Check read-only ERC-20 wallet readiness for a planned token spend
Check read-only ERC-20 wallet readiness for a planned token spend.
2000 (raw units)
price
1
calls / 30d
1
unique payers
2026-09-01
updated
Provider
blockchain-api.x402-chain-tools.workers.dev · discovered, not yet claimed by its owner
Payment (x402 accepts[])
[
{
"scheme": "exact",
"network": "eip155:8453",
"payTo": "0xa7e1fe3744E3b6D55237d95cE575cAFe3b8abeCD",
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amount": "2000",
"maxTimeoutSeconds": 300
},
{
"scheme": "exact",
"network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
"payTo": "5vX2u7mkwhxpvQYNA7SqmauJjkcfnxETQ6tKVZphzKyM",
"asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": "2000",
"maxTimeoutSeconds": 300
}
]Output schema
{
"bazaar": {
"info": {
"input": {
"body": {
"amount": "10.5",
"spender": "0x0000000000000000000000000000000000000003",
"token": "0x0000000000000000000000000000000000000002",
"wallet": "0x0000000000000000000000000000000000000001"
},
"bodyType": "json",
"method": "POST",
"type": "http"
},
"output": {
"example": {
"allowance": {
"formatted": "0",
"raw": "0",
"sufficient": false,
"unlimited": false
},
"issues": [
"NO_NATIVE_GAS_BALANCE",
"INSUFFICIENT_TOKEN_BALANCE"
],
"limitations": [
"native gas check only verifies a non-zero ETH balance",
"transaction execution is not simulated"
],
"native_balance": {
"eth": "0",
"has_native_gas_balance": false,
"wei": "0"
},
"network": "eip155:8453",
"ok": true,
"ready": false,
"requested_amount": {
"decimals": 6,
"formatted": "10.5",
"raw": "10500000"
},
"spender": "0x0000000000000000000000000000000000000003",
"spender_is_contract": true,
"token": "0x0000000000000000000000000000000000000002",
"token_balance": {
"formatted": "0",
"raw": "0",
"sufficient": false
},
"wallet": "0x0000000000000000000000000000000000000001"
},
"type": "json"
}
},
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"input": {
"additionalProperties": false,
"properties": {
"body": {
"additionalProperties": false,
"properties": {
"amount": {
"description": "Positive decimal string without scientific notation. Exact fractional precision depends on the token decimals() response.",
"pattern": "^[0-9]+(?:\\.[0-9]+)?$",
"type": "string"
},
"spender": {
"description": "Planned spender address.",
"pattern": "^0x[0-9a-fA-F]{40}$",
"type": "string"
},
"token": {
"description": "ERC-20 token contract address on Base.",
"pattern": "^0x[0-9a-fA-F]{40}$",
"type": "string"
},
"wallet": {
"description": "Base wallet address.",
"pattern": "^0x[0-9a-fA-F]{40}$",
"type": "string"
}
},
"required": [
"wallet",
"token",
"spender",
"amount"
],
"type": "object"
},
"bodyType": {
"enum": [
"json",
"form-data",
"text"
],
"type": "string"
},
"method": {
"enum": [
"POST"
],
"type": "string"
},
"type": {
"const": "http",
"type": "string"
}
},
"required": [
"type",
"method",
"bodyType",
"body"
],
"type": "object"
},
"output": {
"properties": {
"example": {
"additionalProperties": false,
"properties": {
"allowance": {
"additionalProperties": false,
"properties": {
"formatted": {
"pattern": "^[0-9]+(?:\\.[0-9]+)?$",
"type": "string"
},
"raw": {
"pattern": "^[0-9]+$",
"type": "string"
},
"sufficient": {
"type": "boolean"
},
"unlimited": {
"type": "boolean"
}
},
"required": [
"raw",
"formatted",
"unlimited",
"sufficient"
],
"type": "object"
},
"issues": {
"items": {
"enum": [
"NO_NATIVE_GAS_BALANCE",
"INSUFFICIENT_TOKEN_BALANCE",
"INSUFFICIENT_ALLOWANCE",
"SPENDER_NOT_CONTRACT"
]
},
"type": "array"
},
"limitations": {
"maxItems": 2,
"minItems": 2,
"prefixItems": [
{
"const": "native gas check only verifies a non-zero ETH balance"
},
{
"const": "transaction execution is not simulated"
}
],
"type": "array"
},
"native_balance": {
"additionalProperties": false,
"properties": {
"eth": {
"pattern": "^[0-9]+(?:\\.[0-9]+)?$",
"type": "string"
},
"has_native_gas_balance": {
"type": "boolean"
},
"wei": {
"pattern": "^[0-9]+$",
"type": "string"
}
},
"required": [
"wei",
"eth",
"has_native_gas_balance"
],
"type": "object"
},
"network": {
"const": "eip155:8453",
"type": "string"
},
"ok": {
"const": true,
"type": "boolean"
},
"ready": {
"type": "boolean"
},
"requested_amount": {
"additionalProperties": false,
"properties": {
"decimals": {
"maximum": 255,
"minimum": 0,
"type": "integer"
},
"formatted": {
"pattern": "^[0-9]+(?:\\.[0-9]+)?$",
"type": "string"
},
"raw": {
"pattern": "^[0-9]+$",
"type": "string"
}
},
"required": [
"formatted",
"raw",
"decimals"
],
"type": "object"
},
"spender": {
"description": "Spender address.",
"pattern": "^0x[0-9a-fA-F]{40}$",
"type": "string"
},
"spender_is_contract": {
"type": "boolean"
},
"token": {
"description": "Token contract address.",
"pattern": "^0x[0-9a-fA-F]{40}$",
"type": "string"
},
"token_balance": {
"additionalProperties": false,
"properties": {
"formatted": {
"pattern": "^[0-9]+(?:\\.[0-9]+)?$",
"type": "string"
},
"raw": {
"pattern": "^[0-9]+$",
"type": "string"
},
"sufficient": {
"type": "boolean"
}
},
"required": [
"raw",
"formatted",
"sufficient"
],
"type": "object"
},
"wallet": {
"description": "Wallet address.",
"pattern": "^0x[0-9a-fA-F]{40}$",
"type": "string"
}
},
"required": [
"ok",
"network",
"wallet",
"token",
"spender",
"requested_amount",
"native_balance",
"token_balance",
"allowance",
"spender_is_contract",
"ready",
"issues",
"limitations"
],
"type": "object"
},
"type": {
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
}
},
"required": [
"input"
],
"type": "object"
}
}
}Use it
curl
curl "https://blockchain-api.x402-chain-tools.workers.dev/chain/wallet-preflight" # -> 402 Payment Required, accepts[] lists how to pay # retry with a PAYMENT-SIGNATURE (or PAYMENT header) once paid
JavaScript
const res = await fetch("https://blockchain-api.x402-chain-tools.workers.dev/chain/wallet-preflight");
if (res.status === 402) {
const { accepts } = await res.json();
// pay one of accepts[] via an x402 client, then retry with the payment header
}Python
import httpx
res = httpx.get("https://blockchain-api.x402-chain-tools.workers.dev/chain/wallet-preflight")
if res.status_code == 402:
accepts = res.json()["accepts"]
# pay one of accepts[] via an x402 client, then retry with the payment headerMachine-readable
Everything on this page is also available as clean JSON at /resources/8168.json, and this resource appears in /discovery/resources and /discovery/search.