Sha256: 96a7e2eb8d185d6786e056c743b7e0405db0ee394be4b6617430b16638b89d50

Contents?: true

Size: 1.82 KB

Versions: 3

Compression:

Stored size: 1.82 KB

Contents

module Etherscanio
  class Api
    def initialize(_key)
      nil
    end

    def account_txlist(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

    def account_txlistinternal(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

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

    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

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

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

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
etherscanio-0.0.4 lib/etherscanio/api.rb
etherscanio-0.0.3 lib/etherscanio/api.rb
etherscanio-0.0.1 lib/etherscanio/api.rb