gdax

package
v0.0.0-...-3c53fe9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2017 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GDAX_API_URL     = "https://api.gdax.com/"
	GDAX_API_VERISON = "0"
	GDAX_PRODUCTS    = "products"
	GDAX_ORDERBOOK   = "book"
	GDAX_TICKER      = "ticker"
	GDAX_TRADES      = "trades"
	GDAX_HISTORY     = "candles"
	GDAX_STATS       = "stats"
	GDAX_CURRENCIES  = "currencies"
	GDAX_ACCOUNTS    = "accounts"
	GDAX_LEDGER      = "ledger"
	GDAX_HOLDS       = "holds"
	GDAX_ORDERS      = "orders"
	GDAX_FILLS       = "fills"
	GDAX_TRANSFERS   = "transfers"
	GDAX_REPORTS     = "reports"
)
View Source
const (
	GDAX_WEBSOCKET_URL = "wss://ws-feed.gdax.com"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GDAX

type GDAX struct {
	exchange.ExchangeBase
}

func (*GDAX) CancelOrder

func (g *GDAX) CancelOrder(orderID string) error

func (*GDAX) GetAccount

func (g *GDAX) GetAccount(account string) (GDAXAccountResponse, error)

func (*GDAX) GetAccountHistory

func (g *GDAX) GetAccountHistory(accountID string) ([]GDAXAccountLedgerResponse, error)

func (*GDAX) GetAccounts

func (g *GDAX) GetAccounts() ([]GDAXAccountResponse, error)

func (*GDAX) GetCurrencies

func (g *GDAX) GetCurrencies() ([]GDAXCurrency, error)

func (*GDAX) GetExchangeAccountInfo

func (e *GDAX) GetExchangeAccountInfo() (exchange.ExchangeAccountInfo, error)

GetExchangeAccountInfo : Retrieves balances for all enabled currencies for the GDAX exchange

func (*GDAX) GetFee

func (g *GDAX) GetFee(maker bool) float64

func (*GDAX) GetFills

func (g *GDAX) GetFills(params url.Values) ([]GDAXFillResponse, error)

func (*GDAX) GetHistoricRates

func (g *GDAX) GetHistoricRates(symbol string, start, end, granularity int64) ([]GDAXHistory, error)

func (*GDAX) GetHolds

func (g *GDAX) GetHolds(accountID string) ([]GDAXAccountHolds, error)

func (*GDAX) GetOrder

func (g *GDAX) GetOrder(orderID string) (GDAXOrderResponse, error)

func (*GDAX) GetOrderbook

func (g *GDAX) GetOrderbook(symbol string, level int) (interface{}, error)

func (*GDAX) GetOrderbookEx

func (g *GDAX) GetOrderbookEx(p pair.CurrencyPair) (orderbook.OrderbookBase, error)

func (*GDAX) GetOrders

func (g *GDAX) GetOrders(params url.Values) ([]GDAXOrdersResponse, error)

func (*GDAX) GetProducts

func (g *GDAX) GetProducts() ([]GDAXProduct, error)

func (*GDAX) GetReport

func (g *GDAX) GetReport(reportType, startDate, endDate string) (GDAXReportResponse, error)

func (*GDAX) GetReportStatus

func (g *GDAX) GetReportStatus(reportID string) (GDAXReportResponse, error)

func (*GDAX) GetStats

func (g *GDAX) GetStats(symbol string) (GDAXStats, error)

func (*GDAX) GetTicker

func (g *GDAX) GetTicker(symbol string) (GDAXTicker, error)

func (*GDAX) GetTickerPrice

func (g *GDAX) GetTickerPrice(p pair.CurrencyPair) (ticker.TickerPrice, error)

func (*GDAX) GetTrades

func (g *GDAX) GetTrades(symbol string) ([]GDAXTrade, error)

func (*GDAX) PlaceOrder

func (g *GDAX) PlaceOrder(clientRef string, price, amount float64, side string, productID, stp string) (string, error)

func (*GDAX) Run

func (g *GDAX) Run()

func (*GDAX) SendAuthenticatedHTTPRequest

func (g *GDAX) SendAuthenticatedHTTPRequest(method, path string, params map[string]interface{}, result interface{}) (err error)

func (*GDAX) SetDefaults

func (g *GDAX) SetDefaults()

func (*GDAX) Setup

func (g *GDAX) Setup(exch config.ExchangeConfig)

func (*GDAX) Start

func (g *GDAX) Start()

func (*GDAX) Transfer

func (g *GDAX) Transfer(transferType string, amount float64, accountID string) error

func (*GDAX) WebsocketClient

func (g *GDAX) WebsocketClient()

func (*GDAX) WebsocketSubscribe

func (g *GDAX) WebsocketSubscribe(product string, conn *websocket.Conn) error

type GDAXAccountHolds

type GDAXAccountHolds struct {
	ID        string  `json:"id"`
	AccountID string  `json:"account_id"`
	CreatedAt string  `json:"created_at"`
	UpdatedAt string  `json:"updated_at"`
	Amount    float64 `json:"amount,string"`
	Type      string  `json:"type"`
	Reference string  `json:"ref"`
}

type GDAXAccountLedgerResponse

type GDAXAccountLedgerResponse struct {
	ID        string      `json:"id"`
	CreatedAt string      `json:"created_at"`
	Amount    float64     `json:"amount,string"`
	Balance   float64     `json:"balance,string"`
	Type      string      `json:"type"`
	Details   interface{} `json:"details"`
}

type GDAXAccountResponse

type GDAXAccountResponse struct {
	ID        string  `json:"id"`
	Balance   float64 `json:"balance,string"`
	Hold      float64 `json:"hold,string"`
	Available float64 `json:"available,string"`
	Currency  string  `json:"currency"`
}

type GDAXCurrency

type GDAXCurrency struct {
	ID      string
	Name    string
	MinSize float64 `json:"min_size,string"`
}

type GDAXFillResponse

type GDAXFillResponse struct {
	TradeID   int     `json:"trade_id"`
	ProductID string  `json:"product_id"`
	Price     float64 `json:"price,string"`
	Size      float64 `json:"size,string"`
	OrderID   string  `json:"order_id"`
	CreatedAt string  `json:"created_at"`
	Liquidity string  `json:"liquidity"`
	Fee       float64 `json:"fee,string"`
	Settled   bool    `json:"settled"`
	Side      string  `json:"side"`
}

type GDAXHistory

type GDAXHistory struct {
	Time   int64
	Low    float64
	High   float64
	Open   float64
	Close  float64
	Volume float64
}

type GDAXOrderL1L2

type GDAXOrderL1L2 struct {
	Price     float64
	Amount    float64
	NumOrders float64
}

type GDAXOrderL3

type GDAXOrderL3 struct {
	Price   float64
	Amount  float64
	OrderID string
}

type GDAXOrderResponse

type GDAXOrderResponse struct {
	ID         string  `json:"id"`
	Size       float64 `json:"size,string"`
	Price      float64 `json:"price,string"`
	DoneReason string  `json:"done_reason"`
	Status     string  `json:"status"`
	Settled    bool    `json:"settled"`
	FilledSize float64 `json:"filled_size,string"`
	ProductID  string  `json:"product_id"`
	FillFees   float64 `json:"fill_fees,string"`
	Side       string  `json:"side"`
	CreatedAt  string  `json:"created_at"`
	DoneAt     string  `json:"done_at"`
}

type GDAXOrderbookL1L2

type GDAXOrderbookL1L2 struct {
	Sequence int64           `json:"sequence"`
	Bids     []GDAXOrderL1L2 `json:"asks"`
	Asks     []GDAXOrderL1L2 `json:"asks"`
}

type GDAXOrderbookL3

type GDAXOrderbookL3 struct {
	Sequence int64         `json:"sequence"`
	Bids     []GDAXOrderL3 `json:"asks"`
	Asks     []GDAXOrderL3 `json:"asks"`
}

type GDAXOrderbookResponse

type GDAXOrderbookResponse struct {
	Sequence int64           `json:"sequence"`
	Bids     [][]interface{} `json:"bids"`
	Asks     [][]interface{} `json:"asks"`
}

type GDAXOrdersResponse

type GDAXOrdersResponse struct {
	ID         string  `json:"id"`
	Size       float64 `json:"size,string"`
	Price      float64 `json:"price,string"`
	ProductID  string  `json:"product_id"`
	Status     string  `json:"status"`
	FilledSize float64 `json:"filled_size,string"`
	FillFees   float64 `json:"fill_fees,string"`
	Settled    bool    `json:"settled"`
	Side       string  `json:"side"`
	CreatedAt  string  `json:"created_at"`
}

type GDAXProduct

type GDAXProduct struct {
	ID             string  `json:"id"`
	BaseCurrency   string  `json:"base_currency"`
	QuoteCurrency  string  `json:"quote_currency"`
	BaseMinSize    float64 `json:"base_min_size,string"`
	BaseMaxSize    int64   `json:"base_max_size,string"`
	QuoteIncrement float64 `json:"quote_increment,string"`
	DisplayName    string  `json:"string"`
}

type GDAXReportResponse

type GDAXReportResponse struct {
	ID          string `json:"id"`
	Type        string `json:"type"`
	Status      string `json:"status"`
	CreatedAt   string `json:"created_at"`
	CompletedAt string `json:"completed_at"`
	ExpiresAt   string `json:"expires_at"`
	FileURL     string `json:"file_url"`
	Params      struct {
		StartDate string `json:"start_date"`
		EndDate   string `json:"end_date"`
	} `json:"params"`
}

type GDAXStats

type GDAXStats struct {
	Open   float64 `json:"open,string"`
	High   float64 `json:"high,string"`
	Low    float64 `json:"low,string"`
	Volume float64 `json:"volume,string"`
}

type GDAXTicker

type GDAXTicker struct {
	TradeID int64   `json:"trade_id"`
	Price   float64 `json:"price,string"`
	Size    float64 `json:"size,string"`
	Time    string  `json:"time"`
}

type GDAXTrade

type GDAXTrade struct {
	TradeID int64   `json:"trade_id"`
	Price   float64 `json:"price,string"`
	Size    float64 `json:"size,string"`
	Time    string  `json:"time"`
	Side    string  `json:"side"`
}

type GDAXWebsocketChange

type GDAXWebsocketChange struct {
	Type     string  `json:"type"`
	Time     string  `json:"time"`
	Sequence int     `json:"sequence"`
	OrderID  string  `json:"order_id"`
	NewSize  float64 `json:"new_size,string"`
	OldSize  float64 `json:"old_size,string"`
	Price    float64 `json:"price,string"`
	Side     string  `json:"side"`
}

type GDAXWebsocketDone

type GDAXWebsocketDone struct {
	Type          string  `json:"type"`
	Time          string  `json:"time"`
	Sequence      int     `json:"sequence"`
	Price         float64 `json:"price,string"`
	OrderID       string  `json:"order_id"`
	Reason        string  `json:"reason"`
	Side          string  `json:"side"`
	RemainingSize float64 `json:"remaining_size,string"`
}

type GDAXWebsocketMatch

type GDAXWebsocketMatch struct {
	Type         string  `json:"type"`
	TradeID      int     `json:"trade_id"`
	Sequence     int     `json:"sequence"`
	MakerOrderID string  `json:"maker_order_id"`
	TakerOrderID string  `json:"taker_order_id"`
	Time         string  `json:"time"`
	Size         float64 `json:"size,string"`
	Price        float64 `json:"price,string"`
	Side         string  `json:"side"`
}

type GDAXWebsocketOpen

type GDAXWebsocketOpen struct {
	Type          string  `json:"type"`
	Time          string  `json:"time"`
	Sequence      int     `json:"sequence"`
	OrderID       string  `json:"order_id"`
	Price         float64 `json:"price,string"`
	RemainingSize float64 `json:"remaining_size,string"`
	Side          string  `json:"side"`
}

type GDAXWebsocketReceived

type GDAXWebsocketReceived struct {
	Type     string  `json:"type"`
	Time     string  `json:"time"`
	Sequence int     `json:"sequence"`
	OrderID  string  `json:"order_id"`
	Size     float64 `json:"size,string"`
	Price    float64 `json:"price,string"`
	Side     string  `json:"side"`
}

type GDAXWebsocketSubscribe

type GDAXWebsocketSubscribe struct {
	Type      string `json:"type"`
	ProductID string `json:"product_id"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL