Class: Bitcoin::Node::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/bitcoin/node/cli.rb

Instance Method Summary collapse

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

#getblockchaininfoObject



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()
  request('getnewaddress', )
end

#getpeerinfoObject



35
36
37
# File 'lib/bitcoin/node/cli.rb', line 35

def getpeerinfo
  request('getpeerinfo')
end

#getwalletinfoObject



67
68
69
# File 'lib/bitcoin/node/cli.rb', line 67

def getwalletinfo
  request('getwalletinfo')
end

#listaccountsObject



72
73
74
# File 'lib/bitcoin/node/cli.rb', line 72

def listaccounts
  request('listaccounts')
end

#listwalletsObject



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

#stopObject



24
25
26
# File 'lib/bitcoin/node/cli.rb', line 24

def stop
  request('stop')
end