Documentation
¶
Index ¶
- Constants
- type AccountBalances
- type ActiveLoan
- type ActiveLoans
- type Addresses
- type AvailableAccountBalances
- type Balance
- type Balances
- type Base
- type Buy
- type ChartData
- type ChartDataEntry
- type Currencies
- type Currency
- type DailyVolume
- type DailyVolumeEntry
- type DailyVolumeEntryTemp
- type DailyVolumeTemp
- type DepositsWithdrawals
- type Error
- type FeeInfo
- type LendingHistory
- type LendingHistoryEntry
- type LoanOffer
- type LoanOrder
- type LoanOrders
- type MarginAccountSummary
- type MarginPosition
- type MoveOrder
- type OpenLoanOffer
- type OpenLoanOffers
- type OpenOrder
- type OpenOrders
- type OpenOrdersAll
- type Order
- type OrderBook
- type OrderBookAll
- type OrderBookAllTemp
- type OrderBookTemp
- type OrderStatus
- type OrderTemp
- type OrderTrade
- type OrderTrades
- type Poloniex
- func (p *Poloniex) AccountBalances() (balances AccountBalances, err error)
- func (p *Poloniex) ActiveLoans() (activeLoans ActiveLoans, err error)
- func (p *Poloniex) Addresses() (addresses Addresses, err error)
- func (p *Poloniex) AvailableAccountBalances() (aab AvailableAccountBalances, err error)
- func (p *Poloniex) Balances() (balances Balances, err error)
- func (p *Poloniex) Buy(pair string, rate, amount float64) (buy Buy, err error)
- func (p *Poloniex) BuyFillKill(pair string, rate, amount float64) (buy Buy, err error)
- func (p *Poloniex) BuyImmediateOrCancel(pair string, rate, amount float64) (buy Buy, err error)
- func (p *Poloniex) BuyPostOnly(pair string, rate, amount float64) (buy Buy, err error)
- func (p *Poloniex) CancelLoanOffer(orderNumber int64) (success bool, err error)
- func (p *Poloniex) CancelOrder(orderNumber int64) (success bool, err error)
- func (p *Poloniex) ChartData(pair string) (chartData ChartData, err error)
- func (p *Poloniex) ChartDataCurrent(pair string) (chartData ChartData, err error)
- func (p *Poloniex) ChartDataPeriod(pair string, start, end time.Time, period ...int) (chartData ChartData, err error)
- func (p *Poloniex) CloseMarginPosition(pair string) (success bool, err error)
- func (p *Poloniex) Currencies() (currencies Currencies, err error)
- func (p *Poloniex) DailyVolume() (dailyVolume DailyVolume, err error)
- func (p *Poloniex) Debug()
- func (p *Poloniex) DepositsWithdrawals() (depositsWithdrawals DepositsWithdrawals, err error)
- func (p *Poloniex) Emit(event interface{}, arguments ...interface{}) *emission.Emitter
- func (p *Poloniex) FeeInfo() (fi FeeInfo, err error)
- func (p *Poloniex) GenerateNewAddress(currency string) (address string, err error)
- func (p *Poloniex) LendingHistory(start, end int64, limit int64) (lh LendingHistory, err error)
- func (p *Poloniex) LoanOffer(currency string, amount float64, duration int, renew bool, lendingRate float64) (loanOffer LoanOffer, err error)
- func (p *Poloniex) LoanOrders(currency string) (loanOrders LoanOrders, err error)
- func (p *Poloniex) MarginAccountSummary() (mas MarginAccountSummary, err error)
- func (p *Poloniex) MarginBuy(pair string, rate float64, lendingRate float64, amount float64, ...) (buy Buy, err error)
- func (p *Poloniex) MarginPosition(pair string) (mp MarginPosition, err error)
- func (p *Poloniex) MarginSell(pair string, rate float64, lendingRate float64, amount float64, ...) (sell Sell, err error)
- func (p *Poloniex) Move(orderNumber int64, rate float64) (moveOrder MoveOrder, err error)
- func (p *Poloniex) MoveImmediateOrCancel(orderNumber int64, rate float64) (moveOrder MoveOrder, err error)
- func (p *Poloniex) MovePostOnly(orderNumber int64, rate float64) (moveOrder MoveOrder, err error)
- func (p *Poloniex) Off(event interface{}, listener interface{}) *emission.Emitter
- func (p *Poloniex) On(event interface{}, listener interface{}) *emission.Emitter
- func (p *Poloniex) OpenLoanOffers() (openLoanOffers OpenLoanOffers, err error)
- func (p *Poloniex) OpenOrders(pair string) (openOrders OpenOrders, err error)
- func (p *Poloniex) OpenOrdersAll() (openOrders OpenOrdersAll, err error)
- func (p *Poloniex) OrderBook(pair string) (orderBook OrderBook, err error)
- func (p *Poloniex) OrderBookAll() (orderBook OrderBookAll, err error)
- func (p *Poloniex) OrderStatus(orderNumber int64) (os OrderStatus, err error)
- func (p *Poloniex) OrderTrades(orderNumber int64) (ot OrderTrades, err error)
- func (p *Poloniex) PrivateTradeHistory(pair string, dates ...int64) (history PrivateTradeHistory, err error)
- func (p *Poloniex) PrivateTradeHistoryAll(dates ...int64) (history PrivateTradeHistoryAll, err error)
- func (p *Poloniex) Sell(pair string, rate, amount float64) (sell Sell, err error)
- func (p *Poloniex) SellFillKill(pair string, rate, amount float64) (sell Sell, err error)
- func (p *Poloniex) SellImmediateOrCancel(pair string, rate, amount float64) (sell Sell, err error)
- func (p *Poloniex) SellPostOnly(pair string, rate, amount float64) (sell Sell, err error)
- func (p *Poloniex) StartWS()
- func (p *Poloniex) Subscribe(chid string) error
- func (p *Poloniex) Ticker() (ticker Ticker, err error)
- func (p *Poloniex) ToggleAutoRenew(orderNumber int64) (success bool, err error)
- func (p *Poloniex) TradableBalances() (tb TradableBalances, err error)
- func (p *Poloniex) TradeHistory(pair string, dates ...int64) (tradeHistory TradeHistory, err error)
- func (p *Poloniex) TransferBalance(currency string, amount float64, from string, to string) (tb TransferBalance, err error)
- func (p *Poloniex) Unsubscribe(chid string) error
- func (p *Poloniex) WSIdle(dur time.Duration, callbacks ...WSReportFunc)
- func (p *Poloniex) Withdraw(currency string, amount float64, address string) (w Withdraw, err error)
- type PrivateTradeHistory
- type PrivateTradeHistoryAll
- type PrivateTradeHistoryEntry
- type ResultingTrade
- type Sell
- type Ticker
- type TickerEntry
- type TradableBalance
- type TradableBalances
- type TradeHistory
- type TradeHistoryEntry
- type TransferBalance
- type WSOrderbook
- type WSReportFunc
- type WSTicker
- type Withdraw
Examples ¶
Constants ¶
const ( // PUBLICURI is the address of the public API on Poloniex PUBLICURI = "https://poloniex.com/public" // PRIVATEURI is the address of the public API on Poloniex PRIVATEURI = "https://poloniex.com/tradingApi" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalances ¶
type AccountBalances struct { Exchange map[string]float64 Margin map[string]float64 Lending map[string]float64 }
AccountBalances are all of your balances
type ActiveLoan ¶
type ActiveLoan struct { ID int64 `json:"id"` Currency string Rate float64 `json:",string"` Amount float64 `json:",string"` Range int64 Renewable bool AutoRenew int64 `json:"autoRenew"` Date string DateTaken time.Time Fees float64 `json:",string"` }
ActiveLoan holds your active single loan.
type ActiveLoans ¶
type ActiveLoans struct {
Provided []ActiveLoan
}
ActiveLoans holds your active loans.
type AvailableAccountBalances ¶
type AvailableAccountBalances struct { Exchange map[string]float64 Margin map[string]float64 Lending map[string]float64 }
AvailableAccountBalances holds your balances sorted by account.
type Balance ¶
type Balance struct { Available float64 `json:",string"` OnOrders float64 `json:"onOrders,string"` BTCValue float64 `json:"btcValue,string"` }
Balance is a single balance entry used in the Balances map
Example ¶
p := New("config.json") balances, err := p.Balances() if err != nil { log.Fatalln(err) } fmt.Printf("%+v\n", balances)
Output:
type Balances ¶
Balances are all of your balances available for trade after having deducted all open orders
type Buy ¶
type Buy struct { OrderNumber int64 `json:",string"` ResultingTrades []ResultingTrade }
Buy orders
type ChartData ¶
type ChartData []ChartDataEntry
ChartData holds OHLC data for a period of time at specific resolution
type ChartDataEntry ¶
type ChartDataEntry struct { Date int64 High float64 Low float64 Open float64 Close float64 Volume float64 QuoteVolume float64 WeightedAverage float64 }
ChartDataEntry holds OHLC data for a specific period of time at a specific resolution
type Currencies ¶
Currencies holds information about the available currencies
type Currency ¶
type Currency struct { Name string TxFee float64 `json:",string"` MinConf float64 DepositAddress string Disabled int64 Delisted int64 Frozen int64 }
Currency holds information about a specific currency
type DailyVolume ¶
type DailyVolume map[string]DailyVolumeEntry
DailyVolume is the 24-hour volume for all markets as well as totals for primary currencies
type DailyVolumeEntry ¶
DailyVolumeEntry is the 24-hour volume for a market
type DailyVolumeEntryTemp ¶
type DailyVolumeEntryTemp map[string]interface{}
DailyVolumeEntryTemp ::::
type DepositsWithdrawals ¶
type DepositsWithdrawals struct { Deposits []deposit Withdrawals []withdrawal Adjustments []adjustment }
DepositsWithdrawals holds the history of deposit and withdrawal
type FeeInfo ¶
type FeeInfo struct { MakerFee float64 `json:"makerFee,string"` TakerFee float64 `json:"takerFee,string"` ThirtyDayVolume float64 `json:"thirtyDayVolume,string"` NextTier float64 `json:"nextTier,string"` }
FeeInfo is the maker-taker fee schedule, returns your current trading fees and trailing 30-day volume in BTC.
type LendingHistory ¶
type LendingHistory []LendingHistoryEntry
LendingHistory holds the lending history for a time period
type LendingHistoryEntry ¶
type LendingHistoryEntry struct { ID int64 `json:"id"` Currency string Rate float64 `json:",string"` Amount float64 `json:",string"` Duration float64 `json:",string"` Interest float64 `json:",string"` Earned float64 `json:",string"` Open string Close string Fee float64 `json:",string"` }
LendingHistoryEntry describes one lending history event
type LoanOrder ¶
type LoanOrder struct { Rate float64 `json:",string"` Amount float64 `json:",string"` RangeMin float64 RangeMax float64 }
LoanOrder holds the a loan offer/demand for a given currency
type LoanOrders ¶
LoanOrders holds the list of loan offers and demands for a given currency
type MarginAccountSummary ¶
type MarginAccountSummary struct { TotalValue float64 `json:"totalValue,string"` ProfitLoss float64 `json:"pl,string"` LendingFees float64 `json:"lendingFees,string"` NetValue float64 `json:"netValue,string"` TotalBorrowedValue float64 `json:"totalBorrowedValue,string"` CurrentMargin float64 `json:"currentMargin,string"` }
MarginAccountSummary holds a summary of your entire margin account.
type MarginPosition ¶
type MarginPosition struct { Amount float64 `json:",string"` Total float64 `json:",string"` BasePrice float64 `json:",string"` LiquidationPrice float64 `json:",string"` PL float64 `json:",string"` LendingFees float64 `json:",string"` Type string }
MarginPosition of a pair
type MoveOrder ¶
type MoveOrder struct { Base OrderNumber int64 `json:",string"` ResultingTrades []ResultingTrade }
MoveOrder status
type OpenLoanOffer ¶
type OpenLoanOffer struct { ID int64 `json:"id"` Rate float64 `json:",string"` Amount float64 `json:",string"` Duration int64 Renewable bool AutoRenew int64 `json:"autoRenew"` Date string DateTaken time.Time }
OpenLoanOffer holds your open loan offers for a single currency.
type OpenLoanOffers ¶
type OpenLoanOffers map[string][]OpenLoanOffer
OpenLoanOffers holds your open loan offers for each currency.
type OpenOrder ¶
type OpenOrder struct { OrderNumber int64 `json:",string"` Type string Rate float64 `json:",string"` StartingAmount float64 `json:",string"` Amount float64 `json:",string"` Total float64 `json:",string"` Date string Margin bool }
OpenOrder is a singular entry used in the OpenOrders type
type OpenOrders ¶
type OpenOrders []OpenOrder
OpenOrders is the list of open orders for the pair specified
type OrderBook ¶
OrderBook for a given market
Example ¶
p := NewPublicOnly() ob, err := p.OrderBook("BTC_ETH") if err != nil { log.Fatalln(err) } pp.Println(ob.Asks[0], ob.Bids[0])
Output:
type OrderBookAll ¶
OrderBookAll holds the OrderBooks for all markets
type OrderBookTemp ¶
OrderBookTemp ::::
type OrderStatus ¶
type OrderStatus struct { Status string Rate float64 `json:",string"` Amount float64 `json:",string"` Pair string `json:"currencyPair"` Date string Total float64 `json:",string"` Type string StartingAmount float64 `json:"startingAmount,string"` }
OrderStatus holds the status of a given order
type OrderTrade ¶
type OrderTrade struct { GlobalTradeID int64 `json:"globalTradeID"` TradeID int64 `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 a singular trade involved in a given order
type OrderTrades ¶
type OrderTrades []OrderTrade
OrderTrades holds all trades involving a given order,
type Poloniex ¶
type Poloniex struct { Key string Secret string ByID map[string]string ByName map[string]string // contains filtered or unexported fields }
Poloniex describes the API
Example ¶
p := NewWithCredentials("Key goes here", "secret goes here") p.Subscribe("ticker") p.Subscribe("USDT_BTC") p.On("ticker", func(m WSTicker) { pp.Println(m) }).On("USDT_BTC-trade", func(m WSOrderbook) { pp.Println(m) }) select {}
Output:
func NewPublicOnly ¶
func NewPublicOnly() *Poloniex
NewPublicOnly allows the use of the public and websocket api only
func NewWithConfig ¶
NewWithConfig is the replacement function for New, pass in a configfile to use
func NewWithCredentials ¶
NewWithCredentials allows to pass in the key and secret directly
func (*Poloniex) AccountBalances ¶
func (p *Poloniex) AccountBalances() (balances AccountBalances, err error)
AccountBalances beturns your balances sorted by account.
func (*Poloniex) ActiveLoans ¶
func (p *Poloniex) ActiveLoans() (activeLoans ActiveLoans, err error)
ActiveLoans returns your active loans for each currency.
func (*Poloniex) AvailableAccountBalances ¶
func (p *Poloniex) AvailableAccountBalances() (aab AvailableAccountBalances, err error)
AvailableAccountBalances returns your balances sorted by account.
func (*Poloniex) Balances ¶
Balances returns all of your balances available for trade after having deducted all open orders.
func (*Poloniex) BuyFillKill ¶
BuyFillKill places a limit buy order in a given market. If the order is not immediately entirely filled, the order is killed
func (*Poloniex) BuyImmediateOrCancel ¶
BuyImmediateOrCancel places a limit buy order in a given market. This order can be partially or completely filled, but any portion of the order that cannot be filled immediately will be canceled
func (*Poloniex) BuyPostOnly ¶
BuyPostOnly places a limit buy order in a given market the order is only placed if no portion of the order is filled immediately
func (*Poloniex) CancelLoanOffer ¶
CancelLoanOffer cancels the loan offer specified .
func (*Poloniex) CancelOrder ¶
CancelOrder cancels an order you have placed in a given market
func (*Poloniex) ChartData ¶
ChartData returns OHLC chart data for the last 24 hour period at 5 minute resolution.
func (*Poloniex) ChartDataCurrent ¶
ChartDataCurrent returns OHLC chart data for the last period at 5 minute resolution.
func (*Poloniex) ChartDataPeriod ¶
func (p *Poloniex) ChartDataPeriod(pair string, start, end time.Time, period ...int) (chartData ChartData, err error)
ChartDataPeriod returns OHLC chart data for the specified period at a specified ersolution (default 5 minute resolution).
func (*Poloniex) CloseMarginPosition ¶
CloseMarginPosition closes a margin position
func (*Poloniex) Currencies ¶
func (p *Poloniex) Currencies() (currencies Currencies, err error)
Currencies returns information about currencies.
func (*Poloniex) DailyVolume ¶
func (p *Poloniex) DailyVolume() (dailyVolume DailyVolume, err error)
DailyVolume returns the 24-hour volume for all markets as well as totals for primary currencies
func (*Poloniex) Debug ¶
func (p *Poloniex) Debug()
Debug turns on debugmode, which basically dumps all responses from the poloniex API REST server
func (*Poloniex) DepositsWithdrawals ¶
func (p *Poloniex) DepositsWithdrawals() (depositsWithdrawals DepositsWithdrawals, err error)
DepositsWithdrawals returns your deposit and withdrawal history for the last 6 months,
func (*Poloniex) FeeInfo ¶
FeeInfo returns your current trading fees and trailing 30-day volume in BTC
func (*Poloniex) GenerateNewAddress ¶
GenerateNewAddress generates a new deposit address for the currency specified
func (*Poloniex) LendingHistory ¶
func (p *Poloniex) LendingHistory(start, end int64, limit int64) (lh LendingHistory, err error)
LendingHistory returns the lending history for a specified date range
func (*Poloniex) LoanOffer ¶
func (p *Poloniex) LoanOffer(currency string, amount float64, duration int, renew bool, lendingRate float64) (loanOffer LoanOffer, err error)
LoanOffer creates a loan offer for a given currency.
func (*Poloniex) LoanOrders ¶
func (p *Poloniex) LoanOrders(currency string) (loanOrders LoanOrders, err error)
LoanOrders returns the list of loan offers and demands for a given currency,
func (*Poloniex) MarginAccountSummary ¶
func (p *Poloniex) MarginAccountSummary() (mas MarginAccountSummary, err error)
MarginAccountSummary returns a summary of your entire margin account
func (*Poloniex) MarginBuy ¶
func (p *Poloniex) MarginBuy(pair string, rate float64, lendingRate float64, amount float64, clientOrderIDs ...string) (buy Buy, err error)
MarginBuy enters a buy order into the margin markets
func (*Poloniex) MarginPosition ¶
func (p *Poloniex) MarginPosition(pair string) (mp MarginPosition, err error)
MarginPosition returns margin position info for a pair
func (*Poloniex) MarginSell ¶
func (p *Poloniex) MarginSell(pair string, rate float64, lendingRate float64, amount float64, clientOrderIDs ...string) (sell Sell, err error)
MarginSell enters a sell order into the margin markets
func (*Poloniex) Move ¶
Move 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 (*Poloniex) MoveImmediateOrCancel ¶
func (p *Poloniex) MoveImmediateOrCancel(orderNumber int64, rate float64) (moveOrder MoveOrder, err error)
MoveImmediateOrCancel 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. This order can be partially or completely filled, but any portion of the order that cannot be filled immediately will be canceled
func (*Poloniex) MovePostOnly ¶
MovePostOnly 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. the order is only placed if no portion of the order is filled immediately
func (*Poloniex) OpenLoanOffers ¶
func (p *Poloniex) OpenLoanOffers() (openLoanOffers OpenLoanOffers, err error)
OpenLoanOffers returns your open loan offers for each currency.
func (*Poloniex) OpenOrders ¶
func (p *Poloniex) OpenOrders(pair string) (openOrders OpenOrders, err error)
OpenOrders returns your open orders for a given market
func (*Poloniex) OpenOrdersAll ¶
func (p *Poloniex) OpenOrdersAll() (openOrders OpenOrdersAll, err error)
OpenOrdersAll returns your open orders for all markets
func (*Poloniex) OrderBook ¶
OrderBook returns the order book for a given market, as well as a sequence number used by websockets for synchronization of book updates and an indicator specifying whether the market is frozen.
func (*Poloniex) OrderBookAll ¶
func (p *Poloniex) OrderBookAll() (orderBook OrderBookAll, err error)
OrderBookAll returns the order book for all markets, as well as a sequence number used by websockets for synchronization of book updates and an indicator specifying whether the market is frozen.
func (*Poloniex) OrderStatus ¶
func (p *Poloniex) OrderStatus(orderNumber int64) (os OrderStatus, err error)
OrderStatus returns the status of an individual order
func (*Poloniex) OrderTrades ¶
func (p *Poloniex) OrderTrades(orderNumber int64) (ot OrderTrades, err error)
OrderTrades returns all trades involving a given order,
func (*Poloniex) PrivateTradeHistory ¶
func (p *Poloniex) PrivateTradeHistory(pair string, dates ...int64) (history PrivateTradeHistory, err error)
PrivateTradeHistory takes a string pair and 2 unix timestamps as the start and end date period for the request.
func (*Poloniex) PrivateTradeHistoryAll ¶
func (p *Poloniex) PrivateTradeHistoryAll(dates ...int64) (history PrivateTradeHistoryAll, err error)
PrivateTradeHistoryAll takes 2 unix timestamps as the start and end date period for the request.
func (*Poloniex) SellFillKill ¶
SellFillKill places a limit sell order in a given market. If the order is not immediately entirely filled, the order is killed
func (*Poloniex) SellImmediateOrCancel ¶
SellImmediateOrCancel places a limit sell order in a given market. This order can be partially or completely filled, but any portion of the order that cannot be filled immediately will be canceled
func (*Poloniex) SellPostOnly ¶
SellPostOnly places a limit sell order in a given market the order is only placed if no portion of the order is filled immediately
func (*Poloniex) StartWS ¶
func (p *Poloniex) StartWS()
StartWS opens the websocket connection, and waits for message events
func (*Poloniex) Subscribe ¶
Subscribe to a particular channel specified by channel id: 1000 Private Account Notifications (Beta) 1002 Public Ticker Data 1003 Public 24 Hour Exchange Volume 1010 Public Heartbeat <currency pair> Public Price Aggregated Book
func (*Poloniex) Ticker ¶
Ticker retrieves summary information for each currency pair listed on the exchange.
func (*Poloniex) ToggleAutoRenew ¶
ToggleAutoRenew toggles the autoRenew setting on an active loan,
func (*Poloniex) TradableBalances ¶
func (p *Poloniex) TradableBalances() (tb TradableBalances, err error)
TradableBalances returns your current tradable balances for each currency in each market for which margin trading is enabled
func (*Poloniex) TradeHistory ¶
func (p *Poloniex) TradeHistory(pair string, dates ...int64) (tradeHistory TradeHistory, err error)
TradeHistory returns the past 200 trades for a given market, or up to 50,000 trades between a range specified in UNIX timestamps by the "start" and "end" GET parameters.
If a single date is passed then that is used as the startdate, and current date is used for the enddate. A startdate and enddate may be passed to select a specific period.
func (*Poloniex) TransferBalance ¶
func (p *Poloniex) TransferBalance(currency string, amount float64, from string, to string) (tb TransferBalance, err error)
TransferBalance transfers funds from one account to another (e.g. from your exchange account to your margin account).
func (*Poloniex) Unsubscribe ¶
Unsubscribe from the specified channel: 1000 Private Account Notifications (Beta) 1002 Public Ticker Data 1003 Public 24 Hour Exchange Volume 1010 Public Heartbeat <currency pair> Public Price Aggregated Book
func (*Poloniex) WSIdle ¶
func (p *Poloniex) WSIdle(dur time.Duration, callbacks ...WSReportFunc)
WSIdle idles whilst waiting for callbacks
func (*Poloniex) Withdraw ¶
func (p *Poloniex) Withdraw(currency string, amount float64, address string) (w Withdraw, err error)
Withdraw immediately places a withdrawal for a given currency, with no email confirmation. In order to use this method, withdrawal privilege must be enabled for your API key.
type PrivateTradeHistory ¶
type PrivateTradeHistory []PrivateTradeHistoryEntry
PrivateTradeHistory holds your trade history for a given market,
type PrivateTradeHistoryAll ¶
type PrivateTradeHistoryAll map[string]PrivateTradeHistory
PrivateTradeHistoryAll holds the trade histories of all markets
type PrivateTradeHistoryEntry ¶
type PrivateTradeHistoryEntry struct { Date string Rate float64 `json:",string"` Amount float64 `json:",string"` Total float64 `json:",string"` OrderNumber int64 `json:",string"` Type string GlobalTradeID int64 `json:"globalTradeID"` TradeID int64 `json:"tradeID"` Fee float64 `json:",string"` Category string }
PrivateTradeHistoryEntry holds a singular trade history event
type ResultingTrade ¶
type ResultingTrade struct { Amount float64 `json:",string"` Rate float64 `json:",string"` Date string Total float64 `json:",string"` TradeID string `json:"tradeID"` Type string Fee float64 `json:",string"` Pair string `json:"currencyPair"` ClientOrderID string `json:"clientOrderId"` }
ResultingTrade which form part of an order
type Ticker ¶
type Ticker map[string]TickerEntry
Ticker is summary information for all currency pairs
type TickerEntry ¶
type TickerEntry struct { Last float64 `json:",string"` Ask float64 `json:"lowestAsk,string"` Bid float64 `json:"highestBid,string"` Change float64 `json:"percentChange,string"` BaseVolume float64 `json:"baseVolume,string"` QuoteVolume float64 `json:"quoteVolume,string"` IsFrozen int64 `json:"isFrozen,string"` High float64 `json:"high24hr,string"` Low float64 `json:"low24hr,string"` ID int64 `json:"id"` }
TickerEntry is summary information for a currency pair
type TradableBalance ¶
TradableBalance holds your current tradable balances for the two currencies in a single market for which margin trading is enabled.
type TradableBalances ¶
type TradableBalances map[string]TradableBalance
TradableBalances holds your current tradable balances for each currency in each market for which margin trading is enabled.
type TradeHistory ¶
type TradeHistory []TradeHistoryEntry
TradeHistory holds the historical trades for a given market
type TradeHistoryEntry ¶
type TradeHistoryEntry struct { ID int64 `json:"globalTradeID"` TradeID int64 `json:"tradeID"` Date string Type string Rate float64 `json:",string"` Amount float64 `json:",string"` Total float64 `json:",string"` }
TradeHistoryEntry holds an individual historical order
type TransferBalance ¶
TransferBalance holds status of a balance transfer.
type WSOrderbook ¶
type WSOrderbook struct { Pair string Event string TradeID int64 Type string Rate float64 Amount float64 Total float64 TS time.Time }
WSOrderbook ::::