mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-29 17:19:57 -07:00
global: snapshot
This commit is contained in:
@@ -31,10 +31,11 @@ impl TxRoutes for ApiRouter<AppState> {
|
||||
state.cached_json(&headers, CacheStrategy::Height, move |q| q.transaction(txid)).await
|
||||
},
|
||||
|op| op
|
||||
.id("get_tx")
|
||||
.transactions_tag()
|
||||
.summary("Transaction information")
|
||||
.description(
|
||||
"Retrieve complete transaction data by transaction ID (txid). Returns the full transaction details including inputs, outputs, and metadata. The transaction data is read directly from the blockchain data files.",
|
||||
"Retrieve complete transaction data by transaction ID (txid). Returns inputs, outputs, fee, size, and confirmation status.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction)*",
|
||||
)
|
||||
.ok_response::<Transaction>()
|
||||
.not_modified()
|
||||
@@ -54,10 +55,11 @@ impl TxRoutes for ApiRouter<AppState> {
|
||||
state.cached_json(&headers, CacheStrategy::Height, move |q| q.transaction_status(txid)).await
|
||||
},
|
||||
|op| op
|
||||
.id("get_tx_status")
|
||||
.transactions_tag()
|
||||
.summary("Transaction status")
|
||||
.description(
|
||||
"Retrieve the confirmation status of a transaction. Returns whether the transaction is confirmed and, if so, the block height, hash, and timestamp.",
|
||||
"Retrieve the confirmation status of a transaction. Returns whether the transaction is confirmed and, if so, the block height, hash, and timestamp.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-status)*",
|
||||
)
|
||||
.ok_response::<TxStatus>()
|
||||
.not_modified()
|
||||
@@ -77,10 +79,11 @@ impl TxRoutes for ApiRouter<AppState> {
|
||||
state.cached_text(&headers, CacheStrategy::Height, move |q| q.transaction_hex(txid)).await
|
||||
},
|
||||
|op| op
|
||||
.id("get_tx_hex")
|
||||
.transactions_tag()
|
||||
.summary("Transaction hex")
|
||||
.description(
|
||||
"Retrieve the raw transaction as a hex-encoded string. Returns the serialized transaction in hexadecimal format.",
|
||||
"Retrieve the raw transaction as a hex-encoded string. Returns the serialized transaction in hexadecimal format.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-hex)*",
|
||||
)
|
||||
.ok_response::<Hex>()
|
||||
.not_modified()
|
||||
@@ -101,10 +104,11 @@ impl TxRoutes for ApiRouter<AppState> {
|
||||
state.cached_json(&headers, CacheStrategy::Height, move |q| q.outspend(txid, path.vout)).await
|
||||
},
|
||||
|op| op
|
||||
.id("get_tx_outspend")
|
||||
.transactions_tag()
|
||||
.summary("Output spend status")
|
||||
.description(
|
||||
"Get the spending status of a transaction output. Returns whether the output has been spent and, if so, the spending transaction details.",
|
||||
"Get the spending status of a transaction output. Returns whether the output has been spent and, if so, the spending transaction details.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-outspend)*",
|
||||
)
|
||||
.ok_response::<TxOutspend>()
|
||||
.not_modified()
|
||||
@@ -124,10 +128,11 @@ impl TxRoutes for ApiRouter<AppState> {
|
||||
state.cached_json(&headers, CacheStrategy::Height, move |q| q.outspends(txid)).await
|
||||
},
|
||||
|op| op
|
||||
.id("get_tx_outspends")
|
||||
.transactions_tag()
|
||||
.summary("All output spend statuses")
|
||||
.description(
|
||||
"Get the spending status of all outputs in a transaction. Returns an array with the spend status for each output.",
|
||||
"Get the spending status of all outputs in a transaction. Returns an array with the spend status for each output.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-outspends)*",
|
||||
)
|
||||
.ok_response::<Vec<TxOutspend>>()
|
||||
.not_modified()
|
||||
|
||||
Reference in New Issue
Block a user