Documentation ¶
Index ¶
- func CompareProperties(a, b interface{}, properties []string) (bool, error)
- func Ensure(a interface{}) error
- func EnsureProperties(a interface{}, properties []string) error
- func NewTestWebsocketClient() (*ws.Conn, error)
- func StructHasZeroValues(i interface{}) bool
- type Account
- type Book
- type BookEntry
- type CancelAllOrdersParams
- type Client
- func (c *Client) CancelAllOrders(p ...CancelAllOrdersParams) ([]string, error)
- func (c *Client) CancelOrder(id string) error
- func (c *Client) CreateDeposit(newDeposit *Deposit) (Deposit, error)
- func (c *Client) CreateOrder(newOrder *Order) (Order, error)
- func (c *Client) CreateReport(newReport *Report) (Report, error)
- func (c *Client) CreateTransfer(newTransfer *Transfer) (Transfer, error)
- func (c *Client) CreateWithdrawalCoinbase(newWithdrawalCoinbase *WithdrawalCoinbase) (WithdrawalCoinbase, error)
- func (c *Client) CreateWithdrawalCrypto(newWithdrawalCrypto *WithdrawalCrypto) (WithdrawalCrypto, error)
- func (c *Client) GetAccount(id string) (Account, error)
- func (c *Client) GetAccounts() ([]Account, error)
- func (c *Client) GetBook(product string, level int) (Book, error)
- func (c *Client) GetCurrencies() ([]Currency, error)
- func (c *Client) GetFees() (Fees, error)
- func (c *Client) GetHistoricRates(product string, p ...GetHistoricRatesParams) ([]HistoricRate, error)
- func (c *Client) GetOrder(id string) (Order, error)
- func (c *Client) GetPaymentMethods() ([]PaymentMethod, error)
- func (c *Client) GetProducts() ([]Product, error)
- func (c *Client) GetReportStatus(id string) (Report, error)
- func (c *Client) GetStats(product string) (Stats, error)
- func (c *Client) GetTicker(product string) (Ticker, error)
- func (c *Client) GetTime() (ServerTime, error)
- func (c *Client) Headers(method, url, timestamp, data string) (map[string]string, error)
- func (c *Client) ListAccountLedger(id string, p ...GetAccountLedgerParams) *Cursor
- func (c *Client) ListFills(p ListFillsParams) *Cursor
- func (c *Client) ListHolds(id string, p ...ListHoldsParams) *Cursor
- func (c *Client) ListOrders(p ...ListOrdersParams) *Cursor
- func (c *Client) ListTrades(product string, p ...ListTradesParams) *Cursor
- func (c *Client) Request(method string, url string, params, result interface{}) (res *http.Response, err error)
- func (c *Client) UpdateConfig(config *ClientConfig)
- type ClientConfig
- type CreateReportParams
- type Currency
- type Cursor
- type Deposit
- type Error
- type Fees
- type Fill
- type GetAccountLedgerParams
- type GetHistoricRatesParams
- type HistoricRate
- type Hold
- type LedgerDetails
- type LedgerEntry
- type ListFillsParams
- type ListHoldsParams
- type ListOrdersParams
- type ListTradesParams
- type Message
- type MessageChannel
- type Order
- type PaginationParams
- type PaymentMethod
- type Product
- type Report
- type ReportParams
- type ServerTime
- type SignedMessage
- type SnapshotChange
- type SnapshotEntry
- type Stats
- type StringNumber
- type Ticker
- type Time
- type Trade
- type Transfer
- type WithdrawalCoinbase
- type WithdrawalCrypto
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareProperties ¶
func EnsureProperties ¶
func NewTestWebsocketClient ¶
func StructHasZeroValues ¶
func StructHasZeroValues(i interface{}) bool
Types ¶
type BookEntry ¶
func (*BookEntry) UnmarshalJSON ¶
type CancelAllOrdersParams ¶
type CancelAllOrdersParams struct {
ProductID string
}
type Client ¶
type Client struct { BaseURL string Secret string Key string Passphrase string HTTPClient *http.Client RetryCount int }
func NewTestClient ¶
func NewTestClient() *Client
func (*Client) CancelAllOrders ¶
func (c *Client) CancelAllOrders(p ...CancelAllOrdersParams) ([]string, error)
func (*Client) CancelOrder ¶
func (*Client) CreateTransfer ¶
func (*Client) CreateWithdrawalCoinbase ¶
func (c *Client) CreateWithdrawalCoinbase(newWithdrawalCoinbase *WithdrawalCoinbase) (WithdrawalCoinbase, error)
func (*Client) CreateWithdrawalCrypto ¶
func (c *Client) CreateWithdrawalCrypto(newWithdrawalCrypto *WithdrawalCrypto) (WithdrawalCrypto, error)
func (*Client) GetCurrencies ¶
func (*Client) GetHistoricRates ¶
func (c *Client) GetHistoricRates(product string, p ...GetHistoricRatesParams) ([]HistoricRate, error)
func (*Client) GetPaymentMethods ¶
func (c *Client) GetPaymentMethods() ([]PaymentMethod, error)
func (*Client) GetProducts ¶
func (*Client) GetTime ¶
func (c *Client) GetTime() (ServerTime, error)
func (*Client) Headers ¶
Headers generates a map that can be used as headers to authenticate a request
func (*Client) ListAccountLedger ¶
func (c *Client) ListAccountLedger(id string, p ...GetAccountLedgerParams) *Cursor
func (*Client) ListFills ¶
func (c *Client) ListFills(p ListFillsParams) *Cursor
func (*Client) ListOrders ¶
func (c *Client) ListOrders(p ...ListOrdersParams) *Cursor
func (*Client) ListTrades ¶
func (c *Client) ListTrades(product string, p ...ListTradesParams) *Cursor
func (*Client) UpdateConfig ¶
func (c *Client) UpdateConfig(config *ClientConfig)
type ClientConfig ¶
type Cursor ¶
type Cursor struct { Client *Client Pagination *PaginationParams Method string Params interface{} URL string HasMore bool }
type Deposit ¶
type Deposit struct { Currency string `json:"currency"` Amount string `json:"amount"` PaymentMethodID string `json:"payment_method_id"` // PaymentMethodID can be determined by calling GetPaymentMethods() // Response fields ID string `json:"id,omitempty"` PayoutAt Time `json:"payout_at,string,omitempty"` }
type Fill ¶
type Fill struct { TradeID int `json:"trade_id,int"` ProductID string `json:"product_id"` Price string `json:"price"` Size string `json:"size"` FillID string `json:"order_id"` CreatedAt Time `json:"created_at,string"` Fee string `json:"fee"` Settled bool `json:"settled"` Side string `json:"side"` Liquidity string `json:"liquidity"` }
type GetAccountLedgerParams ¶
type GetAccountLedgerParams struct {
Pagination PaginationParams
}
type GetHistoricRatesParams ¶
type HistoricRate ¶
type HistoricRate struct { Time time.Time Low float64 High float64 Open float64 Close float64 Volume float64 }
func (*HistoricRate) UnmarshalJSON ¶
func (e *HistoricRate) UnmarshalJSON(data []byte) error
type LedgerDetails ¶
type LedgerEntry ¶
type ListFillsParams ¶
type ListFillsParams struct { OrderID string ProductID string Pagination PaginationParams }
type ListHoldsParams ¶
type ListHoldsParams struct {
Pagination PaginationParams
}
type ListOrdersParams ¶
type ListOrdersParams struct { Status string ProductID string Pagination PaginationParams }
type ListTradesParams ¶
type ListTradesParams struct {
Pagination PaginationParams
}
type Message ¶
type Message struct { Type string `json:"type"` ProductID string `json:"product_id"` ProductIds []string `json:"product_ids"` TradeID int `json:"trade_id,number"` OrderID string `json:"order_id"` ClientOID string `json:"client_oid"` Sequence int64 `json:"sequence,number"` MakerOrderID string `json:"maker_order_id"` TakerOrderID string `json:"taker_order_id"` Time Time `json:"time,string"` RemainingSize string `json:"remaining_size"` NewSize string `json:"new_size"` OldSize string `json:"old_size"` Size string `json:"size"` Price string `json:"price"` Side string `json:"side"` Reason string `json:"reason"` OrderType string `json:"order_type"` Funds string `json:"funds"` NewFunds string `json:"new_funds"` OldFunds string `json:"old_funds"` Message string `json:"message"` Bids []SnapshotEntry `json:"bids,omitempty"` Asks []SnapshotEntry `json:"asks,omitempty"` Changes []SnapshotChange `json:"changes,omitempty"` LastSize string `json:"last_size"` BestBid string `json:"best_bid"` BestAsk string `json:"best_ask"` Channels []MessageChannel `json:"channels"` UserID string `json:"user_id"` ProfileID string `json:"profile_id"` LastTradeID int `json:"last_trade_id"` }
type MessageChannel ¶
type Order ¶
type Order struct { Type string `json:"type"` Size string `json:"size,omitempty"` Side string `json:"side"` ProductID string `json:"product_id"` ClientOID string `json:"client_oid,omitempty"` Stp string `json:"stp,omitempty"` Stop string `json:"stop,omitempty"` StopPrice string `json:"stop_price,omitempty"` // Limit Order Price string `json:"price,omitempty"` TimeInForce string `json:"time_in_force,omitempty"` PostOnly bool `json:"post_only,omitempty"` CancelAfter string `json:"cancel_after,omitempty"` // Market Order Funds string `json:"funds,omitempty"` SpecifiedFunds string `json:"specified_funds,omitempty"` // Response Fields ID string `json:"id"` Status string `json:"status,omitempty"` Settled bool `json:"settled,omitempty"` DoneReason string `json:"done_reason,omitempty"` DoneAt Time `json:"done_at,string,omitempty"` CreatedAt Time `json:"created_at,string,omitempty"` FillFees string `json:"fill_fees,omitempty"` FilledSize string `json:"filled_size,omitempty"` ExecutedValue string `json:"executed_value,omitempty"` }
type PaginationParams ¶
func (*PaginationParams) AddExtraParam ¶
func (p *PaginationParams) AddExtraParam(key, value string)
func (*PaginationParams) Done ¶
func (p *PaginationParams) Done(direction string) bool
func (*PaginationParams) Encode ¶
func (p *PaginationParams) Encode(direction string) string
type PaymentMethod ¶
type Product ¶
type Product struct { ID string `json:"id"` BaseCurrency string `json:"base_currency"` QuoteCurrency string `json:"quote_currency"` BaseMinSize string `json:"base_min_size"` BaseMaxSize string `json:"base_max_size"` QuoteIncrement string `json:"quote_increment"` BaseIncrement string `json:"base_increment"` DisplayName string `json:"display_name"` MinMarketFunds string `json:"min_market_funds"` MaxMarketFunds string `json:"max_market_funds"` MarginEnabled bool `json:"margin_enabled"` PostOnly bool `json:"post_only"` LimitOnly bool `json:"limit_only"` CancelOnly bool `json:"cancel_only"` Status string `json:"status"` StatusMessage string `json:"status_message"` }
type Report ¶
type Report struct { ID string `json:"id"` Type string `json:"type"` Status string `json:"status"` CreatedAt Time `json:"created_at,string"` CompletedAt Time `json:"completed_at,string,"` ExpiresAt Time `json:"expires_at,string"` FileURL string `json:"file_url"` Params ReportParams `json:"params"` StartDate time.Time EndDate time.Time }
type ServerTime ¶
type SignedMessage ¶
type SnapshotChange ¶
func (*SnapshotChange) UnmarshalJSON ¶
func (e *SnapshotChange) UnmarshalJSON(data []byte) error
type SnapshotEntry ¶
func (*SnapshotEntry) UnmarshalJSON ¶
func (e *SnapshotEntry) UnmarshalJSON(data []byte) error
type StringNumber ¶
type StringNumber string
func (*StringNumber) UnmarshalJSON ¶
func (s *StringNumber) UnmarshalJSON(data []byte) error
type Time ¶
func (Time) MarshalJSON ¶
MarshalJSON marshal time back to time.Time for json encoding
func (*Time) UnmarshalJSON ¶
type WithdrawalCoinbase ¶
type WithdrawalCrypto ¶
Click to show internal directories.
Click to hide internal directories.