File tree Expand file tree Collapse file tree 29 files changed +141
-47
lines changed Expand file tree Collapse file tree 29 files changed +141
-47
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ crate::impl_client_v17__sendmany!();
101
101
crate :: impl_client_v17__sendtoaddress!( ) ;
102
102
crate :: impl_client_v17__signmessage!( ) ;
103
103
crate :: impl_client_v17__signrawtransactionwithwallet!( ) ;
104
+ crate :: impl_client_v17__unloadwallet!( ) ;
104
105
crate :: impl_client_v17__walletcreatefundedpsbt!( ) ;
105
106
crate :: impl_client_v17__walletprocesspsbt!( ) ;
106
107
Original file line number Diff line number Diff line change @@ -432,6 +432,22 @@ macro_rules! impl_client_v17__signrawtransactionwithwallet {
432
432
} ;
433
433
}
434
434
435
+ /// Implements Bitcoin Core JSON-RPC API method `unloadwallet`.
436
+ #[ macro_export]
437
+ macro_rules! impl_client_v17__unloadwallet {
438
+ ( ) => {
439
+ impl Client {
440
+ pub fn unload_wallet( & self , wallet_name: & str ) -> Result <( ) > {
441
+ match self . call( "unloadwallet" , & [ into_json( wallet_name) ?] ) {
442
+ Ok ( serde_json:: Value :: Null ) => Ok ( ( ) ) ,
443
+ Ok ( res) => Err ( Error :: Returned ( res. to_string( ) ) ) ,
444
+ Err ( err) => Err ( err. into( ) ) ,
445
+ }
446
+ }
447
+ }
448
+ } ;
449
+ }
450
+
435
451
/// Implements Bitcoin Core JSON-RPC API method `walletcreatefundedpsbt`.
436
452
#[ macro_export]
437
453
macro_rules! impl_client_v17__walletcreatefundedpsbt {
Original file line number Diff line number Diff line change @@ -96,5 +96,6 @@ crate::impl_client_v17__sendmany!();
96
96
crate :: impl_client_v17__sendtoaddress!( ) ;
97
97
crate :: impl_client_v17__signmessage!( ) ;
98
98
crate :: impl_client_v17__signrawtransactionwithwallet!( ) ;
99
+ crate :: impl_client_v17__unloadwallet!( ) ;
99
100
crate :: impl_client_v17__walletcreatefundedpsbt!( ) ;
100
101
crate :: impl_client_v17__walletprocesspsbt!( ) ;
Original file line number Diff line number Diff line change @@ -94,5 +94,6 @@ crate::impl_client_v17__sendmany!();
94
94
crate :: impl_client_v17__sendtoaddress!( ) ;
95
95
crate :: impl_client_v17__signmessage!( ) ;
96
96
crate :: impl_client_v17__signrawtransactionwithwallet!( ) ;
97
+ crate :: impl_client_v17__unloadwallet!( ) ;
97
98
crate :: impl_client_v17__walletcreatefundedpsbt!( ) ;
98
99
crate :: impl_client_v17__walletprocesspsbt!( ) ;
Original file line number Diff line number Diff line change @@ -92,5 +92,6 @@ crate::impl_client_v17__sendmany!();
92
92
crate :: impl_client_v17__sendtoaddress!( ) ;
93
93
crate :: impl_client_v17__signmessage!( ) ;
94
94
crate :: impl_client_v17__signrawtransactionwithwallet!( ) ;
95
+ crate :: impl_client_v17__unloadwallet!( ) ;
95
96
crate :: impl_client_v17__walletcreatefundedpsbt!( ) ;
96
97
crate :: impl_client_v17__walletprocesspsbt!( ) ;
Original file line number Diff line number Diff line change 4
4
//!
5
5
//! We ignore option arguments unless they effect the shape of the returned JSON data.
6
6
7
+ mod wallet;
8
+
7
9
use std:: collections:: BTreeMap ;
8
10
use std:: path:: Path ;
9
11
@@ -92,5 +94,6 @@ crate::impl_client_v17__sendmany!();
92
94
crate :: impl_client_v17__sendtoaddress!( ) ;
93
95
crate :: impl_client_v17__signmessage!( ) ;
94
96
crate :: impl_client_v17__signrawtransactionwithwallet!( ) ;
97
+ crate :: impl_client_v21__unloadwallet!( ) ;
95
98
crate :: impl_client_v17__walletcreatefundedpsbt!( ) ;
96
99
crate :: impl_client_v17__walletprocesspsbt!( ) ;
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 `== Wallet ==` section of the
6
+ //! API docs of Bitcoin Core `v21`.
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 `unloadwallet`
13
+ #[ macro_export]
14
+ macro_rules! impl_client_v21__unloadwallet {
15
+ ( ) => {
16
+ impl Client {
17
+ pub fn unload_wallet( & self , wallet: & str ) -> Result <UnloadWallet > {
18
+ self . call( "unloadwallet" , & [ wallet. into( ) ] )
19
+ }
20
+ }
21
+ } ;
22
+ }
Original file line number Diff line number Diff line change @@ -95,5 +95,6 @@ crate::impl_client_v17__sendmany!();
95
95
crate :: impl_client_v17__sendtoaddress!( ) ;
96
96
crate :: impl_client_v17__signmessage!( ) ;
97
97
crate :: impl_client_v17__signrawtransactionwithwallet!( ) ;
98
+ crate :: impl_client_v21__unloadwallet!( ) ;
98
99
crate :: impl_client_v17__walletcreatefundedpsbt!( ) ;
99
100
crate :: impl_client_v17__walletprocesspsbt!( ) ;
Original file line number Diff line number Diff line change 9
9
//!
10
10
//! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
11
11
12
- /// Implements Bitcoin Core JSON-RPC API method `unloadwallet`
13
- #[ macro_export]
14
- macro_rules! impl_client_v22__unloadwallet {
15
- ( ) => {
16
- impl Client {
17
- pub fn unload_wallet( & self , wallet: & str ) -> Result <UnloadWallet > {
18
- self . call( "unloadwallet" , & [ wallet. into( ) ] )
19
- }
20
- }
21
- } ;
22
- }
23
-
24
12
/// Implements Bitcoin Core JSON-RPC API method `loadwallet`
25
13
#[ macro_export]
26
14
macro_rules! impl_client_v22__loadwallet {
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ crate::impl_client_v17__sendmany!();
93
93
crate :: impl_client_v17__sendtoaddress!( ) ;
94
94
crate :: impl_client_v17__signmessage!( ) ;
95
95
crate :: impl_client_v17__signrawtransactionwithwallet!( ) ;
96
- crate :: impl_client_v22__unloadwallet !( ) ;
96
+ crate :: impl_client_v21__unloadwallet !( ) ;
97
97
crate :: impl_client_v17__walletcreatefundedpsbt!( ) ;
98
98
crate :: impl_client_v17__walletprocesspsbt!( ) ;
99
99
You can’t perform that action at this time.
0 commit comments