GDAX::Client
Inherits HTTP::Client < Reference < Object
An HTTP::Client for interacting with the GDAX Client API.
auth = GDAX::Auth.new ENV["CB-ACCESS-KEY"], ENV["API-SECRET"], ENV["PASSPHRASE"]
client = GDAX::Client.new auth
client.get "/products/BTC-USD/trades" do |response|
success = true
end
Constants
DEFAULT_PRODUCTION_HOST = "api.gdax.com"
GDAX's API URL
DEFAULT_SANDBOX_HOST = "api-public.sandbox.gdax.com"
GDAX's Sandbox API URL
Constructors
new(auth : GDAX::Auth, production = true, host = default_host(production), **args)
A constructor for an authenticated client (for access to Private and Public endpoints).
auth is a GDAX::Auth instance containing your API keys.
host is the host uri string. This defaults to DEFAULT_PRODUCTION_HOST if production is not set to false.
new(production = true, host = default_host(production), **args)
A constructor for an unauthenticated client (for access to Public endpoints only).
host is the host uri string. This defaults to DEFAULT_PRODUCTION_HOST if production is not set to false.
Instance methods
authenticated_headers(request_path = "", body : String | Hash = "", timestamp : Int64 = Time.now.epoch, method = "GET")
Returns authenticated headers; Placed on every request if Client is authenticated.
All arguments are passed directly to GDAX::Auth#signed_headers.