Documentation ¶
Index ¶
- func OnDepthOrTrade(args []interface{}, kwargs map[string]interface{})
- func OnTicker(args []interface{}, kwargs map[string]interface{})
- func OnTrollbox(args []interface{}, kwargs map[string]interface{})
- type ActiveLoans
- type AuthenticatedTradeHistoryAll
- type AuthenticatedTradeHistoryResponse
- type AuthentictedTradeHistory
- type Balance
- type ChartData
- type CompleteBalance
- type CompleteBalances
- type Currencies
- type DepositAddresses
- type DepositsWithdrawals
- type Fee
- type GenericResponse
- type LendingHistory
- type LoanOffer
- type LoanOrder
- type LoanOrders
- type Margin
- type MarginPosition
- type MoveOrderResponse
- type OpenOrdersResponse
- type OpenOrdersResponseAll
- type Order
- type OrderResponse
- type Orderbook
- type OrderbookAll
- type OrderbookItem
- type OrderbookResponse
- type OrderbookResponseAll
- type Poloniex
- func (po *Poloniex) CancelAllExchangeOrders(p pair.CurrencyPair) error
- func (po *Poloniex) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error)
- func (p *Poloniex) CancelLoanOffer(orderNumber int64) (bool, error)
- func (p *Poloniex) CancelOrder(orderID int64) (bool, error)
- func (p *Poloniex) CloseMarginPosition(currency string) (bool, error)
- func (p *Poloniex) CreateLoanOffer(currency string, amount, rate float64, duration int, autoRenew bool) (int64, error)
- func (p *Poloniex) GenerateNewAddress(currency string) (string, error)
- func (p *Poloniex) GetActiveLoans() (ActiveLoans, error)
- func (p *Poloniex) GetAuthenticatedTradeHistory(currency, start, end, limit string) (interface{}, error)
- func (p *Poloniex) GetBalances() (Balance, error)
- func (p *Poloniex) GetChartData(currencyPair, start, end, period string) ([]ChartData, error)
- func (p *Poloniex) GetCompleteBalances() (CompleteBalances, error)
- func (p *Poloniex) GetCurrencies() (map[string]Currencies, error)
- func (p *Poloniex) GetDepositAddresses() (DepositAddresses, error)
- func (p *Poloniex) GetDepositsWithdrawals(start, end string) (DepositsWithdrawals, error)
- func (po *Poloniex) GetExchangeAccountInfo() (exchange.AccountInfo, error)
- func (p *Poloniex) GetExchangeCurrencies() ([]string, error)
- func (po *Poloniex) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error)
- func (po *Poloniex) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error)
- func (po *Poloniex) GetExchangeOrderInfo(orderID int64) (float64, error)
- func (p *Poloniex) GetFee() float64
- func (p *Poloniex) GetFeeInfo() (Fee, error)
- func (p *Poloniex) GetLendingHistory(start, end string) ([]LendingHistory, error)
- func (p *Poloniex) GetLoanOrders(currency string) (LoanOrders, error)
- func (p *Poloniex) GetMarginAccountSummary() (Margin, error)
- func (p *Poloniex) GetMarginPosition(currency string) (interface{}, error)
- func (p *Poloniex) GetOpenLoanOffers() (map[string][]LoanOffer, error)
- func (p *Poloniex) GetOpenOrders(currency string) (interface{}, error)
- func (p *Poloniex) GetOrderbook(currencyPair string, depth int) (OrderbookAll, error)
- func (po *Poloniex) GetOrderbookEx(currencyPair pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (p *Poloniex) GetTicker() (map[string]Ticker, error)
- func (po *Poloniex) GetTickerPrice(currencyPair pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (p *Poloniex) GetTradableBalances() (map[string]map[string]float64, error)
- func (p *Poloniex) GetTradeHistory(currencyPair, start, end string) ([]TradeHistory, error)
- func (p *Poloniex) GetVolume() (interface{}, error)
- func (po *Poloniex) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error)
- func (p *Poloniex) MoveOrder(orderID int64, rate, amount float64) (MoveOrderResponse, error)
- func (p *Poloniex) PlaceMarginOrder(currency string, rate, amount, lendingRate float64, buy bool) (OrderResponse, error)
- func (p *Poloniex) PlaceOrder(currency string, rate, amount float64, immediate, fillOrKill, buy bool) (OrderResponse, error)
- func (po *Poloniex) Run()
- func (p *Poloniex) SendAuthenticatedHTTPRequest(method, endpoint string, values url.Values, result interface{}) error
- func (p *Poloniex) SendHTTPRequest(path string, result interface{}) error
- func (p *Poloniex) SetDefaults()
- func (p *Poloniex) Setup(exch config.ExchangeConfig)
- func (po *Poloniex) Start(wg *sync.WaitGroup)
- func (po *Poloniex) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error)
- func (p *Poloniex) ToggleAutoRenew(orderNumber int64) (bool, error)
- func (p *Poloniex) TransferBalance(currency, from, to string, amount float64) (bool, error)
- func (po *Poloniex) UpdateOrderbook(currencyPair pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (po *Poloniex) UpdateTicker(currencyPair pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (p *Poloniex) WebsocketClient()
- func (p *Poloniex) Withdraw(currency, address string, amount float64) (bool, error)
- func (po *Poloniex) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error)
- type ResultingTrades
- type Ticker
- type TradeHistory
- type WebsocketTicker
- type WebsocketTrollboxMessage
- type Withdraw
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OnDepthOrTrade ¶
func OnDepthOrTrade(args []interface{}, kwargs map[string]interface{})
OnDepthOrTrade handles orderbook depth and trade events
func OnTicker ¶
func OnTicker(args []interface{}, kwargs map[string]interface{})
OnTicker converts ticker data to a websocketTicker
func OnTrollbox ¶
func OnTrollbox(args []interface{}, kwargs map[string]interface{})
OnTrollbox handles trollbox messages
Types ¶
type ActiveLoans ¶
ActiveLoans shows the full active loans on the exchange
type AuthenticatedTradeHistoryAll ¶
type AuthenticatedTradeHistoryAll struct {
Data map[string][]AuthentictedTradeHistory
}
AuthenticatedTradeHistoryAll holds the full client trade history
type AuthenticatedTradeHistoryResponse ¶
type AuthenticatedTradeHistoryResponse struct {
Data []AuthentictedTradeHistory
}
AuthenticatedTradeHistoryResponse is a response type for trade history
type AuthentictedTradeHistory ¶
type AuthentictedTradeHistory struct { GlobalTradeID int64 `json:"globalTradeID"` TradeID int64 `json:"tradeID,string"` Date string `json:"date"` Rate float64 `json:"rate,string"` Amount float64 `json:"amount,string"` Total float64 `json:"total,string"` Fee float64 `json:"fee,string"` OrderNumber int64 `json:"orderNumber,string"` Type string `json:"type"` Category string `json:"category"` }
AuthentictedTradeHistory holds client trade history information
type ChartData ¶
type ChartData struct { Date int `json:"date"` 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"` Error string `json:"error"` }
ChartData holds kline data
type CompleteBalance ¶
CompleteBalance contains the complete balance with a btcvalue
type CompleteBalances ¶
type CompleteBalances struct {
Currency map[string]CompleteBalance
}
CompleteBalances holds the full balance data
type Currencies ¶
type Currencies struct { Name string `json:"name"` MaxDailyWithdrawal string `json:"maxDailyWithdrawal"` TxFee float64 `json:"txFee,string"` MinConfirmations int `json:"minConf"` DepositAddresses interface{} `json:"depositAddress"` Disabled int `json:"disabled"` Delisted int `json:"delisted"` Frozen int `json:"frozen"` }
Currencies contains currency information
type DepositAddresses ¶
DepositAddresses holds the full address per crypto-currency
type DepositsWithdrawals ¶
type DepositsWithdrawals struct { Deposits []struct { Currency string `json:"currency"` Address string `json:"address"` Amount float64 `json:"amount,string"` Confirmations int `json:"confirmations"` TransactionID string `json:"txid"` Timestamp int64 `json:"timestamp"` Status string `json:"status"` } `json:"deposits"` Withdrawals []struct { WithdrawalNumber int64 `json:"withdrawalNumber"` Currency string `json:"currency"` Address string `json:"address"` Amount float64 `json:"amount,string"` Confirmations int `json:"confirmations"` TransactionID string `json:"txid"` Timestamp int64 `json:"timestamp"` Status string `json:"status"` IPAddress string `json:"ipAddress"` } `json:"withdrawals"` }
DepositsWithdrawals holds withdrawal information
type Fee ¶
type Fee struct { MakerFee float64 `json:"makerFee,string"` TakerFee float64 `json:"takerFee,string"` ThirtyDayVolume float64 `json:"thirtyDayVolume,string"` NextTier float64 `json:"nextTier,string"` }
Fee holds fees for specific trades
type GenericResponse ¶
GenericResponse is a response type for exchange generic responses
type LendingHistory ¶
type LendingHistory struct { ID int64 `json:"id"` Currency string `json:"currency"` Rate float64 `json:"rate,string"` Amount float64 `json:"amount,string"` Duration float64 `json:"duration,string"` Interest float64 `json:"interest,string"` Fee float64 `json:"fee,string"` Earned float64 `json:"earned,string"` Open string `json:"open"` Close string `json:"close"` }
LendingHistory holds the full lending history data
type LoanOffer ¶
type LoanOffer struct { ID int64 `json:"id"` Rate float64 `json:"rate,string"` Amount float64 `json:"amount,string"` Duration int `json:"duration"` AutoRenew bool `json:"autoRenew,int"` Date string `json:"date"` }
LoanOffer holds loan offer information
type LoanOrder ¶
type LoanOrder struct { Rate float64 `json:"rate,string"` Amount float64 `json:"amount,string"` RangeMin int `json:"rangeMin"` RangeMax int `json:"rangeMax"` }
LoanOrder holds loan order information
type LoanOrders ¶
LoanOrders holds loan order information range
type Margin ¶
type Margin struct { TotalValue float64 `json:"totalValue,string"` ProfitLoss float64 `json:"pl,string"` LendingFees float64 `json:"lendingFees,string"` NetValue float64 `json:"netValue,string"` BorrowedValue float64 `json:"totalBorrowedValue,string"` CurrentMargin float64 `json:"currentMargin,string"` }
Margin holds margin information
type MarginPosition ¶
type MarginPosition struct { Amount float64 `json:"amount,string"` Total float64 `json:"total,string"` BasePrice float64 `json:"basePrice,string"` LiquidiationPrice float64 `json:"liquidiationPrice"` ProfitLoss float64 `json:"pl,string"` LendingFees float64 `json:"lendingFees,string"` Type string `json:"type"` }
MarginPosition holds margin positional information
type MoveOrderResponse ¶
type MoveOrderResponse struct { Success int `json:"success"` Error string `json:"error"` OrderNumber int64 `json:"orderNumber,string"` Trades map[string][]ResultingTrades `json:"resultingTrades"` }
MoveOrderResponse is a response type for move order trades
type OpenOrdersResponse ¶
type OpenOrdersResponse struct {
Data []Order
}
OpenOrdersResponse holds open response orders
type OpenOrdersResponseAll ¶
OpenOrdersResponseAll holds all open order responses
type Order ¶
type Order struct { OrderNumber int64 `json:"orderNumber,string"` Type string `json:"type"` Rate float64 `json:"rate,string"` Amount float64 `json:"amount,string"` Total float64 `json:"total,string"` Date string `json:"date"` Margin float64 `json:"margin"` }
Order hold order information
type OrderResponse ¶
type OrderResponse struct { OrderNumber int64 `json:"orderNumber,string"` Trades []ResultingTrades `json:"resultingTrades"` }
OrderResponse is a response type of trades
type Orderbook ¶
type Orderbook struct { Asks []OrderbookItem `json:"asks"` Bids []OrderbookItem `json:"bids"` }
Orderbook is a generic type golding orderbook information
type OrderbookAll ¶
OrderbookAll contains the full range of orderbooks
type OrderbookItem ¶
OrderbookItem holds data on an individual item
type OrderbookResponse ¶
type OrderbookResponse struct { Asks [][]interface{} `json:"asks"` Bids [][]interface{} `json:"bids"` IsFrozen string `json:"isFrozen"` Error string `json:"error"` }
OrderbookResponse is a sub-type for orderbooks
type OrderbookResponseAll ¶
type OrderbookResponseAll struct {
Data map[string]OrderbookResponse
}
OrderbookResponseAll holds the full response type orderbook
type Poloniex ¶
type Poloniex struct {
exchange.Base
}
Poloniex is the overarching type across the poloniex package
func (*Poloniex) CancelAllExchangeOrders ¶
func (po *Poloniex) CancelAllExchangeOrders(p pair.CurrencyPair) error
CancelAllExchangeOrders cancels all orders associated with a currency pair
func (*Poloniex) CancelExchangeOrder ¶
CancelExchangeOrder cancels an order by its corresponding ID number
func (*Poloniex) CancelLoanOffer ¶
CancelLoanOffer cancels a loan offer order
func (*Poloniex) CancelOrder ¶
CancelOrder cancels and order by orderID
func (*Poloniex) CloseMarginPosition ¶
CloseMarginPosition closes a current margin position
func (*Poloniex) CreateLoanOffer ¶
func (p *Poloniex) CreateLoanOffer(currency string, amount, rate float64, duration int, autoRenew bool) (int64, error)
CreateLoanOffer places a loan offer on the exchange
func (*Poloniex) GenerateNewAddress ¶
GenerateNewAddress generates a new address for a currency
func (*Poloniex) GetActiveLoans ¶
func (p *Poloniex) GetActiveLoans() (ActiveLoans, error)
GetActiveLoans returns active loans
func (*Poloniex) GetAuthenticatedTradeHistory ¶
func (p *Poloniex) GetAuthenticatedTradeHistory(currency, start, end, limit string) (interface{}, error)
GetAuthenticatedTradeHistory returns account trade history
func (*Poloniex) GetBalances ¶
GetBalances returns balances for your account.
func (*Poloniex) GetChartData ¶
GetChartData returns chart data for a specific currency pair
func (*Poloniex) GetCompleteBalances ¶
func (p *Poloniex) GetCompleteBalances() (CompleteBalances, error)
GetCompleteBalances returns complete balances from your account.
func (*Poloniex) GetCurrencies ¶
func (p *Poloniex) GetCurrencies() (map[string]Currencies, error)
GetCurrencies returns information about currencies
func (*Poloniex) GetDepositAddresses ¶
func (p *Poloniex) GetDepositAddresses() (DepositAddresses, error)
GetDepositAddresses returns deposit addresses for all enabled cryptos.
func (*Poloniex) GetDepositsWithdrawals ¶
func (p *Poloniex) GetDepositsWithdrawals(start, end string) (DepositsWithdrawals, error)
GetDepositsWithdrawals returns a list of deposits and withdrawals
func (*Poloniex) GetExchangeAccountInfo ¶
GetExchangeAccountInfo retrieves balances for all enabled currencies for the Poloniex exchange
func (*Poloniex) GetExchangeCurrencies ¶
GetExchangeCurrencies returns a list of currencies using the GetTicker API as the GetExchangeCurrencies information doesn't return currency pair information
func (*Poloniex) GetExchangeDepositAddress ¶
func (po *Poloniex) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error)
GetExchangeDepositAddress returns a deposit address for a specified currency
func (*Poloniex) GetExchangeHistory ¶
func (po *Poloniex) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error)
GetExchangeHistory returns historic trade data since exchange opening.
func (*Poloniex) GetExchangeOrderInfo ¶
GetExchangeOrderInfo returns information on a current open order
func (*Poloniex) GetFeeInfo ¶
GetFeeInfo returns fee information
func (*Poloniex) GetLendingHistory ¶
func (p *Poloniex) GetLendingHistory(start, end string) ([]LendingHistory, error)
GetLendingHistory returns lending history for the account
func (*Poloniex) GetLoanOrders ¶
func (p *Poloniex) GetLoanOrders(currency string) (LoanOrders, error)
GetLoanOrders returns the list of loan offers and demands for a given currency, specified by the "currency" GET parameter.
func (*Poloniex) GetMarginAccountSummary ¶
GetMarginAccountSummary returns a summary on your margin accounts
func (*Poloniex) GetMarginPosition ¶
GetMarginPosition returns a position on a margin order
func (*Poloniex) GetOpenLoanOffers ¶
GetOpenLoanOffers returns all open loan offers
func (*Poloniex) GetOpenOrders ¶
GetOpenOrders returns current unfilled opened orders
func (*Poloniex) GetOrderbook ¶
func (p *Poloniex) GetOrderbook(currencyPair string, depth int) (OrderbookAll, error)
GetOrderbook returns the full orderbook from poloniex
func (*Poloniex) GetOrderbookEx ¶
func (po *Poloniex) GetOrderbookEx(currencyPair pair.CurrencyPair, assetType string) (orderbook.Base, error)
GetOrderbookEx returns orderbook base on the currency pair
func (*Poloniex) GetTickerPrice ¶
func (po *Poloniex) GetTickerPrice(currencyPair pair.CurrencyPair, assetType string) (ticker.Price, error)
GetTickerPrice returns the ticker for a currency pair
func (*Poloniex) GetTradableBalances ¶
GetTradableBalances returns tradable balances
func (*Poloniex) GetTradeHistory ¶
func (p *Poloniex) GetTradeHistory(currencyPair, start, end string) ([]TradeHistory, error)
GetTradeHistory returns trades history from poloniex
func (*Poloniex) ModifyExchangeOrder ¶
ModifyExchangeOrder will allow of changing orderbook placement and limit to market conversion
func (*Poloniex) MoveOrder ¶
func (p *Poloniex) MoveOrder(orderID int64, rate, amount float64) (MoveOrderResponse, error)
MoveOrder moves an order
func (*Poloniex) PlaceMarginOrder ¶
func (p *Poloniex) PlaceMarginOrder(currency string, rate, amount, lendingRate float64, buy bool) (OrderResponse, error)
PlaceMarginOrder places a margin order
func (*Poloniex) PlaceOrder ¶
func (p *Poloniex) PlaceOrder(currency string, rate, amount float64, immediate, fillOrKill, buy bool) (OrderResponse, error)
PlaceOrder places a new order on the exchange
func (*Poloniex) SendAuthenticatedHTTPRequest ¶
func (p *Poloniex) SendAuthenticatedHTTPRequest(method, endpoint string, values url.Values, result interface{}) error
SendAuthenticatedHTTPRequest sends an authenticated HTTP request
func (*Poloniex) SendHTTPRequest ¶
SendHTTPRequest sends an unauthenticated HTTP request
func (*Poloniex) SetDefaults ¶
func (p *Poloniex) SetDefaults()
SetDefaults sets default settings for poloniex
func (*Poloniex) Setup ¶
func (p *Poloniex) Setup(exch config.ExchangeConfig)
Setup sets user exchange configuration settings
func (*Poloniex) SubmitExchangeOrder ¶
func (po *Poloniex) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error)
SubmitExchangeOrder submits a new order
func (*Poloniex) ToggleAutoRenew ¶
ToggleAutoRenew allows for the autorenew of a contract
func (*Poloniex) TransferBalance ¶
TransferBalance transfers balances between your accounts
func (*Poloniex) UpdateOrderbook ¶
func (po *Poloniex) UpdateOrderbook(currencyPair pair.CurrencyPair, assetType string) (orderbook.Base, error)
UpdateOrderbook updates and returns the orderbook for a currency pair
func (*Poloniex) UpdateTicker ¶
func (po *Poloniex) UpdateTicker(currencyPair pair.CurrencyPair, assetType string) (ticker.Price, error)
UpdateTicker updates and returns the ticker for a currency pair
func (*Poloniex) WebsocketClient ¶
func (p *Poloniex) WebsocketClient()
WebsocketClient creates a new websocket client
func (*Poloniex) WithdrawExchangeFunds ¶
func (po *Poloniex) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error)
WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
type ResultingTrades ¶
type ResultingTrades struct { Amount float64 `json:"amount,string"` Date string `json:"date"` Rate float64 `json:"rate,string"` Total float64 `json:"total,string"` TradeID int64 `json:"tradeID,string"` Type string `json:"type"` }
ResultingTrades holds resultant trade information
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"` }
Ticker holds ticker data
type TradeHistory ¶
type TradeHistory struct { GlobalTradeID int64 `json:"globalTradeID"` TradeID int64 `json:"tradeID"` Date string `json:"date"` Type string `json:"type"` Rate float64 `json:"rate,string"` Amount float64 `json:"amount,string"` Total float64 `json:"total,string"` }
TradeHistory holds trade history data
type WebsocketTicker ¶
type WebsocketTicker struct { CurrencyPair string Last float64 LowestAsk float64 HighestBid float64 PercentChange float64 BaseVolume float64 QuoteVolume float64 IsFrozen bool High float64 Low float64 }
WebsocketTicker holds ticker data for the websocket