Submits ledger commands and tracks the transaction in lastTx, fed by the SDK's txChanged event. Wagmi: useWriteContract + useWaitForTransactionReceipt, since execute resolves after execution rather than at submission.
lastTx
txChanged
useWriteContract
useWaitForTransactionReceipt
execute
with no CantonConnectProvider above it, and from execute where nothing is connected or the command fails, the failure also landing in error.
error
const { execute, lastTx } = useExecute()await execute({ commandId: 'claim-1', commands })lastTx?.status // 'pending' | 'signed' | 'executed' | 'failed' Copy
const { execute, lastTx } = useExecute()await execute({ commandId: 'claim-1', commands })lastTx?.status // 'pending' | 'signed' | 'executed' | 'failed'
Submits ledger commands and tracks the transaction in
lastTx, fed by the SDK'stxChangedevent. Wagmi:useWriteContract+useWaitForTransactionReceipt, sinceexecuteresolves after execution rather than at submission.