Documentation ¶
Index ¶
- Constants
- Variables
- func Error(msg string, args ...interface{}) error
- type Accounts
- type Balance
- type Buy
- type CancelOrder
- type CandleStick
- type Currency
- type LoanOrder
- type LoanOrderSc
- type Logger
- type MarginSummary
- type MarketUpdate
- type NewAddress
- type NewTrade
- type OpenOrder
- type Order
- type OrderBook
- type OrderBookModify
- type OrderBookRemove
- type OrderTrade
- type Poloniex
- func (p *Poloniex) PubReturn24hVolume() (volumes Volume, err error)
- func (p *Poloniex) PubReturnChartData(market string, start, end time.Time, period int) (candles []CandleStick, err error)
- func (p *Poloniex) PubReturnCurrencies() (currencies map[string]Currency, err error)
- func (p *Poloniex) PubReturnLoanOrders(currency string) (loanorders LoanOrder, err error)
- func (p *Poloniex) PubReturnOrderBook(market string, depth int) (orders Order, err error)
- func (p *Poloniex) PubReturnTickers() (tickers map[string]Ticker, err error)
- func (p *Poloniex) PubReturnTradeHistory(market string, args ...time.Time) (trades []Trade, err error)
- func (p *Poloniex) TradeBuy(currencyPair string, rate, amount float64) (buy Buy, err error)
- func (p *Poloniex) TradeCancelOrder(orderNumber int64) (cancelorder CancelOrder, err error)
- func (p *Poloniex) TradeGenerateNewAddress(currency string) (newaddress NewAddress, err error)
- func (p *Poloniex) TradeGetMarginPosition() (map[string]Position, error)
- func (p *Poloniex) TradeReturnAllOpenOrders() (openorders map[string][]OpenOrder, err error)
- func (p *Poloniex) TradeReturnAvailableAccountBalances() (accounts Accounts, err error)
- func (p *Poloniex) TradeReturnBalances() (balances map[string]string, err error)
- func (p *Poloniex) TradeReturnCompleteBalances() (completebalances map[string]Balance, err error)
- func (p *Poloniex) TradeReturnDepositAdresses() (depositaddresses map[string]string, err error)
- func (p *Poloniex) TradeReturnMarginAccountSummary() (MarginSummary, error)
- func (p *Poloniex) TradeReturnOpenOrders(currency string) (openorders []OpenOrder, err error)
- func (p *Poloniex) TradeReturnOrderTrade(orderNumber int64) (ordertrades []OrderTrade, err error)
- func (p *Poloniex) TradeReturnTradeHistory(currency string, args ...interface{}) (tradehistory []TradeHistory2, err error)
- func (p *Poloniex) TradeSell(currencyPair string, rate, amount float64) (sell Sell, err error)
- type Position
- type ResultTrades
- type Sell
- type Ticker
- type Trade
- type TradeHistory2
- type Volume
- type WSClient
- type WSTicker
Constants ¶
View Source
const ( TICKER = "1002" /* Ticker Channel Id */ SUBSBUFFER = 24 /* Subscriptions Buffer */ )
Variables ¶
View Source
var ( ConnectError = "[ERROR] Connection could not be established!" RequestError = "[ERROR] NewRequest Error!" SetApiError = "[ERROR] Set the API KEY and API SECRET!" PeriodError = "[ERROR] Invalid Period!" TimePeriodError = "[ERROR] Time Period incompatibility!" TimeError = "[ERROR] Invalid Time!" StartTimeError = "[ERROR] Start Time Format Error!" EndTimeError = "[ERROR] End Time Format Error!" LimitError = "[ERROR] Limit Format Error!" ChannelError = "[ERROR] Unknown Channel Name: %s" SubscribeError = "[ERROR] Already Subscribed!" WSTickerError = "[ERROR] WSTicker Parsing %s" OrderBookError = "[ERROR] MarketUpdate OrderBook Parsing %s" NewTradeError = "[ERROR] MarketUpdate NewTrade Parsing %s" ServerError = "[SERVER ERROR] Response: %s" )
View Source
var ZeroTime = time.Time{}
Functions ¶
Types ¶
type Buy ¶
type Buy struct { OrderNumber decimal.Decimal `json:"orderNumber"` ResultingTrades []ResultTrades }
type CancelOrder ¶
type CancelOrder struct {
Success int `json:"success"`
}
type CandleStick ¶
type CandleStick struct { Date decimal.Decimal `json:"date"` High decimal.Decimal `json:"high"` Low decimal.Decimal `json:"low"` Open decimal.Decimal `json:"open"` Close decimal.Decimal `json:"close"` Volume decimal.Decimal `json:"volume"` QuoteVolume decimal.Decimal `json:"quoteVolume"` WeightedAverage decimal.Decimal `json:"weightedAverage"` }
type LoanOrder ¶
type LoanOrder struct { Offers []LoanOrderSc `json:"offers"` Demands []LoanOrderSc `json:"demands"` }
type LoanOrderSc ¶
type Logger ¶
func (*Logger) LogRoutine ¶
type MarginSummary ¶
type MarginSummary struct { NetValue decimal.Decimal `json:"netValue"` TotalBorrowedValue decimal.Decimal `json:"totalBorrowedValue"` CurrentMargin decimal.Decimal `json:"currentMargin"` TotalValue decimal.Decimal `json:"totalValue"` LendingFees decimal.Decimal `json:"lendingFees"` PlusValue decimal.Decimal `json:"pl"` }
type MarketUpdate ¶
type MarketUpdate struct { Data interface{} TypeUpdate string `json:"type"` }
type NewAddress ¶
type OpenOrder ¶
type OpenOrder struct { OrderNumber decimal.Decimal `json:"orderNumber, string"` Type string `json:"type, string"` Rate decimal.Decimal `json:"rate, string"` /*StartingAmount decimal.Decimal `json:"startingAmount, string"`*/ Amount decimal.Decimal `json:"amount, string"` Total decimal.Decimal `json:"total, string"` }
type Order ¶
type Order struct { Asks [][]interface{} `json:"asks"` Bids [][]interface{} `json:"bids"` IsFrozen string `json:"isFrozen"` }
type OrderBookModify ¶
type OrderBookModify OrderBook
type OrderBookRemove ¶
type OrderTrade ¶
type Poloniex ¶
type Poloniex struct { LogBus chan<- string // contains filtered or unexported fields }
func (*Poloniex) PubReturn24hVolume ¶
func (*Poloniex) PubReturnChartData ¶
func (*Poloniex) PubReturnCurrencies ¶
func (*Poloniex) PubReturnLoanOrders ¶
func (*Poloniex) PubReturnOrderBook ¶
func (*Poloniex) PubReturnTickers ¶
func (*Poloniex) PubReturnTradeHistory ¶
func (*Poloniex) TradeCancelOrder ¶
func (p *Poloniex) TradeCancelOrder(orderNumber int64) (cancelorder CancelOrder, err error)
func (*Poloniex) TradeGenerateNewAddress ¶
func (p *Poloniex) TradeGenerateNewAddress(currency string) (newaddress NewAddress, err error)
func (*Poloniex) TradeGetMarginPosition ¶
func (*Poloniex) TradeReturnAllOpenOrders ¶
New Method Reason: different data type return when currency is 'all'
func (*Poloniex) TradeReturnAvailableAccountBalances ¶
func (*Poloniex) TradeReturnBalances ¶
func (*Poloniex) TradeReturnCompleteBalances ¶
func (*Poloniex) TradeReturnDepositAdresses ¶
func (*Poloniex) TradeReturnMarginAccountSummary ¶
func (p *Poloniex) TradeReturnMarginAccountSummary() (MarginSummary, error)
func (*Poloniex) TradeReturnOpenOrders ¶
func (*Poloniex) TradeReturnOrderTrade ¶
func (p *Poloniex) TradeReturnOrderTrade(orderNumber int64) (ordertrades []OrderTrade, err error)
func (*Poloniex) TradeReturnTradeHistory ¶
func (p *Poloniex) TradeReturnTradeHistory(currency string, args ...interface{}) (tradehistory []TradeHistory2, err error)
type Position ¶
type Position struct { Type string `json:"type"` LendingFees decimal.Decimal `json:"lendingFees"` Amount decimal.Decimal `json:"amount"` Total decimal.Decimal `json:"total"` PlusValue decimal.Decimal `json:"pl"` BasePrice decimal.Decimal `json:"basePrice"` LiquidationPrice decimal.Decimal `json:"liquidationPrice"` }
type ResultTrades ¶
type Ticker ¶
type Ticker struct { ID int `json:"id, int"` Last decimal.Decimal `json:"last, string"` LowestAsk decimal.Decimal `json:"lowestAsk, string"` HighestBid decimal.Decimal `json:"highestBid, string"` PercentChange decimal.Decimal `json:"percentChange, string"` BaseVolume decimal.Decimal `json:"baseVolume, string"` QuoteVolume decimal.Decimal `json:"quoteVolume, string"` IsFrozen int `json:"isFrozen ,string"` High24hr decimal.Decimal `json:"high24hr, string"` Low24hr decimal.Decimal `json:"low24hr, string"` }
type Trade ¶
type Trade struct { GlobalTradeID uint64 `json:"globalTradeID"` TradeID uint64 `json:"tradeID"` Date string `json:"date, string"` Type string `json:"type, string"` Rate decimal.Decimal `json:"rate, string"` Amount decimal.Decimal `json:"amount, string"` Total decimal.Decimal `json:"total, string"` }
type TradeHistory2 ¶
type TradeHistory2 struct { Date string `json:"date"` Type string `json:"type"` Buy decimal.Decimal `json:"buy, string"` Rate decimal.Decimal `json:"rate, string"` Amount decimal.Decimal `json:"amount, string"` Total decimal.Decimal `json:"total, string"` OrderNumber decimal.Decimal `json:"order_number,string"` }
Self Trade History
type Volume ¶
type Volume struct { Volumes map[string]map[string]decimal.Decimal 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"` }
func (*Volume) UnmarshalJSON ¶
type WSClient ¶
type WSClient struct { Subs map[string]chan interface{} LogBus chan<- string // contains filtered or unexported fields }
func NewWSClient ¶
func (*WSClient) SubscribeMarket ¶
func (*WSClient) SubscribeTicker ¶
func (*WSClient) UnsubscribeMarket ¶
func (*WSClient) UnsubscribeTicker ¶
type WSTicker ¶
type WSTicker struct { CurrencyPair string `json:"currencyPair"` Last float64 `json:"last"` LowestAsk float64 `json:"lowestAsk"` HighestBid float64 `json:"hihgestBid"` PercentChange float64 `json:"percentChange"` BaseVolume float64 `json:"baseVolume"` QuoteVolume float64 `json:"quoteVolume"` IsFrozen bool `json:"isFrozen"` High24hr float64 `json:"high24hr"` Low24hr float64 `json:"low24hr"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.