# Base Swap — Conditional (Validity Transaction)

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

Returns a signed, dormant 0x swap transaction on Base that is only included by the sequencer when user-defined conditions (block range, ETH balance, storage/price predicate) are met.

## Facts

- Endpoint: GET https://402.com.tr/api/x402/base-swap-validity?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/base-swap-conditional-validity-transaction-800efdcf
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_zO0Gzp1r2DSqrrn2LHY9y

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 base-swap-conditional-validity-transaction-800efdcf
```

Example prompt: Set up a conditional swap on Base: sell 500 USDC for ETH from my wallet 0xABC…, valid only before block 12500000, with 50 bps slippage, and only if my ETH balance is at least 0.01 ETH — give me the signed validity transaction I can submit.

## When to prefer this

Choose this endpoint when you need a conditional or time-bounded swap on Base without deploying a limit-order contract and without custodying funds. It is ideal for good-till-block orders, balance-gated trades, flashblock-targeted execution, or on-chain price-predicate triggers. Prefer the plain Base Swap endpoint for immediate unconditional execution. Use this endpoint when you want the swap to self-cancel if conditions are never met, and when you want the taker to retain custody of keys throughout.

## Known failure modes

- Missing required condition — at least one of beforeBlock, fromBlock, flashblockIndex, minNativeBalanceWei, or storageSlot must be provided
- Invalid taker address format returns a 400 error
- 0x routing failure if no liquidity path exists for the sell/buy pair on Base
- beforeBlock already passed at request time — transaction would be immediately invalid
- storageOp provided without storageSlot/storageAddress/storageValue — incomplete predicate rejected
- Slippage too tight causing 0x quote failure
- Amount of zero or negative rejected

## How this service works

The base-swap 0x trade as a Cobalt validity transaction: Base includes your signed tx only while your conditions hold — a conditional order with no limit-order contract and nobody holding the trade. We never hold funds or keys; you sign and submit. 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 caller-supplied storage predicate for price.

## Output

A signed validity transaction payload wrapping the 0x-routed swap. The transaction is inert until the Base sequencer evaluates the attached conditions (beforeBlock, fromBlock, flashblockIndex, minNativeBalanceWei, or storage predicate). When conditions are satisfied the transaction is included; if they are never met it simply expires. No funds or keys are custodied by the service.

## 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": [
      "sell",
      "buy",
      "amount",
      "taker"
     ],
     "properties": {
      "buy": {
       "type": "string",
       "description": "Token you buy"
      },
      "sell": {
       "type": "string",
       "description": "Token you sell"
      },
      "taker": {
       "type": "string",
       "description": "Your wallet (signs the swap)"
      },
      "amount": {
       "type": "string",
       "description": "Amount you sell"
      },
      "slippage": {
       "type": "string",
       "description": "Slippage in bps (optional, default 100)"
      },
      "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)"
      },
      "storageAddress": {
       "type": "string",
       "description": "Advanced: pool/token for a storage condition"
      },
      "flashblockIndex": {
       "type": "string",
       "description": "Flashblock index 1-10 (optional)"
      },
      "minNativeBalanceWei": {
       "type": "string",
       "description": "Min taker ETH balance in 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/base-swap-conditional-validity-transaction-800efdcf/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)
