corepc_client/client_sync/v18/
wallet.rs

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 `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/// Implements Bitcoin Core JSON-RPC API method `getreceivedbylabel`.
12#[macro_export]
13macro_rules! impl_client_v18__get_received_by_label {
14    () => {
15        impl Client {
16            pub fn get_received_by_label(&self, label: &str) -> Result<GetReceivedByLabel> {
17                self.call("getreceivedbylabel", &[label.into()])
18            }
19        }
20    };
21}
22
23/// Implements Bitcoin Core JSON-RPC API method `listreceivedbylabel`.
24#[macro_export]
25macro_rules! impl_client_v18__list_received_by_label {
26    () => {
27        impl Client {
28            pub fn list_received_by_label(&self) -> Result<ListReceivedByLabel> {
29                self.call("listreceivedbylabel", &[])
30            }
31        }
32    };
33}
34
35/// Implements Bitcoin Core JSON-RPC API method `listwalletdir`.
36#[macro_export]
37macro_rules! impl_client_v18__list_wallet_dir {
38    () => {
39        impl Client {
40            pub fn list_wallet_dir(&self) -> Result<ListWalletDir> {
41                self.call("listwalletdir", &[])
42            }
43        }
44    };
45}