<commit_before>require 'pry'
require 'json'
require 'dotenv'
require 'faraday'
require 'dogecoin/configuration'

Dotenv.load '../.env'

module DogeCoin
  class Client
    include DogeCoin::Configuration
    include Faraday

    BASE_URL = "https://dogeapi.com/wow/?"
    # API_KEY  = "api_key=#{fetch_api_key}"
    # ACTION   = "&a="

    def initialize
      reset
    end

    # def set_url_params(url, name, options)
    # end

    #   Faraday quick & dirty example
    #   response = Faraday.get('http://twitter.com/statuses/public_timeline.json')
    #   puts response.body, response.status, response.method, response.response_headers, response.url, response.response
    

    ### Stubbed out API requests per DogeAPI documentation

    # Returns the DOGE balance of your entire account to 8 decimal places.
    def get_balance
      # /wow/?api_key={API_KEY}&a=get_balance
      Faraday.get("#{BASE_URL}#{fetch_api_key}&a=get_balance").body
    end

    # Withdraws {AMOUNT} doge to a {PAYMENT_ADDRESS} you specify.
    # For now this must be more than 5 doge, and you must have enough extra in your wallet to pay all fees (another 1-3 doge).
    def withdraw(amount, payment_address)
      # /wow/?api_key={API_KEY}&a=withdraw&amount={AMOUNT}&payment_address={PAYMENT_ADDRESS}
      Faraday.get("#{BASE_URL}#{fetch_api_key}&a=withdraw&amount=#{amount}&payment_address=#{payment_address}").body
    end

    # Returns a new payment address for your account. You can pass an optional alphanumeric {ADDRESS_LABEL} as a label for the address.
    def get_new_address(address_label = nil)
      # /wow/?api_key={API_KEY}&a=get_new_address&address_label={ADDRESS_LABEL}
      if address_label
        Faraday.get("#{BASE_URL}#{fetch_api_key}&a=get_new_address&address_label=#{address_label}").body
      else
        Faraday.get("#{BASE_URL}#{fetch_api_key}&a=get_new_address").body
      end
    end

    # Returns all payment addresses/address_ids for your account.
    def get_my_addresses
      # /wow/?api_key={API_KEY}&a=get_my_addresses
      Faraday.get("#{BASE_URL}#{fetch_api_key}&a=get_my_addresses").body
    end

    # Returns the current amount received to all addresses with {ADDRESS_LABEL} or {PAYMENT_ADDRESS}.
    def get_address_received(payment_address_or_address_label)
      # /wow/?api_key={API_KEY}&a=get_address_received&payment_address={PAYMENT_ADDRESS}
      Faraday.get("#{BASE_URL}#{fetch_api_key}&a=get_address_received&payment_address=#{payment_address_or_address_label}").body
    end

    # Returns the payment address for the given {ADDRESS_LABEL}
    def get_address_by_label(address_label)
      # /wow/?api_key={API_KEY}&a=get_address_by_label&address_label={ADDRESS_LABEL}
      Faraday.get("#{BASE_URL}#{fetch_api_key}&a=get__address_by_label&address_label=#{address_label}").body
    end

    # Returns the current difficulty. This doesn't require an API key.
    def get_difficulty
      # /wow/?a=get_difficulty
      Faraday.get("#{BASE_URL}&a=get_difficulty").body
    end

    # Returns the current block. This doesn't require an API key.
    def get_current_block
      # /wow/?a=get_current_block
      Faraday.get("#{BASE_URL}#&a=get_current_block").body
    end

    private

    def fetch_api_key
      api_key
    end
  end
end<commit_msg>Still trying to get api_key set properly in Client<commit_after>require 'pry'
require 'json'
require 'dotenv'
require 'faraday'
require 'dogecoin/configuration'

Dotenv.load '../.env'

module DogeCoin
  class Client
    include DogeCoin::Configuration
    include Faraday

    BASE_URL = "https://dogeapi.com/wow/?"
    # API_KEY  = "api_key=#{api_key}"
    # ACTION   = "&a="

    def initialize
      reset
    end

    # def set_url_params(url, name, options)
    # end

    #   Faraday quick & dirty example
    #   response = Faraday.get('http://twitter.com/statuses/public_timeline.json')
    #   puts response.body, response.status, response.method, response.response_headers, response.url, response.response
    

    ### Stubbed out API requests per DogeAPI documentation

    # Returns the DOGE balance of your entire account to 8 decimal places.
    def get_balance
      # /wow/?api_key={API_KEY}&a=get_balance
      Faraday.get("#{BASE_URL}#{api_key}&a=get_balance").body
    end

    # Withdraws {AMOUNT} doge to a {PAYMENT_ADDRESS} you specify.
    # For now this must be more than 5 doge, and you must have enough extra in your wallet to pay all fees (another 1-3 doge).
    def withdraw(amount, payment_address)
      # /wow/?api_key={API_KEY}&a=withdraw&amount={AMOUNT}&payment_address={PAYMENT_ADDRESS}
      Faraday.get("#{BASE_URL}#{api_key}&a=withdraw&amount=#{amount}&payment_address=#{payment_address}").body
    end

    # Returns a new payment address for your account. You can pass an optional alphanumeric {ADDRESS_LABEL} as a label for the address.
    def get_new_address(address_label = nil)
      # /wow/?api_key={API_KEY}&a=get_new_address&address_label={ADDRESS_LABEL}
      if address_label
        Faraday.get("#{BASE_URL}#{api_key}&a=get_new_address&address_label=#{address_label}").body
      else
        Faraday.get("#{BASE_URL}#{api_key}&a=get_new_address").body
      end
    end

    # Returns all payment addresses/address_ids for your account.
    def get_my_addresses
      # /wow/?api_key={API_KEY}&a=get_my_addresses
      Faraday.get("#{BASE_URL}#{api_key}&a=get_my_addresses").body
    end

    # Returns the current amount received to all addresses with {ADDRESS_LABEL} or {PAYMENT_ADDRESS}.
    def get_address_received(payment_address_or_address_label)
      # /wow/?api_key={API_KEY}&a=get_address_received&payment_address={PAYMENT_ADDRESS}
      Faraday.get("#{BASE_URL}#{api_key}&a=get_address_received&payment_address=#{payment_address_or_address_label}").body
    end

    # Returns the payment address for the given {ADDRESS_LABEL}
    def get_address_by_label(address_label)
      # /wow/?api_key={API_KEY}&a=get_address_by_label&address_label={ADDRESS_LABEL}
      Faraday.get("#{BASE_URL}#{api_key}&a=get__address_by_label&address_label=#{address_label}").body
    end

    # Returns the current difficulty. This doesn't require an API key.
    def get_difficulty
      # /wow/?a=get_difficulty
      Faraday.get("#{BASE_URL}&a=get_difficulty").body
    end

    # Returns the current block. This doesn't require an API key.
    def get_current_block
      # /wow/?a=get_current_block
      Faraday.get("#{BASE_URL}#&a=get_current_block").body
    end

    # private

    # def api_key
    #   api_key
    # end
  end
end
{'fraction_non_alphanumeric': 0.11102661596958174, 'fraction_numerical': 0.0012167300380228137, 'mean_word_length': 3.9480812641083523, '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': '1839904', 'n_tokens_mistral': 2243, 'n_tokens_neox': 2167, 'n_words': 451}