> ## Documentation Index
> Fetch the complete documentation index at: https://docs.polygon.technology/llms.txt
> Use this file to discover all available pages before exploring further.

# Send transactions with React Native

> Send EVM transactions, Solana transfers, and Tron transactions through one transaction lifecycle.

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:

```typescript theme={null}
import {
  Networks,
  parseUnits,
} from '@polygonlabs/oms-wallet-react-native'

const transaction = await omsWallet.wallet.sendTransaction({
  network: Networks.amoy,
  to: '0x1111111111111111111111111111111111111111',
  value: parseUnits('0.01', 18),
})
```

`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:

```typescript theme={null}
const transaction = await omsWallet.wallet.sendTransaction({
  network: Networks.amoy,
  to: '0x2222222222222222222222222222222222222222',
  value: '0',
  data: '0x095ea7b300000000000000000000000011111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000001',
})
```

## Call a contract by method

Use `callContract` when you have a method name and typed argument values instead of encoded calldata. `method` is the bare function name, such as `'transfer'`, and `args` is an ordered list of `{ type, value }` pairs in parameter order. The wallet service builds the signature from the `args` types; a full signature such as `'transfer(address,uint256)'` rejects with `OMS_VALIDATION_ERROR` before any request:

```typescript theme={null}
const transaction = await omsWallet.wallet.callContract({
  network: Networks.amoy,
  contractAddress: '0x2222222222222222222222222222222222222222',
  method: 'transfer',
  args: [
    {
      type: 'address',
      value: '0x1111111111111111111111111111111111111111',
    },
    { type: 'uint256', value: parseUnits('1', 6) },
  ],
})
```

`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.

```typescript theme={null}
import { SolanaNetworks } from '@polygonlabs/oms-wallet-react-native'

const transaction = await omsWallet.wallet.sendSolanaTransfer({
  network: SolanaNetworks.devnet,
  asset: 'SOL',
  to: '3gFktQX6vki5M2DzN8Y1ESPUJ4fJ8o6hVQWf8vYvPypD',
  amount: '1000000',
})
```

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.

## Send a Tron transaction

Use `sendTronTransaction` for TRX transfers and `callTronContract` for TRC-20 and other contract calls. Both require an active Tron wallet session and a `TronNetworks` value. Tron addresses are Base58Check strings that start with `T`.

```typescript theme={null}
import { TronNetworks } from '@polygonlabs/oms-wallet-react-native'

const trxTransfer = await omsWallet.wallet.sendTronTransaction({
  network: TronNetworks.nile,
  to: 'TBXSw8fM4jpQkGc6zZjsVABFpVN7UvXPdV',
  value: '1000000', // 1 TRX in sun
})

const trc20Transfer = await omsWallet.wallet.callTronContract({
  network: TronNetworks.nile,
  contractAddress: 'TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf',
  method: 'transfer',
  args: [
    { type: 'address', value: 'TBXSw8fM4jpQkGc6zZjsVABFpVN7UvXPdV' },
    { type: 'uint256', value: '1000000' },
  ],
})
```

`value` is a decimal string in sun (1 TRX is 1,000,000 sun). `callTronContract` takes a bare function name and lets the wallet service ABI-encode the arguments; address arguments accept Base58Check addresses. TRC-10 tokens are not supported.

Tron transactions take no `mode`. Each Tron account gets free bandwidth every day, so many Tron transactions need no fee; when it is used up, the fee is a single TRX option that your fee selector receives like any other.

## 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](https://docs.polygon.technology/wallets/gas-sponsorship.md).

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:

```typescript theme={null}
import { FeeOptionSelectors, Networks } from '@polygonlabs/oms-wallet-react-native'

const transaction = await omsWallet.wallet.sendTransaction({
  network: Networks.polygon,
  to: '0x1111111111111111111111111111111111111111',
  value: '0',
  selectFeeOption: FeeOptionSelectors.firstAvailable,
})
```

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:

```typescript theme={null}
const transaction = await omsWallet.wallet.sendTransaction({
  network: Networks.polygon,
  to: '0x1111111111111111111111111111111111111111',
  value: '0',
  selectFeeOption: (options) =>
    options.find((option) => option.feeOption.token.symbol === 'USDC')
      ?.selection,
})
```

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:

| Field | Type | Meaning | | | | |
| - | - | - | - | - | - | - |
| `txnId` | `string` | Wallet transaction ID. Preserve it for status checks. | | | | |
| `status` | \`'quoted' | 'pending' | 'executed' | 'failed' | 'unknown'\` | Latest known status. |
| `txnHash` | \`string | undefined\` | Onchain hash when one is available. | | | |
| `statusResolution` | \`'not-requested' | 'resolved' | 'timed-out'\` | Outcome of post-submit status waiting. | | |

`waitForStatus` defaults to `true`. A timed-out status resolution does not remove `txnId`; check that ID before retrying the write.

## Handle failures

* `OMS_TRANSACTION_EXECUTION_UNCONFIRMED`, with a `txnId`: the SDK cannot tell whether the transaction was submitted. Check its status with the `txnId` before sending it again.
* `OMS_REQUEST_FAILED` without a `txnId`: nothing was submitted. For example, simulation shows the transaction would revert, or a Tron wallet cannot cover the transfer and its fee. `upstreamError.cause` gives the wallet API's reason when it has one. Fix the cause before sending again.
* `OMS_SESSION_EXPIRED`: the session ended. Sign in again.

## Control status waiting

Return after submission without waiting:

```typescript theme={null}
const transaction = await omsWallet.wallet.sendTransaction({
  network: Networks.amoy,
  to: '0x1111111111111111111111111111111111111111',
  value: '0',
  waitForStatus: false,
})
```

Check the latest status later:

```typescript theme={null}
const latest = await omsWallet.wallet.getTransactionStatus(transaction.txnId)
console.log(latest.status, latest.txnHash)
```

Override polling only when the default wait behavior does not fit your UI:

```typescript theme={null}
const transaction = await omsWallet.wallet.sendTransaction({
  network: Networks.amoy,
  to: '0x1111111111111111111111111111111111111111',
  value: '0',
  statusPolling: {
    timeoutMs: 120000,
    intervalMs: 3000,
    fastIntervalMs: 500,
    fastPollCount: 6,
  },
})
```

Message and typed-data signatures do not submit transactions. Use [sign and verify](https://docs.polygon.technology/wallets/sdk/react-native/sign-and-verify.md) for those operations.
