Documentation ¶
Index ¶
- Constants
- func AcceptSnap(snapshot *OkexSnapshot, depth *depthResponse)
- func NowAsUnixMilli() int64
- type AllFutureContractInfo
- type BaesDepthInfo
- type BaseCandleInfo
- type BaseFillInfo
- type BaseHistoricalFundingRate
- type BaseInstrumentAmount
- type BaseInstrumentInfo
- type BaseLedgerInfo
- type BaseLiquidationInfo
- type BaseOrderInfo
- type BaseOrderInfoV5
- type BaseOrderInfoV8
- type BasePlaceOrderInfo
- type BasePlaceOrderInfoV5
- type BaseResponse
- type BaseResponseV5
- type BaseSwapOrderResult
- type BaseTickerInfo
- type BaseTradeInfo
- type BizWarmTips
- type BizWarmTipsV5
- type CrossedAccountInfo
- type DepositAddress
- type FutureContractInfo
- type Instrument
- type MarginLeverage
- type OKEx
- func (ok *OKEx) BuildRequestBody(params interface{}) (string, *bytes.Reader, error)
- func (ok *OKEx) CancelOrder(orderId string, currency CurrencyPair) (bool, error)
- func (ok *OKEx) DoRequest(httpMethod, uri, reqBody string, response interface{}) error
- func (ok *OKEx) GetAccount() (*Account, error)
- func (ok *OKEx) GetDepth(size int, currency CurrencyPair) (*Depth, error)
- func (ok *OKEx) GetExchangeName() string
- func (ok *OKEx) GetKlineRecords(currency CurrencyPair, period KlinePeriod, size int, ...) ([]Kline, error)
- func (ok *OKEx) GetOneOrder(orderId string, currency CurrencyPair) (*Order, error)
- func (ok *OKEx) GetOrderHistorys(currency CurrencyPair, opt ...OptionalParameter) ([]Order, error)
- func (ok *OKEx) GetTicker(currency CurrencyPair) (*Ticker, error)
- func (ok *OKEx) GetTrades(currencyPair CurrencyPair, since int64) ([]Trade, error)
- func (ok *OKEx) GetUnfinishOrders(currency CurrencyPair) ([]Order, error)
- func (ok *OKEx) IsoTime() string
- func (ok *OKEx) LimitBuy(amount, price string, currency CurrencyPair, ...) (*Order, error)
- func (ok *OKEx) LimitSell(amount, price string, currency CurrencyPair, ...) (*Order, error)
- func (ok *OKEx) MarketBuy(amount, price string, currency CurrencyPair) (*Order, error)
- func (ok *OKEx) MarketSell(amount, price string, currency CurrencyPair) (*Order, error)
- func (ok *OKEx) UUID() string
- type OKExFuture
- func (ok *OKExFuture) FutureCancelOrder(currencyPair CurrencyPair, contractType, orderId string) (bool, error)
- func (ok *OKExFuture) GetAccounts(currencyPair CurrencyPair) (*FutureAccount, error)
- func (ok *OKExFuture) GetAllFutureContractInfo() ([]FutureContractInfo, error)
- func (ok *OKExFuture) GetContractInfo(contractId string) (*FutureContractInfo, error)
- func (ok *OKExFuture) GetContractValue(currencyPair CurrencyPair) (float64, error)
- func (ok *OKExFuture) GetDeliveryTime() (int, int, int, int)
- func (ok *OKExFuture) GetExchangeName() string
- func (ok *OKExFuture) GetFee() (float64, error)
- func (ok *OKExFuture) GetFutureAllTicker() (*[]FutureTicker, error)
- func (ok *OKExFuture) GetFutureContractId(pair CurrencyPair, contractAlias string) string
- func (ok *OKExFuture) GetFutureDepth(currencyPair CurrencyPair, contractType string, size int) (*Depth, error)
- func (ok *OKExFuture) GetFutureEstimatedPrice(currencyPair CurrencyPair) (float64, error)
- func (ok *OKExFuture) GetFutureIndex(currencyPair CurrencyPair) (float64, error)
- func (ok *OKExFuture) GetFutureOrder(orderId string, currencyPair CurrencyPair, contractType string) (*FutureOrder, error)
- func (ok *OKExFuture) GetFutureOrderHistory(pair CurrencyPair, contractType string, optional ...OptionalParameter) ([]FutureOrder, error)
- func (ok *OKExFuture) GetFutureOrders(orderIds []string, currencyPair CurrencyPair, contractType string) ([]FutureOrder, error)
- func (ok *OKExFuture) GetFuturePosition(currencyPair CurrencyPair, contractType string) ([]FuturePosition, error)
- func (ok *OKExFuture) GetFutureTicker(currencyPair CurrencyPair, contractType string) (*Ticker, error)
- func (ok *OKExFuture) GetFutureUserinfo(currencyPair ...CurrencyPair) (*FutureAccount, error)
- func (ok *OKExFuture) GetKlineRecords(contractType string, currency CurrencyPair, period KlinePeriod, size int, ...) ([]FutureKline, error)
- func (ok *OKExFuture) GetKlineRecordsByRange(contractType string, currency CurrencyPair, period, since, to int) ([]FutureKline, error)
- func (ok *OKExFuture) GetRate() (float64, error)
- func (ok *OKExFuture) GetTrades(contractType string, currencyPair CurrencyPair, since int64) ([]Trade, error)
- func (ok *OKExFuture) GetUnfinishFutureOrders(currencyPair CurrencyPair, contractType string) ([]FutureOrder, error)
- func (ok *OKExFuture) LimitFuturesOrder(currencyPair CurrencyPair, contractType, price, amount string, openType int, ...) (*FutureOrder, error)
- func (ok *OKExFuture) MarketCloseAllPosition(currency CurrencyPair, contract string, oType int) (bool, error)
- func (ok *OKExFuture) MarketFuturesOrder(currencyPair CurrencyPair, contractType, amount string, openType int) (*FutureOrder, error)
- func (ok *OKExFuture) PlaceFutureOrder(currencyPair CurrencyPair, contractType, price, amount string, ...) (string, error)
- func (ok *OKExFuture) PlaceFutureOrder2(matchPrice int, ord *FutureOrder) (*FutureOrder, error)
- type OKExLogin
- type OKExMargin
- func (ok *OKExMargin) Borrow(parameter BorrowParameter) (borrowId string, err error)
- func (ok *OKExMargin) CancelOrder(orderId string, currency CurrencyPair) (bool, error)
- func (ok *OKExMargin) GetMarginAccount(pair CurrencyPair) (*MarginAccount, error)
- func (ok *OKExMargin) GetOneOrder(orderId string, currency CurrencyPair) (*Order, error)
- func (ok *OKExMargin) GetUnfinishOrders(currency CurrencyPair) ([]Order, error)
- func (ok *OKExMargin) PlaceOrder(ord *Order) (*Order, error)
- func (ok *OKExMargin) Repayment(parameter RepaymentParameter) (repaymentId string, err error)
- type OKExSpot
- func (ok *OKExSpot) BatchPlaceOrders(orders []Order) ([]PlaceOrderResponse, error)
- func (ok *OKExSpot) CancelOrder(orderId string, currency CurrencyPair) (bool, error)
- func (ok *OKExSpot) GetAccount() (*Account, error)
- func (ok *OKExSpot) GetCurrenciesPrecision() ([]OKExSpotSymbol, error)
- func (ok *OKExSpot) GetDepth(size int, currency CurrencyPair) (*Depth, error)
- func (ok *OKExSpot) GetExchangeName() string
- func (ok *OKExSpot) GetKlineRecords(currency CurrencyPair, period KlinePeriod, size int, ...) ([]Kline, error)
- func (ok *OKExSpot) GetOneOrder(orderId string, currency CurrencyPair) (*Order, error)
- func (ok *OKExSpot) GetOrderHistorys(currency CurrencyPair, optional ...OptionalParameter) ([]Order, error)
- func (ok *OKExSpot) GetTicker(currency CurrencyPair) (*Ticker, error)
- func (ok *OKExSpot) GetTrades(currencyPair CurrencyPair, since int64) ([]Trade, error)
- func (ok *OKExSpot) GetUnfinishOrders(currency CurrencyPair) ([]Order, error)
- func (ok *OKExSpot) LimitBuy(amount, price string, currency CurrencyPair, ...) (*Order, error)
- func (ok *OKExSpot) LimitSell(amount, price string, currency CurrencyPair, ...) (*Order, error)
- func (ok *OKExSpot) MarketBuy(amount, price string, currency CurrencyPair) (*Order, error)
- func (ok *OKExSpot) MarketSell(amount, price string, currency CurrencyPair) (*Order, error)
- func (ok *OKExSpot) PlaceOrder(ty string, ord *Order) (*Order, error)
- type OKExSpotSymbol
- type OKExSwap
- func (ok *OKExSwap) AdaptTradeStatus(status int) TradeStatus
- func (ok *OKExSwap) FutureCancelAlgoOrder(currencyPair CurrencyPair, orderId []string) (bool, error)
- func (ok *OKExSwap) FutureCancelOrder(currencyPair CurrencyPair, contractType, orderId string) (TradeStatus, error)
- func (ok *OKExSwap) GetContractValue(currencyPair CurrencyPair) (float64, error)
- func (ok *OKExSwap) GetDeliveryTime() (int, int, int, int)
- func (ok *OKExSwap) GetExchangeName() string
- func (ok *OKExSwap) GetExchangeRate() (float64, error)
- func (ok *OKExSwap) GetFee() (float64, error)
- func (ok *OKExSwap) GetFutureAccountInfo(currency CurrencyPair) (*SwapAccountInfo, error)
- func (ok *OKExSwap) GetFutureAlgoOrders(algo_id string, status string, currencyPair CurrencyPair) ([]FutureOrder, error)
- func (ok *OKExSwap) GetFutureAllTicker() (*[]FutureTicker, error)
- func (ok *OKExSwap) GetFutureDepth(currencyPair CurrencyPair, contractType string, size int) (*Depth, error)
- func (ok *OKExSwap) GetFutureEstimatedPrice(currencyPair CurrencyPair) (float64, error)
- func (ok *OKExSwap) GetFutureIndex(currencyPair CurrencyPair) (float64, error)
- func (ok *OKExSwap) GetFutureOrder(orderId string, currencyPair CurrencyPair, contractType string) (*FutureOrder, error)
- func (ok *OKExSwap) GetFutureOrderByCid(cid string, currencyPair CurrencyPair, contractType string) (*FutureOrder, error)
- func (ok *OKExSwap) GetFutureOrderHistory(pair CurrencyPair, orderAfter string) ([]FutureOrder, error)
- func (ok *OKExSwap) GetFutureOrders(orderIds []string, currencyPair CurrencyPair, contractType string) ([]FutureOrder, error)
- func (ok *OKExSwap) GetFuturePosition(currencyPair CurrencyPair, contractType string) ([]FuturePosition, error)
- func (ok *OKExSwap) GetFutureTicker(currencyPair CurrencyPair, contractType string) (*Ticker, error)
- func (ok *OKExSwap) GetFutureUserinfo(currencyPair ...CurrencyPair) (*FutureAccount, error)
- func (ok *OKExSwap) GetHistoricalFunding(contractType string, currencyPair CurrencyPair, page int) ([]HistoricalFunding, error)
- func (ok *OKExSwap) GetInstruments() ([]Instrument, error)
- func (ok *OKExSwap) GetKlineRecords(contractType string, currency CurrencyPair, period KlinePeriod, size int, ...) ([]FutureKline, error)
- func (ok *OKExSwap) GetKlineRecords2(contractType string, currency CurrencyPair, start, end, period string) ([]FutureKline, error)
- func (ok *OKExSwap) GetKlineRecordsByRange(currency CurrencyPair, period, since, to int) ([]FutureKline, error)
- func (ok *OKExSwap) GetMarginLevel(currencyPair CurrencyPair) (*MarginLeverage, error)
- func (ok *OKExSwap) GetTrades(contractType string, currencyPair CurrencyPair, since int64) ([]Trade, error)
- func (ok *OKExSwap) GetUnfinishFutureOrders(currencyPair CurrencyPair, contractType string) ([]FutureOrder, error)
- func (ok *OKExSwap) LimitFuturesOrder(cid string, currencyPair CurrencyPair, ...) (*FutureOrder, error)
- func (ok *OKExSwap) MarketFuturesOrder(cid string, currencyPair CurrencyPair, contractType, amount, openType string) (*FutureOrder, error)
- func (ok *OKExSwap) PlaceFutureAlgoOrder(ord *FutureOrder) (*FutureOrder, error)
- func (ok *OKExSwap) PlaceFutureOrder(cid string, currencyPair CurrencyPair, ...) (string, error)
- func (ok *OKExSwap) PlaceFutureOrder2(cid string, currencyPair CurrencyPair, ...) (*FutureOrder, error)
- func (ok *OKExSwap) SetMarginLevel(currencyPair CurrencyPair, level, marginMode int) (*MarginLeverage, error)
- type OKExV3FuturesWs
- func (okV3Ws *OKExV3FuturesWs) DepthCallback(depthCallback func(*Depth))
- func (okV3Ws *OKExV3FuturesWs) KlineCallback(klineCallback func(*FutureKline, int))
- func (okV3Ws *OKExV3FuturesWs) SetCallbacks(tickerCallback func(*FutureTicker), depthCallback func(*Depth), ...)
- func (okV3Ws *OKExV3FuturesWs) SubscribeDepth(currencyPair CurrencyPair, contractType string) error
- func (okV3Ws *OKExV3FuturesWs) SubscribeKline(currencyPair CurrencyPair, contractType string, period int) error
- func (okV3Ws *OKExV3FuturesWs) SubscribeTicker(currencyPair CurrencyPair, contractType string) error
- func (okV3Ws *OKExV3FuturesWs) SubscribeTrade(currencyPair CurrencyPair, contractType string) error
- func (okV3Ws *OKExV3FuturesWs) TickerCallback(tickerCallback func(*FutureTicker))
- func (okV3Ws *OKExV3FuturesWs) TradeCallback(tradeCallback func(*Trade, string))
- type OKExV3SpotWs
- func (okV3Ws *OKExV3SpotWs) DepthCallback(depthCallback func(*Depth))
- func (okV3Ws *OKExV3SpotWs) KLineCallback(klineCallback func(kline *Kline, period KlinePeriod))
- func (okV3Ws *OKExV3SpotWs) SetCallbacks(tickerCallback func(*Ticker), depthCallback func(*Depth), ...)
- func (okV3Ws *OKExV3SpotWs) SubscribeDepth(currencyPair CurrencyPair) error
- func (okV3Ws *OKExV3SpotWs) SubscribeKline(currencyPair CurrencyPair, period int) error
- func (okV3Ws *OKExV3SpotWs) SubscribeTicker(currencyPair CurrencyPair) error
- func (okV3Ws *OKExV3SpotWs) SubscribeTrade(currencyPair CurrencyPair) error
- func (okV3Ws *OKExV3SpotWs) TickerCallback(tickerCallback func(*Ticker))
- func (okV3Ws *OKExV3SpotWs) TradeCallback(tradeCallback func(*Trade))
- type OKExV3SwapWs
- func (okV3Ws *OKExV3SwapWs) DepthCallback(depthCallback func(*Depth))
- func (okV3Ws *OKExV3SwapWs) KlineCallback(klineCallback func(*FutureKline, int))
- func (okV3Ws *OKExV3SwapWs) SetCallbacks(tickerCallback func(*FutureTicker), depthCallback func(*Depth), ...)
- func (okV3Ws *OKExV3SwapWs) SubscribeDepth(currencyPair CurrencyPair, contractType string) error
- func (okV3Ws *OKExV3SwapWs) SubscribeKline(currencyPair CurrencyPair, contractType string, period int) error
- func (okV3Ws *OKExV3SwapWs) SubscribeTicker(currencyPair CurrencyPair, contractType string) error
- func (okV3Ws *OKExV3SwapWs) SubscribeTrade(currencyPair CurrencyPair, contractType string) error
- func (okV3Ws *OKExV3SwapWs) TickerCallback(tickerCallback func(*FutureTicker))
- func (okV3Ws *OKExV3SwapWs) TradeCallback(tradeCallback func(*Trade, string))
- type OKExV3Ws
- type OKExWallet
- func (ok *OKExWallet) GetAccount() (*Account, error)
- func (ok *OKExWallet) GetDepositAddress(currency Currency) ([]DepositAddress, error)
- func (ok *OKExWallet) GetDepositHistory(currency *Currency) ([]DepositWithdrawHistory, error)
- func (ok *OKExWallet) GetWithDrawHistory(currency *Currency) ([]DepositWithdrawHistory, error)
- func (ok *OKExWallet) GetWithDrawalFee(currency *Currency) ([]WithdrawFee, error)
- func (ok *OKExWallet) Transfer(param TransferParameter) error
- func (ok *OKExWallet) Withdrawal(param WithdrawParameter) (withdrawId string, err error)
- type OkexLoginArg
- type OkexSnapshot
- type OrderResponse
- type PlaceOrderInfo
- type PlaceOrderInfoV5
- type PlaceOrderParam
- type PlaceOrderResponse
- type PlaceOrdersInfo
- type SwapAccountHolds
- type SwapAccountInfo
- type SwapAccounts
- type SwapAccountsLedgerList
- type SwapAccountsSetting
- type SwapBatchCancelOrderResult
- type SwapCancelOrderResult
- type SwapCandleList
- type SwapFillsInfo
- type SwapFundingTime
- type SwapHistoricalFundingRateList
- type SwapIndexInfo
- type SwapInstrumentDepth
- type SwapInstrumentList
- type SwapLiquidationList
- type SwapMarkPrice
- type SwapOpenInterest
- type SwapOrderResult
- type SwapOrdersInfo
- type SwapOrdersResult
- type SwapPosition
- type SwapPositionHolding
- type SwapPriceLimit
- type SwapRate
- type SwapTickerList
- type SwapTradeList
- type WithdrawFee
Constants ¶
const ( /* http headers */ OK_ACCESS_KEY = "OK-ACCESS-KEY" OK_ACCESS_SIGN = "OK-ACCESS-SIGN" OK_ACCESS_TIMESTAMP = "OK-ACCESS-TIMESTAMP" OK_ACCESS_PASSPHRASE = "OK-ACCESS-PASSPHRASE" /** paging params */ OK_FROM = "OK-FROM" OK_TO = "OK-TO" OK_LIMIT = "OK-LIMIT" CONTENT_TYPE = "Content-Type" ACCEPT = "Accept" COOKIE = "Cookie" LOCALE = "locale=" APPLICATION_JSON = "application/json" APPLICATION_JSON_UTF8 = "application/json; charset=UTF-8" /* i18n: internationalization */ ENGLISH = "en_US" SIMPLIFIED_CHINESE = "zh_CN" //zh_TW || zh_HK TRADITIONAL_CHINESE = "zh_HK" /* http methods */ GET = "GET" POST = "POST" DELETE = "DELETE" /* others */ ResultDataJsonString = "resultDataJsonString" ResultPageJsonString = "resultPageJsonString" BTC_USD_SWAP = "BTC-USD-SWAP" LTC_USD_SWAP = "LTC-USD-SWAP" ETH_USD_SWAP = "ETH-USD-SWAP" ETC_USD_SWAP = "ETC-USD-SWAP" BCH_USD_SWAP = "BCH-USD-SWAP" BSV_USD_SWAP = "BSV-USD-SWAP" EOS_USD_SWAP = "EOS-USD-SWAP" XRP_USD_SWAP = "XRP-USD-SWAP" /*Rest Endpoint*/ Endpoint = "https://www.okx.com" GET_ACCOUNTS = "/api/swap/v3/accounts" PLACE_ORDER = "/api/v5/trade/order" //new v5 CANCEL_ORDER = "/api/v5/trade/cancel-order" GET_ORDER = "/api/v5/trade/order?ordId=%s&instId=%s" GET_ORDER_BY_CID = "/api/v5/trade/order?clOrdId=%s&instId=%s" ORDER_HISTORY = "/api/v5/trade/orders-history?instId=%s&instType=%s&before=%s&limit=1" ORDER_HISTORY_WITHOUT_AFTER = "/api/v5/trade/orders-history?instId=%s&instType=%s&limit=2" GET_INFO = "" GET_POSITION = "/api/swap/v3/%s/position" GET_DEPTH = "/api/swap/v3/instruments/%s/depth?size=%d" GET_TICKER = "/api/swap/v3/instruments/%s/ticker" GET_ALL_TICKER = "/api/swap/v3/instruments/ticker" GET_UNFINISHED_ORDERS = "/api/swap/v3/orders/%s?status=%d&limit=%d" PLACE_ALGO_ORDER = "/api/swap/v3/order_algo" CANCEL_ALGO_ORDER = "/api/swap/v3/cancel_algos" GET_ALGO_ORDER = "/api/swap/v3/order_algo/%s?order_type=%d&" )
const ( WITHDRAWAL_OKCOIN int = 2 //提币到okcoin国际站 WITHDRAWAL_OKEx = 3 //提币到okex,站内提币 WITHDRAWAL_COIN = 4 //提币到数字货币地址,跨平台提币或者提到自己钱包 )
Variables ¶
This section is empty.
Functions ¶
func AcceptSnap ¶ added in v1.4.6
func AcceptSnap(snapshot *OkexSnapshot, depth *depthResponse)
func NowAsUnixMilli ¶ added in v1.3.2
func NowAsUnixMilli() int64
Types ¶
type AllFutureContractInfo ¶
type AllFutureContractInfo struct {
// contains filtered or unexported fields
}
type BaesDepthInfo ¶
type BaesDepthInfo []interface{}
type BaseCandleInfo ¶
type BaseCandleInfo []interface{}
type BaseFillInfo ¶
type BaseFillInfo struct { InstrumentId string `json:"instrument_id"` OrderQty string `json:"order_qty"` TradeId string `json:"trade_id"` Fee string `json:"fee"` OrderId string `json:"order_id"` Timestamp string `json:"timestamp"` Price string `json:"price"` Side string `json:"side"` ExecType string `json:"exec_type"` }
type BaseInstrumentAmount ¶
type BaseInstrumentAmount struct { BizWarmTips InstrumentId string `json:"instrument_id"` Timestamp string `json:"timestamp"` Amount string `json:"amount"` }
type BaseInstrumentInfo ¶
type BaseInstrumentInfo struct { InstrumentId string `json:"instrument_id"` QuoteCurrency string `json:"quote_currency"` TickSize string `json:"tick_size"` ContractVal string `json:"contract_val"` Listing string `json:"listing"` UnderlyingIndex string `json:"underlying_index"` Delivery string `json:"delivery"` Coin string `json:"coin"` SizeIncrement string `json:"size_increment"` }
type BaseLedgerInfo ¶
type BaseLiquidationInfo ¶
type BaseOrderInfo ¶
type BaseOrderInfo struct { InstrumentId string `json:"instrument_id"` Status int `json:"status,string"` OrderId string `json:"order_id"` ClientOid string `json:"client_oid"` Timestamp string `json:"timestamp"` Price float64 `json:"price,string"` PriceAvg float64 `json:"price_avg,string"` Size float64 `json:"size,string"` Fee float64 `json:"fee,string"` FilledQty float64 `json:"filled_qty,string"` ContractVal string `json:"contract_val"` Type int `json:"type,string"` }
type BaseOrderInfoV5 ¶ added in v1.3.2
type BaseOrderInfoV5 struct { InstrumentId string `json:"instId"` InstrumentType string `json:"instType"` Status string `json:"state"` OrderId string `json:"ordId"` ClientOid string `json:"clOrdId"` Timestamp string `json:"uTime"` Price string `json:"px"` PriceAvg string `json:"avgPx"` Size string `json:"sz"` Fee string `json:"fee"` FilledQty string `json:"accFillSz"` ContractVal string `json:"contract_val"` Side string `json:"side"` PositionSide string `json:"posSide"` Pnl string `json:"pnl"` }
type BaseOrderInfoV8 ¶ added in v1.3.2
type BaseOrderInfoV8 struct { InstrumentId string `json:"instId"` Status string `json:"state"` OrderId string `json:"ordId"` ClientOid string `json:"clOrdId"` Timestamp int64 `json:"uTime,string"` Price float64 `json:"px,string"` PriceAvg float64 `json:"avgPx,string"` Size float64 `json:"sz,string"` Fee float64 `json:"fee,string"` FilledQty float64 `json:"fillSz,string"` Side string `json:"side"` //"side":"buy", PosSide string `json:"posSide"` //"posSide":"long", }
type BasePlaceOrderInfo ¶
type BasePlaceOrderInfoV5 ¶ added in v1.3.2
type BaseResponse ¶
type BaseResponseV5 ¶ added in v1.3.2
type BaseSwapOrderResult ¶
type BaseTickerInfo ¶
type BaseTickerInfo struct { InstrumentId string `json:"instrument_id"` Last float64 `json:"last,string"` Timestamp string `json:"timestamp"` High24h float64 `json:"high_24h,string"` Volume24h float64 `json:"volume_24h,string"` Low24h float64 `json:"low_24h,string"` BestBid float64 `json:"best_bid,string"` BestAsk float64 `json:"best_ask,string"` }
type BaseTradeInfo ¶
type BizWarmTips ¶
type BizWarmTipsV5 ¶ added in v1.3.2
type BizWarmTipsV5 struct { Code string `json:"code"` Message string `json:"msg"` OrderInfo []BaseOrderInfoV5 `json:"data"` }
type CrossedAccountInfo ¶
type CrossedAccountInfo struct { MarginMode string `json:"margin_mode"` Equity float64 `json:"equity,string"` RealizedPnl float64 `json:"realized_pnl,string"` UnrealizedPnl float64 `json:"unrealized_pnl,string"` MarginFrozen float64 `json:"margin_frozen,string"` MarginRatio float64 `json:"margin_ratio,string"` MaintMarginRatio float64 `json:"maint_margin_ratio,string"` }
type DepositAddress ¶
type FutureContractInfo ¶
type FutureContractInfo struct { InstrumentID string `json:"instrument_id"` //合约ID:如BTC-USD-180213 UnderlyingIndex string `json:"underlying_index"` QuoteCurrency string `json:"quote_currency"` TickSize float64 `json:"tick_size,string"` //下单价格精度 TradeIncrement string `json:"trade_increment"` //数量精度 ContractVal string `json:"contract_val"` //合约面值(美元) Listing string `json:"listing"` Delivery string `json:"delivery"` //交割日期 Alias string `json:"alias"` // 本周 this_week 次周 next_week 季度 quarter }
合约信息
type Instrument ¶ added in v1.3.2
type Instrument struct { InstrumentID string `json:"instrument_id"` UnderlyingIndex string `json:"underlying_index"` QuoteCurrency string `json:"quote_currency"` Coin string `json:"coin"` ContractVal float64 `json:"contract_val,string"` Listing time.Time `json:"listing"` Delivery time.Time `json:"delivery"` SizeIncrement int `json:"size_increment,string"` TickSize float64 `json:"tick_size,string"` BaseCurrency string `json:"base_currency"` Underlying string `json:"underlying"` SettlementCurrency string `json:"settlement_currency"` IsInverse bool `json:"is_inverse,string"` ContractValCurrency string `json:"contract_val_currency"` }
type MarginLeverage ¶ added in v1.3.2
type OKEx ¶
type OKEx struct { OKExSpot *OKExSpot OKExFuture *OKExFuture OKExSwap *OKExSwap OKExWallet *OKExWallet OKExMargin *OKExMargin OKExV3FuturesWs *OKExV3FuturesWs OKExV3SpotWs *OKExV3SpotWs OKExV3SwapWs *OKExV3SwapWs // contains filtered or unexported fields }
func (*OKEx) BuildRequestBody ¶
Get a http request body is a json string and a byte array.
func (*OKEx) CancelOrder ¶
func (*OKEx) GetAccount ¶
func (*OKEx) GetExchangeName ¶
func (*OKEx) GetKlineRecords ¶
func (*OKEx) GetOneOrder ¶
func (*OKEx) GetOrderHistorys ¶
func (*OKEx) GetUnfinishOrders ¶
func (*OKEx) MarketSell ¶
type OKExFuture ¶
func (*OKExFuture) FutureCancelOrder ¶
func (ok *OKExFuture) FutureCancelOrder(currencyPair CurrencyPair, contractType, orderId string) (bool, error)
func (*OKExFuture) GetAccounts ¶ added in v1.3.2
func (ok *OKExFuture) GetAccounts(currencyPair CurrencyPair) (*FutureAccount, error)
func (*OKExFuture) GetAllFutureContractInfo ¶ added in v1.3.2
func (ok *OKExFuture) GetAllFutureContractInfo() ([]FutureContractInfo, error)
func (*OKExFuture) GetContractInfo ¶ added in v1.3.2
func (ok *OKExFuture) GetContractInfo(contractId string) (*FutureContractInfo, error)
func (*OKExFuture) GetContractValue ¶
func (ok *OKExFuture) GetContractValue(currencyPair CurrencyPair) (float64, error)
func (*OKExFuture) GetDeliveryTime ¶
func (ok *OKExFuture) GetDeliveryTime() (int, int, int, int)
func (*OKExFuture) GetExchangeName ¶
func (ok *OKExFuture) GetExchangeName() string
func (*OKExFuture) GetFee ¶
func (ok *OKExFuture) GetFee() (float64, error)
func (*OKExFuture) GetFutureAllTicker ¶ added in v1.3.2
func (ok *OKExFuture) GetFutureAllTicker() (*[]FutureTicker, error)
func (*OKExFuture) GetFutureContractId ¶ added in v1.3.2
func (ok *OKExFuture) GetFutureContractId(pair CurrencyPair, contractAlias string) string
func (*OKExFuture) GetFutureDepth ¶
func (ok *OKExFuture) GetFutureDepth(currencyPair CurrencyPair, contractType string, size int) (*Depth, error)
func (*OKExFuture) GetFutureEstimatedPrice ¶
func (ok *OKExFuture) GetFutureEstimatedPrice(currencyPair CurrencyPair) (float64, error)
func (*OKExFuture) GetFutureIndex ¶
func (ok *OKExFuture) GetFutureIndex(currencyPair CurrencyPair) (float64, error)
func (*OKExFuture) GetFutureOrder ¶
func (ok *OKExFuture) GetFutureOrder(orderId string, currencyPair CurrencyPair, contractType string) (*FutureOrder, error)
func (*OKExFuture) GetFutureOrderHistory ¶ added in v1.3.2
func (ok *OKExFuture) GetFutureOrderHistory(pair CurrencyPair, contractType string, optional ...OptionalParameter) ([]FutureOrder, error)
func (*OKExFuture) GetFutureOrders ¶
func (ok *OKExFuture) GetFutureOrders(orderIds []string, currencyPair CurrencyPair, contractType string) ([]FutureOrder, error)
func (*OKExFuture) GetFuturePosition ¶
func (ok *OKExFuture) GetFuturePosition(currencyPair CurrencyPair, contractType string) ([]FuturePosition, error)
func (*OKExFuture) GetFutureTicker ¶
func (ok *OKExFuture) GetFutureTicker(currencyPair CurrencyPair, contractType string) (*Ticker, error)
func (*OKExFuture) GetFutureUserinfo ¶
func (ok *OKExFuture) GetFutureUserinfo(currencyPair ...CurrencyPair) (*FutureAccount, error)
基本上已经报废,OK限制10s一次,但是基本上都会返回error:{"code":30014,"message":"Too Many Requests"} 加入currency pair救活了这个接口
func (*OKExFuture) GetKlineRecords ¶
func (ok *OKExFuture) GetKlineRecords(contractType string, currency CurrencyPair, period KlinePeriod, size int, opt ...OptionalParameter) ([]FutureKline, error)
func (*OKExFuture) GetKlineRecordsByRange ¶ added in v1.3.2
func (ok *OKExFuture) GetKlineRecordsByRange(contractType string, currency CurrencyPair, period, since, to int) ([]FutureKline, error)
*
since : 单位秒,开始时间 to : 单位秒,结束时间
func (*OKExFuture) GetTrades ¶
func (ok *OKExFuture) GetTrades(contractType string, currencyPair CurrencyPair, since int64) ([]Trade, error)
func (*OKExFuture) GetUnfinishFutureOrders ¶
func (ok *OKExFuture) GetUnfinishFutureOrders(currencyPair CurrencyPair, contractType string) ([]FutureOrder, error)
func (*OKExFuture) LimitFuturesOrder ¶ added in v1.3.2
func (ok *OKExFuture) LimitFuturesOrder(currencyPair CurrencyPair, contractType, price, amount string, openType int, opt ...LimitOrderOptionalParameter) (*FutureOrder, error)
func (*OKExFuture) MarketCloseAllPosition ¶
func (ok *OKExFuture) MarketCloseAllPosition(currency CurrencyPair, contract string, oType int) (bool, error)
特殊接口
市价全平仓 contract:合约ID oType:平仓方向:CLOSE_SELL平空,CLOSE_BUY平多
func (*OKExFuture) MarketFuturesOrder ¶ added in v1.3.2
func (ok *OKExFuture) MarketFuturesOrder(currencyPair CurrencyPair, contractType, amount string, openType int) (*FutureOrder, error)
func (*OKExFuture) PlaceFutureOrder ¶
func (*OKExFuture) PlaceFutureOrder2 ¶
func (ok *OKExFuture) PlaceFutureOrder2(matchPrice int, ord *FutureOrder) (*FutureOrder, error)
matchPrice:是否以对手价下单(0:不是 1:是),默认为0;当取值为1时,price字段无效,当以对手价下单,order_type只能选择0:普通委托
type OKExLogin ¶ added in v1.3.2
type OKExLogin struct { OP string `json:"op"` Args []OkexLoginArg `json:"args"` }
type OKExMargin ¶
type OKExMargin struct {
*OKEx
}
func (*OKExMargin) Borrow ¶
func (ok *OKExMargin) Borrow(parameter BorrowParameter) (borrowId string, err error)
*
杠杆交易区借币, pair : 操作的交易对 currency: 需要借的币种 amount : 借的金额
func (*OKExMargin) CancelOrder ¶
func (ok *OKExMargin) CancelOrder(orderId string, currency CurrencyPair) (bool, error)
func (*OKExMargin) GetMarginAccount ¶
func (ok *OKExMargin) GetMarginAccount(pair CurrencyPair) (*MarginAccount, error)
func (*OKExMargin) GetOneOrder ¶
func (ok *OKExMargin) GetOneOrder(orderId string, currency CurrencyPair) (*Order, error)
orderId can set client oid or orderId
func (*OKExMargin) GetUnfinishOrders ¶
func (ok *OKExMargin) GetUnfinishOrders(currency CurrencyPair) ([]Order, error)
func (*OKExMargin) PlaceOrder ¶
func (ok *OKExMargin) PlaceOrder(ord *Order) (*Order, error)
func (*OKExMargin) Repayment ¶
func (ok *OKExMargin) Repayment(parameter RepaymentParameter) (repaymentId string, err error)
type OKExSpot ¶
type OKExSpot struct {
*OKEx
}
func (*OKExSpot) BatchPlaceOrders ¶
func (ok *OKExSpot) BatchPlaceOrders(orders []Order) ([]PlaceOrderResponse, error)
* Must Set Client Oid
func (*OKExSpot) CancelOrder ¶
orderId can set client oid or orderId
func (*OKExSpot) GetAccount ¶
func (*OKExSpot) GetCurrenciesPrecision ¶ added in v1.3.2
func (ok *OKExSpot) GetCurrenciesPrecision() ([]OKExSpotSymbol, error)
func (*OKExSpot) GetExchangeName ¶
func (*OKExSpot) GetKlineRecords ¶
func (*OKExSpot) GetOneOrder ¶
orderId can set client oid or orderId
func (*OKExSpot) GetOrderHistorys ¶
func (*OKExSpot) GetUnfinishOrders ¶
func (*OKExSpot) MarketSell ¶
func (*OKExSpot) PlaceOrder ¶
type OKExSpotSymbol ¶ added in v1.3.2
type OKExSwap ¶
type OKExSwap struct { *OKEx // contains filtered or unexported fields }
func NewOKExSwap ¶
func NewOKExSwap(config *APIConfig) *OKExSwap
func (*OKExSwap) AdaptTradeStatus ¶
func (*OKExSwap) FutureCancelAlgoOrder ¶ added in v1.3.2
func (ok *OKExSwap) FutureCancelAlgoOrder(currencyPair CurrencyPair, orderId []string) (bool, error)
委托策略撤单
func (*OKExSwap) FutureCancelOrder ¶
func (*OKExSwap) GetExchangeName ¶
func (*OKExSwap) GetExchangeRate ¶
func (*OKExSwap) GetFutureAccountInfo ¶ added in v1.3.2
func (ok *OKExSwap) GetFutureAccountInfo(currency CurrencyPair) (*SwapAccountInfo, error)
func (*OKExSwap) GetFutureAlgoOrders ¶ added in v1.3.2
func (ok *OKExSwap) GetFutureAlgoOrders(algo_id string, status string, currencyPair CurrencyPair) ([]FutureOrder, error)
获取委托单列表, status和algo_id必填且只能填其一
func (*OKExSwap) GetFutureAllTicker ¶ added in v1.3.2
func (*OKExSwap) GetFutureDepth ¶
func (*OKExSwap) GetFutureEstimatedPrice ¶
func (*OKExSwap) GetFutureIndex ¶
func (*OKExSwap) GetFutureOrder ¶
func (*OKExSwap) GetFutureOrderByCid ¶ added in v1.3.5
func (*OKExSwap) GetFutureOrderHistory ¶ added in v1.3.2
func (*OKExSwap) GetFutureOrders ¶
func (ok *OKExSwap) GetFutureOrders(orderIds []string, currencyPair CurrencyPair, contractType string) ([]FutureOrder, error)
*
*获取订单信息
func (*OKExSwap) GetFuturePosition ¶
func (*OKExSwap) GetFutureTicker ¶
func (*OKExSwap) GetFutureUserinfo ¶
func (*OKExSwap) GetHistoricalFunding ¶ added in v1.0.5
func (*OKExSwap) GetInstruments ¶ added in v1.3.2
func (ok *OKExSwap) GetInstruments() ([]Instrument, error)
func (*OKExSwap) GetKlineRecords ¶
func (*OKExSwap) GetKlineRecords2 ¶ added in v1.3.2
func (ok *OKExSwap) GetKlineRecords2(contractType string, currency CurrencyPair, start, end, period string) ([]FutureKline, error)
*
since : 单位秒,开始时间
func (*OKExSwap) GetKlineRecordsByRange ¶ added in v1.3.2
func (ok *OKExSwap) GetKlineRecordsByRange(currency CurrencyPair, period, since, to int) ([]FutureKline, error)
*
since : 单位秒,开始时间 to : 单位秒,结束时间
func (*OKExSwap) GetMarginLevel ¶ added in v1.3.2
func (ok *OKExSwap) GetMarginLevel(currencyPair CurrencyPair) (*MarginLeverage, error)
func (*OKExSwap) GetUnfinishFutureOrders ¶
func (*OKExSwap) LimitFuturesOrder ¶ added in v1.3.2
func (*OKExSwap) MarketFuturesOrder ¶ added in v1.3.2
func (*OKExSwap) PlaceFutureAlgoOrder ¶ added in v1.3.2
委托策略下单 algo_type 1:限价 2:市场价;触发价格类型,默认是限价;为市场价时,委托价格不必填;
func (*OKExSwap) PlaceFutureOrder ¶
func (*OKExSwap) PlaceFutureOrder2 ¶ added in v1.3.2
func (*OKExSwap) SetMarginLevel ¶ added in v1.3.2
func (ok *OKExSwap) SetMarginLevel(currencyPair CurrencyPair, level, marginMode int) (*MarginLeverage, error)
marginmode 1:逐仓-多仓 2:逐仓-空仓 3:全仓
type OKExV3FuturesWs ¶ added in v1.3.2
type OKExV3FuturesWs struct {
// contains filtered or unexported fields
}
func NewOKExV3FuturesWs ¶ added in v1.3.2
func NewOKExV3FuturesWs(base *OKEx) *OKExV3FuturesWs
func (*OKExV3FuturesWs) DepthCallback ¶ added in v1.3.2
func (okV3Ws *OKExV3FuturesWs) DepthCallback(depthCallback func(*Depth))
func (*OKExV3FuturesWs) KlineCallback ¶ added in v1.3.2
func (okV3Ws *OKExV3FuturesWs) KlineCallback(klineCallback func(*FutureKline, int))
func (*OKExV3FuturesWs) SetCallbacks ¶ added in v1.3.2
func (okV3Ws *OKExV3FuturesWs) SetCallbacks(tickerCallback func(*FutureTicker), depthCallback func(*Depth), tradeCallback func(*Trade, string), klineCallback func(*FutureKline, int))
func (*OKExV3FuturesWs) SubscribeDepth ¶ added in v1.3.2
func (okV3Ws *OKExV3FuturesWs) SubscribeDepth(currencyPair CurrencyPair, contractType string) error
func (*OKExV3FuturesWs) SubscribeKline ¶ added in v1.3.2
func (okV3Ws *OKExV3FuturesWs) SubscribeKline(currencyPair CurrencyPair, contractType string, period int) error
func (*OKExV3FuturesWs) SubscribeTicker ¶ added in v1.3.2
func (okV3Ws *OKExV3FuturesWs) SubscribeTicker(currencyPair CurrencyPair, contractType string) error
func (*OKExV3FuturesWs) SubscribeTrade ¶ added in v1.3.2
func (okV3Ws *OKExV3FuturesWs) SubscribeTrade(currencyPair CurrencyPair, contractType string) error
func (*OKExV3FuturesWs) TickerCallback ¶ added in v1.3.2
func (okV3Ws *OKExV3FuturesWs) TickerCallback(tickerCallback func(*FutureTicker))
func (*OKExV3FuturesWs) TradeCallback ¶ added in v1.3.2
func (okV3Ws *OKExV3FuturesWs) TradeCallback(tradeCallback func(*Trade, string))
type OKExV3SpotWs ¶ added in v1.3.2
type OKExV3SpotWs struct {
// contains filtered or unexported fields
}
func NewOKExSpotV3Ws ¶ added in v1.3.2
func NewOKExSpotV3Ws(base *OKEx) *OKExV3SpotWs
func (*OKExV3SpotWs) DepthCallback ¶ added in v1.3.2
func (okV3Ws *OKExV3SpotWs) DepthCallback(depthCallback func(*Depth))
func (*OKExV3SpotWs) KLineCallback ¶ added in v1.3.2
func (okV3Ws *OKExV3SpotWs) KLineCallback(klineCallback func(kline *Kline, period KlinePeriod))
func (*OKExV3SpotWs) SetCallbacks ¶ added in v1.3.2
func (okV3Ws *OKExV3SpotWs) SetCallbacks(tickerCallback func(*Ticker), depthCallback func(*Depth), tradeCallback func(*Trade), klineCallback func(*Kline, KlinePeriod))
func (*OKExV3SpotWs) SubscribeDepth ¶ added in v1.3.2
func (okV3Ws *OKExV3SpotWs) SubscribeDepth(currencyPair CurrencyPair) error
func (*OKExV3SpotWs) SubscribeKline ¶ added in v1.3.2
func (okV3Ws *OKExV3SpotWs) SubscribeKline(currencyPair CurrencyPair, period int) error
func (*OKExV3SpotWs) SubscribeTicker ¶ added in v1.3.2
func (okV3Ws *OKExV3SpotWs) SubscribeTicker(currencyPair CurrencyPair) error
func (*OKExV3SpotWs) SubscribeTrade ¶ added in v1.3.2
func (okV3Ws *OKExV3SpotWs) SubscribeTrade(currencyPair CurrencyPair) error
func (*OKExV3SpotWs) TickerCallback ¶ added in v1.3.2
func (okV3Ws *OKExV3SpotWs) TickerCallback(tickerCallback func(*Ticker))
func (*OKExV3SpotWs) TradeCallback ¶ added in v1.3.2
func (okV3Ws *OKExV3SpotWs) TradeCallback(tradeCallback func(*Trade))
type OKExV3SwapWs ¶ added in v1.3.2
type OKExV3SwapWs struct {
// contains filtered or unexported fields
}
func NewOKExV3SwapWs ¶ added in v1.3.2
func NewOKExV3SwapWs(base *OKEx) *OKExV3SwapWs
func (*OKExV3SwapWs) DepthCallback ¶ added in v1.3.2
func (okV3Ws *OKExV3SwapWs) DepthCallback(depthCallback func(*Depth))
func (*OKExV3SwapWs) KlineCallback ¶ added in v1.3.2
func (okV3Ws *OKExV3SwapWs) KlineCallback(klineCallback func(*FutureKline, int))
func (*OKExV3SwapWs) SetCallbacks ¶ added in v1.3.2
func (okV3Ws *OKExV3SwapWs) SetCallbacks(tickerCallback func(*FutureTicker), depthCallback func(*Depth), tradeCallback func(*Trade, string), klineCallback func(*FutureKline, int))
func (*OKExV3SwapWs) SubscribeDepth ¶ added in v1.3.2
func (okV3Ws *OKExV3SwapWs) SubscribeDepth(currencyPair CurrencyPair, contractType string) error
func (*OKExV3SwapWs) SubscribeKline ¶ added in v1.3.2
func (okV3Ws *OKExV3SwapWs) SubscribeKline(currencyPair CurrencyPair, contractType string, period int) error
func (*OKExV3SwapWs) SubscribeTicker ¶ added in v1.3.2
func (okV3Ws *OKExV3SwapWs) SubscribeTicker(currencyPair CurrencyPair, contractType string) error
func (*OKExV3SwapWs) SubscribeTrade ¶ added in v1.3.2
func (okV3Ws *OKExV3SwapWs) SubscribeTrade(currencyPair CurrencyPair, contractType string) error
func (*OKExV3SwapWs) TickerCallback ¶ added in v1.3.2
func (okV3Ws *OKExV3SwapWs) TickerCallback(tickerCallback func(*FutureTicker))
func (*OKExV3SwapWs) TradeCallback ¶ added in v1.3.2
func (okV3Ws *OKExV3SwapWs) TradeCallback(tradeCallback func(*Trade, string))
type OKExV3Ws ¶ added in v1.3.2
type OKExV3Ws struct { *WsBuilder WsConn *WsConn // contains filtered or unexported fields }
func NewOKExV3Ws ¶ added in v1.3.2
type OKExWallet ¶
type OKExWallet struct {
*OKEx
}
func (*OKExWallet) GetAccount ¶
func (ok *OKExWallet) GetAccount() (*Account, error)
func (*OKExWallet) GetDepositAddress ¶
func (ok *OKExWallet) GetDepositAddress(currency Currency) ([]DepositAddress, error)
func (*OKExWallet) GetDepositHistory ¶
func (ok *OKExWallet) GetDepositHistory(currency *Currency) ([]DepositWithdrawHistory, error)
func (*OKExWallet) GetWithDrawHistory ¶ added in v1.3.2
func (ok *OKExWallet) GetWithDrawHistory(currency *Currency) ([]DepositWithdrawHistory, error)
func (*OKExWallet) GetWithDrawalFee ¶
func (ok *OKExWallet) GetWithDrawalFee(currency *Currency) ([]WithdrawFee, error)
func (*OKExWallet) Transfer ¶
func (ok *OKExWallet) Transfer(param TransferParameter) error
解释说明
from或to指定为0时,sub_account为必填项。
当from为0时,to只能填6,即子账户的资金账户只能转到母账户的资金账户。
当from指定为6,to指定为1-9,且sub_account填写子账户名时,可从母账户直接划转至子账户对应的币币、合约等账户。
from或to指定为5时,instrument_id为必填项。
func (*OKExWallet) Withdrawal ¶
func (ok *OKExWallet) Withdrawal(param WithdrawParameter) (withdrawId string, err error)
认证过的数字货币地址、邮箱或手机号。某些数字货币地址格式为:地址+标签,例:"ARDOR-7JF3-8F2E-QUWZ-CAN7F:123456"
type OkexLoginArg ¶ added in v1.3.2
type OrderResponse ¶
type OrderResponse struct { InstrumentId string `json:"instrument_id"` ClientOid string `json:"client_oid"` OrderId string `json:"order_id"` Price string `json:"price,omitempty"` Size float64 `json:"size,string"` Notional string `json:"notional"` Side string `json:"side"` Type string `json:"type"` FilledSize string `json:"filled_size"` FilledNotional string `json:"filled_notional"` PriceAvg string `json:"price_avg"` State int `json:"state,string"` Fee string `json:"fee"` OrderType int `json:"order_type,string"` Timestamp string `json:"timestamp"` }
type PlaceOrderInfo ¶
type PlaceOrderInfo struct { BasePlaceOrderInfo InstrumentId string `json:"instrument_id"` }
type PlaceOrderInfoV5 ¶ added in v1.3.2
type PlaceOrderInfoV5 struct { BasePlaceOrderInfoV5 InstrumentId string `json:"instId"` }
type PlaceOrderParam ¶
type PlaceOrderParam struct { ClientOid string `json:"client_oid"` Type string `json:"type"` Side string `json:"side"` InstrumentId string `json:"instrument_id"` OrderType int `json:"order_type"` Price float64 `json:"price"` Size float64 `json:"size"` Notional float64 `json:"notional"` MarginTrading string `json:"margin_trading,omitempty"` }
type PlaceOrderResponse ¶
type PlaceOrdersInfo ¶
type PlaceOrdersInfo struct { InstrumentId string `json:"instrument_id"` OrderData []*BasePlaceOrderInfo `json:"order_data"` }
type SwapAccountHolds ¶
type SwapAccountHolds BaseInstrumentAmount
type SwapAccountInfo ¶
type SwapAccountInfo struct { InstrumentId string `json:"instrument_id"` Timestamp string `json:"timestamp"` MarginFrozen float64 `json:"margin_frozen,string"` TotalAvailBalance float64 `json:"total_avail_balance,string"` MarginRatio float64 `json:"margin_ratio,string"` RealizedPnl float64 `json:"realized_pnl,string"` UnrealizedPnl float64 `json:"unrealized_pnl,string"` FixedBalance float64 `json:"fixed_balance,string"` Equity float64 `json:"equity,string"` Margin float64 `json:"margin,string"` MarginMode string `json:"margin_mode"` }
type SwapAccounts ¶
type SwapAccounts struct { BizWarmTips Info []SwapAccountInfo `json:"info"` }
type SwapAccountsLedgerList ¶
type SwapAccountsLedgerList []BaseLedgerInfo
type SwapAccountsSetting ¶
type SwapAccountsSetting struct { BizWarmTips InstrumentId string `json:"instrument_id"` LongLeverage string `json:"long_leverage"` ShortLeverage string `json:"short_leverage"` MarginMode string `json:"margin_mode"` }
type SwapBatchCancelOrderResult ¶
type SwapBatchCancelOrderResult struct { BizWarmTips InstrumentId string `json:"instrument_id"` Ids []string `json:"ids"` Result string `json:"result"` }
type SwapCancelOrderResult ¶
type SwapCandleList ¶
type SwapCandleList []BaseCandleInfo
type SwapFillsInfo ¶
type SwapFillsInfo struct { BizWarmTips FillInfo []*BaseFillInfo `json:"fill_info"` }
type SwapFundingTime ¶
type SwapFundingTime struct { BizWarmTips InstrumentId string `json:"instrument_id"` FundingTime string `json:"funding_time"` }
type SwapHistoricalFundingRateList ¶
type SwapHistoricalFundingRateList []BaseHistoricalFundingRate
type SwapIndexInfo ¶
type SwapIndexInfo struct { BizWarmTips InstrumentId string `json:"instrument_id"` Index string `json:"index"` Timestamp string `json:"timestamp"` }
type SwapInstrumentDepth ¶
type SwapInstrumentDepth struct { BizWarmTips Timestamp string `json:"time"` Bids []BaesDepthInfo `json:"bids"` Asks []BaesDepthInfo `json:"asks"` }
type SwapInstrumentList ¶
type SwapInstrumentList []BaseInstrumentInfo
type SwapLiquidationList ¶
type SwapLiquidationList []BaseLiquidationInfo
type SwapMarkPrice ¶
type SwapMarkPrice struct { BizWarmTips InstrumentId string `json:"instrument_id"` MarkPrice string `json:"mark_price"` Timestamp string `json:"timestamp"` }
type SwapOpenInterest ¶
type SwapOpenInterest BaseInstrumentAmount
type SwapOrderResult ¶
type SwapOrderResult struct { BaseSwapOrderResult BizWarmTips }
type SwapOrdersInfo ¶
type SwapOrdersInfo struct { BizWarmTips OrderInfo []BaseOrderInfoV8 `json:"data"` }
type SwapOrdersResult ¶
type SwapOrdersResult struct { BizWarmTips OrderInfo []BaseSwapOrderResult `json:"order_info"` }
type SwapPosition ¶
type SwapPosition struct { BizWarmTips MarginMode string `json:"margin_mode"` Holding []SwapPositionHolding `json:"holding"` }
type SwapPositionHolding ¶
type SwapPositionHolding struct { LiquidationPrice float64 `json:"liquidation_price , string"` Position float64 `json:"position,string"` AvailPosition float64 `json:"avail_position,string"` AvgCost float64 `json:"avg_cost,string"` SettlementPrice float64 `json:"settlement_price,string"` InstrumentId string `json:"instrument_id"` Leverage string `json:"leverage"` RealizedPnl float64 `json:"realized_pnl,string"` Side string `json:"side"` Timestamp string `json:"timestamp"` Margin string `json:"margin";default:""` }
type SwapPriceLimit ¶
type SwapPriceLimit struct { BizWarmTips InstrumentId string `json:"instrument_id"` Lowest string `json:"lowest"` Highest string `json:"highest"` Timestamp string `json:"timestamp"` }
type SwapTickerList ¶
type SwapTickerList []BaseTickerInfo
type SwapTradeList ¶
type SwapTradeList []BaseTradeInfo