Skip to main content
Transaction operations require an active wallet session. sendTransaction and callContract are alternate input forms for the same prepare, fee, execute, and status lifecycle.

Send a native transfer

Pass an exported network, a recipient, and a raw base-unit value:
parseUnits returns an integer string. Use the transferred token’s decimals when converting user-facing values. It rounds excess fractional precision to the nearest base unit by default; pass { roundingMode: 'reject' } when the input must match that precision exactly.

Use encoded calldata

Use the same method when your app already has encoded calldata. Set value to the native-token amount sent with the call:

Call a contract by method

Use callContract when you have a method signature and typed argument values instead of encoded calldata:
callContract accepts the same execution mode, fee selector, wait setting, and polling options as sendTransaction.

Send a Solana transfer

Use sendSolanaTransfer with a selected Solana wallet. Set asset to SOL for a native transfer or to an SPL token mint address. amount is a string in the asset’s smallest unit: lamports for SOL or base units for an SPL token.
For an SPL transfer, 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.

Understand the lifecycle

Both methods perform one lifecycle:
1

Prepare

The SDK resolves the transaction input for the selected network and obtains the execution quote.
2

Resolve fees

When a selector is provided, sponsored transactions call it with an empty array. Unsponsored transactions pass the quoted fee options.
3

Execute

The SDK submits the prepared wallet transaction and returns its txnId.
4

Wait for status

By default, the method polls until status resolves or polling times out. An onchain txnHash appears when available.
Leave mode undefined to use the SDK’s default execution behavior. Set 'native' or 'relayer' only when your application explicitly controls that choice.

Select a fee

Whether a transaction is sponsored is decided by your project’s settings, not by your application. See Gas Sponsorship. When you provide a selector, a sponsored transaction calls it with an empty array. Return undefined to continue with the sponsored transaction, or throw to stop execution. FeeOptionSelectors.firstAvailable handles the empty array. For a non-sponsored mainnet transaction, the built-in selector chooses the first quoted token whose raw available balance covers the fee:
If you omit selectFeeOption, the SDK uses the first option returned by OMS without checking whether the wallet can afford it. For custom selection, return an option’s selection. This example prefers a quoted USDC fee and returns undefined when none is available:
Each option contains feeOption, selection, and optional balance and available-amount fields. The callback can return synchronously or as a promise.

Read the result

Both transaction methods return: waitForStatus defaults to true. A timed-out status resolution does not remove txnId; check that ID before retrying the write.

Control status waiting

Return after submission without waiting:
Check the latest status later:
Override polling only when the default wait behavior does not fit your UI:
Message and typed-data signatures do not submit transactions. Use sign and verify for those operations.