{"uid":"cap_nwpEj25e8WxD25yccmdxo","slug":"statepulse-preflight-evm-transaction-pre-flight-check-c3c00df3","name":"StatePulse Preflight – EVM Transaction Pre-flight Check","description":"One call that pre-flights an onchain transaction for an agent: simulates the call for reverts, checks the sender wallet's native gas balance, and reads current Base gas — returning a single GO/NO_GO verdict with reasons. Replaces 3 separate calls (simulate + balances + gas-history) every agent runs before transacting. Matches: pre-transaction check, agent transaction guard, revert + balance + gas preflight, onchain go/no-go, safe-to-send checker, autonomous trade preflight.","url":"https://statepulse-api.hahavoid0.workers.dev/agent/preflight","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","properties":{"to":{"type":"string","description":"Target contract address of the transaction to simulate"},"data":{"type":"string","examples":["0x70a082310000000000000000000000000000000000000000000000000000000000000000"],"description":"Calldata payload (hex) of the transaction to simulate"},"from":{"type":"string","description":"Sender address used by the eth_call (defaults to wallet)"},"chain":{"type":"string","default":"base","description":"base or ethereum"},"wallet":{"type":"string","examples":["0x4a82F147c8A4339409C9097Adc1EedFd56E85bFE"],"description":"Sender wallet — checks native gas balance and USDC"}}},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"result":{"go":true,"gas":{"avg_base_fee_gwei":0.15},"balance":{"usdc_balance":"12.50","native_balance":"0.4200"},"reasons":["Simulation passed: transaction does not revert.","Wallet native balance: 0.4200 (can pay gas).","Current avg gas: 0.15 gwei."],"decision":"GO","simulation":{"reverted":false}},"supported":true,"confidence":"high"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.03","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","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.03/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.03","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.03","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_tpSTeb6fKeCEwyqPQ7XuV","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.03","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Simulates an EVM transaction, checks wallet gas and USDC balance, and returns a GO/NO-GO decision with confidence before sending on-chain","exampleAgentPrompt":"Before I send this transaction, can you run a preflight check on my wallet 0x4a82F147c8A4339409C9097Adc1EedFd56E85bFE calling contract 0xABC123... on Base with calldata 0x70a08231... — tell me if it will revert, whether I have enough gas, and give me a GO or NO-GO decision?","exampleUseCases":null,"resultDescription":"Returns a JSON object with a top-level 'decision' field ('GO' or 'NO-GO'), a 'confidence' string ('high'/'medium'/'low'), a 'simulation' object with a 'reverted' boolean, a 'gas' object with average base fee in gwei, a 'balance' object with USDC and native token balances, and a 'reasons' array listing human-readable explanations for the decision.","failureModes":["Invalid or malformed contract address returns error","Invalid hex calldata causes simulation failure","Unsupported chain value (not 'base' or 'ethereum') returns validation error","Wallet address not found or has zero balance returns NO-GO with balance reasons","Network congestion or RPC timeout may cause simulation failure","Missing required 'to' or 'data' fields returns schema validation error"],"whenToPreferThis":"Use this endpoint when an AI agent needs to verify an EVM transaction will succeed before broadcasting it, especially to avoid wasting gas on reverting transactions. Ideal for DeFi automation, contract interaction workflows, or any agentic flow that needs to gate on-chain actions behind a safety check. Prefer this over raw RPC simulation calls when you also want wallet balance checks and a human-readable GO/NO-GO recommendation bundled in one call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:50:21.454Z","isFirstParty":false}