Sha256: cac8bc5ec570a88d8ba490caa18c66a38c26b1f1a52534f6876450875055a8c0

Contents?: true

Size: 478 Bytes

Versions: 9

Compression:

Stored size: 478 Bytes

Contents

module Etherlite
  module Api
    module Address
      def address
        '0x' + normalized_address
      end

      def get_balance(block: :latest)
        Etherlite::Utils.hex_to_uint(
          connection.ipc_call(
            :eth_getBalance,
            json_encoded_address,
            Etherlite::Utils.encode_block_param(block)
          )
        )
      end

      private

      def json_encoded_address
        '0x' + normalized_address
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
etherlite-0.2.0 lib/etherlite/api/address.rb
etherlite-0.1.8 lib/etherlite/api/address.rb
etherlite-0.1.7 lib/etherlite/api/address.rb
etherlite-0.1.6 lib/etherlite/api/address.rb
etherlite-0.1.5 lib/etherlite/api/address.rb
etherlite-0.1.4 lib/etherlite/api/address.rb
etherlite-0.1.3 lib/etherlite/api/address.rb
etherlite-0.1.2 lib/etherlite/api/address.rb
etherlite-0.1.1 lib/etherlite/api/address.rb