File tree Expand file tree Collapse file tree 32 files changed +278
-55
lines changed Expand file tree Collapse file tree 32 files changed +278
-55
lines changed Original file line number Diff line number Diff line change 7
7
pub mod control;
8
8
pub mod network;
9
9
pub mod raw_transactions;
10
+ pub mod util;
10
11
11
12
use std:: collections:: BTreeMap ;
12
13
use std:: path:: Path ;
@@ -110,7 +111,9 @@ crate::impl_client_v18__utxo_update_psbt!();
110
111
111
112
// == Util ==
112
113
crate :: impl_client_v17__create_multisig!( ) ;
114
+ crate :: impl_client_v18__derive_addresses!( ) ;
113
115
crate :: impl_client_v17__estimate_smart_fee!( ) ;
116
+ crate :: impl_client_v18__get_descriptor_info!( ) ;
114
117
crate :: impl_client_v17__sign_message_with_priv_key!( ) ;
115
118
crate :: impl_client_v17__validate_address!( ) ;
116
119
crate :: impl_client_v17__verify_message!( ) ;
Original file line number Diff line number Diff line change
1
+ // SPDX-License-Identifier: CC0-1.0
2
+
3
+ //! Macros for implementing JSON-RPC methods on a client.
4
+ //!
5
+ //! Specifically this is methods found under the `== Util ==` section of the
6
+ //! API docs of Bitcoin Core `v0.18`.
7
+ //!
8
+ //! All macros require `Client` to be in scope.
9
+ //!
10
+ //! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
11
+
12
+ /// Implements Bitcoin Core JSON-RPC API method `deriveaddresses`
13
+ #[ macro_export]
14
+ macro_rules! impl_client_v18__derive_addresses {
15
+ ( ) => {
16
+ impl Client {
17
+ pub fn derive_addresses( & self , descriptor: & str ) -> Result <DeriveAddresses > {
18
+ self . call( "deriveaddresses" , & [ descriptor. into( ) ] )
19
+ }
20
+ }
21
+ } ;
22
+ }
23
+
24
+ /// Implements Bitcoin Core JSON-RPC API method `getdescriptorinfo`
25
+ #[ macro_export]
26
+ macro_rules! impl_client_v18__get_descriptor_info {
27
+ ( ) => {
28
+ impl Client {
29
+ pub fn get_descriptor_info( & self , descriptor: & str ) -> Result <GetDescriptorInfo > {
30
+ self . call( "getdescriptorinfo" , & [ descriptor. into( ) ] )
31
+ }
32
+ }
33
+ } ;
34
+ }
Original file line number Diff line number Diff line change @@ -108,7 +108,9 @@ crate::impl_client_v18__utxo_update_psbt!();
108
108
109
109
// == Util ==
110
110
crate :: impl_client_v17__create_multisig!( ) ;
111
+ crate :: impl_client_v18__derive_addresses!( ) ;
111
112
crate :: impl_client_v17__estimate_smart_fee!( ) ;
113
+ crate :: impl_client_v18__get_descriptor_info!( ) ;
112
114
crate :: impl_client_v17__sign_message_with_priv_key!( ) ;
113
115
crate :: impl_client_v17__validate_address!( ) ;
114
116
crate :: impl_client_v17__verify_message!( ) ;
Original file line number Diff line number Diff line change @@ -105,7 +105,9 @@ crate::impl_client_v18__utxo_update_psbt!();
105
105
106
106
// == Util ==
107
107
crate :: impl_client_v17__create_multisig!( ) ;
108
+ crate :: impl_client_v18__derive_addresses!( ) ;
108
109
crate :: impl_client_v17__estimate_smart_fee!( ) ;
110
+ crate :: impl_client_v18__get_descriptor_info!( ) ;
109
111
crate :: impl_client_v17__sign_message_with_priv_key!( ) ;
110
112
crate :: impl_client_v17__validate_address!( ) ;
111
113
crate :: impl_client_v17__verify_message!( ) ;
Original file line number Diff line number Diff line change @@ -107,7 +107,9 @@ crate::impl_client_v18__utxo_update_psbt!();
107
107
108
108
// == Util ==
109
109
crate :: impl_client_v17__create_multisig!( ) ;
110
+ crate :: impl_client_v18__derive_addresses!( ) ;
110
111
crate :: impl_client_v17__estimate_smart_fee!( ) ;
112
+ crate :: impl_client_v18__get_descriptor_info!( ) ;
111
113
crate :: impl_client_v17__sign_message_with_priv_key!( ) ;
112
114
crate :: impl_client_v17__validate_address!( ) ;
113
115
crate :: impl_client_v17__verify_message!( ) ;
Original file line number Diff line number Diff line change @@ -107,7 +107,9 @@ crate::impl_client_v18__utxo_update_psbt!();
107
107
108
108
// == Util ==
109
109
crate :: impl_client_v17__create_multisig!( ) ;
110
+ crate :: impl_client_v18__derive_addresses!( ) ;
110
111
crate :: impl_client_v17__estimate_smart_fee!( ) ;
112
+ crate :: impl_client_v18__get_descriptor_info!( ) ;
111
113
crate :: impl_client_v17__sign_message_with_priv_key!( ) ;
112
114
crate :: impl_client_v17__validate_address!( ) ;
113
115
crate :: impl_client_v17__verify_message!( ) ;
Original file line number Diff line number Diff line change @@ -109,7 +109,9 @@ crate::impl_client_v18__utxo_update_psbt!();
109
109
110
110
// == Util ==
111
111
crate :: impl_client_v17__create_multisig!( ) ;
112
+ crate :: impl_client_v18__derive_addresses!( ) ;
112
113
crate :: impl_client_v17__estimate_smart_fee!( ) ;
114
+ crate :: impl_client_v18__get_descriptor_info!( ) ;
113
115
crate :: impl_client_v17__sign_message_with_priv_key!( ) ;
114
116
crate :: impl_client_v17__validate_address!( ) ;
115
117
crate :: impl_client_v17__verify_message!( ) ;
Original file line number Diff line number Diff line change @@ -106,7 +106,9 @@ crate::impl_client_v18__utxo_update_psbt!();
106
106
107
107
// == Util ==
108
108
crate :: impl_client_v17__create_multisig!( ) ;
109
+ crate :: impl_client_v18__derive_addresses!( ) ;
109
110
crate :: impl_client_v17__estimate_smart_fee!( ) ;
111
+ crate :: impl_client_v18__get_descriptor_info!( ) ;
110
112
crate :: impl_client_v17__sign_message_with_priv_key!( ) ;
111
113
crate :: impl_client_v17__validate_address!( ) ;
112
114
crate :: impl_client_v17__verify_message!( ) ;
Original file line number Diff line number Diff line change @@ -106,7 +106,9 @@ crate::impl_client_v18__utxo_update_psbt!();
106
106
107
107
// == Util ==
108
108
crate :: impl_client_v17__create_multisig!( ) ;
109
+ crate :: impl_client_v18__derive_addresses!( ) ;
109
110
crate :: impl_client_v17__estimate_smart_fee!( ) ;
111
+ crate :: impl_client_v18__get_descriptor_info!( ) ;
110
112
crate :: impl_client_v17__sign_message_with_priv_key!( ) ;
111
113
crate :: impl_client_v17__validate_address!( ) ;
112
114
crate :: impl_client_v17__verify_message!( ) ;
Original file line number Diff line number Diff line change @@ -112,7 +112,9 @@ crate::impl_client_v18__utxo_update_psbt!();
112
112
113
113
// == Util ==
114
114
crate :: impl_client_v17__create_multisig!( ) ;
115
+ crate :: impl_client_v18__derive_addresses!( ) ;
115
116
crate :: impl_client_v17__estimate_smart_fee!( ) ;
117
+ crate :: impl_client_v18__get_descriptor_info!( ) ;
116
118
crate :: impl_client_v17__sign_message_with_priv_key!( ) ;
117
119
crate :: impl_client_v17__validate_address!( ) ;
118
120
crate :: impl_client_v17__verify_message!( ) ;
You can’t perform that action at this time.
0 commit comments