class GDAX::Client

Overview

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

Defined in:

gdax/Client.cr

Constant Summary

DEFAULT_PRODUCTION_HOST = "api.gdax.com"

GDAX's API URL

DEFAULT_SANDBOX_HOST = "api-public.sandbox.gdax.com"

GDAX's Sandbox API URL

Constructors

Instance Method Summary

Constructor Detail

def self.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.


[View source]
def self.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.


[View source]

Instance Method Detail

def 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.


[View source]
def base_headers #

Returns standard, unauthenticated headers placed on every request.


[View source]