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) CreateOrder(newOrder *Order) (Order, error)
- func (c *Client) CreateReport(newReport *Report) (Report, error)
- func (c *Client) CreateTransfer(newTransfer *Transfer) (Transfer, 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) GetHistoricRates(product string, p ...GetHistoricRatesParams) ([]HistoricRate, error)
- func (c *Client) GetOrder(id string) (Order, 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)
- type CreateReportParams
- type Currency
- type Cursor
- type Error
- 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 Product
- type Report
- type ReportParams
- type ServerTime
- type SignedMessage
- type SnapshotChange
- type SnapshotEntry
- type Stats
- type Ticker
- type Time
- type Trade
- type Transfer
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) GetCurrencies ¶
func (*Client) GetHistoricRates ¶
func (c *Client) GetHistoricRates(product string, p ...GetHistoricRatesParams) ([]HistoricRate, 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
type Cursor ¶
type Cursor struct {
Client *Client
Pagination *PaginationParams
Method string
Params interface{}
URL string
HasMore bool
}
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"`
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"`
// 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"`
// Response Fields
Id string `json:"id"`
Status string `json:"status,omitempty"`
Settled bool `json:"settled,omitempty"`
DoneReason string `json:"done_reason,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 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 Time ¶
func (Time) MarshalJSON ¶
MarshalJSON marshal time back to time.Time for json encoding
func (*Time) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.