Documentation ¶
Index ¶
- Constants
- type Balance
- type ChartData
- type Client
- func (c *Client) Balance(currency string) (Balance, error)
- func (c *Client) Balances() (map[string]Balance, error)
- func (c *Client) Buy(order OrderRequest) (OrderResult, error)
- func (c *Client) CancelOrder(orderNumber int) error
- func (c *Client) ChartData(market string, start, end time.Time, period period) ([]ChartData, error)
- func (c *Client) MoveOrder(req MoveOrderRequest) (MoveOrderResult, error)
- func (c *Client) OpenOrders() (map[string][]OpenOrder, error)
- func (c *Client) OpenOrdersFor(market string) ([]OpenOrder, error)
- func (c *Client) OrderBook(market string, depth int) (OrderBook, error)
- func (c *Client) OrderBooks(depth int) (map[string]OrderBook, error)
- func (c *Client) Sell(order OrderRequest) (OrderResult, error)
- func (c *Client) Ticker(market string) (Ticker, error)
- func (c *Client) Tickers() (map[string]Ticker, error)
- func (c *Client) TradeHistory(market string) ([]Trade, error)
- func (c *Client) TradeHistoryBetween(market string, start, end time.Time) ([]Trade, error)
- type MoveOrderRequest
- type MoveOrderResult
- type OpenOrder
- type Order
- type OrderBook
- type OrderRequest
- type OrderResult
- type PoloniexError
- type ResultingTrade
- type Ticker
- type Trade
Constants ¶
View Source
const ( Period5Minutes period = 300 Period15Minutes period = 900 Period30Minutes period = 1800 Period2Hours period = 7200 Period4Hours period = 14400 Period24Hours period = 86400 )
View Source
const ( TradeTypeBuy tradeType = "buy" TradeTypeSell tradeType = "sell" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChartData ¶
type ChartData struct { Date time.Time High float64 `json:"high"` Low float64 `json:"low"` Open float64 `json:"open"` Close float64 `json:"close"` Volume float64 `json:"volume"` QuoteVolume float64 `json:"quoteVolume"` WeightedAverage float64 `json:"weightedAverage"` }
func (*ChartData) UnmarshalJSON ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Balances ¶
Returns all of your balances, including available balance, balance on orders, and the estimated BTC value of your balance. This call is limited to your exchange account.
func (*Client) Buy ¶
func (c *Client) Buy(order OrderRequest) (OrderResult, error)
Places a limit buy order in a given market.
func (*Client) CancelOrder ¶
Cancels an order you have placed in a given market.
func (*Client) MoveOrder ¶
func (c *Client) MoveOrder(req MoveOrderRequest) (MoveOrderResult, error)
Cancels an order and places a new one of the same type in a single atomic transaction, meaning either both operations will succeed or both will fail.
func (*Client) OpenOrders ¶
Returns your open orders for all markets.
func (*Client) OpenOrdersFor ¶
Returns your open orders for a given market.
func (*Client) OrderBooks ¶
Returns the order book for all markets.
func (*Client) Sell ¶
func (c *Client) Sell(order OrderRequest) (OrderResult, error)
Places a sell order in a given market.
func (*Client) TradeHistory ¶
Returns the past 200 trades for a given market.
type MoveOrderRequest ¶
type MoveOrderRequest struct { OrderNumber int Rate float64 // You may optionally specify "amount" if you wish to change the amount of the new order. Amount float64 // An immediate-or-cancel order can be partially or completely filled, but any portion of the order that cannot be filled immediately will be canceled rather than left on the order book. May be specified for exchange orders, but will have no effect on margin orders. ImmediateOrCancel bool // A post-only order will only be placed if no portion of it fills immediately; this guarantees you will never pay the taker fee on any part of the order that fills. May be specified for exchange orders, but will have no effect on margin orders. PostOnly bool }
type MoveOrderResult ¶
type MoveOrderResult struct { OrderNumber int `json:"orderNumber,string"` ResultingTrades map[string][]ResultingTrade `json:"resultingTrades"` // contains filtered or unexported fields }
type Order ¶
func (*Order) UnmarshalJSON ¶
type OrderRequest ¶
type OrderRequest struct { Market string Rate float64 Amount float64 // A fill-or-kill order will either fill in its entirety or be completely aborted. FillOrKill bool // An immediate-or-cancel order can be partially or completely filled, but any portion of the order that cannot be filled immediately will be canceled rather than left on the order book. ImmediateOrCancel bool // A post-only order will only be placed if no portion of it fills immediately; this guarantees you will never pay the taker fee on any part of the order that fills. PostOnly bool }
type OrderResult ¶
type OrderResult struct { OrderNumber int `json:"orderNumber,string"` ResultingTrades []ResultingTrade }
type PoloniexError ¶
type PoloniexError struct {
Message string `json:"error"`
}
func (*PoloniexError) Error ¶
func (e *PoloniexError) Error() string
type ResultingTrade ¶
Click to show internal directories.
Click to hide internal directories.