swagger.json


Overview

`swagger.json` is an OpenAPI 3.0 specification file defining the RESTful API for the [@shapeshiftoss/solana-api](/projects/291/69281) project, version 10.0.0. This API provides comprehensive access to Solana blockchain data and operations, including account info, transaction history, token details, fee estimations, raw transaction broadcasting, and JSON-RPC requests to a Solana node.

The file serves as both a machine-readable contract and human-readable documentation for API consumers and developers, enabling automated client generation, testing, and validation.


Components

The file organizes API schemas, endpoints, and operations under the OpenAPI standard elements:


Detailed Explanation of Schemas

The [components.schemas](/projects/291/69205) section defines the data structures used throughout the API. Below are key schemas with explanations and usage contexts.

BaseInfo

**Usage**: Returned by `/api/v1/info` to identify the blockchain environment.


TokenBalance

**Usage**: Included in [Account.tokens](/projects/291/69316) to represent tokens held by an account.


Account

**Usage**: Returned by `/api/v1/account/{pubkey}` to provide account state.


Tx (Transaction)

**BaseTx Properties**:

**EnrichedTransaction Properties**:

**Usage**: Returned by `/api/v1/tx/{txid}` endpoint.


TransactionType (Enum)

Enumerates a wide range of transaction types supported, including NFT bids, swaps, loans, auctions, token minting, and more, allowing clients to understand transaction semantics.


Source (Enum)

Lists various sources or programs that can initiate transactions or operations, including marketplaces (Magic Eden, OpenSea), protocols (Serum, Raydium), and system programs.


NativeTransfer


TokenTransfer


Instruction and InnerInstruction


RPCRequest and RPCResponse


PriorityFees


API Endpoints

The API exposes several REST endpoints under `/api/v1/` namespace:

Path

Method

OperationId

Description

`/api/v1/info`

GET

GetInfo

Retrieves coinstack information (e.g. network).

`/api/v1/account/{pubkey}`

GET

GetAccount

Gets account details by public key or extended key.

`/api/v1/account/{pubkey}/txs`

GET

GetTxHistory

Fetches paginated transaction history for account.

`/api/v1/tx/{txid}`

GET

GetTransaction

Retrieves detailed transaction info by signature.

`/api/v1/send`

POST

SendTx

Broadcasts a raw serialized transaction to the node.

`/api/v1/fees/priority`

GET

GetPriorityFees

Gets recommended priority fees for transactions.

`/api/v1/fees/estimate`

POST

EstimateFees

Estimates compute unit cost for a transaction.

`/api/v1/jsonrpc`

POST

DoRpcRequest

Makes JSON-RPC requests or batch requests to node.

`/api/v1/token/{id}`

GET

GetToken

Gets token details by token ID.


Important Implementation Details


Interactions with Other System Components


Usage Examples

Get Account Information

**Request:**

GET /api/v1/account/2bUNK6eVUmXyxeSDURsWdqi1KK8BYu4egnzyi3xDYc9M
Accept: application/json

**Response:**

{
  "pubkey": "2bUNK6eVUmXyxeSDURsWdqi1KK8BYu4egnzyi3xDYc9M",
  "balance": "0",
  "unconfirmedBalance": "0",
  "tokens": []
}

Send Raw Transaction

**Request:**

POST /api/v1/send
Content-Type: application/json

{
  "hex": "base64-encoded-transaction-hex"
}

**Response:**

"5KDSVYdUSSKSgTcq1PJFmo3vMSNeP383Q3xVqWhGX4xExaYtYmcygA7wncwz8gVgZMbhKtg5ZekD9fsF6T5mCMAv"

Mermaid Diagram - API Structure Overview

This flowchart illustrates the core API endpoints and their relationships to main data schemas.

flowchart TD
    Info["GET /api/v1/info\n(BaseInfo)"]
    Account["GET /api/v1/account/{pubkey}\n(Account)"]
    TxHistory["GET /api/v1/account/{pubkey}/txs\n(TxHistory)"]
    Transaction["GET /api/v1/tx/{txid}\n(Tx)"]
    SendTx["POST /api/v1/send\n(SendTxBody)"]
    PriorityFees["GET /api/v1/fees/priority\n(PriorityFees)"]
    EstimateFees["POST /api/v1/fees/estimate\n(EstimateFeesBody)"]
    JsonRpc["POST /api/v1/jsonrpc\n(RPCRequest / RPCResponse)"]
    Token["GET /api/v1/token/{id}\n(Token)"]

    Info -->|returns| BaseInfo[BaseInfo]
    Account -->|returns| AccountSchema[Account]
    TxHistory -->|returns| TxHistorySchema[TxHistory]
    Transaction -->|returns| TxSchema[Tx]
    SendTx -->|returns| String[Transaction Signature]
    PriorityFees -->|returns| PriorityFeesSchema[PriorityFees]
    EstimateFees -->|returns| String[Estimated Fee]
    JsonRpc -->|returns| RpcResponse[RPCResponse or Batch]
    Token -->|returns| TokenSchema[Token]

Summary

`swagger.json` precisely defines the REST API interface for interacting with Solana blockchain data and transactions, focusing on:

It provides a rich set of data models capturing Solana-specific blockchain semantics and supports extensible transaction types and sources, suitable for wallets, explorers, and DeFi/NFT applications.

This file acts as the central API contract and documentation for developers integrating with the [@shapeshiftoss/solana-api](/projects/291/69281) ecosystem.