gdax

package
v0.0.0-...-e477184 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GDAX_WEBSOCKET_URL = "wss://ws-feed.gdax.com"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID            string  `json:"id"`
	Balance       float64 `json:"balance,string"`
	Hold          float64 `json:"hold,string"`
	FundedAmount  float64 `json:"funded_amount,string"`
	DefaultAmount float64 `json:"default_amount,string"`
}

Account is a sub-type for account overview

type AccountHolds

type AccountHolds 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"`
}

AccountHolds contains the hold information about an account

type AccountLedgerResponse

type AccountLedgerResponse 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"`
}

AccountLedgerResponse holds account history information

type AccountOverview

type AccountOverview struct {
	Status  string `json:"status"`
	Funding struct {
		MaxFundingValue   float64 `json:"max_funding_value,string"`
		FundingValue      float64 `json:"funding_value,string"`
		OldestOutstanding struct {
			ID        string  `json:"id"`
			OrderID   string  `json:"order_id"`
			CreatedAt string  `json:"created_at"`
			Currency  string  `json:"currency"`
			AccountID string  `json:"account_id"`
			Amount    float64 `json:"amount,string"`
		} `json:"oldest_outstanding"`
	} `json:"funding"`
	Accounts struct {
		LTC Account `json:"LTC"`
		ETH Account `json:"ETH"`
		USD Account `json:"USD"`
		BTC Account `json:"BTC"`
	} `json:"accounts"`
	MarginCall struct {
		Active bool    `json:"active"`
		Price  float64 `json:"price,string"`
		Side   string  `json:"side"`
		Size   float64 `json:"size,string"`
		Funds  float64 `json:"funds,string"`
	} `json:"margin_call"`
	UserID    string `json:"user_id"`
	ProfileID string `json:"profile_id"`
	Position  struct {
		Type       string  `json:"type"`
		Size       float64 `json:"size,string"`
		Complement float64 `json:"complement,string"`
		MaxSize    float64 `json:"max_size,string"`
	} `json:"position"`
	ProductID string `json:"product_id"`
}

AccountOverview holds account information returned from position

type AccountResponse

type AccountResponse struct {
	ID            string  `json:"id"`
	Currency      string  `json:"currency"`
	Balance       float64 `json:"balance,string"`
	Available     float64 `json:"available,string"`
	Hold          float64 `json:"hold,string"`
	ProfileID     string  `json:"profile_id"`
	MarginEnabled bool    `json:"margin_enabled"`
	FundedAmount  float64 `json:"funded_amount,string"`
	DefaultAmount float64 `json:"default_amount,string"`
}

AccountResponse holds the details for the trading accounts

type CoinbaseAccounts

type CoinbaseAccounts struct {
	ID                     string  `json:"id"`
	Name                   string  `json:"name"`
	Balance                float64 `json:"balance,string"`
	Currency               string  `json:"currency"`
	Type                   string  `json:"type"`
	Primary                bool    `json:"primary"`
	Active                 bool    `json:"active"`
	WireDepositInformation struct {
		AccountNumber string `json:"account_number"`
		RoutingNumber string `json:"routing_number"`
		BankName      string `json:"bank_name"`
		BankAddress   string `json:"bank_address"`
		BankCountry   struct {
			Code string `json:"code"`
			Name string `json:"name"`
		} `json:"bank_country"`
		AccountName    string `json:"account_name"`
		AccountAddress string `json:"account_address"`
		Reference      string `json:"reference"`
	} `json:"wire_deposit_information"`
	SepaDepositInformation struct {
		Iban            string `json:"iban"`
		Swift           string `json:"swift"`
		BankName        string `json:"bank_name"`
		BankAddress     string `json:"bank_address"`
		BankCountryName string `json:"bank_country_name"`
		AccountName     string `json:"account_name"`
		AccountAddress  string `json:"account_address"`
		Reference       string `json:"reference"`
	} `json:"sep_deposit_information"`
}

CoinbaseAccounts holds coinbase account information

type Currency

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

Currency holds singular currency product information

type DepositWithdrawalInfo

type DepositWithdrawalInfo struct {
	ID       string  `json:"id"`
	Amount   float64 `json:"amount,string"`
	Currency string  `json:"currency"`
	PayoutAt string  `json:"payout_at"`
}

DepositWithdrawalInfo holds returned deposit information

type FillResponse

type FillResponse 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"`
}

FillResponse contains fill information from the exchange

type Funding

type Funding struct {
	ID            string  `json:"id"`
	OrderID       string  `json:"order_id"`
	ProfileID     string  `json:"profile_id"`
	Amount        float64 `json:"amount,string"`
	Status        string  `json:"status"`
	CreatedAt     string  `json:"created_at"`
	Currency      string  `json:"currency"`
	RepaidAmount  float64 `json:"repaid_amount"`
	DefaultAmount float64 `json:"default_amount,string"`
	RepaidDefault bool    `json:"repaid_default"`
}

Funding holds funding data

type GDAX

type GDAX struct {
	exchange.Base
}

GDAX is the overarching type across the GDAX package

func (*GDAX) CancelAllOrders

func (g *GDAX) CancelAllOrders(currencyPair string) ([]string, error)

CancelAllOrders cancels all open orders on the exchange and returns and array of order IDs currencyPair - [optional] all orders for a currencyPair string will be canceled

func (*GDAX) CancelOrder

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

CancelOrder cancels order by orderID

func (*GDAX) ClosePosition

func (g *GDAX) ClosePosition(repayOnly bool) (AccountOverview, error)

ClosePosition closes a position and allowing you to repay position as well repayOnly - allows the position to be repaid

func (*GDAX) DepositViaCoinbase

func (g *GDAX) DepositViaCoinbase(amount float64, currency, accountID string) (DepositWithdrawalInfo, error)

DepositViaCoinbase deposits funds from a coinbase account. Move funds between a Coinbase account and GDAX trading account within daily limits. Moving funds between Coinbase and GDAX is instant and free. See the Coinbase Accounts section for retrieving your Coinbase accounts.

amount - The amount to deposit currency - The type of currency accountID - ID of the coinbase account

func (*GDAX) DepositViaPaymentMethod

func (g *GDAX) DepositViaPaymentMethod(amount float64, currency, paymentID string) (DepositWithdrawalInfo, error)

DepositViaPaymentMethod deposits funds from a payment method. See the Payment Methods section for retrieving your payment methods.

amount - The amount to deposit currency - The type of currency paymentID - ID of the payment method

func (*GDAX) GetAccount

func (g *GDAX) GetAccount(accountID string) (AccountResponse, error)

GetAccount returns information for a single account. Use this endpoint when account_id is known

func (*GDAX) GetAccountHistory

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

GetAccountHistory returns a list of account activity. Account activity either increases or decreases your account balance. Items are paginated and sorted latest first.

func (*GDAX) GetAccounts

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

GetAccounts returns a list of trading accounts associated with the APIKEYS

func (*GDAX) GetCoinbaseAccounts

func (g *GDAX) GetCoinbaseAccounts() ([]CoinbaseAccounts, error)

GetCoinbaseAccounts returns a list of coinbase accounts

func (*GDAX) GetCurrencies

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

GetCurrencies returns a list of supported currency on the exchange Warning: Not all currencies may be currently in use for trading.

func (*GDAX) GetExchangeAccountInfo

func (g *GDAX) GetExchangeAccountInfo() (exchange.AccountInfo, error)

GetExchangeAccountInfo retrieves balances for all enabled currencies for the GDAX exchange

func (*GDAX) GetFee

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

GetFee returns the current fee for the exchange

func (*GDAX) GetFills

func (g *GDAX) GetFills(orderID, currencyPair string) ([]FillResponse, error)

GetFills returns a list of recent fills

func (*GDAX) GetFundingRecords

func (g *GDAX) GetFundingRecords(status string) ([]Funding, error)

GetFundingRecords every order placed with a margin profile that draws funding will create a funding record.

status - "outstanding", "settled", or "rejected"

func (*GDAX) GetHistoricRates

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

GetHistoricRates returns historic rates for a product. Rates are returned in grouped buckets based on requested granularity.

func (*GDAX) GetHolds

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

GetHolds returns the holds that are placed on an account for any active orders or pending withdraw requests. As an order is filled, the hold amount is updated. If an order is canceled, any remaining hold is removed. For a withdraw, once it is completed, the hold is removed.

func (*GDAX) GetOrder

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

GetOrder returns a single order by order id.

func (*GDAX) GetOrderbook

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

GetOrderbook returns orderbook by currency pair and level

func (*GDAX) GetOrderbookEx

func (g *GDAX) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error)

GetOrderbookEx returns orderbook base on the currency pair

func (*GDAX) GetOrders

func (g *GDAX) GetOrders(status []string, currencyPair string) ([]GeneralizedOrderResponse, error)

GetOrders lists current open orders. Only open or un-settled orders are returned. As soon as an order is no longer open and settled, it will no longer appear in the default request. status - can be a range of "open", "pending", "done" or "active" currencyPair - [optional] for example "BTC-USD"

func (*GDAX) GetPayMethods

func (g *GDAX) GetPayMethods() ([]PaymentMethod, error)

GetPayMethods returns a full list of payment methods

func (*GDAX) GetPosition

func (g *GDAX) GetPosition() (AccountOverview, error)

GetPosition returns an overview of account profile.

func (*GDAX) GetProducts

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

GetProducts returns supported currency pairs on the exchange with specific information about the pair

func (*GDAX) GetReport

func (g *GDAX) GetReport(reportType, startDate, endDate, currencyPair, accountID, format, email string) (Report, error)

GetReport returns batches of historic information about your account in various human and machine readable forms.

reportType - "fills" or "account" startDate - Starting date for the report (inclusive) endDate - Ending date for the report (inclusive) currencyPair - ID of the product to generate a fills report for. E.g. BTC-USD. *Required* if type is fills accountID - ID of the account to generate an account report for. *Required* if type is account format - pdf or csv (default is pdf) email - [optional] Email address to send the report to

func (*GDAX) GetReportStatus

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

GetReportStatus once a report request has been accepted for processing, the status is available by polling the report resource endpoint.

func (*GDAX) GetServerTime

func (g *GDAX) GetServerTime() (ServerTime, error)

GetServerTime returns the API server time

func (*GDAX) GetStats

func (g *GDAX) GetStats(currencyPair string) (Stats, error)

GetStats returns a 24 hr stat for the product. Volume is in base currency units. open, high, low are in quote currency units.

func (*GDAX) GetTicker

func (g *GDAX) GetTicker(currencyPair string) (Ticker, error)

GetTicker returns ticker by currency pair currencyPair - example "BTC-USD"

func (*GDAX) GetTickerPrice

func (g *GDAX) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Price, error)

GetTickerPrice returns the ticker for a currency pair

func (*GDAX) GetTrades

func (g *GDAX) GetTrades(currencyPair string) ([]Trade, error)

GetTrades listd the latest trades for a product currencyPair - example "BTC-USD"

func (*GDAX) GetTrailingVolume

func (g *GDAX) GetTrailingVolume() ([]Volume, error)

GetTrailingVolume this request will return your 30-day trailing volume for all products.

func (*GDAX) MarginTransfer

func (g *GDAX) MarginTransfer(amount float64, transferType, profileID, currency string) (MarginTransfer, error)

MarginTransfer sends funds between a standard/default profile and a margin profile. A deposit will transfer funds from the default profile into the margin profile. A withdraw will transfer funds from the margin profile to the default profile. Withdraws will fail if they would set your margin ratio below the initial margin ratio requirement.

amount - the amount to transfer between the default and margin profile transferType - either "deposit" or "withdraw" profileID - The id of the margin profile to deposit or withdraw from currency - currency to transfer, currently on "BTC" or "USD"

func (*GDAX) NewOrder

func (g *GDAX) NewOrder(symbol string, amount, price float64, side, orderType string) (int64, error)

func (*GDAX) PlaceLimitOrder

func (g *GDAX) PlaceLimitOrder(clientRef string, price, amount float64, side, timeInforce, cancelAfter, productID, stp string, postOnly bool) (string, error)

PlaceLimitOrder places a new limit order. Orders can only be placed if the account has sufficient funds. Once an order is placed, account funds will be put on hold for the duration of the order. How much and which funds are put on hold depends on the order type and parameters specified.

GENERAL PARAMS clientRef - [optional] Order ID selected by you to identify your order side - buy or sell productID - A valid product id stp - [optional] Self-trade prevention flag

LIMIT ORDER PARAMS price - Price per bitcoin amount - Amount of BTC to buy or sell timeInforce - [optional] GTC, GTT, IOC, or FOK (default is GTC) cancelAfter - [optional] min, hour, day * Requires time_in_force to be GTT postOnly - [optional] Post only flag Invalid when time_in_force is IOC or FOK

func (*GDAX) PlaceMarginOrder

func (g *GDAX) PlaceMarginOrder(clientRef string, size, funds float64, side string, productID, stp string) (string, error)

PlaceMarginOrder places a new market order. Orders can only be placed if the account has sufficient funds. Once an order is placed, account funds will be put on hold for the duration of the order. How much and which funds are put on hold depends on the order type and parameters specified.

GENERAL PARAMS clientRef - [optional] Order ID selected by you to identify your order side - buy or sell productID - A valid product id stp - [optional] Self-trade prevention flag

MARGIN ORDER PARAMS size - [optional]* Desired amount in BTC funds - [optional]* Desired amount of quote currency to use

func (*GDAX) PlaceMarketOrder

func (g *GDAX) PlaceMarketOrder(clientRef string, size, funds float64, side string, productID, stp string) (string, error)

PlaceMarketOrder places a new market order. Orders can only be placed if the account has sufficient funds. Once an order is placed, account funds will be put on hold for the duration of the order. How much and which funds are put on hold depends on the order type and parameters specified.

GENERAL PARAMS clientRef - [optional] Order ID selected by you to identify your order side - buy or sell productID - A valid product id stp - [optional] Self-trade prevention flag

MARKET ORDER PARAMS size - [optional]* Desired amount in BTC funds [optional]* Desired amount of quote currency to use * One of size or funds is required.

func (*GDAX) Run

func (g *GDAX) Run()

Run implements the GDAX wrapper

func (*GDAX) SendAuthenticatedHTTPRequest

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

SendAuthenticatedHTTPRequest sends an authenticated HTTP reque

func (*GDAX) SetDefaults

func (g *GDAX) SetDefaults()

SetDefaults sets default values for the exchange

func (*GDAX) Setup

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

Setup initialises the exchange parameters with the current configuration

func (*GDAX) Start

func (g *GDAX) Start()

Start starts the GDAX go routine

func (*GDAX) UpdateOrderbook

func (g *GDAX) UpdateOrderbook(p pair.CurrencyPair, assetType string) (orderbook.Base, error)

UpdateOrderbook updates and returns the orderbook for a currency pair

func (*GDAX) UpdateTicker

func (g *GDAX) UpdateTicker(p pair.CurrencyPair, assetType string) (ticker.Price, error)

UpdateTicker updates and returns the ticker for a currency pair

func (*GDAX) WebsocketClient

func (g *GDAX) WebsocketClient()

func (*GDAX) WebsocketSubscribe

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

func (*GDAX) WithdrawCrypto

func (g *GDAX) WithdrawCrypto(amount float64, currency, cryptoAddress string) (DepositWithdrawalInfo, error)

WithdrawCrypto withdraws funds to a crypto address

amount - The amount to withdraw currency - The type of currency cryptoAddress - A crypto address of the recipient

func (*GDAX) WithdrawViaPaymentMethod

func (g *GDAX) WithdrawViaPaymentMethod(amount float64, currency, paymentID string) (DepositWithdrawalInfo, error)

WithdrawViaPaymentMethod withdraws funds to a payment method

amount - The amount to withdraw currency - The type of currency paymentID - ID of the payment method

type GeneralizedOrderResponse

type GeneralizedOrderResponse struct {
	ID             string  `json:"id"`
	Price          float64 `json:"price,string"`
	Size           float64 `json:"size,string"`
	ProductID      string  `json:"product_id"`
	Side           string  `json:"side"`
	Stp            string  `json:"stp"`
	Type           string  `json:"type"`
	TimeInForce    string  `json:"time_in_force"`
	PostOnly       bool    `json:"post_only"`
	CreatedAt      string  `json:"created_at"`
	FillFees       float64 `json:"fill_fees,string"`
	FilledSize     float64 `json:"filled_size,string"`
	ExecutedValue  float64 `json:"executed_value,string"`
	Status         string  `json:"status"`
	Settled        bool    `json:"settled"`
	Funds          float64 `json:"funds,string"`
	SpecifiedFunds float64 `json:"specified_funds,string"`
	DoneReason     string  `json:"done_reason"`
	DoneAt         string  `json:"done_at"`
}

GeneralizedOrderResponse is the generalized return type across order placement and information collation

type History

type History struct {
	Time   int64   `json:"time"`
	Low    float64 `json:"low"`
	High   float64 `json:"high"`
	Open   float64 `json:"open"`
	Close  float64 `json:"close"`
	Volume float64 `json:"volume"`
}

History holds historic rate information

type LimitInfo

type LimitInfo struct {
	PeriodInDays int `json:"period_in_days"`
	Total        struct {
		Amount   float64 `json:"amount,string"`
		Currency string  `json:"currency"`
	} `json:"total"`
}

LimitInfo is a sub-type for payment method

type MarginTransfer

type MarginTransfer struct {
	CreatedAt       string  `json:"created_at"`
	ID              string  `json:"id"`
	UserID          string  `json:"user_id"`
	ProfileID       string  `json:"profile_id"`
	MarginProfileID string  `json:"margin_profile_id"`
	Type            string  `json:"type"`
	Amount          float64 `json:"amount,string"`
	Currency        string  `json:"currency"`
	AccountID       string  `json:"account_id"`
	MarginAccountID string  `json:"margin_account_id"`
	MarginProductID string  `json:"margin_product_id"`
	Status          string  `json:"status"`
	Nonce           int     `json:"nonce"`
}

MarginTransfer holds margin transfer details

type OrderL1L2

type OrderL1L2 struct {
	Price     float64
	Amount    float64
	NumOrders float64
}

OrderL1L2 is a type used in layer conversion

type OrderL3

type OrderL3 struct {
	Price   float64
	Amount  float64
	OrderID string
}

OrderL3 is a type used in layer conversion

type OrderbookL1L2

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

OrderbookL1L2 holds level 1 and 2 order book information

type OrderbookL3

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

OrderbookL3 holds level 3 order book information

type OrderbookResponse

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

OrderbookResponse is a generalized response for order books

type PaymentMethod

type PaymentMethod struct {
	ID            string `json:"id"`
	Type          string `json:"type"`
	Name          string `json:"name"`
	Currency      string `json:"currency"`
	PrimaryBuy    bool   `json:"primary_buy"`
	PrimarySell   bool   `json:"primary_sell"`
	AllowBuy      bool   `json:"allow_buy"`
	AllowSell     bool   `json:"allow_sell"`
	AllowDeposits bool   `json:"allow_deposits"`
	AllowWithdraw bool   `json:"allow_withdraw"`
	Limits        struct {
		Buy        []LimitInfo `json:"buy"`
		InstantBuy []LimitInfo `json:"instant_buy"`
		Sell       []LimitInfo `json:"sell"`
		Deposit    []LimitInfo `json:"deposit"`
	} `json:"limits"`
}

PaymentMethod holds payment method information

type Product

type Product 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"`
}

Product holds product information

type Report

type Report 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"`
}

Report holds historical information

type ServerTime

type ServerTime struct {
	ISO   string  `json:"iso"`
	Epoch float64 `json:"epoch"`
}

ServerTime holds current requested server time information

type Stats

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

Stats holds last 24 hr data for gdax

type Ticker

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

Ticker holds basic ticker information

type Trade

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

Trade holds executed trade information

type Volume

type Volume struct {
	ProductID      string  `json:"product_id"`
	ExchangeVolume float64 `json:"exchange_volume,string"`
	Volume         float64 `json:"volume,string"`
	RecordedAt     string  `json:"recorded_at"`
}

Volume type contains trailing volume information

type WebsocketChange

type WebsocketChange 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"`
}

WebsocketChange holds change information

type WebsocketDone

type WebsocketDone 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"`
}

WebsocketDone holds finished order information

type WebsocketMatch

type WebsocketMatch 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"`
}

WebsocketMatch holds match information

type WebsocketOpen

type WebsocketOpen 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"`
}

WebsocketOpen collates open orders

type WebsocketReceived

type WebsocketReceived 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"`
}

WebsocketReceived holds websocket received values

type WebsocketSubscribe

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

WebsocketSubscribe takes in subscription information

Jump to

Keyboard shortcuts

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