Skip to content

[docs-agent] UTXO API: per-chain curl examples for BCH / LTC / DOGE#1302

Open
JackReacher0807 wants to merge 2 commits into
mainfrom
docs/utxo-per-chain-curl-examples
Open

[docs-agent] UTXO API: per-chain curl examples for BCH / LTC / DOGE#1302
JackReacher0807 wants to merge 2 commits into
mainfrom
docs/utxo-per-chain-curl-examples

Conversation

@JackReacher0807
Copy link
Copy Markdown
Collaborator

Summary

The Bitcoin Cash, Litecoin, and Dogecoin UTXO API method pages currently render bitcoin-mainnet defaults (real BTC block hashes, real BTC txids, BTC bech32 addresses) because all four UTXO chain sections in docs.yml reference the same shared src/openapi/utxo/utxo.yaml. Example:

This PR adds three sibling OpenAPI specs that mirror the shared shape but populate every parameter example and response example with chain-specific values pulled from live *.g.alchemy.com/v2/docs-demo calls (real block hashes for block 860730, real txids and addresses Andra supplied for each chain).

Changes

  • 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)
  • content/docs.yml:
    • Bitcoin Cash section: api-name: utxoapi-name: utxo-bitcoincash
    • Litecoin section: api-name: utxoapi-name: utxo-litecoin
    • Dogecoin section: api-name: utxoapi-name: utxo-dogecoin

Bitcoin section continues to use the existing utxo.yaml unchanged. URLs are unaffected because flattened: true derives the URL segment from the section title (UTXO API Endpoints), not from api-name, so /docs/chains/<chain>/utxo-api-endpoints/utxo-api-endpoints/<method> remains stable across all 4 chains.

Per-chain example values

Endpoint BCH LTC DOGE
block-index/{height} 860730000...e2dcd1d5c9 86073091ccb5...c93c9c03397a617ade19f8b04 86073056acd910...8582cd4d5592
tx/{txid} 0ddda32c...86f72d0a d9a5e3a3...5f545545 bdd9010d...5e217482
address/{addr} bitcoincash:qp3wjpa3tjlj042z2wv7hahsldgwhwy0rq9sywjpyy Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2 DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L
balancehistory.from 1501545600 1318325224 1386474927

Response examples (Tx, AddressInfo, Block, Utxo, BalanceHistoryEntry) were captured live for each chain and inlined under responses["200"].content."application/json".example.

Validation

  • pnpm run validate:rest — all three new specs validate cleanly (each reports 1 warning, matching the pre-existing security-definition warning class on the original utxo.yaml).
  • pnpm run generate:rest — bundles each spec to its own dereferenced JSON under content/api-specs/alchemy/rest/utxo-{chain}.json (gitignored).
  • pnpm run lint — clean for changed files; remaining warnings are pre-existing in unrelated files.

Out of scope

  • Bitcoin UTXO pages — already show valid Bitcoin examples.
  • Tightening the shared utxo.yaml server enum (still lists all 7 networks). Could be a follow-up if reviewers want Bitcoin's page to also drop non-BTC networks from its server picker.

Linear

DOCS-83

Requested by

@andra-catana (via Slack thread)

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
@JackReacher0807 JackReacher0807 requested a review from a team as a code owner May 15, 2026 16:45
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

🔗 Preview Mode

Name Status Preview Updated (UTC)
Alchemy Docs ✅ Ready 🔗 Visit Preview May 15, 2026, 5:24 PM

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

🔍 Link Check

Status: ⏭️ Skipped (no content changes)

View workflow run

…s, surface broken endpoints

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant