<commit_before>module Coinbase
  module Exchange
    # Net-http client for Coinbase Exchange API
    class APIClient
      def initialize(api_key = '', api_secret = '', api_pass = '', options = {})
        @api_uri = URI.parse(options[:api_url] || "https://api.gdax.com")
        @api_pass = api_pass
        @api_key = api_key
        @api_secret = api_secret
        @default_product = options[:product_id] || "BTC-USD"
      end

      def server_epoch(params = {})
        get("/time", params) do |resp|
          yield(resp) if block_given?
        end
      end

      #
      # Market Data
      #
      def currencies(params = {})
        out = nil
        get("/currencies", params) do |resp|
          out = response_collection(resp)
          yield(out, resp) if block_given?
        end
        out
      end

      def products(params = {})
        out = nil
        get("/products", params) do |resp|
          out = response_collection(resp)<commit_msg>updated to use coinbase pro endpoints<commit_after>module Coinbase
  module Exchange
    # Net-http client for Coinbase Exchange API
    class APIClient
      def initialize(api_key = '', api_secret = '', api_pass = '', options = {})
        @api_uri = URI.parse(options[:api_url] || "https://api.pro.coinbase.com")
        @api_pass = api_pass
        @api_key = api_key
        @api_secret = api_secret
        @default_product = options[:product_id] || "BTC-USD"
      end

      def server_epoch(params = {})
        get("/time", params) do |resp|
          yield(resp) if block_given?
        end
      end

      #
      # Market Data
      #
      def currencies(params = {})
        out = nil
        get("/currencies", params) do |resp|
          out = response_collection(resp)
          yield(out, resp) if block_given?
        end
        out
      end

      def products(params = {})
        out = nil
        get("/products", params) do |resp|
          out = response_collection(resp)
{'fraction_non_alphanumeric': 0.11432926829268293, 'fraction_numerical': 0.0, 'mean_word_length': 1.9969558599695585, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5507421', 'n_tokens_mistral': 590, 'n_tokens_neox': 579, 'n_words': 144}