swagger.json


Overview

[swagger.json](/projects/291/68851) is an OpenAPI 3.0 specification file defining the RESTful API contract for the [@shapeshiftoss/bnbsmartchain-api](/projects/291/68970) project, version 10.0.0. This API provides endpoints for interacting with the Binance Smart Chain (BSC) or compatible Ethereum Virtual Machine (EVM) blockchain nodes, supporting operations such as retrieving account information, transaction details, sending raw transactions, fetching token metadata, estimating gas costs, and querying current gas fees.

The file describes the API's available HTTP paths, request parameters, expected responses, and data schemas in a machine-readable JSON format. It serves as a comprehensive reference for developers integrating with the BNB Smart Chain API and can be used to generate client SDKs, server stubs, or interactive API documentation.


Components

Schemas

This section defines reusable data models (schemas) used throughout the API requests and responses. Each schema includes properties, types, descriptions, and validation rules.


Paths and Operations

/api/v1/info — GetInfo (GET)


/api/v1/account/{pubkey} — GetAccount (GET)

**Example Usage:**

GET /api/v1/account/0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF

/api/v1/account/{pubkey}/txs — GetTxHistory (GET)


/api/v1/tx/{txid} — GetTransaction (GET)


/api/v1/send — SendTx (POST)


/api/v1/jsonrpc — DoRpcRequest (POST)

{
  "jsonrpc": "2.0",
  "id": "test",
  "method": "eth_blockNumber",
  "params": []
}

/api/v1/metadata/token — GetTokenMetadata (GET)


/api/v1/gas/estimate — EstimateGas (POST)


/api/v1/gas/fees — GetGasFees (GET)


Important Implementation Details


Interaction with Other System Components


Visual Diagram

flowchart TD
    Info["GetInfo\n(GET /api/v1/info)"]
    Account["GetAccount\n(GET /api/v1/account/{pubkey})"]
    TxHistory["GetTxHistory\n(GET /api/v1/account/{pubkey}/txs)"]
    TxDetail["GetTransaction\n(GET /api/v1/tx/{txid})"]
    SendTx["SendTx\n(POST /api/v1/send)"]
    JsonRpc["DoRpcRequest\n(POST /api/v1/jsonrpc)"]
    TokenMeta["GetTokenMetadata\n(GET /api/v1/metadata/token)"]
    GasEstimate["EstimateGas\n(POST /api/v1/gas/estimate)"]
    GasFees["GetGasFees\n(GET /api/v1/gas/fees)"]

    Info -->|Returns BaseInfo| BaseInfo[BaseInfo Schema]
    Account -->|Returns Account| AccountSchema[Account Schema]
    TxHistory -->|Returns TxHistory| TxHistorySchema[TxHistory Schema]
    TxDetail -->|Returns Tx| TxSchema[Tx Schema]
    SendTx -->|Request: SendTxBody\nResponse: txid string| SendTxBodySchema[SendTxBody Schema]
    JsonRpc -->|Request: RPCRequest(s)\nResponse: RPCResponse(s)| RPCSchemas[RPCRequest & RPCResponse Schemas]
    TokenMeta -->|Returns TokenMetadata| TokenMetadataSchema[TokenMetadata Schema]
    GasEstimate -->|Request: EstimateGasBody\nResponse: GasEstimate| GasEstimateSchemas[EstimateGasBody & GasEstimate Schemas]
    GasFees -->|Returns GasFees| GasFeesSchema[GasFees Schema]

    classDef endpoint fill:#f9f,stroke:#333,stroke-width:1px,color:#000
    class Info,Account,TxHistory,TxDetail,SendTx,JsonRpc,TokenMeta,GasEstimate,GasFees endpoint

Summary

This [swagger.json](/projects/291/68851) is a robust and detailed OpenAPI definition for the Binance Smart Chain API, enabling developers to reliably integrate blockchain data retrieval, transaction processing, and gas fee management into their applications. It covers core blockchain interactions with strong schema validation and supports both REST and JSON-RPC protocols, facilitating flexible and comprehensive access to BNB Smart Chain features.