{"uid":"cap_w67fdM9WCE77U5X8BL5dz","slug":"jtifhcvbgxqwlywugvjv-supabase-co-8d4fbc66","name":"Cortex402 Wallet Balance Validator","description":"Check any wallet balance across 5 EVM chains. Returns native or ERC-20 balance with threshold check, block height, and on-chain receipt. Supports Base, Ethereum, Arbitrum, Optimism, and Polygon.","url":"https://jtifhcvbgxqwlywugvjv.supabase.co/functions/v1/cortex402-wallet-balance","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"token":{"type":"string","description":"Token symbol (USDC/USDT/WETH/WBTC/DAI) or raw ERC-20 contract address. Omit for native balance."},"address":{"type":"string","description":"EVM wallet address (0x-prefixed 40-hex)"},"network":{"enum":["base","ethereum","arbitrum","optimism","polygon"],"type":"string","description":"Chain to query. Defaults to Base mainnet."},"threshold":{"type":"string","description":"Optional decimal amount or raw atomic units. If provided, response includes sufficient/deficient flag."}}},"responseSchema":null,"example":{"request":{"token":"USDC","address":"0x742d35Cc6634C0532925a3b844Bc9e7595f42bE1","network":"base","threshold":"100"},"response":{"block":"0x2d4901f","token":{"kind":"erc20","symbol":"USDC","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","decimals":6},"source":"Base mainnet RPC · eth_call balanceOf(address)","address":"0x742d35Cc6634C0532925a3b844Bc9e7595f42bE1","balance":{"raw":"0","decimals":6,"formatted":"0"},"deficit":{"raw":"100","formatted":"0.0001"},"network":"base","chain_id":8453,"threshold":{"raw":"100","formatted":"0.0001"},"fetched_at":"2026-06-18T05:07:45.974Z","receipt_tx":"0x397b69745cd3186a5ef83563c07dffd609b4e67d6a74d5e1c391c66f167a4da8","request_id":"wb_4402011bbc6c458b852475","sufficient":false}},"exampleRequest":{"token":"USDC","address":"0x742d35Cc6634C0532925a3b844Bc9e7595f42bE1","network":"base","threshold":"100"},"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_KRB1BEgFJFlxfCmFL9vLx","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Queries on-chain native or ERC-20 token balance for a given EVM wallet address and network, returning balance, block height, and an optional sufficient/deficient flag against a threshold.","exampleAgentPrompt":"Can you check whether the wallet 0xAbC123...def on Base mainnet has at least 50 USDC — I need to know if it's sufficiently funded before I proceed?","exampleUseCases":[{"title":"Pre-payment wallet sufficiency check","prompt":"Before I send the invoice, can you verify that my client's wallet on Ethereum has at least 5000 USDC? I don't want to generate the payment request if they're not funded."},{"title":"Multi-chain token balance verification","prompt":"I need to know how much WBTC this address holds across all our supported chains — just give me the totals so I can see where their Bitcoin is distributed."},{"title":"Automated workflow funding validation","prompt":"Set up a check for me: every time we're about to execute a contract on Polygon, verify that the operator wallet has a minimum balance of 10 MATIC. If it doesn't, flag it so we can top up before proceeding."}],"resultDescription":"Returns the current on-chain balance (in decimal and raw atomic units), the block height at the time of query, and — if a threshold was provided — a sufficient/deficient flag indicating whether the wallet meets the required balance.","failureModes":["Invalid or malformed wallet address returns a 4xx error with address validation message","Unsupported network enum value returns an error listing valid chains","Unknown or unsupported token symbol returns an error; use raw ERC-20 contract address as fallback","RPC node timeout or chain congestion may cause delayed or failed responses","Threshold provided in wrong format (e.g. mixing decimal and atomic units) may yield incorrect sufficient/deficient flag","Payment of $0.02 USDC not provided or rejected results in 402 Payment Required"],"whenToPreferThis":"Choose this endpoint when you need a fast, single-call on-chain balance lookup across Base, Ethereum, Arbitrum, Optimism, or Polygon — especially when you also need to validate sufficiency against a threshold before triggering a payment or workflow step. Preferred over block explorer scraping or full node queries when you want a normalized, structured response with a built-in sufficient/deficient flag.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:37:28.831Z","isFirstParty":false}