Documentation
¶
Index ¶
- func CompareProperties(a, b interface{}, properties []string) (bool, error)
- func StructHasZeroValues(i interface{}) bool
- type Account
- type Book
- type BookEntry
- type Client
- 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) 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 Order
- type PaginationParams
- type Product
- type Report
- type ReportParams
- type ServerTime
- type Stats
- type Ticker
- type Time
- type Trade
- type Transfer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareProperties ¶
func StructHasZeroValues ¶
func StructHasZeroValues(i interface{}) bool
Types ¶
type BookEntry ¶
func (*BookEntry) UnmarshalJSON ¶
type Client ¶
func NewTestClient ¶
func NewTestClient() *Client
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) 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 float64 `json:"price,string"`
Size float64 `json:"size,string"`
FillId string `json:"order_id"`
CreatedAt Time `json:"created_at,string"`
Fee float64 `json:"fee,string"`
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
Pagination PaginationParams
}
type ListTradesParams ¶
type ListTradesParams struct {
Pagination PaginationParams
}
type Message ¶
type Message struct {
Type string `json:"type"`
ProductId string `json:"product_id"`
TradeId int `json:"trade_id,number"`
OrderId string `json:"order_id"`
Sequence int `json:"sequence,number"`
MakerOrderId string `json:"maker_order_id"`
TakerOrderId string `json:"taker_order_id"`
Time Time `json:"time,string"`
RemainingSize float64 `json:"remaining_size,string"`
NewSize float64 `json:"new_size,string"`
OldSize float64 `json:"old_size,string"`
Size float64 `json:"size,string"`
Price float64 `json:"price,string"`
Side string `json:"side"`
Reason string `json:"reason"`
OrderType string `json:"order_type"`
Funds float64 `json:"funds,string"`
NewFunds float64 `json:"new_funds,string"`
OldFunds float64 `json:"old_funds,string"`
Message string `json:"message"`
}
type Order ¶
type Order struct {
Type string `json:"type"`
Size float64 `json:"size,string,omitempty"`
Side string `json:"side"`
ProductId string `json:"product_id"`
ClientOID string `json:"client_oid,omitempty"`
Stp string `json:"stp,omitempty"`
// Limit Order
Price float64 `json:"price,string,omitempty"`
TimeInForce string `json:"time_in_force,omitempty"`
PostOnly bool `json:"post_only,omitempty"`
CancelAfter string `json:"cancel_after,omitempty"`
// Market Order
Funds float64 `json:"funds,string,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 float64 `json:"fill_fees,string,omitempty"`
FilledSize float64 `json:"filled_size,string,omitempty"`
ExecutedValue float64 `json:"executed_value,string,omitempty"`
}
type PaginationParams ¶
func (*PaginationParams) AddExtraParam ¶
func (p *PaginationParams) AddExtraParam(key, value string)
func (*PaginationParams) Done ¶
func (p *PaginationParams) Done() 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 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.