Update dispatcher logic for Vending Minter actions
This commit is contained in:
parent
58a186e2ab
commit
a09d59887c
@ -13,6 +13,8 @@ export const ACTION_TYPES = [
|
||||
'mint_token_uri',
|
||||
'purge',
|
||||
'update_mint_price',
|
||||
'update_discount_price',
|
||||
'remove_discount_price',
|
||||
'mint_to',
|
||||
'mint_for',
|
||||
'batch_mint',
|
||||
@ -87,16 +89,21 @@ export const VENDING_ACTION_LIST: ActionListItem[] = [
|
||||
name: 'Mint',
|
||||
description: `Mint a token`,
|
||||
},
|
||||
{
|
||||
id: 'purge',
|
||||
name: 'Purge',
|
||||
description: `Purge`,
|
||||
},
|
||||
{
|
||||
id: 'update_mint_price',
|
||||
name: 'Update Mint Price',
|
||||
description: `Update mint price`,
|
||||
},
|
||||
{
|
||||
id: 'update_discount_price',
|
||||
name: 'Update Discount Price',
|
||||
description: `Update discount price`,
|
||||
},
|
||||
{
|
||||
id: 'remove_discount_price',
|
||||
name: 'Remove Discount Price',
|
||||
description: `Remove discount price`,
|
||||
},
|
||||
{
|
||||
id: 'mint_to',
|
||||
name: 'Mint To',
|
||||
@ -182,6 +189,11 @@ export const VENDING_ACTION_LIST: ActionListItem[] = [
|
||||
name: 'Burn Remaining Tokens',
|
||||
description: 'Burn remaining tokens',
|
||||
},
|
||||
{
|
||||
id: 'purge',
|
||||
name: 'Purge',
|
||||
description: `Purge`,
|
||||
},
|
||||
]
|
||||
|
||||
export interface DispatchExecuteProps {
|
||||
@ -205,6 +217,8 @@ export type DispatchExecuteArgs = {
|
||||
| { type: Select<'mint_token_uri'>; tokenUri: string }
|
||||
| { type: Select<'purge'> }
|
||||
| { type: Select<'update_mint_price'>; price: string }
|
||||
| { type: Select<'update_discount_price'>; price: string }
|
||||
| { type: Select<'remove_discount_price'> }
|
||||
| { type: Select<'mint_to'>; recipient: string }
|
||||
| { type: Select<'mint_for'>; recipient: string; tokenId: number }
|
||||
| { type: Select<'batch_mint'>; recipient: string; batchNumber: number }
|
||||
@ -242,6 +256,12 @@ export const dispatchExecute = async (args: DispatchExecuteArgs) => {
|
||||
case 'update_mint_price': {
|
||||
return vendingMinterMessages.updateMintPrice(txSigner, args.price)
|
||||
}
|
||||
case 'update_discount_price': {
|
||||
return vendingMinterMessages.updateDiscountPrice(txSigner, args.price)
|
||||
}
|
||||
case 'remove_discount_price': {
|
||||
return vendingMinterMessages.removeDiscountPrice(txSigner)
|
||||
}
|
||||
case 'mint_to': {
|
||||
return vendingMinterMessages.mintTo(txSigner, args.recipient)
|
||||
}
|
||||
@ -320,6 +340,12 @@ export const previewExecutePayload = (args: DispatchExecuteArgs) => {
|
||||
case 'update_mint_price': {
|
||||
return vendingMinterMessages(minterContract)?.updateMintPrice(args.price)
|
||||
}
|
||||
case 'update_discount_price': {
|
||||
return vendingMinterMessages(minterContract)?.updateDiscountPrice(args.price)
|
||||
}
|
||||
case 'remove_discount_price': {
|
||||
return vendingMinterMessages(minterContract)?.removeDiscountPrice()
|
||||
}
|
||||
case 'mint_to': {
|
||||
return vendingMinterMessages(minterContract)?.mintTo(args.recipient)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user