Merge pull request #3157 from hunicus/bulk-block-api

Add api documentation for blocks-bulk
This commit is contained in:
softsimon 2023-03-02 17:20:55 +09:00 committed by GitHub
commit dfcbaabeda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2907,6 +2907,219 @@ export const restApiDocsData = [
}
},
...
]`
},
codeSampleLiquid: emptyCodeSample,
codeSampleLiquidTestnet: emptyCodeSample,
codeSampleBisq: emptyCodeSample,
}
}
},
{
type: "endpoint",
category: "blocks",
httpRequestMethod: "GET",
fragment: "get-blocks-bulk",
title: "GET Blocks (Bulk)",
description: {
default: "<p>Returns details on the range of blocks between <code>:minHeight</code> and <code>:maxHeight</code>, inclusive, up to 10 blocks. If <code>:maxHeight</code> is not specified, it defaults to the current tip.</p><p>To return data for more than 10 blocks, consider becoming an <a href='/enterprise'>enterprise sponsor</a>.</p>"
},
urlString: "/v1/blocks-bulk/:minHeight[/:maxHeight]",
showConditions: bitcoinNetworks,
showJsExamples: showJsExamplesDefaultFalse,
codeExample: {
default: {
codeTemplate: {
curl: `/api/v1/blocks-bulk/%{1}/%{2}`,
commonJS: ``,
},
codeSampleMainnet: {
esModule: [],
commonJS: [],
curl: [100000,100000],
response: `[
{
"height": 100000,
"hash": "000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506",
"timestamp": 1293623863,
"median_timestamp": 1293622620,
"previous_block_hash": "000000000002d01c1fccc21636b607dfd930d31d01c3a62104612a1719011250",
"difficulty": 14484.1623612254,
"header": "0100000050120119172a610421a6c3011dd330d9df07b63616c2cc1f1cd00200000000006657a9252aacd5c0b2940996ecff952228c3067cc38d4885efb5a4ac4247e9f337221b4d4c86041b0f2b5710",
"version": 1,
"bits": 453281356,
"nonce": 274148111,
"size": 957,
"weight": 3828,
"tx_count": 4,
"merkle_root": "f3e94742aca4b5ef85488dc37c06c3282295ffec960994b2c0d5ac2a25a95766",
"reward": 5000000000,
"total_fee_amt": 0,
"avg_fee_amt": 0,
"median_fee_amt": 0,
"fee_amt_percentiles": {
"min": 0,
"perc_10": 0,
"perc_25": 0,
"perc_50": 0,
"perc_75": 0,
"perc_90": 0,
"max": 0
},
"avg_fee_rate": 0,
"median_fee_rate": 0,
"fee_rate_percentiles": {
"min": 0,
"perc_10": 0,
"perc_25": 0,
"perc_50": 0,
"perc_75": 0,
"perc_90": 0,
"max": 0
},
"total_inputs": 3,
"total_input_amt": 5301000000,
"total_outputs": 6,
"total_output_amt": 5301000000,
"segwit_total_txs": 0,
"segwit_total_size": 0,
"segwit_total_weight": 0,
"avg_tx_size": 185.25,
"utxoset_change": 3,
"utxoset_size": 71888,
"coinbase_raw": "044c86041b020602",
"coinbase_address": null,
"coinbase_signature": "OP_PUSHBYTES_65 041b0e8c2567c12536aa13357b79a073dc4444acb83c4ec7a0e2f99dd7457516c5817242da796924ca4e99947d087fedf9ce467cb9f7c6287078f801df276fdf84 OP_CHECKSIG",
"coinbase_signature_ascii": "\u0004L<34>\u0004\u001b\u0002\u0006\u0002",
"pool_slug": "unknown",
"orphans": []
}
]`,
},
codeSampleTestnet: {
esModule: [],
commonJS: [],
curl: [100000,100000],
response: `[
{
"height": 100000,
"hash": "00000000009e2958c15ff9290d571bf9459e93b19765c6801ddeccadbb160a1e",
"timestamp": 1376123972,
"median_timestamp": 1677396660,
"previous_block_hash": "000000004956cc2edd1a8caa05eacfa3c69f4c490bfc9ace820257834115ab35",
"difficulty": 271.7576739288896,
"header": "0200000035ab154183570282ce9afc0b494c9fc6a3cfea05aa8c1add2ecc56490000000038ba3d78e4500a5a7570dbe61960398add4410d278b21cd9708e6d9743f374d544fc055227f1001c29c1ea3b",
"version": 2,
"bits": 469823783,
"nonce": 1005240617,
"size": 221,
"weight": 884,
"tx_count": 1,
"merkle_root": "d574f343976d8e70d91cb278d21044dd8a396019e6db70755a0a50e4783dba38",
"reward": 5000000000,
"total_fee_amt": 0,
"avg_fee_amt": 0,
"median_fee_amt": 0,
"fee_amt_percentiles": {
"min": 0,
"perc_10": 0,
"perc_25": 0,
"perc_50": 0,
"perc_75": 0,
"perc_90": 0,
"max": 0
},
"avg_fee_rate": 0,
"median_fee_rate": 0,
"fee_rate_percentiles": {
"min": 0,
"perc_10": 0,
"perc_25": 0,
"perc_50": 0,
"perc_75": 0,
"perc_90": 0,
"max": 0
},
"total_inputs": 0,
"total_input_amt": null,
"total_outputs": 1,
"total_output_amt": 0,
"segwit_total_txs": 0,
"segwit_total_size": 0,
"segwit_total_weight": 0,
"avg_tx_size": 0,
"utxoset_change": 1,
"utxoset_size": null,
"coinbase_raw": "03a08601000427f1001c046a510100522cfabe6d6d0000000000000000000068692066726f6d20706f6f6c7365727665726aac1eeeed88",
"coinbase_address": "mtkbaiLiUH3fvGJeSzuN3kUgmJzqinLejJ",
"coinbase_signature": "OP_DUP OP_HASH160 OP_PUSHBYTES_20 912e2b234f941f30b18afbb4fa46171214bf66c8 OP_EQUALVERIFY OP_CHECKSIG",
"coinbase_signature_ascii": "\u0003 <20>\u0001\u0000\u0004'ñ\u0000\u001c\u0004jQ\u0001\u0000R,ú¾mm\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000hi from poolserverj¬\u001eîí<C3AE>",
"pool_slug": "unknown",
"orphans": []
}
]`
},
codeSampleSignet: {
esModule: [],
commonJS: [],
curl: [100000,100000],
response: `[
{
"height": 100000,
"hash": "0000008753108390007b3f5c26e5d924191567e147876b84489b0c0cf133a0bf",
"timestamp": 1658421183,
"median_timestamp": 1658418056,
"previous_block_hash": "000000b962a13c3dd3f81917bc8646a0c98224adcd5124026d4fdfcb76a76d30",
"difficulty": 0.002781447610743506,
"header": "00000020306da776cbdf4f6d022451cdad2482c9a04686bc1719f8d33d3ca162b90000001367fb15320ebb1932fd589f8f38866b692ca8a4ad6100a4bc732d212916d0efbf7fd9628567011e47662d00",
"version": 536870912,
"bits": 503408517,
"nonce": 2975303,
"size": 343,
"weight": 1264,
"tx_count": 1,
"merkle_root": "efd01629212d73bca40061ada4a82c696b86388f9f58fd3219bb0e3215fb6713",
"reward": 5000000000,
"total_fee_amt": 0,
"avg_fee_amt": 0,
"median_fee_amt": 0,
"fee_amt_percentiles": {
"min": 0,
"perc_10": 0,
"perc_25": 0,
"perc_50": 0,
"perc_75": 0,
"perc_90": 0,
"max": 0
},
"avg_fee_rate": 0,
"median_fee_rate": 0,
"fee_rate_percentiles": {
"min": 0,
"perc_10": 0,
"perc_25": 0,
"perc_50": 0,
"perc_75": 0,
"perc_90": 0,
"max": 0
},
"total_inputs": 0,
"total_input_amt": null,
"total_outputs": 2,
"total_output_amt": 0,
"segwit_total_txs": 0,
"segwit_total_size": 0,
"segwit_total_weight": 0,
"avg_tx_size": 0,
"utxoset_change": 2,
"utxoset_size": null,
"coinbase_raw": "03a08601",
"coinbase_address": "tb1psfjl80vk0yp3agcq6ylueas29rau00mfq90mhejerpgccg33xhasd9gjyd",
"coinbase_signature": "OP_PUSHNUM_1 OP_PUSHBYTES_32 8265f3bd9679031ea300d13fccf60a28fbc7bf69015fbbe65918518c223135fb",
"coinbase_signature_ascii": "\u0003 <20>\u0001",
"pool_slug": "unknown",
"orphans": []
}
]`
},
codeSampleLiquid: emptyCodeSample,