Merge pull request #43 from public-awesome/develop

This commit is contained in:
Jorge Hernandez 2022-10-22 07:40:57 -06:00 committed by GitHub
commit 0350ba5f11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 10 deletions

View File

@ -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)

View File

@ -33,7 +33,7 @@ export interface MinterInstance {
updateMintPrice: (senderAddress: string, price: string) => Promise<string>
setWhitelist: (senderAddress: string, whitelist: string) => Promise<string>
updateStartTime: (senderAddress: string, time: Timestamp) => Promise<string>
updateStartTradingTime: (senderAddress: string, time: Timestamp) => Promise<string>
updateStartTradingTime: (senderAddress: string, time?: Timestamp) => Promise<string>
updatePerAddressLimit: (senderAddress: string, perAddressLimit: number) => Promise<string>
mintTo: (senderAddress: string, recipient: string) => Promise<string>
mintFor: (senderAddress: string, recipient: string, tokenId: number) => Promise<string>
@ -334,12 +334,12 @@ export const minter = (client: SigningCosmWasmClient, txSigner: string): MinterC
return res.transactionHash
}
const updateStartTradingTime = async (senderAddress: string, time: Timestamp): Promise<string> => {
const updateStartTradingTime = async (senderAddress: string, time?: Timestamp): Promise<string> => {
const res = await client.execute(
senderAddress,
contractAddress,
{
update_start_trading_time: { time },
update_start_trading_time: time || null,
},
'auto',
'',

View File

@ -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)

View File

@ -80,11 +80,11 @@ 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'])
const showPriceField = type === 'mint'
const showPriceField = type === 'update_mint_price'
const messages = useMemo(() => contract?.use(contractState.value), [contract, wallet.address, contractState.value])
const payload: DispatchExecuteArgs = {
@ -96,7 +96,7 @@ const MinterExecutePage: NextPage = () => {
messages,
recipient: recipientState.value,
txSigner: wallet.address,
price: priceState.value ? (Number(priceState.value) * 1_000_000).toString() : '0',
price: priceState.value ? priceState.value.toString() : '0',
type,
}
const { isLoading, mutate } = useMutation(