Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

useWaitForTransactionReceipt

Usage

import { useSendTransaction, useWaitForTransactionReceipt } from '@ivem/kit-react'
 
const sendTransaction = useSendTransaction()
const { data: receipt, isLoading } = useWaitForTransactionReceipt({
  hash: sendTransaction.data?.hash,
})
 
await sendTransaction.mutateAsync({ to: 'receiver_account', amount: '1.00000000' })

Parameters

  • hash?: string
  • retryCount?: number
  • retryDelay?: number
  • timeout?: number
  • enabled?: boolean

Return Type

  • data: TxReceipt | undefined
  • error: Error | null
  • isLoading: boolean
  • isSuccess: boolean
  • isError: boolean
  • refetch: () => Promise<unknown>

Examples

const { data: receipt } = useWaitForTransactionReceipt({
  hash: sendTransaction.data?.hash,
  enabled: Boolean(sendTransaction.data?.hash),
})
 
console.log(receipt?.status_code)

Related