81trust / 100

Base Allowance

by base-allowance in Onchain & crypto

x402 APIPassing, checked 2 h ago

ERC20 allowance on Base mainnet via RPC: how much a spender is approved to move from an owner balance, read with allowance(owner,spender) eth_call.

POST https://x402.agentindex.world/base/allowance

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
43 ms typical, 71 ms slowest 5%
Last check
2 h ago
Next check
any minute now

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://x402.agentindex.world/base/allowance" \
  -H "content-type: application/json" \
  -d '{"owner":"0xb3F32bdfe8D07825BC0D7387295aB1D7559BA69d","spender":"0xcA11bde05977b3631167028862bE2a173976CA11","token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fx402.agentindex.world%2Fbase%2Fallowance
const res = await pay("https://x402.agentindex.world/base/allowance", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"owner":"0xb3F32bdfe8D07825BC0D7387295aB1D7559BA69d","spender":"0xcA11bde05977b3631167028862bE2a173976CA11","token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}),
});
console.log(await res.json());

Example input

{
  "owner": "0xb3F32bdfe8D07825BC0D7387295aB1D7559BA69d",
  "spender": "0xcA11bde05977b3631167028862bE2a173976CA11",
  "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}

Example output

{
  "allowance": 0,
  "allowance_raw": "0",
  "decimals": 6,
  "owner": "0xb3F32bdfe8D07825BC0D7387295aB1D7559BA69d",
  "spender": "0xcA11bde05977b3631167028862bE2a173976CA11",
  "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
2 h agoPassed40243 ms$0.003
5 h agoPassed40271 ms$0.003
8 h agoPassed40242 ms$0.003
13 h agoPassed40290 ms$0.003