-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathControlRpcs.R
59 lines (59 loc) · 1.78 KB
/
ControlRpcs.R
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#' RPC-JSON API: getinfo
#'
#' Returning information about bitcoin configuration and settings.
#'
#' WARNING: getinfo is deprecated and will be fully removed in 0.16.
#' Projects should transition to using getblockchaininfo, getnetworkinfo, and
#' getwalletinfo before upgrading to 0.16.
#'
#' @param con object of class \code{CONRPC}.
#'
#' @return A S4-object of class \code{ANSRPC}.
#' @family Control RPCs
#' @author Bernhard Pfaff
#' @references \url{https://bitcoin.org/en/developer-reference#getinfo},
#' \url{https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs}
#' @name getinfo
#' @aliases getinfo
#' @rdname getinfo
#' @export
getinfo <- function(con){
rpcpost(con, "getinfo")
}
#' RPC-JSON API: Help
#'
#' Returning information about RPC functions.
#'
#' @param con object of class \code{CONRPC}.
#' @param rpc \code{character}, name of RPC function.
#'
#' @return A S4-object of class \code{ANSRPC}.
#' @family Control RPCs
#' @author Bernhard Pfaff
#' @references \url{https://bitcoin.org/en/developer-reference#help},
#' \url{https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs}
#' @name gethelp
#' @aliases gethelp
#' @rdname gethelp
#' @export
gethelp <- function(con, rpc = ""){
rpcpost(con, "help", list(command = rpc))
}
#' RPC-JSON API: getwalletinfo
#'
#' Returning information about bitcoin wallet.
#'
#' @param con object of class \code{CONRPC}.
#'
#' @return A S4-object of class \code{ANSRPC}.
#' @family Control RPCs
#' @author Bernhard Pfaff
#' @references \url{https://bitcoin.org/en/developer-reference#getwalletinfo},
#' \url{https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs}
#' @name getwalletinfo
#' @aliases getwalletinfo
#' @rdname getwalletinfo
#' @export
getwalletinfo <- function(con){
rpcpost(con, "getwalletinfo")
}