@@ -28,21 +28,34 @@ namespace interface {
2828
2929struct electrum_methods
3030{
31- // / Electrum protocol version 1.4.2
31+ // / Electrum protocol versions 1.0-1.6
3232 static constexpr std::tuple methods
3333 {
3434 // / Blockchain methods.
35+ method<" blockchain.numblocks.subscribe" >{},
36+ method<" blockchain.block.get_chunk" , number_t >{ " index" },
37+ method<" blockchain.block.get_header" , number_t >{ " height" },
3538 method<" blockchain.block.header" , number_t , optional<0.0 >>{ " height" , " cp_height" },
3639 method<" blockchain.block.headers" , number_t , number_t , optional<0.0 >>{ " start_height" , " count" , " cp_height" },
3740 method<" blockchain.headers.subscribe" >{},
41+
3842 method<" blockchain.estimatefee" , number_t , optional<" " _t>>{ " number" , " mode" },
3943 method<" blockchain.relayfee" >{},
44+
45+ method<" blockchain.utxo.get_address" , string_t , number_t >{ " tx_hash" , " index" },
46+ method<" blockchain.address.get_balance" , string_t >{ " address" },
47+ method<" blockchain.address.get_history" , string_t >{ " address" },
48+ method<" blockchain.address.get_mempool" , string_t >{ " address" },
49+ method<" blockchain.address.listunspent" , string_t >{ " address" },
50+ method<" blockchain.address.subscribe" , string_t >{ " address" },
51+
4052 method<" blockchain.scripthash.get_balance" , string_t >{ " scripthash" },
4153 method<" blockchain.scripthash.get_history" , string_t >{ " scripthash" },
4254 method<" blockchain.scripthash.get_mempool" , string_t >{ " scripthash" },
4355 method<" blockchain.scripthash.list_unspent" , string_t >{ " scripthash" },
4456 method<" blockchain.scripthash.subscribe" , string_t >{ " scripthash" },
4557 method<" blockchain.scripthash.unsubscribe" , string_t >{ " scripthash" },
58+
4659 method<" blockchain.transaction.broadcast" , string_t >{ " raw_tx" },
4760 method<" blockchain.transaction.broadcast_package" , value_t , optional<false >>{ " raw_txs" , " verbose" },
4861 method<" blockchain.transaction.get" , string_t , boolean_t >{ " tx_hash" , " verbose" },
@@ -69,32 +82,46 @@ struct electrum_methods
6982 template <size_t Index>
7083 using at = method_at<methods, Index>;
7184
72- // Derive this from above in c++26 using reflection.
73- using blockchain_block_header = at<0 >;
74- using blockchain_block_headers = at<1 >;
75- using blockchain_headers_subscribe = at<2 >;
76- using blockchain_estimate_fee = at<3 >;
77- using blockchain_relay_fee = at<4 >;
78- using blockchain_scripthash_get_balance = at<5 >;
79- using blockchain_scripthash_get_history = at<6 >;
80- using blockchain_scripthash_get_mempool = at<7 >;
81- using blockchain_scripthash_list_unspent = at<8 >;
82- using blockchain_scripthash_subscribe = at<9 >;
83- using blockchain_scripthash_unsubscribe = at<10 >;
84- using blockchain_transaction_broadcast = at<11 >;
85- using blockchain_transaction_broadcast_package = at<12 >;
86- using blockchain_transaction_get = at<13 >;
87- using blockchain_transaction_get_merkle = at<14 >;
88- using blockchain_transaction_id_from_pos = at<15 >;
89- using server_add_peer = at<16 >;
90- using server_banner = at<17 >;
91- using server_donation_address = at<18 >;
92- using server_features = at<19 >;
93- using server_peers_subscribe = at<20 >;
94- using server_ping = at<21 >;
95- using server_version = at<22 >;
96- using mempool_get_fee_histogram = at<23 >;
97- using mempool_get_info = at<24 >;
85+ using blockchain_number_of_blocks_subscribe = at<0 >;
86+ using blockchain_block_get_chunk = at<1 >;
87+ using blockchain_block_get_header = at<2 >;
88+ using blockchain_block_header = at<3 >;
89+ using blockchain_block_headers = at<4 >;
90+ using blockchain_headers_subscribe = at<5 >;
91+
92+ using blockchain_estimate_fee = at<6 >;
93+ using blockchain_relay_fee = at<7 >;
94+
95+ using blockchain_utxo_get_address = at<8 >;
96+ using blockchain_address_get_balance = at<9 >;
97+ using blockchain_address_get_history = at<10 >;
98+ using blockchain_address_get_mempool = at<11 >;
99+ using blockchain_address_list_unspent = at<12 >;
100+ using blockchain_address_subscribe = at<13 >;
101+
102+ using blockchain_scripthash_get_balance = at<14 >;
103+ using blockchain_scripthash_get_history = at<15 >;
104+ using blockchain_scripthash_get_mempool = at<16 >;
105+ using blockchain_scripthash_list_unspent = at<17 >;
106+ using blockchain_scripthash_subscribe = at<18 >;
107+ using blockchain_scripthash_unsubscribe = at<19 >;
108+
109+ using blockchain_transaction_broadcast = at<20 >;
110+ using blockchain_transaction_broadcast_package = at<21 >;
111+ using blockchain_transaction_get = at<22 >;
112+ using blockchain_transaction_get_merkle = at<23 >;
113+ using blockchain_transaction_id_from_position = at<24 >;
114+
115+ using server_add_peer = at<25 >;
116+ using server_banner = at<26 >;
117+ using server_donation_address = at<27 >;
118+ using server_features = at<28 >;
119+ using server_peers_subscribe = at<29 >;
120+ using server_ping = at<30 >;
121+ using server_version = at<31 >;
122+
123+ using mempool_get_fee_histogram = at<32 >;
124+ using mempool_get_info = at<33 >;
98125};
99126
100127} // namespace interface
0 commit comments