class GDAX::Client
- GDAX::Client
- HTTP::Client
- Reference
- Object
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.crConstant 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
-
.new(auth : GDAX::Auth, production = true, host = default_host(production), **args)
A constructor for an authenticated client (for access to Private and Public endpoints).
-
.new(production = true, host = default_host(production), **args)
A constructor for an unauthenticated client (for access to Public endpoints only).
Instance Method Summary
-
#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. -
#base_headers
Returns standard, unauthenticated headers placed on every request.
Constructor Detail
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.
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 Method Detail
Returns authenticated headers; Placed on every request if Client
is authenticated.
All arguments are passed directly to GDAX::Auth#signed_headers
.