Connect React SDK
Transactions
Sending a transaction in react is done via the useSendTransaction hook. The hook returns a React Query mutate function that you can call with a transaction object created with prepareContractCall or prepareTransaction.
Note that unlike in TypeScript core, useSendTransaction does not require passing the active Account, it will used the current active account from the React context.
Try out the demo for yourself in the sending transactions playground
Extensions are a way to make complex transactions in a type-safe way with a simple API.
Check out all the available extensions for more details.
Check out the transaction hooks reference for more details.
useSendTransaction
Hook to send transactions
useWaitForReceipt
Hook to wait for a transaction receipt
useSendAndConfirmTransaction
Hook to send and confirm transactions
useSimulateTransaction
Hook to simulate transactions
useEstimateGas
Hook to estimate gas units of a transaction
useEstimateGasCost
Hook to estimate gas cost of a transaction
useSendBatchTransaction
Hook to send a batch of transactions