Documentation ¶
Index ¶
- Variables
- 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 TradeHistoryResponse
- type TradeOrderResponse
- type WithdrawCoinsToAddress
- type Yobit
- func (y *Yobit) CancelAllOrders(ctx context.Context, _ *order.Cancel) (order.CancelAllResponse, error)
- func (y *Yobit) CancelBatchOrders(_ context.Context, _ []order.Cancel) (*order.CancelBatchResponse, error)
- func (y *Yobit) CancelExistingOrder(ctx context.Context, orderID int64) error
- func (y *Yobit) CancelOrder(ctx context.Context, o *order.Cancel) error
- func (y *Yobit) CreateCoupon(ctx context.Context, currency string, amount float64) (CreateCoupon, error)
- func (y *Yobit) FetchAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
- func (y *Yobit) FetchOrderbook(ctx context.Context, p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
- func (y *Yobit) FetchTicker(ctx context.Context, p currency.Pair, assetType asset.Item) (*ticker.Price, error)
- func (y *Yobit) FetchTradablePairs(ctx context.Context, _ asset.Item) (currency.Pairs, error)
- func (y *Yobit) GetAccountFundingHistory(_ context.Context) ([]exchange.FundingHistory, error)
- func (y *Yobit) GetAccountInformation(ctx context.Context) (AccountInfo, error)
- func (y *Yobit) GetActiveOrders(ctx context.Context, req *order.MultiOrderRequest) (order.FilteredOrders, error)
- func (y *Yobit) GetCryptoDepositAddress(ctx context.Context, coin string, createNew bool) (*DepositAddress, error)
- func (y *Yobit) GetCurrencyTradeURL(_ context.Context, a asset.Item, cp currency.Pair) (string, error)
- func (y *Yobit) GetDepositAddress(ctx context.Context, cryptocurrency currency.Code, _, _ string) (*deposit.Address, error)
- func (y *Yobit) GetDepth(ctx context.Context, symbol string) (Orderbook, error)
- func (y *Yobit) GetFee(feeBuilder *exchange.FeeBuilder) (float64, error)
- func (y *Yobit) GetFeeByType(ctx context.Context, feeBuilder *exchange.FeeBuilder) (float64, error)
- func (y *Yobit) GetFuturesContractDetails(context.Context, asset.Item) ([]futures.Contract, error)
- func (y *Yobit) GetHistoricCandles(_ context.Context, _ currency.Pair, _ asset.Item, _ kline.Interval, ...) (*kline.Item, error)
- func (y *Yobit) GetHistoricCandlesExtended(_ context.Context, _ currency.Pair, _ asset.Item, _ kline.Interval, ...) (*kline.Item, error)
- func (y *Yobit) GetHistoricTrades(_ context.Context, _ currency.Pair, _ asset.Item, _, _ time.Time) ([]trade.Data, error)
- func (y *Yobit) GetInfo(ctx context.Context) (Info, error)
- func (y *Yobit) GetLatestFundingRates(context.Context, *fundingrate.LatestRateRequest) ([]fundingrate.LatestRateResponse, error)
- func (y *Yobit) GetOpenOrders(ctx context.Context, pair string) (map[string]ActiveOrders, error)
- func (y *Yobit) GetOrderHistory(ctx context.Context, req *order.MultiOrderRequest) (order.FilteredOrders, error)
- func (y *Yobit) GetOrderInfo(ctx context.Context, orderID string, _ currency.Pair, _ asset.Item) (*order.Detail, error)
- func (y *Yobit) GetOrderInformation(ctx context.Context, orderID int64) (map[string]OrderInfo, error)
- func (y *Yobit) GetRecentTrades(ctx context.Context, p currency.Pair, assetType asset.Item) ([]trade.Data, error)
- func (y *Yobit) GetServerTime(ctx context.Context, _ asset.Item) (time.Time, error)
- func (y *Yobit) GetTicker(ctx context.Context, symbol string) (map[string]Ticker, error)
- func (y *Yobit) GetTradeHistory(ctx context.Context, tidFrom, count, tidEnd, since, end int64, ...) (map[string]TradeHistory, error)
- func (y *Yobit) GetTrades(ctx context.Context, symbol string) ([]Trade, error)
- func (y *Yobit) GetWithdrawalsHistory(_ context.Context, _ currency.Code, _ asset.Item) ([]exchange.WithdrawalHistory, error)
- func (y *Yobit) ModifyOrder(_ context.Context, _ *order.Modify) (*order.ModifyResponse, error)
- func (y *Yobit) RedeemCoupon(ctx context.Context, coupon string) (RedeemCoupon, error)
- func (y *Yobit) SendAuthenticatedHTTPRequest(ctx context.Context, ep exchange.URL, path string, params url.Values, ...) (err error)
- func (y *Yobit) SendHTTPRequest(ctx context.Context, ep exchange.URL, path string, result interface{}) error
- func (y *Yobit) SetDefaults()
- func (y *Yobit) Setup(exch *config.Exchange) error
- func (y *Yobit) SubmitOrder(ctx context.Context, s *order.Submit) (*order.SubmitResponse, error)
- func (y *Yobit) SubmitOrders(ctx context.Context, ss ...*order.Submit) ([]*order.SubmitResponse, error)
- func (y *Yobit) Trade(ctx context.Context, pair, orderType string, amount, price float64) (int64, error)
- func (y *Yobit) UpdateAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
- func (y *Yobit) UpdateOrderExecutionLimits(_ context.Context, _ asset.Item) error
- func (y *Yobit) UpdateOrderbook(ctx context.Context, p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
- func (y *Yobit) UpdateTicker(ctx context.Context, p currency.Pair, a asset.Item) (*ticker.Price, error)
- func (y *Yobit) UpdateTickers(ctx context.Context, a asset.Item) error
- func (y *Yobit) UpdateTradablePairs(ctx context.Context, forceUpdate bool) error
- func (y *Yobit) ValidateAPICredentials(ctx context.Context, assetType asset.Item) error
- func (y *Yobit) WithdrawCoinsToAddress(ctx context.Context, coin string, amount float64, address string) (WithdrawCoinsToAddress, error)
- func (y *Yobit) WithdrawCryptocurrencyFunds(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (y *Yobit) WithdrawFiatFunds(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (y *Yobit) WithdrawFiatFundsToInternationalBank(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
Constants ¶
This section is empty.
Variables ¶
var WithdrawalFees = map[currency.Code]float64{}/* 1139 elements not displayed */
WithdrawalFees the large list of predefined withdrawal fees Prone to change, using highest value
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 { Success int `json:"success"` Return struct { Address string `json:"address"` ProcessedAmount float64 `json:"processed_amount"` ServerTime int64 `json:"server_time"` } `json:"return"` Error string `json:"error"` }
DepositAddress stores a currency 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 { Type string `json:"type"` Price float64 `json:"price"` Amount float64 `json:"amount"` TID int64 `json:"tid"` Timestamp int64 `json:"timestamp"` }
Trade stores 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 TradeHistoryResponse ¶
type TradeHistoryResponse struct { Success int64 `json:"success"` Data map[string]TradeHistory `json:"return,omitempty"` Error string `json:"error,omitempty"` }
TradeHistoryResponse returns all your trade history
type TradeOrderResponse ¶
type TradeOrderResponse struct { Received float64 `json:"received"` Remains float64 `json:"remains"` OrderID float64 `json:"order_id"` Funds map[string]float64 `json:"funds"` Error string `json:"error"` }
TradeOrderResponse stores the 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) CancelAllOrders ¶
func (y *Yobit) CancelAllOrders(ctx context.Context, _ *order.Cancel) (order.CancelAllResponse, error)
CancelAllOrders cancels all orders associated with a currency pair
func (*Yobit) CancelBatchOrders ¶
func (y *Yobit) CancelBatchOrders(_ context.Context, _ []order.Cancel) (*order.CancelBatchResponse, error)
CancelBatchOrders cancels an orders by their corresponding ID numbers
func (*Yobit) CancelExistingOrder ¶
CancelExistingOrder cancels an order for a specific order ID
func (*Yobit) CancelOrder ¶
CancelOrder cancels an order by its corresponding ID number
func (*Yobit) CreateCoupon ¶
func (y *Yobit) CreateCoupon(ctx context.Context, currency string, amount float64) (CreateCoupon, error)
CreateCoupon creates an exchange coupon for a specific currency
func (*Yobit) FetchAccountInfo ¶
func (y *Yobit) FetchAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
FetchAccountInfo retrieves balances for all enabled currencies
func (*Yobit) FetchOrderbook ¶
func (y *Yobit) FetchOrderbook(ctx context.Context, p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
FetchOrderbook returns the orderbook for a currency pair
func (*Yobit) FetchTicker ¶
func (y *Yobit) FetchTicker(ctx context.Context, p currency.Pair, assetType asset.Item) (*ticker.Price, error)
FetchTicker returns the ticker for a currency pair
func (*Yobit) FetchTradablePairs ¶
FetchTradablePairs returns a list of the exchanges tradable pairs
func (*Yobit) GetAccountFundingHistory ¶
GetAccountFundingHistory returns funding history, deposits and withdrawals
func (*Yobit) GetAccountInformation ¶
func (y *Yobit) GetAccountInformation(ctx context.Context) (AccountInfo, error)
GetAccountInformation returns a users account info
func (*Yobit) GetActiveOrders ¶
func (y *Yobit) GetActiveOrders(ctx context.Context, req *order.MultiOrderRequest) (order.FilteredOrders, error)
GetActiveOrders retrieves any orders that are active/open
func (*Yobit) GetCryptoDepositAddress ¶
func (y *Yobit) GetCryptoDepositAddress(ctx context.Context, coin string, createNew bool) (*DepositAddress, error)
GetCryptoDepositAddress returns the deposit address for a specific currency
func (*Yobit) GetCurrencyTradeURL ¶
func (y *Yobit) 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 (*Yobit) GetDepositAddress ¶
func (y *Yobit) GetDepositAddress(ctx context.Context, cryptocurrency currency.Code, _, _ string) (*deposit.Address, error)
GetDepositAddress returns a deposit address for a specified currency
func (*Yobit) GetFee ¶
func (y *Yobit) GetFee(feeBuilder *exchange.FeeBuilder) (float64, error)
GetFee returns an estimate of fee based on type of transaction
func (*Yobit) GetFeeByType ¶
GetFeeByType returns an estimate of fee based on type of transaction
func (*Yobit) GetFuturesContractDetails ¶
GetFuturesContractDetails returns all contracts from the exchange by asset type
func (*Yobit) GetHistoricCandles ¶
func (y *Yobit) GetHistoricCandles(_ context.Context, _ currency.Pair, _ asset.Item, _ kline.Interval, _, _ time.Time) (*kline.Item, error)
GetHistoricCandles returns candles between a time period for a set time interval
func (*Yobit) GetHistoricCandlesExtended ¶
func (y *Yobit) GetHistoricCandlesExtended(_ context.Context, _ currency.Pair, _ asset.Item, _ kline.Interval, _, _ time.Time) (*kline.Item, error)
GetHistoricCandlesExtended returns candles between a time period for a set time interval
func (*Yobit) GetHistoricTrades ¶
func (y *Yobit) GetHistoricTrades(_ context.Context, _ currency.Pair, _ asset.Item, _, _ time.Time) ([]trade.Data, error)
GetHistoricTrades returns historic trade data within the timeframe provided
func (*Yobit) GetLatestFundingRates ¶
func (y *Yobit) GetLatestFundingRates(context.Context, *fundingrate.LatestRateRequest) ([]fundingrate.LatestRateResponse, error)
GetLatestFundingRates returns the latest funding rates data
func (*Yobit) GetOpenOrders ¶
GetOpenOrders returns the active orders for a specific currency
func (*Yobit) GetOrderHistory ¶
func (y *Yobit) GetOrderHistory(ctx context.Context, req *order.MultiOrderRequest) (order.FilteredOrders, error)
GetOrderHistory retrieves account order information Can Limit response to specific order status
func (*Yobit) GetOrderInfo ¶
func (y *Yobit) GetOrderInfo(ctx context.Context, orderID string, _ currency.Pair, _ asset.Item) (*order.Detail, error)
GetOrderInfo returns order information based on order ID
func (*Yobit) GetOrderInformation ¶
func (y *Yobit) GetOrderInformation(ctx context.Context, orderID int64) (map[string]OrderInfo, error)
GetOrderInformation returns the order info for a specific order ID
func (*Yobit) GetRecentTrades ¶
func (y *Yobit) GetRecentTrades(ctx context.Context, p currency.Pair, assetType asset.Item) ([]trade.Data, error)
GetRecentTrades returns the most recent trades for a currency and asset
func (*Yobit) GetServerTime ¶
GetServerTime returns the current exchange server time.
func (*Yobit) GetTradeHistory ¶
func (y *Yobit) GetTradeHistory(ctx context.Context, tidFrom, count, tidEnd, since, end int64, order, pair string) (map[string]TradeHistory, error)
GetTradeHistory returns the trade history
func (*Yobit) GetWithdrawalsHistory ¶
func (y *Yobit) GetWithdrawalsHistory(_ context.Context, _ currency.Code, _ asset.Item) ([]exchange.WithdrawalHistory, error)
GetWithdrawalsHistory returns previous withdrawals data
func (*Yobit) ModifyOrder ¶
ModifyOrder will allow of changing orderbook placement and limit to market conversion
func (*Yobit) RedeemCoupon ¶
RedeemCoupon redeems an exchange coupon
func (*Yobit) SendAuthenticatedHTTPRequest ¶
func (y *Yobit) SendAuthenticatedHTTPRequest(ctx context.Context, ep exchange.URL, path string, params url.Values, result interface{}) (err error)
SendAuthenticatedHTTPRequest sends an authenticated HTTP request to Yobit
func (*Yobit) SendHTTPRequest ¶
func (y *Yobit) SendHTTPRequest(ctx context.Context, ep exchange.URL, path string, result interface{}) error
SendHTTPRequest sends an unauthenticated HTTP request
func (*Yobit) SetDefaults ¶
func (y *Yobit) SetDefaults()
SetDefaults sets current default value for Yobit
func (*Yobit) SubmitOrder ¶
SubmitOrder submits a new order Yobit only supports limit orders
func (*Yobit) SubmitOrders ¶ added in v1.0.7
func (*Yobit) Trade ¶
func (y *Yobit) Trade(ctx context.Context, pair, orderType string, amount, price float64) (int64, error)
Trade places an order and returns the order ID if successful or an error
func (*Yobit) UpdateAccountInfo ¶
func (y *Yobit) UpdateAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
UpdateAccountInfo retrieves balances for all enabled currencies for the Yobit exchange
func (*Yobit) UpdateOrderExecutionLimits ¶
UpdateOrderExecutionLimits updates order execution limits
func (*Yobit) UpdateOrderbook ¶
func (y *Yobit) UpdateOrderbook(ctx context.Context, p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
UpdateOrderbook updates and returns the orderbook for a currency pair
func (*Yobit) UpdateTicker ¶
func (y *Yobit) UpdateTicker(ctx context.Context, p currency.Pair, a asset.Item) (*ticker.Price, error)
UpdateTicker updates and returns the ticker for a currency pair
func (*Yobit) UpdateTickers ¶
UpdateTickers updates the ticker for all currency pairs of a given asset type
func (*Yobit) UpdateTradablePairs ¶
UpdateTradablePairs updates the exchanges available pairs and stores them in the exchanges config
func (*Yobit) ValidateAPICredentials ¶
ValidateAPICredentials validates current credentials used for wrapper functionality
func (*Yobit) WithdrawCoinsToAddress ¶
func (y *Yobit) WithdrawCoinsToAddress(ctx context.Context, coin string, amount float64, address string) (WithdrawCoinsToAddress, error)
WithdrawCoinsToAddress initiates a withdrawal to a specified address
func (*Yobit) WithdrawCryptocurrencyFunds ¶
func (y *Yobit) WithdrawCryptocurrencyFunds(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is submitted
func (*Yobit) WithdrawFiatFunds ¶
func (y *Yobit) WithdrawFiatFunds(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawFiatFunds returns a withdrawal ID when a withdrawal is submitted
func (*Yobit) WithdrawFiatFundsToInternationalBank ¶
func (y *Yobit) WithdrawFiatFundsToInternationalBank(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is submitted