[
  {
    "name": "site.home",
    "description": "What Mox is, and every link.",
    "url": "https://mox.network/",
    "method": "GET",
    "group": "site",
    "kind": "link"
  },
  {
    "name": "site.getting_started",
    "description": "From a wallet to a deployed contract on the public testnet.",
    "url": "https://mox.network/getting-started.html",
    "method": "GET",
    "group": "site",
    "kind": "link"
  },
  {
    "name": "site.download",
    "description": "bitprint, the identity provider extension (soon).",
    "url": "https://mox.network/download.html",
    "method": "GET",
    "group": "site",
    "kind": "link"
  },
  {
    "name": "site.terms",
    "description": "Draft testnet terms.",
    "url": "https://mox.network/terms.html",
    "method": "GET",
    "group": "site",
    "kind": "link"
  },
  {
    "name": "site.privacy",
    "description": "Draft testnet privacy notice.",
    "url": "https://mox.network/privacy.html",
    "method": "GET",
    "group": "site",
    "kind": "link"
  },
  {
    "name": "console.open",
    "description": "The wallet and console (keys stay in the browser).",
    "url": "https://console.mox.network",
    "method": "GET",
    "group": "console",
    "kind": "link"
  },
  {
    "name": "console.faucet",
    "description": "Request testnet MUR for the selected account.",
    "url": "https://console.mox.network/#/faucet",
    "method": "GET",
    "group": "console",
    "kind": "link"
  },
  {
    "name": "console.explorer",
    "description": "Search transactions, addresses and commits.",
    "url": "https://console.mox.network/#/explorer",
    "method": "GET",
    "group": "console",
    "kind": "link"
  },
  {
    "name": "console.contracts",
    "description": "Deploy a contract, open one by address, call it, read its views.",
    "url": "https://console.mox.network/#/contracts",
    "method": "GET",
    "group": "console",
    "kind": "link"
  },
  {
    "name": "console.contract",
    "description": "Open a deployed contract by address.",
    "url": "https://console.mox.network/#/contracts/{address}",
    "method": "GET",
    "group": "console",
    "kind": "link"
  },
  {
    "name": "console.bridge",
    "description": "Send MUR to another network (the Mesh page).",
    "url": "https://console.mox.network/#/mesh",
    "method": "GET",
    "group": "console",
    "kind": "link"
  },
  {
    "name": "console.trade",
    "description": "Markets on the standard exchange.",
    "url": "https://console.mox.network/#/trade",
    "method": "GET",
    "group": "console",
    "kind": "link"
  },
  {
    "name": "console.stake",
    "description": "Validators, bond and unbond.",
    "url": "https://console.mox.network/#/stake",
    "method": "GET",
    "group": "console",
    "kind": "link"
  },
  {
    "name": "console.network",
    "description": "Validators by region and the live DAG.",
    "url": "https://console.mox.network/#/network",
    "method": "GET",
    "group": "console",
    "kind": "link"
  },
  {
    "name": "console.analytics",
    "description": "Throughput, latency, mempools, fees.",
    "url": "https://console.mox.network/#/analytics",
    "method": "GET",
    "group": "console",
    "kind": "link"
  },
  {
    "name": "docs.open",
    "description": "Specs, guide and reference.",
    "url": "https://docs.mox.network",
    "method": "GET",
    "group": "docs",
    "kind": "link"
  },
  {
    "name": "docs.api",
    "description": "The API reference, generated from this registry.",
    "url": "https://docs.mox.network/api/",
    "method": "GET",
    "group": "docs",
    "kind": "link"
  },
  {
    "name": "chain.status",
    "description": "A validator's status: chain id, epoch, latest decided and executed commits, mempool, peers, health.",
    "url": "https://api.mox.network/",
    "method": "POST",
    "group": "chain",
    "kind": "read",
    "via": "gateway",
    "rpc": "mox_status",
    "input": {
      "type": "object",
      "properties": {},
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "validator": {
          "type": "integer",
          "minimum": 0,
          "description": "Node index"
        },
        "member": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "description": "Committee index in the current epoch (null: a follower)"
            },
            {
              "type": "null"
            }
          ]
        },
        "epoch": {
          "type": "integer",
          "minimum": 0,
          "description": "Epoch"
        },
        "chain_id": {
          "type": "integer",
          "minimum": 0,
          "description": "Chain id"
        },
        "commit_index": {
          "type": "integer",
          "minimum": 0,
          "description": "Latest commit decided"
        },
        "executed_index": {
          "type": "integer",
          "minimum": 0,
          "description": "Latest commit executed (use as a transaction's snapshot)"
        },
        "highest_round": {
          "type": "integer",
          "minimum": 0,
          "description": "Highest DAG round seen"
        },
        "effects": {
          "type": "string",
          "description": "Effects digest after executed_index"
        },
        "mempool": {
          "type": "integer",
          "minimum": 0,
          "description": "Transactions waiting"
        },
        "peers_connected": {
          "type": "integer",
          "minimum": 0,
          "description": "Peers"
        },
        "halted": {
          "type": "boolean",
          "description": "Stopped on a safety alarm"
        },
        "executed_txs": {
          "type": "integer",
          "minimum": 0,
          "description": "Transactions executed"
        },
        "alarms": {
          "type": "array",
          "items": {
            "type": "string",
            "description": "Alarm"
          }
        },
        "excluded_leaders": {
          "type": "array",
          "items": {
            "type": "integer",
            "minimum": 0,
            "description": "Node"
          }
        }
      }
    },
    "examples": [
      {
        "input": {},
        "output": {
          "chain_id": 1337,
          "epoch": 0,
          "commit_index": 5120,
          "executed_index": 5120,
          "member": 0,
          "halted": false
        }
      }
    ]
  },
  {
    "name": "chain.epoch",
    "description": "The current epoch (committee, threshold key) and any scheduled reconfiguration.",
    "url": "https://api.mox.network/",
    "method": "POST",
    "group": "chain",
    "kind": "read",
    "via": "gateway",
    "rpc": "mox_epoch",
    "input": {
      "type": "object",
      "properties": {},
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "current": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "epoch": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Epoch"
                },
                "committee": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "node": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Node"
                      },
                      "stake": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Weight"
                      }
                    }
                  }
                },
                "threshold_public": {
                  "type": "string",
                  "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
                  "description": "Threshold public key set: 0x hex"
                },
                "start_commit": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "First commit of the epoch"
                }
              }
            },
            {
              "type": "null"
            }
          ]
        },
        "next": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "info": {
                  "type": "object",
                  "properties": {
                    "epoch": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Epoch"
                    },
                    "committee": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "node": {
                            "type": "integer",
                            "minimum": 0,
                            "description": "Node"
                          },
                          "stake": {
                            "type": "integer",
                            "minimum": 0,
                            "description": "Weight"
                          }
                        }
                      }
                    },
                    "threshold_public": {
                      "type": "string",
                      "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
                      "description": "Threshold public key set: 0x hex"
                    },
                    "start_commit": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "First commit of the epoch"
                    }
                  }
                },
                "end_round": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "The current epoch ends after this round"
                }
              }
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "examples": [
      {
        "input": {}
      }
    ]
  },
  {
    "name": "chain.fees",
    "description": "Prices in force (per million compute units, per byte, deposit per stored byte), surcharges by domain, the fee pool, burned and minted totals, deposits held, and optionally one fee tank.",
    "url": "https://api.mox.network/",
    "method": "POST",
    "group": "chain",
    "kind": "read",
    "via": "gateway",
    "rpc": "mox_fees",
    "input": {
      "type": "object",
      "properties": {
        "tank": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Also show the fee tank of this address: 32 bytes, 0x hex"
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "tariff": {
          "type": "object",
          "properties": {
            "per_mcu": {
              "type": "integer",
              "minimum": 0,
              "description": "MUR base units per million CU"
            },
            "per_byte": {
              "type": "integer",
              "minimum": 0,
              "description": "Per transaction byte"
            },
            "deposit_per_byte": {
              "type": "integer",
              "minimum": 0,
              "description": "Refundable, per stored byte"
            }
          }
        },
        "surcharges": {
          "type": "object",
          "properties": {},
          "description": "ORDERED surcharge per domain"
        },
        "pool": {
          "type": "string",
          "pattern": "^[0-9]+$",
          "description": "Fee pool"
        },
        "burned": {
          "type": "string",
          "pattern": "^[0-9]+$",
          "description": "Burned"
        },
        "deposits": {
          "type": "string",
          "pattern": "^[0-9]+$",
          "description": "Deposits held"
        },
        "tank": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "address": {
                  "type": "string",
                  "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
                  "description": "Tank: 0x hex"
                },
                "available": {
                  "type": "string",
                  "pattern": "^[0-9]+$",
                  "description": "Available"
                }
              }
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "examples": [
      {
        "input": {}
      }
    ]
  },
  {
    "name": "chain.rewards",
    "description": "Validator rewards: parameters, this period's committed blocks per node, the last payout. Null if the chain pays none.",
    "url": "https://api.mox.network/",
    "method": "POST",
    "group": "chain",
    "kind": "read",
    "via": "gateway",
    "rpc": "mox_rewards",
    "input": {
      "type": "object",
      "properties": {},
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "period_ms": {
              "type": "integer",
              "minimum": 0,
              "description": "Period"
            },
            "commission_ppm": {
              "type": "integer",
              "minimum": 0,
              "description": "Commission"
            },
            "blocks": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "node": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Node"
                  },
                  "blocks": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Blocks"
                  }
                }
              }
            },
            "distributed": {
              "type": "string",
              "pattern": "^[0-9]+$",
              "description": "Paid so far"
            }
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "examples": [
      {
        "input": {}
      }
    ]
  },
  {
    "name": "chain.bootstrap",
    "description": "Bootstrap security: the phase, its gate and the readings against it, guardian and open stake per node, jailed nodes. Null if the chain is governed directly.",
    "url": "https://api.mox.network/",
    "method": "POST",
    "group": "chain",
    "kind": "read",
    "via": "gateway",
    "rpc": "mox_bootstrap",
    "input": {
      "type": "object",
      "properties": {},
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "phase": {
              "type": "integer",
              "minimum": 0,
              "description": "Phase 0–3"
            },
            "gate_open": {
              "type": "boolean",
              "description": "The next phase may begin"
            },
            "jailed": {
              "type": "array",
              "items": {
                "type": "integer",
                "minimum": 0,
                "description": "Node"
              }
            },
            "stakes": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "node": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Node"
                  },
                  "guardian": {
                    "type": "string",
                    "pattern": "^[0-9]+$",
                    "description": "Guardian stake"
                  },
                  "open": {
                    "type": "string",
                    "pattern": "^[0-9]+$",
                    "description": "Open stake"
                  }
                }
              }
            }
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "examples": [
      {
        "input": {}
      }
    ]
  },
  {
    "name": "chain.checkpoint",
    "description": "A certified checkpoint: state and receipts roots, peers and outbox roots, the threshold signature, and the payload to anchor it elsewhere. Default: the latest.",
    "url": "https://api.mox.network/",
    "method": "POST",
    "group": "chain",
    "kind": "read",
    "via": "gateway",
    "rpc": "mox_checkpoint",
    "input": {
      "type": "object",
      "properties": {
        "index": {
          "type": "integer",
          "minimum": 0,
          "description": "Checkpoint (commit) index"
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "chain_id": {
              "type": "integer",
              "minimum": 0,
              "description": "Chain"
            },
            "index": {
              "type": "integer",
              "minimum": 0,
              "description": "Commit"
            },
            "state_root": {
              "type": "string",
              "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
              "description": "State root: 0x hex"
            },
            "receipts_root": {
              "type": "string",
              "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
              "description": "Receipts root: 0x hex"
            },
            "message": {
              "type": "string",
              "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
              "description": "Signed message: 0x hex"
            },
            "signature": {
              "type": "string",
              "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
              "description": "Threshold signature: 0x hex"
            },
            "anchor": {
              "type": "string",
              "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
              "description": "External anchor payload: 0x hex"
            }
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "examples": [
      {
        "input": {}
      }
    ]
  },
  {
    "name": "chain.security",
    "description": "Shared security: the provider this chain borrows stake from, rent, the borrowed stake table, and leases to consumer chains.",
    "url": "https://api.mox.network/",
    "method": "POST",
    "group": "chain",
    "kind": "read",
    "via": "gateway",
    "rpc": "mox_security",
    "input": {
      "type": "object",
      "properties": {},
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "provider": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "rent_paid": {
          "type": "string",
          "pattern": "^[0-9]+$",
          "description": "Rent paid"
        },
        "borrowed": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {}
          }
        },
        "leases": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {}
          }
        }
      }
    },
    "examples": [
      {
        "input": {}
      }
    ]
  },
  {
    "name": "chain.evidence",
    "description": "Slashing: proofs of equivocation this validator holds (for relaying to where the key is bonded), offences recorded here, jailed nodes, the key registry.",
    "url": "http://<validator rpc>/",
    "method": "POST",
    "group": "node",
    "kind": "read",
    "via": "node",
    "rpc": "mox_evidence",
    "input": {
      "type": "object",
      "properties": {},
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "proofs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {}
          }
        },
        "offences": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {}
          }
        },
        "jailed": {
          "type": "array",
          "items": {
            "type": "integer",
            "minimum": 0,
            "description": "Node"
          }
        },
        "validators": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "node": {
                "type": "integer",
                "minimum": 0,
                "description": "Node"
              },
              "key": {
                "type": "string",
                "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
                "description": "Key: 0x hex"
              }
            }
          }
        }
      }
    }
  },
  {
    "name": "chain.commit_hashes",
    "description": "Fingerprints of consecutive commits from `from`, for checking that validators agree (`mox check`).",
    "url": "http://<validator rpc>/",
    "method": "POST",
    "group": "node",
    "kind": "read",
    "via": "node",
    "rpc": "mox_commitHashes",
    "input": {
      "type": "object",
      "properties": {
        "from": {
          "type": "integer",
          "minimum": 0,
          "description": "First commit"
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10000,
          "description": "Most to return"
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "from": {
          "type": "integer",
          "minimum": 0,
          "description": "First commit returned"
        },
        "hashes": {
          "type": "array",
          "items": {
            "type": "string",
            "description": "Hex fingerprint"
          }
        },
        "oldest": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "description": "Oldest kept"
            },
            {
              "type": "null"
            }
          ]
        },
        "newest": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "description": "Newest kept"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    }
  },
  {
    "name": "node.set_fault",
    "description": "Switch this validator's injected fault at runtime (builds with the `testnet-faults` feature only), for fault campaigns. Null clears it.",
    "url": "http://<validator rpc>/",
    "method": "POST",
    "group": "node",
    "kind": "write",
    "signer": "none",
    "via": "node",
    "rpc": "mox_setFault",
    "input": {
      "type": "object",
      "properties": {
        "fault": {
          "anyOf": [
            {
              "type": "string",
              "description": "equivocate, silent, …"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "fault"
      ],
      "additionalProperties": false
    },
    "output": {
      "type": "boolean"
    }
  },
  {
    "name": "account.get",
    "description": "An account's next sequence number and native MUR balance (base units; 9 decimals).",
    "url": "https://api.mox.network/",
    "method": "POST",
    "group": "account",
    "kind": "read",
    "via": "gateway",
    "rpc": "mox_account",
    "input": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Address: 32 bytes, 0x hex"
        }
      },
      "required": [
        "address"
      ],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "next_seq": {
          "type": "integer",
          "minimum": 0,
          "description": "The sequence number its next transaction takes"
        },
        "balance": {
          "type": "string",
          "pattern": "^[0-9]+$",
          "description": "MUR, base units"
        }
      }
    },
    "examples": [
      {
        "input": {
          "address": "0x8c1f6a3e5b2d4c7f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f"
        },
        "output": {
          "next_seq": 3,
          "balance": "99998200000"
        }
      }
    ]
  },
  {
    "name": "account.faucet",
    "description": "Testnet MUR for an address, sent by the gateway's faucet account (limited per address and per IP).",
    "url": "https://api.mox.network/faucet",
    "method": "POST",
    "group": "account",
    "kind": "write",
    "signer": "none",
    "via": "gateway",
    "route": "POST /faucet",
    "input": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Recipient: 32 bytes, 0x hex"
        }
      },
      "required": [
        "address"
      ],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "hash": {
          "type": "string",
          "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
          "description": "The faucet's transfer: 0x hex"
        },
        "amount": {
          "type": "string",
          "pattern": "^[0-9]+$",
          "description": "Sent"
        },
        "from": {
          "type": "string",
          "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
          "description": "Faucet account: 0x hex"
        }
      }
    },
    "examples": [
      {
        "input": {
          "address": "0x8c1f6a3e5b2d4c7f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f"
        },
        "output": {
          "hash": "0x3b7d0f5c9e2a4b6c8d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e",
          "amount": "100000000000"
        }
      }
    ]
  },
  {
    "name": "tx.transfer",
    "description": "Prepare a native MUR transfer for the sender's wallet to sign: an unsigned transaction and a summary.",
    "url": null,
    "method": null,
    "group": "tx",
    "kind": "write",
    "signer": "wallet",
    "via": "sdk",
    "input": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Sender: the account that will sign (default: the configured account). Its sequence number and the snapshot are read now: 32 bytes, 0x hex"
        },
        "to": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Recipient: 32 bytes, 0x hex"
        },
        "amount": {
          "type": "string",
          "pattern": "^[0-9]+(\\.[0-9]+)?$",
          "description": "MUR as decimal text, e.g. 2.5"
        }
      },
      "required": [
        "to",
        "amount"
      ],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "summary": {
          "type": "string",
          "description": "What the transaction does, for the person approving it"
        },
        "from": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Sender: 32 bytes, 0x hex"
        },
        "unsigned": {
          "type": "object",
          "properties": {},
          "description": "The transaction as mox-client describes it (crates/mox-client/src/tx.rs), unsigned: chain_id, seq, snapshot, class, domain, limits, payload, value, fee"
        },
        "request": {
          "anyOf": [
            {
              "type": "object",
              "properties": {},
              "description": "The same as a wallet request (`mox_sendTransaction` params for window.mox or the console), when one can express it"
            },
            {
              "type": "null"
            }
          ]
        },
        "max_fee": {
          "type": "string",
          "pattern": "^[0-9]+$",
          "description": "The most it can cost at current prices (its declared limits); unused fees are refunded"
        },
        "next": {
          "type": "string",
          "description": "How to finish: sign, then tx.submit"
        }
      },
      "description": "An unsigned prepared transaction"
    },
    "examples": [
      {
        "input": {
          "from": "0x8c1f6a3e5b2d4c7f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f",
          "to": "0x3b7d0f5c9e2a4b6c8d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e",
          "amount": "2.5"
        }
      }
    ]
  },
  {
    "name": "tx.submit",
    "description": "Submit one signed transaction (MXE bytes, hex). Returns its hash; the receipt follows once a commit executes it.",
    "url": "https://api.mox.network/",
    "method": "POST",
    "group": "tx",
    "kind": "write",
    "signer": "none",
    "via": "gateway",
    "rpc": "mox_submit",
    "input": {
      "type": "object",
      "properties": {
        "tx": {
          "type": "string",
          "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
          "description": "Signed transaction: 0x hex"
        }
      },
      "required": [
        "tx"
      ],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "hash": {
          "type": "string",
          "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
          "description": "Transaction hash: 0x hex"
        }
      }
    }
  },
  {
    "name": "tx.submit_batch",
    "description": "Submit several signed transactions at once (at most 100 through the gateway): a hash or an error for each, in order.",
    "url": "https://api.mox.network/",
    "method": "POST",
    "group": "tx",
    "kind": "write",
    "signer": "none",
    "via": "gateway",
    "rpc": "mox_submitBatch",
    "input": {
      "type": "object",
      "properties": {
        "txs": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
            "description": "Signed transaction: 0x hex"
          }
        }
      },
      "required": [
        "txs"
      ],
      "additionalProperties": false
    },
    "output": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "hash": {
            "type": "string",
            "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
            "description": "Hash: 0x hex"
          },
          "error": {
            "type": "string",
            "description": "Why it was refused"
          }
        }
      }
    }
  },
  {
    "name": "tx.submit_raw",
    "description": "Submit signed transactions without JSON or hex, for high-rate clients: the body is each transaction as a 4-byte little-endian length and its bytes; the reply has, per transaction, 0 and the 32-byte hash, or 1, a 2-byte length and the error.",
    "url": "http://<validator rpc>/submit",
    "method": "POST",
    "group": "node",
    "kind": "write",
    "signer": "none",
    "via": "node",
    "route": "POST /submit",
    "input": {
      "type": "object",
      "properties": {
        "body": {
          "type": "string",
          "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
          "description": "The length-prefixed transactions: 0x hex"
        }
      },
      "required": [
        "body"
      ],
      "additionalProperties": false
    },
    "output": {
      "type": "string",
      "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
      "description": "The binary reply: 0x hex"
    }
  },
  {
    "name": "tx.receipt",
    "description": "A transaction's receipt (status, compute, fee, output, events), or null if not executed yet. With wait_ms, waits for it.",
    "url": "https://api.mox.network/",
    "method": "POST",
    "group": "tx",
    "kind": "read",
    "via": "gateway",
    "rpc": "mox_receipt",
    "input": {
      "type": "object",
      "properties": {
        "hash": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Transaction hash: 32 bytes, 0x hex"
        },
        "wait_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10000,
          "description": "Wait up to this long for it (≤ 10000)"
        }
      },
      "required": [
        "hash"
      ],
      "additionalProperties": false
    },
    "output": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "tx_hash": {
              "type": "string",
              "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
              "description": "Transaction hash: 0x hex"
            },
            "commit": {
              "type": "integer",
              "minimum": 0,
              "description": "The commit that executed it"
            },
            "status": {
              "type": "integer",
              "description": "0: success; >0: the contract's error code; <0: a system status"
            },
            "status_name": {
              "type": "string",
              "description": "Readable status"
            },
            "compute_used": {
              "type": "integer",
              "minimum": 0,
              "description": "Compute units used"
            },
            "fee": {
              "type": "string",
              "pattern": "^[0-9]+$",
              "description": "Fee charged (MUR base units)"
            },
            "refund": {
              "type": "string",
              "pattern": "^[0-9]+$",
              "description": "Deposit refunded (MUR base units)"
            },
            "output": {
              "type": "string",
              "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
              "description": "Raw output (a deploy's is the new contract's address): 0x hex"
            },
            "events": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "contract": {
                    "type": "string",
                    "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
                    "description": "Emitting contract: 0x hex"
                  },
                  "topics": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
                      "description": "Topic: 0x hex"
                    },
                    "description": "topics[0] is BLAKE3 of the event name"
                  },
                  "data": {
                    "type": "string",
                    "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
                    "description": "MXE-encoded fields: 0x hex"
                  },
                  "name": {
                    "type": "string",
                    "description": "Decoded event name, when the interface is known"
                  },
                  "fields": {
                    "description": "Any JSON value"
                  }
                },
                "description": "A contract event"
              }
            },
            "result": {
              "description": "Any JSON value"
            },
            "error": {
              "type": "string",
              "description": "Readable error, for failed contract calls"
            }
          },
          "description": "A transaction receipt"
        },
        {
          "type": "null"
        }
      ]
    },
    "examples": [
      {
        "input": {
          "hash": "0x3b7d0f5c9e2a4b6c8d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e",
          "wait_ms": 5000
        }
      }
    ]
  },
  {
    "name": "tx.estimate",
    "description": "Dry-run a signed transaction against the latest state: status, compute used, fee and refund. Nothing is kept.",
    "url": "https://api.mox.network/",
    "method": "POST",
    "group": "tx",
    "kind": "read",
    "via": "gateway",
    "rpc": "mox_estimate",
    "input": {
      "type": "object",
      "properties": {
        "tx": {
          "type": "string",
          "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
          "description": "Signed transaction: 0x hex"
        }
      },
      "required": [
        "tx"
      ],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "status": {
          "type": "integer"
        },
        "status_name": {
          "type": "string",
          "description": "Status"
        },
        "compute_used": {
          "type": "integer",
          "minimum": 0,
          "description": "Compute"
        },
        "fee": {
          "type": "string",
          "pattern": "^[0-9]+$",
          "description": "Fee"
        },
        "refund": {
          "type": "string",
          "pattern": "^[0-9]+$",
          "description": "Refund"
        }
      }
    }
  },
  {
    "name": "tx.decode",
    "description": "Decode signed transaction bytes: every field, the payload, the signers and the hash. What a confirmation screen shows.",
    "url": null,
    "method": null,
    "group": "tx",
    "kind": "read",
    "via": "sdk",
    "input": {
      "type": "object",
      "properties": {
        "tx": {
          "type": "string",
          "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
          "description": "Signed transaction: 0x hex"
        }
      },
      "required": [
        "tx"
      ],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {},
      "description": "The transaction as JSON"
    }
  },
  {
    "name": "contract.interface",
    "description": "A deployed contract's published interface: code hash, domain, creator, name, `.mxi` source, constants (hex) and the validated interface (MXE hex). Null if there is no contract there.",
    "url": "https://api.mox.network/",
    "method": "POST",
    "group": "contract",
    "kind": "read",
    "via": "gateway",
    "rpc": "mox_interface",
    "input": {
      "type": "object",
      "properties": {
        "contract": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Contract: 32 bytes, 0x hex"
        }
      },
      "required": [
        "contract"
      ],
      "additionalProperties": false
    },
    "output": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "code_hash": {
              "type": "string",
              "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
              "description": "Code: 0x hex"
            },
            "domain": {
              "type": "integer",
              "minimum": 0,
              "description": "Domain"
            },
            "creator": {
              "type": "string",
              "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
              "description": "Creator: 0x hex"
            },
            "name": {
              "type": "string",
              "description": "Name"
            },
            "source": {
              "type": "string",
              "description": ".mxi source"
            },
            "constants": {
              "type": "object",
              "properties": {}
            },
            "interface": {
              "type": "string",
              "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
              "description": "Interface (MXE): 0x hex"
            }
          }
        },
        {
          "type": "null"
        }
      ]
    }
  },
  {
    "name": "contract.code",
    "description": "Published code by standard name (mrc20, exchange, staking) or code hash, with its interface (MXE hex).",
    "url": "https://api.mox.network/",
    "method": "POST",
    "group": "contract",
    "kind": "read",
    "via": "gateway",
    "rpc": "mox_code",
    "input": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "A standard code's name"
        },
        "hash": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "A code hash: 32 bytes, 0x hex"
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "hash": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
              "description": "Code hash: 0x hex"
            },
            {
              "type": "null"
            }
          ]
        },
        "interface": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
              "description": "Interface (MXE): 0x hex"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "examples": [
      {
        "input": {
          "name": "mrc20"
        }
      }
    ]
  },
  {
    "name": "contract.query",
    "description": "Run any entry read-only against the latest state, with raw MXE input and output (contract.view encodes them by the interface).",
    "url": "https://api.mox.network/",
    "method": "POST",
    "group": "contract",
    "kind": "read",
    "via": "gateway",
    "rpc": "mox_query",
    "input": {
      "type": "object",
      "properties": {
        "contract": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Contract: 32 bytes, 0x hex"
        },
        "entry": {
          "type": "string",
          "description": "Entry name"
        },
        "input": {
          "type": "string",
          "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
          "description": "MXE-encoded arguments: 0x hex"
        }
      },
      "required": [
        "contract",
        "entry",
        "input"
      ],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "status": {
          "type": "integer"
        },
        "output": {
          "type": "string",
          "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
          "description": "Raw output: 0x hex"
        }
      }
    }
  },
  {
    "name": "contract.open",
    "description": "Load a deployed contract by address and generate one function per entry of its interface: `<alias>.<entry>` (views read, fns prepare a transaction).",
    "url": null,
    "method": null,
    "group": "contract",
    "kind": "read",
    "via": "sdk",
    "input": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Contract: 32 bytes, 0x hex"
        },
        "alias": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9_]{0,23}$",
          "description": "Name prefix for its functions (default: the contract's name, lowercased)"
        }
      },
      "required": [
        "address"
      ],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string",
          "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
          "description": "Contract: 0x hex"
        },
        "alias": {
          "type": "string",
          "description": "Prefix"
        },
        "name": {
          "type": "string",
          "description": "Contract name"
        },
        "functions": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "Function"
              },
              "kind": {
                "type": "string",
                "description": "read or write"
              },
              "description": {
                "type": "string",
                "description": "Signature and doc"
              }
            }
          }
        },
        "constants": {
          "type": "object",
          "properties": {}
        }
      }
    }
  },
  {
    "name": "contract.view",
    "description": "Call a view by name with JSON arguments, encoded and decoded by the contract's interface. Free, needs no wallet.",
    "url": null,
    "method": null,
    "group": "contract",
    "kind": "read",
    "via": "sdk",
    "input": {
      "type": "object",
      "properties": {
        "contract": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Contract: 32 bytes, 0x hex"
        },
        "entry": {
          "type": "string",
          "description": "View name"
        },
        "args": {
          "anyOf": [
            {
              "type": "array"
            },
            {
              "type": "object"
            }
          ],
          "description": "Arguments as JSON: an array in order, or an object by name (see the interface; amounts in the token's decimals)"
        }
      },
      "required": [
        "contract",
        "entry"
      ],
      "additionalProperties": false
    },
    "output": {
      "description": "Any JSON value"
    }
  },
  {
    "name": "contract.call",
    "description": "Prepare a call to a state-changing function by name, with JSON arguments encoded by the interface: an unsigned transaction and a summary for the sender's wallet.",
    "url": null,
    "method": null,
    "group": "contract",
    "kind": "write",
    "signer": "wallet",
    "via": "sdk",
    "input": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Sender: the account that will sign (default: the configured account). Its sequence number and the snapshot are read now: 32 bytes, 0x hex"
        },
        "contract": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Contract: 32 bytes, 0x hex"
        },
        "entry": {
          "type": "string",
          "description": "Function name"
        },
        "args": {
          "anyOf": [
            {
              "type": "array"
            },
            {
              "type": "object"
            }
          ],
          "description": "Arguments as JSON: an array in order, or an object by name (see the interface; amounts in the token's decimals)"
        },
        "value": {
          "type": "array",
          "items": {
            "type": "array",
            "prefixItems": [
              {
                "type": "string",
                "pattern": "^(0x)?[0-9a-fA-F]{64}$",
                "description": "Token: 32 bytes, 0x hex"
              },
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "integer"
                  }
                ]
              }
            ],
            "minItems": 2,
            "maxItems": 2
          },
          "description": "Tokens to attach, moved to the contract before it runs: [token address, base units]"
        }
      },
      "required": [
        "contract",
        "entry"
      ],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "summary": {
          "type": "string",
          "description": "What the transaction does, for the person approving it"
        },
        "from": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Sender: 32 bytes, 0x hex"
        },
        "unsigned": {
          "type": "object",
          "properties": {},
          "description": "The transaction as mox-client describes it (crates/mox-client/src/tx.rs), unsigned: chain_id, seq, snapshot, class, domain, limits, payload, value, fee"
        },
        "request": {
          "anyOf": [
            {
              "type": "object",
              "properties": {},
              "description": "The same as a wallet request (`mox_sendTransaction` params for window.mox or the console), when one can express it"
            },
            {
              "type": "null"
            }
          ]
        },
        "max_fee": {
          "type": "string",
          "pattern": "^[0-9]+$",
          "description": "The most it can cost at current prices (its declared limits); unused fees are refunded"
        },
        "next": {
          "type": "string",
          "description": "How to finish: sign, then tx.submit"
        }
      },
      "description": "An unsigned prepared transaction"
    }
  },
  {
    "name": "contract.deploy",
    "description": "Prepare publishing and creating a contract from a WebAssembly module and its `.mxi` interface (default: the one embedded in the module), with typed init arguments. The receipt's output is the new address.",
    "url": null,
    "method": null,
    "group": "contract",
    "kind": "write",
    "signer": "wallet",
    "via": "sdk",
    "input": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Sender: the account that will sign (default: the configured account). Its sequence number and the snapshot are read now: 32 bytes, 0x hex"
        },
        "module": {
          "type": "string",
          "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
          "description": "The WebAssembly module: 0x hex"
        },
        "interface": {
          "type": "string",
          "description": "The `.mxi` source (default: embedded in the module)"
        },
        "init": {
          "anyOf": [
            {
              "type": "array"
            },
            {
              "type": "object"
            }
          ],
          "description": "Arguments as JSON: an array in order, or an object by name (see the interface; amounts in the token's decimals)"
        },
        "salt": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Salt for the contract address (default: random): 32 bytes, 0x hex"
        },
        "domain": {
          "type": "integer",
          "minimum": 0,
          "description": "Domain"
        }
      },
      "required": [
        "module"
      ],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "summary": {
          "type": "string",
          "description": "What the transaction does, for the person approving it"
        },
        "from": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Sender: 32 bytes, 0x hex"
        },
        "unsigned": {
          "type": "object",
          "properties": {},
          "description": "The transaction as mox-client describes it (crates/mox-client/src/tx.rs), unsigned: chain_id, seq, snapshot, class, domain, limits, payload, value, fee"
        },
        "request": {
          "anyOf": [
            {
              "type": "object",
              "properties": {},
              "description": "The same as a wallet request (`mox_sendTransaction` params for window.mox or the console), when one can express it"
            },
            {
              "type": "null"
            }
          ]
        },
        "max_fee": {
          "type": "string",
          "pattern": "^[0-9]+$",
          "description": "The most it can cost at current prices (its declared limits); unused fees are refunded"
        },
        "next": {
          "type": "string",
          "description": "How to finish: sign, then tx.submit"
        }
      },
      "description": "An unsigned prepared transaction"
    }
  },
  {
    "name": "contract.create",
    "description": "Prepare creating a contract from published code (a standard name such as mrc20, or a code hash), with init arguments encoded by its interface.",
    "url": null,
    "method": null,
    "group": "contract",
    "kind": "write",
    "signer": "wallet",
    "via": "sdk",
    "input": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Sender: the account that will sign (default: the configured account). Its sequence number and the snapshot are read now: 32 bytes, 0x hex"
        },
        "code": {
          "type": "string",
          "description": "Standard code name or code hash"
        },
        "init": {
          "anyOf": [
            {
              "type": "array"
            },
            {
              "type": "object"
            }
          ],
          "description": "Arguments as JSON: an array in order, or an object by name (see the interface; amounts in the token's decimals)"
        },
        "salt": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Salt (default: random): 32 bytes, 0x hex"
        },
        "domain": {
          "type": "integer",
          "minimum": 0,
          "description": "Domain"
        }
      },
      "required": [
        "code"
      ],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "summary": {
          "type": "string",
          "description": "What the transaction does, for the person approving it"
        },
        "from": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Sender: 32 bytes, 0x hex"
        },
        "unsigned": {
          "type": "object",
          "properties": {},
          "description": "The transaction as mox-client describes it (crates/mox-client/src/tx.rs), unsigned: chain_id, seq, snapshot, class, domain, limits, payload, value, fee"
        },
        "request": {
          "anyOf": [
            {
              "type": "object",
              "properties": {},
              "description": "The same as a wallet request (`mox_sendTransaction` params for window.mox or the console), when one can express it"
            },
            {
              "type": "null"
            }
          ]
        },
        "max_fee": {
          "type": "string",
          "pattern": "^[0-9]+$",
          "description": "The most it can cost at current prices (its declared limits); unused fees are refunded"
        },
        "next": {
          "type": "string",
          "description": "How to finish: sign, then tx.submit"
        }
      },
      "description": "An unsigned prepared transaction"
    },
    "examples": [
      {
        "input": {
          "from": "0x8c1f6a3e5b2d4c7f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f",
          "code": "mrc20",
          "init": [
            "Gold",
            "GLD",
            2,
            100000,
            null
          ]
        }
      }
    ]
  },
  {
    "name": "events.poll",
    "description": "Recent contract events by cursor, filtered by contract, event and address; with wait_ms, long-polls for new ones (subscriptions without a socket).",
    "url": "https://api.mox.network/",
    "method": "POST",
    "group": "events",
    "kind": "read",
    "via": "gateway",
    "rpc": "mox_events",
    "input": {
      "type": "object",
      "properties": {
        "from": {
          "type": "integer",
          "minimum": 0,
          "description": "Cursor: the first event to return (default: the latest)"
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10000,
          "description": "Most to return"
        },
        "wait_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 30000,
          "description": "Long-poll: wait up to this long for new ones (≤ 30000)"
        },
        "contract": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Only events of this contract: 32 bytes, 0x hex"
        },
        "topic": {
          "type": "string",
          "description": "Only this event: its name (e.g. Transfer) or its 32-byte topic hex"
        },
        "address": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Only events mentioning this address: 32 bytes, 0x hex"
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "events": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "seq": {
                "type": "integer",
                "minimum": 0,
                "description": "Event cursor"
              },
              "commit": {
                "type": "integer",
                "minimum": 0,
                "description": "Commit"
              },
              "tx": {
                "type": "string",
                "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
                "description": "Transaction hash: 0x hex"
              },
              "contract": {
                "type": "string",
                "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
                "description": "Contract: 0x hex"
              },
              "topics": {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
                  "description": "Topic: 0x hex"
                }
              },
              "data": {
                "type": "string",
                "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
                "description": "Data: 0x hex"
              }
            }
          }
        },
        "next": {
          "type": "integer",
          "minimum": 0,
          "description": "Cursor to pass as `from` next time"
        },
        "gap": {
          "type": "boolean",
          "description": "Older events were no longer kept: some were missed"
        }
      }
    },
    "examples": [
      {
        "input": {
          "topic": "Transfer",
          "limit": 10
        }
      }
    ]
  },
  {
    "name": "events.stream",
    "description": "Contract events as they execute (Server-Sent Events), with the same filters as events.poll.",
    "url": "https://api.mox.network/events",
    "method": "GET",
    "group": "events",
    "kind": "stream",
    "via": "gateway",
    "route": "GET /events",
    "input": {
      "type": "object",
      "properties": {
        "contract": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Only events of this contract: 32 bytes, 0x hex"
        },
        "topic": {
          "type": "string",
          "description": "Only this event: its name (e.g. Transfer) or its 32-byte topic hex"
        },
        "address": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Only events mentioning this address: 32 bytes, 0x hex"
        },
        "from": {
          "type": "integer",
          "minimum": 0,
          "description": "Start at this cursor"
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "seq": {
          "type": "integer",
          "minimum": 0,
          "description": "Event cursor"
        },
        "commit": {
          "type": "integer",
          "minimum": 0,
          "description": "Commit"
        },
        "tx": {
          "type": "string",
          "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
          "description": "Transaction hash: 0x hex"
        },
        "contract": {
          "type": "string",
          "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
          "description": "Contract: 0x hex"
        },
        "topics": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
            "description": "Topic: 0x hex"
          }
        },
        "data": {
          "type": "string",
          "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
          "description": "Data: 0x hex"
        }
      }
    }
  },
  {
    "name": "events.dag_poll",
    "description": "The live DAG feed by cursor: blocks this validator sees, commits it decides, leaders excluded by reputation (default: the latest 500).",
    "url": "https://api.mox.network/",
    "method": "POST",
    "group": "events",
    "kind": "read",
    "via": "gateway",
    "rpc": "mox_dag",
    "input": {
      "type": "object",
      "properties": {
        "from": {
          "type": "integer",
          "minimum": 0,
          "description": "Cursor: the first DAG event to return (default: the latest)"
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10000,
          "description": "Most to return"
        },
        "wait_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 30000,
          "description": "Long-poll: wait up to this long for new ones (≤ 30000)"
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "events": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {}
          }
        },
        "next": {
          "type": "integer",
          "minimum": 0,
          "description": "Cursor to pass as `from` next time"
        },
        "gap": {
          "type": "boolean",
          "description": "Older DAG events were no longer kept: some were missed"
        }
      }
    }
  },
  {
    "name": "events.dag_stream",
    "description": "The live DAG as Server-Sent Events.",
    "url": "https://api.mox.network/dag",
    "method": "GET",
    "group": "events",
    "kind": "stream",
    "via": "gateway",
    "route": "GET /dag",
    "input": {
      "type": "object",
      "properties": {
        "from": {
          "type": "integer",
          "minimum": 0,
          "description": "Start at this cursor"
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {},
      "description": "A DAG event (block, commit or exclusion)"
    }
  },
  {
    "name": "events.commits",
    "description": "Recently executed commits with their transactions (signed bytes), receipts and drops, by cursor: what indexers follow.",
    "url": "https://api.mox.network/",
    "method": "POST",
    "group": "events",
    "kind": "read",
    "via": "gateway",
    "rpc": "mox_commits",
    "input": {
      "type": "object",
      "properties": {
        "from": {
          "type": "integer",
          "minimum": 0,
          "description": "Cursor: the first commit to return (default: the latest)"
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10000,
          "description": "Most to return"
        },
        "wait_ms": {
          "type": "integer",
          "minimum": 0,
          "maximum": 30000,
          "description": "Long-poll: wait up to this long for new ones (≤ 30000)"
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "commits": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {}
          }
        },
        "next": {
          "type": "integer",
          "minimum": 0,
          "description": "Cursor to pass as `from` next time"
        },
        "gap": {
          "type": "boolean",
          "description": "Older commits were no longer kept: some were missed"
        }
      }
    }
  },
  {
    "name": "mesh.peers",
    "description": "Registered peer networks: their latest checkpoint anchored here, value and rent caps, the next inbound message.",
    "url": "https://api.mox.network/",
    "method": "POST",
    "group": "mesh",
    "kind": "read",
    "via": "gateway",
    "rpc": "mox_peers",
    "input": {
      "type": "object",
      "properties": {},
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "chain_id": {
            "type": "integer",
            "minimum": 0,
            "description": "Peer chain"
          },
          "anchored_index": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "description": "Latest anchored checkpoint"
              },
              {
                "type": "null"
              }
            ]
          },
          "next_in": {
            "type": "integer",
            "minimum": 0,
            "description": "Next inbound message"
          }
        }
      }
    },
    "examples": [
      {
        "input": {}
      }
    ]
  },
  {
    "name": "mesh.outbox",
    "description": "Interchain messages to `dest` from `from_seq`, as ready-to-submit deliveries for relayers.",
    "url": "https://api.mox.network/",
    "method": "POST",
    "group": "mesh",
    "kind": "read",
    "via": "gateway",
    "rpc": "mox_outbox",
    "input": {
      "type": "object",
      "properties": {
        "dest": {
          "type": "integer",
          "minimum": 0,
          "description": "Destination chain id"
        },
        "from_seq": {
          "type": "integer",
          "minimum": 0,
          "description": "First message"
        }
      },
      "required": [
        "dest"
      ],
      "additionalProperties": false
    },
    "output": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "checkpoint": {
            "type": "integer",
            "minimum": 0,
            "description": "Checkpoint"
          },
          "first_seq": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "description": "First message"
              },
              {
                "type": "null"
              }
            ]
          },
          "count": {
            "type": "integer",
            "minimum": 0,
            "description": "Messages"
          },
          "payload": {
            "type": "string",
            "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
            "description": "Deliver payload (MXE): 0x hex"
          }
        }
      }
    }
  },
  {
    "name": "gateway.status",
    "description": "The gateway's view: validators' health and regions, indexer progress, the faucet's address, amount and balance.",
    "url": "https://api.mox.network/status",
    "method": "GET",
    "group": "gateway",
    "kind": "read",
    "via": "gateway",
    "route": "GET /status",
    "input": {
      "type": "object",
      "properties": {},
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "validators": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "addr": {
                "type": "string",
                "description": "RPC address"
              },
              "up": {
                "type": "boolean",
                "description": "Answering"
              },
              "halted": {
                "type": "boolean",
                "description": "Halted"
              },
              "executed_index": {
                "type": "integer",
                "minimum": 0,
                "description": "Executed"
              }
            }
          }
        },
        "indexer": {
          "description": "Any JSON value"
        },
        "faucet": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "address": {
                  "type": "string",
                  "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
                  "description": "Faucet: 0x hex"
                },
                "amount": {
                  "type": "string",
                  "pattern": "^[0-9]+$",
                  "description": "Per request"
                }
              }
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "examples": [
      {
        "input": {}
      }
    ]
  },
  {
    "name": "gateway.chain",
    "description": "Which network this is: its chain id and genesis hash (the state root of the genesis state). Wallets pin both on first contact; two devnets may share a chain id, never a genesis hash.",
    "url": "https://api.mox.network/chain",
    "method": "GET",
    "group": "gateway",
    "kind": "read",
    "via": "gateway",
    "route": "GET /chain",
    "input": {
      "type": "object",
      "properties": {},
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "chain_id": {
          "type": "integer",
          "minimum": 0,
          "description": "Chain id"
        },
        "genesis_hash": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
              "description": "Genesis hash: 0x hex"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "examples": [
      {
        "input": {},
        "output": {
          "chain_id": 1337,
          "genesis_hash": "0x3b7d0f5c9e2a4b6c8d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e"
        }
      }
    ]
  },
  {
    "name": "explorer.txs",
    "description": "Recent transactions, newest first.",
    "url": "https://api.mox.network/api/txs",
    "method": "GET",
    "group": "explorer",
    "kind": "read",
    "via": "gateway",
    "route": "GET /api/txs",
    "input": {
      "type": "object",
      "properties": {
        "before": {
          "type": "integer",
          "minimum": 0,
          "description": "Only items before this (commit index or id): for paging back"
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500,
          "description": "Most to return (default 50)"
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "hash": {
            "type": "string",
            "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
            "description": "Hash: 0x hex"
          },
          "commit": {
            "type": "integer",
            "minimum": 0,
            "description": "Commit"
          },
          "timestamp_ms": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "description": "Commit time"
              },
              {
                "type": "null"
              }
            ]
          },
          "sender": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
                "description": "Sender: 0x hex"
              },
              {
                "type": "null"
              }
            ]
          },
          "seq": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "description": "Sequence number"
              },
              {
                "type": "null"
              }
            ]
          },
          "kind": {
            "anyOf": [
              {
                "type": "string",
                "description": "transfer, call, deploy, …"
              },
              {
                "type": "null"
              }
            ]
          },
          "target": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
                "description": "Recipient or called contract: 0x hex"
              },
              {
                "type": "null"
              }
            ]
          },
          "entry": {
            "anyOf": [
              {
                "type": "string",
                "description": "Called function"
              },
              {
                "type": "null"
              }
            ]
          },
          "amount": {
            "anyOf": [
              {
                "type": "string",
                "description": "Transferred amount (base units)"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "status_name": {
            "anyOf": [
              {
                "type": "string",
                "description": "Status"
              },
              {
                "type": "null"
              }
            ]
          },
          "fee": {
            "anyOf": [
              {
                "type": "string",
                "description": "Fee (base units)"
              },
              {
                "type": "null"
              }
            ]
          },
          "compute_used": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "description": "Compute used"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      }
    },
    "examples": [
      {
        "input": {
          "limit": 5
        }
      }
    ]
  },
  {
    "name": "explorer.tx",
    "description": "One transaction: its row, the decoded transaction, the signed bytes and the receipt.",
    "url": "https://api.mox.network/api/tx/{hash}",
    "method": "GET",
    "group": "explorer",
    "kind": "read",
    "via": "gateway",
    "route": "GET /api/tx/{hash}",
    "input": {
      "type": "object",
      "properties": {
        "hash": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Transaction hash: 32 bytes, 0x hex"
        }
      },
      "required": [
        "hash"
      ],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "hash": {
          "type": "string",
          "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
          "description": "Hash: 0x hex"
        },
        "tx": {
          "type": "object",
          "properties": {}
        },
        "raw": {
          "type": "string",
          "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
          "description": "Signed bytes: 0x hex"
        },
        "receipt": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "tx_hash": {
                  "type": "string",
                  "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
                  "description": "Transaction hash: 0x hex"
                },
                "commit": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "The commit that executed it"
                },
                "status": {
                  "type": "integer",
                  "description": "0: success; >0: the contract's error code; <0: a system status"
                },
                "status_name": {
                  "type": "string",
                  "description": "Readable status"
                },
                "compute_used": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Compute units used"
                },
                "fee": {
                  "type": "string",
                  "pattern": "^[0-9]+$",
                  "description": "Fee charged (MUR base units)"
                },
                "refund": {
                  "type": "string",
                  "pattern": "^[0-9]+$",
                  "description": "Deposit refunded (MUR base units)"
                },
                "output": {
                  "type": "string",
                  "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
                  "description": "Raw output (a deploy's is the new contract's address): 0x hex"
                },
                "events": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "contract": {
                        "type": "string",
                        "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
                        "description": "Emitting contract: 0x hex"
                      },
                      "topics": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
                          "description": "Topic: 0x hex"
                        },
                        "description": "topics[0] is BLAKE3 of the event name"
                      },
                      "data": {
                        "type": "string",
                        "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
                        "description": "MXE-encoded fields: 0x hex"
                      },
                      "name": {
                        "type": "string",
                        "description": "Decoded event name, when the interface is known"
                      },
                      "fields": {
                        "description": "Any JSON value"
                      }
                    },
                    "description": "A contract event"
                  }
                },
                "result": {
                  "description": "Any JSON value"
                },
                "error": {
                  "type": "string",
                  "description": "Readable error, for failed contract calls"
                }
              },
              "description": "A transaction receipt"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    }
  },
  {
    "name": "explorer.address_txs",
    "description": "Transactions sent by an address, or to it (a transfer's recipient or a called contract), newest first.",
    "url": "https://api.mox.network/api/address/{address}/txs",
    "method": "GET",
    "group": "explorer",
    "kind": "read",
    "via": "gateway",
    "route": "GET /api/address/{address}/txs",
    "input": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Address: 32 bytes, 0x hex"
        },
        "before": {
          "type": "integer",
          "minimum": 0,
          "description": "Before this commit"
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500,
          "description": "Most (default 50)"
        }
      },
      "required": [
        "address"
      ],
      "additionalProperties": false
    },
    "output": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "hash": {
            "type": "string",
            "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
            "description": "Hash: 0x hex"
          },
          "commit": {
            "type": "integer",
            "minimum": 0,
            "description": "Commit"
          },
          "timestamp_ms": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "description": "Commit time"
              },
              {
                "type": "null"
              }
            ]
          },
          "sender": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
                "description": "Sender: 0x hex"
              },
              {
                "type": "null"
              }
            ]
          },
          "seq": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "description": "Sequence number"
              },
              {
                "type": "null"
              }
            ]
          },
          "kind": {
            "anyOf": [
              {
                "type": "string",
                "description": "transfer, call, deploy, …"
              },
              {
                "type": "null"
              }
            ]
          },
          "target": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
                "description": "Recipient or called contract: 0x hex"
              },
              {
                "type": "null"
              }
            ]
          },
          "entry": {
            "anyOf": [
              {
                "type": "string",
                "description": "Called function"
              },
              {
                "type": "null"
              }
            ]
          },
          "amount": {
            "anyOf": [
              {
                "type": "string",
                "description": "Transferred amount (base units)"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "status_name": {
            "anyOf": [
              {
                "type": "string",
                "description": "Status"
              },
              {
                "type": "null"
              }
            ]
          },
          "fee": {
            "anyOf": [
              {
                "type": "string",
                "description": "Fee (base units)"
              },
              {
                "type": "null"
              }
            ]
          },
          "compute_used": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "description": "Compute used"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      }
    },
    "examples": [
      {
        "input": {
          "address": "0x8c1f6a3e5b2d4c7f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f"
        }
      }
    ]
  },
  {
    "name": "explorer.address_tokens",
    "description": "Tokens an address has sent or received.",
    "url": "https://api.mox.network/api/address/{address}/tokens",
    "method": "GET",
    "group": "explorer",
    "kind": "read",
    "via": "gateway",
    "route": "GET /api/address/{address}/tokens",
    "input": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Address: 32 bytes, 0x hex"
        }
      },
      "required": [
        "address"
      ],
      "additionalProperties": false
    },
    "output": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
        "description": "Token: 0x hex"
      }
    },
    "examples": [
      {
        "input": {
          "address": "0x8c1f6a3e5b2d4c7f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f"
        }
      }
    ]
  },
  {
    "name": "explorer.commits",
    "description": "Recent commits, newest first; nonempty=1 skips commits without transactions.",
    "url": "https://api.mox.network/api/commits",
    "method": "GET",
    "group": "explorer",
    "kind": "read",
    "via": "gateway",
    "route": "GET /api/commits",
    "input": {
      "type": "object",
      "properties": {
        "before": {
          "type": "integer",
          "minimum": 0,
          "description": "Only items before this (commit index or id): for paging back"
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500,
          "description": "Most to return (default 50)"
        },
        "nonempty": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1,
          "description": "1: only commits with transactions"
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer",
            "minimum": 0,
            "description": "Commit index"
          },
          "timestamp_ms": {
            "type": "integer",
            "minimum": 0,
            "description": "Commit time"
          },
          "leader": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "[round, author]"
          },
          "blocks": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "description": "Blocks"
              },
              {
                "type": "null"
              }
            ]
          },
          "txs": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "description": "Transactions"
              },
              {
                "type": "null"
              }
            ]
          },
          "executed": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "description": "Executed"
              },
              {
                "type": "null"
              }
            ]
          },
          "failed": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "description": "Failed"
              },
              {
                "type": "null"
              }
            ]
          },
          "dropped": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "description": "Dropped"
              },
              {
                "type": "null"
              }
            ]
          },
          "fees": {
            "anyOf": [
              {
                "type": "string",
                "description": "Fees (base units)"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      }
    },
    "examples": [
      {
        "input": {
          "limit": 5
        }
      }
    ]
  },
  {
    "name": "explorer.commit",
    "description": "One commit with its transactions.",
    "url": "https://api.mox.network/api/commit/{index}",
    "method": "GET",
    "group": "explorer",
    "kind": "read",
    "via": "gateway",
    "route": "GET /api/commit/{index}",
    "input": {
      "type": "object",
      "properties": {
        "index": {
          "type": "integer",
          "minimum": 0,
          "description": "Commit index"
        }
      },
      "required": [
        "index"
      ],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "index": {
          "type": "integer",
          "minimum": 0,
          "description": "Index"
        },
        "transactions": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "hash": {
                "type": "string",
                "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
                "description": "Hash: 0x hex"
              },
              "commit": {
                "type": "integer",
                "minimum": 0,
                "description": "Commit"
              },
              "timestamp_ms": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Commit time"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "sender": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
                    "description": "Sender: 0x hex"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "seq": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Sequence number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "kind": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "transfer, call, deploy, …"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "target": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
                    "description": "Recipient or called contract: 0x hex"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "entry": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "Called function"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "amount": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "Transferred amount (base units)"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "status": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "status_name": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "Status"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "fee": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "Fee (base units)"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "compute_used": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Compute used"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          }
        }
      }
    }
  },
  {
    "name": "explorer.events",
    "description": "Indexed contract events, newest first, optionally of one contract and first topic.",
    "url": "https://api.mox.network/api/events",
    "method": "GET",
    "group": "explorer",
    "kind": "read",
    "via": "gateway",
    "route": "GET /api/events",
    "input": {
      "type": "object",
      "properties": {
        "before": {
          "type": "integer",
          "minimum": 0,
          "description": "Only items before this (commit index or id): for paging back"
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500,
          "description": "Most to return (default 50)"
        },
        "contract": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Contract: 32 bytes, 0x hex"
        },
        "topic": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "First topic: 32 bytes, 0x hex"
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 0,
            "description": "Id"
          },
          "commit": {
            "type": "integer",
            "minimum": 0,
            "description": "Commit"
          },
          "tx": {
            "anyOf": [
              {
                "type": "string",
                "description": "Transaction"
              },
              {
                "type": "null"
              }
            ]
          },
          "contract": {
            "anyOf": [
              {
                "type": "string",
                "description": "Contract"
              },
              {
                "type": "null"
              }
            ]
          },
          "topics": {
            "description": "Any JSON value"
          },
          "data": {
            "anyOf": [
              {
                "type": "string",
                "description": "Data (hex)"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      }
    },
    "examples": [
      {
        "input": {
          "limit": 5
        }
      }
    ]
  },
  {
    "name": "explorer.contracts",
    "description": "Known contracts, newest first, optionally of one kind (mrc20, exchange, staking, other).",
    "url": "https://api.mox.network/api/contracts",
    "method": "GET",
    "group": "explorer",
    "kind": "read",
    "via": "gateway",
    "route": "GET /api/contracts",
    "input": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "description": "mrc20, exchange, staking or other"
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500,
          "description": "Most (default 50)"
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Address"
          },
          "kind": {
            "type": "string",
            "description": "Kind"
          },
          "code": {
            "anyOf": [
              {
                "type": "string",
                "description": "Code hash"
              },
              {
                "type": "null"
              }
            ]
          },
          "creator": {
            "anyOf": [
              {
                "type": "string",
                "description": "Creator"
              },
              {
                "type": "null"
              }
            ]
          },
          "commit": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "description": "Created in"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      }
    },
    "examples": [
      {
        "input": {
          "kind": "mrc20"
        }
      }
    ]
  },
  {
    "name": "explorer.search",
    "description": "What a search box means: a transaction or an address (32-byte hex), or a commit index.",
    "url": "https://api.mox.network/api/search",
    "method": "GET",
    "group": "explorer",
    "kind": "read",
    "via": "gateway",
    "route": "GET /api/search",
    "input": {
      "type": "object",
      "properties": {
        "q": {
          "type": "string",
          "description": "Hash, address or commit index"
        }
      },
      "required": [
        "q"
      ],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "description": "tx, address, commit or none"
        }
      }
    },
    "examples": [
      {
        "input": {
          "q": "1"
        }
      }
    ]
  },
  {
    "name": "analytics.metrics",
    "description": "Network metrics over the last minutes, scraped from every validator's Prometheus endpoint: throughput, latency, mempools, fees.",
    "url": "https://api.mox.network/api/metrics",
    "method": "GET",
    "group": "analytics",
    "kind": "read",
    "via": "gateway",
    "route": "GET /api/metrics",
    "input": {
      "type": "object",
      "properties": {
        "minutes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 60,
          "description": "Window (1 to 60, default 15)"
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {}
    },
    "examples": [
      {
        "input": {
          "minutes": 5
        }
      }
    ]
  },
  {
    "name": "analytics.propagation",
    "description": "Block propagation between validators, from every validator's DAG feed.",
    "url": "https://api.mox.network/api/propagation",
    "method": "GET",
    "group": "analytics",
    "kind": "read",
    "via": "gateway",
    "route": "GET /api/propagation",
    "input": {
      "type": "object",
      "properties": {},
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {}
    },
    "examples": [
      {
        "input": {}
      }
    ]
  },
  {
    "name": "analytics.stats",
    "description": "Per-minute aggregates (commits, transactions, failures, drops, fees) for the last minutes that saw commits.",
    "url": "https://api.mox.network/api/stats",
    "method": "GET",
    "group": "analytics",
    "kind": "read",
    "via": "gateway",
    "route": "GET /api/stats",
    "input": {
      "type": "object",
      "properties": {
        "minutes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1440,
          "description": "Window (up to 1440, default 60)"
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "minute": {
            "type": "integer",
            "minimum": 0,
            "description": "Minute"
          },
          "commits": {
            "type": "integer",
            "minimum": 0,
            "description": "Commits"
          },
          "txs": {
            "type": "integer",
            "minimum": 0,
            "description": "Transactions"
          }
        }
      }
    },
    "examples": [
      {
        "input": {
          "minutes": 10
        }
      }
    ]
  },
  {
    "name": "node.status",
    "description": "A validator's status over plain HTTP (the same as chain.status), for health checks.",
    "url": "http://<validator rpc>/status",
    "method": "GET",
    "group": "node",
    "kind": "read",
    "via": "node",
    "route": "GET /status",
    "input": {
      "type": "object",
      "properties": {},
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "validator": {
          "type": "integer",
          "minimum": 0,
          "description": "Node index"
        },
        "member": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "description": "Committee index in the current epoch (null: a follower)"
            },
            {
              "type": "null"
            }
          ]
        },
        "epoch": {
          "type": "integer",
          "minimum": 0,
          "description": "Epoch"
        },
        "chain_id": {
          "type": "integer",
          "minimum": 0,
          "description": "Chain id"
        },
        "commit_index": {
          "type": "integer",
          "minimum": 0,
          "description": "Latest commit decided"
        },
        "executed_index": {
          "type": "integer",
          "minimum": 0,
          "description": "Latest commit executed (use as a transaction's snapshot)"
        },
        "highest_round": {
          "type": "integer",
          "minimum": 0,
          "description": "Highest DAG round seen"
        },
        "effects": {
          "type": "string",
          "description": "Effects digest after executed_index"
        },
        "mempool": {
          "type": "integer",
          "minimum": 0,
          "description": "Transactions waiting"
        },
        "peers_connected": {
          "type": "integer",
          "minimum": 0,
          "description": "Peers"
        },
        "halted": {
          "type": "boolean",
          "description": "Stopped on a safety alarm"
        },
        "executed_txs": {
          "type": "integer",
          "minimum": 0,
          "description": "Transactions executed"
        },
        "alarms": {
          "type": "array",
          "items": {
            "type": "string",
            "description": "Alarm"
          }
        },
        "excluded_leaders": {
          "type": "array",
          "items": {
            "type": "integer",
            "minimum": 0,
            "description": "Node"
          }
        }
      }
    }
  },
  {
    "name": "node.metrics",
    "description": "A validator's metrics in the Prometheus text format.",
    "url": "http://<validator rpc>/metrics",
    "method": "GET",
    "group": "node",
    "kind": "read",
    "via": "node",
    "route": "GET /metrics",
    "input": {
      "type": "object",
      "properties": {},
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "string",
      "description": "Prometheus exposition text"
    }
  },
  {
    "name": "node.events_stream",
    "description": "Contract events from one validator as Server-Sent Events (the gateway relays this as events.stream).",
    "url": "http://<validator rpc>/events",
    "method": "GET",
    "group": "node",
    "kind": "stream",
    "via": "node",
    "route": "GET /events",
    "input": {
      "type": "object",
      "properties": {
        "contract": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Only events of this contract: 32 bytes, 0x hex"
        },
        "topic": {
          "type": "string",
          "description": "Only this event: its name (e.g. Transfer) or its 32-byte topic hex"
        },
        "address": {
          "type": "string",
          "pattern": "^(0x)?[0-9a-fA-F]{64}$",
          "description": "Only events mentioning this address: 32 bytes, 0x hex"
        },
        "from": {
          "type": "integer",
          "minimum": 0,
          "description": "Start at this cursor"
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {
        "seq": {
          "type": "integer",
          "minimum": 0,
          "description": "Event cursor"
        },
        "commit": {
          "type": "integer",
          "minimum": 0,
          "description": "Commit"
        },
        "tx": {
          "type": "string",
          "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
          "description": "Transaction hash: 0x hex"
        },
        "contract": {
          "type": "string",
          "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
          "description": "Contract: 0x hex"
        },
        "topics": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
            "description": "Topic: 0x hex"
          }
        },
        "data": {
          "type": "string",
          "pattern": "^(0x)?([0-9a-fA-F]{2})*$",
          "description": "Data: 0x hex"
        }
      }
    }
  },
  {
    "name": "node.dag_stream",
    "description": "One validator's live DAG as Server-Sent Events (the gateway relays this as events.dag_stream).",
    "url": "http://<validator rpc>/dag",
    "method": "GET",
    "group": "node",
    "kind": "stream",
    "via": "node",
    "route": "GET /dag",
    "input": {
      "type": "object",
      "properties": {
        "from": {
          "type": "integer",
          "minimum": 0,
          "description": "Start at this cursor"
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "properties": {}
    }
  }
]
