Sha256: 07eafdbcdeef3f0ca242d02c2b1fc55d55bd033ffdded59a6d9a8f2ae11675ff

Contents?: true

Size: 339 Bytes

Versions: 5

Compression:

Stored size: 339 Bytes

Contents

# frozen_string_literal: true

module Harmony
  module Api
    class Utilities
      class << self
        def hex_to_int(string)
          string.to_i(16)
        end

        def int_to_hex(int)
          "0x#{int.to_s(16)}"
        end

        def wei_to_ether(wei)
          1.0 * wei / 10**18
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
harmony-api-0.1.4 lib/harmony/api/utilities.rb
harmony-api-0.1.3 lib/harmony/api/utilities.rb
harmony-api-0.1.2 lib/harmony/api/utilities.rb
harmony-api-0.1.1 lib/harmony/api/utilities.rb
harmony-api-0.1.0 lib/harmony/api/utilities.rb