Sha256: 3dbbd0c0b67147a03293bd87d1ae2751c4d2aca028753ef9c454b82603d53b76

Contents?: true

Size: 469 Bytes

Versions: 3

Compression:

Stored size: 469 Bytes

Contents

require_relative 'api'

module Etherscan
  class Tokens < Etherscan::Api
    def total_supply(contract_address)
      params = {
        module: 'stats', action: 'tokensupply',
        contractaddress: contract_address
      }
      get(params)
    end

    def balance(address, contract_address)
      params = {
        module: 'account', action: 'tokenbalance',
        address: address, contractaddress: contract_address
      }
      get(params)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
etherscan_api-0.4.0 lib/etherscan/tokens.rb
etherscan_api-0.3.0 lib/etherscan/tokens.rb
etherscan_api-0.2.0 lib/etherscan/tokens.rb