Sha256: 19336352620543353508fb5f7a5e0154b5aff8bd67000a2b9700c1eea8db67c2

Contents?: true

Size: 1.19 KB

Versions: 78

Compression:

Stored size: 1.19 KB

Contents

# frozen_string_literal: true

module Cryptum
  # This module is used to Interact with the APIs
  module API
    # Module specifically related to orders history retrieval.
    module ExchangeRates
      # Obtain latest order history
      public_class_method def self.get(opts = {})
        option_choice = opts[:option_choice]
        env = opts[:env]

        api_endpoint = 'https://api.coinbase.com/v2'
        exchange_rates_api_call = '/exchange-rates'

        # We don't always get fees back from Coinbase...
        # This is a hack to ensure we do.
        Cryptum::API::Rest.call(
          option_choice: option_choice,
          env: env,
          http_method: :GET,
          api_endpoint: api_endpoint,
          api_call: exchange_rates_api_call
        )
      rescue Interrupt, StandardError => e
        Cryptum::Log.append(level: :error, msg: e, which_self: self)
      end

      # Display Usage for this Module
      public_class_method def self.help
        puts "USAGE:
          fees = #{self}.get(
            env: 'required - Coinbase::Option::Environment.get Object',
            option_choice: 'required - Coinbase::Option::Choice Object'
          )
        "
      end
    end
  end
end

Version data entries

78 entries across 78 versions & 1 rubygems

Version Path
cryptum-0.0.466 lib/cryptum/api/exchange_rates.rb
cryptum-0.0.465 lib/cryptum/api/exchange_rates.rb
cryptum-0.0.464 lib/cryptum/api/exchange_rates.rb
cryptum-0.0.463 lib/cryptum/api/exchange_rates.rb
cryptum-0.0.462 lib/cryptum/api/exchange_rates.rb
cryptum-0.0.461 lib/cryptum/api/exchange_rates.rb
cryptum-0.0.460 lib/cryptum/api/exchange_rates.rb
cryptum-0.0.459 lib/cryptum/api/exchange_rates.rb
cryptum-0.0.458 lib/cryptum/api/exchange_rates.rb
cryptum-0.0.457 lib/cryptum/api/exchange_rates.rb
cryptum-0.0.456 lib/cryptum/api/exchange_rates.rb
cryptum-0.0.455 lib/cryptum/api/exchange_rates.rb
cryptum-0.0.454 lib/cryptum/api/exchange_rates.rb
cryptum-0.0.453 lib/cryptum/api/exchange_rates.rb
cryptum-0.0.452 lib/cryptum/api/exchange_rates.rb
cryptum-0.0.451 lib/cryptum/api/exchange_rates.rb
cryptum-0.0.450 lib/cryptum/api/exchange_rates.rb
cryptum-0.0.449 lib/cryptum/api/exchange_rates.rb
cryptum-0.0.448 lib/cryptum/api/exchange_rates.rb
cryptum-0.0.447 lib/cryptum/api/exchange_rates.rb