forked from rust-bitcoin/corepc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwallet.rs
More file actions
45 lines (42 loc) · 1.34 KB
/
wallet.rs
File metadata and controls
45 lines (42 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// SPDX-License-Identifier: CC0-1.0
//! Macros for implementing JSON-RPC methods on a client.
//!
//! Specifically this is methods found under the `== Wallet ==` section of the
//! API docs of Bitcoin Core `v0.18`.
//!
//! All macros require `Client` to be in scope.
//!
//! See or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.
/// Implements Bitcoin Core JSON-RPC API method `getreceivedbylabel`.
#[macro_export]
macro_rules! impl_client_v18__get_received_by_label {
() => {
impl Client {
pub fn get_received_by_label(&self, label: &str) -> Result<GetReceivedByLabel> {
self.call("getreceivedbylabel", &[label.into()])
}
}
};
}
/// Implements Bitcoin Core JSON-RPC API method `listreceivedbylabel`.
#[macro_export]
macro_rules! impl_client_v18__list_received_by_label {
() => {
impl Client {
pub fn list_received_by_label(&self) -> Result<ListReceivedByLabel> {
self.call("listreceivedbylabel", &[])
}
}
};
}
/// Implements Bitcoin Core JSON-RPC API method `listwalletdir`.
#[macro_export]
macro_rules! impl_client_v18__list_wallet_dir {
() => {
impl Client {
pub fn list_wallet_dir(&self) -> Result<ListWalletDir> {
self.call("listwalletdir", &[])
}
}
};
}