{
  "openapi": "3.1.0",
  "info": {
    "title": "NoJunk Chain",
    "version": "1.0.0",
    "description": "Multi-chain wallet balances, gas prices, transaction and block lookups across 7 EVM chains, Solana and Bitcoin. Pay per call with USDC on Base (x402). No API key.",
    "x-guidance": "Cheap read-only blockchain lookups for AI agents, paid per call in USDC on Base via x402; you are only charged when data is returned (400/404/413/502 are free). GET with query parameters or POST a JSON body. Chains: base, ethereum, bsc, arbitrum, polygon, optimism, avalanche (EVM), solana, bitcoin. /balance $0.002 {address, chain?} -> native balance (wei/lamports/sats + formatted), USDC balance (raw + formatted) and tx count; a 0x address defaults to all 7 EVM chains in one call (per-chain ok/error, charged if at least one succeeds), a base58 address to solana, a Bitcoin address to bitcoin. /gas $0.001 {chain?} -> per EVM chain: gas_price_gwei, base_fee_gwei, next_base_fee_gwei, priority_fee_gwei {p25, p50, p75} averaged over the last 5 blocks, suggested {slow, standard, fast} and block_number; default all 7 EVM chains; chain=bitcoin -> sat/vB estimates (fastest, half_hour, hour, economy, minimum). /tx $0.002 {hash, chain} -> EVM: status success|failed|pending, from, to, value, gas_used, fee, confirmations, erc20_transfers [{token, from, to, raw_amount}] decoded from Transfer logs (amounts are in the token's smallest unit); chain is required for 0x hashes because the same hash format is used on every EVM chain; bitcoin and solana are inferred from the hash. /block $0.001 {chain, number?|hash?} -> number, hash, timestamp, tx_count, gas_used, gas_limit, base_fee, miner (EVM); Bitcoin header; Solana slot (number = slot). All raw amounts are decimal strings (BigInt-safe); formatted values are decimal strings in whole coins. Data comes from public nodes (publicnode.com JSON-RPC, mempool.space REST) and is live, not cached. Best for: checking whether a wallet holds funds or USDC before acting, estimating gas before sending, confirming a payment or transfer landed, verifying a transaction's status and token movements, watching chain head / block times."
  },
  "servers": [
    {
      "url": "https://nojunk-chain.mick8511.workers.dev"
    }
  ],
  "paths": {
    "/balance": {
      "get": {
        "operationId": "balance",
        "summary": "Native + USDC balance and tx count for a wallet on 7 EVM chains (one or all), Solana or Bitcoin",
        "tags": [
          "Blockchain",
          "Crypto",
          "Web3",
          "balance"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Wallet address. EVM: 0x + 40 hex (checked on every EVM chain unless chain is set). Solana: base58, 32-44 chars. Bitcoin: bc1..., 1... or 3..."
          },
          {
            "name": "chain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Which chain to query. 0x address: one EVM chain or all (default all). Base58 address: solana (default). Bitcoin address: bitcoin (default)."
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "address": {
                      "type": "string"
                    },
                    "address_type": {
                      "type": "string",
                      "enum": [
                        "evm",
                        "solana",
                        "bitcoin"
                      ]
                    },
                    "scope": {
                      "type": "string",
                      "description": "Chain queried, or all"
                    },
                    "chains_ok": {
                      "type": "integer"
                    },
                    "chains_failed": {
                      "type": "integer"
                    },
                    "balances": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "ok": {
                            "type": "boolean"
                          },
                          "chain": {
                            "type": "string"
                          },
                          "chain_id": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "chain_name": {
                            "type": "string"
                          },
                          "address": {
                            "type": "string"
                          },
                          "native": {
                            "type": "object",
                            "description": "Native coin balance: {symbol, wei|lamports|sats (decimal string), formatted (decimal string in whole coins)}; Bitcoin adds unconfirmed_sats"
                          },
                          "usdc": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "description": "USDC balance on this chain: {contract|mint, decimals, raw (decimal string), formatted}; null on Bitcoin, raw/formatted null if the token call failed"
                          },
                          "tx_count": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "EVM nonce (outgoing tx count) / Bitcoin confirmed tx count; null on Solana"
                          },
                          "block_number": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "slot": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "explorer": {
                            "type": "string"
                          },
                          "error": {
                            "type": "string",
                            "description": "Only when ok is false"
                          }
                        },
                        "required": [
                          "ok",
                          "chain"
                        ]
                      },
                      "description": "Keyed by chain name. Each entry is either a result with ok: true or {ok: false, chain, error} when that chain's node failed; the call is only charged when at least one chain succeeded."
                    },
                    "fetched_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "address",
                    "address_type",
                    "scope",
                    "chains_ok",
                    "chains_failed",
                    "balances",
                    "fetched_at"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid parameters (no charge)"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Bitcoin address unknown to mempool.space (no charge)"
          },
          "413": {
            "description": "Request body larger than 16384 bytes (no charge)"
          },
          "502": {
            "description": "Node unreachable, timed out (8 s) or returned an error; for chain=all only when every chain failed (no charge)"
          }
        }
      },
      "post": {
        "operationId": "balancePost",
        "summary": "Native + USDC balance and tx count for a wallet on 7 EVM chains (one or all), Solana or Bitcoin",
        "tags": [
          "Blockchain",
          "Crypto",
          "Web3",
          "balance"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string",
                    "description": "Wallet address. EVM: 0x + 40 hex (checked on every EVM chain unless chain is set). Solana: base58, 32-44 chars. Bitcoin: bc1..., 1... or 3..."
                  },
                  "chain": {
                    "type": "string",
                    "enum": [
                      "base",
                      "ethereum",
                      "bsc",
                      "arbitrum",
                      "polygon",
                      "optimism",
                      "avalanche",
                      "solana",
                      "bitcoin",
                      "all"
                    ],
                    "description": "Which chain to query. 0x address: one EVM chain or all (default all). Base58 address: solana (default). Bitcoin address: bitcoin (default)."
                  }
                },
                "required": [
                  "address"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "address": {
                      "type": "string"
                    },
                    "address_type": {
                      "type": "string",
                      "enum": [
                        "evm",
                        "solana",
                        "bitcoin"
                      ]
                    },
                    "scope": {
                      "type": "string",
                      "description": "Chain queried, or all"
                    },
                    "chains_ok": {
                      "type": "integer"
                    },
                    "chains_failed": {
                      "type": "integer"
                    },
                    "balances": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "ok": {
                            "type": "boolean"
                          },
                          "chain": {
                            "type": "string"
                          },
                          "chain_id": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "chain_name": {
                            "type": "string"
                          },
                          "address": {
                            "type": "string"
                          },
                          "native": {
                            "type": "object",
                            "description": "Native coin balance: {symbol, wei|lamports|sats (decimal string), formatted (decimal string in whole coins)}; Bitcoin adds unconfirmed_sats"
                          },
                          "usdc": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "description": "USDC balance on this chain: {contract|mint, decimals, raw (decimal string), formatted}; null on Bitcoin, raw/formatted null if the token call failed"
                          },
                          "tx_count": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "EVM nonce (outgoing tx count) / Bitcoin confirmed tx count; null on Solana"
                          },
                          "block_number": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "slot": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "explorer": {
                            "type": "string"
                          },
                          "error": {
                            "type": "string",
                            "description": "Only when ok is false"
                          }
                        },
                        "required": [
                          "ok",
                          "chain"
                        ]
                      },
                      "description": "Keyed by chain name. Each entry is either a result with ok: true or {ok: false, chain, error} when that chain's node failed; the call is only charged when at least one chain succeeded."
                    },
                    "fetched_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "address",
                    "address_type",
                    "scope",
                    "chains_ok",
                    "chains_failed",
                    "balances",
                    "fetched_at"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid parameters (no charge)"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Bitcoin address unknown to mempool.space (no charge)"
          },
          "413": {
            "description": "Request body larger than 16384 bytes (no charge)"
          },
          "502": {
            "description": "Node unreachable, timed out (8 s) or returned an error; for chain=all only when every chain failed (no charge)"
          }
        }
      }
    },
    "/gas": {
      "get": {
        "operationId": "gas",
        "summary": "Gas price, base fee and priority-fee percentiles (gwei) for EVM chains; Bitcoin sat/vB fees",
        "tags": [
          "Blockchain",
          "Crypto",
          "Web3",
          "gas"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "parameters": [
          {
            "name": "chain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "One EVM chain, bitcoin, or all (= the 7 EVM chains in parallel)"
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "scope": {
                      "type": "string"
                    },
                    "unit": {
                      "type": "string"
                    },
                    "chains_ok": {
                      "type": "integer"
                    },
                    "chains_failed": {
                      "type": "integer"
                    },
                    "gas": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "ok": {
                            "type": "boolean"
                          },
                          "chain": {
                            "type": "string"
                          },
                          "chain_id": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "chain_name": {
                            "type": "string"
                          },
                          "block_number": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "gas_price_gwei": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "eth_gasPrice in gwei"
                          },
                          "gas_price_wei": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "base_fee_gwei": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Base fee of the latest block"
                          },
                          "next_base_fee_gwei": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Base fee of the next block (from eth_feeHistory)"
                          },
                          "priority_fee_gwei": {
                            "type": "object",
                            "description": "Average tip over the last 5 blocks at the 25th/50th/75th percentile: {p25, p50, p75}"
                          },
                          "suggested": {
                            "type": "object",
                            "description": "{slow, standard, fast}: each {max_priority_fee_gwei, max_fee_gwei = 2 * next base fee + tip}"
                          },
                          "fee_history": {
                            "type": "object"
                          },
                          "eip1559": {
                            "type": "boolean"
                          },
                          "block_height": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Bitcoin only"
                          },
                          "fees_sat_per_vbyte": {
                            "type": "object",
                            "description": "Bitcoin only: {fastest, half_hour, hour, economy, minimum}"
                          },
                          "error": {
                            "type": "string",
                            "description": "Only when ok is false"
                          }
                        },
                        "required": [
                          "ok",
                          "chain"
                        ]
                      },
                      "description": "Keyed by chain name. Each entry is either a result with ok: true or {ok: false, chain, error} when that chain's node failed; the call is only charged when at least one chain succeeded."
                    },
                    "fetched_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "scope",
                    "chains_ok",
                    "chains_failed",
                    "gas",
                    "fetched_at"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid parameters (no charge)"
          },
          "402": {
            "description": "Payment Required"
          },
          "413": {
            "description": "Request body larger than 16384 bytes (no charge)"
          },
          "502": {
            "description": "Node unreachable, timed out (8 s) or returned an error; for chain=all only when every chain failed (no charge)"
          }
        }
      },
      "post": {
        "operationId": "gasPost",
        "summary": "Gas price, base fee and priority-fee percentiles (gwei) for EVM chains; Bitcoin sat/vB fees",
        "tags": [
          "Blockchain",
          "Crypto",
          "Web3",
          "gas"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "chain": {
                    "type": "string",
                    "enum": [
                      "base",
                      "ethereum",
                      "bsc",
                      "arbitrum",
                      "polygon",
                      "optimism",
                      "avalanche",
                      "bitcoin",
                      "all"
                    ],
                    "default": "all",
                    "description": "One EVM chain, bitcoin, or all (= the 7 EVM chains in parallel)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "scope": {
                      "type": "string"
                    },
                    "unit": {
                      "type": "string"
                    },
                    "chains_ok": {
                      "type": "integer"
                    },
                    "chains_failed": {
                      "type": "integer"
                    },
                    "gas": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "ok": {
                            "type": "boolean"
                          },
                          "chain": {
                            "type": "string"
                          },
                          "chain_id": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "chain_name": {
                            "type": "string"
                          },
                          "block_number": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "gas_price_gwei": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "eth_gasPrice in gwei"
                          },
                          "gas_price_wei": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "base_fee_gwei": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Base fee of the latest block"
                          },
                          "next_base_fee_gwei": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Base fee of the next block (from eth_feeHistory)"
                          },
                          "priority_fee_gwei": {
                            "type": "object",
                            "description": "Average tip over the last 5 blocks at the 25th/50th/75th percentile: {p25, p50, p75}"
                          },
                          "suggested": {
                            "type": "object",
                            "description": "{slow, standard, fast}: each {max_priority_fee_gwei, max_fee_gwei = 2 * next base fee + tip}"
                          },
                          "fee_history": {
                            "type": "object"
                          },
                          "eip1559": {
                            "type": "boolean"
                          },
                          "block_height": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Bitcoin only"
                          },
                          "fees_sat_per_vbyte": {
                            "type": "object",
                            "description": "Bitcoin only: {fastest, half_hour, hour, economy, minimum}"
                          },
                          "error": {
                            "type": "string",
                            "description": "Only when ok is false"
                          }
                        },
                        "required": [
                          "ok",
                          "chain"
                        ]
                      },
                      "description": "Keyed by chain name. Each entry is either a result with ok: true or {ok: false, chain, error} when that chain's node failed; the call is only charged when at least one chain succeeded."
                    },
                    "fetched_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "scope",
                    "chains_ok",
                    "chains_failed",
                    "gas",
                    "fetched_at"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid parameters (no charge)"
          },
          "402": {
            "description": "Payment Required"
          },
          "413": {
            "description": "Request body larger than 16384 bytes (no charge)"
          },
          "502": {
            "description": "Node unreachable, timed out (8 s) or returned an error; for chain=all only when every chain failed (no charge)"
          }
        }
      }
    },
    "/tx": {
      "get": {
        "operationId": "tx",
        "summary": "Transaction lookup with receipt, confirmations and decoded ERC-20 transfers (EVM), or Bitcoin / Solana transaction",
        "tags": [
          "Blockchain",
          "Crypto",
          "Web3",
          "tx"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "parameters": [
          {
            "name": "hash",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "EVM: 0x + 64 hex. Bitcoin: 64-hex txid. Solana: base58 signature (87-88 chars)."
          },
          {
            "name": "chain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for EVM hashes (the same hash format is used on every EVM chain). bitcoin and solana are inferred from the hash format and may be omitted."
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "EVM fields shown; Bitcoin returns {status confirmed|unconfirmed, block_height, confirmations, fee_sats, vsize, fee_rate_sat_per_vbyte, inputs[], outputs[], total_output_sats}; Solana returns {status success|failed, slot, block_time, fee_lamports, signers[], programs[], instruction_count, accounts[{pubkey, signer, writable, change_lamports}]}",
                  "properties": {
                    "chain": {
                      "type": "string"
                    },
                    "chain_id": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "chain_name": {
                      "type": "string"
                    },
                    "hash": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "description": "EVM: success | failed | pending. Bitcoin: confirmed | unconfirmed. Solana: success | failed"
                    },
                    "block_number": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "block_hash": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "transaction_index": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "confirmations": {
                      "type": "integer",
                      "description": "Blocks since inclusion (0 when pending)"
                    },
                    "from": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "to": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "null for contract creation"
                    },
                    "contract_created": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "value_wei": {
                      "type": "string"
                    },
                    "value_formatted": {
                      "type": "string",
                      "description": "Native value in whole coins"
                    },
                    "native_symbol": {
                      "type": "string"
                    },
                    "nonce": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "type": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "gas_limit": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "gas_used": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "gas_price_wei": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "effective_gas_price_wei": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "effective_gas_price_gwei": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "max_fee_per_gas_wei": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "max_priority_fee_per_gas_wei": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "fee_wei": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "fee_formatted": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "gas_used * effective gas price, in whole coins"
                    },
                    "input_selector": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "First 4 bytes of calldata (function selector), e.g. 0xa9059cbb = transfer"
                    },
                    "input_bytes": {
                      "type": "integer"
                    },
                    "logs_count": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "erc20_transfers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "token": {
                            "type": "string",
                            "description": "ERC-20 contract address"
                          },
                          "from": {
                            "type": "string"
                          },
                          "to": {
                            "type": "string"
                          },
                          "raw_amount": {
                            "type": "string",
                            "description": "Token amount in the token's smallest unit (decimal string); divide by the token's decimals"
                          },
                          "log_index": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "token",
                          "from",
                          "to",
                          "raw_amount"
                        ]
                      },
                      "description": "Decoded Transfer(address,address,uint256) events (max 100)"
                    },
                    "explorer": {
                      "type": "string"
                    },
                    "fetched_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "chain",
                    "hash",
                    "status",
                    "confirmations",
                    "explorer",
                    "fetched_at"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid parameters (no charge)"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Transaction not found on that chain (no charge)"
          },
          "413": {
            "description": "Request body larger than 16384 bytes (no charge)"
          },
          "502": {
            "description": "Node unreachable, timed out (8 s) or returned an error; for chain=all only when every chain failed (no charge)"
          }
        }
      },
      "post": {
        "operationId": "txPost",
        "summary": "Transaction lookup with receipt, confirmations and decoded ERC-20 transfers (EVM), or Bitcoin / Solana transaction",
        "tags": [
          "Blockchain",
          "Crypto",
          "Web3",
          "tx"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "hash": {
                    "type": "string",
                    "description": "EVM: 0x + 64 hex. Bitcoin: 64-hex txid. Solana: base58 signature (87-88 chars)."
                  },
                  "chain": {
                    "type": "string",
                    "enum": [
                      "base",
                      "ethereum",
                      "bsc",
                      "arbitrum",
                      "polygon",
                      "optimism",
                      "avalanche",
                      "solana",
                      "bitcoin"
                    ],
                    "description": "Required for EVM hashes (the same hash format is used on every EVM chain). bitcoin and solana are inferred from the hash format and may be omitted."
                  }
                },
                "required": [
                  "hash"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "EVM fields shown; Bitcoin returns {status confirmed|unconfirmed, block_height, confirmations, fee_sats, vsize, fee_rate_sat_per_vbyte, inputs[], outputs[], total_output_sats}; Solana returns {status success|failed, slot, block_time, fee_lamports, signers[], programs[], instruction_count, accounts[{pubkey, signer, writable, change_lamports}]}",
                  "properties": {
                    "chain": {
                      "type": "string"
                    },
                    "chain_id": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "chain_name": {
                      "type": "string"
                    },
                    "hash": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "description": "EVM: success | failed | pending. Bitcoin: confirmed | unconfirmed. Solana: success | failed"
                    },
                    "block_number": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "block_hash": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "transaction_index": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "confirmations": {
                      "type": "integer",
                      "description": "Blocks since inclusion (0 when pending)"
                    },
                    "from": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "to": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "null for contract creation"
                    },
                    "contract_created": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "value_wei": {
                      "type": "string"
                    },
                    "value_formatted": {
                      "type": "string",
                      "description": "Native value in whole coins"
                    },
                    "native_symbol": {
                      "type": "string"
                    },
                    "nonce": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "type": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "gas_limit": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "gas_used": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "gas_price_wei": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "effective_gas_price_wei": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "effective_gas_price_gwei": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "max_fee_per_gas_wei": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "max_priority_fee_per_gas_wei": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "fee_wei": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "fee_formatted": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "gas_used * effective gas price, in whole coins"
                    },
                    "input_selector": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "First 4 bytes of calldata (function selector), e.g. 0xa9059cbb = transfer"
                    },
                    "input_bytes": {
                      "type": "integer"
                    },
                    "logs_count": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "erc20_transfers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "token": {
                            "type": "string",
                            "description": "ERC-20 contract address"
                          },
                          "from": {
                            "type": "string"
                          },
                          "to": {
                            "type": "string"
                          },
                          "raw_amount": {
                            "type": "string",
                            "description": "Token amount in the token's smallest unit (decimal string); divide by the token's decimals"
                          },
                          "log_index": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "token",
                          "from",
                          "to",
                          "raw_amount"
                        ]
                      },
                      "description": "Decoded Transfer(address,address,uint256) events (max 100)"
                    },
                    "explorer": {
                      "type": "string"
                    },
                    "fetched_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "chain",
                    "hash",
                    "status",
                    "confirmations",
                    "explorer",
                    "fetched_at"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid parameters (no charge)"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Transaction not found on that chain (no charge)"
          },
          "413": {
            "description": "Request body larger than 16384 bytes (no charge)"
          },
          "502": {
            "description": "Node unreachable, timed out (8 s) or returned an error; for chain=all only when every chain failed (no charge)"
          }
        }
      }
    },
    "/block": {
      "get": {
        "operationId": "block",
        "summary": "Block summary by number, hash or latest (EVM, Bitcoin) or slot (Solana)",
        "tags": [
          "Blockchain",
          "Crypto",
          "Web3",
          "block"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "parameters": [
          {
            "name": "chain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "number",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Block number (decimal or 0x hex) / Solana slot, or \"latest\" (default when number and hash are omitted)"
          },
          {
            "name": "hash",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Block hash (EVM 0x + 64 hex, Bitcoin 64 hex). Not supported for Solana. Mutually exclusive with number."
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "EVM fields shown; Bitcoin adds height, median_time, weight, difficulty, nonce, bits, version, merkle_root; Solana returns slot, block_height, hash (blockhash), parent_hash, parent_slot, timestamp",
                  "properties": {
                    "chain": {
                      "type": "string"
                    },
                    "chain_id": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "chain_name": {
                      "type": "string"
                    },
                    "number": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "hash": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "parent_hash": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "timestamp": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Unix seconds"
                    },
                    "timestamp_iso": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "tx_count": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "gas_used": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "gas_limit": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "gas_used_pct": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "base_fee_wei": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "base_fee_gwei": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "miner": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "size_bytes": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "explorer": {
                      "type": "string"
                    },
                    "fetched_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "chain",
                    "number",
                    "hash",
                    "timestamp",
                    "tx_count",
                    "explorer",
                    "fetched_at"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid parameters (no charge)"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Block / slot does not exist or was skipped (no charge)"
          },
          "413": {
            "description": "Request body larger than 16384 bytes (no charge)"
          },
          "502": {
            "description": "Node unreachable, timed out (8 s) or returned an error; for chain=all only when every chain failed (no charge)"
          }
        }
      },
      "post": {
        "operationId": "blockPost",
        "summary": "Block summary by number, hash or latest (EVM, Bitcoin) or slot (Solana)",
        "tags": [
          "Blockchain",
          "Crypto",
          "Web3",
          "block"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "chain": {
                    "type": "string",
                    "enum": [
                      "base",
                      "ethereum",
                      "bsc",
                      "arbitrum",
                      "polygon",
                      "optimism",
                      "avalanche",
                      "solana",
                      "bitcoin"
                    ]
                  },
                  "number": {
                    "type": [
                      "string",
                      "integer"
                    ],
                    "description": "Block number (decimal or 0x hex) / Solana slot, or \"latest\" (default when number and hash are omitted)"
                  },
                  "hash": {
                    "type": "string",
                    "description": "Block hash (EVM 0x + 64 hex, Bitcoin 64 hex). Not supported for Solana. Mutually exclusive with number."
                  }
                },
                "required": [
                  "chain"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "EVM fields shown; Bitcoin adds height, median_time, weight, difficulty, nonce, bits, version, merkle_root; Solana returns slot, block_height, hash (blockhash), parent_hash, parent_slot, timestamp",
                  "properties": {
                    "chain": {
                      "type": "string"
                    },
                    "chain_id": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "chain_name": {
                      "type": "string"
                    },
                    "number": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "hash": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "parent_hash": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "timestamp": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Unix seconds"
                    },
                    "timestamp_iso": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "tx_count": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "gas_used": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "gas_limit": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "gas_used_pct": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "base_fee_wei": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "base_fee_gwei": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "miner": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "size_bytes": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "explorer": {
                      "type": "string"
                    },
                    "fetched_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "chain",
                    "number",
                    "hash",
                    "timestamp",
                    "tx_count",
                    "explorer",
                    "fetched_at"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid parameters (no charge)"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Block / slot does not exist or was skipped (no charge)"
          },
          "413": {
            "description": "Request body larger than 16384 bytes (no charge)"
          },
          "502": {
            "description": "Node unreachable, timed out (8 s) or returned an error; for chain=all only when every chain failed (no charge)"
          }
        }
      }
    }
  }
}