Skip to main content
POST
/
api
/
v1
/
wallets
/
{wallet_uuid}
/
estimate-contract-call-fee
Estimate contract call fee
import requests

url = "https://api.example.com/api/v1/wallets/{wallet_uuid}/estimate-contract-call-fee"

payload = {
    "chain_id": "<string>",
    "contract_addr": "<string>",
    "value": "0",
    "calldata": "<string>",
    "instructions": [
        {
            "program_id": "<string>",
            "accounts": [
                {
                    "pubkey": "<string>",
                    "is_signer": True,
                    "is_writable": True
                }
            ],
            "data": "<string>"
        }
    ],
    "address_lookup_table_accounts": [
        {
            "alt_account_key": "<string>",
            "addresses": ["<string>"]
        }
    ],
    "src_addr": "<string>"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
{
  "result": {
    "fee_type": "<string>",
    "token_id": "<string>",
    "recommended": {
      "max_fee_per_gas": "<string>",
      "max_priority_fee_per_gas": "<string>",
      "gas_limit": "<string>",
      "compute_unit_price": "<string>",
      "compute_unit_limit": "<string>",
      "fee_amount": "<string>"
    },
    "slow": {
      "max_fee_per_gas": "<string>",
      "max_priority_fee_per_gas": "<string>",
      "gas_limit": "<string>",
      "compute_unit_price": "<string>",
      "compute_unit_limit": "<string>",
      "fee_amount": "<string>"
    },
    "fast": {
      "max_fee_per_gas": "<string>",
      "max_priority_fee_per_gas": "<string>",
      "gas_limit": "<string>",
      "compute_unit_price": "<string>",
      "compute_unit_limit": "<string>",
      "fee_amount": "<string>"
    }
  },
  "success": true,
  "suggestion": "",
  "message": "",
  "meta": {
    "total": 123,
    "offset": 123,
    "limit": 123,
    "has_more": true,
    "after": "<string>",
    "before": "<string>"
  }
}

Headers

X-API-Key
string | null

Path Parameters

wallet_uuid
string<uuid>
required

The UUID of the wallet for which to estimate the contract call fee. Retrieve this value from the id field returned when the wallet was created.

Body

application/json

Request payload for contract-call fee estimation.

chain_id
string
required

The Cobo chain ID for this contract call (for example, SETH, BASE_ETH, SOL).

Required string length: 1 - 100
contract_addr
string | null

The EVM contract address to call. Required for EVM chains.

Maximum string length: 255
value
string
default:0

The ETH value to send with the call, in whole token units (not wei), as a decimal string. Defaults to 0.

Required string length: 1 - 100
calldata
string | null

The ABI-encoded calldata as a hex string.

Maximum string length: 8192
instructions
SolInstruction · object[] | null

Solana instructions for this call. Required for Solana chains.

address_lookup_table_accounts
SolAddressLookupTableAccount · object[] | null

Optional Solana address lookup table accounts.

src_addr
string | null

The source address. If omitted, the wallet's most recently created address for this chain is used.

Maximum string length: 255

Response

Successful Response

result
EstimateTransferFeeRead · object
required

Fee estimation response payload.

success
boolean
default:true
suggestion
string
default:""
message
string
default:""
meta
PaginationMeta · object

Pagination metadata for list responses.

Supports both legacy offset-based and cursor-based pagination. Cursor fields (has_more, after, before) are populated for cursor-paginated endpoints. Legacy fields (offset, limit) are populated when the caller uses the deprecated offset parameter.