Skip to main content
POST
/
v3
/
quote
/
prepare-call-quote
curl --request POST \
  --url https://be.onebalance.io/api/v3/quote/prepare-call-quote \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "accounts": [
    {
      "type": "solana",
      "accountAddress": "EB8Hi4LoqUVCGUPJ2y9MsHbEsJQJvmpQRUWrLpjEZxC6"
    },
    {
      "type": "kernel-v3.3-ecdsa",
      "accountAddress": "0xDb69A4Ded06AaD92C69c42232b691CFD8bF347e8",
      "signerAddress": "0xDb69A4Ded06AaD92C69c42232b691CFD8bF347e8",
      "deploymentType": "EIP7702"
    }
  ],
  "targetChain": "eip155:42161",
  "calls": [
    {
      "to": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
      "data": "0xa9059cbb0000000000000000000000004EbcFae0C3e747C95504CA7c79c46f725Cb4c7520000000000000000000000000000000000000000000000000000000000000001",
      "value": "0x0"
    }
  ],
  "tokensRequired": [
    {
      "assetType": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
      "amount": "10000"
    }
  ],
  "fromAssetId": "ob:usdc"
}
'
{
"accounts": [
{
"type": "solana",
"accountAddress": "EB8Hi4LoqUVCGUPJ2y9MsHbEsJQJvmpQRUWrLpjEZxC6"
},
{
"type": "kernel-v3.3-ecdsa",
"accountAddress": "0xDb69A4Ded06AaD92C69c42232b691CFD8bF347e8",
"signerAddress": "0xDb69A4Ded06AaD92C69c42232b691CFD8bF347e8",
"deploymentType": "EIP7702"
}
],
"chainOperation": {
"userOp": {
"sender": "0xdb69a4ded06aad92c69c42232b691cfd8bf347e8",
"nonce": "913479994650515257524606220465835134743662536739504622017003723935449089",
"callData": "0xe9ae5c53010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e5831000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb0000000000000000000000004ebcfae0c3e747c95504ca7c79c46f725cb4c752000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000",
"callGasLimit": "2831389",
"verificationGasLimit": "46313",
"preVerificationGas": "0",
"maxFeePerGas": "0",
"maxPriorityFeePerGas": "0",
"paymaster": "0xa784e6482bd5edbfe5991b18cbd545ebd46e1cc4",
"paymasterVerificationGasLimit": "13011",
"paymasterPostOpGasLimit": "0",
"paymasterData": "0x",
"signature": "0x"
},
"typedDataToSign": {
"domain": {
"name": "RoleBasedECDSAValidator",
"version": "1.4.3",
"chainId": 42161,
"verifyingContract": "0xA24bD06230f3F54e5bf266AE7A41750eE3b789FA"
},
"types": {
"Approve": [
{
"name": "callDataAndNonceHash",
"type": "bytes32"
}
]
},
"primaryType": "Approve",
"message": {
"callDataAndNonceHash": "0x68752061ab5e1f42561b192a3ea5e70c4005b62a7ea4698b14a35ab0004f6687"
}
},
"assetType": "eip155:42161/erc20:0xaf88d065e77c8cc2239327c5edb3a432268e5831",
"amount": "10000"
},
"tamperProofSignature": "0x6316c2fe49d51af45b7bb7bb311395595fe29b7bd9de2e219cba0942fda2461c1c3f19108d6f391cd02c7cdc7d218ff0945d32ba784be1357b3c954ff7ae254e1c"
}

Authorizations

x-api-key
string
header
required

The OneBalance API uses API keys to authenticate requests. All API requests require authentication using an API key passed in the x-api-key header:

curl -X 'GET' \
'https://be.onebalance.io/api/path-to/endpoint' \
-H 'x-api-key: ${ONEBALANCE_API_KEY}' \
...

A public API key is available for testing purposes with limited usage: 42bb629272001ee1163ca0dbbbc07bcbb0ef57a57baf16c4b1d4672db4562c11.

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

Learn how to generate API access tokens at OneBalance Docs.

Body

application/json

Details of the accounts, calls, and token requirements.

V3 prepare call request with multi-account support for cross-chain contract calls

accounts
(Role-based Account · object | Basic Account · object | EIP-7702 Account · object | Solana Account · object)[]
required

Array of account configurations. Each account type must be unique. Supports mixed Solana and EVM accounts for cross-chain operations.

Required array length: 1 - 10 elements

Account configuration supporting multiple blockchain types.

Account Compatibility Rules:

  • Cannot combine multiple accounts of the same chain type
  • Solana accounts can be combined with any EVM account type
  • Single account operations are supported for any account type

Supported Account Types:

  • role-based: Traditional EVM account with session/admin addresses
  • kernel-v3.1-ecdsa: Kernel v3.1 ECDSA smart account
  • kernel-v3.3-ecdsa: Kernel v3.3 ECDSA smart account with EIP-7702 support
  • solana: Solana blockchain account
  • Role-based Account
  • Basic Account
  • EIP-7702 Account
  • Solana Account
Example:
[
{
"type": "solana",
"accountAddress": "EB8Hi4LoqUVCGUPJ2y9MsHbEsJQJvmpQRUWrLpjEZxC6"
},
{
"type": "kernel-v3.3-ecdsa",
"accountAddress": "0xDb69A4Ded06AaD92C69c42232b691CFD8bF347e8",
"signerAddress": "0xDb69A4Ded06AaD92C69c42232b691CFD8bF347e8",
"deploymentType": "EIP7702"
}
]
targetChain
string
required

Target chain in CAIP-2 notation (e.g. "eip155:42161" for Arbitrum).

Example:

"eip155:42161"

calls
object[]
required

Array of contract calls to be executed on the target chain.

Minimum array length: 1
Example:
[
{
"to": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"data": "0xa9059cbb0000000000000000000000004EbcFae0C3e747C95504CA7c79c46f725Cb4c7520000000000000000000000000000000000000000000000000000000000000001",
"value": "0x0"
}
]
tokensRequired
object[]
required

Array of tokens needed for these calls on the target chain.

Example:
[
{
"assetType": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"amount": "10000"
}
]
allowanceRequirements
object[]

Optional array of token approvals required for the calls. Approvals need to be explicitly defined. Any approval passed as a call would result in a failing request.

Example:
[
{
"assetType": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"amount": "10000",
"spender": "0xDb69A4Ded06AaD92C69c42232b691CFD8bF347e8"
}
]
overrides
object[]

Optional state overrides (e.g., fake balances for simulation).

Example:
[
{
"address": "0xDb69A4Ded06AaD92C69c42232b691CFD8bF347e8",
"balance": "0x1"
}
]
validAfter
string

Permit valid after value in block timestamp.

Example:

"1686239400"

validUntil
string

Permit valid until value in block timestamp.

Example:

"1686339400"

fromAssetId
string

Source asset identifier to spend from for bridging to target chain. Can be either aggregated asset ID (e.g., "ob:usdc") or CAIP-19 asset type (e.g., "eip155:1/erc20:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"). This field enables cross-chain spending from specific assets in multi-account setups.

Example:

"ob:usdc"

slippageTolerance
integer

Slippage tolerance in basis points (1/100th of a percent). For example, 50 = 0.5%, 100 = 1%, 1000 = 10%.

Required range: x >= 1
Example:

50

Response

Call quote prepared successfully

V3 response from prepare-call-quote containing all necessary data to execute contract calls with multi-account support

accounts
(Role-based Account · object | Basic Account · object | EIP-7702 Account · object | Solana Account · object)[]
required

Array of account configurations involved in the operation

Account configuration supporting multiple blockchain types.

Account Compatibility Rules:

  • Cannot combine multiple accounts of the same chain type
  • Solana accounts can be combined with any EVM account type
  • Single account operations are supported for any account type

Supported Account Types:

  • role-based: Traditional EVM account with session/admin addresses
  • kernel-v3.1-ecdsa: Kernel v3.1 ECDSA smart account
  • kernel-v3.3-ecdsa: Kernel v3.3 ECDSA smart account with EIP-7702 support
  • solana: Solana blockchain account
  • Role-based Account
  • Basic Account
  • EIP-7702 Account
  • Solana Account
Example:
[
{
"type": "solana",
"accountAddress": "EB8Hi4LoqUVCGUPJ2y9MsHbEsJQJvmpQRUWrLpjEZxC6"
},
{
"type": "kernel-v3.3-ecdsa",
"accountAddress": "0xDb69A4Ded06AaD92C69c42232b691CFD8bF347e8",
"signerAddress": "0xDb69A4Ded06AaD92C69c42232b691CFD8bF347e8",
"deploymentType": "EIP7702"
}
]
chainOperation
object
required

Operation (including userOp and typed data) to be executed on the target chain

tamperProofSignature
string
required

Tamper-proof signature for the entire call request

Example:

"0x0e1f9f56bb4072894a24ebc6fe6e41e15f8b9c8ce7bc1d9d88e9a46b85353d55238f0e7a75fbeb71249292e2206887adc894849488d8d8c23a5a17542d5ab2511b"

callType
enum<string>

Type of operation indicating the routing strategy for multi-account operations

Available options:
same_chain_exclude_solver,
cross_chain_with_solver,
same_chain_with_solver,
cross_chain_with_solver_and_swaps
Example:

"cross_chain_with_solver"

sourceAssetBalances
object[]

Available balances across all accounts that could be used for this operation

Example:
[
{
"assetType": "eip155:42161/erc20:0xaf88d065e77c8cc2239327c5edb3a432268e5831",
"balance": "20476622",
"decimals": 6,
"fiatValue": 20.52074709722842
}
]
delegation
object

EIP-7702 delegation object that needs to be signed before execution. Only present when using EIP-7702 accounts that require delegation.