Sha256: d57df79a950cb15566c7ad8e485f883ecadaa345a1f2c6d528b29a66d240825d
Contents?: true
Size: 853 Bytes
Versions: 5
Compression:
Stored size: 853 Bytes
Contents
# frozen_string_literal: true module Harmony module Api module V1 module Accounts module Account def get_balance(address) params = [address, 'latest'] wei = response(post('getBalance', params: params))&.to_i(16) Harmony::Api::Utilities.wei_to_ether(wei) end def get_balance_by_block_number(address, block_number) params = [address, Harmony::Api::Utilities.int_to_hex(block_number)] wei = response(post('getBalanceByBlockNumber', params: params))&.to_i(16) Harmony::Api::Utilities.wei_to_ether(wei) end def get_transaction_count(address) params = [address, 'latest'] response(post('getTransactionCount', params: params))&.to_i(16) end end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems