Skip to content

Commit f0f30fe

Browse files
authored
Merge pull request #653 from evoskuil/master
Add top explore query.
2 parents 20ee641 + efff835 commit f0f30fe

File tree

1 file changed

+35
-29
lines changed

1 file changed

+35
-29
lines changed

include/bitcoin/network/rpc/interfaces/explore.hpp

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ struct explore_methods
3131
{
3232
static constexpr std::tuple methods
3333
{
34+
method<"top", uint8_t, uint8_t>{ "version", "media" },
3435
method<"block", uint8_t, uint8_t, nullable<system::hash_cptr>, nullable<uint32_t>, optional<true>>{ "version", "media", "hash", "height", "witness" },
3536
method<"block_header", uint8_t, uint8_t, nullable<system::hash_cptr>, nullable<uint32_t>>{ "version", "media", "hash", "height" },
3637
method<"block_txs", uint8_t, uint8_t, nullable<system::hash_cptr>, nullable<uint32_t>>{ "version", "media", "hash", "height" },
@@ -68,39 +69,44 @@ struct explore_methods
6869
using at = method_at<methods, Index>;
6970

7071
// Derive this from above in c++26 using reflection.
71-
using block = at<0>;
72-
using block_header = at<1>;
73-
using block_txs = at<2>;
74-
using block_fees = at<3>;
75-
using block_filter = at<4>;
76-
using block_filter_hash = at<5>;
77-
using block_filter_header = at<6>;
78-
using block_tx = at<7>;
79-
80-
using tx = at<8>;
81-
using tx_block = at<9>;
82-
using tx_fee = at<10>;
83-
84-
using inputs = at<11>;
85-
using input = at<12>;
86-
using input_script = at<13>;
87-
using input_witness = at<14>;
88-
89-
using outputs = at<15>;
90-
using output = at<16>;
91-
using output_script = at<17>;
92-
using output_spender = at<18>;
93-
using output_spenders = at<19>;
94-
95-
using address = at<20>;
96-
using address_confirmed = at<21>;
97-
using address_unconfirmed = at<22>;
98-
using address_balance = at<23>;
72+
73+
using top = at<0>;
74+
75+
using block = at<1>;
76+
using block_header = at<2>;
77+
using block_txs = at<3>;
78+
using block_fees = at<4>;
79+
using block_filter = at<5>;
80+
using block_filter_hash = at<6>;
81+
using block_filter_header = at<7>;
82+
using block_tx = at<8>;
83+
84+
using tx = at<9>;
85+
using tx_block = at<10>;
86+
using tx_fee = at<11>;
87+
88+
using inputs = at<12>;
89+
using input = at<13>;
90+
using input_script = at<14>;
91+
using input_witness = at<15>;
92+
93+
using outputs = at<16>;
94+
using output = at<17>;
95+
using output_script = at<18>;
96+
using output_spender = at<19>;
97+
using output_spenders = at<20>;
98+
99+
using address = at<21>;
100+
using address_confirmed = at<22>;
101+
using address_unconfirmed = at<23>;
102+
using address_balance = at<24>;
99103
};
100104

101-
/// Pagination and filtering are via query string.
105+
/// ?format=data|text|json (via query string).
102106
/// -----------------------------------------------------------------------
103107

108+
/// /v1/block/top {1}
109+
104110
/// /v1/block/hash/[bkhash] {1}
105111
/// /v1/block/height/[height] {1}
106112

0 commit comments

Comments
 (0)