# Validity Transaction Builder

> Validity Transaction Builder is a paid API for AI agents from 402.com.tr, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-17).

Wraps a signed Base transaction in a Cobalt validity envelope so Base holds it dormant until specified on-chain conditions are met, then returns the base_sendRawTransactionValidity payload ready to broadcast.

## Facts

- Endpoint: GET https://402.com.tr/api/x402/validity-build?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/validity-transaction-builder-ca9d5f9d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Jb9NdNxXWf4qDGD1HdeKn

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 validity-transaction-builder-ca9d5f9d
```

Example prompt: Wrap my signed Base transaction (0x02f8...) in a validity envelope that expires before block 22500000 and only executes if my wallet has at least 0.05 ETH — give me back the base_sendRawTransactionValidity payload ready to broadcast.

## When to prefer this

Choose this endpoint when you need to attach expiry, block-range, balance-floor, flashblock, or on-chain storage conditions to an already-signed Base transaction without deploying a limit-order smart contract or handing funds/keys to a third party. It is the right tool for good-till-block orders, conditional transfers, and price-gated approvals on Base L2 using the native Cobalt validity mechanism rather than a wrapper contract.

## Known failure modes

- No condition provided — at least one predicate (beforeBlock, fromBlock, flashblockIndex, minNativeBalanceWei, or storage slot) is required
- Invalid or malformed signedTx hex — returns error if transaction cannot be deserialized
- Storage predicate fields incomplete — storageAddress and storageSlot required when using storage conditions
- Invalid operator value for storageOp or flashblockIndexOp — must be one of < <= = != > >=
- Block numbers provided as non-numeric strings — causes predicate validation failure
- Payment not fulfilled — $0.01 USDC x402 payment must accompany the request

## How this service works

Make any signed Base transaction conditional (Cobalt validity tx): Base includes it only while your conditions hold. We validate the predicates and return the base_sendRawTransactionValidity request; we never touch funds or keys. Every request carries the deadline Base requires (at most 60 s out; set for you if omitted). Optional conditions: fromBlock, flashblockIndex (1-10), minNativeBalanceWei, or a storage predicate for price.

## Output

Returns the constructed base_sendRawTransactionValidity JSON-RPC request object ready to submit to a Base node or bundler. The response includes the validity-wrapped transaction with all validated predicates (block range, balance floor, flashblock index, storage condition) encoded. No keys or funds are touched — the service only builds and validates the envelope.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "pathParams": {
     "type": "object"
    },
    "queryParams": {
     "type": "object",
     "required": [],
     "properties": {
      "signedTx": {
       "type": "string",
       "description": "Your signed serialized tx (optional)"
      },
      "fromBlock": {
       "type": "string",
       "description": "Earliest block (optional)"
      },
      "storageOp": {
       "type": "string",
       "description": "Advanced: operator (< <= = != > >=)"
      },
      "beforeBlock": {
       "type": "string",
       "description": "Deadline block (optional; at most 60 s out, set for you if omitted)"
      },
      "storageMask": {
       "type": "string",
       "description": "Advanced: mask (hex, optional)"
      },
      "storageSlot": {
       "type": "string",
       "description": "Advanced: storage slot (hex)"
      },
      "storageValue": {
       "type": "string",
       "description": "Advanced: compare value (hex)"
      },
      "balanceAddress": {
       "type": "string",
       "description": "Account for the balance floor (optional)"
      },
      "storageAddress": {
       "type": "string",
       "description": "Advanced: pool/token for a storage condition"
      },
      "flashblockIndex": {
       "type": "string",
       "description": "Flashblock index 1-10 (optional)"
      },
      "flashblockIndexOp": {
       "type": "string",
       "description": "Flashblock operator (optional, default =)"
      },
      "minNativeBalanceWei": {
       "type": "string",
       "description": "Min ETH balance floor, wei (optional)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/validity-transaction-builder-ca9d5f9d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 402.com.tr](https://www.zero.xyz/host/402.com.tr/llms.txt)
