Class: Etherscan::Accounts
Instance Attribute Summary
Attributes inherited from Api
Instance Method Summary collapse
- #address_balance(address) ⇒ Object
-
#internal_transactions(address, args = {}) ⇒ Object
Get a list of ‘Internal’ Transactions By Address Available args: start_block, end_block, sort, page, offset.
- #multi_address_balance(addresses) ⇒ Object
-
#normal_transactions(address, args = {}) ⇒ Object
Get a list of ‘Normal’ Transactions By Address if page is not defined Returns up to 10000 last transactions Available args: start_block, end_block, sort, page, offset.
-
#token_transactions(contract_address, address = nil, args = {}) ⇒ Object
Get a list of “ERC20 - Token Transfer Events” Available args: start_block, end_block, sort, page, offset.
Methods inherited from Api
Constructor Details
This class inherits a constructor from Etherscan::Api
Instance Method Details
#address_balance(address) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/etherscan/accounts.rb', line 5 def address_balance(address) params = { module: 'account', action: 'balance', address: address, tag: 'latest' } get(params) end |
#internal_transactions(address, args = {}) ⇒ Object
Get a list of ‘Internal’ Transactions By Address Available args: start_block, end_block, sort, page, offset
37 38 39 40 |
# File 'lib/etherscan/accounts.rb', line 37 def internal_transactions(address, args = {}) action = 'txlistinternal' transcations(action, address, nil, args) end |
#multi_address_balance(addresses) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/etherscan/accounts.rb', line 13 def multi_address_balance(addresses) fail Etherscan::Exception, 'up to 20 accounts in a single batch' if addresses.size > 20 params = { module: 'account', action: 'balancemulti', address: addresses.join(','), tag: 'latest' } get(params) end |
#normal_transactions(address, args = {}) ⇒ Object
Get a list of ‘Normal’ Transactions By Address if page is not defined Returns up to 10000 last transactions Available args: start_block, end_block, sort, page, offset
30 31 32 33 |
# File 'lib/etherscan/accounts.rb', line 30 def normal_transactions(address, args = {}) action = 'txlist' transcations(action, address, nil, args) end |
#token_transactions(contract_address, address = nil, args = {}) ⇒ Object
Get a list of “ERC20 - Token Transfer Events” Available args: start_block, end_block, sort, page, offset
46 47 48 49 50 |
# File 'lib/etherscan/accounts.rb', line 46 def token_transactions(contract_address, address = nil, args = {}) fail Etherscan::Exception, 'contract or address must be defined' if (contract_address || address).nil? action = 'tokentx' transcations(action, address, contract_address, args) end |