Module: Etherlite::Api::Rpc

Included in:
Connection
Defined in:
lib/etherlite/api/rpc.rb

Instance Method Summary collapse

Instance Method Details

#eth_block_numberObject



4
5
6
# File 'lib/etherlite/api/rpc.rb', line 4

def eth_block_number
  Etherlite::Utils.hex_to_uint ipc_call(:eth_blockNumber)
end

#eth_call(_params, _block = 'latest') ⇒ Object



28
29
30
# File 'lib/etherlite/api/rpc.rb', line 28

def eth_call(_params, _block = 'latest')
  ipc_call(:eth_call, _params, _block)
end

#eth_gas_priceObject



8
9
10
# File 'lib/etherlite/api/rpc.rb', line 8

def eth_gas_price
  Etherlite::Utils.hex_to_uint ipc_call(:eth_gasPrice)
end

#eth_get_balance(_address, _block = 'latest') ⇒ Object



24
25
26
# File 'lib/etherlite/api/rpc.rb', line 24

def eth_get_balance(_address, _block = 'latest')
  Etherlite::Utils.hex_to_uint ipc_call(:eth_getBalance, _address, _block)
end

#eth_get_transaction_by_hash(_tx_hash) ⇒ Object



12
13
14
# File 'lib/etherlite/api/rpc.rb', line 12

def eth_get_transaction_by_hash(_tx_hash)
  ipc_call(:eth_getTransactionByHash, _tx_hash)
end

#eth_get_transaction_count(_address, _block = 'latest') ⇒ Object



20
21
22
# File 'lib/etherlite/api/rpc.rb', line 20

def eth_get_transaction_count(_address, _block = 'latest')
  Etherlite::Utils.hex_to_uint ipc_call(:eth_getTransactionCount, _address, _block)
end

#eth_get_transaction_receipt(_tx_hash) ⇒ Object



16
17
18
# File 'lib/etherlite/api/rpc.rb', line 16

def eth_get_transaction_receipt(_tx_hash)
  ipc_call(:eth_getTransactionReceipt, _tx_hash)
end

#eth_send_raw_transaction(_hex_data) ⇒ Object



32
33
34
# File 'lib/etherlite/api/rpc.rb', line 32

def eth_send_raw_transaction(_hex_data)
  ipc_call(:eth_sendRawTransaction, _hex_data)
end

#eth_send_transaction(_params) ⇒ Object



36
37
38
# File 'lib/etherlite/api/rpc.rb', line 36

def eth_send_transaction(_params)
  ipc_call(:eth_sendTransaction, _params)
end

#evm_increase_time(_seconds) ⇒ Object



54
55
56
# File 'lib/etherlite/api/rpc.rb', line 54

def evm_increase_time(_seconds)
  Etherlite::Utils.hex_to_uint ipc_call(:evm_increase_time, _seconds)
end

#evm_mineObject



58
59
60
# File 'lib/etherlite/api/rpc.rb', line 58

def evm_mine
  ipc_call(:evm_mine)
end

#evm_revert(_snapshot_id) ⇒ Object



50
51
52
# File 'lib/etherlite/api/rpc.rb', line 50

def evm_revert(_snapshot_id)
  ipc_call(:evm_revert, _snapshot_id)
end

#evm_snapshotObject

TestRPC support



46
47
48
# File 'lib/etherlite/api/rpc.rb', line 46

def evm_snapshot
  ipc_call(:evm_snapshot)
end

#personal_send_transaction(_params, _passphrase) ⇒ Object



40
41
42
# File 'lib/etherlite/api/rpc.rb', line 40

def personal_send_transaction(_params, _passphrase)
  ipc_call(:personal_sendTransaction, _params, _passphrase)
end