forked from rust-bitcoin/corepc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil.rs
More file actions
34 lines (31 loc) · 1.05 KB
/
util.rs
File metadata and controls
34 lines (31 loc) · 1.05 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
// SPDX-License-Identifier: CC0-1.0
//! Macros for implementing JSON-RPC methods on a client.
//!
//! Specifically this is methods found under the `== Util ==` 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 `deriveaddresses`.
#[macro_export]
macro_rules! impl_client_v18__derive_addresses {
() => {
impl Client {
pub fn derive_addresses(&self, descriptor: &str) -> Result<DeriveAddresses> {
self.call("deriveaddresses", &[descriptor.into()])
}
}
};
}
/// Implements Bitcoin Core JSON-RPC API method `getdescriptorinfo`.
#[macro_export]
macro_rules! impl_client_v18__get_descriptor_info {
() => {
impl Client {
pub fn get_descriptor_info(&self, descriptor: &str) -> Result<GetDescriptorInfo> {
self.call("getdescriptorinfo", &[descriptor.into()])
}
}
};
}