Contract calls enable you to execute any smart contract operation using your aggregated balance. This powerful feature allows for complex DeFi operations, NFT interactions, gaming actions, and custom business logic - all while benefiting from unified asset management.

What Are Contract Calls?

Contract calls let you interact with smart contracts on any supported chain while OneBalance handles:

  • Cross-chain token routing - Use tokens from any chain to pay for operations
  • Automatic gas abstraction - No need to hold native tokens on target chains
  • Token approvals - Automatic ERC20 approvals when needed
  • Transaction bundling - Multiple operations in a single user experience

Account Configuration Required: Contract calls require proper account setup. Choose your account model based on your security and operational needs. See Account Models for setup instructions.

Quick Example

Here’s how to transfer USDC on Arbitrum using funds from your aggregated balance:

Terminal
curl -X POST "https://be.onebalance.io/api/quotes/prepare-call-quote" \
  -H "x-api-key: ONEBALANCE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "account": {
      "sessionAddress": "0x1cBF...",
      "adminAddress": "0xc162...",
      "accountAddress": "0xE202..."
    },
    "targetChain": "eip155:42161",
    "calls": [{
      "to": "0xaf88d065e77c8cc2239327c5edb3a432268e5831",
      "data": "0xa9059cbb000000000000000000000000742d35cc6634c0532925a3b844bc454e4438f44e0000000000000000000000000000000000000000000000000000000005f5e100",
      "value": "0x0"
    }],
    "tokensRequired": [{
      "assetType": "eip155:42161/erc20:0xaf88d065e77c8cc2239327c5edb3a432268e5831",
      "amount": "100000000"
    }],
    "allowanceRequirements": []
  }'

How It Works

OneBalance contract calls are executed through a three-phase process that handles all the complexity behind the scenes.

Phase Breakdown

  1. Prepare Quote - Submit your contract calls and requirements to get executable operations. OneBalance analyzes your requirements, generates user operations, and calculates optimal routing across chains.
  2. Sign Operations - Sign the generated user operations with your wallet. This happens client-side using standard EIP-712 typed data signatures.
  3. Execute - OneBalance coordinates cross-chain execution and settlement, handling token transfers, bridging, and smart contract calls automatically.

Detailed Flow

For those interested in the technical details, here’s the complete execution flow:

Each phase uses specific API endpoints:

Common Use Cases

Token Operations

Cross-chain transfers, swaps, and token management

DeFi Protocols

Lending, borrowing, staking, and yield farming

NFT Interactions

Minting, trading, and marketplace operations

DAO Governance

Proposal voting and treasury management

Real-World Examples

  • Cross-chain DEX Trading - Use USDC from Polygon to trade on Uniswap on Base
  • Multi-chain Staking - Stake ETH on Ethereum using tokens from your Arbitrum balance
  • NFT Minting - Mint NFTs on any chain using your unified token balance
  • DAO Participation - Vote on proposals using tokens from multiple chains

Benefits

Unified Experience

One API for all chains and protocols

Gas Efficiency

Optimized routing and batched operations

Enhanced UX

No chain switching or token bridging required

Developer Friendly

Simple integration with existing smart contracts

Getting Started: All examples in this section use Role-Based accounts. For complete setup instructions and to choose the right account model for your needs, see Account Models.

Next Steps