swagger.json


Overview

The [swagger.json](/projects/291/68851) file is an OpenAPI 3.0 specification document that defines the RESTful API interface for the [@shapeshiftoss/dogecoin-api](/projects/291/69281) service (version 10.0.0). This API provides endpoints to interact with a Dogecoin coinstack, allowing clients to query blockchain data such as account details, transaction history, unspent transaction outputs (UTXOs), transaction details, broadcast raw transactions, and retrieve current network fee recommendations.

The file serves as a contract between API providers and consumers, detailing available paths, HTTP methods, request parameters, response schemas, error handling, and server information. It is primarily used for API documentation, client SDK generation, and automated testing.


Components

The [components](/projects/291/69205) section contains reusable schema definitions (data models), error response formats, and (though empty here) security schemes. These schemas describe the shape and constraints of request and response payloads.

Schemas

Below are key data schemas defined in [swagger.json](/projects/291/68851):

BaseInfo

Address

Account

Vin (Transaction Input)

Vout (Transaction Output)

Tx (Transaction)

BaseTxHistory_Tx_

TxHistory

Utxo (Unspent Transaction Output)

RawTx

SendTxBody

NetworkFee

NetworkFees


API Paths and Operations

The API exposes the following primary endpoints under `/api/v1`:

1. GET /api/v1/info

GET /api/v1/info HTTP/1.1
Host: example.com

Response:
{
  "network": "mainnet"
}

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

GET /api/v1/account/abc123pubkey HTTP/1.1

Response:
{
  "balance": "1000000",
  "unconfirmedBalance": "50000",
  "pubkey": "abc123pubkey",
  "addresses": [...],
  "nextReceiveAddressIndex": 5,
  "nextChangeAddressIndex": 2
}

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


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


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


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


7. POST /api/v1/send

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

{
  "hex": "0100000001abcdef..."
}

Response:
"txid1234567890"

8. GET /api/v1/fees


Error Schemas


Important Implementation Details


Interaction With Other System Components


Visual Diagram: API Structure Flowchart

flowchart TD
    A[API Root] --> B[GET /api/v1/info]
    A --> C[GET /api/v1/account/{pubkey}]
    A --> D[GET /api/v1/account/{pubkey}/txs]
    A --> E[GET /api/v1/account/{pubkey}/utxos]
    A --> F[GET /api/v1/tx/{txid}]
    A --> G[GET /api/v1/tx/{txid}/raw]
    A --> H[POST /api/v1/send]
    A --> I[GET /api/v1/fees]

    C --> |Returns| Account
    D --> |Returns| TxHistory
    E --> |Returns| Utxo[]
    F --> |Returns| Tx
    G --> |Returns| RawTx
    H --> |Request| SendTxBody
    H --> |Returns| txid (string)
    I --> |Returns| NetworkFees
    B --> |Returns| BaseInfo

Summary

This [swagger.json](/projects/291/68851) file comprehensively defines the Dogecoin API for querying blockchain data, managing accounts, retrieving transactions and UTXOs, sending transactions, and fetching fee recommendations. It uses strict and detailed JSON schemas to describe data structures and robustly defines various HTTP endpoints with clear operation IDs and error handling.

This specification is essential for developers and integrators to understand, consume, and implement the Dogecoin API consistently, ensuring reliable and predictable interactions with the Dogecoin coinstack service.