Skip to main content
POST
/
quotes
/
prepare-call-quote
curl --request POST \
--url https://be.onebalance.io/api/quotes/prepare-call-quote \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{
"account": {
"accountAddress": "0xb8e4b017f4a8870E3eB4eb15c5e180D2a34D877B",
"adminAddress": "0x8FA09fc75bC2619e594cCb720096627DCaA7c5C4",
"sessionAddress": "0xBbef1E2dEA96c1c2001Eb48136e513A855F46097"
},
"targetChain": "eip155:10",
"calls": [
{
"data": "0x095ea7b3000000000000000000000000Bbef1E2dEA96c1c2001Eb48136e513A855F460970000000000000000000000000000000000000000000000000000000000000001",
"to": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
"value": "0x0"
}
],
"allowanceRequirements": [
{
"assetType": "eip155:10/erc20:0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
"amount": "8000000",
"spender": "0xb8e4b017f4a8870E3eB4eb15c5e180D2a34D877B"
}
],
"tokensRequired": [
{
"assetType": "eip155:10/erc20:0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
"amount": "8000000"
}
],
"overrides": [
{
"address": "0xb8e4b017f4a8870E3eB4eb15c5e180D2a34D877B",
"balance": "0x1"
}
]
}'
{
"account": {
"accountAddress": "0xb8e4b017f4a8870E3eB4eb15c5e180D2a34D877B",
"adminAddress": "0x8FA09fc75bC2619e594cCb720096627DCaA7c5C4",
"sessionAddress": "0xBbef1E2dEA96c1c2001Eb48136e513A855F46097"
},
"chainOperation": {
"userOp": {
"sender": "0xb8e4b017f4a8870e3eb4eb15c5e180d2a34d877b",
"nonce": "1120126849530300722547379539971600052481264750391572034956634531672621056",
"factory": "0xd703aae79538628d27099b8c4f621be4ccd142d5",
"factoryData": "0x",
"callData": "0xe9ae5c530100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000b2c639c533813f4aa9d7837caf62653d097ff85000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb0000000000000000000000004ebcfae0c3e747c95504ca7c79c46f725cb4c752000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000",
"callGasLimit": "737280",
"verificationGasLimit": "3076170",
"preVerificationGas": "0",
"maxFeePerGas": "0",
"maxPriorityFeePerGas": "0",
"paymaster": "0xa784e6482bd5edbfe5991b18cbd545ebd46e1cc4",
"paymasterVerificationGasLimit": "19219",
"paymasterPostOpGasLimit": "0",
"paymasterData": "0x",
"signature": "0x"
},
"typedDataToSign": {
"domain": {
"name": "RoleBasedECDSAValidator",
"version": "1.4.3",
"chainId": 10,
"verifyingContract": "0xA24bD06230f3F54e5bf266AE7A41750eE3b789FA"
},
"types": {
"Approve": [
{
"name": "callDataAndNonceHash",
"type": "bytes32"
}
]
},
"primaryType": "Approve",
"message": {
"callDataAndNonceHash": "0xaab2ddac63e4a7e25b7d339cacdff2f9280025cef27699ffe5f5e9e9625b15eb"
}
},
"assetType": "eip155:10/erc20:0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
"amount": "8000000"
},
"tamperProofSignature": "0x1eeb521fc3ffd61cb3fa44526b3933155ed774d5c599491bd6dca1366bb8eaed4004f311351ed7ca2f9777e8e561556f546a32bc2b45df7fe303c709613ead541b"
}

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 account, calls, and token requirements.

account
object
required

Account details (smart account / EOA and related addresses). Account information that supports both role-based and basic account types. OneBalance supports a modular architecture designed to accommodate various account types with different validators, versions, and deployment methods.

Learn more about account types and their capabilities at OneBalance Account Models.

Role-based account using RoleBasedValidator with Kernel 3.1. Always has Resource Lock enabled. Allows a user_admin role (think user cold wallet) next to the signer role to rotate keys and execute trustless rage quit in emergency cases. Secure in emergency cases related to WaaS/TEE but consumes slightly more gas.

  • Role-based Account
  • Basic Account
  • EIP-7702 Account
targetChain
string
required

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

Example:

"eip155:10"

calls
object[]
required

Array of calls to be executed.

allowanceRequirements
object[]
required

Array of approvals required for the call. Approvals need to be explicitly defined. Any approval pased as call would result into a failing request.

tokensRequired
object[]
required

Array of tokens needed for these calls.

overrides
object[]

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

validAfter
string

Permit valid after value in block timestamp.

validUntil
string

Permit valid until value in block timestamp.

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

Response from prepare-call-quote containing all necessary data to execute contract calls on the target chain

account
object
required

Account configuration for the operation Account information that supports both role-based and basic account types. OneBalance supports a modular architecture designed to accommodate various account types with different validators, versions, and deployment methods.

Learn more about account types and their capabilities at OneBalance Account Models.

Role-based account using RoleBasedValidator with Kernel 3.1. Always has Resource Lock enabled. Allows a user_admin role (think user cold wallet) next to the signer role to rotate keys and execute trustless rage quit in emergency cases. Secure in emergency cases related to WaaS/TEE but consumes slightly more gas.

  • Role-based Account
  • Basic Account
  • EIP-7702 Account
chainOperation
object
required

Operation (including userOp and typed data) to be executed on-chain Chain operation containing user operation data, typed data to sign, and optional EIP-7702 delegation.

When EIP-7702 delegation is required, the delegation field will be present and must be signed before submission.

tamperProofSignature
string
required

Tamper-proof signature for the entire call request

Example:

"0x0e1f9f56bb4072894a24ebc6fe6e41e15f8b9c8ce7bc1d9d88e9a46b85353d55238f0e7a75fbeb71249292e2206887adc894849488d8d8c23a5a17542d5ab2511b"

callType
enum<string>

Type of operation indicating the routing strategy Type of call operation indicating the routing strategy:

  • same_chain_exclude_solver: Operation on the same chain without solver involvement
  • cross_chain_with_solver: Cross-chain operation requiring solver assistance
  • same_chain_with_solver: Same-chain operation with solver involvement
  • cross_chain_with_solver_and_swaps: Complex cross-chain operation with multiple swaps
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 for source assets that could be used for this operation

I