Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Token Requests – 1auth
Skip to content

Token Requests

Token requests enable the output-first model for crosschain transactions. Instead of specifying which tokens to spend (input), you specify what tokens you need to receive (output). The orchestrator automatically finds the optimal route to deliver those tokens.

Why output-first?

Traditional blockchain transactions require you to:

  1. Know exactly which token to spend
  2. Calculate swap rates and slippage
  3. Handle bridging between chains
  4. Manage gas tokens on each chain

With token requests, you simply say "I need 100 USDC on Base" and the orchestrator handles everything else.

Benefits

  • Simpler UX - Users don't need to think about routing or bridging
  • Optimal routing - Orchestrator finds the cheapest path across all chains
  • Flexible funding - Uses whatever assets the user has available
  • Single signature - User signs once with their passkey

Using token requests

Add tokenRequests to your sendCalls to specify what tokens you need:

How it works

When you include tokenRequests:

  1. Orchestrator analyzes the user's balances across all supported chains
  2. Finds optimal route - cheapest combination of bridges and swaps
  3. Executes atomically - bridging, swapping, and your calls all succeed or fail together
  4. Delivers tokens - the requested tokens arrive on the target chain before your calls execute

TokenRequest object

FieldTypeDescription
tokenstringERC-20 token contract address on the target chain
amountbigintAmount in base units (e.g., parseUnits('100', 6) for 100 USDC)

Multiple token requests

You can request multiple tokens in a single transaction:

sendCalls({
  calls: [{ to: '0x...', data: '0x...' }],
  chainId: 8453,
  tokenRequests: [
    {
      token: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', // USDC
      amount: parseUnits('100', 6),
    },
    {
      token: '0x4200000000000000000000000000000000000006', // WETH
      amount: parseUnits('0.05', 18),
    },
  ],
})

Common use cases

E-commerce checkout

User wants to buy an item priced in USDC, but only has ETH on mainnet:

sendCalls({
  calls: [{
    to: SHOP_CONTRACT,
    data: encodeFunctionData({
      abi: shopAbi,
      functionName: 'purchase',
      args: [itemId],
    }),
  }],
  chainId: 8453, // Shop is on Base
  tokenRequests: [{
    token: USDC_BASE,
    amount: parseUnits('29.99', 6), // Item price
  }],
})

DeFi interactions

Provide liquidity with tokens from any chain:

sendCalls({
  calls: [{
    to: LP_CONTRACT,
    data: encodeFunctionData({
      abi: lpAbi,
      functionName: 'addLiquidity',
      args: [amount0, amount1],
    }),
  }],
  chainId: 42161, // Arbitrum
  tokenRequests: [
    { token: USDC_ARB, amount: parseUnits('1000', 6) },
    { token: WETH_ARB, amount: parseUnits('0.5', 18) },
  ],
})

NFT minting

Mint an NFT with payment in any token:

sendCalls({
  calls: [{
    to: NFT_CONTRACT,
    data: encodeFunctionData({
      abi: nftAbi,
      functionName: 'mint',
      args: [tokenId],
    }),
  }],
  chainId: 8453,
  tokenRequests: [{
    token: USDC_BASE,
    amount: parseUnits('0.5', 6), // Mint price
  }],
})

Next steps