Skip to main content
Parameter types define the input interfaces for all SDK operations including bridge, swap, execute, and transfer methods.

Bridge operations

BridgeParams

Parameters for bridging tokens between chains.
token
string
required
Token symbol to bridge. Supported tokens: ETH, USDC, USDT, USDM
amount
bigint
required
Amount in smallest unit (atomic units). For example, 100 USDC with 6 decimals = 100_000_000n
toChainId
number
required
Destination chain ID. See Supported Networks for available chains
recipient
Hex
Recipient address on destination chain. Defaults to connected wallet address if omitted
sourceChains
number[]
Specific source chain IDs to use for bridging. Auto-selected if omitted
gas
bigint
Gas amount to supply on destination chain for contract execution
const params: BridgeParams = {
  token: 'USDC',
  amount: 100_000_000n, // 100 USDC
  toChainId: 137, // Polygon
};

TransferParams

Parameters for bridge-and-transfer operations.
token
string
required
Token symbol to transfer
amount
bigint
required
Amount in atomic units
toChainId
number
required
Destination chain ID
recipient
Hex
required
Recipient address (required for transfers)
sourceChains
number[]
Specific source chains to use
const params: TransferParams = {
  token: 'USDC',
  amount: 50_000_000n,
  toChainId: 42161,
  recipient: '0x742d35Cc6634C0532925a3b8D4C9db96c4b4Db45',
};

Execute operations

ExecuteParams

Parameters for executing smart contract calls on a destination chain.
toChainId
number
required
Target chain ID for contract execution
to
Hex
required
Contract address to call
data
Hex
Encoded function call data
value
bigint
Native token value to send with transaction (in wei)
gas
bigint
Gas limit for the transaction
gasPrice
'low' | 'medium' | 'high'
Gas price strategy selector
waitForReceipt
boolean
Wait for transaction receipt before returning. Default: false
receiptTimeout
number
Receipt wait timeout in milliseconds. Default: 60000
requiredConfirmations
number
Required block confirmations. Default: 1
tokenApproval
object
Token approval configuration for ERC-20 tokens
const params: ExecuteParams = {
  toChainId: 1,
  to: '0xContractAddress',
  data: '0x...', // Encoded function call
};

BridgeAndExecuteParams

Parameters for bridging tokens and executing a contract call.
token
string
required
Token to bridge
amount
bigint
required
Amount to bridge in atomic units
toChainId
number
required
Destination chain ID
sourceChains
number[]
Source chains to use for bridging
execute
Omit<ExecuteParams, 'toChainId'>
required
Contract execution parameters (excluding toChainId which is inherited from parent)
const params: BridgeAndExecuteParams = {
  token: 'USDC',
  amount: 100_000_000n,
  toChainId: 1,
  sourceChains: [8453],
  execute: {
    to: '0xDeFiProtocol',
    data: '0x...', // deposit() call
    tokenApproval: {
      token: 'USDC',
      amount: 100_000_000n,
      spender: '0xDeFiProtocol',
    },
  },
};

Swap operations

ExactInSwapInput

Parameters for swapping with exact input amounts.
from
object[]
required
Array of source tokens and amounts to swap
toChainId
number
required
Destination chain ID
toTokenAddress
Hex
required
Output token contract address
const input: ExactInSwapInput = {
  from: [
    {
      chainId: 10, // Optimism
      amount: 1_000_000n,
      tokenAddress: '0xUSDC...',
    },
    {
      chainId: 42161, // Arbitrum
      amount: 500_000n,
      tokenAddress: '0xUSDC...',
    },
  ],
  toChainId: 8453, // Base
  toTokenAddress: '0xETH...',
};

ExactOutSwapInput

Parameters for swapping with exact output amount.
toChainId
number
required
Destination chain ID
toTokenAddress
Hex
required
Output token contract address
toAmount
bigint
required
Exact output amount desired in atomic units
fromSources
object[]
Optional array to restrict source chains and tokens for routing
toNativeAmount
bigint
Optional native gas amount for destination chain
const input: ExactOutSwapInput = {
  toChainId: 8453,
  toTokenAddress: '0xETH...',
  toAmount: 1_000_000_000_000_000_000n, // 1 ETH
};

Callback parameters

OnEventParam

Event callback configuration for operation progress tracking.
onEvent
function
Callback function invoked for operation progress eventsSignature: (event: EventUnion) => voidWhere EventUnion is:
  • { name: 'STEPS_LIST', args: BridgeStepType[] }
  • { name: 'STEP_COMPLETE', args: BridgeStepType }
  • { name: 'SWAP_STEP_COMPLETE', args: SwapStepType }
{
  onEvent: (event) => {
    if (event.name === 'STEPS_LIST') {
      console.log('All steps:', event.args);
    }
    if (event.name === 'STEP_COMPLETE') {
      console.log('Step complete:', event.args);
    }
  }
}

Build docs developers (and LLMs) love