{
  "openapi": "3.1.0",
  "info": {
    "title": "LIQUID oversight API (SBP)",
    "version": "1.0.0-sandbox",
    "description": "SBP's read-only window onto the shared record: standard Ethereum JSON-RPC, read methods only. Write and admin methods are refused (JSON-RPC error -32601). Only SBP clients (client id `api-sbp…`) may call it; others get 403.\n\nChain id **2611170** (Hyperledger Besu, QBFT). Contract addresses are on the developer portal's SBP guide."
  },
  "security": [
    {
      "clientCredentials": []
    }
  ],
  "tags": [
    {
      "name": "shared record",
      "description": "Read the shared record (Besu JSON-RPC, read-only)."
    }
  ],
  "paths": {
    "/oversight/v1/rpc": {
      "post": {
        "tags": [
          "shared record"
        ],
        "operationId": "rpc",
        "summary": "Call a read-only JSON-RPC method",
        "description": "Allowed methods: `eth_blockNumber`, `eth_chainId`, `eth_syncing`, `eth_getBlockByNumber`, `eth_getBlockByHash`, `eth_getBlockTransactionCountByNumber`, `eth_getBlockTransactionCountByHash`, `eth_getTransactionByHash`, `eth_getTransactionByBlockNumberAndIndex`, `eth_getTransactionByBlockHashAndIndex`, `eth_getTransactionReceipt`, `eth_getLogs`, `eth_call`, `eth_getBalance`, `eth_getCode`, `eth_getStorageAt`, `eth_getTransactionCount`, `eth_gasPrice`, `net_version`, `net_peerCount`, `net_listening`, `web3_clientVersion`. Batches are allowed; refused methods in a batch get an error each.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RpcRequest"
              },
              "examples": {
                "latestBlock": {
                  "summary": "Latest block number",
                  "value": {
                    "jsonrpc": "2.0",
                    "id": 1,
                    "method": "eth_blockNumber",
                    "params": []
                  }
                },
                "receipt": {
                  "summary": "A transaction's receipt",
                  "value": {
                    "jsonrpc": "2.0",
                    "id": 2,
                    "method": "eth_getTransactionReceipt",
                    "params": [
                      "0x…"
                    ]
                  }
                },
                "refused": {
                  "summary": "A write (refused)",
                  "value": {
                    "jsonrpc": "2.0",
                    "id": 3,
                    "method": "eth_sendRawTransaction",
                    "params": [
                      "0x…"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response (an error object for refused methods).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RpcResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorised"
          },
          "403": {
            "description": "Only SBP clients may read through this endpoint."
          },
          "429": {
            "$ref": "#/components/responses/TooMany"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "What went wrong, in plain words."
          }
        },
        "required": [
          "error"
        ]
      },
      "RpcRequest": {
        "type": "object",
        "required": [
          "jsonrpc",
          "id",
          "method"
        ],
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": [
              "integer",
              "string"
            ]
          },
          "method": {
            "type": "string",
            "enum": [
              "eth_blockNumber",
              "eth_chainId",
              "eth_syncing",
              "eth_getBlockByNumber",
              "eth_getBlockByHash",
              "eth_getBlockTransactionCountByNumber",
              "eth_getBlockTransactionCountByHash",
              "eth_getTransactionByHash",
              "eth_getTransactionByBlockNumberAndIndex",
              "eth_getTransactionByBlockHashAndIndex",
              "eth_getTransactionReceipt",
              "eth_getLogs",
              "eth_call",
              "eth_getBalance",
              "eth_getCode",
              "eth_getStorageAt",
              "eth_getTransactionCount",
              "eth_gasPrice",
              "net_version",
              "net_peerCount",
              "net_listening",
              "web3_clientVersion"
            ]
          },
          "params": {
            "type": "array"
          }
        }
      },
      "RpcResponse": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": [
              "integer",
              "string",
              "null"
            ]
          },
          "result": {},
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "integer"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "clientCredentials": {
        "type": "oauth2",
        "description": "Your client id and secret from the sandbox access request. Tokens last 5 minutes.",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://id.liquid.bridgeintelligence.cloud/realms/liquid/protocol/openid-connect/token",
            "scopes": {}
          }
        }
      }
    },
    "responses": {
      "Unauthorised": {
        "description": "No token, or the token is wrong, expired or for another audience.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          },
          "text/plain": {
            "schema": {
              "type": "string"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Your role or organisation can't do this.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "TooMany": {
        "description": "Rate limit reached. Wait for the minute to pass (see x-ratelimit-reset).",
        "headers": {
          "x-ratelimit-limit": {
            "schema": {
              "type": "string"
            }
          },
          "x-ratelimit-remaining": {
            "schema": {
              "type": "string"
            }
          },
          "x-ratelimit-reset": {
            "schema": {
              "type": "string"
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://api.liquid.bridgeintelligence.cloud",
      "description": "Sandbox"
    }
  ]
}