Crate bitcoin_cli

source ·

Structs

Constants

Traits

  • | Class that handles the conversion from | a command-line to a JSON-RPC request, | as well as converting back to a JSON object | that can be shown as result. |

Functions

  • | This function returns either one of EXIT_ codes | when it’s expected to stop the process or | CONTINUE_EXECUTION when it’s expected to | continue further. |
  • | ConnectAndCallRPC wraps CallRPC with | -rpcwait and an exception handler. | | ———– | @param[in] rh | | Pointer to RequestHandler. | ––––– | @param[in] strMethod | | Reference to const string method to | forward to CallRPC. | ––––– | @param[in] rpcwallet | | Reference to const optional string | wallet name to forward to CallRPC. | | ———– | @return | | the RPC response as a UniValue object. | @throws a CConnectionFailed std::runtime_error | if connection failed or RPC server still | in warmup. |
  • | Call RPC getnewaddress. | | | ———– | @return | | getnewaddress response as a UniValue | object. |
  • | GetProgressBar constructs a progress | bar with 5% intervals. | | ———– | @param[in] progress | | The proportion of the progress bar to | be filled between 0 and 1. | ––––– | @param[out] progress_bar | | String representation of the progress | bar. |
  • | GetWalletBalances calls listwallets; | if more than one wallet is loaded, it | then fetches mine.trusted balances | for each loaded wallet and pushes them | to result. | | ———– | @param result | | Reference to UniValue object the wallet | names and balances are pushed to. |
  • | libevent event log callback |
  • | Parse UniValue error to update the message | to print to std::cerr and the code to | return. |
  • | ParseGetInfoResult takes in -getinfo | result in UniValue object and parses | it into a user friendly UniValue string | to be printed on the console. | | ———– | @param[out] result | | Reference to UniValue result containing | the -getinfo output. |
  • | Non-RFC4627 JSON parser, accepts internal | values (such as numbers, true, false, | null) as well as objects and arrays. |
  • | Parse UniValue result to update the | message to print to std::cout. |
  • | Convert named arguments to command-specific | RPC representation |
  • | Convert positional arguments to command-specific | RPC representation |
  • | Check bounds and set up args for RPC generatetoaddress | params: nblocks, address, maxtries. | | ———– | @param[in] address | | Reference to const string address to | insert into the args. | ––––– | @param args | | Reference to vector of string args to | modify. |