Skip to main content

corepc_client/client_sync/v27/
hidden.rs

1// SPDX-License-Identifier: CC0-1.0
2
3//! Macros for implementing JSON-RPC methods on a client.
4//!
5//! Specifically this is `== Hidden ==` methods that are not listed in the
6//! API docs of Bitcoin Core `v27`.
7//!
8//! All macros require `Client` to be in scope.
9//!
10//! See, or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.
11
12/// Implements Bitcoin Core JSON-RPC API method `addconnection`.
13#[macro_export]
14macro_rules! impl_client_v27__add_connection {
15    () => {
16        impl Client {
17            pub fn add_connection(
18                &self,
19                address: &str,
20                connection_type: &str,
21                v2transport: bool,
22            ) -> Result<AddConnection> {
23                self.call(
24                    "addconnection",
25                    &[into_json(address)?, into_json(connection_type)?, into_json(v2transport)?],
26                )
27            }
28        }
29    };
30}