Usage

"use client";
import { useMintTokenBatchWithERC20 } from "@tx-kit/hooks";

const MyComponent = () => {
    const { 
        mintTokenBatchWithERC20,
        status, 
        txHash,
        error 
    } = useMintTokenBatchWithERC20()

    const onClick = () => {
        mintTokenBatchWithERC20({ ... })
    }

    return <button onClick={onClick}>Mint Token</button>
}

Returns

mintTokenBatchWithERC20

Function to create a new token. See mintTokenBatchWithERC20 args.

  • type: ({ channelAddress: string; to: string; tokenIds: bigint[]; amounts: number[]; mintReferral: string; data: string; transactionOverrides?: TransactionOverrides; }) => Promise<Log[] | undefined>

status

  • type: ContractExecutionStatus
type ContractExecutionStatus =
  | 'pendingApproval'
  | 'txInProgress'
  | 'complete'
  | 'error'

the status of the transaction

txHash

  • type: string

the transaction hash of the transaction

error

  • type: any

the revert message if the transaction fails