Documentation ¶
Index ¶
- func GetRateLimit() request.RateLimitDefinitions
- type AccountData
- type AssetData
- type BTCMarkets
- func (b *BTCMarkets) BatchPlaceCancelOrders(ctx context.Context, cancelOrders []CancelBatch, placeOrders []PlaceBatch) (*BatchPlaceCancelResponse, error)
- func (b *BTCMarkets) CancelAllOpenOrdersByPairs(ctx context.Context, marketIDs []string) ([]CancelOrderResp, error)
- func (b *BTCMarkets) CancelAllOrders(ctx context.Context, _ *order.Cancel) (order.CancelAllResponse, error)
- func (b *BTCMarkets) CancelBatch(ctx context.Context, ids []string) (BatchCancelResponse, error)
- func (b *BTCMarkets) CancelBatchOrders(ctx context.Context, o []order.Cancel) (*order.CancelBatchResponse, error)
- func (b *BTCMarkets) CancelOrder(ctx context.Context, o *order.Cancel) error
- func (b *BTCMarkets) CreateNewReport(ctx context.Context, reportType, format string) (CreateReportResp, error)
- func (b *BTCMarkets) FetchAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
- func (b *BTCMarkets) FetchDepositAddress(ctx context.Context, curr currency.Code, before, after, limit int64) (*DepositAddress, error)
- func (b *BTCMarkets) FetchOrder(ctx context.Context, id string) (*OrderData, error)
- func (b *BTCMarkets) FetchOrderbook(ctx context.Context, p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
- func (b *BTCMarkets) FetchTicker(ctx context.Context, p currency.Pair, assetType asset.Item) (*ticker.Price, error)
- func (b *BTCMarkets) FetchTradablePairs(ctx context.Context, a asset.Item) (currency.Pairs, error)
- func (b *BTCMarkets) FormatExchangeKlineInterval(in kline.Interval) string
- func (b *BTCMarkets) GetAccountBalance(ctx context.Context) ([]AccountData, error)
- func (b *BTCMarkets) GetAccountFundingHistory(_ context.Context) ([]exchange.FundingHistory, error)
- func (b *BTCMarkets) GetActiveOrders(ctx context.Context, req *order.MultiOrderRequest) (order.FilteredOrders, error)
- func (b *BTCMarkets) GetBatchTrades(ctx context.Context, ids []string) (BatchTradeResponse, error)
- func (b *BTCMarkets) GetCurrencyTradeURL(_ context.Context, a asset.Item, cp currency.Pair) (string, error)
- func (b *BTCMarkets) GetCurrentServerTime(ctx context.Context) (time.Time, error)
- func (b *BTCMarkets) GetDeposit(ctx context.Context, id string) (TransferData, error)
- func (b *BTCMarkets) GetDepositAddress(ctx context.Context, cryptocurrency currency.Code, _, _ string) (*deposit.Address, error)
- func (b *BTCMarkets) GetFee(ctx context.Context, feeBuilder *exchange.FeeBuilder) (float64, error)
- func (b *BTCMarkets) GetFeeByType(ctx context.Context, feeBuilder *exchange.FeeBuilder) (float64, error)
- func (b *BTCMarkets) GetFuturesContractDetails(context.Context, asset.Item) ([]futures.Contract, error)
- func (b *BTCMarkets) GetHistoricCandles(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, ...) (*kline.Item, error)
- func (b *BTCMarkets) GetHistoricCandlesExtended(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, ...) (*kline.Item, error)
- func (b *BTCMarkets) GetHistoricTrades(_ context.Context, _ currency.Pair, _ asset.Item, _, _ time.Time) ([]trade.Data, error)
- func (b *BTCMarkets) GetLatestFundingRates(context.Context, *fundingrate.LatestRateRequest) ([]fundingrate.LatestRateResponse, error)
- func (b *BTCMarkets) GetMarketCandles(ctx context.Context, marketID, timeWindow string, from, to time.Time, ...) (out CandleResponse, err error)
- func (b *BTCMarkets) GetMarkets(ctx context.Context) ([]Market, error)
- func (b *BTCMarkets) GetMultipleOrderbooks(ctx context.Context, marketIDs []string) ([]Orderbook, error)
- func (b *BTCMarkets) GetOrderHistory(ctx context.Context, req *order.MultiOrderRequest) (order.FilteredOrders, error)
- func (b *BTCMarkets) GetOrderInfo(ctx context.Context, orderID string, _ currency.Pair, _ asset.Item) (*order.Detail, error)
- func (b *BTCMarkets) GetOrderbook(ctx context.Context, marketID string, level int64) (*Orderbook, error)
- func (b *BTCMarkets) GetOrders(ctx context.Context, marketID string, before, after, limit int64, ...) ([]OrderData, error)
- func (b *BTCMarkets) GetRecentTrades(ctx context.Context, p currency.Pair, assetType asset.Item) ([]trade.Data, error)
- func (b *BTCMarkets) GetReport(ctx context.Context, reportID string) (ReportData, error)
- func (b *BTCMarkets) GetServerTime(ctx context.Context, _ asset.Item) (time.Time, error)
- func (b *BTCMarkets) GetSubscriptionTemplate(_ *subscription.Subscription) (*template.Template, error)
- func (b *BTCMarkets) GetTicker(ctx context.Context, marketID string) (Ticker, error)
- func (b *BTCMarkets) GetTickers(ctx context.Context, marketIDs currency.Pairs) ([]Ticker, error)
- func (b *BTCMarkets) GetTradeByID(ctx context.Context, id string) (TradeHistoryData, error)
- func (b *BTCMarkets) GetTradeHistory(ctx context.Context, marketID, orderID string, before, after, limit int64) ([]TradeHistoryData, error)
- func (b *BTCMarkets) GetTrades(ctx context.Context, marketID string, before, after, limit int64) ([]Trade, error)
- func (b *BTCMarkets) GetTradingFees(ctx context.Context) (TradingFeeResponse, error)
- func (b *BTCMarkets) GetTransactions(ctx context.Context, assetName string, before, after, limit int64) ([]TransactionData, error)
- func (b *BTCMarkets) GetTransfer(ctx context.Context, id string) (TransferData, error)
- func (b *BTCMarkets) GetWithdrawal(ctx context.Context, id string) (TransferData, error)
- func (b *BTCMarkets) GetWithdrawalFees(ctx context.Context) ([]WithdrawalFeeData, error)
- func (b *BTCMarkets) GetWithdrawalsHistory(ctx context.Context, c currency.Code, _ asset.Item) ([]exchange.WithdrawalHistory, error)
- func (b *BTCMarkets) ListAssets(ctx context.Context) ([]AssetData, error)
- func (b *BTCMarkets) ListDeposits(ctx context.Context, before, after, limit int64) ([]TransferData, error)
- func (b *BTCMarkets) ListTransfers(ctx context.Context, before, after, limit int64) ([]TransferData, error)
- func (b *BTCMarkets) ListWithdrawals(ctx context.Context, before, after, limit int64) ([]TransferData, error)
- func (b *BTCMarkets) ModifyOrder(ctx context.Context, action *order.Modify) (*order.ModifyResponse, error)
- func (b *BTCMarkets) NewOrder(ctx context.Context, price, amount, triggerPrice, targetAmount float64, ...) (OrderData, error)
- func (b *BTCMarkets) ReSubscribeSpecificOrderbook(pair currency.Pair) error
- func (b *BTCMarkets) RemoveOrder(ctx context.Context, id string) (CancelOrderResp, error)
- func (b *BTCMarkets) ReplaceOrder(ctx context.Context, id, clientOrderID string, price, amount float64) (*OrderData, error)
- func (b *BTCMarkets) RequestWithdraw(ctx context.Context, assetName string, amount float64, ...) (TransferData, error)
- func (b *BTCMarkets) SendAuthenticatedRequest(ctx context.Context, method, path string, data, result interface{}, ...) (err error)
- func (b *BTCMarkets) SendHTTPRequest(ctx context.Context, path string, result interface{}) error
- func (b *BTCMarkets) SetDefaults()
- func (b *BTCMarkets) Setup(exch *config.Exchange) error
- func (b *BTCMarkets) SubmitOrder(ctx context.Context, s *order.Submit) (*order.SubmitResponse, error)
- func (b *BTCMarkets) Subscribe(subs subscription.List) error
- func (b *BTCMarkets) Unsubscribe(subs subscription.List) error
- func (b *BTCMarkets) UpdateAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
- func (b *BTCMarkets) UpdateOrderExecutionLimits(ctx context.Context, a asset.Item) error
- func (b *BTCMarkets) UpdateOrderbook(ctx context.Context, p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
- func (b *BTCMarkets) UpdateTicker(ctx context.Context, p currency.Pair, a asset.Item) (*ticker.Price, error)
- func (b *BTCMarkets) UpdateTickers(ctx context.Context, a asset.Item) error
- func (b *BTCMarkets) UpdateTradablePairs(ctx context.Context, forceUpdate bool) error
- func (b *BTCMarkets) ValidateAPICredentials(ctx context.Context, assetType asset.Item) error
- func (b *BTCMarkets) WithdrawCryptocurrencyFunds(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (b *BTCMarkets) WithdrawFiatFunds(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (b *BTCMarkets) WithdrawFiatFundsToInternationalBank(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (b *BTCMarkets) WsConnect() error
- type BatchCancelResponse
- type BatchPlaceCancelResponse
- type BatchPlaceData
- type BatchTradeResponse
- type CancelBatch
- type CancelOrderMethod
- type CancelOrderResp
- type CandleResponse
- type CreateReportResp
- type DepositAddress
- type Market
- type MarketCandle
- type OBData
- type Order
- type OrderData
- type OrderToGo
- type Orderbook
- type PaymentDetails
- type PlaceBatch
- type PlaceOrderMethod
- type ReportData
- type Ticker
- type TimeResp
- type Trade
- type TradeHistoryData
- type TradeResponse
- type TradingFee
- type TradingFeeData
- type TradingFeeResponse
- type TransactionData
- type TransferData
- type UnprocessedBatchResp
- type WebsocketOrderbook
- type WithdrawRequestAUD
- type WithdrawRequestCrypto
- type WithdrawalFeeData
- type WsError
- type WsFundTransfer
- type WsMessageType
- type WsOrderChange
- type WsOrderbook
- type WsSubscribe
- type WsTick
- type WsTrade
- type WsTradeData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRateLimit ¶
func GetRateLimit() request.RateLimitDefinitions
GetRateLimit returns the rate limit for the exchange
Types ¶
type AccountData ¶
type AccountData struct { AssetName string `json:"assetName"` Balance float64 `json:"balance,string"` Available float64 `json:"available,string"` Locked float64 `json:"locked,string"` }
AccountData stores account data
type AssetData ¶
type AssetData struct { AssetName string `json:"assetName"` MinDepositAmount float64 `json:"minDepositAmount,string"` MaxDepositAmount float64 `json:"maxDepositAmount,string"` DepositDecimals float64 `json:"depositDecimals,string"` MinWithdrawalAmount float64 `json:"minWithdrawalAmount,string"` MaxWithdrawalAmount float64 `json:"maxWithdrawalAmount,string"` WithdrawalDecimals float64 `json:"withdrawalDecimals,string"` WithdrawalFee float64 `json:"withdrawalFee,string"` DepositFee float64 `json:"depositFee,string"` }
AssetData stores data for given asset
type BTCMarkets ¶
BTCMarkets is the overarching type across the BTCMarkets package
func (*BTCMarkets) BatchPlaceCancelOrders ¶
func (b *BTCMarkets) BatchPlaceCancelOrders(ctx context.Context, cancelOrders []CancelBatch, placeOrders []PlaceBatch) (*BatchPlaceCancelResponse, error)
BatchPlaceCancelOrders places and cancels batch orders
func (*BTCMarkets) CancelAllOpenOrdersByPairs ¶
func (b *BTCMarkets) CancelAllOpenOrdersByPairs(ctx context.Context, marketIDs []string) ([]CancelOrderResp, error)
CancelAllOpenOrdersByPairs cancels all open orders unless pairs are specified
func (*BTCMarkets) CancelAllOrders ¶
func (b *BTCMarkets) CancelAllOrders(ctx context.Context, _ *order.Cancel) (order.CancelAllResponse, error)
CancelAllOrders cancels all orders associated with a currency pair
func (*BTCMarkets) CancelBatch ¶
func (b *BTCMarkets) CancelBatch(ctx context.Context, ids []string) (BatchCancelResponse, error)
CancelBatch cancels given ids
func (*BTCMarkets) CancelBatchOrders ¶
func (b *BTCMarkets) CancelBatchOrders(ctx context.Context, o []order.Cancel) (*order.CancelBatchResponse, error)
CancelBatchOrders cancels an orders by their corresponding ID numbers
func (*BTCMarkets) CancelOrder ¶
CancelOrder cancels an order by its corresponding ID number
func (*BTCMarkets) CreateNewReport ¶
func (b *BTCMarkets) CreateNewReport(ctx context.Context, reportType, format string) (CreateReportResp, error)
CreateNewReport creates a new report
func (*BTCMarkets) FetchAccountInfo ¶
func (b *BTCMarkets) FetchAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
FetchAccountInfo retrieves balances for all enabled currencies
func (*BTCMarkets) FetchDepositAddress ¶
func (b *BTCMarkets) FetchDepositAddress(ctx context.Context, curr currency.Code, before, after, limit int64) (*DepositAddress, error)
FetchDepositAddress gets deposit address for the given asset
func (*BTCMarkets) FetchOrder ¶
FetchOrder finds order based on the provided id
func (*BTCMarkets) FetchOrderbook ¶
func (b *BTCMarkets) FetchOrderbook(ctx context.Context, p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
FetchOrderbook returns orderbook base on the currency pair
func (*BTCMarkets) FetchTicker ¶
func (b *BTCMarkets) FetchTicker(ctx context.Context, p currency.Pair, assetType asset.Item) (*ticker.Price, error)
FetchTicker returns the ticker for a currency pair
func (*BTCMarkets) FetchTradablePairs ¶
FetchTradablePairs returns a list of the exchanges tradable pairs
func (*BTCMarkets) FormatExchangeKlineInterval ¶
func (b *BTCMarkets) FormatExchangeKlineInterval(in kline.Interval) string
FormatExchangeKlineInterval returns Interval to exchange formatted string
func (*BTCMarkets) GetAccountBalance ¶
func (b *BTCMarkets) GetAccountBalance(ctx context.Context) ([]AccountData, error)
GetAccountBalance returns the full account balance
func (*BTCMarkets) GetAccountFundingHistory ¶
func (b *BTCMarkets) GetAccountFundingHistory(_ context.Context) ([]exchange.FundingHistory, error)
GetAccountFundingHistory returns funding history, deposits and withdrawals
func (*BTCMarkets) GetActiveOrders ¶
func (b *BTCMarkets) GetActiveOrders(ctx context.Context, req *order.MultiOrderRequest) (order.FilteredOrders, error)
GetActiveOrders retrieves any orders that are active/open
func (*BTCMarkets) GetBatchTrades ¶
func (b *BTCMarkets) GetBatchTrades(ctx context.Context, ids []string) (BatchTradeResponse, error)
GetBatchTrades gets batch trades
func (*BTCMarkets) GetCurrencyTradeURL ¶
func (b *BTCMarkets) 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 (*BTCMarkets) GetCurrentServerTime ¶
GetCurrentServerTime gets time from btcmarkets
func (*BTCMarkets) GetDeposit ¶
func (b *BTCMarkets) GetDeposit(ctx context.Context, id string) (TransferData, error)
GetDeposit gets deposit info for a given ID
func (*BTCMarkets) GetDepositAddress ¶
func (b *BTCMarkets) GetDepositAddress(ctx context.Context, cryptocurrency currency.Code, _, _ string) (*deposit.Address, error)
GetDepositAddress returns a deposit address for a specified currency
func (*BTCMarkets) GetFee ¶
func (b *BTCMarkets) GetFee(ctx context.Context, feeBuilder *exchange.FeeBuilder) (float64, error)
GetFee returns an estimate of fee based on type of transaction
func (*BTCMarkets) GetFeeByType ¶
func (b *BTCMarkets) GetFeeByType(ctx context.Context, feeBuilder *exchange.FeeBuilder) (float64, error)
GetFeeByType returns an estimate of fee based on type of transaction
func (*BTCMarkets) GetFuturesContractDetails ¶
func (b *BTCMarkets) GetFuturesContractDetails(context.Context, asset.Item) ([]futures.Contract, error)
GetFuturesContractDetails returns all contracts from the exchange by asset type
func (*BTCMarkets) GetHistoricCandles ¶
func (b *BTCMarkets) GetHistoricCandles(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, start, end time.Time) (*kline.Item, error)
GetHistoricCandles returns candles between a time period for a set time interval
func (*BTCMarkets) GetHistoricCandlesExtended ¶
func (b *BTCMarkets) GetHistoricCandlesExtended(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, start, end time.Time) (*kline.Item, error)
GetHistoricCandlesExtended returns candles between a time period for a set time interval
func (*BTCMarkets) GetHistoricTrades ¶
func (b *BTCMarkets) GetHistoricTrades(_ context.Context, _ currency.Pair, _ asset.Item, _, _ time.Time) ([]trade.Data, error)
GetHistoricTrades returns historic trade data within the timeframe provided
func (*BTCMarkets) GetLatestFundingRates ¶
func (b *BTCMarkets) GetLatestFundingRates(context.Context, *fundingrate.LatestRateRequest) ([]fundingrate.LatestRateResponse, error)
GetLatestFundingRates returns the latest funding rates data
func (*BTCMarkets) GetMarketCandles ¶
func (b *BTCMarkets) GetMarketCandles(ctx context.Context, marketID, timeWindow string, from, to time.Time, before, after, limit int64) (out CandleResponse, err error)
GetMarketCandles gets candles for specified currency pair
func (*BTCMarkets) GetMarkets ¶
func (b *BTCMarkets) GetMarkets(ctx context.Context) ([]Market, error)
GetMarkets returns the BTCMarkets instruments
func (*BTCMarkets) GetMultipleOrderbooks ¶
func (b *BTCMarkets) GetMultipleOrderbooks(ctx context.Context, marketIDs []string) ([]Orderbook, error)
GetMultipleOrderbooks gets orderbooks
func (*BTCMarkets) GetOrderHistory ¶
func (b *BTCMarkets) GetOrderHistory(ctx context.Context, req *order.MultiOrderRequest) (order.FilteredOrders, error)
GetOrderHistory retrieves account order information Can Limit response to specific order status
func (*BTCMarkets) GetOrderInfo ¶
func (b *BTCMarkets) GetOrderInfo(ctx context.Context, orderID string, _ currency.Pair, _ asset.Item) (*order.Detail, error)
GetOrderInfo returns order information based on order ID
func (*BTCMarkets) GetOrderbook ¶
func (b *BTCMarkets) GetOrderbook(ctx context.Context, marketID string, level int64) (*Orderbook, error)
GetOrderbook returns current orderbook. levels are: 0 - Returns the top bids and ask orders only. 1 - Returns top 50 bids and asks. 2 - Returns full orderbook. WARNING: This is cached every 10 seconds.
func (*BTCMarkets) GetOrders ¶
func (b *BTCMarkets) GetOrders(ctx context.Context, marketID string, before, after, limit int64, openOnly bool) ([]OrderData, error)
GetOrders returns current order information on the exchange
func (*BTCMarkets) GetRecentTrades ¶
func (b *BTCMarkets) 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 (*BTCMarkets) GetReport ¶
func (b *BTCMarkets) GetReport(ctx context.Context, reportID string) (ReportData, error)
GetReport finds details bout a past report
func (*BTCMarkets) GetServerTime ¶
GetServerTime returns the current exchange server time.
func (*BTCMarkets) GetSubscriptionTemplate ¶
func (b *BTCMarkets) GetSubscriptionTemplate(_ *subscription.Subscription) (*template.Template, error)
GetSubscriptionTemplate returns a subscription channel template
func (*BTCMarkets) GetTickers ¶
GetTickers gets multiple tickers
func (*BTCMarkets) GetTradeByID ¶
func (b *BTCMarkets) GetTradeByID(ctx context.Context, id string) (TradeHistoryData, error)
GetTradeByID returns the singular trade of the ID given
func (*BTCMarkets) GetTradeHistory ¶
func (b *BTCMarkets) GetTradeHistory(ctx context.Context, marketID, orderID string, before, after, limit int64) ([]TradeHistoryData, error)
GetTradeHistory returns trade history
func (*BTCMarkets) GetTrades ¶
func (b *BTCMarkets) GetTrades(ctx context.Context, marketID string, before, after, limit int64) ([]Trade, error)
GetTrades returns executed trades on the exchange
func (*BTCMarkets) GetTradingFees ¶
func (b *BTCMarkets) GetTradingFees(ctx context.Context) (TradingFeeResponse, error)
GetTradingFees returns trading fees for all pairs based on trading activity
func (*BTCMarkets) GetTransactions ¶
func (b *BTCMarkets) GetTransactions(ctx context.Context, assetName string, before, after, limit int64) ([]TransactionData, error)
GetTransactions gets trading fees
func (*BTCMarkets) GetTransfer ¶
func (b *BTCMarkets) GetTransfer(ctx context.Context, id string) (TransferData, error)
GetTransfer gets asset transfer info for a given ID
func (*BTCMarkets) GetWithdrawal ¶
func (b *BTCMarkets) GetWithdrawal(ctx context.Context, id string) (TransferData, error)
GetWithdrawal gets withdrawawl info for a given id
func (*BTCMarkets) GetWithdrawalFees ¶
func (b *BTCMarkets) GetWithdrawalFees(ctx context.Context) ([]WithdrawalFeeData, error)
GetWithdrawalFees gets withdrawal fees for all assets
func (*BTCMarkets) GetWithdrawalsHistory ¶
func (b *BTCMarkets) GetWithdrawalsHistory(ctx context.Context, c currency.Code, _ asset.Item) ([]exchange.WithdrawalHistory, error)
GetWithdrawalsHistory returns previous withdrawals data
func (*BTCMarkets) ListAssets ¶
func (b *BTCMarkets) ListAssets(ctx context.Context) ([]AssetData, error)
ListAssets lists all available assets
func (*BTCMarkets) ListDeposits ¶
func (b *BTCMarkets) ListDeposits(ctx context.Context, before, after, limit int64) ([]TransferData, error)
ListDeposits lists the deposit history
func (*BTCMarkets) ListTransfers ¶
func (b *BTCMarkets) ListTransfers(ctx context.Context, before, after, limit int64) ([]TransferData, error)
ListTransfers lists the past asset transfers
func (*BTCMarkets) ListWithdrawals ¶
func (b *BTCMarkets) ListWithdrawals(ctx context.Context, before, after, limit int64) ([]TransferData, error)
ListWithdrawals lists the withdrawal history
func (*BTCMarkets) ModifyOrder ¶
func (b *BTCMarkets) ModifyOrder(ctx context.Context, action *order.Modify) (*order.ModifyResponse, error)
ModifyOrder will allow of changing orderbook placement and limit to market conversion
func (*BTCMarkets) NewOrder ¶
func (b *BTCMarkets) NewOrder(ctx context.Context, price, amount, triggerPrice, targetAmount float64, marketID, orderType, side, timeInForce, selfTrade, clientOrderID string, postOnly bool) (OrderData, error)
NewOrder requests a new order and returns an ID
func (*BTCMarkets) ReSubscribeSpecificOrderbook ¶
func (b *BTCMarkets) ReSubscribeSpecificOrderbook(pair currency.Pair) error
ReSubscribeSpecificOrderbook removes the subscription and the subscribes again to fetch a new snapshot in the event of a de-sync event.
func (*BTCMarkets) RemoveOrder ¶
func (b *BTCMarkets) RemoveOrder(ctx context.Context, id string) (CancelOrderResp, error)
RemoveOrder removes a given order
func (*BTCMarkets) ReplaceOrder ¶
func (b *BTCMarkets) ReplaceOrder(ctx context.Context, id, clientOrderID string, price, amount float64) (*OrderData, error)
ReplaceOrder cancels an order and then places a new order.
func (*BTCMarkets) RequestWithdraw ¶
func (b *BTCMarkets) RequestWithdraw(ctx context.Context, assetName string, amount float64, toAddress, accountName, accountNumber, bsbNumber, bankName string) (TransferData, error)
RequestWithdraw requests withdrawals
func (*BTCMarkets) SendAuthenticatedRequest ¶
func (b *BTCMarkets) SendAuthenticatedRequest(ctx context.Context, method, path string, data, result interface{}, f request.EndpointLimit) (err error)
SendAuthenticatedRequest sends an authenticated HTTP request
func (*BTCMarkets) SendHTTPRequest ¶
func (b *BTCMarkets) SendHTTPRequest(ctx context.Context, path string, result interface{}) error
SendHTTPRequest sends an unauthenticated HTTP request
func (*BTCMarkets) Setup ¶
func (b *BTCMarkets) Setup(exch *config.Exchange) error
Setup takes in an exchange configuration and sets all parameters
func (*BTCMarkets) SubmitOrder ¶
func (b *BTCMarkets) SubmitOrder(ctx context.Context, s *order.Submit) (*order.SubmitResponse, error)
SubmitOrder submits a new order
func (*BTCMarkets) Subscribe ¶
func (b *BTCMarkets) Subscribe(subs subscription.List) error
Subscribe sends a websocket message to receive data from the channel
func (*BTCMarkets) Unsubscribe ¶
func (b *BTCMarkets) Unsubscribe(subs subscription.List) error
Unsubscribe sends a websocket message to manage and remove a subscription.
func (*BTCMarkets) UpdateAccountInfo ¶
func (b *BTCMarkets) UpdateAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
UpdateAccountInfo retrieves balances for all enabled currencies
func (*BTCMarkets) UpdateOrderExecutionLimits ¶
UpdateOrderExecutionLimits sets exchange executions for a required asset type
func (*BTCMarkets) UpdateOrderbook ¶
func (b *BTCMarkets) UpdateOrderbook(ctx context.Context, p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
UpdateOrderbook updates and returns the orderbook for a currency pair
func (*BTCMarkets) UpdateTicker ¶
func (b *BTCMarkets) UpdateTicker(ctx context.Context, p currency.Pair, a asset.Item) (*ticker.Price, error)
UpdateTicker updates and returns the ticker for a currency pair
func (*BTCMarkets) UpdateTickers ¶
UpdateTickers updates the ticker for all currency pairs of a given asset type
func (*BTCMarkets) UpdateTradablePairs ¶
func (b *BTCMarkets) UpdateTradablePairs(ctx context.Context, forceUpdate bool) error
UpdateTradablePairs updates the exchanges available pairs and stores them in the exchanges config
func (*BTCMarkets) ValidateAPICredentials ¶
ValidateAPICredentials validates current credentials used for wrapper functionality
func (*BTCMarkets) WithdrawCryptocurrencyFunds ¶
func (b *BTCMarkets) WithdrawCryptocurrencyFunds(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is submitted
func (*BTCMarkets) WithdrawFiatFunds ¶
func (b *BTCMarkets) WithdrawFiatFunds(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawFiatFunds returns a withdrawal ID when a withdrawal is submitted
func (*BTCMarkets) WithdrawFiatFundsToInternationalBank ¶
func (b *BTCMarkets) WithdrawFiatFundsToInternationalBank(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is submitted
func (*BTCMarkets) WsConnect ¶
func (b *BTCMarkets) WsConnect() error
WsConnect connects to a websocket feed
type BatchCancelResponse ¶
type BatchCancelResponse struct { CancelOrders []CancelOrderResp `json:"cancelOrders"` UnprocessedRequests []UnprocessedBatchResp `json:"unprocessedRequests"` }
BatchCancelResponse stores the cancellation details from batch cancels
type BatchPlaceCancelResponse ¶
type BatchPlaceCancelResponse struct { PlacedOrders []BatchPlaceData `json:"placeOrders"` CancelledOrders []CancelOrderResp `json:"cancelOrders"` UnprocessedOrders []UnprocessedBatchResp `json:"unprocessedRequests"` }
BatchPlaceCancelResponse stores place and cancel batch data
type BatchPlaceData ¶
type BatchPlaceData struct { OrderID string `json:"orderId"` MarketID string `json:"marketId"` Side string `json:"side"` Type string `json:"type"` CreationTime time.Time `json:"creationTime"` Price float64 `json:"price,string"` Amount float64 `json:"amount,string"` OpenAmount float64 `json:"openAmount,string"` Status string `json:"status"` ClientOrderID string `json:"clientOrderId"` }
BatchPlaceData stores data for placed batch orders
type BatchTradeResponse ¶
type BatchTradeResponse struct { Orders []BatchPlaceData `json:"orders"` UnprocessedRequests []UnprocessedBatchResp `json:"unprocessedRequests"` }
BatchTradeResponse stores the trades from batchtrades
type CancelBatch ¶
type CancelBatch struct { OrderID string `json:"orderId,omitempty"` ClientOrderID string `json:"clientOrderId,omitempty"` }
CancelBatch stores data for batch cancel request
type CancelOrderMethod ¶
type CancelOrderMethod struct {
CancelOrder CancelBatch `json:"cancelOrder,omitempty"`
}
CancelOrderMethod stores data for Cancel request
type CancelOrderResp ¶
type CancelOrderResp struct { OrderID string `json:"orderId"` ClientOrderID string `json:"clientOrderId"` }
CancelOrderResp stores data for cancelled orders
type CreateReportResp ¶
type CreateReportResp struct {
ReportID string `json:"reportId"`
}
CreateReportResp stores data for created report
type DepositAddress ¶
type DepositAddress struct { Address string `json:"address"` AssetName string `json:"assetName"` Tag string // custom field we populate }
DepositAddress stores deposit address data
type Market ¶
type Market struct { MarketID string `json:"marketId"` BaseAsset string `json:"baseAssetName"` QuoteAsset string `json:"quoteAssetName"` MinOrderAmount float64 `json:"minOrderAmount,string"` MaxOrderAmount float64 `json:"maxOrderAmount,string"` AmountDecimals float64 `json:"amountDecimals,string"` PriceDecimals float64 `json:"priceDecimals,string"` Status string `json:"status"` }
Market holds a tradable market instrument
type MarketCandle ¶
type MarketCandle struct { Time time.Time Open float64 Close float64 Low float64 High float64 Volume float64 }
MarketCandle stores candle data for a given pair
type Order ¶
type Order struct { ID int64 `json:"id"` Currency string `json:"currency"` Instrument string `json:"instrument"` OrderSide string `json:"orderSide"` OrderType string `json:"ordertype"` CreationTime time.Time `json:"creationTime"` Status string `json:"status"` ErrorMessage string `json:"errorMessage"` Price float64 `json:"price"` Volume float64 `json:"volume"` OpenVolume float64 `json:"openVolume"` ClientRequestID string `json:"clientRequestId"` Trades []TradeResponse `json:"trades"` }
Order holds order information
type OrderData ¶
type OrderData struct { OrderID string `json:"orderId"` MarketID string `json:"marketId"` Side string `json:"side"` Type string `json:"type"` CreationTime time.Time `json:"creationTime"` Price float64 `json:"price,string"` Amount float64 `json:"amount,string"` OpenAmount float64 `json:"openAmount,string"` Status string `json:"status"` TargetAmount float64 `json:"targetAmount,string"` TimeInForce string `json:"timeInForce"` }
OrderData stores data for new order created
type OrderToGo ¶
type OrderToGo struct { Currency string `json:"currency"` Instrument string `json:"instrument"` Price int64 `json:"price"` Volume int64 `json:"volume"` OrderSide string `json:"orderSide"` OrderType string `json:"ordertype"` ClientRequestID string `json:"clientRequestId"` }
OrderToGo holds order information to be sent to the exchange
type PaymentDetails ¶
type PaymentDetails struct {
Address string `json:"address"`
}
PaymentDetails stores payment address
type PlaceBatch ¶
type PlaceBatch struct { MarketID string `json:"marketId"` Price float64 `json:"price"` Amount float64 `json:"amount"` OrderType string `json:"type"` Side string `json:"side"` TriggerPrice float64 `json:"triggerPrice,omitempty"` TriggerAmount float64 `json:"triggerAmount,omitempty"` TimeInForce string `json:"timeInForce,omitempty"` PostOnly bool `json:"postOnly,omitempty"` SelfTrade string `json:"selfTrade,omitempty"` ClientOrderID string `json:"clientOrderId,omitempty"` }
PlaceBatch stores data for place batch request
type PlaceOrderMethod ¶
type PlaceOrderMethod struct {
PlaceOrder PlaceBatch `json:"placeOrder,omitempty"`
}
PlaceOrderMethod stores data for place request
type ReportData ¶
type ReportData struct { ID string `json:"id"` ContentURL string `json:"contentUrl"` CreationTime time.Time `json:"creationTime"` ReportType string `json:"reportType"` Status string `json:"status"` Format string `json:"format"` }
ReportData gets data for a created report
type Ticker ¶
type Ticker struct { MarketID string `json:"marketId"` BestBID float64 `json:"bestBid,string"` BestAsk float64 `json:"bestAsk,string"` LastPrice float64 `json:"lastPrice,string"` Volume float64 `json:"volume24h,string"` Change24h float64 `json:"price24h,string"` Low24h float64 `json:"low24h,string"` High24h float64 `json:"high24h,string"` Timestamp time.Time `json:"timestamp"` }
Ticker holds ticker information
type Trade ¶
type Trade struct { TradeID string `json:"id"` Amount float64 `json:"amount,string"` Price float64 `json:"price,string"` Timestamp time.Time `json:"timestamp"` Side string `json:"side"` }
Trade holds trade information
type TradeHistoryData ¶
type TradeHistoryData struct { ID string `json:"id"` MarketID string `json:"marketId"` Timestamp time.Time `json:"timestamp"` Price float64 `json:"price,string"` Amount float64 `json:"amount,string"` Side string `json:"side"` Fee float64 `json:"fee,string"` OrderID string `json:"orderId"` LiquidityType string `json:"liquidityType"` }
TradeHistoryData stores data of past trades
type TradeResponse ¶
type TradeResponse struct { ID int64 `json:"id"` CreationTime time.Time `json:"creationTime"` Description string `json:"description"` Price float64 `json:"price"` Volume float64 `json:"volume"` Fee float64 `json:"fee"` }
TradeResponse holds trade information
type TradingFee ¶
type TradingFee struct { Success bool `json:"success"` ErrorCode int `json:"errorCode"` ErrorMessage string `json:"errorMessage"` TradingFeeRate float64 `json:"tradingfeerate"` Volume30Day float64 `json:"volume30day"` }
TradingFee 30 day trade volume
type TradingFeeData ¶
type TradingFeeData struct { MakerFeeRate float64 `json:"makerFeeRate,string"` TakerFeeRate float64 `json:"takerFeeRate,string"` MarketID string `json:"marketId"` }
TradingFeeData stores trading fee data
type TradingFeeResponse ¶
type TradingFeeResponse struct { MonthlyVolume float64 `json:"volume30Day,string"` FeeByMarkets []TradingFeeData `json:"FeeByMarkets"` }
TradingFeeResponse stores trading fee data
type TransactionData ¶
type TransactionData struct { ID string `json:"id"` CreationTime time.Time `json:"creationTime"` Description string `json:"description"` AssetName string `json:"assetName"` Amount float64 `json:"amount,string"` Balance float64 `json:"balance,string"` FeeType string `json:"type"` RecordType string `json:"recordType"` ReferrenceID string `json:"referrenceId"` }
TransactionData stores data from past transactions
type TransferData ¶
type TransferData struct { ID string `json:"id"` AssetName currency.Code `json:"assetName"` Amount float64 `json:"amount,string"` RequestType string `json:"type"` CreationTime time.Time `json:"creationTime"` Status string `json:"status"` Description string `json:"description"` Fee float64 `json:"fee,string"` LastUpdate string `json:"lastUpdate"` PaymentDetails PaymentDetails `json:"paymentDetail"` }
TransferData stores data from asset transfers
type UnprocessedBatchResp ¶
type UnprocessedBatchResp struct { Code string `json:"code"` Message string `json:"message"` RequestID string `json:"requestId"` }
UnprocessedBatchResp stores data for unprocessed response
type WebsocketOrderbook ¶
WebsocketOrderbook defines a specific websocket orderbook type to directly unmarshal json.
func (*WebsocketOrderbook) UnmarshalJSON ¶
func (w *WebsocketOrderbook) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the unmarshaler interface.
type WithdrawRequestAUD ¶
type WithdrawRequestAUD struct { Amount int64 `json:"amount"` Currency string `json:"currency"` AccountName string `json:"accountName"` AccountNumber string `json:"accountNumber"` BankName string `json:"bankName"` BSBNumber string `json:"bsbNumber"` }
WithdrawRequestAUD is a generalized withdraw request type
type WithdrawRequestCrypto ¶
type WithdrawRequestCrypto struct { Amount int64 `json:"amount"` Currency string `json:"currency"` Address string `json:"address"` }
WithdrawRequestCrypto is a generalized withdraw request type
type WithdrawalFeeData ¶
type WithdrawalFeeData struct { AssetName string `json:"assetName"` Fee float64 `json:"fee,string"` }
WithdrawalFeeData stores data for fees
type WsError ¶
type WsError struct { MessageType string `json:"messageType"` Code int64 `json:"code"` Message string `json:"message"` }
WsError stores websocket error data
type WsFundTransfer ¶
type WsFundTransfer struct { FundTransferID int64 `json:"fundtransferId"` TransferType string `json:"type"` Status string `json:"status"` Timestamp time.Time `json:"timestamp"` Amount float64 `json:"amount,string"` Currency string `json:"currency"` Fee float64 `json:"fee,string"` MessageType string `json:"messageType"` }
WsFundTransfer stores fund transfer data for websocket
type WsMessageType ¶
type WsMessageType struct {
MessageType string `json:"messageType"`
}
WsMessageType message sent via ws to determine type
type WsOrderChange ¶
type WsOrderChange struct { OrderID int64 `json:"orderId"` MarketID string `json:"marketId"` Side string `json:"side"` OrderType string `json:"type"` OpenVolume float64 `json:"openVolume,string"` Status string `json:"status"` TriggerStatus string `json:"triggerStatus"` Trades []WsTradeData `json:"trades"` Timestamp time.Time `json:"timestamp"` MessageType string `json:"messageType"` }
WsOrderChange stores order data
type WsOrderbook ¶
type WsOrderbook struct { Currency currency.Pair `json:"marketId"` Snapshot bool `json:"snapshot"` Timestamp time.Time `json:"timestamp"` SnapshotID int64 `json:"snapshotId"` Bids WebsocketOrderbook `json:"bids"` Asks WebsocketOrderbook `json:"asks"` Checksum uint32 `json:"checksum,string"` MessageType string `json:"messageType"` }
WsOrderbook message received for orderbook data
type WsSubscribe ¶
type WsSubscribe struct { MarketIDs []string `json:"marketIds,omitempty"` Channels []string `json:"channels,omitempty"` Key string `json:"key,omitempty"` Signature string `json:"signature,omitempty"` Timestamp string `json:"timestamp,omitempty"` MessageType string `json:"messageType,omitempty"` ClientType string `json:"clientType,omitempty"` }
WsSubscribe defines a subscription message used in the Subscribe function
type WsTick ¶
type WsTick struct { Currency string `json:"marketId"` Timestamp time.Time `json:"timestamp"` Bid float64 `json:"bestBid,string"` Ask float64 `json:"bestAsk,string"` Last float64 `json:"lastPrice,string"` Volume float64 `json:"volume24h,string"` Price24h float64 `json:"price24h,string"` Low24h float64 `json:"low24h,string"` High24 float64 `json:"high24h,string"` MessageType string `json:"messageType"` }
WsTick message received for ticker data
type WsTrade ¶
type WsTrade struct { Currency string `json:"marketId"` Timestamp time.Time `json:"timestamp"` TradeID int64 `json:"tradeId"` Price float64 `json:"price,string"` Volume float64 `json:"volume,string"` Side string `json:"side"` MessageType string `json:"messageType"` }
WsTrade message received for trade data