Class: Etherscanio::Api

Inherits:
Object
  • Object
show all
Defined in:
lib/etherscanio/api.rb

Instance Method Summary collapse

Constructor Details

#initialize(_key) ⇒ Api

Returns a new instance of Api



3
4
5
# File 'lib/etherscanio/api.rb', line 3

def initialize(_key)
  nil
end

Instance Method Details

#account_balance(address, tag) ⇒ Object



29
30
31
32
33
34
# File 'lib/etherscanio/api.rb', line 29

def (address, tag)
  call = Etherscanio::Call.new('account', 'balance')
  call.address = address
  call.tag = tag
  call.fetch
end

#account_balancemulti(address, tag) ⇒ Object



45
46
47
48
49
50
# File 'lib/etherscanio/api.rb', line 45

def (address, tag)
  call = Etherscanio::Call.new('account', 'balancemulti')
  call.address = address
  call.tag = tag
  call.fetch
end

#account_txlist(address, startblock, endblock, sort = 'desc', page = nil, offset = nil) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/etherscanio/api.rb', line 7

def (address, startblock, endblock, sort = 'desc', page = nil, offset = nil)
  call = Etherscanio::Call.new('account', 'txlist')
  call.address = address
  call.startblock = startblock
  call.endblock = endblock
  call.page = page
  call.offset = offset
  call.sort = sort
  call.fetch
end

#account_txlistinternal(address, startblock, endblock, sort = 'desc', page = nil, offset = nil) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'lib/etherscanio/api.rb', line 18

def (address, startblock, endblock, sort = 'desc', page = nil, offset = nil)
  call = Etherscanio::Call.new('account', 'txlistinternal')
  call.address = address
  call.startblock = startblock
  call.endblock = endblock
  call.page = page
  call.offset = offset
  call.sort = sort
  call.fetch
end

#block_getblockreward(blockno) ⇒ Object



64
65
66
67
68
# File 'lib/etherscanio/api.rb', line 64

def block_getblockreward(blockno)
  call = Etherscanio::Call.new('block', 'getblockreward')
  call.blockno = blockno
  call.fetch
end

#contract_getabi(address) ⇒ Object



52
53
54
55
56
# File 'lib/etherscanio/api.rb', line 52

def contract_getabi(address)
  call = Etherscanio::Call.new('contract', 'getabi')
  call.address = address
  call.fetch
end

#getminedblocks(address, blocktype, page = nil, offset = nil) ⇒ Object



36
37
38
39
40
41
42
43
# File 'lib/etherscanio/api.rb', line 36

def getminedblocks(address, blocktype, page = nil, offset = nil)
  call = Etherscanio::Call.new('account', 'getminedblocks')
  call.page = page
  call.offset = offset
  call.address = address
  call.blocktype = blocktype
  call.fetch
end

#transaction_getstatus(txhash) ⇒ Object



58
59
60
61
62
# File 'lib/etherscanio/api.rb', line 58

def transaction_getstatus(txhash)
  call = Etherscanio::Call.new('transaction', 'getstatus')
  call.txhash = txhash
  call.fetch
end