Documentation ¶
Index ¶
- Variables
- type ActiveLoans
- type AuthenticatedTradeHistory
- type AuthenticatedTradeHistoryAll
- type AuthenticatedTradeHistoryResponse
- type Balance
- type CancelOrdersResponse
- type ChartData
- type CodeSummaryInfo
- type CompleteBalance
- type CompleteBalances
- type Currencies
- type CurrencyDetails
- func (w *CurrencyDetails) GetCode(id float64) (currency.Code, error)
- func (w *CurrencyDetails) GetDepositAddress(c currency.Code) (string, error)
- func (w *CurrencyDetails) GetPair(id float64) (currency.Pair, error)
- func (w *CurrencyDetails) GetWithdrawalTXFee(c currency.Code) (float64, error)
- func (w *CurrencyDetails) IsPostOnlyForPair(pair currency.Pair) (bool, error)
- func (w *CurrencyDetails) IsTradingEnabledForCurrency(c currency.Code) (bool, error)
- func (w *CurrencyDetails) IsTradingEnabledForPair(pair currency.Pair) (bool, error)
- func (w *CurrencyDetails) IsWithdrawAndDepositsEnabled(c currency.Code) (bool, error)
- 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 OrderStatus
- type OrderStatusData
- type OrderTrade
- type Orderbook
- type OrderbookAll
- type OrderbookItem
- type OrderbookResponse
- type OrderbookResponseAll
- type PairSummaryInfo
- type Poloniex
- func (p *Poloniex) CancelAllOrders(ctx context.Context, _ *order.Cancel) (order.CancelAllResponse, error)
- func (p *Poloniex) CancelBatchOrders(ctx context.Context, o []order.Cancel) (*order.CancelBatchResponse, error)
- func (p *Poloniex) CancelExistingOrder(ctx context.Context, orderID int64) error
- func (p *Poloniex) CancelLoanOffer(ctx context.Context, orderNumber int64) (bool, error)
- func (p *Poloniex) CancelMultipleOrdersByIDs(ctx context.Context, orderIDs, clientOrderIDs []string) ([]CancelOrdersResponse, error)
- func (p *Poloniex) CancelOrder(ctx context.Context, o *order.Cancel) error
- func (p *Poloniex) CloseMarginPosition(ctx context.Context, currency string) (bool, error)
- func (p *Poloniex) CreateLoanOffer(ctx context.Context, currency string, amount, rate float64, duration int, ...) (int64, error)
- func (p *Poloniex) FetchAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
- func (p *Poloniex) FetchOrderbook(ctx context.Context, currencyPair currency.Pair, assetType asset.Item) (*orderbook.Base, error)
- func (p *Poloniex) FetchTicker(ctx context.Context, currencyPair currency.Pair, assetType asset.Item) (*ticker.Price, error)
- func (p *Poloniex) FetchTradablePairs(ctx context.Context, _ asset.Item) (currency.Pairs, error)
- func (p *Poloniex) GenerateDefaultSubscriptions() ([]subscription.Subscription, error)
- func (p *Poloniex) GenerateNewAddress(ctx context.Context, curr string) (string, error)
- func (p *Poloniex) GetAccountFundingHistory(ctx context.Context) ([]exchange.FundingHistory, error)
- func (p *Poloniex) GetActiveLoans(ctx context.Context) (ActiveLoans, error)
- func (p *Poloniex) GetActiveOrders(ctx context.Context, req *order.MultiOrderRequest) (order.FilteredOrders, error)
- func (p *Poloniex) GetAuthenticatedOrderStatus(ctx context.Context, orderID string) (o OrderStatusData, err error)
- func (p *Poloniex) GetAuthenticatedOrderTrades(ctx context.Context, orderID string) (o []OrderTrade, err error)
- func (p *Poloniex) GetAuthenticatedTradeHistory(ctx context.Context, start, end, limit int64) (AuthenticatedTradeHistoryAll, error)
- func (p *Poloniex) GetAuthenticatedTradeHistoryForCurrency(ctx context.Context, currency string, start, end, limit int64) (AuthenticatedTradeHistoryResponse, error)
- func (p *Poloniex) GetAvailableTransferChains(ctx context.Context, cryptocurrency currency.Code) ([]string, error)
- func (p *Poloniex) GetBalances(ctx context.Context) (Balance, error)
- func (p *Poloniex) GetChartData(ctx context.Context, currencyPair string, start, end time.Time, period string) ([]ChartData, error)
- func (p *Poloniex) GetCompleteBalances(ctx context.Context) (CompleteBalances, error)
- func (p *Poloniex) GetCurrencies(ctx context.Context) (map[string]*Currencies, error)
- func (p *Poloniex) GetCurrencyTradeURL(_ context.Context, a asset.Item, cp currency.Pair) (string, error)
- func (p *Poloniex) GetDepositAddress(ctx context.Context, cryptocurrency currency.Code, _, chain string) (*deposit.Address, error)
- func (p *Poloniex) GetDepositAddresses(ctx context.Context) (DepositAddresses, error)
- func (p *Poloniex) GetDepositsWithdrawals(ctx context.Context, start, end string) (DepositsWithdrawals, error)
- func (p *Poloniex) GetFee(ctx context.Context, feeBuilder *exchange.FeeBuilder) (float64, error)
- func (p *Poloniex) GetFeeByType(ctx context.Context, feeBuilder *exchange.FeeBuilder) (float64, error)
- func (p *Poloniex) GetFeeInfo(ctx context.Context) (Fee, error)
- func (p *Poloniex) GetFuturesContractDetails(context.Context, asset.Item) ([]futures.Contract, error)
- func (p *Poloniex) GetHistoricCandles(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, ...) (*kline.Item, error)
- func (p *Poloniex) GetHistoricCandlesExtended(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, ...) (*kline.Item, error)
- func (p *Poloniex) GetHistoricTrades(ctx context.Context, pair currency.Pair, assetType asset.Item, ...) ([]trade.Data, error)
- func (p *Poloniex) GetLatestFundingRates(context.Context, *fundingrate.LatestRateRequest) ([]fundingrate.LatestRateResponse, error)
- func (p *Poloniex) GetLendingHistory(ctx context.Context, start, end string) ([]LendingHistory, error)
- func (p *Poloniex) GetLoanOrders(ctx context.Context, currency string) (LoanOrders, error)
- func (p *Poloniex) GetMarginAccountSummary(ctx context.Context) (Margin, error)
- func (p *Poloniex) GetMarginPosition(ctx context.Context, currency string) (interface{}, error)
- func (p *Poloniex) GetOpenLoanOffers(ctx context.Context) (map[string][]LoanOffer, error)
- func (p *Poloniex) GetOpenOrders(ctx context.Context, currency string) (OpenOrdersResponse, error)
- func (p *Poloniex) GetOpenOrdersForAllCurrencies(ctx context.Context) (OpenOrdersResponseAll, error)
- func (p *Poloniex) GetOrderHistory(ctx context.Context, req *order.MultiOrderRequest) (order.FilteredOrders, error)
- func (p *Poloniex) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, _ asset.Item) (*order.Detail, error)
- func (p *Poloniex) GetOrderbook(ctx context.Context, currencyPair string, depth int) (OrderbookAll, error)
- func (p *Poloniex) GetRecentTrades(ctx context.Context, pair currency.Pair, assetType asset.Item) ([]trade.Data, error)
- func (p *Poloniex) GetServerTime(ctx context.Context, _ asset.Item) (time.Time, error)
- func (p *Poloniex) GetTicker(ctx context.Context) (map[string]Ticker, error)
- func (p *Poloniex) GetTimestamp(ctx context.Context) (time.Time, error)
- func (p *Poloniex) GetTradableBalances(ctx context.Context) (map[string]map[string]float64, error)
- func (p *Poloniex) GetTradeHistory(ctx context.Context, currencyPair string, start, end int64) ([]TradeHistory, error)
- func (p *Poloniex) GetVolume(ctx context.Context) (interface{}, error)
- func (p *Poloniex) GetWithdrawalsHistory(ctx context.Context, c currency.Code, _ asset.Item) ([]exchange.WithdrawalHistory, error)
- func (p *Poloniex) ModifyOrder(ctx context.Context, action *order.Modify) (*order.ModifyResponse, error)
- func (p *Poloniex) MoveOrder(ctx context.Context, orderID int64, rate, amount float64, ...) (MoveOrderResponse, error)
- func (p *Poloniex) PlaceMarginOrder(ctx context.Context, currency string, rate, amount, lendingRate float64, ...) (OrderResponse, error)
- func (p *Poloniex) PlaceOrder(ctx context.Context, currency string, rate, amount float64, ...) (OrderResponse, error)
- func (p *Poloniex) SendAuthenticatedHTTPRequest(ctx context.Context, ep exchange.URL, method, endpoint string, ...) error
- func (p *Poloniex) SendHTTPRequest(ctx context.Context, ep exchange.URL, path string, result interface{}) error
- func (p *Poloniex) SetDefaults()
- func (p *Poloniex) Setup(exch *config.Exchange) error
- func (p *Poloniex) SubmitOrder(ctx context.Context, s *order.Submit) (*order.SubmitResponse, error)
- func (p *Poloniex) Subscribe(sub []subscription.Subscription) error
- func (p *Poloniex) ToggleAutoRenew(ctx context.Context, orderNumber int64) (bool, error)
- func (p *Poloniex) TransferBalance(ctx context.Context, currency, from, to string, amount float64) (bool, error)
- func (p *Poloniex) Unsubscribe(unsub []subscription.Subscription) error
- func (p *Poloniex) UpdateAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
- func (p *Poloniex) UpdateOrderExecutionLimits(_ context.Context, _ asset.Item) error
- func (p *Poloniex) UpdateOrderbook(ctx context.Context, pair currency.Pair, assetType asset.Item) (*orderbook.Base, error)
- func (p *Poloniex) UpdateTicker(ctx context.Context, currencyPair currency.Pair, a asset.Item) (*ticker.Price, error)
- func (p *Poloniex) UpdateTickers(ctx context.Context, a asset.Item) error
- func (p *Poloniex) UpdateTradablePairs(ctx context.Context, forceUpgrade bool) error
- func (p *Poloniex) ValidateAPICredentials(ctx context.Context, assetType asset.Item) error
- func (p *Poloniex) WalletActivity(ctx context.Context, start, end time.Time, activityType string) (*WalletActivityResponse, error)
- func (p *Poloniex) Withdraw(ctx context.Context, currency, address string, amount float64) (*Withdraw, error)
- func (p *Poloniex) WithdrawCryptocurrencyFunds(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (p *Poloniex) WithdrawFiatFunds(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (p *Poloniex) WithdrawFiatFundsToInternationalBank(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (p *Poloniex) WsConnect() error
- func (p *Poloniex) WsProcessOrderbookSnapshot(data []interface{}) error
- func (p *Poloniex) WsProcessOrderbookUpdate(sequenceNumber float64, data []interface{}, pair currency.Pair) error
- type RateLimit
- type ResultingTrades
- type Ticker
- type TimeStampResponse
- type TradeHistory
- type WalletActivityResponse
- type WalletDeposits
- type WalletWithdrawals
- type WebsocketTicker
- type WebsocketTrollboxMessage
- type Withdraw
- type WsAuthorisationRequest
- type WsCommand
- type WsOrderUpdateResponse
- type WsTicker
- type WsTrade
- type WsTradeNotificationResponse
Constants ¶
This section is empty.
Variables ¶
var WithdrawalFees = map[currency.Code]float64{ currency.ZRX: 5, currency.ARDR: 2, currency.REP: 0.1, currency.BTC: 0.0005, currency.BCH: 0.0001, currency.XBC: 0.0001, currency.BTCD: 0.01, currency.BTM: 0.01, currency.BTS: 5, currency.BURST: 1, currency.BCN: 1, currency.CVC: 1, currency.CLAM: 0.001, currency.XCP: 1, currency.DASH: 0.01, currency.DCR: 0.1, currency.DGB: 0.1, currency.DOGE: 5, currency.EMC2: 0.01, currency.EOS: 0, currency.ETH: 0.01, currency.ETC: 0.01, currency.EXP: 0.01, currency.FCT: 0.01, currency.GAME: 0.01, currency.GAS: 0, currency.GNO: 0.015, currency.GNT: 1, currency.GRC: 0.01, currency.HUC: 0.01, currency.LBC: 0.05, currency.LSK: 0.1, currency.LTC: 0.001, currency.MAID: 10, currency.XMR: 0.015, currency.NMC: 0.01, currency.NAV: 0.01, currency.XEM: 15, currency.NEOS: 0.0001, currency.NXT: 1, currency.OMG: 0.3, currency.OMNI: 0.1, currency.PASC: 0.01, currency.PPC: 0.01, currency.POT: 0.01, currency.XPM: 0.01, currency.XRP: 0.15, currency.SC: 10, currency.STEEM: 0.01, currency.SBD: 0.01, currency.XLM: 0.00001, currency.STORJ: 1, currency.STRAT: 0.01, currency.AMP: 5, currency.SYS: 0.01, currency.USDT: 10, currency.VRC: 0.01, currency.VTC: 0.001, currency.VIA: 0.01, currency.ZEC: 0.001, }
WithdrawalFees the large list of predefined withdrawal fees Prone to change, using highest value
Functions ¶
This section is empty.
Types ¶
type ActiveLoans ¶
ActiveLoans shows the full active loans on the exchange
type AuthenticatedTradeHistory ¶
type AuthenticatedTradeHistory struct { GlobalTradeID string `json:"globalTradeID"` TradeID string `json:"tradeID"` 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"` }
AuthenticatedTradeHistory holds client trade history information
type AuthenticatedTradeHistoryAll ¶
type AuthenticatedTradeHistoryAll struct {
Data map[string][]AuthenticatedTradeHistory
}
AuthenticatedTradeHistoryAll holds the full client trade history
type AuthenticatedTradeHistoryResponse ¶
type AuthenticatedTradeHistoryResponse struct {
Data []AuthenticatedTradeHistory
}
AuthenticatedTradeHistoryResponse is a response type for trade history
type CancelOrdersResponse ¶
type CancelOrdersResponse struct { OrderID string `json:"orderId"` ClientOrderID string `json:"clientOrderId"` State string `json:"state"` Code int64 `json:"code"` Message string `json:"message"` }
CancelOrdersResponse holds cancelled order info
type ChartData ¶
type ChartData struct { Date int64 `json:"date,string"` High float64 `json:"high,string"` Low float64 `json:"low,string"` Open float64 `json:"open,string"` Close float64 `json:"close,string"` Volume float64 `json:"volume,string"` QuoteVolume float64 `json:"quoteVolume,string"` WeightedAverage float64 `json:"weightedAverage,string"` Error string `json:"error"` }
ChartData holds kline data
type CodeSummaryInfo ¶
type CodeSummaryInfo struct { Currency currency.Code WithdrawalTXFee float64 MinimumConfirmations int64 DepositAddress string WithdrawalDepositDisabled bool Frozen bool }
CodeSummaryInfo defines currency information
type CompleteBalance ¶
type CompleteBalance struct { Available float64 `json:"available,string"` OnOrders float64 `json:"onOrders,string"` BTCValue float64 `json:"btcValue,string"` }
CompleteBalance contains the complete balance with a btcvalue
type CompleteBalances ¶
type CompleteBalances map[string]CompleteBalance
CompleteBalances holds the full balance data
type Currencies ¶
type Currencies struct { ID float64 `json:"id"` Name string `json:"name"` HumanType string `json:"humanType"` CurrencyType string `json:"currencyType"` TxFee float64 `json:"txFee,string"` MinConfirmations int64 `json:"minConf"` DepositAddress string `json:"depositAddress"` WithdrawalDepositDisabled uint8 `json:"disabled"` Frozen uint8 `json:"frozen"` HexColour string `json:"hexColor"` Blockchain string `json:"blockchain"` Delisted uint8 `json:"delisted"` ParentChain string `json:"parentChain"` IsMultiChain uint8 `json:"isMultiChain"` IsChildChain uint8 `json:"isChildChain"` ChildChains []string `json:"childChains"` IsGeofenced uint8 `json:"isGeofenced"` }
Currencies contains currency information
type CurrencyDetails ¶
type CurrencyDetails struct {
// contains filtered or unexported fields
}
CurrencyDetails stores a map of currencies associated with their ID
func (*CurrencyDetails) GetCode ¶
func (w *CurrencyDetails) GetCode(id float64) (currency.Code, error)
GetCode returns a currency code by its ID
func (*CurrencyDetails) GetDepositAddress ¶
func (w *CurrencyDetails) GetDepositAddress(c currency.Code) (string, error)
GetDepositAddress returns the public deposit address details for the currency
func (*CurrencyDetails) GetPair ¶
func (w *CurrencyDetails) GetPair(id float64) (currency.Pair, error)
GetPair returns a currency pair by its ID
func (*CurrencyDetails) GetWithdrawalTXFee ¶
func (w *CurrencyDetails) GetWithdrawalTXFee(c currency.Code) (float64, error)
GetWithdrawalTXFee returns withdrawal transaction fee for the currency
func (*CurrencyDetails) IsPostOnlyForPair ¶
func (w *CurrencyDetails) IsPostOnlyForPair(pair currency.Pair) (bool, error)
IsPostOnlyForPair returns if an order is allowed to take liquidity from the books or reduce positions
func (*CurrencyDetails) IsTradingEnabledForCurrency ¶
func (w *CurrencyDetails) IsTradingEnabledForCurrency(c currency.Code) (bool, error)
IsTradingEnabledForCurrency returns if the currency is allowed to be traded
func (*CurrencyDetails) IsTradingEnabledForPair ¶
func (w *CurrencyDetails) IsTradingEnabledForPair(pair currency.Pair) (bool, error)
IsTradingEnabledForPair returns if the currency pair is allowed to be traded
func (*CurrencyDetails) IsWithdrawAndDepositsEnabled ¶
func (w *CurrencyDetails) IsWithdrawAndDepositsEnabled(c currency.Code) (bool, error)
IsWithdrawAndDepositsEnabled returns if withdrawals or deposits are enabled
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 int64 `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 int64 `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"` }
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 int64 `json:"duration"` AutoRenew bool `json:"autoRenew"` 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 int64 `json:"rangeMin"` RangeMax int64 `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"` LiquidationPrice float64 `json:"liquidationPrice"` 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 int64 `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 OrderStatus ¶
type OrderStatus struct { Result json.RawMessage `json:"result"` Success int64 `json:"success"` }
OrderStatus holds order status data
type OrderStatusData ¶
type OrderStatusData struct { Pair string `json:"currencyPair"` Rate float64 `json:"rate,string"` Amount float64 `json:"amount,string"` Total float64 `json:"total,string"` StartingAmount float64 `json:"startingAmount,string"` Type string `json:"type"` Status string `json:"status"` Date string `json:"date"` Fee float64 `json:"fee,string"` }
OrderStatusData defines order status details
type OrderTrade ¶
type OrderTrade struct { Status string `json:"status"` GlobalTradeID string `json:"globalTradeID"` TradeID string `json:"tradeID"` CurrencyPair string `json:"currencyPair"` Type string `json:"type"` Rate float64 `json:"rate,string"` Amount float64 `json:"amount,string"` Total float64 `json:"total,string"` Fee float64 `json:"fee,string"` Date string `json:"date"` }
OrderTrade holds order trade data
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"` Seq int64 `json:"seq"` }
OrderbookResponse is a sub-type for orderbooks
type OrderbookResponseAll ¶
type OrderbookResponseAll struct {
Data map[string]OrderbookResponse
}
OrderbookResponseAll holds the full response type orderbook
type PairSummaryInfo ¶
PairSummaryInfo defines currency pair information
type Poloniex ¶
Poloniex is the overarching type across the poloniex package
func (*Poloniex) CancelAllOrders ¶
func (p *Poloniex) CancelAllOrders(ctx context.Context, _ *order.Cancel) (order.CancelAllResponse, error)
CancelAllOrders cancels all orders associated with a currency pair
func (*Poloniex) CancelBatchOrders ¶
func (p *Poloniex) CancelBatchOrders(ctx context.Context, o []order.Cancel) (*order.CancelBatchResponse, error)
CancelBatchOrders cancels an orders by their corresponding ID numbers
func (*Poloniex) CancelExistingOrder ¶
CancelExistingOrder cancels and order by orderID
func (*Poloniex) CancelLoanOffer ¶
CancelLoanOffer cancels a loan offer order
func (*Poloniex) CancelMultipleOrdersByIDs ¶
func (p *Poloniex) CancelMultipleOrdersByIDs(ctx context.Context, orderIDs, clientOrderIDs []string) ([]CancelOrdersResponse, error)
CancelMultipleOrdersByIDs Batch cancel one or many smart orders in an account by IDs.
func (*Poloniex) CancelOrder ¶
CancelOrder cancels an order by its corresponding ID number
func (*Poloniex) CloseMarginPosition ¶
CloseMarginPosition closes a current margin position
func (*Poloniex) CreateLoanOffer ¶
func (p *Poloniex) CreateLoanOffer(ctx context.Context, currency string, amount, rate float64, duration int, autoRenew bool) (int64, error)
CreateLoanOffer places a loan offer on the exchange
func (*Poloniex) FetchAccountInfo ¶
func (p *Poloniex) FetchAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
FetchAccountInfo retrieves balances for all enabled currencies
func (*Poloniex) FetchOrderbook ¶
func (p *Poloniex) FetchOrderbook(ctx context.Context, currencyPair currency.Pair, assetType asset.Item) (*orderbook.Base, error)
FetchOrderbook returns orderbook base on the currency pair
func (*Poloniex) FetchTicker ¶
func (p *Poloniex) FetchTicker(ctx context.Context, currencyPair currency.Pair, assetType asset.Item) (*ticker.Price, error)
FetchTicker returns the ticker for a currency pair
func (*Poloniex) FetchTradablePairs ¶
FetchTradablePairs returns a list of the exchanges tradable pairs
func (*Poloniex) GenerateDefaultSubscriptions ¶
func (p *Poloniex) GenerateDefaultSubscriptions() ([]subscription.Subscription, error)
GenerateDefaultSubscriptions Adds default subscriptions to websocket to be handled by ManageSubscriptions()
func (*Poloniex) GenerateNewAddress ¶
GenerateNewAddress generates a new address for a currency
func (*Poloniex) GetAccountFundingHistory ¶
GetAccountFundingHistory returns funding history, deposits and withdrawals
func (*Poloniex) GetActiveLoans ¶
func (p *Poloniex) GetActiveLoans(ctx context.Context) (ActiveLoans, error)
GetActiveLoans returns active loans
func (*Poloniex) GetActiveOrders ¶
func (p *Poloniex) GetActiveOrders(ctx context.Context, req *order.MultiOrderRequest) (order.FilteredOrders, error)
GetActiveOrders retrieves any orders that are active/open
func (*Poloniex) GetAuthenticatedOrderStatus ¶
func (p *Poloniex) GetAuthenticatedOrderStatus(ctx context.Context, orderID string) (o OrderStatusData, err error)
GetAuthenticatedOrderStatus returns the status of a given orderId.
func (*Poloniex) GetAuthenticatedOrderTrades ¶
func (p *Poloniex) GetAuthenticatedOrderTrades(ctx context.Context, orderID string) (o []OrderTrade, err error)
GetAuthenticatedOrderTrades returns all trades involving a given orderId.
func (*Poloniex) GetAuthenticatedTradeHistory ¶
func (p *Poloniex) GetAuthenticatedTradeHistory(ctx context.Context, start, end, limit int64) (AuthenticatedTradeHistoryAll, error)
GetAuthenticatedTradeHistory returns account trade history
func (*Poloniex) GetAuthenticatedTradeHistoryForCurrency ¶
func (p *Poloniex) GetAuthenticatedTradeHistoryForCurrency(ctx context.Context, currency string, start, end, limit int64) (AuthenticatedTradeHistoryResponse, error)
GetAuthenticatedTradeHistoryForCurrency returns account trade history
func (*Poloniex) GetAvailableTransferChains ¶
func (p *Poloniex) GetAvailableTransferChains(ctx context.Context, cryptocurrency currency.Code) ([]string, error)
GetAvailableTransferChains returns the available transfer blockchains for the specific cryptocurrency
func (*Poloniex) GetBalances ¶
GetBalances returns balances for your account.
func (*Poloniex) GetChartData ¶
func (p *Poloniex) GetChartData(ctx context.Context, currencyPair string, start, end time.Time, period string) ([]ChartData, error)
GetChartData returns chart data for a specific currency pair
func (*Poloniex) GetCompleteBalances ¶
func (p *Poloniex) GetCompleteBalances(ctx context.Context) (CompleteBalances, error)
GetCompleteBalances returns complete balances from your account.
func (*Poloniex) GetCurrencies ¶
GetCurrencies returns information about currencies
func (*Poloniex) GetCurrencyTradeURL ¶
func (p *Poloniex) GetCurrencyTradeURL(_ context.Context, a asset.Item, cp currency.Pair) (string, error)
GetCurrencyTradeURL returns the URL to the exchange's trade page for the given asset and currency pair
func (*Poloniex) GetDepositAddress ¶
func (p *Poloniex) GetDepositAddress(ctx context.Context, cryptocurrency currency.Code, _, chain string) (*deposit.Address, error)
GetDepositAddress returns a deposit address for a specified currency
func (*Poloniex) GetDepositAddresses ¶
func (p *Poloniex) GetDepositAddresses(ctx context.Context) (DepositAddresses, error)
GetDepositAddresses returns deposit addresses for all enabled cryptos.
func (*Poloniex) GetDepositsWithdrawals ¶
func (p *Poloniex) GetDepositsWithdrawals(ctx context.Context, start, end string) (DepositsWithdrawals, error)
GetDepositsWithdrawals returns a list of deposits and withdrawals
func (*Poloniex) GetFeeByType ¶
func (p *Poloniex) GetFeeByType(ctx context.Context, feeBuilder *exchange.FeeBuilder) (float64, error)
GetFeeByType returns an estimate of fee based on type of transaction
func (*Poloniex) GetFeeInfo ¶
GetFeeInfo returns fee information
func (*Poloniex) GetFuturesContractDetails ¶
func (p *Poloniex) GetFuturesContractDetails(context.Context, asset.Item) ([]futures.Contract, error)
GetFuturesContractDetails returns all contracts from the exchange by asset type
func (*Poloniex) GetHistoricCandles ¶
func (p *Poloniex) GetHistoricCandles(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, start, end time.Time) (*kline.Item, error)
GetHistoricCandles returns candles between a time period for a set time interval
func (*Poloniex) GetHistoricCandlesExtended ¶
func (p *Poloniex) GetHistoricCandlesExtended(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, start, end time.Time) (*kline.Item, error)
GetHistoricCandlesExtended returns candles between a time period for a set time interval
func (*Poloniex) GetHistoricTrades ¶
func (p *Poloniex) GetHistoricTrades(ctx context.Context, pair currency.Pair, assetType asset.Item, timestampStart, timestampEnd time.Time) ([]trade.Data, error)
GetHistoricTrades returns historic trade data within the timeframe provided
func (*Poloniex) GetLatestFundingRates ¶
func (p *Poloniex) GetLatestFundingRates(context.Context, *fundingrate.LatestRateRequest) ([]fundingrate.LatestRateResponse, error)
GetLatestFundingRates returns the latest funding rates data
func (*Poloniex) GetLendingHistory ¶
func (p *Poloniex) GetLendingHistory(ctx context.Context, start, end string) ([]LendingHistory, error)
GetLendingHistory returns lending history for the account
func (*Poloniex) GetLoanOrders ¶
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) GetOpenOrdersForAllCurrencies ¶
func (p *Poloniex) GetOpenOrdersForAllCurrencies(ctx context.Context) (OpenOrdersResponseAll, error)
GetOpenOrdersForAllCurrencies returns all open orders
func (*Poloniex) GetOrderHistory ¶
func (p *Poloniex) GetOrderHistory(ctx context.Context, req *order.MultiOrderRequest) (order.FilteredOrders, error)
GetOrderHistory retrieves account order information Can Limit response to specific order status
func (*Poloniex) GetOrderInfo ¶
func (p *Poloniex) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, _ asset.Item) (*order.Detail, error)
GetOrderInfo returns order information based on order ID
func (*Poloniex) GetOrderbook ¶
func (p *Poloniex) GetOrderbook(ctx context.Context, currencyPair string, depth int) (OrderbookAll, error)
GetOrderbook returns the full orderbook from poloniex
func (*Poloniex) GetRecentTrades ¶
func (p *Poloniex) GetRecentTrades(ctx context.Context, pair currency.Pair, assetType asset.Item) ([]trade.Data, error)
GetRecentTrades returns the most recent trades for a currency and asset
func (*Poloniex) GetServerTime ¶
GetServerTime returns the current exchange server time.
func (*Poloniex) GetTimestamp ¶
GetTimestamp returns server time
func (*Poloniex) GetTradableBalances ¶
GetTradableBalances returns tradable balances
func (*Poloniex) GetTradeHistory ¶
func (p *Poloniex) GetTradeHistory(ctx context.Context, currencyPair string, start, end int64) ([]TradeHistory, error)
GetTradeHistory returns trades history from poloniex
func (*Poloniex) GetWithdrawalsHistory ¶
func (p *Poloniex) GetWithdrawalsHistory(ctx context.Context, c currency.Code, _ asset.Item) ([]exchange.WithdrawalHistory, error)
GetWithdrawalsHistory returns previous withdrawals data
func (*Poloniex) ModifyOrder ¶
func (p *Poloniex) ModifyOrder(ctx context.Context, action *order.Modify) (*order.ModifyResponse, error)
ModifyOrder will allow of changing orderbook placement and limit to market conversion
func (*Poloniex) MoveOrder ¶
func (p *Poloniex) MoveOrder(ctx context.Context, orderID int64, rate, amount float64, postOnly, immediateOrCancel bool) (MoveOrderResponse, error)
MoveOrder moves an order
func (*Poloniex) PlaceMarginOrder ¶
func (p *Poloniex) PlaceMarginOrder(ctx context.Context, currency string, rate, amount, lendingRate float64, buy bool) (OrderResponse, error)
PlaceMarginOrder places a margin order
func (*Poloniex) PlaceOrder ¶
func (p *Poloniex) PlaceOrder(ctx context.Context, 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(ctx context.Context, ep exchange.URL, method, endpoint string, values url.Values, result interface{}) error
SendAuthenticatedHTTPRequest sends an authenticated HTTP request
func (*Poloniex) SendHTTPRequest ¶
func (p *Poloniex) SendHTTPRequest(ctx context.Context, ep exchange.URL, path string, result interface{}) error
SendHTTPRequest sends an unauthenticated HTTP request
func (*Poloniex) SetDefaults ¶
func (p *Poloniex) SetDefaults()
SetDefaults sets default settings for poloniex
func (*Poloniex) SubmitOrder ¶
SubmitOrder submits a new order
func (*Poloniex) Subscribe ¶
func (p *Poloniex) Subscribe(sub []subscription.Subscription) error
Subscribe sends a websocket message to receive data from the channel
func (*Poloniex) ToggleAutoRenew ¶
ToggleAutoRenew allows for the autorenew of a contract
func (*Poloniex) TransferBalance ¶
func (p *Poloniex) TransferBalance(ctx context.Context, currency, from, to string, amount float64) (bool, error)
TransferBalance transfers balances between your accounts
func (*Poloniex) Unsubscribe ¶
func (p *Poloniex) Unsubscribe(unsub []subscription.Subscription) error
Unsubscribe sends a websocket message to stop receiving data from the channel
func (*Poloniex) UpdateAccountInfo ¶
func (p *Poloniex) UpdateAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
UpdateAccountInfo retrieves balances for all enabled currencies for the Poloniex exchange
func (*Poloniex) UpdateOrderExecutionLimits ¶
UpdateOrderExecutionLimits updates order execution limits
func (*Poloniex) UpdateOrderbook ¶
func (p *Poloniex) UpdateOrderbook(ctx context.Context, pair currency.Pair, assetType asset.Item) (*orderbook.Base, error)
UpdateOrderbook updates and returns the orderbook for a currency pair
func (*Poloniex) UpdateTicker ¶
func (p *Poloniex) UpdateTicker(ctx context.Context, currencyPair currency.Pair, a asset.Item) (*ticker.Price, error)
UpdateTicker updates and returns the ticker for a currency pair
func (*Poloniex) UpdateTickers ¶
UpdateTickers updates the ticker for all currency pairs of a given asset type
func (*Poloniex) UpdateTradablePairs ¶
UpdateTradablePairs updates the exchanges available pairs and stores them in the exchanges config
func (*Poloniex) ValidateAPICredentials ¶
ValidateAPICredentials validates current credentials used for wrapper functionality
func (*Poloniex) WalletActivity ¶
func (p *Poloniex) WalletActivity(ctx context.Context, start, end time.Time, activityType string) (*WalletActivityResponse, error)
WalletActivity returns the wallet activity between set start and end time
func (*Poloniex) Withdraw ¶
func (p *Poloniex) Withdraw(ctx context.Context, currency, address string, amount float64) (*Withdraw, error)
Withdraw withdraws a currency to a specific delegated address. For currencies where there are multiple networks to choose from (like USDT or BTC), you can specify the chain by setting the "currency" parameter to be a multiChain currency name, like USDTTRON, USDTETH, or BTCTRON
func (*Poloniex) WithdrawCryptocurrencyFunds ¶
func (p *Poloniex) WithdrawCryptocurrencyFunds(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is submitted
func (*Poloniex) WithdrawFiatFunds ¶
func (p *Poloniex) WithdrawFiatFunds(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawFiatFunds returns a withdrawal ID when a withdrawal is submitted
func (*Poloniex) WithdrawFiatFundsToInternationalBank ¶
func (p *Poloniex) WithdrawFiatFundsToInternationalBank(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is submitted
func (*Poloniex) WsProcessOrderbookSnapshot ¶
WsProcessOrderbookSnapshot processes a new orderbook snapshot into a local of orderbooks
type RateLimit ¶
RateLimit implements the request.Limiter interface
func SetRateLimit ¶
func SetRateLimit() *RateLimit
SetRateLimit returns the rate limit for the exchange If your account's volume is over $5 million in 30 day volume, you may be eligible for an API rate limit increase. Please email poloniex@circle.com. As per https://docs.poloniex.com/#http-api
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 { ID float64 `json:"id"` 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"` High24Hr float64 `json:"high24hr,string"` Low24Hr float64 `json:"low24hr,string"` IsFrozen uint8 `json:"isFrozen,string"` PostOnly uint8 `json:"postOnly,string"` }
Ticker holds ticker data
type TimeStampResponse ¶
type TimeStampResponse struct {
ServerTime int64 `json:"serverTime"`
}
TimeStampResponse returns the time
type TradeHistory ¶
type TradeHistory struct { GlobalTradeID string `json:"globalTradeID"` TradeID string `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 WalletActivityResponse ¶
type WalletActivityResponse struct { Deposits []WalletDeposits `json:"deposits"` Withdrawals []WalletWithdrawals `json:"withdrawals"` }
WalletActivityResponse holds wallet activity info
type WalletDeposits ¶
type WalletDeposits struct { DepositNumber int64 `json:"depositNumber"` Currency currency.Code `json:"currency"` Address string `json:"address"` Amount float64 `json:"amount,string"` Confirmations int64 `json:"confirmations"` TransactionID string `json:"txid"` Timestamp int64 `json:"timestamp"` Status string `json:"status"` }
WalletDeposits holds wallet deposit info
type WalletWithdrawals ¶
type WalletWithdrawals struct { WithdrawalRequestsID int64 `json:"withdrawalRequestsId"` Currency currency.Code `json:"currency"` Address string `json:"address"` Amount float64 `json:"amount,string"` Fee float64 `json:"fee,string"` Timestamp int64 `json:"timestamp"` Status string `json:"status"` TransactionID string `json:"txid"` IPAddress string `json:"ipAddress"` PaymentID string `json:"paymentID"` }
WalletWithdrawals holds wallet withdrawal info
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
type WebsocketTrollboxMessage ¶
type WebsocketTrollboxMessage struct { MessageNumber float64 Username string Message string Reputation float64 }
WebsocketTrollboxMessage holds trollbox messages and information for websocket
type WsAuthorisationRequest ¶
type WsAuthorisationRequest struct { Command string `json:"command"` Channel int64 `json:"channel"` Sign string `json:"sign"` Key string `json:"key"` Payload string `json:"payload"` }
WsAuthorisationRequest Authenticated Ws Account data request
type WsCommand ¶
type WsCommand struct { Command string `json:"command"` Channel interface{} `json:"channel"` APIKey string `json:"key,omitempty"` Payload string `json:"payload,omitempty"` Sign string `json:"sign,omitempty"` }
WsCommand defines the request params after a websocket connection has been established
type WsOrderUpdateResponse ¶
WsOrderUpdateResponse Authenticated Ws Account data
type WsTicker ¶
type WsTicker struct { LastPrice float64 LowestAsk float64 HighestBid float64 PercentageChange float64 BaseCurrencyVolume24H float64 QuoteCurrencyVolume24H float64 IsFrozen bool HighestTradeIn24H float64 LowestTradePrice24H float64 }
WsTicker defines the websocket ticker response