{"uid":"cap_eZVH15hjVlxmVXE6sULNz","slug":"token-allowance-balance-pre-flight-check-8f0ad1cf","name":"Token Allowance & Balance Pre-flight Check","description":"Pre-flight check before a swap or transfer: ERC-20 allowance, balance, decimals and symbol in one call, read live from the chain at the latest block. Pass an amount and get a straight would_succeed verdict with the blocking reason and the action needed. Base, Ethereum, Arbitrum, Optimism, Polygon. A missing approval burns the gas of a failed transaction - this call costs a fraction of that.","url":"https://api.eucompliance.tools/x402/token","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","required":["token","owner"],"properties":{"chain":{"enum":["base","ethereum","arbitrum","optimism","polygon"],"type":"string"},"owner":{"type":"string","description":"wallet holding the tokens"},"token":{"type":"string","description":"ERC-20 contract address"},"amount":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Exact decimal string preferred; JSON number remains accepted for backwards compatibility. Optional; returns a would_succeed verdict."},"spender":{"type":"string","description":"contract that would spend them, optional"}}}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_OF7VRhtVrfPbiWCPjMg1u","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns ERC-20 token allowance, balance, decimals, and symbol in one call, with an optional would_succeed verdict for a proposed transfer amount on Base, Ethereum, Arbitrum, Optimism, or Polygon.","exampleAgentPrompt":"Before I try to swap 500 USDC on Base, check if my wallet 0xABC...123 has enough balance and has approved 0xDEF...456 as the spender — tell me if the transaction would succeed and what's blocking it if not.","exampleUseCases":[{"title":"Pre-swap approval check on Base","prompt":"I'm about to swap 1000 USDC on Base using Uniswap's router 0x2626664c2603336E57B271c5C0b26F421741e481 from my wallet 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 — can you check if my allowance and balance are sufficient and tell me if the swap would go through?"},{"title":"Diagnose failed token transfer on Polygon","prompt":"My WMATIC transfer on Polygon keeps failing — can you check the balance and allowance for token 0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270, owned by 0xAbCd...5678, to see what's blocking it?"},{"title":"Batch pre-flight before multi-chain DeFi bot","prompt":"Before my bot executes, check the USDT token 0xdAC17F958D2ee523a2206206994597C13D831ec7 on Ethereum: wallet 0x742d35Cc6634C0532925a3b844Bc454e4438f44e, spender 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D, amount 5000 — would it succeed, and what action do I need to take?"}],"resultDescription":"Returns the token's balance, allowance, decimals, and symbol read live from the chain at the latest block. If an amount and spender are provided, also returns a boolean would_succeed verdict, the specific blocking reason (e.g. insufficient balance or missing approval), and the action required to fix it (e.g. approve spender or acquire more tokens).","failureModes":["Invalid or non-ERC-20 contract address returns an error or zero values","Unsupported chain value returns a validation error","Owner or spender address malformed returns a parameter error","Network RPC timeout causes a delayed or failed response","Amount specified without spender omits the would_succeed verdict"],"whenToPreferThis":"Choose this endpoint when you need to verify ERC-20 token state before executing a swap, transfer, or DeFi interaction and want to avoid wasting gas on a predictably failing transaction. It consolidates balance, allowance, decimals, and symbol into a single read call and adds an actionable verdict, making it ideal for any agent or bot that needs to pre-validate token conditions on Base, Ethereum, Arbitrum, Optimism, or Polygon before submitting a transaction.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:39:47.209Z","isFirstParty":false}