Documentation ¶
Index ¶
- type AccountInfo
- type ActiveOrders
- type CancelOrder
- type CoinDepositAddress
- type CreateCoupon
- type Info
- type OrderInfo
- type Orderbook
- type Pair
- type RedeemCoupon
- type Response
- type Ticker
- type Trade
- type TradeHistory
- type Trades
- type TransHistory
- type WEX
- func (w *WEX) CancelOrder(OrderID int64) (bool, error)
- func (w *WEX) CoinDepositAddress(coin string) (string, error)
- func (w *WEX) CreateCoupon(currency string, amount float64) (CreateCoupon, error)
- func (w *WEX) GetAccountInfo() (AccountInfo, error)
- func (w *WEX) GetActiveOrders(pair string) (map[string]ActiveOrders, error)
- func (w *WEX) GetDepth(symbol string) (Orderbook, error)
- func (w *WEX) GetExchangeAccountInfo() (exchange.AccountInfo, error)
- func (w *WEX) GetFee() float64
- func (w *WEX) GetInfo() (Info, error)
- func (w *WEX) GetOrderInfo(OrderID int64) (map[string]OrderInfo, error)
- func (w *WEX) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (w *WEX) GetTicker(symbol string) (map[string]Ticker, error)
- func (w *WEX) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (w *WEX) GetTradeHistory(TIDFrom, Count, TIDEnd int64, order, since, end, pair string) (map[string]TradeHistory, error)
- func (w *WEX) GetTrades(symbol string) ([]Trades, error)
- func (w *WEX) GetTransactionHistory(TIDFrom, Count, TIDEnd int64, order, since, end string) (map[string]TransHistory, error)
- func (w *WEX) RedeemCoupon(coupon string) (RedeemCoupon, error)
- func (w *WEX) Run()
- func (w *WEX) SendAuthenticatedHTTPRequest(method string, values url.Values, result interface{}) (err error)
- func (w *WEX) SetDefaults()
- func (w *WEX) Setup(exch config.ExchangeConfig)
- func (w *WEX) Start()
- func (w *WEX) Trade(pair, orderType string, amount, price float64) (int64, error)
- func (w *WEX) UpdateOrderbook(p pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (w *WEX) UpdateTicker(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (w *WEX) WithdrawCoins(coin string, amount float64, address string) (WithdrawCoins, error)
- type WithdrawCoins
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountInfo ¶
type AccountInfo struct { Funds map[string]float64 `json:"funds"` OpenOrders int `json:"open_orders"` Rights struct { Info int `json:"info"` Trade int `json:"trade"` Withdraw int `json:"withdraw"` } `json:"rights"` ServerTime float64 `json:"server_time"` TransactionCount int `json:"transaction_count"` }
AccountInfo stores the account information for a user
type ActiveOrders ¶
type ActiveOrders struct { Pair string `json:"pair"` Type string `json:"sell"` Amount float64 `json:"amount"` Rate float64 `json:"rate"` TimestampCreated float64 `json:"time_created"` Status int `json:"status"` }
ActiveOrders stores active order information
type CancelOrder ¶
type CancelOrder struct { OrderID float64 `json:"order_id"` Funds map[string]float64 `json:"funds"` }
CancelOrder is used for the CancelOrder API request response
type CoinDepositAddress ¶
type CoinDepositAddress struct {
Address string `json:"address"`
}
CoinDepositAddress stores a curency deposit address
type CreateCoupon ¶
type CreateCoupon struct { Coupon string `json:"coupon"` TransID int64 `json:"transID"` Funds map[string]float64 `json:"funds"` }
CreateCoupon stores information coupon information
type OrderInfo ¶
type OrderInfo struct { Pair string `json:"pair"` Type string `json:"sell"` StartAmount float64 `json:"start_amount"` Amount float64 `json:"amount"` Rate float64 `json:"rate"` TimestampCreated float64 `json:"time_created"` Status int `json:"status"` }
OrderInfo stores order information
type Pair ¶
type Pair struct { DecimalPlaces int `json:"decimal_places"` MinPrice float64 `json:"min_price"` MaxPrice float64 `json:"max_price"` MinAmount float64 `json:"min_amount"` Hidden int `json:"hidden"` Fee float64 `json:"fee"` }
Pair holds pair information
type RedeemCoupon ¶
type RedeemCoupon struct { CouponAmount float64 `json:"couponAmount,string"` CouponCurrency string `json:"couponCurrency"` TransID int64 `json:"transID"` }
RedeemCoupon stores redeem coupon information
type Response ¶
type Response struct { Return interface{} `json:"return"` Success int `json:"success"` Error string `json:"error"` }
Response is a generic struct used for exchange API request result
type Ticker ¶
type Ticker struct { High float64 Low float64 Avg float64 Vol float64 VolumeCurrent float64 `json:"vol_cur"` Last float64 Buy float64 Sell float64 Updated int64 }
Ticker stores the ticker information
type Trade ¶
type Trade struct { Received float64 `json:"received"` Remains float64 `json:"remains"` OrderID float64 `json:"order_id"` Funds map[string]float64 `json:"funds"` }
Trade stores the trade information
type TradeHistory ¶
type TradeHistory struct { Pair string `json:"pair"` Type string `json:"type"` Amount float64 `json:"amount"` Rate float64 `json:"rate"` OrderID float64 `json:"order_id"` MyOrder int `json:"is_your_order"` Timestamp float64 `json:"timestamp"` }
TradeHistory stores trade history
type Trades ¶
type Trades struct { Type string `json:"type"` Price float64 `json:"bid"` Amount float64 `json:"amount"` TID int64 `json:"tid"` Timestamp int64 `json:"timestamp"` }
Trades stores trade information
type TransHistory ¶
type TransHistory struct { Type int `json:"type"` Amount float64 `json:"amount"` Currency string `json:"currency"` Description string `json:"desc"` Status int `json:"status"` Timestamp float64 `json:"timestamp"` }
TransHistory stores transaction history
type WEX ¶
WEX is the overarching type across the wex package
func (*WEX) CancelOrder ¶
CancelOrder cancels an order for a specific order ID
func (*WEX) CoinDepositAddress ¶
CoinDepositAddress returns the deposit address for a specific currency
func (*WEX) CreateCoupon ¶
func (w *WEX) CreateCoupon(currency string, amount float64) (CreateCoupon, error)
CreateCoupon creates an exchange coupon for a sepcific currency
func (*WEX) GetAccountInfo ¶
func (w *WEX) GetAccountInfo() (AccountInfo, error)
GetAccountInfo returns a users account info
func (*WEX) GetActiveOrders ¶
func (w *WEX) GetActiveOrders(pair string) (map[string]ActiveOrders, error)
GetActiveOrders returns the active orders for a specific currency
func (*WEX) GetExchangeAccountInfo ¶
func (w *WEX) GetExchangeAccountInfo() (exchange.AccountInfo, error)
GetExchangeAccountInfo retrieves balances for all enabled currencies for the WEX exchange
func (*WEX) GetOrderInfo ¶
GetOrderInfo returns the order info for a specific order ID
func (*WEX) GetOrderbookEx ¶
GetOrderbookEx returns the orderbook for a currency pair
func (*WEX) GetTickerPrice ¶
GetTickerPrice returns the ticker for a currency pair
func (*WEX) GetTradeHistory ¶
func (w *WEX) GetTradeHistory(TIDFrom, Count, TIDEnd int64, order, since, end, pair string) (map[string]TradeHistory, error)
GetTradeHistory returns the trade history
func (*WEX) GetTransactionHistory ¶
func (w *WEX) GetTransactionHistory(TIDFrom, Count, TIDEnd int64, order, since, end string) (map[string]TransHistory, error)
GetTransactionHistory returns the transaction history
func (*WEX) RedeemCoupon ¶
func (w *WEX) RedeemCoupon(coupon string) (RedeemCoupon, error)
RedeemCoupon redeems an exchange coupon
func (*WEX) SendAuthenticatedHTTPRequest ¶
func (w *WEX) SendAuthenticatedHTTPRequest(method string, values url.Values, result interface{}) (err error)
SendAuthenticatedHTTPRequest sends an authenticated HTTP request to WEX
func (*WEX) SetDefaults ¶
func (w *WEX) SetDefaults()
SetDefaults sets current default value for WEX
func (*WEX) Setup ¶
func (w *WEX) Setup(exch config.ExchangeConfig)
Setup sets exchange configuration parameters for WEX
func (*WEX) UpdateOrderbook ¶
UpdateOrderbook updates and returns the orderbook for a currency pair
func (*WEX) UpdateTicker ¶
UpdateTicker updates and returns the ticker for a currency pair
func (*WEX) WithdrawCoins ¶
WithdrawCoins withdraws coins for a specific coin