Skip to content

Commit

Permalink
[PSDK-40] Parameterize debug mode for API clients
Browse files Browse the repository at this point in the history
  • Loading branch information
yuga-cb committed May 2, 2024
1 parent 2dc74fb commit 44c0eba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/coinbase.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@ def self.configure_from_json(file_path = 'coinbase_cloud_api_key.json')
# Configuration object for the Coinbase SDK.
class Configuration
attr_reader :base_sepolia_rpc_url, :base_sepolia_client
attr_accessor :api_url, :api_key_name, :api_key_private_key
attr_accessor :api_url, :api_key_name, :api_key_private_key, :debug_api

# Initializes the configuration object.
def initialize
@base_sepolia_rpc_url = 'https://sepolia.base.org'
@base_sepolia_client = Jimson::Client.new(@base_sepolia_rpc_url)
@api_url = 'https://api.cdp.coinbase.com'
@debug_api = false
end

# Sets configuration values based on the provided CDP API Key JSON file.
Expand Down
2 changes: 1 addition & 1 deletion lib/coinbase/middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module Middleware
# Returns the default middleware configuration for the Coinbase SDK.
def self.config
Coinbase::Client::Configuration.default.tap do |config|
config.debugging = true
config.debugging = Coinbase.configuration.debug_api
config.host = Coinbase.configuration.api_url
config.request(:authenticator)
end
Expand Down

0 comments on commit 44c0eba

Please sign in to comment.