OptionalonCalled after every internal RPC call (simulation, account fetch, send, etc.) whether it succeeded or failed. This provides fine-grained visibility into how long each network round-trip took.
A descriptive label for the RPC call (e.g. 'simulateTransaction',
'getAccount', 'sendTransaction').
Relevant call parameters for correlation (e.g. contract method name).
Wall-clock milliseconds the call took.
OptionalonCalled when a mutating SDK method throws an unexpected exception.
Normal status: 'failed' returns do NOT trigger this; only unhandled
exceptions propagated out of the method do.
The SDK method name.
The caught exception.
Wall-clock milliseconds elapsed before the throw.
OptionalonCalled immediately before a mutating SDK method is executed (before any RPC calls or transaction building takes place).
The SDK method name (e.g. 'fundCAddress').
The parameters passed to the method (sanitised — keypairs are excluded, only plain option objects are forwarded).
OptionalonCalled when a mutating SDK method completes without throwing.
Note: status: 'failed' results still trigger this hook; check
result.status if you want to distinguish submission failures from
network errors.
The SDK method name.
The TransactionResult (or array of results for batch calls).
Wall-clock milliseconds from onTransactionStart to completion.
Lifecycle callbacks that the SDK invokes around every mutating method (state-changing contract calls) and every RPC call.
All hooks are optional — supply only the callbacks you need. Hooks must not throw; any uncaught exception is silently swallowed so that instrumentation never breaks the core SDK flow.
Example