Documentation ¶
Index ¶
- Constants
- type OKEX
- func (o *OKEX) CancelBatchOrders(_ context.Context, _ []order.Cancel) (order.CancelBatchResponse, error)
- func (o *OKEX) CancelETTOrder(ctx context.Context, orderID string) (resp okgroup.PlaceETTOrderResponse, _ error)
- func (o *OKEX) CancelFuturesOrder(ctx context.Context, request okgroup.CancelFuturesOrderRequest) (resp okgroup.CancelFuturesOrderResponse, _ error)
- func (o *OKEX) CancelFuturesOrderBatch(ctx context.Context, request okgroup.CancelMultipleSpotOrdersRequest) (resp okgroup.CancelMultipleSpotOrdersResponse, _ error)
- func (o *OKEX) CancelMultipleSwapOrders(ctx context.Context, request okgroup.CancelMultipleSwapOrdersRequest) (resp okgroup.CancelMultipleSwapOrdersResponse, _ error)
- func (o *OKEX) CancelSwapOrder(ctx context.Context, request okgroup.CancelSwapOrderRequest) (resp okgroup.CancelSwapOrderResponse, _ error)
- func (o *OKEX) FetchTicker(ctx context.Context, p currency.Pair, assetType asset.Item) (tickerData *ticker.Price, err error)
- func (o *OKEX) FetchTradablePairs(ctx context.Context, i asset.Item) ([]string, error)
- func (o *OKEX) GetAllFuturesTokenInfo(ctx context.Context) (resp []okgroup.GetFuturesTokenInfoResponse, _ error)
- func (o *OKEX) GetAllMarginRates(ctx context.Context) ([]okgroup.MarginCurrencyData, error)
- func (o *OKEX) GetAllSwapTokensInformation(ctx context.Context) (resp []okgroup.GetAllSwapTokensInformationResponse, _ error)
- func (o *OKEX) GetDefaultConfig() (*config.Exchange, error)
- func (o *OKEX) GetETT(ctx context.Context) (resp []okgroup.GetETTResponse, _ error)
- func (o *OKEX) GetETTAccountInformationForCurrency(ctx context.Context, currency string) (resp okgroup.GetETTResponse, _ error)
- func (o *OKEX) GetETTBillsDetails(ctx context.Context, currency string) (resp []okgroup.GetETTBillsDetailsResponse, _ error)
- func (o *OKEX) GetETTConstituents(ctx context.Context, ett string) (resp okgroup.GetETTConstituentsResponse, _ error)
- func (o *OKEX) GetETTOrderDetails(ctx context.Context, orderID string) (resp okgroup.GetETTOrderListResponse, _ error)
- func (o *OKEX) GetETTOrderList(ctx context.Context, request okgroup.GetETTOrderListRequest) (resp []okgroup.GetETTOrderListResponse, _ error)
- func (o *OKEX) GetETTSettlementPriceHistory(ctx context.Context, ett string) (resp []okgroup.GetETTSettlementPriceHistoryResponse, _ error)
- func (o *OKEX) GetFundingRate(ctx context.Context, marketName, limit string) ([]okgroup.PerpSwapFundingRates, error)
- func (o *OKEX) GetFuturesAccountOfACurrency(ctx context.Context, instrumentID string) (resp okgroup.FuturesCurrencyData, _ error)
- func (o *OKEX) GetFuturesAccountOfAllCurrencies(ctx context.Context) (resp okgroup.FuturesAccountForAllCurrenciesResponse, _ error)
- func (o *OKEX) GetFuturesBillDetails(ctx context.Context, request okgroup.GetSpotBillDetailsForCurrencyRequest) (resp []okgroup.GetSpotBillDetailsForCurrencyResponse, _ error)
- func (o *OKEX) GetFuturesContractInformation(ctx context.Context) (resp []okgroup.GetFuturesContractInformationResponse, _ error)
- func (o *OKEX) GetFuturesCurrentMarkPrice(ctx context.Context, instrumentID string) (resp okgroup.GetFuturesCurrentMarkPriceResponse, _ error)
- func (o *OKEX) GetFuturesCurrentPriceLimit(ctx context.Context, instrumentID string) (resp okgroup.GetFuturesCurrentPriceLimitResponse, _ error)
- func (o *OKEX) GetFuturesEstimatedDeliveryPrice(ctx context.Context, instrumentID string) (resp okgroup.GetFuturesEstimatedDeliveryPriceResponse, _ error)
- func (o *OKEX) GetFuturesExchangeRates(ctx context.Context) (resp okgroup.GetFuturesExchangeRatesResponse, _ error)
- func (o *OKEX) GetFuturesFilledOrder(ctx context.Context, request okgroup.GetFuturesFilledOrderRequest) (resp []okgroup.GetFuturesFilledOrdersResponse, _ error)
- func (o *OKEX) GetFuturesForceLiquidatedOrders(ctx context.Context, request okgroup.GetFuturesForceLiquidatedOrdersRequest) (resp []okgroup.GetFuturesForceLiquidatedOrdersResponse, _ error)
- func (o *OKEX) GetFuturesHoldAmount(ctx context.Context, instrumentID string) (resp okgroup.GetFuturesHoldAmountResponse, _ error)
- func (o *OKEX) GetFuturesIndices(ctx context.Context, instrumentID string) (resp okgroup.GetFuturesIndicesResponse, _ error)
- func (o *OKEX) GetFuturesLeverage(ctx context.Context, instrumentID string) (resp okgroup.GetFuturesLeverageResponse, _ error)
- func (o *OKEX) GetFuturesOpenInterests(ctx context.Context, instrumentID string) (resp okgroup.GetFuturesOpenInterestsResponse, _ error)
- func (o *OKEX) GetFuturesOrderDetails(ctx context.Context, request okgroup.GetFuturesOrderDetailsRequest) (resp okgroup.GetFuturesOrderDetailsResponseData, _ error)
- func (o *OKEX) GetFuturesOrderList(ctx context.Context, request okgroup.GetFuturesOrdersListRequest) (resp okgroup.GetFuturesOrderListResponse, _ error)
- func (o *OKEX) GetFuturesPostions(ctx context.Context) (resp okgroup.GetFuturesPositionsResponse, _ error)
- func (o *OKEX) GetFuturesPostionsForCurrency(ctx context.Context, instrumentID string) (resp okgroup.GetFuturesPositionsForCurrencyResponse, _ error)
- func (o *OKEX) GetFuturesTagPrice(ctx context.Context, instrumentID string) (resp okgroup.GetFuturesTagPriceResponse, _ error)
- func (o *OKEX) GetFuturesTokenInfoForCurrency(ctx context.Context, instrumentID string) (resp okgroup.GetFuturesTokenInfoResponse, _ error)
- func (o *OKEX) GetFuturesTransactionDetails(ctx context.Context, request okgroup.GetFuturesTransactionDetailsRequest) (resp []okgroup.GetFuturesTransactionDetailsResponse, _ error)
- func (o *OKEX) GetMarginRates(ctx context.Context, instrumentID currency.Pair) (okgroup.MarginCurrencyData, error)
- func (o *OKEX) GetPerpSwapMarkets(ctx context.Context) ([]okgroup.TickerData, error)
- func (o *OKEX) GetRecentTrades(ctx context.Context, p currency.Pair, assetType asset.Item) ([]trade.Data, error)
- func (o *OKEX) GetSpotMarkets(ctx context.Context) ([]okgroup.TradingPairData, error)
- func (o *OKEX) GetSwapAccountOfAllCurrency(ctx context.Context) (resp okgroup.GetSwapAccountOfAllCurrencyResponse, _ error)
- func (o *OKEX) GetSwapAccountSettingsOfAContract(ctx context.Context, instrumentID string) (resp okgroup.GetSwapAccountSettingsOfAContractResponse, _ error)
- func (o *OKEX) GetSwapBillDetails(ctx context.Context, request okgroup.GetSpotBillDetailsForCurrencyRequest) (resp []okgroup.GetSwapBillDetailsResponse, _ error)
- func (o *OKEX) GetSwapContractInformation(ctx context.Context) (resp []okgroup.GetSwapContractInformationResponse, _ error)
- func (o *OKEX) GetSwapCurrentPriceLimits(ctx context.Context, instrumentID string) (resp okgroup.GetSwapCurrentPriceLimitsResponse, _ error)
- func (o *OKEX) GetSwapExchangeRates(ctx context.Context) (resp okgroup.GetSwapExchangeRatesResponse, _ error)
- func (o *OKEX) GetSwapFilledOrdersData(ctx context.Context, request *okgroup.GetSwapFilledOrdersDataRequest) (resp []okgroup.GetSwapFilledOrdersDataResponse, _ error)
- func (o *OKEX) GetSwapForceLiquidatedOrders(ctx context.Context, request okgroup.GetSwapForceLiquidatedOrdersRequest) (resp []okgroup.GetSwapForceLiquidatedOrdersResponse, _ error)
- func (o *OKEX) GetSwapFundingRateHistory(ctx context.Context, request okgroup.GetSwapFundingRateHistoryRequest) (resp []okgroup.GetSwapFundingRateHistoryResponse, _ error)
- func (o *OKEX) GetSwapIndices(ctx context.Context, instrumentID string) (resp okgroup.GetSwapIndecesResponse, _ error)
- func (o *OKEX) GetSwapInstruments(ctx context.Context) ([]okgroup.PerpSwapInstrumentData, error)
- func (o *OKEX) GetSwapMarkPrice(ctx context.Context, instrumentID string) (resp okgroup.GetSwapMarkPriceResponse, _ error)
- func (o *OKEX) GetSwapMarkets(ctx context.Context) ([]okgroup.SwapInstrumentsData, error)
- func (o *OKEX) GetSwapNextSettlementTime(ctx context.Context, instrumentID string) (resp okgroup.GetSwapNextSettlementTimeResponse, _ error)
- func (o *OKEX) GetSwapOnHoldAmountForOpenOrders(ctx context.Context, instrumentID string) (resp okgroup.GetSwapOnHoldAmountForOpenOrdersResponse, _ error)
- func (o *OKEX) GetSwapOpenInterest(ctx context.Context, instrumentID string) (resp okgroup.GetSwapExchangeRatesResponse, _ error)
- func (o *OKEX) GetSwapOrderDetails(ctx context.Context, request okgroup.GetSwapOrderDetailsRequest) (resp okgroup.GetSwapOrderListResponseData, _ error)
- func (o *OKEX) GetSwapOrderList(ctx context.Context, request okgroup.GetSwapOrderListRequest) (resp okgroup.GetSwapOrderListResponse, _ error)
- func (o *OKEX) GetSwapPostions(ctx context.Context) (resp []okgroup.GetSwapPostionsResponse, _ error)
- func (o *OKEX) GetSwapPostionsForContract(ctx context.Context, instrumentID string) (resp okgroup.GetSwapPostionsResponse, _ error)
- func (o *OKEX) GetSwapTokensInformationForCurrency(ctx context.Context, instrumentID string) (resp okgroup.GetAllSwapTokensInformationResponse, _ error)
- func (o *OKEX) GetSwapTransactionDetails(ctx context.Context, request okgroup.GetSwapTransactionDetailsRequest) (resp []okgroup.GetSwapTransactionDetailsResponse, _ error)
- func (o *OKEX) PlaceETTOrder(ctx context.Context, request *okgroup.PlaceETTOrderRequest) (resp okgroup.PlaceETTOrderResponse, _ error)
- func (o *OKEX) PlaceFuturesOrder(ctx context.Context, request okgroup.PlaceFuturesOrderRequest) (resp okgroup.PlaceFuturesOrderResponse, _ error)
- func (o *OKEX) PlaceFuturesOrderBatch(ctx context.Context, request okgroup.PlaceFuturesOrderBatchRequest) (resp okgroup.PlaceFuturesOrderBatchResponse, _ error)
- func (o *OKEX) PlaceMultipleSwapOrders(ctx context.Context, request okgroup.PlaceMultipleSwapOrdersRequest) (resp okgroup.PlaceMultipleSwapOrdersResponse, _ error)
- func (o *OKEX) PlaceSwapOrder(ctx context.Context, request okgroup.PlaceSwapOrderRequest) (resp okgroup.PlaceSwapOrderResponse, _ error)
- func (o *OKEX) Run()
- func (o *OKEX) SetDefaults()
- func (o *OKEX) SetFuturesLeverage(ctx context.Context, request okgroup.SetFuturesLeverageRequest) (resp okgroup.SetFuturesLeverageResponse, _ error)
- func (o *OKEX) SetSwapLeverageLevelOfAContract(ctx context.Context, request okgroup.SetSwapLeverageLevelOfAContractRequest) (resp okgroup.SetSwapLeverageLevelOfAContractResponse, _ error)
- func (o *OKEX) Start(wg *sync.WaitGroup) error
- func (o *OKEX) UpdateTicker(ctx context.Context, p currency.Pair, a asset.Item) (*ticker.Price, error)
- func (o *OKEX) UpdateTickers(ctx context.Context, a asset.Item) error
- func (o *OKEX) UpdateTradablePairs(ctx context.Context, forceUpdate bool) error
Constants ¶
const (
// OkExWebsocketURL WebsocketURL
OkExWebsocketURL = "wss://real.okex.com:8443/ws/v3"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OKEX ¶
OKEX bases all account, spot and margin methods off okgroup implementation
func (*OKEX) CancelBatchOrders ¶
func (o *OKEX) CancelBatchOrders(_ context.Context, _ []order.Cancel) (order.CancelBatchResponse, error)
CancelBatchOrders cancels an orders by their corresponding ID numbers
func (*OKEX) CancelETTOrder ¶
func (o *OKEX) CancelETTOrder(ctx context.Context, orderID string) (resp okgroup.PlaceETTOrderResponse, _ error)
CancelETTOrder Cancel an unfilled order.
func (*OKEX) CancelFuturesOrder ¶
func (o *OKEX) CancelFuturesOrder(ctx context.Context, request okgroup.CancelFuturesOrderRequest) (resp okgroup.CancelFuturesOrderResponse, _ error)
CancelFuturesOrder Cancelling an unfilled order.
func (*OKEX) CancelFuturesOrderBatch ¶
func (o *OKEX) CancelFuturesOrderBatch(ctx context.Context, request okgroup.CancelMultipleSpotOrdersRequest) (resp okgroup.CancelMultipleSpotOrdersResponse, _ error)
CancelFuturesOrderBatch With best effort, cancel all open orders.
func (*OKEX) CancelMultipleSwapOrders ¶
func (o *OKEX) CancelMultipleSwapOrders(ctx context.Context, request okgroup.CancelMultipleSwapOrdersRequest) (resp okgroup.CancelMultipleSwapOrdersResponse, _ error)
CancelMultipleSwapOrders With best effort, cancel all open orders.
func (*OKEX) CancelSwapOrder ¶
func (o *OKEX) CancelSwapOrder(ctx context.Context, request okgroup.CancelSwapOrderRequest) (resp okgroup.CancelSwapOrderResponse, _ error)
CancelSwapOrder Cancelling an unfilled order
func (*OKEX) FetchTicker ¶
func (o *OKEX) FetchTicker(ctx context.Context, p currency.Pair, assetType asset.Item) (tickerData *ticker.Price, err error)
FetchTicker returns the ticker for a currency pair
func (*OKEX) FetchTradablePairs ¶
FetchTradablePairs returns a list of the exchanges tradable pairs
func (*OKEX) GetAllFuturesTokenInfo ¶
func (o *OKEX) GetAllFuturesTokenInfo(ctx context.Context) (resp []okgroup.GetFuturesTokenInfoResponse, _ error)
GetAllFuturesTokenInfo Get the last traded price, best bid/ask price, 24 hour trading volume and more info of all contracts.
func (*OKEX) GetAllMarginRates ¶
GetAllMarginRates gets interest rates for all margin currencies on OKEX
func (*OKEX) GetAllSwapTokensInformation ¶
func (o *OKEX) GetAllSwapTokensInformation(ctx context.Context) (resp []okgroup.GetAllSwapTokensInformationResponse, _ error)
GetAllSwapTokensInformation Get the last traded price, best bid/ask price, 24 hour trading volume and more info of all contracts.
func (*OKEX) GetDefaultConfig ¶
GetDefaultConfig returns a default exchange config
func (*OKEX) GetETT ¶
GetETT List the assets in ETT account. Get information such as balance, amount on hold/ available.
func (*OKEX) GetETTAccountInformationForCurrency ¶
func (o *OKEX) GetETTAccountInformationForCurrency(ctx context.Context, currency string) (resp okgroup.GetETTResponse, _ error)
GetETTAccountInformationForCurrency Getting the balance, amount available/on hold of a token in ETT account.
func (*OKEX) GetETTBillsDetails ¶
func (o *OKEX) GetETTBillsDetails(ctx context.Context, currency string) (resp []okgroup.GetETTBillsDetailsResponse, _ error)
GetETTBillsDetails Bills details. All paginated requests return the latest information (newest) as the first page sorted by newest (in chronological time) first
func (*OKEX) GetETTConstituents ¶
func (o *OKEX) GetETTConstituents(ctx context.Context, ett string) (resp okgroup.GetETTConstituentsResponse, _ error)
GetETTConstituents Get ETT Constituents.This is a public endpoint, no identity verification is needed.
func (*OKEX) GetETTOrderDetails ¶
func (o *OKEX) GetETTOrderDetails(ctx context.Context, orderID string) (resp okgroup.GetETTOrderListResponse, _ error)
GetETTOrderDetails Get order details by order ID.
func (*OKEX) GetETTOrderList ¶
func (o *OKEX) GetETTOrderList(ctx context.Context, request okgroup.GetETTOrderListRequest) (resp []okgroup.GetETTOrderListResponse, _ error)
GetETTOrderList List your orders. Cursor pagination is used. All paginated requests return the latest information (newest) as the first page sorted by newest (in chronological time) first.
func (*OKEX) GetETTSettlementPriceHistory ¶
func (o *OKEX) GetETTSettlementPriceHistory(ctx context.Context, ett string) (resp []okgroup.GetETTSettlementPriceHistoryResponse, _ error)
GetETTSettlementPriceHistory Get ETT settlement price history. This is a public endpoint, no identity verification is needed.
func (*OKEX) GetFundingRate ¶
func (o *OKEX) GetFundingRate(ctx context.Context, marketName, limit string) ([]okgroup.PerpSwapFundingRates, error)
GetFundingRate gets funding rate of a given currency
func (*OKEX) GetFuturesAccountOfACurrency ¶
func (o *OKEX) GetFuturesAccountOfACurrency(ctx context.Context, instrumentID string) (resp okgroup.FuturesCurrencyData, _ error)
GetFuturesAccountOfACurrency Get the futures account info of a token.
func (*OKEX) GetFuturesAccountOfAllCurrencies ¶
func (o *OKEX) GetFuturesAccountOfAllCurrencies(ctx context.Context) (resp okgroup.FuturesAccountForAllCurrenciesResponse, _ error)
GetFuturesAccountOfAllCurrencies Get the futures account info of all token. Due to high energy consumption, you are advised to capture data with the "Futures Account of a Currency" API instead.
func (*OKEX) GetFuturesBillDetails ¶
func (o *OKEX) GetFuturesBillDetails(ctx context.Context, request okgroup.GetSpotBillDetailsForCurrencyRequest) (resp []okgroup.GetSpotBillDetailsForCurrencyResponse, _ error)
GetFuturesBillDetails Shows the account’s historical coin in flow and out flow. All paginated requests return the latest information (newest) as the first page sorted by newest (in chronological time) first.
func (*OKEX) GetFuturesContractInformation ¶
func (o *OKEX) GetFuturesContractInformation(ctx context.Context) (resp []okgroup.GetFuturesContractInformationResponse, _ error)
GetFuturesContractInformation Get market data. This endpoint provides the snapshots of market data and can be used without verifications.
func (*OKEX) GetFuturesCurrentMarkPrice ¶
func (o *OKEX) GetFuturesCurrentMarkPrice(ctx context.Context, instrumentID string) (resp okgroup.GetFuturesCurrentMarkPriceResponse, _ error)
GetFuturesCurrentMarkPrice The maximum buying price and the minimum selling price of the contract. This is a public endpoint, no identity verification is needed.
func (*OKEX) GetFuturesCurrentPriceLimit ¶
func (o *OKEX) GetFuturesCurrentPriceLimit(ctx context.Context, instrumentID string) (resp okgroup.GetFuturesCurrentPriceLimitResponse, _ error)
GetFuturesCurrentPriceLimit The maximum buying price and the minimum selling price of the contract. This is a public endpoint, no identity verification is needed.
func (*OKEX) GetFuturesEstimatedDeliveryPrice ¶
func (o *OKEX) GetFuturesEstimatedDeliveryPrice(ctx context.Context, instrumentID string) (resp okgroup.GetFuturesEstimatedDeliveryPriceResponse, _ error)
GetFuturesEstimatedDeliveryPrice the estimated delivery price. It is available 3 hours before delivery. This is a public endpoint, no identity verification is needed.
func (*OKEX) GetFuturesExchangeRates ¶
func (o *OKEX) GetFuturesExchangeRates(ctx context.Context) (resp okgroup.GetFuturesExchangeRatesResponse, _ error)
GetFuturesExchangeRates Get the fiat exchange rates. This is a public endpoint, no identity verification is needed.
func (*OKEX) GetFuturesFilledOrder ¶
func (o *OKEX) GetFuturesFilledOrder(ctx context.Context, request okgroup.GetFuturesFilledOrderRequest) (resp []okgroup.GetFuturesFilledOrdersResponse, _ error)
GetFuturesFilledOrder Get the recent 300 transactions of all contracts. Pagination is not supported here. The whole book will be returned for one request. Websocket is recommended here.
func (*OKEX) GetFuturesForceLiquidatedOrders ¶
func (o *OKEX) GetFuturesForceLiquidatedOrders(ctx context.Context, request okgroup.GetFuturesForceLiquidatedOrdersRequest) (resp []okgroup.GetFuturesForceLiquidatedOrdersResponse, _ error)
GetFuturesForceLiquidatedOrders Get force liquidated orders. This is a public endpoint, no identity verification is needed.
func (*OKEX) GetFuturesHoldAmount ¶
func (o *OKEX) GetFuturesHoldAmount(ctx context.Context, instrumentID string) (resp okgroup.GetFuturesHoldAmountResponse, _ error)
GetFuturesHoldAmount Get the number of futures with hold.
func (*OKEX) GetFuturesIndices ¶
func (o *OKEX) GetFuturesIndices(ctx context.Context, instrumentID string) (resp okgroup.GetFuturesIndicesResponse, _ error)
GetFuturesIndices Get Indices of tokens. This is a public endpoint, no identity verification is needed.
func (*OKEX) GetFuturesLeverage ¶
func (o *OKEX) GetFuturesLeverage(ctx context.Context, instrumentID string) (resp okgroup.GetFuturesLeverageResponse, _ error)
GetFuturesLeverage Get the leverage of the futures account
func (*OKEX) GetFuturesOpenInterests ¶
func (o *OKEX) GetFuturesOpenInterests(ctx context.Context, instrumentID string) (resp okgroup.GetFuturesOpenInterestsResponse, _ error)
GetFuturesOpenInterests Get the open interest of a contract. This is a public endpoint, no identity verification is needed.
func (*OKEX) GetFuturesOrderDetails ¶
func (o *OKEX) GetFuturesOrderDetails(ctx context.Context, request okgroup.GetFuturesOrderDetailsRequest) (resp okgroup.GetFuturesOrderDetailsResponseData, _ error)
GetFuturesOrderDetails Get order details by order ID.
func (*OKEX) GetFuturesOrderList ¶
func (o *OKEX) GetFuturesOrderList(ctx context.Context, request okgroup.GetFuturesOrdersListRequest) (resp okgroup.GetFuturesOrderListResponse, _ error)
GetFuturesOrderList List your orders. Cursor pagination is used. All paginated requests return the latest information (newest) as the first page sorted by newest (in chronological time) first.
func (*OKEX) GetFuturesPostions ¶
func (o *OKEX) GetFuturesPostions(ctx context.Context) (resp okgroup.GetFuturesPositionsResponse, _ error)
GetFuturesPostions Get the information of all holding positions in futures trading. Due to high energy consumption, you are advised to capture data with the "Futures Account of a Currency" API instead.
func (*OKEX) GetFuturesPostionsForCurrency ¶
func (o *OKEX) GetFuturesPostionsForCurrency(ctx context.Context, instrumentID string) (resp okgroup.GetFuturesPositionsForCurrencyResponse, _ error)
GetFuturesPostionsForCurrency Get the information of holding positions of a contract.
func (*OKEX) GetFuturesTagPrice ¶
func (o *OKEX) GetFuturesTagPrice(ctx context.Context, instrumentID string) (resp okgroup.GetFuturesTagPriceResponse, _ error)
GetFuturesTagPrice Get the tag price. This is a public endpoint, no identity verification is needed.
func (*OKEX) GetFuturesTokenInfoForCurrency ¶
func (o *OKEX) GetFuturesTokenInfoForCurrency(ctx context.Context, instrumentID string) (resp okgroup.GetFuturesTokenInfoResponse, _ error)
GetFuturesTokenInfoForCurrency Get the last traded price, best bid/ask price, 24 hour trading volume and more info of a contract.
func (*OKEX) GetFuturesTransactionDetails ¶
func (o *OKEX) GetFuturesTransactionDetails(ctx context.Context, request okgroup.GetFuturesTransactionDetailsRequest) (resp []okgroup.GetFuturesTransactionDetailsResponse, _ error)
GetFuturesTransactionDetails Get details of the recent filled orders. Cursor pagination is used. All paginated requests return the latest information (newest) as the first page sorted by newest (in chronological time) first.
func (*OKEX) GetMarginRates ¶
func (o *OKEX) GetMarginRates(ctx context.Context, instrumentID currency.Pair) (okgroup.MarginCurrencyData, error)
GetMarginRates gets interest rates for margin currencies
func (*OKEX) GetPerpSwapMarkets ¶
GetPerpSwapMarkets gets perpetual swap markets' data
func (*OKEX) GetRecentTrades ¶
func (o *OKEX) GetRecentTrades(ctx context.Context, p currency.Pair, assetType asset.Item) ([]trade.Data, error)
GetRecentTrades returns recent trade data
func (*OKEX) GetSpotMarkets ¶
GetSpotMarkets gets perpetual swap markets' data
func (*OKEX) GetSwapAccountOfAllCurrency ¶
func (o *OKEX) GetSwapAccountOfAllCurrency(ctx context.Context) (resp okgroup.GetSwapAccountOfAllCurrencyResponse, _ error)
GetSwapAccountOfAllCurrency Get the perpetual swap account info of a token. Margin ratio set as 10,000 when users have no open position.
func (*OKEX) GetSwapAccountSettingsOfAContract ¶
func (o *OKEX) GetSwapAccountSettingsOfAContract(ctx context.Context, instrumentID string) (resp okgroup.GetSwapAccountSettingsOfAContractResponse, _ error)
GetSwapAccountSettingsOfAContract Get leverage level and margin mode of a contract.
func (*OKEX) GetSwapBillDetails ¶
func (o *OKEX) GetSwapBillDetails(ctx context.Context, request okgroup.GetSpotBillDetailsForCurrencyRequest) (resp []okgroup.GetSwapBillDetailsResponse, _ error)
GetSwapBillDetails Shows the account’s historical coin in flow and out flow. All paginated requests return the latest information (newest) as the first page sorted by newest (in chronological time) first.
func (*OKEX) GetSwapContractInformation ¶
func (o *OKEX) GetSwapContractInformation(ctx context.Context) (resp []okgroup.GetSwapContractInformationResponse, _ error)
GetSwapContractInformation Get market data.
func (*OKEX) GetSwapCurrentPriceLimits ¶
func (o *OKEX) GetSwapCurrentPriceLimits(ctx context.Context, instrumentID string) (resp okgroup.GetSwapCurrentPriceLimitsResponse, _ error)
GetSwapCurrentPriceLimits Get the open interest of a contract.
func (*OKEX) GetSwapExchangeRates ¶
func (o *OKEX) GetSwapExchangeRates(ctx context.Context) (resp okgroup.GetSwapExchangeRatesResponse, _ error)
GetSwapExchangeRates Get the fiat exchange rates.
func (*OKEX) GetSwapFilledOrdersData ¶
func (o *OKEX) GetSwapFilledOrdersData(ctx context.Context, request *okgroup.GetSwapFilledOrdersDataRequest) (resp []okgroup.GetSwapFilledOrdersDataResponse, _ error)
GetSwapFilledOrdersData Get details of the recent filled orders
func (*OKEX) GetSwapForceLiquidatedOrders ¶
func (o *OKEX) GetSwapForceLiquidatedOrders(ctx context.Context, request okgroup.GetSwapForceLiquidatedOrdersRequest) (resp []okgroup.GetSwapForceLiquidatedOrdersResponse, _ error)
GetSwapForceLiquidatedOrders Get force liquidated orders.
func (*OKEX) GetSwapFundingRateHistory ¶
func (o *OKEX) GetSwapFundingRateHistory(ctx context.Context, request okgroup.GetSwapFundingRateHistoryRequest) (resp []okgroup.GetSwapFundingRateHistoryResponse, _ error)
GetSwapFundingRateHistory Get Funding Rate History.
func (*OKEX) GetSwapIndices ¶
func (o *OKEX) GetSwapIndices(ctx context.Context, instrumentID string) (resp okgroup.GetSwapIndecesResponse, _ error)
GetSwapIndices Get Indices of tokens.
func (*OKEX) GetSwapInstruments ¶
GetSwapInstruments gets perpetual swap instruments data
func (*OKEX) GetSwapMarkPrice ¶
func (o *OKEX) GetSwapMarkPrice(ctx context.Context, instrumentID string) (resp okgroup.GetSwapMarkPriceResponse, _ error)
GetSwapMarkPrice Get the time of next settlement.
func (*OKEX) GetSwapMarkets ¶
GetSwapMarkets gets perpetual swap markets
func (*OKEX) GetSwapNextSettlementTime ¶
func (o *OKEX) GetSwapNextSettlementTime(ctx context.Context, instrumentID string) (resp okgroup.GetSwapNextSettlementTimeResponse, _ error)
GetSwapNextSettlementTime Get the time of next settlement.
func (*OKEX) GetSwapOnHoldAmountForOpenOrders ¶
func (o *OKEX) GetSwapOnHoldAmountForOpenOrders(ctx context.Context, instrumentID string) (resp okgroup.GetSwapOnHoldAmountForOpenOrdersResponse, _ error)
GetSwapOnHoldAmountForOpenOrders Get On Hold Amount for Open Orders.
func (*OKEX) GetSwapOpenInterest ¶
func (o *OKEX) GetSwapOpenInterest(ctx context.Context, instrumentID string) (resp okgroup.GetSwapExchangeRatesResponse, _ error)
GetSwapOpenInterest Get the open interest of a contract.
func (*OKEX) GetSwapOrderDetails ¶
func (o *OKEX) GetSwapOrderDetails(ctx context.Context, request okgroup.GetSwapOrderDetailsRequest) (resp okgroup.GetSwapOrderListResponseData, _ error)
GetSwapOrderDetails Get order details by order ID.
func (*OKEX) GetSwapOrderList ¶
func (o *OKEX) GetSwapOrderList(ctx context.Context, request okgroup.GetSwapOrderListRequest) (resp okgroup.GetSwapOrderListResponse, _ error)
GetSwapOrderList List your orders. Cursor pagination is used. All paginated requests return the latest information (newest) as the first page sorted by newest (in chronological time) first.
func (*OKEX) GetSwapPostions ¶
func (o *OKEX) GetSwapPostions(ctx context.Context) (resp []okgroup.GetSwapPostionsResponse, _ error)
GetSwapPostions Get the information of all holding positions in swap trading. Due to high energy consumption, you are advised to capture data with the "Swap Account of a Currency" API instead.
func (*OKEX) GetSwapPostionsForContract ¶
func (o *OKEX) GetSwapPostionsForContract(ctx context.Context, instrumentID string) (resp okgroup.GetSwapPostionsResponse, _ error)
GetSwapPostionsForContract Get the information of holding positions of a contract.
func (*OKEX) GetSwapTokensInformationForCurrency ¶
func (o *OKEX) GetSwapTokensInformationForCurrency(ctx context.Context, instrumentID string) (resp okgroup.GetAllSwapTokensInformationResponse, _ error)
GetSwapTokensInformationForCurrency Get the last traded price, best bid/ask price, 24 hour trading volume and more info of all contracts.
func (*OKEX) GetSwapTransactionDetails ¶
func (o *OKEX) GetSwapTransactionDetails(ctx context.Context, request okgroup.GetSwapTransactionDetailsRequest) (resp []okgroup.GetSwapTransactionDetailsResponse, _ error)
GetSwapTransactionDetails Get details of the recent filled orders
func (*OKEX) PlaceETTOrder ¶
func (o *OKEX) PlaceETTOrder(ctx context.Context, request *okgroup.PlaceETTOrderRequest) (resp okgroup.PlaceETTOrderResponse, _ error)
PlaceETTOrder You can place subscription or redemption orders under ETT trading. You can place an order only if you have enough funds. Once your order is placed, the amount will be put on hold in the order lifecycle. The assets and amount on hold depends on the order's specific type and parameters.
func (*OKEX) PlaceFuturesOrder ¶
func (o *OKEX) PlaceFuturesOrder(ctx context.Context, request okgroup.PlaceFuturesOrderRequest) (resp okgroup.PlaceFuturesOrderResponse, _ error)
PlaceFuturesOrder OKEx futures trading only supports limit orders. You can place an order only if you have enough funds. Once your order is placed, the amount will be put on hold in the order lifecycle. The assets and amount on hold depends on the order's specific type and parameters.
func (*OKEX) PlaceFuturesOrderBatch ¶
func (o *OKEX) PlaceFuturesOrderBatch(ctx context.Context, request okgroup.PlaceFuturesOrderBatchRequest) (resp okgroup.PlaceFuturesOrderBatchResponse, _ error)
PlaceFuturesOrderBatch Batch contract placing order operation.
func (*OKEX) PlaceMultipleSwapOrders ¶
func (o *OKEX) PlaceMultipleSwapOrders(ctx context.Context, request okgroup.PlaceMultipleSwapOrdersRequest) (resp okgroup.PlaceMultipleSwapOrdersResponse, _ error)
PlaceMultipleSwapOrders Batch contract placing order operation.
func (*OKEX) PlaceSwapOrder ¶
func (o *OKEX) PlaceSwapOrder(ctx context.Context, request okgroup.PlaceSwapOrderRequest) (resp okgroup.PlaceSwapOrderResponse, _ error)
PlaceSwapOrder OKEx perpetual swap trading only supports limit orders,USD as quote currency for orders. You can place an order only if you have enough funds. Once your order is placed, the amount will be put on hold in the order lifecycle. The assets and amount on hold depends on the order's specific type and parameters.
func (*OKEX) SetDefaults ¶
func (o *OKEX) SetDefaults()
SetDefaults method assignes the default values for OKEX
func (*OKEX) SetFuturesLeverage ¶
func (o *OKEX) SetFuturesLeverage(ctx context.Context, request okgroup.SetFuturesLeverageRequest) (resp okgroup.SetFuturesLeverageResponse, _ error)
SetFuturesLeverage Adjusting the leverage for futures account。 Cross margin request requirements: {"leverage":"10"} Fixed margin request requirements: {"instrument_id":"BTC-USD-180213","direction":"long","leverage":"10"}
func (*OKEX) SetSwapLeverageLevelOfAContract ¶
func (o *OKEX) SetSwapLeverageLevelOfAContract(ctx context.Context, request okgroup.SetSwapLeverageLevelOfAContractRequest) (resp okgroup.SetSwapLeverageLevelOfAContractResponse, _ error)
SetSwapLeverageLevelOfAContract Setting the leverage level of a contract TODO this returns invalid parameters, but matches spec. Unsure how to fix
func (*OKEX) UpdateTicker ¶
func (o *OKEX) UpdateTicker(ctx context.Context, p currency.Pair, a asset.Item) (*ticker.Price, error)
UpdateTicker updates and returns the ticker for a currency pair
func (*OKEX) UpdateTickers ¶
UpdateTickers updates the ticker for all currency pairs of a given asset type