# StatePulse Preflight – EVM Transaction Pre-flight Check

> StatePulse Preflight – EVM Transaction Pre-flight Check is a paid API for AI agents from statepulse-api.hahavoid0.workers.dev, paid per call via x402, $0.03/call, status unknown (last checked 2026-09-14).

Simulates an EVM transaction, checks wallet gas and USDC balance, and returns a GO/NO-GO decision with confidence before sending on-chain

## Facts

- Endpoint: POST https://statepulse-api.hahavoid0.workers.dev/agent/preflight
- Price: $0.03/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/statepulse-preflight-evm-transaction-pre-flight-check-c3c00df3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_nwpEj25e8WxD25yccmdxo

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability statepulse-preflight-evm-transaction-pre-flight-check-c3c00df3 -d '<json body>'
```

Example prompt: 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?

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "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"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/statepulse-preflight-evm-transaction-pre-flight-check-c3c00df3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from statepulse-api.hahavoid0.workers.dev](https://www.zero.xyz/host/statepulse-api.hahavoid0.workers.dev/llms.txt)
