Documentation ¶
Index ¶
- Constants
- type BinanceAssetPosEarnInfo
- type BinanceGetPosEarnListResponse
- type BinanceGetPosEarnListService
- func (s *BinanceGetPosEarnListService) Asset(v string) *BinanceGetPosEarnListService
- func (s *BinanceGetPosEarnListService) Do(ctx context.Context, opts ...RequestOption) (res []*BinanceAssetPosEarnInfo, err error)
- func (s *BinanceGetPosEarnListService) PageIndex(v int) *BinanceGetPosEarnListService
- func (s *BinanceGetPosEarnListService) PageSize(v int) *BinanceGetPosEarnListService
- type BinancePosEarnConfig
- type BinancePosEarnInfo
- type Client
- func (c *Client) NewBinanceGetPosEarnListService() *BinanceGetPosEarnListService
- func (c *Client) NewOKEXGetEarnListService() *OKEXGetEarnListService
- func (c *Client) NewOKEXGetFuturesInstrumentsService() *OKEXGetFuturesInstrumentsService
- func (c *Client) NewOKEXGetFuturesMarkPriceService() *OKEXGetFuturesMarkPriceService
- func (c *Client) NewOKEXGetServiceListService() *OKEXGetServiceListService
- func (c *Client) SetProxy(proxyUrl string)
- func (c *Client) SetSourceAddr(srcIP string)
- type ContractType
- type ForceOrderCloseType
- type MarginType
- type NewOrderRespType
- type OKEXEarnInfo
- type OKEXFuturesInstrument
- type OKEXFuturesInstrumentsService
- func (is *OKEXFuturesInstrumentsService) BaseCurrency(bc string) *OKEXFuturesInstrumentsService
- func (s *OKEXFuturesInstrumentsService) Do(ctx context.Context, opts ...RequestOption) (data []byte, err error)
- func (is *OKEXFuturesInstrumentsService) InfoName(in string) *OKEXFuturesInstrumentsService
- func (is *OKEXFuturesInstrumentsService) QuoteCurrency(qc string) *OKEXFuturesInstrumentsService
- type OKEXFuturesMarkPrice
- type OKEXGetEarnListService
- type OKEXGetFuturesInstrumentsService
- type OKEXGetFuturesMarkPriceService
- func (s *OKEXGetFuturesMarkPriceService) BaseCurrency(v string) *OKEXGetFuturesMarkPriceService
- func (s *OKEXGetFuturesMarkPriceService) Do(ctx context.Context, opts ...RequestOption) (res *OKEXFuturesMarkPrice, err error)
- func (s *OKEXGetFuturesMarkPriceService) QuoteCurrency(v string) *OKEXGetFuturesMarkPriceService
- 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 BinanceAssetPosEarnInfo ¶ added in v2.2.10
type BinanceAssetPosEarnInfo struct { Asset string `json:"asset"` Projects []BinancePosEarnInfo `json:"projects"` }
type BinanceGetPosEarnListResponse ¶ added in v2.2.10
type BinanceGetPosEarnListResponse struct { Code string `json:"code"` Data json.RawMessage `json:"data"` Total int `json:"total"` Success bool `json:"success"` }
type BinanceGetPosEarnListService ¶ added in v2.2.10
type BinanceGetPosEarnListService struct {
// contains filtered or unexported fields
}
func (*BinanceGetPosEarnListService) Asset ¶ added in v2.2.10
func (s *BinanceGetPosEarnListService) Asset(v string) *BinanceGetPosEarnListService
func (*BinanceGetPosEarnListService) Do ¶ added in v2.2.10
func (s *BinanceGetPosEarnListService) Do(ctx context.Context, opts ...RequestOption) (res []*BinanceAssetPosEarnInfo, err error)
func (*BinanceGetPosEarnListService) PageIndex ¶ added in v2.2.10
func (s *BinanceGetPosEarnListService) PageIndex(v int) *BinanceGetPosEarnListService
func (*BinanceGetPosEarnListService) PageSize ¶ added in v2.2.10
func (s *BinanceGetPosEarnListService) PageSize(v int) *BinanceGetPosEarnListService
type BinancePosEarnConfig ¶ added in v2.2.10
type BinancePosEarnInfo ¶ added in v2.2.10
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) NewBinanceGetPosEarnListService ¶ added in v2.2.10
func (c *Client) NewBinanceGetPosEarnListService() *BinanceGetPosEarnListService
func (*Client) NewOKEXGetEarnListService ¶
func (c *Client) NewOKEXGetEarnListService() *OKEXGetEarnListService
func (*Client) NewOKEXGetFuturesInstrumentsService ¶ added in v2.2.9
func (c *Client) NewOKEXGetFuturesInstrumentsService() *OKEXGetFuturesInstrumentsService
func (*Client) NewOKEXGetFuturesMarkPriceService ¶ added in v2.2.9
func (c *Client) NewOKEXGetFuturesMarkPriceService() *OKEXGetFuturesMarkPriceService
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 OKEXFuturesInstrument ¶ added in v2.2.9
type OKEXFuturesInstrument struct { InstrumentId string `json:"instrument_id"` Underlying string `json:"underlying"` BaseCurrency string `json:"base_currency"` QuoteCurrency string `json:"quote_currency"` SettlementCurrency string `json:"settlement_currency"` ContractVal string `json:"contract_val"` Listing string `json:"listing"` Delivery string `json:"delivery"` SizeIncrement string `json:"size_increment"` TickSize string `json:"tick_size"` IsInverse string `json:"is_inverse"` Category string `json:"category"` ContractValCurrency string `json:"contract_val_currency"` UnderlyingIndex string `json:"underlying_index"` }
type OKEXFuturesInstrumentsService ¶ added in v2.2.9
type OKEXFuturesInstrumentsService struct {
// contains filtered or unexported fields
}
func (*OKEXFuturesInstrumentsService) BaseCurrency ¶ added in v2.2.9
func (is *OKEXFuturesInstrumentsService) BaseCurrency(bc string) *OKEXFuturesInstrumentsService
func (*OKEXFuturesInstrumentsService) Do ¶ added in v2.2.9
func (s *OKEXFuturesInstrumentsService) Do(ctx context.Context, opts ...RequestOption) (data []byte, err error)
func (*OKEXFuturesInstrumentsService) InfoName ¶ added in v2.2.9
func (is *OKEXFuturesInstrumentsService) InfoName(in string) *OKEXFuturesInstrumentsService
func (*OKEXFuturesInstrumentsService) QuoteCurrency ¶ added in v2.2.9
func (is *OKEXFuturesInstrumentsService) QuoteCurrency(qc string) *OKEXFuturesInstrumentsService
type OKEXFuturesMarkPrice ¶ added in v2.2.9
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 OKEXGetFuturesInstrumentsService ¶ added in v2.2.9
type OKEXGetFuturesInstrumentsService struct {
// contains filtered or unexported fields
}
func (*OKEXGetFuturesInstrumentsService) Do ¶ added in v2.2.9
func (s *OKEXGetFuturesInstrumentsService) Do(ctx context.Context, opts ...RequestOption) (res []*OKEXFuturesInstrument, err error)
type OKEXGetFuturesMarkPriceService ¶ added in v2.2.9
type OKEXGetFuturesMarkPriceService struct {
// contains filtered or unexported fields
}
func (*OKEXGetFuturesMarkPriceService) BaseCurrency ¶ added in v2.2.9
func (s *OKEXGetFuturesMarkPriceService) BaseCurrency(v string) *OKEXGetFuturesMarkPriceService
func (*OKEXGetFuturesMarkPriceService) Do ¶ added in v2.2.9
func (s *OKEXGetFuturesMarkPriceService) Do(ctx context.Context, opts ...RequestOption) (res *OKEXFuturesMarkPrice, err error)
func (*OKEXGetFuturesMarkPriceService) QuoteCurrency ¶ added in v2.2.9
func (s *OKEXGetFuturesMarkPriceService) QuoteCurrency(v string) *OKEXGetFuturesMarkPriceService
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"` Status int `json:"status"` 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