Documentation ¶
Index ¶
- Constants
- type CancelOrdersResponse
- type CandleResponse
- type Coinbene
- func (c *Coinbene) AuthenticateWebsocket(_ context.Context) error
- func (c *Coinbene) CancelAllOrders(ctx context.Context, orderCancellation *order.Cancel) (order.CancelAllResponse, error)
- func (c *Coinbene) CancelBatchOrders(ctx context.Context, o []order.Cancel) (order.CancelBatchResponse, error)
- func (c *Coinbene) CancelOrder(ctx context.Context, o *order.Cancel) error
- func (c *Coinbene) CancelSpotOrder(ctx context.Context, orderID string) (string, error)
- func (c *Coinbene) CancelSpotOrders(ctx context.Context, orderIDs []string) ([]OrderCancellationResponse, error)
- func (c *Coinbene) CancelSwapOrder(ctx context.Context, orderID string) (string, error)
- func (c *Coinbene) CancelSwapOrders(ctx context.Context, orderIDs []string) ([]OrderCancellationResponse, error)
- func (c *Coinbene) FetchAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
- func (c *Coinbene) FetchClosedOrders(ctx context.Context, symbol, latestID string) (OrdersInfo, error)
- func (c *Coinbene) FetchOpenSpotOrders(ctx context.Context, symbol string) (OrdersInfo, error)
- func (c *Coinbene) FetchOrderbook(ctx context.Context, p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
- func (c *Coinbene) FetchSpotOrderInfo(ctx context.Context, orderID string) (OrderInfo, error)
- func (c *Coinbene) FetchTicker(ctx context.Context, p currency.Pair, assetType asset.Item) (*ticker.Price, error)
- func (c *Coinbene) FetchTradablePairs(ctx context.Context, a asset.Item) ([]string, error)
- func (c *Coinbene) FormatExchangeKlineInterval(in kline.Interval) string
- func (c *Coinbene) GenerateAuthSubs() ([]stream.ChannelSubscription, error)
- func (c *Coinbene) GenerateDefaultSubscriptions() ([]stream.ChannelSubscription, error)
- func (c *Coinbene) GetAccountAssetBalance(ctx context.Context, symbol string) (UserBalanceData, error)
- func (c *Coinbene) GetAccountBalances(ctx context.Context) ([]UserBalanceData, error)
- func (c *Coinbene) GetActiveOrders(ctx context.Context, getOrdersRequest *order.GetOrdersRequest) ([]order.Detail, error)
- func (c *Coinbene) GetAllPairs(ctx context.Context) ([]PairData, error)
- func (c *Coinbene) GetAvailableTransferChains(ctx context.Context, cryptocurrency currency.Code) ([]string, error)
- func (c *Coinbene) GetDefaultConfig() (*config.Exchange, error)
- func (c *Coinbene) GetDepositAddress(ctx context.Context, curr currency.Code, _, chain string) (*deposit.Address, error)
- func (c *Coinbene) GetFeeByType(ctx context.Context, feeBuilder *exchange.FeeBuilder) (float64, error)
- func (c *Coinbene) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory, error)
- func (c *Coinbene) GetHistoricCandles(ctx context.Context, pair currency.Pair, a asset.Item, start, end time.Time, ...) (kline.Item, error)
- func (c *Coinbene) GetHistoricCandlesExtended(ctx context.Context, pair currency.Pair, a asset.Item, start, end time.Time, ...) (kline.Item, error)
- func (c *Coinbene) GetHistoricTrades(_ context.Context, _ currency.Pair, _ asset.Item, _, _ time.Time) ([]trade.Data, error)
- func (c *Coinbene) GetKlines(ctx context.Context, pair string, start, end time.Time, period string) (resp CandleResponse, err error)
- func (c *Coinbene) GetOrderHistory(ctx context.Context, getOrdersRequest *order.GetOrdersRequest) ([]order.Detail, error)
- func (c *Coinbene) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error)
- func (c *Coinbene) GetOrderbook(ctx context.Context, symbol string, size int64) (Orderbook, error)
- func (c *Coinbene) GetPairInfo(ctx context.Context, symbol string) (PairData, error)
- func (c *Coinbene) GetRecentTrades(ctx context.Context, p currency.Pair, assetType asset.Item) ([]trade.Data, error)
- func (c *Coinbene) GetSpotOrderFills(ctx context.Context, orderID string) ([]OrderFills, error)
- func (c *Coinbene) GetSwapAccountInfo(ctx context.Context) (SwapAccountInfo, error)
- func (c *Coinbene) GetSwapFundingRates(ctx context.Context, pageNum, pageSize int) ([]SwapFundingRate, error)
- func (c *Coinbene) GetSwapInstruments(ctx context.Context) ([]Instrument, error)
- func (c *Coinbene) GetSwapKlines(ctx context.Context, symbol string, start, end time.Time, resolution string) (resp CandleResponse, err error)
- func (c *Coinbene) GetSwapOpenOrders(ctx context.Context, symbol string, pageNum, pageSize int) (SwapOrders, error)
- func (c *Coinbene) GetSwapOpenOrdersByPage(ctx context.Context, symbol string, latestOrderID int64) (SwapOrders, error)
- func (c *Coinbene) GetSwapOrderFills(ctx context.Context, symbol, orderID string, lastTradeID int64) (SwapOrderFills, error)
- func (c *Coinbene) GetSwapOrderHistory(ctx context.Context, beginTime, endTime, symbol string, pageNum, pageSize int, ...) (SwapOrders, error)
- func (c *Coinbene) GetSwapOrderHistoryByOrderID(ctx context.Context, beginTime, endTime, symbol, status string, ...) (SwapOrders, error)
- func (c *Coinbene) GetSwapOrderInfo(ctx context.Context, orderID string) (SwapOrder, error)
- func (c *Coinbene) GetSwapOrderbook(ctx context.Context, symbol string, size int64) (Orderbook, error)
- func (c *Coinbene) GetSwapPositions(ctx context.Context, symbol string) (SwapPositions, error)
- func (c *Coinbene) GetSwapTicker(ctx context.Context, symbol string) (SwapTicker, error)
- func (c *Coinbene) GetSwapTickers(ctx context.Context) (SwapTickers, error)
- func (c *Coinbene) GetSwapTrades(ctx context.Context, symbol string, limit int) (SwapTrades, error)
- func (c *Coinbene) GetTicker(ctx context.Context, symbol string) (TickerData, error)
- func (c *Coinbene) GetTickers(ctx context.Context) ([]TickerData, error)
- func (c *Coinbene) GetTrades(ctx context.Context, symbol string, limit int64) (Trades, error)
- func (c *Coinbene) GetWithdrawalsHistory(_ context.Context, _ currency.Code) (resp []exchange.WithdrawalHistory, err error)
- func (c *Coinbene) ListDepositAddress(ctx context.Context, crypto currency.Code) ([]DepositAddress, error)
- func (c *Coinbene) Login() error
- func (c *Coinbene) ModifyOrder(ctx context.Context, action *order.Modify) (order.Modify, error)
- func (c *Coinbene) PlaceSpotOrder(ctx context.Context, price, quantity float64, ...) (OrderPlacementResponse, error)
- func (c *Coinbene) PlaceSpotOrders(ctx context.Context, orders []PlaceOrderRequest) ([]OrderPlacementResponse, error)
- func (c *Coinbene) PlaceSwapOrder(ctx context.Context, symbol, direction, orderType, marginMode, clientID string, ...) (SwapPlaceOrderResponse, error)
- func (c *Coinbene) Run()
- func (c *Coinbene) SendAuthHTTPRequest(ctx context.Context, ep exchange.URL, method, epPath string, epAuthPath uint8, ...) error
- func (c *Coinbene) SendHTTPRequest(ctx context.Context, ep exchange.URL, path string, f request.EndpointLimit, ...) error
- func (c *Coinbene) SetDefaults()
- func (c *Coinbene) Setup(exch *config.Exchange) error
- func (c *Coinbene) Start(wg *sync.WaitGroup) error
- func (c *Coinbene) SubmitOrder(ctx context.Context, s *order.Submit) (order.SubmitResponse, error)
- func (c *Coinbene) Subscribe(channelsToSubscribe []stream.ChannelSubscription) error
- func (c *Coinbene) Unsubscribe(channelToUnsubscribe []stream.ChannelSubscription) error
- func (c *Coinbene) UpdateAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
- func (c *Coinbene) UpdateOrderbook(ctx context.Context, p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
- func (c *Coinbene) UpdateTicker(ctx context.Context, p currency.Pair, a asset.Item) (*ticker.Price, error)
- func (c *Coinbene) UpdateTickers(ctx context.Context, a asset.Item) error
- func (c *Coinbene) UpdateTradablePairs(ctx context.Context, forceUpdate bool) error
- func (c *Coinbene) ValidateCredentials(ctx context.Context, assetType asset.Item) error
- func (c *Coinbene) Withdraw(ctx context.Context, curr currency.Code, address, tag, chain string, ...) (*WithdrawResponse, error)
- func (c *Coinbene) WithdrawCryptocurrencyFunds(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (c *Coinbene) WithdrawFiatFunds(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (c *Coinbene) WithdrawFiatFundsToInternationalBank(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (c *Coinbene) WsConnect() error
- type DepositAddress
- type Instrument
- type OrderCancellationResponse
- type OrderFills
- type OrderInfo
- type OrderPlacementResponse
- type Orderbook
- type OrderbookItem
- type OrdersInfo
- type PairData
- type PlaceOrderRequest
- type RateLimit
- type SwapAccountInfo
- type SwapFundingRate
- type SwapKlineItem
- type SwapKlines
- type SwapOrder
- type SwapOrderFill
- type SwapOrderFills
- type SwapOrders
- type SwapPlaceOrderResponse
- type SwapPosition
- type SwapPositions
- type SwapTicker
- type SwapTickers
- type SwapTrade
- type SwapTrades
- type TickerData
- type TradeItem
- type Trades
- type UserBalanceData
- type WithdrawResponse
- type WsKLineData
- type WsKline
- type WsOrderData
- type WsOrderbookData
- type WsPosition
- type WsPositionData
- type WsSub
- type WsTicker
- type WsTickerData
- type WsTradeData
- type WsTradeList
- type WsUserData
- type WsUserInfo
- type WsUserOrders
Constants ¶
const ( APISpotPath uint8 = iota APISwapPath APICapitalPath )
Coinbene path vals
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CancelOrdersResponse ¶
type CancelOrdersResponse struct { OrderID string `json:"orderId"` Message string `json:"message"` }
CancelOrdersResponse stores data for a cancelled order
type CandleResponse ¶
type CandleResponse struct { Code int64 `json:"code"` Message string `json:"message"` Data [][]interface{} `json:"data"` }
CandleResponse stores returned kline data
type Coinbene ¶
Coinbene is the overarching type across this package
func (*Coinbene) AuthenticateWebsocket ¶
AuthenticateWebsocket sends an authentication message to the websocket
func (*Coinbene) CancelAllOrders ¶
func (c *Coinbene) CancelAllOrders(ctx context.Context, orderCancellation *order.Cancel) (order.CancelAllResponse, error)
CancelAllOrders cancels all orders associated with a currency pair
func (*Coinbene) CancelBatchOrders ¶
func (c *Coinbene) CancelBatchOrders(ctx context.Context, o []order.Cancel) (order.CancelBatchResponse, error)
CancelBatchOrders cancels an orders by their corresponding ID numbers
func (*Coinbene) CancelOrder ¶
CancelOrder cancels an order by its corresponding ID number
func (*Coinbene) CancelSpotOrder ¶
CancelSpotOrder removes a given order
func (*Coinbene) CancelSpotOrders ¶
func (c *Coinbene) CancelSpotOrders(ctx context.Context, orderIDs []string) ([]OrderCancellationResponse, error)
CancelSpotOrders cancels a batch of orders
func (*Coinbene) CancelSwapOrder ¶
CancelSwapOrder cancels a swap order
func (*Coinbene) CancelSwapOrders ¶
func (c *Coinbene) CancelSwapOrders(ctx context.Context, orderIDs []string) ([]OrderCancellationResponse, error)
CancelSwapOrders cancels multiple swap order IDs
func (*Coinbene) FetchAccountInfo ¶
func (c *Coinbene) FetchAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
FetchAccountInfo retrieves balances for all enabled currencies
func (*Coinbene) FetchClosedOrders ¶
func (c *Coinbene) FetchClosedOrders(ctx context.Context, symbol, latestID string) (OrdersInfo, error)
FetchClosedOrders finds open orders
func (*Coinbene) FetchOpenSpotOrders ¶
FetchOpenSpotOrders finds open orders
func (*Coinbene) FetchOrderbook ¶
func (c *Coinbene) FetchOrderbook(ctx context.Context, p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
FetchOrderbook returns orderbook base on the currency pair
func (*Coinbene) FetchSpotOrderInfo ¶
FetchSpotOrderInfo gets order info
func (*Coinbene) FetchTicker ¶
func (c *Coinbene) FetchTicker(ctx context.Context, p currency.Pair, assetType asset.Item) (*ticker.Price, error)
FetchTicker returns the ticker for a currency pair
func (*Coinbene) FetchTradablePairs ¶
FetchTradablePairs returns a list of exchange tradable pairs
func (*Coinbene) FormatExchangeKlineInterval ¶
FormatExchangeKlineInterval returns Interval to string
func (*Coinbene) GenerateAuthSubs ¶
func (c *Coinbene) GenerateAuthSubs() ([]stream.ChannelSubscription, error)
GenerateAuthSubs generates auth subs
func (*Coinbene) GenerateDefaultSubscriptions ¶
func (c *Coinbene) GenerateDefaultSubscriptions() ([]stream.ChannelSubscription, error)
GenerateDefaultSubscriptions generates stuff
func (*Coinbene) GetAccountAssetBalance ¶
func (c *Coinbene) GetAccountAssetBalance(ctx context.Context, symbol string) (UserBalanceData, error)
GetAccountAssetBalance gets user balanace info
func (*Coinbene) GetAccountBalances ¶
func (c *Coinbene) GetAccountBalances(ctx context.Context) ([]UserBalanceData, error)
GetAccountBalances gets user balanace info
func (*Coinbene) GetActiveOrders ¶
func (c *Coinbene) GetActiveOrders(ctx context.Context, getOrdersRequest *order.GetOrdersRequest) ([]order.Detail, error)
GetActiveOrders retrieves any orders that are active/open
func (*Coinbene) GetAllPairs ¶
GetAllPairs gets all pairs on the exchange
func (*Coinbene) GetAvailableTransferChains ¶
func (c *Coinbene) GetAvailableTransferChains(ctx context.Context, cryptocurrency currency.Code) ([]string, error)
GetAvailableTransferChains returns the available transfer blockchains for the specific cryptocurrency
func (*Coinbene) GetDefaultConfig ¶
GetDefaultConfig returns a default exchange config
func (*Coinbene) GetDepositAddress ¶
func (c *Coinbene) GetDepositAddress(ctx context.Context, curr currency.Code, _, chain string) (*deposit.Address, error)
GetDepositAddress returns a deposit address for a specified currency
func (*Coinbene) GetFeeByType ¶
func (c *Coinbene) GetFeeByType(ctx context.Context, feeBuilder *exchange.FeeBuilder) (float64, error)
GetFeeByType returns an estimate of fee based on the type of transaction
func (*Coinbene) GetFundingHistory ¶
GetFundingHistory returns funding history, deposits and withdrawals
func (*Coinbene) GetHistoricCandles ¶
func (c *Coinbene) GetHistoricCandles(ctx context.Context, pair currency.Pair, a asset.Item, start, end time.Time, interval kline.Interval) (kline.Item, error)
GetHistoricCandles returns candles between a time period for a set time interval
func (*Coinbene) GetHistoricCandlesExtended ¶
func (c *Coinbene) GetHistoricCandlesExtended(ctx context.Context, pair currency.Pair, a asset.Item, start, end time.Time, interval kline.Interval) (kline.Item, error)
GetHistoricCandlesExtended returns candles between a time period for a set time interval
func (*Coinbene) GetHistoricTrades ¶
func (c *Coinbene) GetHistoricTrades(_ context.Context, _ currency.Pair, _ asset.Item, _, _ time.Time) ([]trade.Data, error)
GetHistoricTrades returns historic trade data within the timeframe provided
func (*Coinbene) GetKlines ¶
func (c *Coinbene) GetKlines(ctx context.Context, pair string, start, end time.Time, period string) (resp CandleResponse, err error)
GetKlines data returns the kline data for a specific symbol
func (*Coinbene) GetOrderHistory ¶
func (c *Coinbene) GetOrderHistory(ctx context.Context, getOrdersRequest *order.GetOrdersRequest) ([]order.Detail, error)
GetOrderHistory retrieves account order information Can Limit response to specific order status
func (*Coinbene) GetOrderInfo ¶
func (c *Coinbene) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error)
GetOrderInfo returns order information based on order ID
func (*Coinbene) GetOrderbook ¶
GetOrderbook gets and stores orderbook data for given pair
func (*Coinbene) GetPairInfo ¶
GetPairInfo gets info about a single pair
func (*Coinbene) GetRecentTrades ¶
func (c *Coinbene) 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 (*Coinbene) GetSpotOrderFills ¶
GetSpotOrderFills returns a list of fills related to an order ID
func (*Coinbene) GetSwapAccountInfo ¶
func (c *Coinbene) GetSwapAccountInfo(ctx context.Context) (SwapAccountInfo, error)
GetSwapAccountInfo returns a users swap account balance info
func (*Coinbene) GetSwapFundingRates ¶
func (c *Coinbene) GetSwapFundingRates(ctx context.Context, pageNum, pageSize int) ([]SwapFundingRate, error)
GetSwapFundingRates returns a list of funding rates
func (*Coinbene) GetSwapInstruments ¶
func (c *Coinbene) GetSwapInstruments(ctx context.Context) ([]Instrument, error)
GetSwapInstruments returns a list of tradable instruments
func (*Coinbene) GetSwapKlines ¶
func (c *Coinbene) GetSwapKlines(ctx context.Context, symbol string, start, end time.Time, resolution string) (resp CandleResponse, err error)
GetSwapKlines data returns the kline data for a specific symbol
func (*Coinbene) GetSwapOpenOrders ¶
func (c *Coinbene) GetSwapOpenOrders(ctx context.Context, symbol string, pageNum, pageSize int) (SwapOrders, error)
GetSwapOpenOrders gets a list of open swap orders
func (*Coinbene) GetSwapOpenOrdersByPage ¶
func (c *Coinbene) GetSwapOpenOrdersByPage(ctx context.Context, symbol string, latestOrderID int64) (SwapOrders, error)
GetSwapOpenOrdersByPage gets a list of open orders by page
func (*Coinbene) GetSwapOrderFills ¶
func (c *Coinbene) GetSwapOrderFills(ctx context.Context, symbol, orderID string, lastTradeID int64) (SwapOrderFills, error)
GetSwapOrderFills returns a list of swap order fills
func (*Coinbene) GetSwapOrderHistory ¶
func (c *Coinbene) GetSwapOrderHistory(ctx context.Context, beginTime, endTime, symbol string, pageNum, pageSize int, direction, orderType string) (SwapOrders, error)
GetSwapOrderHistory returns the swap order history for a given symbol
func (*Coinbene) GetSwapOrderHistoryByOrderID ¶
func (c *Coinbene) GetSwapOrderHistoryByOrderID(ctx context.Context, beginTime, endTime, symbol, status string, latestOrderID int64) (SwapOrders, error)
GetSwapOrderHistoryByOrderID returns a list of historic orders based on user params
func (*Coinbene) GetSwapOrderInfo ¶
GetSwapOrderInfo gets order info for a specific order
func (*Coinbene) GetSwapOrderbook ¶
func (c *Coinbene) GetSwapOrderbook(ctx context.Context, symbol string, size int64) (Orderbook, error)
GetSwapOrderbook returns an orderbook for the specified currency
func (*Coinbene) GetSwapPositions ¶
GetSwapPositions returns a list of open swap positions
func (*Coinbene) GetSwapTicker ¶
GetSwapTicker returns a specific swap ticker
func (*Coinbene) GetSwapTickers ¶
func (c *Coinbene) GetSwapTickers(ctx context.Context) (SwapTickers, error)
GetSwapTickers returns a map of swap tickers
func (*Coinbene) GetSwapTrades ¶
GetSwapTrades returns a list of trades for a swap symbol
func (*Coinbene) GetTickers ¶
func (c *Coinbene) GetTickers(ctx context.Context) ([]TickerData, error)
GetTickers gets and all spot tickers supported by the exchange
func (*Coinbene) GetWithdrawalsHistory ¶
func (c *Coinbene) GetWithdrawalsHistory(_ context.Context, _ currency.Code) (resp []exchange.WithdrawalHistory, err error)
GetWithdrawalsHistory returns previous withdrawals data
func (*Coinbene) ListDepositAddress ¶
func (c *Coinbene) ListDepositAddress(ctx context.Context, crypto currency.Code) ([]DepositAddress, error)
ListDepositAddress returns a list of deposit addresses for a given cryptocurrency
func (*Coinbene) ModifyOrder ¶
ModifyOrder will allow of changing orderbook placement and limit to market conversion
func (*Coinbene) PlaceSpotOrder ¶
func (c *Coinbene) PlaceSpotOrder(ctx context.Context, price, quantity float64, symbol, direction, orderType, clientID string, notional int) (OrderPlacementResponse, error)
PlaceSpotOrder creates an order
func (*Coinbene) PlaceSpotOrders ¶
func (c *Coinbene) PlaceSpotOrders(ctx context.Context, orders []PlaceOrderRequest) ([]OrderPlacementResponse, error)
PlaceSpotOrders sets a batchful order request
func (*Coinbene) PlaceSwapOrder ¶
func (c *Coinbene) PlaceSwapOrder(ctx context.Context, symbol, direction, orderType, marginMode, clientID string, price, quantity float64, leverage int) (SwapPlaceOrderResponse, error)
PlaceSwapOrder places a swap order
func (*Coinbene) SendAuthHTTPRequest ¶
func (c *Coinbene) SendAuthHTTPRequest(ctx context.Context, ep exchange.URL, method, epPath string, epAuthPath uint8, params, result interface{}, f request.EndpointLimit) error
SendAuthHTTPRequest sends an authenticated HTTP request
func (*Coinbene) SendHTTPRequest ¶
func (c *Coinbene) SendHTTPRequest(ctx context.Context, ep exchange.URL, path string, f request.EndpointLimit, result interface{}) error
SendHTTPRequest sends an unauthenticated HTTP request
func (*Coinbene) SetDefaults ¶
func (c *Coinbene) SetDefaults()
SetDefaults sets the basic defaults for Coinbene
func (*Coinbene) SubmitOrder ¶
SubmitOrder submits a new order
func (*Coinbene) Subscribe ¶
func (c *Coinbene) Subscribe(channelsToSubscribe []stream.ChannelSubscription) error
Subscribe sends a websocket message to receive data from the channel
func (*Coinbene) Unsubscribe ¶
func (c *Coinbene) Unsubscribe(channelToUnsubscribe []stream.ChannelSubscription) error
Unsubscribe sends a websocket message to receive data from the channel
func (*Coinbene) UpdateAccountInfo ¶
func (c *Coinbene) UpdateAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
UpdateAccountInfo retrieves balances for all enabled currencies for the Coinbene exchange
func (*Coinbene) UpdateOrderbook ¶
func (c *Coinbene) UpdateOrderbook(ctx context.Context, p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
UpdateOrderbook updates and returns the orderbook for a currency pair
func (*Coinbene) UpdateTicker ¶
func (c *Coinbene) UpdateTicker(ctx context.Context, p currency.Pair, a asset.Item) (*ticker.Price, error)
UpdateTicker updates and returns the ticker for a currency pair
func (*Coinbene) UpdateTickers ¶
UpdateTickers updates the ticker for all currency pairs of a given asset type
func (*Coinbene) UpdateTradablePairs ¶
UpdateTradablePairs updates the exchanges available pairs and stores them
func (*Coinbene) ValidateCredentials ¶
ValidateCredentials validates current credentials used for wrapper functionality
func (*Coinbene) Withdraw ¶
func (c *Coinbene) Withdraw(ctx context.Context, curr currency.Code, address, tag, chain string, amount float64) (*WithdrawResponse, error)
Withdraw issues a withdrawawl request based on the supplied parameters
func (*Coinbene) WithdrawCryptocurrencyFunds ¶
func (c *Coinbene) WithdrawCryptocurrencyFunds(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is submitted
func (*Coinbene) WithdrawFiatFunds ¶
func (c *Coinbene) WithdrawFiatFunds(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawFiatFunds returns a withdrawal ID when a withdrawal is submitted
func (*Coinbene) WithdrawFiatFundsToInternationalBank ¶
func (c *Coinbene) WithdrawFiatFundsToInternationalBank(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is submitted
type DepositAddress ¶
type DepositAddress struct { Asset string `json:"asset"` Chain string `json:"chain"` Address string `json:"address"` AddressTag string `json:"addressTag"` DepositLimit float64 `json:"depositLimit,string"` BlockNumber uint8 `json:"blockNumber,string"` }
DepositAddress stores the deposit address data
type Instrument ¶
type Instrument struct { InstrumentID currency.Pair `json:"instrumentId"` Multiplier float64 `json:"multiplier,string"` MinimumAmount float64 `json:"minAmount,string"` MaximumAmount float64 `json:"maxAmount,string"` MinimumPriceChange float64 `json:"minPriceChange,string"` PricePrecision int64 `json:"pricePrecision,string"` }
Instrument stores an individual tradable instrument
type OrderCancellationResponse ¶
type OrderCancellationResponse struct { OrderID string `json:"orderId"` Code int `json:"code,string"` Message string `json:"message"` }
OrderCancellationResponse returns a list of cancel order status
type OrderFills ¶
type OrderFills struct { Price float64 `json:"price,string"` Quantity float64 `json:"quantity,string"` Amount float64 `json:"amount,string"` Fee float64 `json:"fee,string"` Direction string `json:"direction"` TradeTime time.Time `json:"tradeTime"` FeeByConi float64 `json:"feeByConi,string"` }
OrderFills stores the fill info
type OrderInfo ¶
type OrderInfo struct { OrderID string `json:"orderId"` BaseAsset string `json:"baseAsset"` QuoteAsset string `json:"quoteAsset"` OrderType string `json:"orderDirection"` Quantity float64 `json:"quntity,string"` Amount float64 `json:"amout,string"` FilledAmount float64 `json:"filledAmount"` TakerRate float64 `json:"takerFeeRate,string"` MakerRate float64 `json:"makerFeeRate,string"` AvgPrice float64 `json:"avgPrice,string"` OrderPrice float64 `json:"orderPrice,string"` OrderStatus string `json:"orderStatus"` OrderTime time.Time `json:"orderTime"` TotalFee float64 `json:"totalFee"` }
OrderInfo stores order info
type OrderPlacementResponse ¶
type OrderPlacementResponse OrderCancellationResponse
OrderPlacementResponse stores the order placement data
type Orderbook ¶
type Orderbook struct { Bids []OrderbookItem Asks []OrderbookItem Symbol string Time time.Time }
Orderbook stores the orderbook data
type OrderbookItem ¶
OrderbookItem stores an individual orderbook item
type PairData ¶
type PairData struct { Symbol string `json:"symbol"` BaseAsset string `json:"baseAsset"` QuoteAsset string `json:"quoteAsset"` PricePrecision int64 `json:"pricePrecision,string"` AmountPrecision int64 `json:"amountPrecision,string"` TakerFeeRate float64 `json:"takerFeeRate,string"` MakerFeeRate float64 `json:"makerFeeRate,string"` MinAmount float64 `json:"minAmount,string"` Site string `json:"site"` PriceFluctuation float64 `json:"priceFluctuation,string"` }
PairData stores pair data
type PlaceOrderRequest ¶
type PlaceOrderRequest struct { Price float64 Quantity float64 Symbol string Direction string OrderType string ClientID string Notional int }
PlaceOrderRequest places an order request
type RateLimit ¶
type RateLimit struct { ContractOrderbook *rate.Limiter ContractTickers *rate.Limiter ContractKline *rate.Limiter ContractTrades *rate.Limiter ContractInstruments *rate.Limiter ContractAccountInfo *rate.Limiter ContractPositionInfo *rate.Limiter ContractPlaceOrder *rate.Limiter ContractCancelOrder *rate.Limiter ContractGetOpenOrders *rate.Limiter ContractOpenOrdersByPage *rate.Limiter ContractGetOrderInfo *rate.Limiter ContractGetClosedOrders *rate.Limiter ContractGetClosedOrdersbyPage *rate.Limiter ContractCancelMultipleOrders *rate.Limiter ContractGetOrderFills *rate.Limiter ContractGetFundingRates *rate.Limiter SpotPairs *rate.Limiter SpotPairInfo *rate.Limiter SpotOrderbook *rate.Limiter SpotTickerList *rate.Limiter SpotSpecificTicker *rate.Limiter SpotMarketTrades *rate.Limiter // spotKline // Not implemented yet // spotExchangeRate // Not implemented yet SpotAccountInfo *rate.Limiter SpotAccountAssetInfo *rate.Limiter SpotPlaceOrder *rate.Limiter SpotBatchOrder *rate.Limiter SpotQueryOpenOrders *rate.Limiter SpotQueryClosedOrders *rate.Limiter SpotQuerySpecficOrder *rate.Limiter SpotQueryTradeFills *rate.Limiter SpotCancelOrder *rate.Limiter SpotCancelOrdersBatch *rate.Limiter CapitalDeposit *rate.Limiter CapitalWithdraw *rate.Limiter }
RateLimit implements the request.Limiter interface
func SetRateLimit ¶
func SetRateLimit() *RateLimit
SetRateLimit returns the rate limit for the exchange
type SwapAccountInfo ¶
type SwapAccountInfo struct { AvailableBalance float64 `json:"availableBalance,string"` FrozenBalance float64 `json:"frozenBalance,string"` MarginBalance float64 `json:"marginBalance,string"` MarginRate float64 `json:"marginRate,string"` Balance float64 `json:"balance,string"` UnrealisedProfitAndLoss float64 `json:"unrealisedPnl,string"` }
SwapAccountInfo returns the swap account balance info
type SwapFundingRate ¶
type SwapFundingRate struct { Symbol string `json:"symbol"` Side string `json:"side"` MarkPrice float64 `json:"markPrice,string"` PositionValue float64 `json:"positionValue,string"` Fee float64 `json:"fee,string"` FeeRate float64 `json:"feeRate,string"` Leverage int64 `json:"leverage"` }
SwapFundingRate stores a collection of funding rates
type SwapKlineItem ¶
type SwapKlineItem struct { Time time.Time Open float64 Close float64 High float64 Low float64 Volume float64 Turnover float64 BuyVolume float64 BuyTurnover float64 }
SwapKlineItem stores an individual kline data item
type SwapOrder ¶
type SwapOrder struct { OrderID string `json:"orderId"` Direction string `json:"direction"` Leverage int64 `json:"leverage,string"` OrderType string `json:"orderType"` Quantity float64 `json:"quantity,string"` OrderPrice float64 `json:"orderPrice,string"` OrderValue float64 `json:"orderValue,string"` Fee float64 `json:"fee"` FilledQuantity float64 `json:"filledQuantity,string"` AveragePrice float64 `json:"averagePrice,string"` OrderTime time.Time `json:"orderTime"` Status string `json:"status"` }
SwapOrder stores the swap order data
type SwapOrderFill ¶
type SwapOrderFill struct { Symbol string `json:"symbol"` TradeTime time.Time `json:"tradeTime"` TradeID int64 `json:"tradeId,string"` OrderID int64 `json:"orderId,string"` Price float64 `json:"price,string"` Fee float64 `json:"fee,string"` ExecType string `json:"execType"` Side string `json:"side"` Quantity float64 `json:"quantity,string"` }
SwapOrderFill stores a swap orders fill info
type SwapOrderFills ¶
type SwapOrderFills []SwapOrderFill
SwapOrderFills stores a collection of swap order fills
type SwapPlaceOrderResponse ¶
type SwapPlaceOrderResponse struct { OrderID string `json:"orderId"` ClientID string `json:"clientId"` }
SwapPlaceOrderResponse stores the response data for placing a swap order
type SwapPosition ¶
type SwapPosition struct { AvailableQuantity float64 `json:"availableQuantity,string"` AveragePrice float64 `json:"averagePrice,string"` CreateTime time.Time `json:"createTime"` DeleveragePercentile int64 `json:"deleveragePercentile,string"` Leverage int64 `json:"leverage,string"` LiquidationPrice float64 `json:"liquidationPrice,string"` MarkPrice float64 `json:"markPrice,string"` PositionMargin float64 `json:"positionMargin,string"` PositionValue float64 `json:"positionValue,string"` Quantity float64 `json:"quantity,string"` RateOfReturn float64 `json:"roe,string"` Side string `json:"side"` Symbol string `json:"symbol"` UnrealisedProfitAndLoss float64 `json:"UnrealisedPnl,string"` }
SwapPosition stores a single swap position's data
type SwapPositions ¶
type SwapPositions []SwapPosition
SwapPositions stores a collection of swap positions
type SwapTicker ¶
type SwapTicker struct { LastPrice float64 `json:"lastPrice,string"` MarkPrice float64 `json:"markPrice,string"` BestAskPrice float64 `json:"bestAskPrice,string"` BestBidPrice float64 `json:"bestBidPrice,string"` High24Hour float64 `json:"high24h,string"` Low24Hour float64 `json:"low24h,string"` Volume24Hour float64 `json:"volume24h,string"` BestAskVolume float64 `json:"bestAskVolume,string"` BestBidVolume float64 `json:"bestBidVolume,string"` Turnover float64 `json:"turnover,string"` Timestamp time.Time `json:"timeStamp"` Change24Hour float64 `json:"chg24h,string"` ChangeZeroHour float64 `json:"chg0h,string"` }
SwapTicker stores the swap ticker info
type TickerData ¶
type TickerData struct { Symbol string `json:"symbol"` LatestPrice float64 `json:"latestPrice,string"` BestBid float64 `json:"bestBid,string"` BestAsk float64 `json:"bestAsk,string"` DailyHigh float64 `json:"high24h,string"` DailyLow float64 `json:"low24h,string"` DailyVolume float64 `json:"volume24h,string"` }
TickerData stores ticker data
type TradeItem ¶
type TradeItem struct { CurrencyPair string Price float64 Volume float64 Direction string TradeTime time.Time }
TradeItem stores a single trade
type UserBalanceData ¶
type UserBalanceData struct { Asset string `json:"asset"` Available float64 `json:"available,string"` Reserved float64 `json:"reserved,string"` Total float64 `json:"total,string"` }
UserBalanceData stores user balance data
type WithdrawResponse ¶
type WithdrawResponse struct { ID string `json:"id"` Amount float64 `json:"amount"` Asset string `json:"asset"` Address string `json:"address"` Tag string `json:"tag"` Chain string `json:"chain"` }
WithdrawResponse stores the withdrawal request response data
type WsKLineData ¶
type WsKLineData struct { Open float64 `json:"o"` High float64 `json:"h"` Low float64 `json:"l"` Close float64 `json:"c"` Volume float64 `json:"v"` Timestamp int64 `json:"t"` }
WsKLineData holds OHLCV data
type WsKline ¶
type WsKline struct { Topic string `json:"topic"` Data []WsKLineData `json:"data"` }
WsKline stores websocket kline data
type WsOrderData ¶
type WsOrderData struct { OrderID string `json:"orderId"` Direction string `json:"direction"` Leverage int64 `json:"leverage,string"` Symbol string `json:"symbol"` OrderType string `json:"orderType"` Quantity float64 `json:"quantity,string"` OrderPrice float64 `json:"orderPrice,string"` OrderValue float64 `json:"orderValue,string"` Fee float64 `json:"fee,string"` FilledQuantity float64 `json:"filledQuantity,string"` AveragePrice float64 `json:"averagePrice,string"` OrderTime time.Time `json:"orderTime"` Status string `json:"status"` LastFillQuantity float64 `json:"lastFillQuantity,string"` LastFillPrice float64 `json:"lastFillPrice,string"` LastFillTime string `json:"lastFillTime"` }
WsOrderData stores websocket user order data
type WsOrderbookData ¶
type WsOrderbookData struct { Topic string `json:"topic"` Action string `json:"action"` Data []struct { Bids [][2]string `json:"bids"` Asks [][2]string `json:"asks"` Version int64 `json:"version"` Timestamp int64 `json:"timestamp"` } `json:"data"` }
WsOrderbookData stores ws orderbook data
type WsPosition ¶
type WsPosition struct { Topic string `json:"topic"` Data []WsPositionData `json:"data"` }
WsPosition stores websocket info on user's positions
type WsPositionData ¶
type WsPositionData struct { AvailableQuantity float64 `json:"availableQuantity,string"` AveragePrice float64 `json:"avgPrice,string"` Leverage int64 `json:"leverage,string"` LiquidationPrice float64 `json:"liquidationPrice,string"` MarkPrice float64 `json:"markPrice,string"` PositionMargin float64 `json:"positionMargin,string"` Quantity float64 `json:"quantity,string"` RealisedPNL float64 `json:"realisedPnl,string"` Side string `json:"side"` Symbol string `json:"symbol"` MarginMode int64 `json:"marginMode,string"` CreateTime time.Time `json:"createTime"` }
WsPositionData stores websocket info on user's position
type WsTicker ¶
type WsTicker struct { Topic string `json:"topic"` Data []WsTickerData `json:"data"` }
WsTicker stores websocket ticker
type WsTickerData ¶
type WsTickerData struct { Symbol string `json:"symbol"` LastPrice float64 `json:"lastPrice,string"` MarkPrice float64 `json:"markPrice,string"` BestAskPrice float64 `json:"bestAskPrice,string"` BestBidPrice float64 `json:"bestBidPrice,string"` BestAskVolume float64 `json:"bestAskVolume,string"` BestBidVolume float64 `json:"bestBidVolume,string"` High24h float64 `json:"high24h,string"` Low24h float64 `json:"low24h,string"` Volume24h float64 `json:"volume24h,string"` Timestamp int64 `json:"timestamp"` }
WsTickerData stores websocket ticker data
type WsTradeData ¶
type WsTradeData struct { BestAskPrice float64 `json:"bestAskPrice,string"` BestBidPrice float64 `json:"bestBidPrice,string"` High24h float64 `json:"high24h,string"` LastPrice float64 `json:"lastPrice,string"` Low24h float64 `json:"low24h,string"` Open24h float64 `json:"open24h,string"` OpenPrice float64 `json:"openPrice,string"` Symbol string `json:"symbol"` Timestamp int64 `json:"timestamp"` Volume24h float64 `json:"volume24h,string"` }
WsTradeData stores trade data for websocket
type WsTradeList ¶
type WsTradeList struct { Topic string `json:"topic"` Data [][4]interface{} `json:"data"` }
WsTradeList stores websocket tradelist data
type WsUserData ¶
type WsUserData struct { Asset string `json:"string"` Available float64 `json:"availableBalance,string"` Locked float64 `json:"frozenBalance,string"` Total float64 `json:"balance,string"` Timestamp time.Time `json:"timestamp"` }
WsUserData stores websocket user data
type WsUserInfo ¶
type WsUserInfo struct { Topic string `json:"topic"` Data []WsUserData `json:"data"` }
WsUserInfo stores websocket user info
type WsUserOrders ¶
type WsUserOrders struct { Topic string `json:"topic"` Data []WsOrderData `json:"data"` }
WsUserOrders stores websocket user orders' data