class GDAX::Auth

Overview

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

Defined in:

gdax/Auth.cr

Constructors

Instance Method Summary

Constructor Detail

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


[View source]

Instance Method Detail

def signature(request_path = "", body : String | Hash = "", timestamp : Int64? = 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"


[View source]
def signed_hash(request_path = "", body : String | Hash = "", timestamp : Int64 = Time.now.epoch, method = "GET") #

Returns full, signed authentication object as a Hash.


[View source]
def signed_headers(request_path = "", body : String | Hash = "", timestamp : Int64 = Time.now.epoch, method = "GET") #

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


[View source]