diff --git a/components/collections/actions/actions.ts b/components/collections/actions/actions.ts index 588e8d8..af174cf 100644 --- a/components/collections/actions/actions.ts +++ b/components/collections/actions/actions.ts @@ -149,7 +149,7 @@ export type DispatchExecuteArgs = { | { type: Select<'batch_mint'>; recipient: string; batchNumber: number } | { type: Select<'set_whitelist'>; whitelist: string } | { type: Select<'update_start_time'>; startTime: string } - | { type: Select<'update_start_trading_time'>; startTime: string } + | { type: Select<'update_start_trading_time'>; startTime?: string } | { type: Select<'update_per_address_limit'>; limit: number } | { type: Select<'shuffle'> } | { type: Select<'withdraw'> } @@ -259,7 +259,7 @@ export const previewExecutePayload = (args: DispatchExecuteArgs) => { return minterMessages(minterContract)?.updateStartTime(args.startTime) } case 'update_start_trading_time': { - return minterMessages(minterContract)?.updateStartTradingTime(args.startTime) + return minterMessages(minterContract)?.updateStartTradingTime(args.startTime as string) } case 'update_per_address_limit': { return minterMessages(minterContract)?.updatePerAddressLimit(args.limit) diff --git a/contracts/minter/contract.ts b/contracts/minter/contract.ts index eb77006..db89d9e 100644 --- a/contracts/minter/contract.ts +++ b/contracts/minter/contract.ts @@ -33,7 +33,7 @@ export interface MinterInstance { updateMintPrice: (senderAddress: string, price: string) => Promise setWhitelist: (senderAddress: string, whitelist: string) => Promise updateStartTime: (senderAddress: string, time: Timestamp) => Promise - updateStartTradingTime: (senderAddress: string, time: Timestamp) => Promise + updateStartTradingTime: (senderAddress: string, time?: Timestamp) => Promise updatePerAddressLimit: (senderAddress: string, perAddressLimit: number) => Promise mintTo: (senderAddress: string, recipient: string) => Promise mintFor: (senderAddress: string, recipient: string, tokenId: number) => Promise @@ -325,7 +325,7 @@ export const minter = (client: SigningCosmWasmClient, txSigner: string): MinterC senderAddress, contractAddress, { - update_start_time: { time }, + update_start_time: time, }, 'auto', '', @@ -334,12 +334,12 @@ export const minter = (client: SigningCosmWasmClient, txSigner: string): MinterC return res.transactionHash } - const updateStartTradingTime = async (senderAddress: string, time: Timestamp): Promise => { + const updateStartTradingTime = async (senderAddress: string, time?: Timestamp): Promise => { const res = await client.execute( senderAddress, contractAddress, { - update_start_trading_time: { time }, + update_start_trading_time: time || null, }, 'auto', '', diff --git a/contracts/minter/messages/execute.ts b/contracts/minter/messages/execute.ts index b57f45b..f2f072f 100644 --- a/contracts/minter/messages/execute.ts +++ b/contracts/minter/messages/execute.ts @@ -101,7 +101,7 @@ export type DispatchExecuteArgs = { | { type: Select<'update_mint_price'>; price: string } | { type: Select<'set_whitelist'>; whitelist: string } | { type: Select<'update_start_time'>; startTime: string } - | { type: Select<'update_start_trading_time'>; startTime: string } + | { type: Select<'update_start_trading_time'>; startTime?: string } | { type: Select<'update_per_address_limit'>; limit: number } | { type: Select<'mint_to'>; recipient: string } | { type: Select<'mint_for'>; recipient: string; tokenId: number } @@ -179,7 +179,7 @@ export const previewExecutePayload = (args: DispatchExecuteArgs) => { return messages(contract)?.updateStartTime(args.startTime) } case 'update_start_trading_time': { - return messages(contract)?.updateStartTradingTime(args.startTime) + return messages(contract)?.updateStartTradingTime(args.startTime as string) } case 'update_per_address_limit': { return messages(contract)?.updatePerAddressLimit(args.limit) diff --git a/pages/contracts/minter/execute.tsx b/pages/contracts/minter/execute.tsx index 15747ec..302854f 100644 --- a/pages/contracts/minter/execute.tsx +++ b/pages/contracts/minter/execute.tsx @@ -80,7 +80,7 @@ const MinterExecutePage: NextPage = () => { }) const showWhitelistField = type === 'set_whitelist' - const showDateField = type === 'update_start_time' + const showDateField = isEitherType(type, ['update_start_time', 'update_start_trading_time']) const showLimitField = type === 'update_per_address_limit' const showTokenIdField = type === 'mint_for' const showRecipientField = isEitherType(type, ['mint_to', 'mint_for'])