class

GDAX::Auth

Inherits Reference < Object

Signs requests for GDAX Authentication. See GDAX's Signing a Message .

Constructors

new(key : String, secret : String, passphrase : String)

key is your "CB-ACCESS-KEY", secret is your "API-SECRET", and passphrase is "PASSPHRASE", as in GDAX's Creating a Request

Source

Instance methods

signature(request_path = "", body : String | Hash = "", timestamp : Int64 | Nil = nil, method = "GET") : String

Generates a request signature. Code based on GDAX's Ruby Sample

request_path is the path for your individual request. e.g. "/orders"

body is a stringified of your request's body. e.g. %({"price":"1.0","size":"1.0","side":"buy","product_id":"BTC-USD"})

timestamp is an Int64 of seconds since Epoch. Defaults to current Epoch.

method is a String of the request method. e.g. "POST"

Source
signed_hash(request_path = "", body : String | Hash = "", timestamp : Int64 = Time.now.epoch, method = "GET")

Returns full, signed authentication object as a Hash.

Source
signed_headers(request_path = "", body : String | Hash = "", timestamp : Int64 = Time.now.epoch, method = "GET")

Returns full, signed authentication object as a HTTP::Headers instance.

Source