swagger.json


Overview

This file is an **OpenAPI 3.0 specification** document defining the REST API for the [@shapeshiftoss/litecoin-api](/projects/291/69281) project, version `10.0.0`. It describes the API endpoints, request/response schemas, and error handling related to Litecoin blockchain data and transaction management.

The API provides functionality to:

This specification serves as the contract between the backend Litecoin node or service and API consumers, enabling programmatic access to Litecoin blockchain data and transaction operations in a standardized way.


Detailed Components and Endpoints

Components

The [components](/projects/291/69205) section defines reusable schemas (data models) used in request and response bodies, along with empty placeholders for examples, headers, parameters, request bodies, responses, and security schemes.

Schemas


Paths (Endpoints)

All endpoints are under `/api/v1/` base path and tagged with `"v1"`.


1. GET /api/v1/info

GET /api/v1/info HTTP/1.1
Accept: application/json

Response:

{
  "network": "mainnet"
}

2. GET /api/v1/account/{pubkey}

GET /api/v1/account/xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKp9ybq4dK HTTP/1.1
Accept: application/json

Response (200):

{
  "balance": "100000000",
  "unconfirmedBalance": "0",
  "pubkey": "xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKp9ybq4dK",
  "addresses": [
    {
      "balance": "50000000",
      "pubkey": "LTCaddress1"
    },
    {
      "balance": "50000000",
      "pubkey": "LTCaddress2"
    }
  ],
  "nextReceiveAddressIndex": 2,
  "nextChangeAddressIndex": 1
}

3. GET /api/v1/account/{pubkey}/txs

GET /api/v1/account/xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKp9ybq4dK/txs?pageSize=5 HTTP/1.1
Accept: application/json

4. GET /api/v1/account/{pubkey}/utxos

GET /api/v1/account/LTCTestAddress/utxos HTTP/1.1
Accept: application/json

5. GET /api/v1/tx/{txid}

GET /api/v1/tx/abcd1234 HTTP/1.1
Accept: application/json

6. GET /api/v1/tx/{txid}/raw

GET /api/v1/tx/abcd1234/raw HTTP/1.1
Accept: application/json

7. POST /api/v1/send

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

{
  "hex": "0200000001abcd..."
}

8. GET /api/v1/fees

GET /api/v1/fees HTTP/1.1
Accept: application/json

Response:

{
  "fast": {
    "satsPerKiloByte": 50000,
    "blocksUntilConfirmation": 1
  },
  "average": {
    "satsPerKiloByte": 30000,
    "blocksUntilConfirmation": 3
  },
  "slow": {
    "satsPerKiloByte": 10000,
    "blocksUntilConfirmation": 6
  }
}

Implementation Details and Algorithms


Interaction with Other System Components


Visual Diagram

This file defines primarily **schemas** and **REST endpoints**, so a **flowchart** showing the main endpoints and their relationships to schemas provides the clearest overview.

flowchart TD
    Info[GET /api/v1/info] -->|response| BaseInfoSchema[BaseInfo]
    Account[GET /api/v1/account/{pubkey}] -->|response| AccountSchema[Account]
    TxHistory[GET /api/v1/account/{pubkey}/txs] -->|response| TxHistorySchema[TxHistory]
    Utxos[GET /api/v1/account/{pubkey}/utxos] -->|response| UtxoSchemaArray[Array of Utxo]
    Tx[GET /api/v1/tx/{txid}] -->|response| TxSchema[Tx]
    RawTx[GET /api/v1/tx/{txid}/raw] -->|response| RawTxSchema[RawTx]
    SendTx[POST /api/v1/send] -->|request body| SendTxBodySchema[SendTxBody]
    SendTx -->|response| TxId[String]
    Fees[GET /api/v1/fees] -->|response| NetworkFeesSchema[NetworkFees]

    subgraph Schemas
        BaseInfoSchema
        AccountSchema
        TxHistorySchema
        UtxoSchemaArray
        TxSchema
        RawTxSchema
        SendTxBodySchema
        NetworkFeesSchema
    end

Summary

The [swagger.json](/projects/291/68968) file is a comprehensive OpenAPI specification for the ShapeShift Litecoin API, defining a robust set of REST endpoints to interact with Litecoin accounts, transactions, UTXOs, and network fees. It standardizes request/response formats and error handling, serving as the formal API contract for clients and backend implementers. The spec models typical blockchain data constructs and supports pagination, raw transaction broadcasting, and fee estimation — essential for building wallets, explorers, and other blockchain-integrated applications.