Module: Etherlite::Api::Node
Instance Method Summary collapse
- #accounts ⇒ Object
- #first_account ⇒ Object
- #get_block_number ⇒ Object
- #get_gas_price ⇒ Object
- #get_transaction_receipt(_tx_hash) ⇒ Object
- #register_account(_passphrase) ⇒ Object
Methods included from Address
Instance Method Details
#accounts ⇒ Object
24 25 26 27 28 |
# File 'lib/etherlite/api/node.rb', line 24 def accounts connection.ipc_call(:eth_accounts).map do |address| Etherlite::Account.new @connection, Etherlite::Utils.normalize_address(address) end end |
#first_account ⇒ Object
30 31 32 |
# File 'lib/etherlite/api/node.rb', line 30 def first_account @first_account ||= accounts.first end |
#get_block_number ⇒ Object
7 8 9 |
# File 'lib/etherlite/api/node.rb', line 7 def get_block_number Etherlite::Utils.hex_to_uint connection.ipc_call(:eth_blockNumber) end |
#get_gas_price ⇒ Object
11 12 13 |
# File 'lib/etherlite/api/node.rb', line 11 def get_gas_price Etherlite::Utils.hex_to_uint connection.ipc_call(:eth_gasPrice) end |
#get_transaction_receipt(_tx_hash) ⇒ Object
15 16 17 |
# File 'lib/etherlite/api/node.rb', line 15 def get_transaction_receipt(_tx_hash) connection.ipc_call(:eth_getTransactionReceipt, _tx_hash) end |