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!();
101101crate :: impl_client_v17__sendtoaddress!( ) ;
102102crate :: impl_client_v17__signmessage!( ) ;
103103crate :: impl_client_v17__signrawtransactionwithwallet!( ) ;
104+ crate :: impl_client_v17__unloadwallet!( ) ;
104105crate :: impl_client_v17__walletcreatefundedpsbt!( ) ;
105106crate :: impl_client_v17__walletprocesspsbt!( ) ;
106107
Original file line number Diff line number Diff line change @@ -432,6 +432,22 @@ macro_rules! impl_client_v17__signrawtransactionwithwallet {
432432 } ;
433433}
434434
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+
435451/// Implements Bitcoin Core JSON-RPC API method `walletcreatefundedpsbt`.
436452#[ macro_export]
437453macro_rules! impl_client_v17__walletcreatefundedpsbt {
Original file line number Diff line number Diff line change @@ -96,5 +96,6 @@ crate::impl_client_v17__sendmany!();
9696crate :: impl_client_v17__sendtoaddress!( ) ;
9797crate :: impl_client_v17__signmessage!( ) ;
9898crate :: impl_client_v17__signrawtransactionwithwallet!( ) ;
99+ crate :: impl_client_v17__unloadwallet!( ) ;
99100crate :: impl_client_v17__walletcreatefundedpsbt!( ) ;
100101crate :: impl_client_v17__walletprocesspsbt!( ) ;
Original file line number Diff line number Diff line change @@ -94,5 +94,6 @@ crate::impl_client_v17__sendmany!();
9494crate :: impl_client_v17__sendtoaddress!( ) ;
9595crate :: impl_client_v17__signmessage!( ) ;
9696crate :: impl_client_v17__signrawtransactionwithwallet!( ) ;
97+ crate :: impl_client_v17__unloadwallet!( ) ;
9798crate :: impl_client_v17__walletcreatefundedpsbt!( ) ;
9899crate :: impl_client_v17__walletprocesspsbt!( ) ;
Original file line number Diff line number Diff line change @@ -92,5 +92,6 @@ crate::impl_client_v17__sendmany!();
9292crate :: impl_client_v17__sendtoaddress!( ) ;
9393crate :: impl_client_v17__signmessage!( ) ;
9494crate :: impl_client_v17__signrawtransactionwithwallet!( ) ;
95+ crate :: impl_client_v17__unloadwallet!( ) ;
9596crate :: impl_client_v17__walletcreatefundedpsbt!( ) ;
9697crate :: impl_client_v17__walletprocesspsbt!( ) ;
Original file line number Diff line number Diff line change 44//!
55//! We ignore option arguments unless they effect the shape of the returned JSON data.
66
7+ mod wallet;
8+
79use std:: collections:: BTreeMap ;
810use std:: path:: Path ;
911
@@ -92,5 +94,6 @@ crate::impl_client_v17__sendmany!();
9294crate :: impl_client_v17__sendtoaddress!( ) ;
9395crate :: impl_client_v17__signmessage!( ) ;
9496crate :: impl_client_v17__signrawtransactionwithwallet!( ) ;
97+ crate :: impl_client_v21__unloadwallet!( ) ;
9598crate :: impl_client_v17__walletcreatefundedpsbt!( ) ;
9699crate :: 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!();
9595crate :: impl_client_v17__sendtoaddress!( ) ;
9696crate :: impl_client_v17__signmessage!( ) ;
9797crate :: impl_client_v17__signrawtransactionwithwallet!( ) ;
98+ crate :: impl_client_v21__unloadwallet!( ) ;
9899crate :: impl_client_v17__walletcreatefundedpsbt!( ) ;
99100crate :: impl_client_v17__walletprocesspsbt!( ) ;
Original file line number Diff line number Diff line change 99//!
1010//! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
1111
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-
2412/// Implements Bitcoin Core JSON-RPC API method `loadwallet`
2513#[ macro_export]
2614macro_rules! impl_client_v22__loadwallet {
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ crate::impl_client_v17__sendmany!();
9393crate :: impl_client_v17__sendtoaddress!( ) ;
9494crate :: impl_client_v17__signmessage!( ) ;
9595crate :: impl_client_v17__signrawtransactionwithwallet!( ) ;
96- crate :: impl_client_v22__unloadwallet !( ) ;
96+ crate :: impl_client_v21__unloadwallet !( ) ;
9797crate :: impl_client_v17__walletcreatefundedpsbt!( ) ;
9898crate :: impl_client_v17__walletprocesspsbt!( ) ;
9999
You can’t perform that action at this time.
0 commit comments