Documentation ¶
Overview ¶
Package Poloniex is an implementation of the Poloniex API in Golang.
Index ¶
- Constants
- func NewClient(apiKey, apiSecret string) (c *client)
- type Balance
- type CandleStick
- type Currencies
- type Currency
- type OrderBook
- type Poloniex
- func (b *Poloniex) ChartData(currencyPair string, period int, start, end time.Time) (candles []*CandleStick, err error)
- func (b *Poloniex) GetBalance() (balance []Balance, err error)
- func (b *Poloniex) GetCurrencies() (currencies Currencies, err error)
- func (b *Poloniex) GetOrderBook(market, cat string, depth int) (orderBook OrderBook, err error)
- func (b *Poloniex) GetTickers() (tickers map[string]Ticker, err error)
- func (b *Poloniex) GetVolumes() (vc VolumeCollection, err error)
- func (b *Poloniex) MarketHistory(currencyPair string, start, end time.Time) (trades []Trade, err error)
- type PoloniexDate
- type Ticker
- type Tickers
- type Trade
- type Volume
- type VolumeCollection
Constants ¶
const ( API_BASE = "https://poloniex.com/" // Poloniex API endpoint DEFAULT_HTTPCLIENT_TIMEOUT = 30 // HTTP client timeout )
const TIME_FORMAT = "2006-01-02T15:04:05"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CandleStick ¶
type Currencies ¶
type Poloniex ¶
type Poloniex struct {
// contains filtered or unexported fields
}
poloniex represent a poloniex client
func (*Poloniex) ChartData ¶
func (b *Poloniex) ChartData(currencyPair string, period int, start, end time.Time) (candles []*CandleStick, err error)
Returns candlestick chart data. Required GET parameters are "currencyPair", "period" (candlestick period in seconds; valid values are 300, 900, 1800, 7200, 14400, and 86400), "start", and "end". "Start" and "end" are given in UNIX timestamp format and used to specify the date range for the data returned.
func (*Poloniex) GetBalance ¶
"available":"5.015","onOrders":"1.0025","btcValue":"0.078"
func (*Poloniex) GetCurrencies ¶
func (b *Poloniex) GetCurrencies() (currencies Currencies, err error)
func (*Poloniex) GetOrderBook ¶
GetOrderBook is used to get retrieve the orderbook for a given market market: a string literal for the market (ex: BTC_NXT). 'all' not implemented. cat: bid, ask or both to identify the type of orderbook to return. depth: how deep of an order book to retrieve
func (*Poloniex) GetTickers ¶
GetTickers is used to get the ticker for all markets
func (*Poloniex) GetVolumes ¶
func (b *Poloniex) GetVolumes() (vc VolumeCollection, err error)
GetVolumes is used to get the volume for all markets
type PoloniexDate ¶
func (*PoloniexDate) UnmarshalJSON ¶
func (pd *PoloniexDate) UnmarshalJSON(data []byte) error
type Ticker ¶
type Ticker struct { Last float64 `json:"last,string"` LowestAsk float64 `json:"lowestAsk,string"` HighestBid float64 `json:"highestBid,string"` PercentChange float64 `json:"percentChange,string"` BaseVolume float64 `json:"baseVolume,string"` QuoteVolume float64 `json:"quoteVolume,string"` IsFrozen int `json:"isFrozen,string"` High24Hr float64 `json:"high24hr,string"` Low24Hr float64 `json:"low24hr,string"` }
type Volume ¶
func (*Volume) UnmarshalJSON ¶
type VolumeCollection ¶
type VolumeCollection struct { TotalBTC float64 `json:"totalBTC,string"` TotalETH float64 `json:"totalETH,string"` TotalUSDT float64 `json:"totalUSDT,string"` TotalXMR float64 `json:"totalXMR,string"` TotalXUSD float64 `json:"totalXUSD,string"` Volumes map[string]Volume }
func (*VolumeCollection) UnmarshalJSON ¶
func (tc *VolumeCollection) UnmarshalJSON(b []byte) error