From a61db62d8168459d937a5a474867fde389f524bf Mon Sep 17 00:00:00 2001 From: docs-agent Date: Fri, 15 May 2026 16:45:11 +0000 Subject: [PATCH 1/2] [docs-agent] UTXO API: per-chain curl examples for BCH / LTC / DOGE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each UTXO chain page currently consumes the shared `src/openapi/utxo/utxo.yaml` spec, which defaults to bitcoin-mainnet and carries Bitcoin-specific examples (real BTC block hashes, real BTC txids, BTC bech32 addresses). On the Bitcoin Cash, Litecoin, and Dogecoin chain pages, that produces misleading defaults — users see BTC curl invocations under a non-BTC product header. Add three sibling OpenAPI specs that mirror the shared shape but populate every parameter and response example with chain-specific values derived from live mainnet calls: * `src/openapi/utxo-bitcoincash/utxo-bitcoincash.yaml` (servers: `bitcoincash-mainnet`, `bitcoincash-testnet`) * `src/openapi/utxo-litecoin/utxo-litecoin.yaml` (servers: `litecoin-mainnet`, `litecoin-testnet`) * `src/openapi/utxo-dogecoin/utxo-dogecoin.yaml` (servers: `dogecoin-mainnet`) Repoint the three sibling chain sections in `content/docs.yml` at their new `api-name`. Bitcoin section continues to use the existing `utxo.yaml` unchanged. Refs DOCS-83 Requested-by: @andra-catana --- content/docs.yml | 6 +- .../utxo-bitcoincash/utxo-bitcoincash.yaml | 842 +++++++++++++++++ src/openapi/utxo-dogecoin/utxo-dogecoin.yaml | 839 +++++++++++++++++ src/openapi/utxo-litecoin/utxo-litecoin.yaml | 847 ++++++++++++++++++ 4 files changed, 2531 insertions(+), 3 deletions(-) create mode 100644 src/openapi/utxo-bitcoincash/utxo-bitcoincash.yaml create mode 100644 src/openapi/utxo-dogecoin/utxo-dogecoin.yaml create mode 100644 src/openapi/utxo-litecoin/utxo-litecoin.yaml diff --git a/content/docs.yml b/content/docs.yml index c66c6c85e..e27a56158 100644 --- a/content/docs.yml +++ b/content/docs.yml @@ -1481,7 +1481,7 @@ navigation: - link: UTXO Migration Guide href: /docs/bitcoin/utxo-migration-guide - api: UTXO API Endpoints - api-name: utxo + api-name: utxo-bitcoincash flattened: true slug: bitcoincash - section: Blast @@ -1604,7 +1604,7 @@ navigation: - link: UTXO Migration Guide href: /docs/bitcoin/utxo-migration-guide - api: UTXO API Endpoints - api-name: utxo + api-name: utxo-dogecoin flattened: true slug: dogecoin @@ -1761,7 +1761,7 @@ navigation: - link: UTXO Migration Guide href: /docs/bitcoin/utxo-migration-guide - api: UTXO API Endpoints - api-name: utxo + api-name: utxo-litecoin flattened: true slug: litecoin - section: Lumia diff --git a/src/openapi/utxo-bitcoincash/utxo-bitcoincash.yaml b/src/openapi/utxo-bitcoincash/utxo-bitcoincash.yaml new file mode 100644 index 000000000..1c304fd78 --- /dev/null +++ b/src/openapi/utxo-bitcoincash/utxo-bitcoincash.yaml @@ -0,0 +1,842 @@ +# yaml-language-server: $schema=https://spec.openapis.org/oas/3.1/schema/2022-10-07 +openapi: 3.1.0 +info: + title: 🪙 UTXO API (Bitcoin Cash) + version: "1.0" + description: > + REST API for Bitcoin Cash, powered by [Trezor Blockbook](https://github.com/trezor/blockbook). + Use these endpoints to query indexed block, transaction, address, xpub, and UTXO data on the + Bitcoin Cash networks. The same paths are available on every UTXO chain Alchemy supports — + switch chains using the chain-specific overview pages or by changing the host. +servers: + - url: https://{network}.g.alchemy.com/v2 + variables: + network: + default: bitcoincash-mainnet + enum: + - bitcoincash-mainnet + - bitcoincash-testnet +paths: + "/{apiKey}/api/v2/block-index/{block_height}": + get: + operationId: getBlockHashByIndex + summary: Get Block Hash + description: Returns the block hash for a given block height on the selected network. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - $ref: "#/components/parameters/blockHeight" + responses: + "200": + description: Block hash for the requested height. + content: + application/json: + schema: + $ref: "#/components/schemas/BlockIndexResponse" + example: + blockHash: "000000000000000001b4642b21d69e5ebfe640dc86beff246597bbe2dcd1d5c9" + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + + "/{apiKey}/api/v2/tx/{txid}": + get: + operationId: getTransaction + summary: Get Transaction + description: > + Returns normalized transaction data for the given transaction ID. Response shape is consistent + across UTXO networks. Empty fields are omitted. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - $ref: "#/components/parameters/txid" + responses: + "200": + description: Transaction details. + content: + application/json: + schema: + $ref: "#/components/schemas/Tx" + example: + txid: "0ddda32c1004ba0cdb6544ac4622f7affc895b8f582b27f202d9745186f72d0a" + version: 1 + vin: + - txid: "9a3a10888fb4e8b6ecc83a5add5c5bc8db33650feeaac9a2a94fe114d4e311fd" + vout: 2 + sequence: 4294967295 + n: 0 + addresses: + ["bitcoincash:qzk7vrrk3x87psq5x8kateumge0crzsd3g6r84k0ef"] + isAddress: true + value: "546" + vout: + - value: "546" + n: 1 + hex: "76a91462e9075c5cbf27d50a539e7afbe1f6a1d772479e88ac" + addresses: + ["bitcoincash:qp3wjpa3tjlj042z2wv7hahsldgwhwy0rq9sywjpyy"] + isAddress: true + blockHash: "000000000000000000b9cc8d1b01604a308f872fae0408045466e82ec6ae9ac1" + blockHeight: 941680 + confirmations: 9484 + blockTime: 1773119738 + size: 479 + value: "45484" + valueIn: "45965" + fees: "481" + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + + "/{apiKey}/api/v2/tx-specific/{txid}": + get: + operationId: getTransactionSpecific + summary: Get Transaction Specific + description: > + Returns transaction data in the exact format returned by the underlying coin backend, including + all chain-specific fields not surfaced by the normalized `/tx/{txid}` endpoint. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - $ref: "#/components/parameters/txid" + responses: + "200": + description: Backend-native transaction object. + content: + application/json: + schema: + type: object + additionalProperties: true + description: Backend-specific transaction object. Shape varies by coin. + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + + "/{apiKey}/api/v2/address/{address}": + get: + operationId: getAddress + summary: Get Address + description: > + Returns balances and transactions for the given Bitcoin Cash address. Transactions are sorted + newest-first by block height. Bitcoin Cash addresses use the `bitcoincash:` CashAddr prefix. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - $ref: "#/components/parameters/address" + - in: query + name: page + required: false + description: Page of returned transactions, starting from 1. + schema: + type: integer + minimum: 1 + default: 1 + - in: query + name: pageSize + required: false + description: Number of transactions returned per page (max 1000). + schema: + type: integer + minimum: 1 + maximum: 1000 + default: 1000 + - in: query + name: from + required: false + description: Filter transactions starting from this block height. + schema: + type: integer + minimum: 0 + - in: query + name: to + required: false + description: Filter transactions up to this block height. + schema: + type: integer + minimum: 0 + - in: query + name: details + required: false + description: Level of detail to return. + schema: + type: string + enum: [basic, tokens, tokenBalances, txids, txslight, txs] + default: txids + - in: query + name: secondary + required: false + description: Secondary (fiat) currency code for balance conversion, e.g. `usd` or `eur`. + schema: + type: string + responses: + "200": + description: Address details, balances, and transactions. + content: + application/json: + schema: + $ref: "#/components/schemas/AddressInfo" + example: + page: 1 + totalPages: 2 + itemsOnPage: 1000 + address: "bitcoincash:qp3wjpa3tjlj042z2wv7hahsldgwhwy0rq9sywjpyy" + balance: "7671258180" + totalReceived: "7671258180" + totalSent: "0" + unconfirmedBalance: "0" + unconfirmedTxs: 0 + txs: 1228 + txids: + - "20063eb8ae04c6449ea397ca609db09522e316795d96eb47d3e4c50591fb3679" + - "0ddda32c1004ba0cdb6544ac4622f7affc895b8f582b27f202d9745186f72d0a" + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + + "/{apiKey}/api/v2/xpub/{xpub}": + get: + operationId: getXpub + summary: Get Xpub + description: > + Returns balances and transactions for an xpub or output descriptor on Bitcoin Cash. Supports + BIP44 and BIP49 derivation schemes. The BIP version is determined by the xpub prefix or by an + explicit output descriptor. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - in: path + name: xpub + required: true + description: Extended public key or output descriptor. + schema: + type: string + example: "xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz" + - in: query + name: page + required: false + schema: + type: integer + minimum: 1 + default: 1 + - in: query + name: pageSize + required: false + schema: + type: integer + minimum: 1 + maximum: 1000 + default: 1000 + - in: query + name: from + required: false + schema: + type: integer + minimum: 0 + - in: query + name: to + required: false + schema: + type: integer + minimum: 0 + - in: query + name: details + required: false + schema: + type: string + enum: [basic, tokens, tokenBalances, txids, txs] + default: txids + - in: query + name: tokens + required: false + description: Which derived addresses to return. + schema: + type: string + enum: [nonzero, used, derived] + default: nonzero + - in: query + name: secondary + required: false + description: Secondary (fiat) currency code for balance conversion. + schema: + type: string + responses: + "200": + description: Xpub details, balances, derived addresses, and transactions. + content: + application/json: + schema: + $ref: "#/components/schemas/AddressInfo" + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + + "/{apiKey}/api/v2/utxo/{descriptor}": + get: + operationId: getUtxo + summary: Get UTXOs + description: > + Returns the unspent transaction outputs for a Bitcoin Cash address, xpub, or output + descriptor. Includes confirmed and unconfirmed UTXOs by default; pass `confirmed=true` to + limit to confirmed only. UTXOs are sorted newest-first. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - in: path + name: descriptor + required: true + description: Bitcoin Cash address, xpub, or output descriptor. + schema: + type: string + example: "bitcoincash:qp3wjpa3tjlj042z2wv7hahsldgwhwy0rq9sywjpyy" + - in: query + name: confirmed + required: false + description: When `true`, exclude unconfirmed UTXOs. + schema: + type: boolean + default: false + responses: + "200": + description: List of UTXOs. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Utxo" + example: + - txid: "20063eb8ae04c6449ea397ca609db09522e316795d96eb47d3e4c50591fb3679" + vout: 1 + value: "600" + height: 949568 + confirmations: 1591 + - txid: "0ddda32c1004ba0cdb6544ac4622f7affc895b8f582b27f202d9745186f72d0a" + vout: 1 + value: "546" + height: 941680 + confirmations: 9479 + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + + "/{apiKey}/api/v2/block/{block}": + get: + operationId: getBlock + summary: Get Block + description: > + Returns information about a block on Bitcoin Cash, including transactions, by block hash or + block height. Results are paginated. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - in: path + name: block + required: true + description: Block height (integer) or block hash (hex string). + schema: + type: string + example: "860730" + - in: query + name: page + required: false + schema: + type: integer + minimum: 1 + default: 1 + - in: query + name: pageSize + required: false + schema: + type: integer + minimum: 1 + maximum: 1000 + default: 1000 + responses: + "200": + description: Block details with paginated transactions. + content: + application/json: + schema: + $ref: "#/components/schemas/Block" + example: + page: 1 + totalPages: 1 + itemsOnPage: 1000 + hash: "000000000000000001b4642b21d69e5ebfe640dc86beff246597bbe2dcd1d5c9" + previousBlockHash: "000000000000000000ec5ff3da7aa8064ddb9fc0630a9f5859ad8e2d6e07de78" + nextBlockHash: "000000000000000002247a19f9f7b69fc1a5d330455c82a7f37efd8deee6f64a" + height: 860730 + confirmations: 90434 + size: 95372 + time: 1724718072 + version: 1040187392 + merkleRoot: "fd9773cd0359a8ba3ef62e542ad86a38536b6a81d7cdcf2f25d494264dd55a55" + nonce: "3293742657" + bits: "18025986" + difficulty: "467929700151.3096" + txCount: 196 + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + + "/{apiKey}/api/v2/sendtx/{hex}": + get: + operationId: sendTransactionGet + summary: Send Transaction (GET) + description: > + Broadcasts a signed raw Bitcoin Cash transaction encoded as a hex string in the path. Returns + the transaction ID on success. For larger payloads, use the POST variant. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - in: path + name: hex + required: true + description: Hex-encoded raw transaction bytes. + schema: + type: string + example: "010000000001..." + responses: + "200": + description: Transaction broadcast result. + content: + application/json: + schema: + $ref: "#/components/schemas/SendTxResponse" + example: + result: "0ddda32c1004ba0cdb6544ac4622f7affc895b8f582b27f202d9745186f72d0a" + "400": + $ref: "#/components/responses/BadRequest" + + "/{apiKey}/api/v2/sendtx/": + post: + operationId: sendTransactionPost + summary: Send Transaction (POST) + description: > + Broadcasts a signed raw Bitcoin Cash transaction by sending hex bytes in the request body. + The trailing slash on the path is mandatory; see the [Blockbook API + reference](https://github.com/trezor/blockbook/blob/master/docs/api.md#send-transaction). + Use this for larger payloads (request body limit 8 MiB). Returns the transaction ID on success. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + requestBody: + required: true + content: + text/plain: + schema: + type: string + description: Hex-encoded raw transaction bytes. + example: "010000000001..." + responses: + "200": + description: Transaction broadcast result. + content: + application/json: + schema: + $ref: "#/components/schemas/SendTxResponse" + example: + result: "0ddda32c1004ba0cdb6544ac4622f7affc895b8f582b27f202d9745186f72d0a" + "400": + $ref: "#/components/responses/BadRequest" + + "/{apiKey}/api/v2/tickers-list": + get: + operationId: getTickersList + summary: Get Tickers List + description: > + Returns the list of available currency rate tickers (secondary currencies) for Bitcoin Cash at + a given timestamp, along with the actual data timestamp. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - in: query + name: timestamp + required: false + description: Unix timestamp to query availability for. Defaults to the latest available. + schema: + type: integer + example: 1578391200 + responses: + "200": + description: Available tickers. + content: + application/json: + schema: + $ref: "#/components/schemas/TickersListResponse" + example: + ts: 1578391200 + available_currencies: ["eur", "usd"] + "400": + $ref: "#/components/responses/BadRequest" + + "/{apiKey}/api/v2/tickers": + get: + operationId: getTickers + summary: Get Tickers + description: > + Returns the Bitcoin Cash currency rate for the specified currency and timestamp. If the + requested currency is unavailable for that timestamp, the closest rate is returned with the + actual rate timestamp. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - in: query + name: currency + required: false + description: Fiat or crypto currency code (e.g. `usd`, `eur`, `eth`). Omit to return all. + schema: + type: string + example: usd + - in: query + name: timestamp + required: false + description: Unix timestamp. Omit to return the latest. + schema: + type: integer + example: 1578391200 + responses: + "200": + description: Currency rate response. + content: + application/json: + schema: + $ref: "#/components/schemas/TickerRates" + example: + ts: 1578391200 + rates: + usd: 240.13 + "400": + $ref: "#/components/responses/BadRequest" + + "/{apiKey}/api/v2/balancehistory/{address}": + get: + operationId: getBalanceHistory + summary: Get Balance History + description: > + Returns the balance history for the specified Bitcoin Cash address. Optionally enrich each + bucket with secondary (fiat) currency rates at the time of the transaction. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - $ref: "#/components/parameters/address" + - in: query + name: from + required: true + description: Start of the history range as a Unix timestamp. + schema: + type: integer + example: 1501545600 + - in: query + name: to + required: true + description: End of the history range as a Unix timestamp. + schema: + type: integer + example: 1757280000 + - in: query + name: fiatcurrency + required: false + description: Fiat currency code to enrich each bucket with. + schema: + type: string + example: usd + - in: query + name: groupBy + required: false + description: Aggregation interval in seconds. Defaults to 3600. + schema: + type: integer + default: 3600 + responses: + "200": + description: Balance history buckets. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/BalanceHistoryEntry" + example: + - time: 1724720400 + txs: 1 + received: "100000" + sent: "0" + sentToSelf: "0" + rates: + usd: 322.7 + - time: 1724724000 + txs: 1 + received: "0" + sent: "100000" + sentToSelf: "0" + rates: + usd: 323.1 + "400": + $ref: "#/components/responses/BadRequest" + +components: + parameters: + apiKey: + name: apiKey + in: path + required: true + schema: + type: string + default: docs-demo + description: For higher throughput, [create your own API key](https://dashboard.alchemy.com/signup) + blockHeight: + in: path + name: block_height + required: true + description: Block height as a non-negative integer. + schema: + type: integer + minimum: 0 + example: 860730 + txid: + in: path + name: txid + required: true + description: Hex-encoded transaction ID. + schema: + type: string + example: "0ddda32c1004ba0cdb6544ac4622f7affc895b8f582b27f202d9745186f72d0a" + address: + in: path + name: address + required: true + description: Bitcoin Cash CashAddr address (`bitcoincash:` prefixed). + schema: + type: string + example: "bitcoincash:qp3wjpa3tjlj042z2wv7hahsldgwhwy0rq9sywjpyy" + responses: + BadRequest: + description: Malformed request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + example: + error: + message: "invalid request" + NotFound: + description: Resource not found on the requested network. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + example: + error: + message: "not found" + schemas: + Error: + type: object + properties: + error: + type: object + properties: + message: + type: string + BlockIndexResponse: + type: object + required: [blockHash] + properties: + blockHash: + type: string + description: Hex-encoded block hash for the requested height. + SendTxResponse: + type: object + properties: + result: + type: string + description: Transaction ID of the broadcast transaction. + Vin: + type: object + properties: + txid: { type: string } + vout: { type: integer } + sequence: { type: integer } + n: { type: integer } + addresses: + type: array + items: { type: string } + isAddress: { type: boolean } + value: + type: string + description: Value in the smallest denomination, as a decimal string. + Vout: + type: object + properties: + value: + type: string + description: Value in the smallest denomination, as a decimal string. + n: { type: integer } + spent: { type: boolean } + hex: { type: string } + addresses: + type: array + items: { type: string } + isAddress: { type: boolean } + Tx: + type: object + properties: + txid: { type: string } + version: { type: integer } + lockTime: { type: integer } + vin: + type: array + items: + $ref: "#/components/schemas/Vin" + vout: + type: array + items: + $ref: "#/components/schemas/Vout" + blockHash: { type: string } + blockHeight: + type: integer + description: Height of the block, or `-1` for unconfirmed transactions. + confirmations: { type: integer } + confirmationETABlocks: + type: integer + description: Estimated blocks to first confirmation (only set when unconfirmed). + confirmationETASeconds: + type: integer + description: Estimated seconds to first confirmation (only set when unconfirmed). + blockTime: { type: integer } + size: { type: integer } + vsize: { type: integer } + value: + type: string + valueIn: + type: string + fees: + type: string + hex: { type: string } + rbf: { type: boolean } + Token: + type: object + description: Derived token entry for an xpub or address. + properties: + type: + type: string + example: XPUBAddress + name: { type: string } + path: { type: string } + transfers: { type: integer } + decimals: { type: integer } + balance: + type: string + totalReceived: + type: string + totalSent: + type: string + AddressInfo: + type: object + properties: + page: { type: integer } + totalPages: { type: integer } + itemsOnPage: { type: integer } + address: { type: string } + balance: + type: string + totalReceived: + type: string + totalSent: + type: string + unconfirmedBalance: + type: string + unconfirmedTxs: { type: integer } + txs: { type: integer } + txids: + type: array + items: { type: string } + usedTokens: { type: integer } + tokens: + type: array + items: + $ref: "#/components/schemas/Token" + secondaryValue: { type: number } + Utxo: + type: object + required: [txid, vout, value] + properties: + txid: { type: string } + vout: { type: integer } + value: + type: string + description: Value in the smallest denomination, as a decimal string. + height: + type: integer + description: Block height. Omitted for unconfirmed UTXOs. + confirmations: { type: integer } + lockTime: + type: integer + description: Lock time, only set for unconfirmed UTXOs with non-zero locktime. + coinbase: + type: boolean + description: True if the output comes from a coinbase transaction within the first 100 confirmations. + address: { type: string } + path: + type: string + description: Derivation path. Only set when querying by xpub or descriptor. + Block: + type: object + properties: + page: { type: integer } + totalPages: { type: integer } + itemsOnPage: { type: integer } + hash: { type: string } + previousBlockHash: { type: string } + nextBlockHash: { type: string } + height: { type: integer } + confirmations: { type: integer } + size: { type: integer } + time: { type: integer } + version: { type: integer } + merkleRoot: { type: string } + nonce: { type: string } + bits: { type: string } + difficulty: { type: string } + txCount: { type: integer } + txs: + type: array + items: + $ref: "#/components/schemas/Tx" + TickersListResponse: + type: object + properties: + ts: { type: integer } + available_currencies: + type: array + items: { type: string } + TickerRates: + type: object + properties: + ts: { type: integer } + rates: + type: object + additionalProperties: + type: number + BalanceHistoryEntry: + type: object + properties: + time: { type: integer } + txs: { type: integer } + received: + type: string + sent: + type: string + sentToSelf: + type: string + rates: + type: object + additionalProperties: + type: number diff --git a/src/openapi/utxo-dogecoin/utxo-dogecoin.yaml b/src/openapi/utxo-dogecoin/utxo-dogecoin.yaml new file mode 100644 index 000000000..a38d71409 --- /dev/null +++ b/src/openapi/utxo-dogecoin/utxo-dogecoin.yaml @@ -0,0 +1,839 @@ +# yaml-language-server: $schema=https://spec.openapis.org/oas/3.1/schema/2022-10-07 +openapi: 3.1.0 +info: + title: 🪙 UTXO API (Dogecoin) + version: "1.0" + description: > + REST API for Dogecoin, powered by [Trezor Blockbook](https://github.com/trezor/blockbook). + Use these endpoints to query indexed block, transaction, address, xpub, and UTXO data on + Dogecoin. The same paths are available on every UTXO chain Alchemy supports — switch chains + using the chain-specific overview pages or by changing the host. +servers: + - url: https://{network}.g.alchemy.com/v2 + variables: + network: + default: dogecoin-mainnet + enum: + - dogecoin-mainnet +paths: + "/{apiKey}/api/v2/block-index/{block_height}": + get: + operationId: getBlockHashByIndex + summary: Get Block Hash + description: Returns the block hash for a given block height on the selected network. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - $ref: "#/components/parameters/blockHeight" + responses: + "200": + description: Block hash for the requested height. + content: + application/json: + schema: + $ref: "#/components/schemas/BlockIndexResponse" + example: + blockHash: "56acd910a28cf4fd3504252464f80bcf11944246e4ab49c8d9108582cd4d5592" + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + + "/{apiKey}/api/v2/tx/{txid}": + get: + operationId: getTransaction + summary: Get Transaction + description: > + Returns normalized transaction data for the given transaction ID. Response shape is consistent + across UTXO networks. Empty fields are omitted. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - $ref: "#/components/parameters/txid" + responses: + "200": + description: Transaction details. + content: + application/json: + schema: + $ref: "#/components/schemas/Tx" + example: + txid: "bdd9010d7a666d3b7d3c7434b1ed98ccdf51e07aa69f00919f191f6a5e217482" + version: 1 + vin: + - txid: "e6b774dae71e6db82d991ed1e2edc1c69d06eb8d7bbf63e5175d424fefd951d0" + vout: 1 + sequence: 4294967295 + n: 0 + addresses: ["D6Dz1pzn2AcwSfz1Sat6Re54pghrFxcRa8"] + isAddress: true + value: "171349091667" + vout: + - value: "832138460" + n: 0 + hex: "76a914830a7420e63d76244ff7cbd1c248e94c1446325988ac" + addresses: ["DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L"] + isAddress: true + blockHash: "9d9435c808eb48f81bae0dad67238ff0d23486340f3ec03194164a46c78e4ce6" + blockHeight: 6170356 + confirmations: 37436 + blockTime: 1776485581 + size: 226 + value: "171239091667" + valueIn: "171349091667" + fees: "110000000" + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + + "/{apiKey}/api/v2/tx-specific/{txid}": + get: + operationId: getTransactionSpecific + summary: Get Transaction Specific + description: > + Returns transaction data in the exact format returned by the underlying coin backend, including + all chain-specific fields not surfaced by the normalized `/tx/{txid}` endpoint. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - $ref: "#/components/parameters/txid" + responses: + "200": + description: Backend-native transaction object. + content: + application/json: + schema: + type: object + additionalProperties: true + description: Backend-specific transaction object. Shape varies by coin. + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + + "/{apiKey}/api/v2/address/{address}": + get: + operationId: getAddress + summary: Get Address + description: > + Returns balances and transactions for the given Dogecoin address. Transactions are sorted + newest-first by block height. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - $ref: "#/components/parameters/address" + - in: query + name: page + required: false + description: Page of returned transactions, starting from 1. + schema: + type: integer + minimum: 1 + default: 1 + - in: query + name: pageSize + required: false + description: Number of transactions returned per page (max 1000). + schema: + type: integer + minimum: 1 + maximum: 1000 + default: 1000 + - in: query + name: from + required: false + description: Filter transactions starting from this block height. + schema: + type: integer + minimum: 0 + - in: query + name: to + required: false + description: Filter transactions up to this block height. + schema: + type: integer + minimum: 0 + - in: query + name: details + required: false + description: Level of detail to return. + schema: + type: string + enum: [basic, tokens, tokenBalances, txids, txslight, txs] + default: txids + - in: query + name: secondary + required: false + description: Secondary (fiat) currency code for balance conversion, e.g. `usd` or `eur`. + schema: + type: string + responses: + "200": + description: Address details, balances, and transactions. + content: + application/json: + schema: + $ref: "#/components/schemas/AddressInfo" + example: + page: 1 + totalPages: 2 + itemsOnPage: 1000 + address: "DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L" + balance: "6107498363136" + totalReceived: "5581286217473096314" + totalSent: "5581280109974733178" + unconfirmedBalance: "0" + unconfirmedTxs: 0 + txs: 1471 + txids: + - "1b8599ba1425c62df8097a688ae5b63a807a1f1d212080f213c0a22bbc1623c2" + - "152eafdee44fae922f1a4c0b110433e9bbe4f1190089f15b8fcc705dbbaad63e" + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + + "/{apiKey}/api/v2/xpub/{xpub}": + get: + operationId: getXpub + summary: Get Xpub + description: > + Returns balances and transactions for an xpub or output descriptor on Dogecoin. Supports + BIP44 derivation. The BIP version is determined by the xpub prefix or by an explicit + output descriptor. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - in: path + name: xpub + required: true + description: Extended public key or output descriptor. + schema: + type: string + example: "xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz" + - in: query + name: page + required: false + schema: + type: integer + minimum: 1 + default: 1 + - in: query + name: pageSize + required: false + schema: + type: integer + minimum: 1 + maximum: 1000 + default: 1000 + - in: query + name: from + required: false + schema: + type: integer + minimum: 0 + - in: query + name: to + required: false + schema: + type: integer + minimum: 0 + - in: query + name: details + required: false + schema: + type: string + enum: [basic, tokens, tokenBalances, txids, txs] + default: txids + - in: query + name: tokens + required: false + description: Which derived addresses to return. + schema: + type: string + enum: [nonzero, used, derived] + default: nonzero + - in: query + name: secondary + required: false + description: Secondary (fiat) currency code for balance conversion. + schema: + type: string + responses: + "200": + description: Xpub details, balances, derived addresses, and transactions. + content: + application/json: + schema: + $ref: "#/components/schemas/AddressInfo" + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + + "/{apiKey}/api/v2/utxo/{descriptor}": + get: + operationId: getUtxo + summary: Get UTXOs + description: > + Returns the unspent transaction outputs for a Dogecoin address, xpub, or output descriptor. + Includes confirmed and unconfirmed UTXOs by default; pass `confirmed=true` to limit to + confirmed only. UTXOs are sorted newest-first. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - in: path + name: descriptor + required: true + description: Dogecoin address, xpub, or output descriptor. + schema: + type: string + example: "DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L" + - in: query + name: confirmed + required: false + description: When `true`, exclude unconfirmed UTXOs. + schema: + type: boolean + default: false + responses: + "200": + description: List of UTXOs. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Utxo" + example: + - txid: "1b8599ba1425c62df8097a688ae5b63a807a1f1d212080f213c0a22bbc1623c2" + vout: 5 + value: "1857000000" + height: 6201476 + confirmations: 6319 + - txid: "152eafdee44fae922f1a4c0b110433e9bbe4f1190089f15b8fcc705dbbaad63e" + vout: 0 + value: "1370237805" + height: 6197469 + confirmations: 10326 + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + + "/{apiKey}/api/v2/block/{block}": + get: + operationId: getBlock + summary: Get Block + description: > + Returns information about a block on Dogecoin, including transactions, by block hash or + block height. Results are paginated. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - in: path + name: block + required: true + description: Block height (integer) or block hash (hex string). + schema: + type: string + example: "860730" + - in: query + name: page + required: false + schema: + type: integer + minimum: 1 + default: 1 + - in: query + name: pageSize + required: false + schema: + type: integer + minimum: 1 + maximum: 1000 + default: 1000 + responses: + "200": + description: Block details with paginated transactions. + content: + application/json: + schema: + $ref: "#/components/schemas/Block" + example: + page: 1 + totalPages: 1 + itemsOnPage: 1000 + hash: "56acd910a28cf4fd3504252464f80bcf11944246e4ab49c8d9108582cd4d5592" + previousBlockHash: "44158276941865c4edf59dfe95b2b413f8647446c2939817c2112ab8fc426382" + nextBlockHash: "323f3fad908db6d5937eabb66d5cc67d1cd4be5009fa84f0786e83c6bc931c35" + height: 860730 + confirmations: 5347067 + size: 3590 + time: 1441293539 + version: 6422786 + merkleRoot: "78107b10d593f186e16638f1a1e921ad93976ee51c419773405a2f5ed82c0a5f" + nonce: "0" + bits: "1b046d84" + difficulty: "14800.81935350472" + txCount: 10 + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + + "/{apiKey}/api/v2/sendtx/{hex}": + get: + operationId: sendTransactionGet + summary: Send Transaction (GET) + description: > + Broadcasts a signed raw Dogecoin transaction encoded as a hex string in the path. Returns + the transaction ID on success. For larger payloads, use the POST variant. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - in: path + name: hex + required: true + description: Hex-encoded raw transaction bytes. + schema: + type: string + example: "010000000001..." + responses: + "200": + description: Transaction broadcast result. + content: + application/json: + schema: + $ref: "#/components/schemas/SendTxResponse" + example: + result: "bdd9010d7a666d3b7d3c7434b1ed98ccdf51e07aa69f00919f191f6a5e217482" + "400": + $ref: "#/components/responses/BadRequest" + + "/{apiKey}/api/v2/sendtx/": + post: + operationId: sendTransactionPost + summary: Send Transaction (POST) + description: > + Broadcasts a signed raw Dogecoin transaction by sending hex bytes in the request body. + The trailing slash on the path is mandatory; see the [Blockbook API + reference](https://github.com/trezor/blockbook/blob/master/docs/api.md#send-transaction). + Use this for larger payloads (request body limit 8 MiB). Returns the transaction ID on success. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + requestBody: + required: true + content: + text/plain: + schema: + type: string + description: Hex-encoded raw transaction bytes. + example: "010000000001..." + responses: + "200": + description: Transaction broadcast result. + content: + application/json: + schema: + $ref: "#/components/schemas/SendTxResponse" + example: + result: "bdd9010d7a666d3b7d3c7434b1ed98ccdf51e07aa69f00919f191f6a5e217482" + "400": + $ref: "#/components/responses/BadRequest" + + "/{apiKey}/api/v2/tickers-list": + get: + operationId: getTickersList + summary: Get Tickers List + description: > + Returns the list of available currency rate tickers (secondary currencies) for Dogecoin at + a given timestamp, along with the actual data timestamp. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - in: query + name: timestamp + required: false + description: Unix timestamp to query availability for. Defaults to the latest available. + schema: + type: integer + example: 1578391200 + responses: + "200": + description: Available tickers. + content: + application/json: + schema: + $ref: "#/components/schemas/TickersListResponse" + example: + ts: 1578391200 + available_currencies: ["eur", "usd"] + "400": + $ref: "#/components/responses/BadRequest" + + "/{apiKey}/api/v2/tickers": + get: + operationId: getTickers + summary: Get Tickers + description: > + Returns the Dogecoin currency rate for the specified currency and timestamp. If the + requested currency is unavailable for that timestamp, the closest rate is returned with + the actual rate timestamp. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - in: query + name: currency + required: false + description: Fiat or crypto currency code (e.g. `usd`, `eur`, `eth`). Omit to return all. + schema: + type: string + example: usd + - in: query + name: timestamp + required: false + description: Unix timestamp. Omit to return the latest. + schema: + type: integer + example: 1578391200 + responses: + "200": + description: Currency rate response. + content: + application/json: + schema: + $ref: "#/components/schemas/TickerRates" + example: + ts: 1578391200 + rates: + usd: 0.00195 + "400": + $ref: "#/components/responses/BadRequest" + + "/{apiKey}/api/v2/balancehistory/{address}": + get: + operationId: getBalanceHistory + summary: Get Balance History + description: > + Returns the balance history for the specified Dogecoin address. Optionally enrich each + bucket with secondary (fiat) currency rates at the time of the transaction. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - $ref: "#/components/parameters/address" + - in: query + name: from + required: true + description: Start of the history range as a Unix timestamp. + schema: + type: integer + example: 1386474927 + - in: query + name: to + required: true + description: End of the history range as a Unix timestamp. + schema: + type: integer + example: 1757280000 + - in: query + name: fiatcurrency + required: false + description: Fiat currency code to enrich each bucket with. + schema: + type: string + example: usd + - in: query + name: groupBy + required: false + description: Aggregation interval in seconds. Defaults to 3600. + schema: + type: integer + default: 3600 + responses: + "200": + description: Balance history buckets. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/BalanceHistoryEntry" + example: + - time: 1776484800 + txs: 1 + received: "832138460" + sent: "0" + sentToSelf: "0" + rates: + usd: 0.155 + - time: 1776488400 + txs: 1 + received: "0" + sent: "832138460" + sentToSelf: "0" + rates: + usd: 0.156 + "400": + $ref: "#/components/responses/BadRequest" + +components: + parameters: + apiKey: + name: apiKey + in: path + required: true + schema: + type: string + default: docs-demo + description: For higher throughput, [create your own API key](https://dashboard.alchemy.com/signup) + blockHeight: + in: path + name: block_height + required: true + description: Block height as a non-negative integer. + schema: + type: integer + minimum: 0 + example: 860730 + txid: + in: path + name: txid + required: true + description: Hex-encoded transaction ID. + schema: + type: string + example: "bdd9010d7a666d3b7d3c7434b1ed98ccdf51e07aa69f00919f191f6a5e217482" + address: + in: path + name: address + required: true + description: Dogecoin address. + schema: + type: string + example: "DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L" + responses: + BadRequest: + description: Malformed request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + example: + error: + message: "invalid request" + NotFound: + description: Resource not found on the requested network. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + example: + error: + message: "not found" + schemas: + Error: + type: object + properties: + error: + type: object + properties: + message: + type: string + BlockIndexResponse: + type: object + required: [blockHash] + properties: + blockHash: + type: string + description: Hex-encoded block hash for the requested height. + SendTxResponse: + type: object + properties: + result: + type: string + description: Transaction ID of the broadcast transaction. + Vin: + type: object + properties: + txid: { type: string } + vout: { type: integer } + sequence: { type: integer } + n: { type: integer } + addresses: + type: array + items: { type: string } + isAddress: { type: boolean } + value: + type: string + description: Value in the smallest denomination, as a decimal string. + Vout: + type: object + properties: + value: + type: string + description: Value in the smallest denomination, as a decimal string. + n: { type: integer } + spent: { type: boolean } + hex: { type: string } + addresses: + type: array + items: { type: string } + isAddress: { type: boolean } + Tx: + type: object + properties: + txid: { type: string } + version: { type: integer } + lockTime: { type: integer } + vin: + type: array + items: + $ref: "#/components/schemas/Vin" + vout: + type: array + items: + $ref: "#/components/schemas/Vout" + blockHash: { type: string } + blockHeight: + type: integer + description: Height of the block, or `-1` for unconfirmed transactions. + confirmations: { type: integer } + confirmationETABlocks: + type: integer + description: Estimated blocks to first confirmation (only set when unconfirmed). + confirmationETASeconds: + type: integer + description: Estimated seconds to first confirmation (only set when unconfirmed). + blockTime: { type: integer } + size: { type: integer } + vsize: { type: integer } + value: + type: string + valueIn: + type: string + fees: + type: string + hex: { type: string } + rbf: { type: boolean } + Token: + type: object + description: Derived token entry for an xpub or address. + properties: + type: + type: string + example: XPUBAddress + name: { type: string } + path: { type: string } + transfers: { type: integer } + decimals: { type: integer } + balance: + type: string + totalReceived: + type: string + totalSent: + type: string + AddressInfo: + type: object + properties: + page: { type: integer } + totalPages: { type: integer } + itemsOnPage: { type: integer } + address: { type: string } + balance: + type: string + totalReceived: + type: string + totalSent: + type: string + unconfirmedBalance: + type: string + unconfirmedTxs: { type: integer } + txs: { type: integer } + txids: + type: array + items: { type: string } + usedTokens: { type: integer } + tokens: + type: array + items: + $ref: "#/components/schemas/Token" + secondaryValue: { type: number } + Utxo: + type: object + required: [txid, vout, value] + properties: + txid: { type: string } + vout: { type: integer } + value: + type: string + description: Value in the smallest denomination, as a decimal string. + height: + type: integer + description: Block height. Omitted for unconfirmed UTXOs. + confirmations: { type: integer } + lockTime: + type: integer + description: Lock time, only set for unconfirmed UTXOs with non-zero locktime. + coinbase: + type: boolean + description: True if the output comes from a coinbase transaction within the first 100 confirmations. + address: { type: string } + path: + type: string + description: Derivation path. Only set when querying by xpub or descriptor. + Block: + type: object + properties: + page: { type: integer } + totalPages: { type: integer } + itemsOnPage: { type: integer } + hash: { type: string } + previousBlockHash: { type: string } + nextBlockHash: { type: string } + height: { type: integer } + confirmations: { type: integer } + size: { type: integer } + time: { type: integer } + version: { type: integer } + merkleRoot: { type: string } + nonce: { type: string } + bits: { type: string } + difficulty: { type: string } + txCount: { type: integer } + txs: + type: array + items: + $ref: "#/components/schemas/Tx" + TickersListResponse: + type: object + properties: + ts: { type: integer } + available_currencies: + type: array + items: { type: string } + TickerRates: + type: object + properties: + ts: { type: integer } + rates: + type: object + additionalProperties: + type: number + BalanceHistoryEntry: + type: object + properties: + time: { type: integer } + txs: { type: integer } + received: + type: string + sent: + type: string + sentToSelf: + type: string + rates: + type: object + additionalProperties: + type: number diff --git a/src/openapi/utxo-litecoin/utxo-litecoin.yaml b/src/openapi/utxo-litecoin/utxo-litecoin.yaml new file mode 100644 index 000000000..5768fc221 --- /dev/null +++ b/src/openapi/utxo-litecoin/utxo-litecoin.yaml @@ -0,0 +1,847 @@ +# yaml-language-server: $schema=https://spec.openapis.org/oas/3.1/schema/2022-10-07 +openapi: 3.1.0 +info: + title: 🪙 UTXO API (Litecoin) + version: "1.0" + description: > + REST API for Litecoin, powered by [Trezor Blockbook](https://github.com/trezor/blockbook). + Use these endpoints to query indexed block, transaction, address, xpub, and UTXO data on the + Litecoin networks. The same paths are available on every UTXO chain Alchemy supports — + switch chains using the chain-specific overview pages or by changing the host. +servers: + - url: https://{network}.g.alchemy.com/v2 + variables: + network: + default: litecoin-mainnet + enum: + - litecoin-mainnet + - litecoin-testnet +paths: + "/{apiKey}/api/v2/block-index/{block_height}": + get: + operationId: getBlockHashByIndex + summary: Get Block Hash + description: Returns the block hash for a given block height on the selected network. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - $ref: "#/components/parameters/blockHeight" + responses: + "200": + description: Block hash for the requested height. + content: + application/json: + schema: + $ref: "#/components/schemas/BlockIndexResponse" + example: + blockHash: "91ccb5ed8ad6ecfef1347511fa09436a191ea07c93c9c03397a617ade19f8b04" + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + + "/{apiKey}/api/v2/tx/{txid}": + get: + operationId: getTransaction + summary: Get Transaction + description: > + Returns normalized transaction data for the given transaction ID. Response shape is consistent + across UTXO networks. Empty fields are omitted. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - $ref: "#/components/parameters/txid" + responses: + "200": + description: Transaction details. + content: + application/json: + schema: + $ref: "#/components/schemas/Tx" + example: + txid: "d9a5e3a3cb19be98a2ed6a205a22d207892e1c0ba8faf0301abcd94d5f545545" + version: 2 + vin: + - txid: "3e004412be5d56b1e0fefcf73f5010a49e498c728e5097e8f09278b7b389dff7" + vout: 21 + sequence: 4294967295 + n: 0 + addresses: ["LNqEYhSgarC9gY6AAdBHyVJvEikQth3eNj"] + isAddress: true + value: "2868006" + vout: + - value: "100000" + n: 0 + spent: true + hex: "76a914be7846a7ac1fa99117c8ea7472f240c68f01eb8f88ac" + addresses: ["Lcb4jao9XQ9WQGBW4hcBf7kVUSe5Ze6bsf"] + isAddress: true + - value: "2718006" + n: 1 + hex: "76a914815d8e3e2dd0fc88de37e0bf16b8af5a64055f4188ac" + addresses: ["Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2"] + isAddress: true + blockHash: "6d1a8eedc9ce9055366efdb8260c8d4ea0a8fa01905d3ecf92716a8940a0d06e" + blockHeight: 2981901 + confirmations: 125935 + blockTime: 1759937639 + size: 225 + vsize: 225 + value: "2818006" + valueIn: "2868006" + fees: "50000" + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + + "/{apiKey}/api/v2/tx-specific/{txid}": + get: + operationId: getTransactionSpecific + summary: Get Transaction Specific + description: > + Returns transaction data in the exact format returned by the underlying coin backend, including + all chain-specific fields not surfaced by the normalized `/tx/{txid}` endpoint. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - $ref: "#/components/parameters/txid" + responses: + "200": + description: Backend-native transaction object. + content: + application/json: + schema: + type: object + additionalProperties: true + description: Backend-specific transaction object. Shape varies by coin. + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + + "/{apiKey}/api/v2/address/{address}": + get: + operationId: getAddress + summary: Get Address + description: > + Returns balances and transactions for the given Litecoin address. Transactions are sorted + newest-first by block height. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - $ref: "#/components/parameters/address" + - in: query + name: page + required: false + description: Page of returned transactions, starting from 1. + schema: + type: integer + minimum: 1 + default: 1 + - in: query + name: pageSize + required: false + description: Number of transactions returned per page (max 1000). + schema: + type: integer + minimum: 1 + maximum: 1000 + default: 1000 + - in: query + name: from + required: false + description: Filter transactions starting from this block height. + schema: + type: integer + minimum: 0 + - in: query + name: to + required: false + description: Filter transactions up to this block height. + schema: + type: integer + minimum: 0 + - in: query + name: details + required: false + description: Level of detail to return. + schema: + type: string + enum: [basic, tokens, tokenBalances, txids, txslight, txs] + default: txids + - in: query + name: secondary + required: false + description: Secondary (fiat) currency code for balance conversion, e.g. `usd` or `eur`. + schema: + type: string + responses: + "200": + description: Address details, balances, and transactions. + content: + application/json: + schema: + $ref: "#/components/schemas/AddressInfo" + example: + page: 1 + totalPages: 1 + itemsOnPage: 1000 + address: "Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2" + balance: "2728006" + totalReceived: "218883700604" + totalSent: "218880972598" + unconfirmedBalance: "0" + unconfirmedTxs: 0 + txs: 247 + txids: + - "d9a5e3a3cb19be98a2ed6a205a22d207892e1c0ba8faf0301abcd94d5f545545" + - "c5826af541034211d27483996160f6c5467adc9de7fd6045afe3b0957ac7ddb7" + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + + "/{apiKey}/api/v2/xpub/{xpub}": + get: + operationId: getXpub + summary: Get Xpub + description: > + Returns balances and transactions for an xpub or output descriptor on Litecoin. Supports + BIP44, BIP49, BIP84, and BIP86 (Taproot) derivation schemes. The BIP version is determined + by the xpub prefix or by an explicit output descriptor. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - in: path + name: xpub + required: true + description: Extended public key or output descriptor. + schema: + type: string + example: "xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz" + - in: query + name: page + required: false + schema: + type: integer + minimum: 1 + default: 1 + - in: query + name: pageSize + required: false + schema: + type: integer + minimum: 1 + maximum: 1000 + default: 1000 + - in: query + name: from + required: false + schema: + type: integer + minimum: 0 + - in: query + name: to + required: false + schema: + type: integer + minimum: 0 + - in: query + name: details + required: false + schema: + type: string + enum: [basic, tokens, tokenBalances, txids, txs] + default: txids + - in: query + name: tokens + required: false + description: Which derived addresses to return. + schema: + type: string + enum: [nonzero, used, derived] + default: nonzero + - in: query + name: secondary + required: false + description: Secondary (fiat) currency code for balance conversion. + schema: + type: string + responses: + "200": + description: Xpub details, balances, derived addresses, and transactions. + content: + application/json: + schema: + $ref: "#/components/schemas/AddressInfo" + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + + "/{apiKey}/api/v2/utxo/{descriptor}": + get: + operationId: getUtxo + summary: Get UTXOs + description: > + Returns the unspent transaction outputs for a Litecoin address, xpub, or output descriptor. + Includes confirmed and unconfirmed UTXOs by default; pass `confirmed=true` to limit to + confirmed only. UTXOs are sorted newest-first. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - in: path + name: descriptor + required: true + description: Litecoin address, xpub, or output descriptor. + schema: + type: string + example: "Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2" + - in: query + name: confirmed + required: false + description: When `true`, exclude unconfirmed UTXOs. + schema: + type: boolean + default: false + responses: + "200": + description: List of UTXOs. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Utxo" + example: + - txid: "d9a5e3a3cb19be98a2ed6a205a22d207892e1c0ba8faf0301abcd94d5f545545" + vout: 1 + value: "2718006" + height: 2981901 + confirmations: 125929 + - txid: "c5826af541034211d27483996160f6c5467adc9de7fd6045afe3b0957ac7ddb7" + vout: 0 + value: "10000" + height: 2876920 + confirmations: 230910 + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + + "/{apiKey}/api/v2/block/{block}": + get: + operationId: getBlock + summary: Get Block + description: > + Returns information about a block on Litecoin, including transactions, by block hash or + block height. Results are paginated. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - in: path + name: block + required: true + description: Block height (integer) or block hash (hex string). + schema: + type: string + example: "860730" + - in: query + name: page + required: false + schema: + type: integer + minimum: 1 + default: 1 + - in: query + name: pageSize + required: false + schema: + type: integer + minimum: 1 + maximum: 1000 + default: 1000 + responses: + "200": + description: Block details with paginated transactions. + content: + application/json: + schema: + $ref: "#/components/schemas/Block" + example: + page: 1 + totalPages: 1 + itemsOnPage: 1000 + hash: "91ccb5ed8ad6ecfef1347511fa09436a191ea07c93c9c03397a617ade19f8b04" + previousBlockHash: "688543ada7bc18b23a9b4db0d11233d1a1d4380d97801ff0c66506f99bba9aa8" + nextBlockHash: "2b7697a2567aa93e3e4261d58a660fde5e7e552d0b13b39a753cfc4cbb741819" + height: 860730 + confirmations: 2247106 + size: 266 + time: 1443630565 + version: 3 + merkleRoot: "e596d7458fa44d83e22210c8d00ef3e80ee6eb2b36d9008b9ddbb44cbc566575" + nonce: "324698247" + bits: "1b01697d" + difficulty: "46410.79910526145" + txCount: 1 + "400": + $ref: "#/components/responses/BadRequest" + "404": + $ref: "#/components/responses/NotFound" + + "/{apiKey}/api/v2/sendtx/{hex}": + get: + operationId: sendTransactionGet + summary: Send Transaction (GET) + description: > + Broadcasts a signed raw Litecoin transaction encoded as a hex string in the path. Returns + the transaction ID on success. For larger payloads, use the POST variant. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - in: path + name: hex + required: true + description: Hex-encoded raw transaction bytes. + schema: + type: string + example: "010000000001..." + responses: + "200": + description: Transaction broadcast result. + content: + application/json: + schema: + $ref: "#/components/schemas/SendTxResponse" + example: + result: "d9a5e3a3cb19be98a2ed6a205a22d207892e1c0ba8faf0301abcd94d5f545545" + "400": + $ref: "#/components/responses/BadRequest" + + "/{apiKey}/api/v2/sendtx/": + post: + operationId: sendTransactionPost + summary: Send Transaction (POST) + description: > + Broadcasts a signed raw Litecoin transaction by sending hex bytes in the request body. + The trailing slash on the path is mandatory; see the [Blockbook API + reference](https://github.com/trezor/blockbook/blob/master/docs/api.md#send-transaction). + Use this for larger payloads (request body limit 8 MiB). Returns the transaction ID on success. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + requestBody: + required: true + content: + text/plain: + schema: + type: string + description: Hex-encoded raw transaction bytes. + example: "010000000001..." + responses: + "200": + description: Transaction broadcast result. + content: + application/json: + schema: + $ref: "#/components/schemas/SendTxResponse" + example: + result: "d9a5e3a3cb19be98a2ed6a205a22d207892e1c0ba8faf0301abcd94d5f545545" + "400": + $ref: "#/components/responses/BadRequest" + + "/{apiKey}/api/v2/tickers-list": + get: + operationId: getTickersList + summary: Get Tickers List + description: > + Returns the list of available currency rate tickers (secondary currencies) for Litecoin at + a given timestamp, along with the actual data timestamp. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - in: query + name: timestamp + required: false + description: Unix timestamp to query availability for. Defaults to the latest available. + schema: + type: integer + example: 1578391200 + responses: + "200": + description: Available tickers. + content: + application/json: + schema: + $ref: "#/components/schemas/TickersListResponse" + example: + ts: 1578391200 + available_currencies: ["eur", "usd"] + "400": + $ref: "#/components/responses/BadRequest" + + "/{apiKey}/api/v2/tickers": + get: + operationId: getTickers + summary: Get Tickers + description: > + Returns the Litecoin currency rate for the specified currency and timestamp. If the + requested currency is unavailable for that timestamp, the closest rate is returned with + the actual rate timestamp. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - in: query + name: currency + required: false + description: Fiat or crypto currency code (e.g. `usd`, `eur`, `eth`). Omit to return all. + schema: + type: string + example: usd + - in: query + name: timestamp + required: false + description: Unix timestamp. Omit to return the latest. + schema: + type: integer + example: 1578391200 + responses: + "200": + description: Currency rate response. + content: + application/json: + schema: + $ref: "#/components/schemas/TickerRates" + example: + ts: 1578391200 + rates: + usd: 42.71 + "400": + $ref: "#/components/responses/BadRequest" + + "/{apiKey}/api/v2/balancehistory/{address}": + get: + operationId: getBalanceHistory + summary: Get Balance History + description: > + Returns the balance history for the specified Litecoin address. Optionally enrich each + bucket with secondary (fiat) currency rates at the time of the transaction. + tags: ["UTXO API Endpoints"] + parameters: + - $ref: "#/components/parameters/apiKey" + - $ref: "#/components/parameters/address" + - in: query + name: from + required: true + description: Start of the history range as a Unix timestamp. + schema: + type: integer + example: 1318325224 + - in: query + name: to + required: true + description: End of the history range as a Unix timestamp. + schema: + type: integer + example: 1757280000 + - in: query + name: fiatcurrency + required: false + description: Fiat currency code to enrich each bucket with. + schema: + type: string + example: usd + - in: query + name: groupBy + required: false + description: Aggregation interval in seconds. Defaults to 3600. + schema: + type: integer + default: 3600 + responses: + "200": + description: Balance history buckets. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/BalanceHistoryEntry" + example: + - time: 1759935600 + txs: 1 + received: "2718006" + sent: "0" + sentToSelf: "0" + rates: + usd: 76.42 + - time: 1759939200 + txs: 1 + received: "0" + sent: "2718006" + sentToSelf: "0" + rates: + usd: 76.55 + "400": + $ref: "#/components/responses/BadRequest" + +components: + parameters: + apiKey: + name: apiKey + in: path + required: true + schema: + type: string + default: docs-demo + description: For higher throughput, [create your own API key](https://dashboard.alchemy.com/signup) + blockHeight: + in: path + name: block_height + required: true + description: Block height as a non-negative integer. + schema: + type: integer + minimum: 0 + example: 860730 + txid: + in: path + name: txid + required: true + description: Hex-encoded transaction ID. + schema: + type: string + example: "d9a5e3a3cb19be98a2ed6a205a22d207892e1c0ba8faf0301abcd94d5f545545" + address: + in: path + name: address + required: true + description: Litecoin address. + schema: + type: string + example: "Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2" + responses: + BadRequest: + description: Malformed request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + example: + error: + message: "invalid request" + NotFound: + description: Resource not found on the requested network. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + example: + error: + message: "not found" + schemas: + Error: + type: object + properties: + error: + type: object + properties: + message: + type: string + BlockIndexResponse: + type: object + required: [blockHash] + properties: + blockHash: + type: string + description: Hex-encoded block hash for the requested height. + SendTxResponse: + type: object + properties: + result: + type: string + description: Transaction ID of the broadcast transaction. + Vin: + type: object + properties: + txid: { type: string } + vout: { type: integer } + sequence: { type: integer } + n: { type: integer } + addresses: + type: array + items: { type: string } + isAddress: { type: boolean } + value: + type: string + description: Value in the smallest denomination, as a decimal string. + Vout: + type: object + properties: + value: + type: string + description: Value in the smallest denomination, as a decimal string. + n: { type: integer } + spent: { type: boolean } + hex: { type: string } + addresses: + type: array + items: { type: string } + isAddress: { type: boolean } + Tx: + type: object + properties: + txid: { type: string } + version: { type: integer } + lockTime: { type: integer } + vin: + type: array + items: + $ref: "#/components/schemas/Vin" + vout: + type: array + items: + $ref: "#/components/schemas/Vout" + blockHash: { type: string } + blockHeight: + type: integer + description: Height of the block, or `-1` for unconfirmed transactions. + confirmations: { type: integer } + confirmationETABlocks: + type: integer + description: Estimated blocks to first confirmation (only set when unconfirmed). + confirmationETASeconds: + type: integer + description: Estimated seconds to first confirmation (only set when unconfirmed). + blockTime: { type: integer } + size: { type: integer } + vsize: { type: integer } + value: + type: string + valueIn: + type: string + fees: + type: string + hex: { type: string } + rbf: { type: boolean } + Token: + type: object + description: Derived token entry for an xpub or address. + properties: + type: + type: string + example: XPUBAddress + name: { type: string } + path: { type: string } + transfers: { type: integer } + decimals: { type: integer } + balance: + type: string + totalReceived: + type: string + totalSent: + type: string + AddressInfo: + type: object + properties: + page: { type: integer } + totalPages: { type: integer } + itemsOnPage: { type: integer } + address: { type: string } + balance: + type: string + totalReceived: + type: string + totalSent: + type: string + unconfirmedBalance: + type: string + unconfirmedTxs: { type: integer } + txs: { type: integer } + txids: + type: array + items: { type: string } + usedTokens: { type: integer } + tokens: + type: array + items: + $ref: "#/components/schemas/Token" + secondaryValue: { type: number } + Utxo: + type: object + required: [txid, vout, value] + properties: + txid: { type: string } + vout: { type: integer } + value: + type: string + description: Value in the smallest denomination, as a decimal string. + height: + type: integer + description: Block height. Omitted for unconfirmed UTXOs. + confirmations: { type: integer } + lockTime: + type: integer + description: Lock time, only set for unconfirmed UTXOs with non-zero locktime. + coinbase: + type: boolean + description: True if the output comes from a coinbase transaction within the first 100 confirmations. + address: { type: string } + path: + type: string + description: Derivation path. Only set when querying by xpub or descriptor. + Block: + type: object + properties: + page: { type: integer } + totalPages: { type: integer } + itemsOnPage: { type: integer } + hash: { type: string } + previousBlockHash: { type: string } + nextBlockHash: { type: string } + height: { type: integer } + confirmations: { type: integer } + size: { type: integer } + time: { type: integer } + version: { type: integer } + merkleRoot: { type: string } + nonce: { type: string } + bits: { type: string } + difficulty: { type: string } + txCount: { type: integer } + txs: + type: array + items: + $ref: "#/components/schemas/Tx" + TickersListResponse: + type: object + properties: + ts: { type: integer } + available_currencies: + type: array + items: { type: string } + TickerRates: + type: object + properties: + ts: { type: integer } + rates: + type: object + additionalProperties: + type: number + BalanceHistoryEntry: + type: object + properties: + time: { type: integer } + txs: { type: integer } + received: + type: string + sent: + type: string + sentToSelf: + type: string + rates: + type: object + additionalProperties: + type: number From 01ee80286fab57e3e6ffb8f6e2668cc3bd8c3a70 Mon Sep 17 00:00:00 2001 From: docs-agent Date: Fri, 15 May 2026 17:23:09 +0000 Subject: [PATCH 2/2] [docs-agent] UTXO API: realistic sendtx hex examples, BTC UTXO address, surface broken endpoints MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Address review feedback from @andra-catana on PR #1302 covering the broader `utxo-api-endpoints/*` surface across BTC / BCH / LTC / DOGE: * `Send Transaction (GET)`: replace the `010000000001...` placeholder with the hex of a real already-confirmed transaction for each chain. Re-sending now responds with a meaningful Bitcoin-Core RPC error (`-27: transaction already in block chain` on BCH/LTC/DOGE, `-25: bad-txns-inputs-missingorspent` on BTC) instead of `-22: TX decode failed`, which demonstrates the request structure is correct. Description explains the example and instructs users to substitute their own signed hex. * `Send Transaction (POST)`: same realistic hex in the `text/plain` request body example, and a description callout noting the POST variant currently returns HTTP 400 `Parse error` at the Alchemy proxy regardless of body format. Points users at the working GET variant. Will follow up upstream so the proxy issue can be fixed. * `Get Tickers` / `Get Tickers List`: description callout on each endpoint noting they currently return HTTP 503 `Unable to complete request at this time` at the proxy. Schema/request shape kept for reference until the upstream service is restored. * Bitcoin `Get UTXO`: example address `bc1q0wd209cv5k9pd9mhk7nspacywcj038xxdhnt5u` is fully spent (balance 0), so "Try It" returned an empty array. Switched to `1FzWLkAahHooV3kzTgyx6qsswXJ6sCXkSR`, which has 5 stable confirmed UTXOs from blocks 745,856 – 766,367 and a steady residual balance. Response example refreshed to match. Validated via `pnpm run validate:rest` (all four UTXO specs valid) and live-tested `sendtx GET` plus `Get UTXO` against `alch-demo`. Refs DOCS-83 Requested-by: @andra-catana --- .../utxo-bitcoincash/utxo-bitcoincash.yaml | 24 +++++++- src/openapi/utxo-dogecoin/utxo-dogecoin.yaml | 24 +++++++- src/openapi/utxo-litecoin/utxo-litecoin.yaml | 24 +++++++- src/openapi/utxo/utxo.yaml | 56 ++++++++++++------- 4 files changed, 100 insertions(+), 28 deletions(-) diff --git a/src/openapi/utxo-bitcoincash/utxo-bitcoincash.yaml b/src/openapi/utxo-bitcoincash/utxo-bitcoincash.yaml index 1c304fd78..022748844 100644 --- a/src/openapi/utxo-bitcoincash/utxo-bitcoincash.yaml +++ b/src/openapi/utxo-bitcoincash/utxo-bitcoincash.yaml @@ -392,7 +392,10 @@ paths: summary: Send Transaction (GET) description: > Broadcasts a signed raw Bitcoin Cash transaction encoded as a hex string in the path. Returns - the transaction ID on success. For larger payloads, use the POST variant. + the transaction ID on success. The example value below is the hex of an already-confirmed + Bitcoin Cash transaction; re-sending it will respond with the Bitcoin-Core + `-27: transaction already in block chain` error. Substitute your own signed raw-transaction + hex to broadcast. For larger payloads, use the POST variant. tags: ["UTXO API Endpoints"] parameters: - $ref: "#/components/parameters/apiKey" @@ -402,7 +405,7 @@ paths: description: Hex-encoded raw transaction bytes. schema: type: string - example: "010000000001..." + example: "0100000002fd11e3d414e14fa9a2c9aaee0f6533dbc85b5cdd5a3ac8ecb6e8b48f88103a9a020000006a473044022067fc686b4fe5dcae65ec721d47faf9312634f7087d3bb9924f2f4e5c3d55e2b302206c403b098b62b648ef329a23184b0b9320745b1227463aeeafcbfb7f5563218d412102870b87cdbc930db3b8cbef3b4d72cce0ce2817bfef15aab28abe61fb064930f5ffffffff3051fba1337c0898f3cbf87e9bdb0efa5beab0bef8d32f0deb8d1d29326ea4eb010000006a47304402204ef4b516abac3d419c5dae87c4f5da412ad159b9288c35034a044433109c4355022002cd568e69f2490bc45f71f7cbe3a29124548057ed625b286616e590e45f87a8412102870b87cdbc930db3b8cbef3b4d72cce0ce2817bfef15aab28abe61fb064930f5ffffffff040000000000000000406a04534c500001010453454e4420c4c788a1664de4213b9bcb806e3fb47f786d53f6f63220deb6719b2c087b457308000000174876e80008000775d6bd84740022020000000000001976a91462e907b15cbf27d5425399ebf6f0fb50ebb88f1888ac22020000000000001976a914ade60c76898fe0c01431edd5e79b465f818a0d8a88ac68ad0000000000001976a914ade60c76898fe0c01431edd5e79b465f818a0d8a88ac00000000" responses: "200": description: Transaction broadcast result. @@ -424,6 +427,11 @@ paths: The trailing slash on the path is mandatory; see the [Blockbook API reference](https://github.com/trezor/blockbook/blob/master/docs/api.md#send-transaction). Use this for larger payloads (request body limit 8 MiB). Returns the transaction ID on success. + + + > **Heads up**: the POST variant currently returns `{ "error": "Parse error" }` (HTTP 400) + > on the Alchemy proxy regardless of body format. Until that upstream issue is resolved, + > prefer the GET variant above for hex payloads under the URL-length limit. tags: ["UTXO API Endpoints"] parameters: - $ref: "#/components/parameters/apiKey" @@ -434,7 +442,7 @@ paths: schema: type: string description: Hex-encoded raw transaction bytes. - example: "010000000001..." + example: "0100000002fd11e3d414e14fa9a2c9aaee0f6533dbc85b5cdd5a3ac8ecb6e8b48f88103a9a020000006a473044022067fc686b4fe5dcae65ec721d47faf9312634f7087d3bb9924f2f4e5c3d55e2b302206c403b098b62b648ef329a23184b0b9320745b1227463aeeafcbfb7f5563218d412102870b87cdbc930db3b8cbef3b4d72cce0ce2817bfef15aab28abe61fb064930f5ffffffff3051fba1337c0898f3cbf87e9bdb0efa5beab0bef8d32f0deb8d1d29326ea4eb010000006a47304402204ef4b516abac3d419c5dae87c4f5da412ad159b9288c35034a044433109c4355022002cd568e69f2490bc45f71f7cbe3a29124548057ed625b286616e590e45f87a8412102870b87cdbc930db3b8cbef3b4d72cce0ce2817bfef15aab28abe61fb064930f5ffffffff040000000000000000406a04534c500001010453454e4420c4c788a1664de4213b9bcb806e3fb47f786d53f6f63220deb6719b2c087b457308000000174876e80008000775d6bd84740022020000000000001976a91462e907b15cbf27d5425399ebf6f0fb50ebb88f1888ac22020000000000001976a914ade60c76898fe0c01431edd5e79b465f818a0d8a88ac68ad0000000000001976a914ade60c76898fe0c01431edd5e79b465f818a0d8a88ac00000000" responses: "200": description: Transaction broadcast result. @@ -454,6 +462,11 @@ paths: description: > Returns the list of available currency rate tickers (secondary currencies) for Bitcoin Cash at a given timestamp, along with the actual data timestamp. + + + > **Heads up**: this endpoint currently returns HTTP 503 `Unable to complete request at this + > time` on the Alchemy proxy. The schema and request shape below are documented for + > reference; "Try It" will not return live data until the upstream service is restored. tags: ["UTXO API Endpoints"] parameters: - $ref: "#/components/parameters/apiKey" @@ -485,6 +498,11 @@ paths: Returns the Bitcoin Cash currency rate for the specified currency and timestamp. If the requested currency is unavailable for that timestamp, the closest rate is returned with the actual rate timestamp. + + + > **Heads up**: this endpoint currently returns HTTP 503 `Unable to complete request at this + > time` on the Alchemy proxy. The schema and request shape below are documented for + > reference; "Try It" will not return live data until the upstream service is restored. tags: ["UTXO API Endpoints"] parameters: - $ref: "#/components/parameters/apiKey" diff --git a/src/openapi/utxo-dogecoin/utxo-dogecoin.yaml b/src/openapi/utxo-dogecoin/utxo-dogecoin.yaml index a38d71409..515af0992 100644 --- a/src/openapi/utxo-dogecoin/utxo-dogecoin.yaml +++ b/src/openapi/utxo-dogecoin/utxo-dogecoin.yaml @@ -389,7 +389,10 @@ paths: summary: Send Transaction (GET) description: > Broadcasts a signed raw Dogecoin transaction encoded as a hex string in the path. Returns - the transaction ID on success. For larger payloads, use the POST variant. + the transaction ID on success. The example value below is the hex of an already-confirmed + Dogecoin transaction; re-sending it will respond with the Bitcoin-Core + `-27: transaction already in block chain` error. Substitute your own signed raw-transaction + hex to broadcast. For larger payloads, use the POST variant. tags: ["UTXO API Endpoints"] parameters: - $ref: "#/components/parameters/apiKey" @@ -399,7 +402,7 @@ paths: description: Hex-encoded raw transaction bytes. schema: type: string - example: "010000000001..." + example: "0100000001d051d9ef4f425d17e563bf7b8deb069dc6c1ede2d11e992db86d1ee7da74b7e6010000006b4830450221009fb8326bb131eae26db852816b6ce964525d8ff61e2b303e34bedb08307cb482022073ead61ededcd78577d23376cd7d485690dbb45700da8b6e8d3c71de1289529901210265a3c00a588c899676681e166c916ed030385c9da5a4c8d4b9029eed88a56d44ffffffff02dc6c9931000000001976a914830a7420e63d76244ff7cbd1c248e94c1446325988acf7c00bad270000001976a9140be4c25349ee33a3f3d9674fdd31618918cacd4588ac00000000" responses: "200": description: Transaction broadcast result. @@ -421,6 +424,11 @@ paths: The trailing slash on the path is mandatory; see the [Blockbook API reference](https://github.com/trezor/blockbook/blob/master/docs/api.md#send-transaction). Use this for larger payloads (request body limit 8 MiB). Returns the transaction ID on success. + + + > **Heads up**: the POST variant currently returns `{ "error": "Parse error" }` (HTTP 400) + > on the Alchemy proxy regardless of body format. Until that upstream issue is resolved, + > prefer the GET variant above for hex payloads under the URL-length limit. tags: ["UTXO API Endpoints"] parameters: - $ref: "#/components/parameters/apiKey" @@ -431,7 +439,7 @@ paths: schema: type: string description: Hex-encoded raw transaction bytes. - example: "010000000001..." + example: "0100000001d051d9ef4f425d17e563bf7b8deb069dc6c1ede2d11e992db86d1ee7da74b7e6010000006b4830450221009fb8326bb131eae26db852816b6ce964525d8ff61e2b303e34bedb08307cb482022073ead61ededcd78577d23376cd7d485690dbb45700da8b6e8d3c71de1289529901210265a3c00a588c899676681e166c916ed030385c9da5a4c8d4b9029eed88a56d44ffffffff02dc6c9931000000001976a914830a7420e63d76244ff7cbd1c248e94c1446325988acf7c00bad270000001976a9140be4c25349ee33a3f3d9674fdd31618918cacd4588ac00000000" responses: "200": description: Transaction broadcast result. @@ -451,6 +459,11 @@ paths: description: > Returns the list of available currency rate tickers (secondary currencies) for Dogecoin at a given timestamp, along with the actual data timestamp. + + + > **Heads up**: this endpoint currently returns HTTP 503 `Unable to complete request at this + > time` on the Alchemy proxy. The schema and request shape below are documented for + > reference; "Try It" will not return live data until the upstream service is restored. tags: ["UTXO API Endpoints"] parameters: - $ref: "#/components/parameters/apiKey" @@ -482,6 +495,11 @@ paths: Returns the Dogecoin currency rate for the specified currency and timestamp. If the requested currency is unavailable for that timestamp, the closest rate is returned with the actual rate timestamp. + + + > **Heads up**: this endpoint currently returns HTTP 503 `Unable to complete request at this + > time` on the Alchemy proxy. The schema and request shape below are documented for + > reference; "Try It" will not return live data until the upstream service is restored. tags: ["UTXO API Endpoints"] parameters: - $ref: "#/components/parameters/apiKey" diff --git a/src/openapi/utxo-litecoin/utxo-litecoin.yaml b/src/openapi/utxo-litecoin/utxo-litecoin.yaml index 5768fc221..cd1f6f380 100644 --- a/src/openapi/utxo-litecoin/utxo-litecoin.yaml +++ b/src/openapi/utxo-litecoin/utxo-litecoin.yaml @@ -397,7 +397,10 @@ paths: summary: Send Transaction (GET) description: > Broadcasts a signed raw Litecoin transaction encoded as a hex string in the path. Returns - the transaction ID on success. For larger payloads, use the POST variant. + the transaction ID on success. The example value below is the hex of an already-confirmed + Litecoin transaction; re-sending it will respond with the Bitcoin-Core `-27: Transaction + already in block chain` error. Substitute your own signed raw-transaction hex to broadcast. + For larger payloads, use the POST variant. tags: ["UTXO API Endpoints"] parameters: - $ref: "#/components/parameters/apiKey" @@ -407,7 +410,7 @@ paths: description: Hex-encoded raw transaction bytes. schema: type: string - example: "010000000001..." + example: "0200000001f7df89b3b77892f0e897508e728c499ea410503ff7fcfee0b1565dbe1244003e150000006a47304402200d49aa9e5e883f600a0d21c5258d731b8b5c10e521fcae83284d0bfd81a73857022051cee4e2cdaa29535a52b0dbb6e540882f52a09f73bbaa738dbeeb3ae8e3bca101210318d87bcd93c083e8ff34d4321280f04d4e43c585a1320688982fae054f398ba0ffffffff02a0860100000000001976a914be7846a7ac1fa99117c8ea7472f240c68f01eb8f88ac36792900000000001976a914d73e63c04a6cbad8d5dc94fdbef5175d2364e32f88ac00000000" responses: "200": description: Transaction broadcast result. @@ -429,6 +432,11 @@ paths: The trailing slash on the path is mandatory; see the [Blockbook API reference](https://github.com/trezor/blockbook/blob/master/docs/api.md#send-transaction). Use this for larger payloads (request body limit 8 MiB). Returns the transaction ID on success. + + + > **Heads up**: the POST variant currently returns `{ "error": "Parse error" }` (HTTP 400) + > on the Alchemy proxy regardless of body format. Until that upstream issue is resolved, + > prefer the GET variant above for hex payloads under the URL-length limit. tags: ["UTXO API Endpoints"] parameters: - $ref: "#/components/parameters/apiKey" @@ -439,7 +447,7 @@ paths: schema: type: string description: Hex-encoded raw transaction bytes. - example: "010000000001..." + example: "0200000001f7df89b3b77892f0e897508e728c499ea410503ff7fcfee0b1565dbe1244003e150000006a47304402200d49aa9e5e883f600a0d21c5258d731b8b5c10e521fcae83284d0bfd81a73857022051cee4e2cdaa29535a52b0dbb6e540882f52a09f73bbaa738dbeeb3ae8e3bca101210318d87bcd93c083e8ff34d4321280f04d4e43c585a1320688982fae054f398ba0ffffffff02a0860100000000001976a914be7846a7ac1fa99117c8ea7472f240c68f01eb8f88ac36792900000000001976a914d73e63c04a6cbad8d5dc94fdbef5175d2364e32f88ac00000000" responses: "200": description: Transaction broadcast result. @@ -459,6 +467,11 @@ paths: description: > Returns the list of available currency rate tickers (secondary currencies) for Litecoin at a given timestamp, along with the actual data timestamp. + + + > **Heads up**: this endpoint currently returns HTTP 503 `Unable to complete request at this + > time` on the Alchemy proxy. The schema and request shape below are documented for + > reference; "Try It" will not return live data until the upstream service is restored. tags: ["UTXO API Endpoints"] parameters: - $ref: "#/components/parameters/apiKey" @@ -490,6 +503,11 @@ paths: Returns the Litecoin currency rate for the specified currency and timestamp. If the requested currency is unavailable for that timestamp, the closest rate is returned with the actual rate timestamp. + + + > **Heads up**: this endpoint currently returns HTTP 503 `Unable to complete request at this + > time` on the Alchemy proxy. The schema and request shape below are documented for + > reference; "Try It" will not return live data until the upstream service is restored. tags: ["UTXO API Endpoints"] parameters: - $ref: "#/components/parameters/apiKey" diff --git a/src/openapi/utxo/utxo.yaml b/src/openapi/utxo/utxo.yaml index 9b3a69901..e55d53dda 100644 --- a/src/openapi/utxo/utxo.yaml +++ b/src/openapi/utxo/utxo.yaml @@ -297,7 +297,7 @@ paths: description: Address, xpub, or output descriptor. schema: type: string - example: "bc1q0wd209cv5k9pd9mhk7nspacywcj038xxdhnt5u" + example: "1FzWLkAahHooV3kzTgyx6qsswXJ6sCXkSR" - in: query name: confirmed required: false @@ -315,17 +315,16 @@ paths: items: $ref: "#/components/schemas/Utxo" example: - - txid: "a79e396a32e10856c97b95f43da7e9d2b9a11d446f7638dbd75e5e7603128cac" + - txid: "804973d96dbd6462ce1ebe9e88e2ceb449ef51104c65fbe5457133b2b4187e22" vout: 1 - value: "39748685" - height: 2648043 - confirmations: 47 - coinbase: true - - txid: "de4f379fdc3ea9be063e60340461a014f372a018d70c3db35701654e7066b3ef" - vout: 0 - value: "122492339065" - height: 2646043 - confirmations: 2047 + value: "450000" + height: 766367 + confirmations: 183174 + - txid: "c2e3fd958801f35caef168734402796a63edfe3cbf052e97127f9098187a19af" + vout: 1 + value: "450000" + height: 763766 + confirmations: 185775 "400": $ref: "#/components/responses/BadRequest" "404": @@ -380,8 +379,12 @@ paths: operationId: sendTransactionGet summary: Send Transaction (GET) description: > - Broadcasts a signed raw transaction encoded as a hex string in the path. Returns the - transaction ID on success. For larger payloads, use the POST variant. + Broadcasts a signed raw Bitcoin transaction encoded as a hex string in the path. Returns + the transaction ID on success. The example value below is the hex of a confirmed Bitcoin + transaction; re-sending it will respond with a Bitcoin-Core RPC error (e.g. + `-25: bad-txns-inputs-missingorspent` once the inputs are spent, or + `-27: transaction already in block chain` for unspent re-broadcasts). Substitute your own + signed raw-transaction hex to broadcast. For larger payloads, use the POST variant. tags: ["UTXO API Endpoints"] parameters: - $ref: "#/components/parameters/apiKey" @@ -391,7 +394,7 @@ paths: description: Hex-encoded raw transaction bytes. schema: type: string - example: "010000000001..." + example: "02000000000101662a2fc609ddb4ebf96113d237041d687c94494f44c10d8dc8e23d3774b5b70e0100000000fdffffff0298ab0200000000001976a914ecc999d554eaa3efa5e871c28f58b549c36ec51788ac64e196000000000016001496f152a0919487624bf4f13f46f0d20fa10d9acc0247304402202bb0591180cdbbe0f639af6eb21abdb993fc5a667b09e6392d5c11b025a9187102201ef2e84fc91a5d2c6fbbc9f943482d230256a3640f8ecb83c1f3f17242cf011001210314f03889e1667feb696ee280625943195189cfabe46d54204d987f631fe6892739220d00" responses: "200": description: Transaction broadcast result. @@ -400,7 +403,7 @@ paths: schema: $ref: "#/components/schemas/SendTxResponse" example: - result: "7c3be24063f268aaa1ed81b64776798f56088757641a34fb156c4f51ed2e9d25" + result: "8c1e3dec662d1f2a5e322ccef5eca263f98eb16723c6f990be0c88c1db113fb1" "400": $ref: "#/components/responses/BadRequest" @@ -409,10 +412,15 @@ paths: operationId: sendTransactionPost summary: Send Transaction (POST) description: > - Broadcasts a signed raw transaction by sending hex bytes in the request body. The trailing - slash on the path is mandatory; see the [Blockbook API + Broadcasts a signed raw Bitcoin transaction by sending hex bytes in the request body. The + trailing slash on the path is mandatory; see the [Blockbook API reference](https://github.com/trezor/blockbook/blob/master/docs/api.md#send-transaction). Use this for larger payloads (request body limit 8 MiB). Returns the transaction ID on success. + + + > **Heads up**: the POST variant currently returns `{ "error": "Parse error" }` (HTTP 400) + > on the Alchemy proxy regardless of body format. Until that upstream issue is resolved, + > prefer the GET variant above for hex payloads under the URL-length limit. tags: ["UTXO API Endpoints"] parameters: - $ref: "#/components/parameters/apiKey" @@ -423,7 +431,7 @@ paths: schema: type: string description: Hex-encoded raw transaction bytes. - example: "010000000001..." + example: "02000000000101662a2fc609ddb4ebf96113d237041d687c94494f44c10d8dc8e23d3774b5b70e0100000000fdffffff0298ab0200000000001976a914ecc999d554eaa3efa5e871c28f58b549c36ec51788ac64e196000000000016001496f152a0919487624bf4f13f46f0d20fa10d9acc0247304402202bb0591180cdbbe0f639af6eb21abdb993fc5a667b09e6392d5c11b025a9187102201ef2e84fc91a5d2c6fbbc9f943482d230256a3640f8ecb83c1f3f17242cf011001210314f03889e1667feb696ee280625943195189cfabe46d54204d987f631fe6892739220d00" responses: "200": description: Transaction broadcast result. @@ -432,7 +440,7 @@ paths: schema: $ref: "#/components/schemas/SendTxResponse" example: - result: "7c3be24063f268aaa1ed81b64776798f56088757641a34fb156c4f51ed2e9d25" + result: "8c1e3dec662d1f2a5e322ccef5eca263f98eb16723c6f990be0c88c1db113fb1" "400": $ref: "#/components/responses/BadRequest" @@ -443,6 +451,11 @@ paths: description: > Returns the list of available currency rate tickers (secondary currencies) for a given timestamp, along with the actual data timestamp. + + + > **Heads up**: this endpoint currently returns HTTP 503 `Unable to complete request at this + > time` on the Alchemy proxy. The schema and request shape below are documented for + > reference; "Try It" will not return live data until the upstream service is restored. tags: ["UTXO API Endpoints"] parameters: - $ref: "#/components/parameters/apiKey" @@ -474,6 +487,11 @@ paths: Returns the currency rate for the specified currency and timestamp. If the requested currency is unavailable for that timestamp, the closest rate is returned with the actual rate timestamp. + + + > **Heads up**: this endpoint currently returns HTTP 503 `Unable to complete request at this + > time` on the Alchemy proxy. The schema and request shape below are documented for + > reference; "Try It" will not return live data until the upstream service is restored. tags: ["UTXO API Endpoints"] parameters: - $ref: "#/components/parameters/apiKey"