Class: Bitcoin::Node::CLI
- Inherits:
-
Thor
- Object
- Thor
- Bitcoin::Node::CLI
- Defined in:
- lib/bitcoin/node/cli.rb
Instance Method Summary collapse
- #createwallet(wallet_id) ⇒ Object
- #decodepsbt(base64) ⇒ Object
- #decoderawtransaction(hexstring) ⇒ Object
- #decodescript(hexstring) ⇒ Object
- #encryptwallet(passhphrase) ⇒ Object
- #getblockchaininfo ⇒ Object
- #getblockheader(hash, verbose = true) ⇒ Object
- #getnewaddress(account) ⇒ Object
- #getpeerinfo ⇒ Object
- #getwalletinfo ⇒ Object
- #listaccounts ⇒ Object
- #listwallets ⇒ Object
- #sendrawtransaction(hex_tx) ⇒ Object
- #stop ⇒ Object
Instance Method Details
#createwallet(wallet_id) ⇒ Object
57 58 59 |
# File 'lib/bitcoin/node/cli.rb', line 57 def createwallet(wallet_id) request('createwallet', wallet_id) end |
#decodepsbt(base64) ⇒ Object
13 14 15 16 |
# File 'lib/bitcoin/node/cli.rb', line 13 def decodepsbt(base64) psbt = Bitcoin::PSBT::Tx.parse_from_base64(base64) puts JSON.pretty_generate(psbt.to_h) end |
#decoderawtransaction(hexstring) ⇒ Object
40 41 42 |
# File 'lib/bitcoin/node/cli.rb', line 40 def decoderawtransaction(hexstring) request('decoderawtransaction', hexstring) end |
#decodescript(hexstring) ⇒ Object
45 46 47 |
# File 'lib/bitcoin/node/cli.rb', line 45 def decodescript(hexstring) request('decodescript', hexstring) end |
#encryptwallet(passhphrase) ⇒ Object
77 78 79 |
# File 'lib/bitcoin/node/cli.rb', line 77 def encryptwallet(passhphrase) request('encryptwallet', passhphrase) end |
#getblockchaininfo ⇒ Object
19 20 21 |
# File 'lib/bitcoin/node/cli.rb', line 19 def getblockchaininfo request('getblockchaininfo') end |
#getblockheader(hash, verbose = true) ⇒ Object
29 30 31 32 |
# File 'lib/bitcoin/node/cli.rb', line 29 def getblockheader(hash, verbose = true) verbose = verbose.is_a?(String) ? (verbose == 'true') : verbose request('getblockheader', hash, verbose) end |
#getnewaddress(account) ⇒ Object
82 83 84 |
# File 'lib/bitcoin/node/cli.rb', line 82 def getnewaddress(account) request('getnewaddress', account) end |
#getpeerinfo ⇒ Object
35 36 37 |
# File 'lib/bitcoin/node/cli.rb', line 35 def getpeerinfo request('getpeerinfo') end |
#getwalletinfo ⇒ Object
67 68 69 |
# File 'lib/bitcoin/node/cli.rb', line 67 def getwalletinfo request('getwalletinfo') end |
#listaccounts ⇒ Object
72 73 74 |
# File 'lib/bitcoin/node/cli.rb', line 72 def listaccounts request('listaccounts') end |
#listwallets ⇒ Object
62 63 64 |
# File 'lib/bitcoin/node/cli.rb', line 62 def listwallets request('listwallets') end |
#sendrawtransaction(hex_tx) ⇒ Object
52 53 54 |
# File 'lib/bitcoin/node/cli.rb', line 52 def sendrawtransaction(hex_tx) request('sendrawtransaction', hex_tx) end |
#stop ⇒ Object
24 25 26 |
# File 'lib/bitcoin/node/cli.rb', line 24 def stop request('stop') end |