sendTransaction and callContract are alternate inputs to one lifecycle: prepare, resolve any fee requirement, execute, and wait for status by default.
Send native value
Amounts are raw base-unit integer strings. UseparseUnits to convert display values without floating-point arithmetic.
.relayer, and waitForStatus defaults to true.
Send encoded calldata
UseSendTransactionRequest when you already have calldata. value remains a raw base-unit string.
parseUnits defaults to 18 decimals and rounds excess fractional precision to the nearest base unit. Invalid values and negative decimal counts throw UnitConversionError.
Call an ABI method
UsecallContract when you have a method signature and typed arguments instead of encoded calldata.
Send a Solana transfer
UsesendSolanaTransfer with a selected Solana wallet. Set asset to SOL for a native transfer or to an SPL token mint address. amount is an integer string in the asset’s smallest unit: lamports for SOL or base units for an SPL token.
to is the recipient wallet address, not an associated token account. Solana transfers accept the same execution mode, fee selector, wait setting, and polling options.
Resolve fees during preparation
Preparation tells the SDK whether the transaction is sponsored. When you provide a selector, a sponsored preparation calls it with an empty array. Returnnil to continue with the sponsored transaction, or throw to stop execution. .firstAvailable handles the empty array. An unsponsored preparation must include fee options.
Whether a transaction is sponsored is decided by your project’s settings, not by your application. See Gas Sponsorship.
With no selector, the SDK chooses the first fee option returned by OMS. This default does not compare the option with the wallet’s balance.
Use .firstAvailable to query indexer balances and choose the first option whose raw available balance covers its quoted fee.
FeeOptionWithBalance.availableRaw is the base-unit balance used for comparison. available is formatted for display when token decimals are known.
These fee-selection examples use Polygon mainnet. Fund the wallet for any returned fee option your app selects.
Interpret the result
SendTransactionResponse always contains the OMS txnId, the latest status, and statusResolution. txnHash is optional until an onchain hash is available.
A resolved result can still have
status == .failed. Check both status and resolution.
Return after execution
SetwaitForStatus: false when your app wants to persist txnId immediately after the execute call and manage status separately.
getTransactionStatus also requires the active wallet session and credential.
To change the default wait, pass TransactionStatusPollingOptions. The SDK defaults to a 60-second timeout, uses short initial intervals, and then polls every two seconds.
Handle uncertain execution and cancellation
The SDK preservesCancellationError instead of wrapping it. Cancelling a Swift task stops the local SDK operation or status wait. It does not cancel a transaction that may already have been submitted. When your UI needs a cancellable wait with a durable identifier, submit with waitForStatus: false, persist txnId, and poll in a separate task.
Transaction-specific OMSWalletError codes carry recovery context:
.transactionExecutionUnconfirmed; the original transaction may have been submitted.