Class: CronosChain::Accounts

Inherits:
Object
  • Object
show all
Defined in:
lib/cronos_chain/accounts.rb

Constant Summary collapse

DEFAULT_HASH =
{ module: 'account' }.freeze

Class Method Summary collapse

Class Method Details

.eth_get_balance(address) ⇒ Object



8
9
10
11
12
# File 'lib/cronos_chain/accounts.rb', line 8

def eth_get_balance(address)
  hash = DEFAULT_HASH.merge(action: 'eth_get_balance', address: address)

  Request.get hash
end

.tokenbalance(contractaddress, address) ⇒ Object



20
21
22
23
24
# File 'lib/cronos_chain/accounts.rb', line 20

def tokenbalance(contractaddress, address)
  hash = DEFAULT_HASH.merge(action: 'tokenbalance', contractaddress: contractaddress, address: address)

  Request.get hash
end

.txlist(address, starttimestamp = nil, sort = 'desc') ⇒ Object



14
15
16
17
18
# File 'lib/cronos_chain/accounts.rb', line 14

def txlist(address, starttimestamp = nil, sort = 'desc')
  hash = DEFAULT_HASH.merge(action: 'txlist', address: address, starttimestamp: starttimestamp, sort: sort)

  Request.get hash
end