Documentation
¶
Index ¶
- type AccountInfo
- type ActiveOrders
- type CancelOrder
- type CreateCoupon
- type DepositAddress
- type Info
- type OrderInfo
- type Orderbook
- type Pair
- type RedeemCoupon
- type Response
- type Ticker
- type Trade
- type TradeHistory
- type Trades
- type WithdrawCoinsToAddress
- type Yobit
- func (y *Yobit) CancelAllExchangeOrders() error
- func (y *Yobit) CancelExchangeOrder(orderID int64) error
- func (y *Yobit) CancelOrder(OrderID int64) (bool, error)
- func (y *Yobit) CreateCoupon(currency string, amount float64) (CreateCoupon, error)
- func (y *Yobit) GetAccountInfo() (AccountInfo, error)
- func (y *Yobit) GetActiveOrders(pair string) (map[string]ActiveOrders, error)
- func (y *Yobit) GetDepositAddress(coin string) (DepositAddress, error)
- func (y *Yobit) GetDepth(symbol string) (Orderbook, error)
- func (y *Yobit) GetExchangeAccountInfo() (exchange.AccountInfo, error)
- func (y *Yobit) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error)
- func (y *Yobit) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error)
- func (y *Yobit) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error)
- func (y *Yobit) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error)
- func (y *Yobit) GetFee() float64
- func (y *Yobit) GetInfo() (Info, error)
- func (y *Yobit) GetOrderInfo(OrderID int64) (map[string]OrderInfo, error)
- func (y *Yobit) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (y *Yobit) GetTicker(symbol string) (map[string]Ticker, error)
- func (y *Yobit) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (y *Yobit) GetTradeHistory(TIDFrom, Count, TIDEnd int64, order, since, end, pair string) (map[string]TradeHistory, error)
- func (y *Yobit) GetTrades(symbol string) ([]Trades, error)
- func (y *Yobit) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error)
- func (y *Yobit) RedeemCoupon(coupon string) (RedeemCoupon, error)
- func (y *Yobit) Run()
- func (y *Yobit) SendAuthenticatedHTTPRequest(path string, params url.Values, result interface{}) (err error)
- func (y *Yobit) SendHTTPRequest(path string, result interface{}) error
- func (y *Yobit) SetDefaults()
- func (y *Yobit) Setup(exch config.ExchangeConfig)
- func (y *Yobit) Start(wg *sync.WaitGroup)
- func (y *Yobit) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, ...) (int64, error)
- func (y *Yobit) Trade(pair, orderType string, amount, price float64) (int64, error)
- func (y *Yobit) UpdateOrderbook(p pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (y *Yobit) UpdateTicker(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (y *Yobit) WithdrawCoinsToAddress(coin string, amount float64, address string) (WithdrawCoinsToAddress, error)
- func (y *Yobit) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error)
- func (y *Yobit) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error)
- func (y *Yobit) WithdrawFiatExchangeFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error)
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"` FundsInclOrders map[string]float64 `json:"funds_incl_orders"` Rights struct { Info int `json:"info"` Trade int `json:"trade"` Withdraw int `json:"withdraw"` } `json:"rights"` TransactionCount int `json:"transaction_count"` OpenOrders int `json:"open_orders"` ServerTime float64 `json:"server_time"` Error string `json:"error"` }
AccountInfo stores the account information for a user
type ActiveOrders ¶
type ActiveOrders struct { Pair string `json:"pair"` Type string `json:"type"` Amount float64 `json:"amount"` Rate float64 `json:"rate"` TimestampCreated float64 `json:"timestamp_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"` Error string `json:"error"` }
CancelOrder is used for the CancelOrder API request response
type CreateCoupon ¶
type CreateCoupon struct { Coupon string `json:"coupon"` TransID int64 `json:"transID"` Funds map[string]float64 `json:"funds"` Error string `json:"error"` }
CreateCoupon stores information coupon information
type DepositAddress ¶
type DepositAddress struct { Address string `json:"address"` ProcessedAmount float64 `json:"processed_amount"` ServerTime int64 `json:"server_time"` Error string `json:"error"` }
DepositAddress stores a curency deposit address
type OrderInfo ¶
type OrderInfo struct { Pair string `json:"pair"` Type string `json:"type"` StartAmount float64 `json:"start_amount"` Amount float64 `json:"amount"` Rate float64 `json:"rate"` TimestampCreated float64 `json:"timestamp_created"` Status int `json:"status"` }
OrderInfo stores order information
type Orderbook ¶
type Orderbook struct { Asks [][]float64 `json:"asks"` // selling orders Bids [][]float64 `json:"bids"` // buying orders }
Orderbook stores the asks and bids orderbook information
type Pair ¶
type Pair struct { DecimalPlaces int `json:"decimal_places"` // Quantity of permitted numbers after decimal point MinPrice float64 `json:"min_price"` // Minimal permitted price MaxPrice float64 `json:"max_price"` // Maximal permitted price MinAmount float64 `json:"min_amount"` // Minimal permitted buy or sell amount Hidden int `json:"hidden"` // Pair is hidden (0 or 1) Fee float64 `json:"fee"` // Pair commission }
Pair holds pair information
type RedeemCoupon ¶
type RedeemCoupon struct { CouponAmount float64 `json:"couponAmount,string"` CouponCurrency string `json:"couponCurrency"` TransID int64 `json:"transID"` Funds map[string]float64 `json:"funds"` Error string `json:"error"` }
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 // maximal price Low float64 // minimal price Avg float64 // average price Vol float64 // traded volume VolumeCurrent float64 `json:"vol_cur"` // traded volume in currency Last float64 // last transaction price Buy float64 // buying price Sell float64 // selling price Updated int64 // last cache upgrade }
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"` Error string `json:"error"` }
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 WithdrawCoinsToAddress ¶
type WithdrawCoinsToAddress struct { ServerTime int64 `json:"server_time"` Error string `json:"error"` }
WithdrawCoinsToAddress stores information for a withdrawcoins request
type Yobit ¶
Yobit is the overarching type across the Yobit package
func (*Yobit) CancelAllExchangeOrders ¶
CancelAllExchangeOrders cancels all orders associated with a currency pair
func (*Yobit) CancelExchangeOrder ¶
CancelExchangeOrder cancels an order by its corresponding ID number
func (*Yobit) CancelOrder ¶
CancelOrder cancels an order for a specific order ID
func (*Yobit) CreateCoupon ¶
func (y *Yobit) CreateCoupon(currency string, amount float64) (CreateCoupon, error)
CreateCoupon creates an exchange coupon for a sepcific currency
func (*Yobit) GetAccountInfo ¶
func (y *Yobit) GetAccountInfo() (AccountInfo, error)
GetAccountInfo returns a users account info
func (*Yobit) GetActiveOrders ¶
func (y *Yobit) GetActiveOrders(pair string) (map[string]ActiveOrders, error)
GetActiveOrders returns the active orders for a specific currency
func (*Yobit) GetDepositAddress ¶
func (y *Yobit) GetDepositAddress(coin string) (DepositAddress, error)
GetDepositAddress returns the deposit address for a specific currency
func (*Yobit) GetExchangeAccountInfo ¶
func (y *Yobit) GetExchangeAccountInfo() (exchange.AccountInfo, error)
GetExchangeAccountInfo retrieves balances for all enabled currencies for the Yobit exchange
func (*Yobit) GetExchangeDepositAddress ¶
func (y *Yobit) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error)
GetExchangeDepositAddress returns a deposit address for a specified currency
func (*Yobit) GetExchangeFundTransferHistory ¶
func (y *Yobit) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error)
GetExchangeFundTransferHistory returns funding history, deposits and withdrawals
func (*Yobit) GetExchangeHistory ¶
func (y *Yobit) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error)
GetExchangeHistory returns historic trade data since exchange opening.
func (*Yobit) GetExchangeOrderInfo ¶
func (y *Yobit) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error)
GetExchangeOrderInfo returns information on a current open order
func (*Yobit) GetOrderInfo ¶
GetOrderInfo returns the order info for a specific order ID
func (*Yobit) GetOrderbookEx ¶
GetOrderbookEx returns the orderbook for a currency pair
func (*Yobit) GetTickerPrice ¶
GetTickerPrice returns the ticker for a currency pair
func (*Yobit) GetTradeHistory ¶
func (y *Yobit) GetTradeHistory(TIDFrom, Count, TIDEnd int64, order, since, end, pair string) (map[string]TradeHistory, error)
GetTradeHistory returns the trade history
func (*Yobit) ModifyExchangeOrder ¶
ModifyExchangeOrder will allow of changing orderbook placement and limit to market conversion
func (*Yobit) RedeemCoupon ¶
func (y *Yobit) RedeemCoupon(coupon string) (RedeemCoupon, error)
RedeemCoupon redeems an exchange coupon
func (*Yobit) SendAuthenticatedHTTPRequest ¶
func (y *Yobit) SendAuthenticatedHTTPRequest(path string, params url.Values, result interface{}) (err error)
SendAuthenticatedHTTPRequest sends an authenticated HTTP request to Yobit
func (*Yobit) SendHTTPRequest ¶
SendHTTPRequest sends an unauthenticated HTTP request
func (*Yobit) SetDefaults ¶
func (y *Yobit) SetDefaults()
SetDefaults sets current default value for Yobit
func (*Yobit) Setup ¶
func (y *Yobit) Setup(exch config.ExchangeConfig)
Setup sets exchange configuration parameters for Yobit
func (*Yobit) SubmitExchangeOrder ¶
func (y *Yobit) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error)
SubmitExchangeOrder submits a new order
func (*Yobit) UpdateOrderbook ¶
UpdateOrderbook updates and returns the orderbook for a currency pair
func (*Yobit) UpdateTicker ¶
UpdateTicker updates and returns the ticker for a currency pair
func (*Yobit) WithdrawCoinsToAddress ¶
func (y *Yobit) WithdrawCoinsToAddress(coin string, amount float64, address string) (WithdrawCoinsToAddress, error)
WithdrawCoinsToAddress initiates a withdrawal to a specified address
func (*Yobit) WithdrawCryptoExchangeFunds ¶
func (y *Yobit) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error)
WithdrawCryptoExchangeFunds returns a withdrawal ID when a withdrawal is submitted
func (*Yobit) WithdrawFiatExchangeFunds ¶
func (y *Yobit) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error)
WithdrawFiatExchangeFunds returns a withdrawal ID when a withdrawal is submitted
func (*Yobit) WithdrawFiatExchangeFundsToInternationalBank ¶
func (y *Yobit) WithdrawFiatExchangeFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error)
WithdrawFiatExchangeFundsToInternationalBank returns a withdrawal ID when a withdrawal is submitted