Skip to main content
All wallet operations require an active wallet session. The examples assume an OMSClient instance named oms. React Native wallet, transaction, and signature APIs take chainId as a string, such as 137 for Polygon mainnet or 80002 for Polygon Amoy. Indexer APIs use OmsNetwork values from oms.supportedNetworks, or networkType when you are querying a network group.
const walletAddress = await oms.wallet.getWalletAddress()

if (!walletAddress) {
  throw new Error('No active wallet session')
}

Get Supported Networks

Read networks supported by this SDK build from oms.supportedNetworks.
const networks = oms.supportedNetworks
const amoy = networks.find((network) => network.chainId === '80002')

console.log(amoy?.displayName)
Parameters Takes no parameters. Returns Returns OmsNetwork[].
FieldTypeDescription
chainIdstringEVM chain ID as a string.
namestringNetwork registry name.
nativeTokenSymbolstringNative token symbol.
explorerUrlstringBlock explorer URL.
displayNamestringDisplay name for UI.

Send A Transaction

oms.wallet.sendTransaction sends native tokens when you pass to and value. Values are raw base-unit integer strings.
import { parseUnits } from '@0xsequence/oms-react-native-sdk'

const tx = await oms.wallet.sendTransaction({
  chainId: '80002',
  to: '0x1111111111111111111111111111111111111111',
  value: parseUnits('0.01', 18),
})

console.log(tx.txnHash ?? tx.txnId)
Parameters
ParameterTypeDescription
chainIdstringEVM chain ID as a string.
tostringRecipient address or contract address.
valuestringRaw base-unit native token value.
datastring, null, or undefinedEncoded calldata for contract transactions.
mode'native', 'relayer', or undefinedAdvanced execution option. Omit it for the default behavior.
selectFeeOptionOmsFeeOptionSelector, null, or undefinedOptional callback for selecting a fee option.
waitForStatusboolean or undefinedDefaults to true. Pass false to return immediately after transaction execution starts.
statusPollingOmsTransactionStatusPollingOptions or undefinedOptional post-execute polling controls.
Returns Returns Promise<OmsSendTransactionResponse>.
FieldTypeDescription
txnIdstringWallet transaction ID.
statusstringLatest transaction status returned by OMS Wallet.
txnHashstring or nullOn-chain transaction hash when available.

Send Encoded Calldata

Use data when you already have encoded calldata.
const tx = await oms.wallet.sendTransaction({
  chainId: '80002',
  to: '0x2222222222222222222222222222222222222222',
  value: '0',
  data: '0xa9059cbb000000000000000000000000...',
})

console.log('Contract transaction:', tx.txnHash ?? tx.txnId)
Parameters Use the same oms.wallet.sendTransaction parameters. Returns Returns Promise<OmsSendTransactionResponse>.

Call A Contract

Use oms.wallet.callContract when you want the SDK to submit a method-string contract call.
import { parseUnits } from '@0xsequence/oms-react-native-sdk'

const amount = parseUnits('1', 6)

const tx = await oms.wallet.callContract({
  chainId: '80002',
  contractAddress: '0x2222222222222222222222222222222222222222',
  method: 'transfer(address,uint256)',
  args: [
    { type: 'address', value: '0x1111111111111111111111111111111111111111' },
    { type: 'uint256', value: amount },
  ],
})

console.log('Contract transaction:', tx.txnHash ?? tx.txnId)
Parameters
ParameterTypeDescription
chainIdstringEVM chain ID as a string.
contractAddressstringContract address to call.
methodstringABI method signature, such as transfer(address,uint256).
argsCallContractArg[], null, or undefinedMethod arguments as ABI argument objects.
mode'native', 'relayer', or undefinedAdvanced execution option. Omit it for the default behavior.
selectFeeOptionOmsFeeOptionSelector, null, or undefinedOptional callback for selecting a fee option.
waitForStatusboolean or undefinedDefaults to true. Pass false to return immediately after transaction execution starts.
statusPollingOmsTransactionStatusPollingOptions or undefinedOptional post-execute polling controls.
Returns Returns Promise<OmsSendTransactionResponse>. By default, transaction methods poll for status after execute until the status resolves or the default timeout is reached. Pass waitForStatus: false to return immediately after execute, or pass statusPolling to tune timeoutMs, intervalMs, fastIntervalMs, and fastPollCount.

Select A Fee Option

When OMS Wallet returns fee options, pass selectFeeOption. The selector receives fee options enriched with the wallet balance for each token when available. On testnets, all transactions are sponsored and do not require picking a fee option. Use a first-available selector when you want to choose the first fee option whose availableRaw balance covers the quoted fee value.
import type { OmsFeeOptionSelector } from '@0xsequence/oms-react-native-sdk'

const firstAvailable: OmsFeeOptionSelector = (feeOptions) =>
  feeOptions.find((option) => {
    if (option.availableRaw == null) {
      return false
    }

    return BigInt(option.availableRaw) >= BigInt(option.feeOption.value)
  })?.selection ?? null

const tx = await oms.wallet.sendTransaction({
  chainId: '137',
  to: '0x1111111111111111111111111111111111111111',
  value: '0',
  selectFeeOption: firstAvailable,
})
Return option.selection when choosing a quoted fee option. It uses tokenId when present and falls back to the token symbol for native fee options. Parameters selectFeeOption receives OmsFeeOptionWithBalance[]. Each item includes feeOption, selection, and optional balance fields such as availableRaw. Returns Return OmsFeeOptionSelection, null, or a promise for either value.

Get Transaction Status

Fetch the current status for a wallet transaction ID.
const status = await oms.wallet.getTransactionStatus(tx.txnId)

console.log(status.status, status.txnHash)
Parameters
ParameterTypeDescription
txnIdstringWallet transaction ID returned by oms.wallet.sendTransaction or oms.wallet.callContract.
Returns Returns Promise<OmsTransactionStatus>.
FieldTypeDescription
statusstringLatest Wallet transaction status.
txnHashstring or nullOn-chain transaction hash when available.

Sign A Message

oms.wallet.signMessage returns a hex-encoded signature for the active wallet.
const message = 'Hello from OMS'
const signature = await oms.wallet.signMessage('80002', message)

console.log('Signature:', signature)
Parameters
ParameterTypeDescription
chainIdstringEVM chain ID as a string.
messagestringPlaintext message to sign.
Returns Returns Promise<string>, the hex-encoded signature.

Verify A Message Signature

oms.wallet.verifyMessageSignature verifies a message signature against the active wallet session.
const isValid = await oms.wallet.verifyMessageSignature({
  chainId: '80002',
  message,
  signature,
})

console.log('Signature valid:', isValid)
Parameters
ParameterTypeDescription
chainIdstringEVM chain ID as a string.
messagestringOriginal plaintext message.
signaturestringHex-encoded signature to verify.
Returns Returns Promise<boolean>.

Sign Typed Data

Use oms.wallet.signTypedData for EIP-712 typed data.
const typedData = {
  domain: {
    name: 'Example App',
    version: '1',
    chainId: 80002,
  },
  types: {
    Message: [{ name: 'contents', type: 'string' }],
  },
  primaryType: 'Message',
  message: {
    contents: 'Hello from OMS',
  },
}

const typedSignature = await oms.wallet.signTypedData({
  chainId: '80002',
  typedData,
})
Parameters
ParameterTypeDescription
chainIdstringEVM chain ID as a string.
typedDataunknownEIP-712 typed-data payload. Must be JSON serializable.
Returns Returns Promise<string>, the hex-encoded signature.

Verify Typed Data

Verify an EIP-712 signature against the active wallet session.
const isTypedDataValid = await oms.wallet.verifyTypedDataSignature({
  chainId: '80002',
  typedData,
  signature: typedSignature,
})
Parameters
ParameterTypeDescription
chainIdstringEVM chain ID as a string.
typedDataunknownOriginal EIP-712 typed-data payload. Must be JSON serializable.
signaturestringHex-encoded signature to verify.
Returns Returns Promise<boolean>.

Parse Units

Convert a decimal display value to a raw base-unit integer string.
import { parseUnits } from '@0xsequence/oms-react-native-sdk'

const rawAmount = parseUnits('1.00', 6)

console.log(rawAmount)
Parameters
ParameterTypeDescription
valuestringDecimal display value.
decimalsnumber or undefinedToken decimals. Defaults to 18.
options.roundingMode'reject' or 'nearest'Defaults to 'nearest'. Use 'reject' to fail on non-zero fractional precision beyond decimals.
Returns Returns string.

Format Units

Convert a raw base-unit value to a decimal display string.
import { formatUnits } from '@0xsequence/oms-react-native-sdk'

const displayAmount = formatUnits('1000000', 6)

console.log(displayAmount)
Parameters
ParameterTypeDescription
valuestring or bigintRaw base-unit integer value.
decimalsnumber or undefinedToken decimals. Defaults to 18.
Returns Returns string.