Skip to main content

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 USDC by submitting an ERC-20 transfer contract call from an authenticated embedded wallet.
Start with the quickstart for your SDK first: TypeScript, Swift, or Kotlin.

1. Authenticate

Authenticate the user and resolve an active wallet session before submitting transactions. These snippets use email OTP, matching the quickstart flow.
await oms.wallet.startEmailAuth({ email: 'user@example.com' })

// Show your OTP input, then complete auth with the user-entered code.
const { walletAddress } = await oms.wallet.completeEmailAuth({ code: '123456' })

console.log('Wallet address:', walletAddress)

2. Send USDC

Send USDC by calling the ERC-20 transfer method from the authenticated wallet. USDC uses 6 decimals, so 1.00 USDC is the raw base-unit value 1000000. Replace 0xTokenContract with the USDC contract for the network you are sending on. For Polygon PoS mainnet, native USDC is 0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359. The snippets use Polygon mainnet; to test on Polygon Amoy, switch the network value and use a test ERC-20 contract with 6 decimals.
import { Networks } from '@0xsequence/typescript-sdk'
import { parseUnits, type Abi, type Address } from 'viem'

const usdcContract = '0xTokenContract' as Address
const recipient = '0xRecipient' as Address
const amount = parseUnits('1.00', 6)

const usdcAbi = [
  {
    name: 'transfer',
    type: 'function',
    inputs: [
      { name: 'to', type: 'address' },
      { name: 'amount', type: 'uint256' },
    ],
  },
] as const satisfies Abi

const tx = await oms.wallet.sendTransaction({
  network: Networks.polygon,
  to: usdcContract,
  abi: usdcAbi,
  functionName: 'transfer',
  args: [recipient, amount],
})

console.log('USDC transaction:', tx.txnHash ?? tx.txnId)