Documentation ¶
Index ¶
- Constants
- type AllFutureContractInfo
- type BaesDepthInfo
- type BaseCandleInfo
- type BaseFillInfo
- type BaseHistoricalFundingRate
- type BaseInstrumentAmount
- type BaseInstrumentInfo
- type BaseLedgerInfo
- type BaseLiquidationInfo
- type BaseOrderInfo
- type BasePlaceOrderInfo
- type BaseResponse
- type BaseSwapOrderResult
- type BaseTickerInfo
- type BaseTradeInfo
- type BizWarmTips
- type CrossedAccountInfo
- type DepositAddress
- type DepositWithDrawHistory
- type FutureContractInfo
- 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, size, since int) ([]Kline, error)
- func (ok *OKEx) GetOneOrder(orderId string, currency CurrencyPair) (*Order, error)
- func (ok *OKEx) GetOrderHistorys(currency CurrencyPair, currentPage, pageSize int) ([]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) 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) GetFutureContractInfo() ([]FutureContractInfo, error)
- 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) 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() (*FutureAccount, error)
- func (ok *OKExFuture) GetKlineRecords(contract_type string, currency CurrencyPair, period, size, since int) ([]FutureKline, error)
- func (ok *OKExFuture) GetRate() (float64, error)
- func (ok *OKExFuture) GetTrades(contract_type string, currencyPair CurrencyPair, since int64) ([]Trade, error)
- func (ok *OKExFuture) GetUnfinishFutureOrders(currencyPair CurrencyPair, contractType string) ([]FutureOrder, error)
- func (ok *OKExFuture) MarketCloseAllPosition(currency CurrencyPair, contract string, oType int) (bool, error)
- func (ok *OKExFuture) PlaceFutureOrder(currencyPair CurrencyPair, contractType, price, amount string, ...) (string, error)
- func (ok *OKExFuture) PlaceFutureOrder2(matchPrice int, ord *FutureOrder) (*FutureOrder, error)
- 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) GetDepth(size int, currency CurrencyPair) (*Depth, error)
- func (ok *OKExSpot) GetExchangeName() string
- func (ok *OKExSpot) GetFills(orderId string, currency CurrencyPair) (*OrderFills, error)
- func (ok *OKExSpot) GetKlineRecords(currency CurrencyPair, period, size, since int) ([]Kline, error)
- func (ok *OKExSpot) GetOneOrder(orderId string, currency CurrencyPair) (*Order, error)
- func (ok *OKExSpot) GetOrderHistorys(currency CurrencyPair, currentPage, pageSize int) ([]Order, error)
- func (ok *OKExSpot) GetSymbols() (*Symbols, 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 OKExSwap
- func (ok *OKExSwap) AdaptTradeStatus(status int) TradeStatus
- func (ok *OKExSwap) FutureCancelOrder(currencyPair CurrencyPair, contractType, orderId string) (bool, 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) 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) 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() (*FutureAccount, error)
- func (ok *OKExSwap) GetHistoricalFunding(contractType string, currencyPair CurrencyPair, page int) ([]HistoricalFunding, error)
- func (ok *OKExSwap) GetKlineRecords(contract_type string, currency CurrencyPair, period, size, since int) ([]FutureKline, error)
- func (ok *OKExSwap) GetTrades(contract_type string, currencyPair CurrencyPair, since int64) ([]Trade, error)
- func (ok *OKExSwap) GetUnfinishFutureOrders(currencyPair CurrencyPair, contractType string) ([]FutureOrder, error)
- func (ok *OKExSwap) PlaceFutureOrder(currencyPair CurrencyPair, contractType, price, amount string, ...) (string, error)
- 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) GetWithDrawalFee(currency *Currency) ([]WithdrawFee, error)
- func (ok *OKExWallet) GetWithDrawalHistory(currency *Currency) ([]DepositWithDrawHistory, error)
- func (ok *OKExWallet) Transfer(param TransferParameter) error
- func (ok *OKExWallet) Withdrawal(param WithdrawParameter) (withdrawId string, err error)
- type OrderResponse
- type PlaceOrderInfo
- 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 TransferParameter
- type WithdrawFee
- type WithdrawParameter
Constants ¶
View Source
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.okex.com" GET_ACCOUNTS = "/api/swap/v3/accounts" PLACE_ORDER = "/api/swap/v3/order" CANCEL_ORDER = "/api/swap/v3/cancel_order/%s/%s" GET_ORDER = "/api/swap/v3/orders/%s/%s" 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" )
View Source
const ( SUB_ACCOUNT = iota //子账户 SPOT // 币币交易 FUTURE //交割合约 C2C //法币 SPOT_MARGIN //币币杠杆交易 WALLET // 资金账户 TIPS //余币宝 SWAP //永续合约 )
View Source
const ( WITHDRAWAL_OKCOIN int = 2 //提币到okcoin国际站 WITHDRAWAL_OKEx = 3 //提币到okex,站内提币 WITHDRAWAL_COIN = 4 //提币到数字货币地址,跨平台提币或者提到自己钱包 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 BasePlaceOrderInfo ¶
type BaseResponse ¶
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 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 DepositWithDrawHistory ¶
type DepositWithDrawHistory struct { WithdrawalId string `json:"withdrawal_id,omitempty"` Currency string `json:"currency"` Txid string `json:"txid"` Amount float64 `json:"amount,string"` From string `json:"from,omitempty"` To string `json:"to"` Memo string `json:"memo,omitempty"` Fee string `json:"fee"` Status int `json:"status,string"` Timestamp time.Time `json:"timestamp"` }
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 OKEx ¶
type OKEx struct { OKExSpot *OKExSpot OKExFuture *OKExFuture OKExSwap *OKExSwap OKExWallet *OKExWallet OKExMargin *OKExMargin // 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.1.0
func (ok *OKExFuture) GetAccounts(currencyPair ...CurrencyPair) (*FutureAccount, 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.1.0
func (ok *OKExFuture) GetFutureAllTicker() (*[]FutureTicker, error)
func (*OKExFuture) GetFutureContractInfo ¶
func (ok *OKExFuture) GetFutureContractInfo() ([]FutureContractInfo, error)
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) 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() (*FutureAccount, error)
deprecated 基本上已经报废,OK限制10s一次,但是基本上都会返回error:{"code":30014,"message":"Too Many Requests"}
func (*OKExFuture) GetKlineRecords ¶
func (ok *OKExFuture) GetKlineRecords(contract_type string, currency CurrencyPair, period, size, since int) ([]FutureKline, error)
*
since : 单位秒,开始时间
func (*OKExFuture) GetTrades ¶
func (ok *OKExFuture) GetTrades(contract_type string, currencyPair CurrencyPair, since int64) ([]Trade, error)
func (*OKExFuture) GetUnfinishFutureOrders ¶
func (ok *OKExFuture) GetUnfinishFutureOrders(currencyPair CurrencyPair, contractType string) ([]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) PlaceFutureOrder ¶
func (ok *OKExFuture) PlaceFutureOrder(currencyPair CurrencyPair, contractType, price, amount string, openType, matchPrice, leverRate int) (string, error)
deprecated
func (*OKExFuture) PlaceFutureOrder2 ¶
func (ok *OKExFuture) PlaceFutureOrder2(matchPrice int, ord *FutureOrder) (*FutureOrder, error)
matchPrice:是否以对手价下单(0:不是 1:是),默认为0;当取值为1时,price字段无效,当以对手价下单,order_type只能选择0:普通委托
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) GetExchangeName ¶
func (*OKExSpot) GetKlineRecords ¶
func (*OKExSpot) GetOneOrder ¶
orderId can set client oid or orderId
func (*OKExSpot) GetOrderHistorys ¶
func (*OKExSpot) GetSymbols ¶ added in v1.1.5
func (*OKExSpot) GetUnfinishOrders ¶
func (*OKExSpot) MarketSell ¶
func (*OKExSpot) PlaceOrder ¶
type OKExSwap ¶
type OKExSwap struct { *OKEx // contains filtered or unexported fields }
func NewOKExSwap ¶
func NewOKExSwap(config *APIConfig) *OKExSwap
func (*OKExSwap) AdaptTradeStatus ¶
func (*OKExSwap) FutureCancelOrder ¶
func (*OKExSwap) GetExchangeName ¶
func (*OKExSwap) GetExchangeRate ¶
func (*OKExSwap) GetFutureAllTicker ¶ added in v1.1.0
func (*OKExSwap) GetFutureDepth ¶
func (*OKExSwap) GetFutureEstimatedPrice ¶
func (*OKExSwap) GetFutureIndex ¶
func (*OKExSwap) GetFutureOrder ¶
func (ok *OKExSwap) GetFutureOrder(orderId string, currencyPair CurrencyPair, contractType string) (*FutureOrder, error)
*
*获取单个订单信息
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) GetKlineRecords ¶
func (*OKExSwap) GetUnfinishFutureOrders ¶
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) GetWithDrawalFee ¶
func (ok *OKExWallet) GetWithDrawalFee(currency *Currency) ([]WithdrawFee, error)
func (*OKExWallet) GetWithDrawalHistory ¶
func (ok *OKExWallet) GetWithDrawalHistory(currency *Currency) ([]DepositWithDrawHistory, 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 OrderResponse ¶
type OrderResponse struct { InstrumentId string `json:"instrument_id"` ClientOid string `json:"client_oid"` OrderId string `json:"order_id"` Price float64 `json:"price,string"` 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"` OrderType int `json:"order_type,string"` Timestamp string `json:"timestamp"` }
type PlaceOrderInfo ¶
type PlaceOrderInfo struct { BasePlaceOrderInfo InstrumentId string `json:"instrument_id"` }
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 []BaseOrderInfo `json:"order_info"` }
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
type TransferParameter ¶
type WithdrawFee ¶
Click to show internal directories.
Click to hide internal directories.