sendTransaction and callContract are two input forms for the same lifecycle. Both require an active selected wallet and a supported Network.
- The SDK prepares the request with OMS.
- The preparation response either marks it sponsored or supplies fee options.
- The SDK executes the prepared transaction with the applicable fee selection.
- By default, the SDK polls until status resolves or the polling timeout expires.
Send native value
Values are non-negative raw base-unit integers. UseparseUnits to convert a display amount.
parseUnits rounds fractional precision beyond decimals to the nearest base unit and requires a non-negative decimal count.
Send encoded calldata
Use the request overload when you already have calldata or need to set the transaction mode:SendTransactionRequest.mode defaults to TransactionMode.Relayer. This mode is an execution input; it does not by itself promise sponsorship.
Call a contract by method and arguments
UsecallContract when you have an ABI method signature and argument values rather than encoded calldata:
sendTransaction.
Resolve sponsorship and fees
Testnet transaction fees are sponsored. On mainnet, OMS reports whether each prepared transaction is sponsored or requires a fee option. When the response is sponsored, the SDK executes without a fee selection and does not call your selector. For an unsponsored response:- No selector: the SDK submits the first returned fee option.
FeeOptionSelector.firstAvailable: the SDK chooses the first option whose known raw balance covers its quoted fee.- Custom selector: your callback returns a
FeeOptionSelectionfrom the available options. - No fee options, or a selector returning
null: the SDK fails before execution.
FeeOptionWithBalance values:
balance, available, availableRaw, or decimals when data is unavailable or the enrichment request fails. firstAvailable only selects an option when availableRaw is present and sufficient. It does not make an independent balance request or guarantee that execution will accept the fee.
Understand the returned status
SendTransactionResponse contains:
With the default
waitForStatus = true, the SDK polls immediately after execution. It sets statusResolution = Resolved when status becomes Executed or Failed, or when OMS returns a nonblank transaction hash. A resolved response can therefore still report Pending when its hash is already available.
If the timeout expires first, the response uses TimedOut and preserves the latest status and any hash. Timeout does not mean failure. Continue with getTransactionStatus(txnId).
Set waitForStatus = false to return directly after execute:
txnHash = null; fetch status to obtain a later hash. getTransactionStatus returns the current status and nullable txnHash but does not add a statusResolution value.
To tune waiting, pass TransactionStatusPollingOptions. Its defaults are fastPollCount = 5, fastPollIntervalMillis = 400, pollIntervalMillis = 2_000, and timeoutMillis = 60_000.
Handle interruption and uncertain execution
Coroutine cancellation stops the local SDK call or status polling. It is not an onchain cancellation and does not cancel a transaction that OMS may already have accepted for execution. UsewaitForStatus = false when you need the SDK to return after execute instead of canceling a waiting coroutine.
When execute fails before the SDK can confirm submission, it throws OMSWalletTransactionException with code = TransactionExecutionUnconfirmed and the prepared txnId. Do not automatically submit the write again because the first attempt may have reached OMS.
When post-submit status polling fails, the exception uses TransactionStatusLookupFailed, includes txnId, and is retryable through getTransactionStatus.