Batch minting (#30)

* Bach Mint

* Add mint_for for batch minting

* Batch minting with mint to function with given number

* Minor fixes

* Update components/collections/actions/actions.ts

Co-authored-by: name-user1 <eray@deuslabs.fi>
Co-authored-by: Serkan Reis <serkanreis@gmail.com>
Co-authored-by: Arda Nakışçı <anakisci@gmail.com>
This commit is contained in:
name-user1
2022-08-10 10:25:23 +03:00
committed by GitHub
co-authored by name-user1 Serkan Reis Arda Nakışçı
parent 823b8c04f5
commit c994411dfb
3 changed files with 74 additions and 2 deletions
+13
View File
@@ -8,6 +8,7 @@ export type ActionType = typeof ACTION_TYPES[number]
export const ACTION_TYPES = [
'mint_to',
'mint_for',
'batch_mint',
'set_whitelist',
'update_start_time',
'update_per_address_limit',
@@ -33,6 +34,11 @@ export const ACTION_LIST: ActionListItem[] = [
name: 'Mint For',
description: `Mint a token for a user with given token ID`,
},
{
id: 'batch_mint',
name: 'Batch Mint',
description: `Mint multiple tokens to a user with given token amount`,
},
{
id: 'set_whitelist',
name: 'Set Whitelist',
@@ -83,6 +89,7 @@ export type DispatchExecuteArgs = {
| { type: undefined }
| { type: Select<'mint_to'>; recipient: string }
| { type: Select<'mint_for'>; recipient: string; tokenId: number }
| { type: Select<'batch_mint'>; recipient: string; batchNumber: number }
| { type: Select<'set_whitelist'>; whitelist: string }
| { type: Select<'update_start_time'>; startTime: string }
| { type: Select<'update_per_address_limit'>; limit: number }
@@ -103,6 +110,9 @@ export const dispatchExecute = async (args: DispatchExecuteArgs) => {
case 'mint_for': {
return minterMessages.mintFor(txSigner, args.recipient, args.tokenId)
}
case 'batch_mint': {
return minterMessages.batchMint(txSigner, args.recipient, args.batchNumber)
}
case 'set_whitelist': {
return minterMessages.setWhitelist(txSigner, args.whitelist)
}
@@ -140,6 +150,9 @@ export const previewExecutePayload = (args: DispatchExecuteArgs) => {
case 'mint_for': {
return minterMessages()?.mintFor(minterContract, args.recipient, args.tokenId)
}
case 'batch_mint': {
return minterMessages()?.batchMint(minterContract, args.recipient, args.batchNumber)
}
case 'set_whitelist': {
return minterMessages()?.setWhitelist(minterContract, args.whitelist)
}