* V2 Sync * v2 sync * Launchpad V2 sync * Update trading start time description * Add explicit_content to CollectionDetails update dependencies * Minor UI changes * Update MintPriceMessage interface * Add symbolState.value to CollectionDetails update dependencies * Add external_link to Collection Details * Remove the tab Instantiate from the minter contract dashboard * Add price check for update_minting_price * Implement dynamic per address limit check * Add checks for trading start time * Update Minter Contract Dashboard Instantiate Tab - 1 * Update Minter Contract Dashboard Instantiate Tab - 2 * Remove Instantiate tab from SG721 Contract Dashboard * Update whitelist contract helpers * Update whitelist instantiate fee wrt member limit Co-authored-by: name-user1 <eray@deuslabs.fi> Co-authored-by: Serkan Reis <serkanreis@gmail.com>
29 lines
895 B
TypeScript
29 lines
895 B
TypeScript
import type { Coin } from '@cosmjs/proto-signing'
|
|
|
|
import type { VendingFactoryInstance } from '../index'
|
|
import { useVendingFactoryContract } from '../index'
|
|
|
|
/** @see {@link VendingFactoryInstance} */
|
|
export interface DispatchExecuteArgs {
|
|
contract: string
|
|
messages?: VendingFactoryInstance
|
|
txSigner: string
|
|
msg: Record<string, unknown>
|
|
funds: Coin[]
|
|
}
|
|
|
|
export const dispatchExecute = async (args: DispatchExecuteArgs) => {
|
|
const { messages, txSigner } = args
|
|
if (!messages) {
|
|
throw new Error('cannot dispatch execute, messages is not defined')
|
|
}
|
|
return messages.createMinter(txSigner, args.msg, args.funds)
|
|
}
|
|
|
|
export const previewExecutePayload = (args: DispatchExecuteArgs) => {
|
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
const { messages } = useVendingFactoryContract()
|
|
const { contract } = args
|
|
return messages(contract)?.createMinter(args.msg)
|
|
}
|