Documentation
¶
Index ¶
- Constants
- type Client
- type ContractType
- type ForceOrderCloseType
- type MarginType
- type NewOrderRespType
- type OKEXEarnInfo
- type OKEXGetEarnListService
- type OKEXGetServiceListService
- type OKEXProductType
- type OKEXServiceInfo
- type OKEXSpiderResponse
- type OKEXStakingList
- type OrderExecutionType
- type OrderStatusType
- type OrderType
- type PositionSideType
- type RequestOption
- type SideEffectType
- type SideType
- type SymbolFilterType
- type SymbolStatusType
- type SymbolType
- type TimeInForceType
- type UserDataEventReasonType
- type UserDataEventType
- type WorkingType
Constants ¶
const ( RemoteHostTypeBinance = iota RemoteHostTypeOKEX )
const ( SideTypeBuy SideType = "BUY" SideTypeSell SideType = "SELL" PositionSideTypeBoth PositionSideType = "BOTH" PositionSideTypeLong PositionSideType = "LONG" PositionSideTypeShort PositionSideType = "SHORT" OrderTypeLimit OrderType = "LIMIT" OrderTypeMarket OrderType = "MARKET" OrderTypeStop OrderType = "STOP" OrderTypeStopMarket OrderType = "STOP_MARKET" OrderTypeTakeProfit OrderType = "TAKE_PROFIT" OrderTypeTakeProfitMarket OrderType = "TAKE_PROFIT_MARKET" OrderTypeTrailingStopMarket OrderType = "TRAILING_STOP_MARKET" TimeInForceTypeGTC TimeInForceType = "GTC" // Good Till Cancel TimeInForceTypeIOC TimeInForceType = "IOC" // Immediate or Cancel TimeInForceTypeFOK TimeInForceType = "FOK" // Fill or Kill TimeInForceTypeGTX TimeInForceType = "GTX" // Good Till Crossing (Post Only) NewOrderRespTypeACK NewOrderRespType = "ACK" NewOrderRespTypeRESULT NewOrderRespType = "RESULT" OrderExecutionTypeNew OrderExecutionType = "NEW" OrderExecutionTypePartialFill OrderExecutionType = "PARTIAL_FILL" OrderExecutionTypeFill OrderExecutionType = "FILL" OrderExecutionTypeCanceled OrderExecutionType = "CANCELED" OrderExecutionTypeCalculated OrderExecutionType = "CALCULATED" OrderExecutionTypeExpired OrderExecutionType = "EXPIRED" OrderExecutionTypeTrade OrderExecutionType = "TRADE" OrderStatusTypeNew OrderStatusType = "NEW" OrderStatusTypePartiallyFilled OrderStatusType = "PARTIALLY_FILLED" OrderStatusTypeFilled OrderStatusType = "FILLED" OrderStatusTypeCanceled OrderStatusType = "CANCELED" OrderStatusTypeRejected OrderStatusType = "REJECTED" OrderStatusTypeExpired OrderStatusType = "EXPIRED" OrderStatusTypeNewInsurance OrderStatusType = "NEW_INSURANCE" OrderStatusTypeNewADL OrderStatusType = "NEW_ADL" SymbolTypeFuture SymbolType = "FUTURE" WorkingTypeMarkPrice WorkingType = "MARK_PRICE" WorkingTypeContractPrice WorkingType = "CONTRACT_PRICE" SymbolStatusTypePreTrading SymbolStatusType = "PRE_TRADING" SymbolStatusTypeTrading SymbolStatusType = "TRADING" SymbolStatusTypePostTrading SymbolStatusType = "POST_TRADING" SymbolStatusTypeEndOfDay SymbolStatusType = "END_OF_DAY" SymbolStatusTypeHalt SymbolStatusType = "HALT" SymbolStatusTypeAuctionMatch SymbolStatusType = "AUCTION_MATCH" SymbolStatusTypeBreak SymbolStatusType = "BREAK" SymbolFilterTypeLotSize SymbolFilterType = "LOT_SIZE" SymbolFilterTypePrice SymbolFilterType = "PRICE_FILTER" SymbolFilterTypePercentPrice SymbolFilterType = "PERCENT_PRICE" SymbolFilterTypeMarketLotSize SymbolFilterType = "MARKET_LOT_SIZE" SymbolFilterTypeMaxNumOrders SymbolFilterType = "MAX_NUM_ORDERS" SymbolFilterTypeMaxNumAlgoOrders SymbolFilterType = "MAX_NUM_ALGO_ORDERS" SymbolFilterTypeMinNotional SymbolFilterType = "MIN_NOTIONAL" SideEffectTypeNoSideEffect SideEffectType = "NO_SIDE_EFFECT" SideEffectTypeMarginBuy SideEffectType = "MARGIN_BUY" SideEffectTypeAutoRepay SideEffectType = "AUTO_REPAY" MarginTypeIsolated MarginType = "ISOLATED" MarginTypeCrossed MarginType = "CROSSED" ContractTypePerpetual ContractType = "PERPETUAL" UserDataEventTypeListenKeyExpired UserDataEventType = "listenKeyExpired" UserDataEventTypeMarginCall UserDataEventType = "MARGIN_CALL" UserDataEventTypeAccountUpdate UserDataEventType = "ACCOUNT_UPDATE" UserDataEventTypeOrderTradeUpdate UserDataEventType = "ORDER_TRADE_UPDATE" UserDataEventTypeAccountConfigUpdate UserDataEventType = "ACCOUNT_CONFIG_UPDATE" UserDataEventReasonTypeDeposit UserDataEventReasonType = "DEPOSIT" UserDataEventReasonTypeWithdraw UserDataEventReasonType = "WITHDRAW" UserDataEventReasonTypeOrder UserDataEventReasonType = "ORDER" UserDataEventReasonTypeFundingFee UserDataEventReasonType = "FUNDING_FEE" UserDataEventReasonTypeWithdrawReject UserDataEventReasonType = "WITHDRAW_REJECT" UserDataEventReasonTypeAdjustment UserDataEventReasonType = "ADJUSTMENT" UserDataEventReasonTypeInsuranceClear UserDataEventReasonType = "INSURANCE_CLEAR" UserDataEventReasonTypeAdminDeposit UserDataEventReasonType = "ADMIN_DEPOSIT" UserDataEventReasonTypeAdminWithdraw UserDataEventReasonType = "ADMIN_WITHDRAW" UserDataEventReasonTypeMarginTransfer UserDataEventReasonType = "MARGIN_TRANSFER" UserDataEventReasonTypeMarginTypeChange UserDataEventReasonType = "MARGIN_TYPE_CHANGE" UserDataEventReasonTypeAssetTransfer UserDataEventReasonType = "ASSET_TRANSFER" UserDataEventReasonTypeOptionsPremiumFee UserDataEventReasonType = "OPTIONS_PREMIUM_FEE" UserDataEventReasonTypeOptionsSettleProfit UserDataEventReasonType = "OPTIONS_SETTLE_PROFIT" ForceOrderCloseTypeLiquidation ForceOrderCloseType = "LIQUIDATION" ForceOrderCloseTypeADL ForceOrderCloseType = "ADL" )
Global enums
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { BaseURL string UserAgent string HTTPClient *http.Client Debug bool Logger *log.Logger TimeOffset int64 // contains filtered or unexported fields }
Client define API client
func NewClient ¶
NewClient initialize an API client instance with API key and secret key. You should always call this function before using this SDK. Services will be created by the form client.NewXXXService().
func (*Client) NewOKEXGetEarnListService ¶
func (c *Client) NewOKEXGetEarnListService() *OKEXGetEarnListService
func (*Client) NewOKEXGetServiceListService ¶
func (c *Client) NewOKEXGetServiceListService() *OKEXGetServiceListService
type ForceOrderCloseType ¶
type ForceOrderCloseType string
ForceOrderCloseType define reason type for force order
type NewOrderRespType ¶
type NewOrderRespType string
NewOrderRespType define response JSON verbosity
type OKEXEarnInfo ¶
type OKEXEarnInfo struct { CurrencyName string `json:"currencyName"` ProjectList []OKEXServiceInfo `json:"projectList"` }
type OKEXGetEarnListService ¶
type OKEXGetEarnListService struct {
// contains filtered or unexported fields
}
func (*OKEXGetEarnListService) Do ¶
func (s *OKEXGetEarnListService) Do(ctx context.Context, opts ...RequestOption) (res []*OKEXEarnInfo, err error)
func (*OKEXGetEarnListService) ProductType ¶
func (s *OKEXGetEarnListService) ProductType(pType OKEXProductType) *OKEXGetEarnListService
type OKEXGetServiceListService ¶
type OKEXGetServiceListService struct {
// contains filtered or unexported fields
}
func (*OKEXGetServiceListService) Do ¶
func (s *OKEXGetServiceListService) Do(ctx context.Context, opts ...RequestOption) (res []*OKEXServiceInfo, err error)
Do send request
type OKEXProductType ¶
type OKEXProductType int
const ( OKEXProductTypeSaving OKEXProductType = 1 OKEXProductTypeStaking OKEXProductType = 3 )
type OKEXServiceInfo ¶
type OKEXServiceInfo struct { Unit string `json:"unit"` ProductStatus bool `json:"productStatus"` SumHold float64 `json:"sumHold"` MinHold float64 `json:"minHold"` MaxHold float64 `json:"maxHold"` Period string `json:"period"` Rate string `json:"rate"` StartTime int64 `json:"startTime"` EndTime int64 `json:"endTime"` }
type OKEXSpiderResponse ¶
type OKEXStakingList ¶
type OKEXStakingList struct {
List json.RawMessage `json:"list"`
}
type OrderExecutionType ¶
type OrderExecutionType string
OrderExecutionType define order execution type
type PositionSideType ¶
type PositionSideType string
PositionSideType define position side type of order
type RequestOption ¶
type RequestOption func(*request)
RequestOption define option type for request
func WithHeader ¶
func WithHeader(key, value string, replace bool) RequestOption
WithHeader set or add a header value to the request
func WithHeaders ¶
func WithHeaders(header http.Header) RequestOption
WithHeaders set or replace the headers of the request
func WithRecvWindow ¶
func WithRecvWindow(recvWindow int64) RequestOption
WithRecvWindow set recvWindow param for the request
type TimeInForceType ¶
type TimeInForceType string
TimeInForceType define time in force type of order
type UserDataEventReasonType ¶
type UserDataEventReasonType string
UserDataEventReasonType define reason type for user data event
type UserDataEventType ¶
type UserDataEventType string
UserDataEventType define user data event type