Documentation
¶
Index ¶
- Constants
- func IsErrWebsocketClosed(err error) bool
- func MinimumVolumeUSDT(symbol SymbolUSDT) float64
- type APIKeyResponse
- type AccountAssetService
- type AccountRatioParam
- type AccountRatioResponse
- type AccountRatioResult
- type ApiKey
- type Balance
- type BalanceResponse
- type BalanceResult
- type BigDealParam
- type BigDealResponse
- type BigDealResult
- type CancelLinearOrder
- type CancelLinearOrderParam
- type CancelLinearOrderResponse
- type CancelLinearOrderResult
- type CancelOrder
- type CancelOrderParam
- type CancelOrderResponse
- type CancelOrderResult
- type Client
- func (c *Client) AccountAsset() *AccountAssetService
- func (c *Client) CopyTrading() *CopyTradingService
- func (c *Client) Debug() *Client
- func (c *Client) Derivative() *DerivativeService
- func (c *Client) Future() FutureServiceI
- func (c *Client) Spot() SpotServiceI
- func (c *Client) USDCContract() USDCContractServiceI
- func (c *Client) WithAuth(key string, secret string) *Client
- func (c *Client) WithHTTPClient(httpClient *http.Client) *Client
- type Coin
- type CommonResponse
- type CopyTradingService
- type CreateLinearOrder
- type CreateLinearOrderParam
- type CreateLinearOrderResponse
- type CreateLinearOrderResult
- type CreateOrder
- type CreateOrderParam
- type CreateOrderResponse
- type CreateOrderResult
- type DerivativeService
- type Direction
- type ExecType
- type FutureCommonService
- func (s *FutureCommonService) APIKey() (*APIKeyResponse, error)
- func (s *FutureCommonService) AccountRatio(param AccountRatioParam) (*AccountRatioResponse, error)
- func (s *FutureCommonService) Balance(coin Coin) (*BalanceResponse, error)
- func (s *FutureCommonService) BigDeal(param BigDealParam) (*BigDealResponse, error)
- func (s *FutureCommonService) IndexPriceKline(param IndexPriceKlineParam) (*IndexPriceKlineResponse, error)
- func (s *FutureCommonService) ListKline(param ListKlineParam) (*ListKlineResponse, error)
- func (s *FutureCommonService) MarkPriceKline(param MarkPriceKlineParam) (*MarkPriceKlineResponse, error)
- func (s *FutureCommonService) OpenInterest(param OpenInterestParam) (*OpenInterestResponse, error)
- func (s *FutureCommonService) OrderBook(symbol SymbolInverse) (*OrderBookResponse, error)
- func (s *FutureCommonService) Symbols() (*SymbolsResponse, error)
- func (s *FutureCommonService) Tickers(symbol SymbolInverse) (*TickersResponse, error)
- func (s *FutureCommonService) TradingRecords(param TradingRecordsParam) (*TradingRecordsResponse, error)
- type FutureInverseFutureService
- type FutureInverseFutureServiceI
- type FutureInversePerpetualService
- func (s *FutureInversePerpetualService) CancelOrder(param CancelOrderParam) (*CancelOrderResponse, error)
- func (s *FutureInversePerpetualService) CreateOrder(param CreateOrderParam) (*CreateOrderResponse, error)
- func (s *FutureInversePerpetualService) ListOrder(param ListOrderParam) (*ListOrderResponse, error)
- func (s *FutureInversePerpetualService) ListPosition(symbol SymbolInverse) (*ListPositionResponse, error)
- func (s *FutureInversePerpetualService) ListPositions() (*ListPositionsResponse, error)
- func (s *FutureInversePerpetualService) PremiumIndexKline(param PremiumIndexKlineParam) (*PremiumIndexKlineResponse, error)
- func (s *FutureInversePerpetualService) SaveLeverage(param SaveLeverageParam) (*SaveLeverageResponse, error)
- type FutureInversePerpetualServiceI
- type FutureService
- type FutureServiceI
- type FutureUSDTPerpetualService
- func (s *FutureUSDTPerpetualService) CancelLinearOrder(param CancelLinearOrderParam) (*CancelLinearOrderResponse, error)
- func (s *FutureUSDTPerpetualService) CreateLinearOrder(param CreateLinearOrderParam) (*CreateLinearOrderResponse, error)
- func (s *FutureUSDTPerpetualService) LinearCancelAllOrder(param LinearCancelAllParam) (*LinearCancelAllResponse, error)
- func (s *FutureUSDTPerpetualService) LinearExecutionList(param LinearExecutionListParam) (*LinearExecutionListResponse, error)
- func (s *FutureUSDTPerpetualService) ListLinearPosition(symbol SymbolUSDT) (*ListLinearPositionResponse, error)
- func (s *FutureUSDTPerpetualService) ListLinearPositions() (*ListLinearPositionsResponse, error)
- func (s *FutureUSDTPerpetualService) SaveLinearLeverage(param SaveLinearLeverageParam) (*SaveLinearLeverageResponse, error)
- type FutureUSDTPerpetualServiceI
- type IndexPriceKlineParam
- type IndexPriceKlineResponse
- type IndexPriceKlineResult
- type Interval
- type LeverageFilter
- type LinearCancelAllParam
- type LinearCancelAllResponse
- type LinearCancelAllResult
- type LinearExecutionList
- type LinearExecutionListParam
- type LinearExecutionListResponse
- type LinearExecutionListResult
- type ListKlineParam
- type ListKlineResponse
- type ListKlineResult
- type ListLinearPositionResponse
- type ListLinearPositionResult
- type ListLinearPositionsResponse
- type ListLinearPositionsResult
- type ListOrder
- type ListOrderParam
- type ListOrderResponse
- type ListOrderResult
- type ListPositionResponse
- type ListPositionResult
- type ListPositionsResponse
- type ListPositionsResult
- type LotSizeFilter
- type MarkPriceKlineParam
- type MarkPriceKlineResponse
- type MarkPriceKlineResult
- type OpenInterestParam
- type OpenInterestResponse
- type OpenInterestResult
- type OrderBookResponse
- type OrderBookResult
- type OrderStatus
- type OrderStatusSpot
- type OrderType
- type OrderTypeSpot
- type Period
- type PremiumIndexKlineParam
- type PremiumIndexKlineResponse
- type PremiumIndexKlineResult
- type PriceFilter
- type SaveLeverageParam
- type SaveLeverageResponse
- type SaveLinearLeverageParam
- type SaveLinearLeverageResponse
- type Side
- type SpotDeleteOrderFastParam
- type SpotDeleteOrderFastResponse
- type SpotDeleteOrderFastResult
- type SpotDeleteOrderParam
- type SpotDeleteOrderResponse
- type SpotDeleteOrderResult
- type SpotGetOrderParam
- type SpotGetOrderResponse
- type SpotGetOrderResult
- type SpotInterval
- type SpotOrderBatchCancelByIDsResponse
- type SpotOrderBatchCancelByIDsResult
- type SpotOrderBatchCancelParam
- type SpotOrderBatchCancelResponse
- type SpotOrderBatchCancelResult
- type SpotOrderBatchFastCancelParam
- type SpotOrderBatchFastCancelResponse
- type SpotOrderBatchFastCancelResult
- type SpotPostOrderParam
- type SpotPostOrderResponse
- type SpotPostOrderResult
- type SpotQuoteDepthBidAsk
- type SpotQuoteDepthBidsAsks
- type SpotQuoteDepthMergedParam
- type SpotQuoteDepthMergedResponse
- type SpotQuoteDepthMergedResult
- type SpotQuoteDepthParam
- type SpotQuoteDepthResponse
- type SpotQuoteDepthResult
- type SpotQuoteKline
- type SpotQuoteKlineParam
- type SpotQuoteKlineResponse
- type SpotQuoteKlineResult
- type SpotQuoteTicker24hrParam
- type SpotQuoteTicker24hrResponse
- type SpotQuoteTicker24hrResult
- type SpotQuoteTickerBookTickerParam
- type SpotQuoteTickerBookTickerResponse
- type SpotQuoteTickerBookTickerResult
- type SpotQuoteTickerPriceParam
- type SpotQuoteTickerPriceResponse
- type SpotQuoteTickerPriceResult
- type SpotQuoteTradesParam
- type SpotQuoteTradesResponse
- type SpotQuoteTradesResult
- type SpotService
- type SpotServiceI
- type SpotSymbolsResponse
- type SpotSymbolsResult
- type SpotV1Service
- func (s *SpotV1Service) SpotDeleteOrder(param SpotDeleteOrderParam) (*SpotDeleteOrderResponse, error)
- func (s *SpotV1Service) SpotDeleteOrderFast(param SpotDeleteOrderFastParam) (*SpotDeleteOrderFastResponse, error)
- func (s *SpotV1Service) SpotGetOrder(param SpotGetOrderParam) (*SpotGetOrderResponse, error)
- func (s *SpotV1Service) SpotOrderBatchCancel(param SpotOrderBatchCancelParam) (*SpotOrderBatchCancelResponse, error)
- func (s *SpotV1Service) SpotOrderBatchCancelByIDs(orderIDs []string) (*SpotOrderBatchCancelByIDsResponse, error)
- func (s *SpotV1Service) SpotOrderBatchFastCancel(param SpotOrderBatchFastCancelParam) (*SpotOrderBatchFastCancelResponse, error)
- func (s *SpotV1Service) SpotPostOrder(param SpotPostOrderParam) (*SpotPostOrderResponse, error)
- func (s *SpotV1Service) SpotQuoteDepth(param SpotQuoteDepthParam) (*SpotQuoteDepthResponse, error)
- func (s *SpotV1Service) SpotQuoteDepthMerged(param SpotQuoteDepthMergedParam) (*SpotQuoteDepthMergedResponse, error)
- func (s *SpotV1Service) SpotQuoteKline(param SpotQuoteKlineParam) (*SpotQuoteKlineResponse, error)
- func (s *SpotV1Service) SpotQuoteTicker24hr(param SpotQuoteTicker24hrParam) (*SpotQuoteTicker24hrResponse, error)
- func (s *SpotV1Service) SpotQuoteTickerBookTicker(param SpotQuoteTickerBookTickerParam) (*SpotQuoteTickerBookTickerResponse, error)
- func (s *SpotV1Service) SpotQuoteTickerPrice(param SpotQuoteTickerPriceParam) (*SpotQuoteTickerPriceResponse, error)
- func (s *SpotV1Service) SpotQuoteTrades(param SpotQuoteTradesParam) (*SpotQuoteTradesResponse, error)
- func (s *SpotV1Service) SpotSymbols() (*SpotSymbolsResponse, error)
- type SpotV1ServiceI
- type SpotV3Service
- type SpotWebsocketService
- type SpotWebsocketV1PrivateEventType
- type SpotWebsocketV1PrivateOutboundAccountInfoResponse
- type SpotWebsocketV1PrivateOutboundAccountInfoResponseContent
- type SpotWebsocketV1PrivateOutboundAccountInfoResponseWalletBalanceChange
- type SpotWebsocketV1PrivateParamKey
- type SpotWebsocketV1PrivateService
- func (s *SpotWebsocketV1PrivateService) Close() error
- func (s *SpotWebsocketV1PrivateService) Ping() error
- func (s *SpotWebsocketV1PrivateService) RegisterFuncOutboundAccountInfo(f func(SpotWebsocketV1PrivateOutboundAccountInfoResponse) error) error
- func (s *SpotWebsocketV1PrivateService) Run() error
- func (s *SpotWebsocketV1PrivateService) Start(ctx context.Context)
- func (s *SpotWebsocketV1PrivateService) Subscribe() error
- type SpotWebsocketV1PublicV1Event
- type SpotWebsocketV1PublicV1Service
- func (s *SpotWebsocketV1PublicV1Service) Close() error
- func (s *SpotWebsocketV1PublicV1Service) Ping() error
- func (s *SpotWebsocketV1PublicV1Service) Run() error
- func (s *SpotWebsocketV1PublicV1Service) Start(ctx context.Context)
- func (s *SpotWebsocketV1PublicV1Service) SubscribeTrade(symbol SymbolSpot, f func(response SpotWebsocketV1PublicV1TradeResponse) error) (func() error, error)
- type SpotWebsocketV1PublicV1Topic
- type SpotWebsocketV1PublicV1TradeContent
- type SpotWebsocketV1PublicV1TradeParam
- type SpotWebsocketV1PublicV1TradeParamChild
- type SpotWebsocketV1PublicV1TradeParamKey
- type SpotWebsocketV1PublicV1TradeResponse
- type SpotWebsocketV1PublicV1TradeResponseParams
- type SpotWebsocketV1PublicV2Event
- type SpotWebsocketV1PublicV2Service
- func (s *SpotWebsocketV1PublicV2Service) Close() error
- func (s *SpotWebsocketV1PublicV2Service) Ping() error
- func (s *SpotWebsocketV1PublicV2Service) Run() error
- func (s *SpotWebsocketV1PublicV2Service) Start(ctx context.Context)
- func (s *SpotWebsocketV1PublicV2Service) SubscribeTrade(symbol SymbolSpot, f func(response SpotWebsocketV1PublicV2TradeResponse) error) (func() error, error)
- type SpotWebsocketV1PublicV2Topic
- type SpotWebsocketV1PublicV2TradeContent
- type SpotWebsocketV1PublicV2TradeParam
- type SpotWebsocketV1PublicV2TradeParamChild
- type SpotWebsocketV1PublicV2TradeParamKey
- type SpotWebsocketV1PublicV2TradeResponse
- type SpotWebsocketV1PublicV2TradeResponseParams
- type SpotWebsocketV1Service
- type SymbolInverse
- type SymbolSpot
- type SymbolUSDT
- type SymbolsResponse
- type SymbolsResult
- type TestClient
- type TestWebSocketClient
- type TickDirection
- type TickersResponse
- type TickersResult
- type TimeInForce
- type TimeInForceSpot
- type TpSlMode
- type TradingRecordsParam
- type TradingRecordsResponse
- type TradingRecordsResult
- type USDCContractOptionService
- type USDCContractPerpetualService
- type USDCContractService
- type USDCContractServiceI
- type WebSocketClient
- type WebsocketExecutor
Constants ¶
const ( // CoinBTC : CoinBTC = "BTC" // CoinETH : CoinETH = "ETH" // CoinEOS : CoinEOS = "EOS" // CoinXRP : CoinXRP = "XRP" // CoinUSDT : CoinUSDT = "USDT" )
const ( // SymbolInverseBTCUSD : SymbolInverseBTCUSD = SymbolInverse("BTCUSD") // SymbolInverseETHUSD : SymbolInverseETHUSD = SymbolInverse("ETHUSD") // SymbolInverseEOSUSD : SymbolInverseEOSUSD = SymbolInverse("EOSUSD") // SymbolInverseXRPUSD : SymbolInverseXRPUSD = SymbolInverse("XRPUSD") )
const ( // SymbolUSDTBTC : SymbolUSDTBTC = SymbolUSDT("BTCUSDT") // SymbolUSDTETH : SymbolUSDTETH = SymbolUSDT("ETHUSDT") // SymbolUSDTLTC : SymbolUSDTLTC = SymbolUSDT("LTCUSDT") // SymbolUSDTLINK : SymbolUSDTLINK = SymbolUSDT("LINKUSDT") // SymbolUSDTXTZ : SymbolUSDTXTZ = SymbolUSDT("XTZUSDT") // SymbolUSDTBCH : SymbolUSDTBCH = SymbolUSDT("BCHUSDT") // SymbolUSDTADA : SymbolUSDTADA = SymbolUSDT("ADAUSDT") // SymbolUSDTDOT : SymbolUSDTDOT = SymbolUSDT("DOTUSDT") // SymbolUSDTUNI : SymbolUSDTUNI = SymbolUSDT("UNIUSDT") )
const ( // SymbolSpotBTCUSDT : SymbolSpotBTCUSDT = SymbolSpot("BTCUSDT") // SymbolSpotETHUSDT : SymbolSpotETHUSDT = SymbolSpot("ETHUSDT") // SymbolSpotEOSUSDT : SymbolSpotEOSUSDT = SymbolSpot("EOSUSDT") // SymbolSpotXRPUSDT : SymbolSpotXRPUSDT = SymbolSpot("XRPUSDT") // SymbolSpotUNIUSDT : SymbolSpotUNIUSDT = SymbolSpot("UNIUSDT") // SymbolSpotBTCETH : SymbolSpotBTCETH = SymbolSpot("BTCETH") // SymbolSpotDOGEXRP : SymbolSpotDOGEXRP = SymbolSpot("DOGEXRP") // SymbolSpotXLMUSDT : SymbolSpotXLMUSDT = SymbolSpot("XLMUSDT") // SymbolSpotLTCUSDT : SymbolSpotLTCUSDT = SymbolSpot("LTCUSDT") // SymbolSpotXRPBTC : SymbolSpotXRPBTC = SymbolSpot("XRPBTC") // SymbolSpotDOGEUSDT : SymbolSpotDOGEUSDT = SymbolSpot("DOGEUSDT") // SymbolSpotBITUSDT : SymbolSpotBITUSDT = SymbolSpot("BITUSDT") // SymbolSpotMANAUSDT : SymbolSpotMANAUSDT = SymbolSpot("MANAUSDT") // SymbolSpotAXSUSDT : SymbolSpotAXSUSDT = SymbolSpot("AXSUSDT") // SymbolSpotDYDXUSDT : SymbolSpotDYDXUSDT = SymbolSpot("DYDXUSDT") // SymbolSpotPMTEST5BTC : SymbolSpotPMTEST5BTC = SymbolSpot("PMTEST5BTC") // SymbolSpotGENEUSDT : SymbolSpotGENEUSDT = SymbolSpot("GENEUSDT") )
const ( // SideNone : not defined officially SideNone = Side("None") // SideBuy : SideBuy = Side("Buy") // SideSell : SideSell = Side("Sell") )
const ( // OrderTypeLimit : OrderTypeLimit = OrderType("Limit") // OrderTypeMarket : OrderTypeMarket = OrderType("Market") )
const ( // OrderTypeSpotLimit : OrderTypeSpotLimit = OrderTypeSpot("LIMIT") // OrderTypeSpotMarket : OrderTypeSpotMarket = OrderTypeSpot("MARKET") // OrderTypeSpotLimitMaker : OrderTypeSpotLimitMaker = OrderTypeSpot("LIMIT_MAKER") )
const ( // OrderStatusCreated : OrderStatusCreated = OrderStatus("Created") // OrderStatusRejected : OrderStatusRejected = OrderStatus("Rejected") // OrderStatusNew : OrderStatusNew = OrderStatus("New") // OrderStatusPartiallyFilled : OrderStatusPartiallyFilled = OrderStatus("PartiallyFilled") // OrderStatusFilled : OrderStatusFilled = OrderStatus("Filled") // OrderStatusCancelled : OrderStatusCancelled = OrderStatus("Cancelled") // OrderStatusPendingCancel : OrderStatusPendingCancel = OrderStatus("PendingCancel") )
const ( // OrderStatusSpotNew : OrderStatusSpotNew = OrderStatusSpot("NEW") // OrderStatusSpotPartiallyFilled : OrderStatusSpotPartiallyFilled = OrderStatusSpot("PARTIALLY_FILLED") // OrderStatusSpotFilled : OrderStatusSpotFilled = OrderStatusSpot("FILLED") // OrderStatusSpotCanceled : OrderStatusSpotCanceled = OrderStatusSpot("CANCELED") // OrderStatusSpotPendingCancel : OrderStatusSpotPendingCancel = OrderStatusSpot("PENDING_CANCEL") // OrderStatusSpotPendingNew : OrderStatusSpotPendingNew = OrderStatusSpot("PENDING_NEW") // OrderStatusSpotRejected : OrderStatusSpotRejected = OrderStatusSpot("REJECTED") )
const ( // TimeInForceGoodTillCancel : TimeInForceGoodTillCancel = TimeInForce("GoodTillCancel") // TimeInForceImmediateOrCancel : TimeInForceImmediateOrCancel = TimeInForce("ImmediateOrCancel") // TimeInForceFillOrKill : TimeInForceFillOrKill = TimeInForce("FillOrKill") // TimeInForcePostOnly : TimeInForcePostOnly = TimeInForce("PostOnly") )
const ( // TimeInForceSpotGTC : TimeInForceSpotGTC = TimeInForceSpot("GTC") // TimeInForceSpotFOK : TimeInForceSpotFOK = TimeInForceSpot("FOK") // TimeInForceSpotIOC : TimeInForceSpotIOC = TimeInForceSpot("IOC") )
const ( // Interval1 : Interval1 = Interval("1") // Interval3 : Interval3 = Interval("3") // Interval5 : Interval5 = Interval("5") // Interval15 : Interval15 = Interval("15") // Interval30 : Interval30 = Interval("30") // Interval60 : Interval60 = Interval("60") // Interval120 : Interval120 = Interval("120") // Interval240 : Interval240 = Interval("240") // Interval360 : Interval360 = Interval("360") // Interval720 : Interval720 = Interval("720") // IntervalD : IntervalD = Interval("D") // IntervalW : IntervalW = Interval("W") // IntervalM : IntervalM = Interval("M") )
const ( // SpotInterval1m : SpotInterval1m = Interval("1m") // SpotInterval3m : SpotInterval3m = Interval("3m") // SpotInterval5m : SpotInterval5m = Interval("5m") // SpotInterval15m : SpotInterval15m = Interval("15m") // SpotInterval30m : SpotInterval30m = Interval("30m") // SpotInterval1h : SpotInterval1h = Interval("1h") // SpotInterval2h : SpotInterval2h = Interval("2h") // SpotInterval4h : SpotInterval4h = Interval("4h") // SpotInterval6h : SpotInterval6h = Interval("6h") // SpotInterval12h : SpotInterval12h = Interval("12h") // SpotInterval1d : SpotInterval1d = Interval("1d") // SpotInterval1w : SpotInterval1w = Interval("1w") // SpotInterval1M : SpotInterval1M = Interval("1M") )
const ( // TickDirectionPlusTick : TickDirectionPlusTick = TickDirection("PlusTick") // TickDirectionZeroPlusTick : TickDirectionZeroPlusTick = TickDirection("ZeroPlusTick") // TickDirectionMinusTick : TickDirectionMinusTick = TickDirection("MinusTick") // TickDirectionZeroMinusTick : TickDirectionZeroMinusTick = TickDirection("ZeroMinusTick") )
const ( // Period5min : Period5min = Period("5min") // Period15min : Period15min = Period("15min") // Period30min : Period30min = Period("30min") // Period1h : Period1h = Period("1h") // Period4h : Period4h = Period("4h") // Period1d : Period1d = Period("1d") )
const ( // TpSlModeFull : TpSlModeFull = TpSlMode("Full") // TpSlModePartial : TpSlModePartial = TpSlMode("Partial") )
const ( // ExecTypeTrade : ExecTypeTrade = ExecType("Trade") // ExecTypeAdlTrade : ExecTypeAdlTrade = ExecType("AdlTrade") // ExecTypeFunding : ExecTypeFunding = ExecType("Funding") // ExecTypeBustTrade : ExecTypeBustTrade = ExecType("BustTrade") )
const ( // DirectionPrev : DirectionPrev = Direction("prev") // DirectionNext : DirectionNext = Direction("next") )
const ( // SpotWebsocketV1PublicV1EventSubscribe : SpotWebsocketV1PublicV1EventSubscribe = "sub" // SpotWebsocketV1PublicV1EventUnsubscribe : SpotWebsocketV1PublicV1EventUnsubscribe = "cancel" )
const ( // SpotWebsocketV1PublicV2EventSubscribe : SpotWebsocketV1PublicV2EventSubscribe = "sub" // SpotWebsocketV1PublicV2EventUnsubscribe : SpotWebsocketV1PublicV2EventUnsubscribe = "cancel" )
const (
// MainNetBaseURL :
MainNetBaseURL = "https://api.bybit.com"
)
const (
// SpotWebsocketV1PrivateEventTypeOutboundAccountInfo :
SpotWebsocketV1PrivateEventTypeOutboundAccountInfo = "outboundAccountInfo"
)
const (
// SpotWebsocketV1PrivatePath :
SpotWebsocketV1PrivatePath = "/spot/ws"
)
const (
// SpotWebsocketV1PublicV1Path :
SpotWebsocketV1PublicV1Path = "/spot/quote/ws/v1"
)
const ( // SpotWebsocketV1PublicV1TopicTrade : SpotWebsocketV1PublicV1TopicTrade = SpotWebsocketV1PublicV1Topic("trade") )
const (
// SpotWebsocketV1PublicV2Path :
SpotWebsocketV1PublicV2Path = "/spot/quote/ws/v2"
)
const ( // SpotWebsocketV1PublicV2TopicTrade : SpotWebsocketV1PublicV2TopicTrade = SpotWebsocketV1PublicV2Topic("trade") )
const (
// TestNetBaseURL :
TestNetBaseURL = "https://api-testnet.bybit.com"
)
const (
// TestWebsocketBaseURL :
TestWebsocketBaseURL = "wss://stream-testnet.bybit.com"
)
const (
// WebsocketBaseURL :
WebsocketBaseURL = "wss://stream.bybit.com"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIKeyResponse ¶
type APIKeyResponse struct {
CommonResponse `json:",inline"`
Result []ApiKey `json:"result"`
}
APIKeyResponse :
type AccountAssetService ¶
type AccountAssetService struct {
// contains filtered or unexported fields
}
AccountAssetService :
type AccountRatioParam ¶
type AccountRatioParam struct {
Symbol SymbolInverse `url:"symbol"`
Period Period `url:"period"`
Limit *int `url:"limit,omitempty"`
}
AccountRatioParam :
type AccountRatioResponse ¶
type AccountRatioResponse struct {
CommonResponse `json:",inline"`
Result []AccountRatioResult `json:"result"`
}
AccountRatioResponse :
type AccountRatioResult ¶
type AccountRatioResult struct {
Symbol SymbolInverse `json:"symbol"`
BuyRatio float64 `json:"buy_ratio"`
SellRatio float64 `json:"sell_ratio"`
Timestamp int `json:"timestamp"`
}
AccountRatioResult :
type ApiKey ¶
type ApiKey struct {
APIKey string `json:"api_key"`
Type string `json:"type"`
UserID int `json:"user_id"`
InviterID int `json:"inviter_id"`
IPs []string `json:"ips"`
Note string `json:"note"`
Permissions []string `json:"permissions"`
CreatedAt time.Time `json:"created_at"`
ExpiredAt time.Time `json:"expired_at"`
ReadOnly bool `json:"read_only"`
VipLevel string `json:"vip_level"`
MarketMakerLevel string `json:"mkt_maker_level"`
AffiliateID int `json:"affiliate_id"`
}
type Balance ¶
type Balance struct {
Equity float64 `json:"equity"`
AvailableBalance float64 `json:"available_balance"`
UsedMargin float64 `json:"used_margin"`
OrderMargin float64 `json:"order_margin"`
PositionMargin float64 `json:"position_margin"`
OccClosingFee float64 `json:"occ_closing_fee"`
OccFundingFee float64 `json:"occ_funding_fee"`
WalletBalance float64 `json:"wallet_balance"`
RealisedPnl float64 `json:"realised_pnl"`
UnrealisedPnl float64 `json:"unrealised_pnl"`
CumRealisedPnl float64 `json:"cum_realised_pnl"`
GivenCash float64 `json:"given_cash"`
ServiceCash float64 `json:"service_cash"`
}
Balance :
type BalanceResponse ¶
type BalanceResponse struct {
CommonResponse `json:",inline"`
Result BalanceResult `json:"result"`
}
BalanceResponse :
type BalanceResult ¶
BalanceResult :
func (*BalanceResult) UnmarshalJSON ¶
func (r *BalanceResult) UnmarshalJSON(data []byte) error
UnmarshalJSON :
type BigDealParam ¶
type BigDealParam struct {
Symbol SymbolInverse `url:"symbol"`
Limit *int `url:"limit,omitempty"`
}
BigDealParam :
type BigDealResponse ¶
type BigDealResponse struct {
CommonResponse `json:",inline"`
Result []BigDealResult `json:"result"`
}
BigDealResponse :
type BigDealResult ¶
type BigDealResult struct {
Symbol SymbolInverse `json:"symbol"`
Side Side `json:"side"`
Timestamp int `json:"timestamp"`
Value int `json:"value"`
}
BigDealResult :
type CancelLinearOrder ¶
type CancelLinearOrder struct {
OrderID string `json:"order_id"`
}
CancelLinearOrder :
type CancelLinearOrderParam ¶
type CancelLinearOrderParam struct {
Symbol SymbolUSDT `json:"symbol"`
OrderID *string `json:"order_id,omitempty"`
OrderLinkID *string `json:"order_link_id,omitempty"`
}
CancelLinearOrderParam :
type CancelLinearOrderResponse ¶
type CancelLinearOrderResponse struct {
CommonResponse `json:",inline"`
Result CancelLinearOrderResult `json:"result"`
}
CancelLinearOrderResponse :
type CancelLinearOrderResult ¶
type CancelLinearOrderResult struct {
CancelLinearOrder `json:",inline"`
}
CancelLinearOrderResult :
type CancelOrder ¶
type CancelOrder struct {
UserID int `json:"user_id"`
OrderID string `json:"order_id"`
Symbol SymbolInverse `json:"symbol"`
Side Side `json:"side"`
OrderType OrderType `json:"order_type"`
Price float64 `json:"price"`
Qty float64 `json:"qty"`
TimeInForce TimeInForce `json:"time_in_force"`
OrderStatus OrderStatus `json:"order_status"`
LastExecTime float64 `json:"last_exec_time"`
LastExecPrice float64 `json:"last_exec_price"`
LeavesQty float64 `json:"leaves_qty"`
CumExecQty float64 `json:"cum_exec_qty"`
CumExecValue float64 `json:"cum_exec_value"`
CumExecFee float64 `json:"cum_exec_fee"`
RejectReason string `json:"reject_reason"`
OrderLinkID string `json:"order_link_id"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
CancelOrder : so far, same as CreateOrder
type CancelOrderParam ¶
type CancelOrderParam struct {
Symbol SymbolInverse `json:"symbol"`
OrderID *string `json:"order_id,omitempty"`
OrderLinkID *string `json:"order_link_id,omitempty"`
}
CancelOrderParam :
type CancelOrderResponse ¶
type CancelOrderResponse struct {
CommonResponse `json:",inline"`
Result CancelOrderResult `json:"result"`
}
CancelOrderResponse :
type CancelOrderResult ¶
type CancelOrderResult struct {
CancelOrder `json:",inline"`
}
CancelOrderResult :
type CommonResponse ¶
type CommonResponse struct {
RetCode int `json:"ret_code"`
RetMsg string `json:"ret_msg"`
ExtCode string `json:"ext_code"`
ExtInfo string `json:"ext_info"`
TimeNow string `json:"time_now"`
RateLimitStatus int `json:"rate_limit_status"`
RateLimitResetMs int `json:"rate_limit_reset_ms"`
RateLimit int `json:"rate_limit"`
}
CommonResponse :
type CopyTradingService ¶
type CopyTradingService struct {
// contains filtered or unexported fields
}
CopyTradingService :
type CreateLinearOrder ¶
type CreateLinearOrder struct {
OrderID string `json:"order_id"`
UserID int `json:"user_id"`
Symbol SymbolUSDT `json:"symbol"`
Side Side `json:"side"`
OrderType OrderType `json:"order_type"`
Price float64 `json:"price"`
Qty float64 `json:"qty"`
TimeInForce TimeInForce `json:"time_in_force"`
OrderStatus OrderStatus `json:"order_status"`
LastExecPrice float64 `json:"last_exec_price"`
CumExecQty float64 `json:"cum_exec_qty"`
CumExecValue float64 `json:"cum_exec_value"`
CumExecFee float64 `json:"cum_exec_fee"`
ReduceOnly bool `json:"reduce_only"`
CloseOnTrigger bool `json:"close_on_trigger"`
OrderLinkID string `json:"order_link_id"`
CreatedTime string `json:"created_time"`
UpdatedTime string `json:"updated_time"`
TakeProfit float64 `json:"take_profit"`
StopLoss float64 `json:"stop_loss"`
TpTriggerBy string `json:"tp_trigger_by"`
SlTriggerBy string `json:"sl_trigger_by"`
}
CreateLinearOrder :
type CreateLinearOrderParam ¶
type CreateLinearOrderParam struct {
Side Side `json:"side"`
Symbol SymbolUSDT `json:"symbol"`
OrderType OrderType `json:"order_type"`
Qty float64 `json:"qty"`
TimeInForce TimeInForce `json:"time_in_force"`
ReduceOnly bool `json:"reduce_only"`
CloseOnTrigger bool `json:"close_on_trigger"`
Price *float64 `json:"price,omitempty"`
TakeProfit *float64 `json:"take_profit,omitempty"`
StopLoss *float64 `json:"stop_loss,omitempty"`
TpTriggerBy *string `json:"tp_trigger_by"`
SlTriggerBy *string `json:"sl_trigger_by"`
OrderLinkID *string `json:"order_link_id,omitempty"`
}
CreateLinearOrderParam :
type CreateLinearOrderResponse ¶
type CreateLinearOrderResponse struct {
CommonResponse `json:",inline"`
Result CreateLinearOrderResult `json:"result"`
}
CreateLinearOrderResponse :
type CreateLinearOrderResult ¶
type CreateLinearOrderResult struct {
CreateLinearOrder `json:",inline"`
}
CreateLinearOrderResult :
type CreateOrder ¶
type CreateOrder struct {
UserID int `json:"user_id"`
OrderID string `json:"order_id"`
Symbol SymbolInverse `json:"symbol"`
Side Side `json:"side"`
OrderType OrderType `json:"order_type"`
Price float64 `json:"price"`
Qty float64 `json:"qty"`
TimeInForce TimeInForce `json:"time_in_force"`
OrderStatus OrderStatus `json:"order_status"`
LastExecTime float64 `json:"last_exec_time"`
LastExecPrice float64 `json:"last_exec_price"`
LeavesQty float64 `json:"leaves_qty"`
CumExecQty float64 `json:"cum_exec_qty"`
CumExecValue float64 `json:"cum_exec_value"`
CumExecFee float64 `json:"cum_exec_fee"`
RejectReason string `json:"reject_reason"`
OrderLinkID string `json:"order_link_id"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
CreateOrder :
type CreateOrderParam ¶
type CreateOrderParam struct {
Side Side `json:"side"`
Symbol SymbolInverse `json:"symbol"`
OrderType OrderType `json:"order_type"`
Qty int `json:"qty"`
TimeInForce TimeInForce `json:"time_in_force"`
Price *float64 `json:"price,omitempty"`
TakeProfit *float64 `json:"take_profit,omitempty"`
StopLoss *float64 `json:"stop_loss,omitempty"`
ReduceOnly *bool `json:"reduce_only,omitempty"`
CloseOnTrigger *bool `json:"close_on_trigger,omitempty"`
OrderLinkID *string `json:"order_link_id,omitempty"`
}
CreateOrderParam :
type CreateOrderResponse ¶
type CreateOrderResponse struct {
CommonResponse `json:",inline"`
Result CreateOrderResult `json:"result"`
}
CreateOrderResponse :
type CreateOrderResult ¶
type CreateOrderResult struct {
CreateOrder `json:",inline"`
}
CreateOrderResult :
type DerivativeService ¶
type DerivativeService struct {
// contains filtered or unexported fields
}
DerivativeService :
type FutureCommonService ¶
type FutureCommonService struct {
// contains filtered or unexported fields
}
FutureCommonService :
func (*FutureCommonService) APIKey ¶
func (s *FutureCommonService) APIKey() (*APIKeyResponse, error)
Balance :
func (*FutureCommonService) AccountRatio ¶
func (s *FutureCommonService) AccountRatio(param AccountRatioParam) (*AccountRatioResponse, error)
AccountRatio :
func (*FutureCommonService) Balance ¶
func (s *FutureCommonService) Balance(coin Coin) (*BalanceResponse, error)
Balance :
func (*FutureCommonService) BigDeal ¶
func (s *FutureCommonService) BigDeal(param BigDealParam) (*BigDealResponse, error)
BigDeal :
func (*FutureCommonService) IndexPriceKline ¶
func (s *FutureCommonService) IndexPriceKline(param IndexPriceKlineParam) (*IndexPriceKlineResponse, error)
IndexPriceKline :
func (*FutureCommonService) ListKline ¶
func (s *FutureCommonService) ListKline(param ListKlineParam) (*ListKlineResponse, error)
ListKline :
func (*FutureCommonService) MarkPriceKline ¶
func (s *FutureCommonService) MarkPriceKline(param MarkPriceKlineParam) (*MarkPriceKlineResponse, error)
MarkPriceKline :
func (*FutureCommonService) OpenInterest ¶
func (s *FutureCommonService) OpenInterest(param OpenInterestParam) (*OpenInterestResponse, error)
OpenInterest :
func (*FutureCommonService) OrderBook ¶
func (s *FutureCommonService) OrderBook(symbol SymbolInverse) (*OrderBookResponse, error)
OrderBook :
func (*FutureCommonService) Symbols ¶
func (s *FutureCommonService) Symbols() (*SymbolsResponse, error)
Symbols :
func (*FutureCommonService) Tickers ¶
func (s *FutureCommonService) Tickers(symbol SymbolInverse) (*TickersResponse, error)
Tickers :
func (*FutureCommonService) TradingRecords ¶
func (s *FutureCommonService) TradingRecords(param TradingRecordsParam) (*TradingRecordsResponse, error)
TradingRecords :
type FutureInverseFutureService ¶
type FutureInverseFutureService struct {
*FutureCommonService
// contains filtered or unexported fields
}
FutureInverseFutureService :
type FutureInverseFutureServiceI ¶
type FutureInverseFutureServiceI interface {
// Market Data Endpoints
OrderBook(SymbolInverse) (*OrderBookResponse, error)
ListKline(ListKlineParam) (*ListKlineResponse, error)
Tickers(SymbolInverse) (*TickersResponse, error)
TradingRecords(TradingRecordsParam) (*TradingRecordsResponse, error)
Symbols() (*SymbolsResponse, error)
MarkPriceKline(MarkPriceKlineParam) (*MarkPriceKlineResponse, error)
IndexPriceKline(IndexPriceKlineParam) (*IndexPriceKlineResponse, error)
OpenInterest(OpenInterestParam) (*OpenInterestResponse, error)
BigDeal(BigDealParam) (*BigDealResponse, error)
AccountRatio(AccountRatioParam) (*AccountRatioResponse, error)
// Wallet Data Endpoints
Balance(Coin) (*BalanceResponse, error)
// Account Data Endpoints
APIKey() (*APIKeyResponse, error)
}
FutureInverseFutureServiceI :
type FutureInversePerpetualService ¶
type FutureInversePerpetualService struct {
*FutureCommonService
// contains filtered or unexported fields
}
FutureInversePerpetualService :
func (*FutureInversePerpetualService) CancelOrder ¶
func (s *FutureInversePerpetualService) CancelOrder(param CancelOrderParam) (*CancelOrderResponse, error)
CancelOrder :
func (*FutureInversePerpetualService) CreateOrder ¶
func (s *FutureInversePerpetualService) CreateOrder(param CreateOrderParam) (*CreateOrderResponse, error)
CreateOrder :
func (*FutureInversePerpetualService) ListOrder ¶
func (s *FutureInversePerpetualService) ListOrder(param ListOrderParam) (*ListOrderResponse, error)
ListOrder :
func (*FutureInversePerpetualService) ListPosition ¶
func (s *FutureInversePerpetualService) ListPosition(symbol SymbolInverse) (*ListPositionResponse, error)
ListPosition :
func (*FutureInversePerpetualService) ListPositions ¶
func (s *FutureInversePerpetualService) ListPositions() (*ListPositionsResponse, error)
ListPositions :
func (*FutureInversePerpetualService) PremiumIndexKline ¶
func (s *FutureInversePerpetualService) PremiumIndexKline(param PremiumIndexKlineParam) (*PremiumIndexKlineResponse, error)
PremiumIndexKline :
func (*FutureInversePerpetualService) SaveLeverage ¶
func (s *FutureInversePerpetualService) SaveLeverage(param SaveLeverageParam) (*SaveLeverageResponse, error)
SaveLeverage :
type FutureInversePerpetualServiceI ¶
type FutureInversePerpetualServiceI interface {
// Market Data Endpoints
OrderBook(SymbolInverse) (*OrderBookResponse, error)
ListKline(ListKlineParam) (*ListKlineResponse, error)
Tickers(SymbolInverse) (*TickersResponse, error)
TradingRecords(TradingRecordsParam) (*TradingRecordsResponse, error)
Symbols() (*SymbolsResponse, error)
MarkPriceKline(MarkPriceKlineParam) (*MarkPriceKlineResponse, error)
IndexPriceKline(IndexPriceKlineParam) (*IndexPriceKlineResponse, error)
PremiumIndexKline(PremiumIndexKlineParam) (*PremiumIndexKlineResponse, error)
OpenInterest(OpenInterestParam) (*OpenInterestResponse, error)
BigDeal(BigDealParam) (*BigDealResponse, error)
AccountRatio(AccountRatioParam) (*AccountRatioResponse, error)
// Account Data Endpoints
CreateOrder(CreateOrderParam) (*CreateOrderResponse, error)
ListOrder(ListOrderParam) (*ListOrderResponse, error)
CancelOrder(CancelOrderParam) (*CancelOrderResponse, error)
ListPosition(SymbolInverse) (*ListPositionResponse, error)
ListPositions() (*ListPositionsResponse, error)
SaveLeverage(SaveLeverageParam) (*SaveLeverageResponse, error)
// Wallet Data Endpoints
Balance(Coin) (*BalanceResponse, error)
}
FutureInversePerpetualServiceI :
type FutureService ¶
type FutureService struct {
// contains filtered or unexported fields
}
FutureService :
func (*FutureService) InverseFuture ¶
func (s *FutureService) InverseFuture() FutureInverseFutureServiceI
InverseFuture :
func (*FutureService) InversePerpetual ¶
func (s *FutureService) InversePerpetual() FutureInversePerpetualServiceI
InversePerpetual :
func (*FutureService) USDTPerpetual ¶
func (s *FutureService) USDTPerpetual() FutureUSDTPerpetualServiceI
USDTPerpetual :
type FutureServiceI ¶
type FutureServiceI interface {
InversePerpetual() FutureInversePerpetualServiceI
USDTPerpetual() FutureUSDTPerpetualServiceI
InverseFuture() FutureInverseFutureServiceI
}
FutureServiceI :
type FutureUSDTPerpetualService ¶
type FutureUSDTPerpetualService struct {
*FutureCommonService
// contains filtered or unexported fields
}
FutureUSDTPerpetualService :
func (*FutureUSDTPerpetualService) CancelLinearOrder ¶
func (s *FutureUSDTPerpetualService) CancelLinearOrder(param CancelLinearOrderParam) (*CancelLinearOrderResponse, error)
CancelLinearOrder :
func (*FutureUSDTPerpetualService) CreateLinearOrder ¶
func (s *FutureUSDTPerpetualService) CreateLinearOrder(param CreateLinearOrderParam) (*CreateLinearOrderResponse, error)
CreateLinearOrder :
func (*FutureUSDTPerpetualService) LinearCancelAllOrder ¶
func (s *FutureUSDTPerpetualService) LinearCancelAllOrder(param LinearCancelAllParam) (*LinearCancelAllResponse, error)
LinearCancelAllOrder : Cancel all active orders that are unfilled or partially filled. Fully filled orders cannot be cancelled.
func (*FutureUSDTPerpetualService) LinearExecutionList ¶
func (s *FutureUSDTPerpetualService) LinearExecutionList(param LinearExecutionListParam) (*LinearExecutionListResponse, error)
LinearExecutionList : NOTE(TODO) : somehow got EOF 404(path not found)
func (*FutureUSDTPerpetualService) ListLinearPosition ¶
func (s *FutureUSDTPerpetualService) ListLinearPosition(symbol SymbolUSDT) (*ListLinearPositionResponse, error)
ListLinearPosition :
func (*FutureUSDTPerpetualService) ListLinearPositions ¶
func (s *FutureUSDTPerpetualService) ListLinearPositions() (*ListLinearPositionsResponse, error)
ListLinearPositions :
func (*FutureUSDTPerpetualService) SaveLinearLeverage ¶
func (s *FutureUSDTPerpetualService) SaveLinearLeverage(param SaveLinearLeverageParam) (*SaveLinearLeverageResponse, error)
SaveLinearLeverage :
type FutureUSDTPerpetualServiceI ¶
type FutureUSDTPerpetualServiceI interface {
// Market Data Endpoints
OrderBook(SymbolInverse) (*OrderBookResponse, error)
Tickers(SymbolInverse) (*TickersResponse, error)
Symbols() (*SymbolsResponse, error)
OpenInterest(OpenInterestParam) (*OpenInterestResponse, error)
BigDeal(BigDealParam) (*BigDealResponse, error)
AccountRatio(AccountRatioParam) (*AccountRatioResponse, error)
// Account Data Endpoints
CreateLinearOrder(CreateLinearOrderParam) (*CreateLinearOrderResponse, error)
CancelLinearOrder(CancelLinearOrderParam) (*CancelLinearOrderResponse, error)
LinearCancelAllOrder(LinearCancelAllParam) (*LinearCancelAllResponse, error)
ListLinearPosition(SymbolUSDT) (*ListLinearPositionResponse, error)
ListLinearPositions() (*ListLinearPositionsResponse, error)
SaveLinearLeverage(SaveLinearLeverageParam) (*SaveLinearLeverageResponse, error)
LinearExecutionList(LinearExecutionListParam) (*LinearExecutionListResponse, error)
// Wallet Data Endpoints
Balance(Coin) (*BalanceResponse, error)
}
FutureUSDTPerpetualServiceI :
type IndexPriceKlineParam ¶
type IndexPriceKlineParam struct {
Symbol SymbolInverse `url:"symbol"`
Interval Interval `url:"interval"`
From int `url:"from"`
Limit *int `url:"limit,omitempty"`
}
IndexPriceKlineParam :
type IndexPriceKlineResponse ¶
type IndexPriceKlineResponse struct {
CommonResponse `json:",inline"`
Result []IndexPriceKlineResult `json:"result"`
}
IndexPriceKlineResponse :
type IndexPriceKlineResult ¶
type IndexPriceKlineResult struct {
Symbol SymbolInverse `json:"symbol"`
Period Period `json:"period"`
OpenTime int `json:"open_time"`
Open string `json:"open"`
High string `json:"high"`
Low string `json:"low"`
Close string `json:"close"`
}
IndexPriceKlineResult :
type LeverageFilter ¶
type LeverageFilter struct {
MinLeverage float64 `json:"min_leverage"`
MaxLeverage float64 `json:"max_leverage"`
LeverageStep string `json:"leverage_step"`
}
LeverageFilter :
type LinearCancelAllParam ¶
type LinearCancelAllParam struct {
Symbol SymbolUSDT `json:"symbol"`
}
LinearCancelAllParam : Parameters to be supplied to cancel all endpoint
type LinearCancelAllResponse ¶
type LinearCancelAllResponse struct {
CommonResponse `json:",inline"`
Result LinearCancelAllResult `json:"result"`
}
LinearCancelAllResponse : Response from cancel all endpoint
type LinearCancelAllResult ¶
type LinearCancelAllResult []string
type LinearExecutionList ¶
type LinearExecutionList struct {
OrderID string `json:"order_id"`
OrderLinkID string `json:"order_link_id"`
Side Side `json:"side"`
Symbol SymbolUSDT `json:"symbol"`
OrderPrice float64 `json:"order_price"`
OrderQty float64 `json:"order_qty"`
OrderType OrderType `json:"order_type"`
FeeRate float64 `json:"fee_rate"`
ExecPrice float64 `json:"exec_price"`
ExecType ExecType `json:"exec_type"`
ExecQty float64 `json:"exec_qty"`
ExecFee float64 `json:"exec_fee"`
ExecValue float64 `json:"exec_value"`
LeavesQty float64 `json:"leaves_qty"`
ClosedSize float64 `json:"closed_size"`
LastLiquidityInd string `json:"last_liquidity_ind"`
TradeTimeMs float64 `json:"trade_time_ms"`
}
LinearExecutionList :
type LinearExecutionListParam ¶
type LinearExecutionListParam struct {
Symbol SymbolUSDT `json:"symbol"`
StartTime *int `json:"start_time"`
EndTime *int `json:"end_time"`
ExecType *ExecType `json:"exec_type"`
Page *int `json:"page"`
Limit *int `json:"limit"`
}
LinearExecutionListParam :
type LinearExecutionListResponse ¶
type LinearExecutionListResponse struct {
CommonResponse `json:",inline"`
Result LinearExecutionListResult `json:"result"`
}
LinearExecutionListResponse :
type LinearExecutionListResult ¶
type LinearExecutionListResult struct {
CurrentPage int `json:"current_page"`
LinearExecutionLists []LinearExecutionList `json:"data"`
}
LinearExecutionListResult :
type ListKlineParam ¶
type ListKlineParam struct {
Symbol SymbolInverse `url:"symbol"`
Interval Interval `url:"interval"`
From int `url:"from"`
Limit *int `url:"limit,omitempty"`
}
ListKlineParam :
type ListKlineResponse ¶
type ListKlineResponse struct {
CommonResponse `json:",inline"`
Result []ListKlineResult `json:"result"`
}
ListKlineResponse :
type ListKlineResult ¶
type ListKlineResult struct {
Symbol SymbolInverse `json:"symbol"`
Interval string `json:"interval"`
OpenTime int `json:"open_time"`
Open string `json:"open"`
High string `json:"high"`
Low string `json:"low"`
Close string `json:"close"`
Volume string `json:"volume"`
Turnover string `json:"turnover"`
}
ListKlineResult :
type ListLinearPositionResponse ¶
type ListLinearPositionResponse struct {
CommonResponse `json:",inline"`
Result []ListLinearPositionResult `json:"result"`
}
ListLinearPositionResponse :
type ListLinearPositionResult ¶
type ListLinearPositionResult struct {
UserID int `json:"user_id"`
Symbol SymbolInverse `json:"symbol"`
Side Side `json:"side"`
Size float64 `json:"size"`
PositionValue float64 `json:"position_value"`
EntryPrice float64 `json:"entry_price"`
LiqPrice float64 `json:"liq_price"`
BustPrice float64 `json:"bust_price"`
Leverage float64 `json:"leverage"`
AutoAddMargin float64 `json:"auto_add_margin"`
IsIsolated bool `json:"is_isolated"`
PositionMargin float64 `json:"position_margin"`
OccClosingFee float64 `json:"occ_closing_fee"`
RealisedPnl float64 `json:"realised_pnl"`
CumRealisedPnl float64 `json:"cum_realised_pnl"`
FreeQty float64 `json:"free_qty"`
TpSlMode TpSlMode `json:"tp_sl_mode"`
DeleverageIndicator int `json:"deleverage_indicator"`
UnrealisedPnl float64 `json:"unrealised_pnl"`
RiskID int `json:"risk_id"`
}
ListLinearPositionResult :
type ListLinearPositionsResponse ¶
type ListLinearPositionsResponse struct {
CommonResponse `json:",inline"`
Result []ListLinearPositionsResult `json:"result"`
}
ListLinearPositionsResponse :
type ListLinearPositionsResult ¶
type ListLinearPositionsResult struct {
IsValid bool `json:"is_valid"`
ListLinearPositionResult `json:"data,inline"`
}
ListLinearPositionsResult :
type ListOrder ¶
type ListOrder struct {
UserID int `json:"user_id"`
Symbol SymbolInverse `json:"symbol"`
Side Side `json:"side"`
OrderType OrderType `json:"order_type"`
Price string `json:"price"`
Qty string `json:"qty"`
TimeInForce TimeInForce `json:"time_in_force"`
OrderStatus OrderStatus `json:"order_status"`
LeavesQty string `json:"leaves_qty"`
LeavesValue string `json:"leaves_value"`
CumExecQty string `json:"cum_exec_qty"`
CumExecValue string `json:"cum_exec_value"`
CumExecFee string `json:"cum_exec_fee"`
RejectReason string `json:"reject_reason"`
OrderLinkID string `json:"order_link_id"`
CreatedAt string `json:"created_at"`
OrderID string `json:"order_id"`
TakeProfit string `json:"take_profit"`
StopLoss string `json:"stop_loss"`
TpTriggerBy string `json:"tp_trigger_by"`
SlTriggerBy string `json:"sl_trigger_by"`
}
ListOrder :
type ListOrderParam ¶
type ListOrderParam struct {
Symbol SymbolInverse `url:"symbol"`
OrderStatus *OrderStatus `url:"order_status,omitempty"`
Direction *Direction `url:"direction,omitempty"`
Size *int `url:"size,omitempty"`
Cursor *string `url:"cursor,omitempty"`
}
ListOrderParam :
type ListOrderResponse ¶
type ListOrderResponse struct {
CommonResponse `json:",inline"`
Result ListOrderResult `json:"result"`
}
ListOrderResponse :
type ListOrderResult ¶
type ListOrderResult struct {
ListOrders []ListOrder `json:"data"`
}
ListOrderResult :
type ListPositionResponse ¶
type ListPositionResponse struct {
CommonResponse `json:",inline"`
Result ListPositionResult `json:"result"`
}
ListPositionResponse :
type ListPositionResult ¶
type ListPositionResult struct {
ID int `json:"id"`
UserID int `json:"user_id"`
RiskID int `json:"risk_id"`
Symbol SymbolInverse `json:"symbol"`
Side Side `json:"side"`
Size float64 `json:"size"`
PositionValue string `json:"position_value"`
EntryPrice string `json:"entry_price"`
IsIsolated bool `json:"is_isolated"`
AutoAddMargin float64 `json:"auto_add_margin"`
Leverage string `json:"leverage"`
EffectiveLeverage string `json:"effective_leverage"`
PositionMargin string `json:"position_margin"`
LiqPrice string `json:"liq_price"`
BustPrice string `json:"bust_price"`
OccClosingFee string `json:"occ_closing_fee"`
OccFundingFee string `json:"occ_funding_fee"`
TakeProfit string `json:"take_profit"`
StopLoss string `json:"stop_loss"`
TrailingStop string `json:"trailing_stop"`
PositionStatus string `json:"position_status"`
DeleverageIndicator int `json:"deleverage_indicator"`
OcCalcData string `json:"oc_calc_data"`
OrderMargin string `json:"order_margin"`
WalletBalance string `json:"wallet_balance"`
RealisedPnl string `json:"realised_pnl"`
UnrealisedPnl float64 `json:"unrealised_pnl"`
CumRealisedPnl string `json:"cum_realised_pnl"`
CrossSeq float64 `json:"cross_seq"`
PositionSeq float64 `json:"position_seq"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
ListPositionResult :
type ListPositionsResponse ¶
type ListPositionsResponse struct {
CommonResponse `json:",inline"`
Result []ListPositionsResult `json:"result"`
}
ListPositionsResponse :
type ListPositionsResult ¶
type ListPositionsResult struct {
IsValid bool `json:"is_valid"`
ListPositionResult `json:"data,inline"`
}
ListPositionsResult :
type LotSizeFilter ¶
type LotSizeFilter struct {
MaxTradingQty float64 `json:"max_trading_qty"`
MinTradingQty float64 `json:"min_trading_qty"`
QtyStep float64 `json:"qty_step"`
}
LotSizeFilter :
type MarkPriceKlineParam ¶
type MarkPriceKlineParam struct {
Symbol SymbolInverse `url:"symbol"`
Interval Interval `url:"interval"`
From int `url:"from"`
Limit *int `url:"limit,omitempty"`
}
MarkPriceKlineParam :
type MarkPriceKlineResponse ¶
type MarkPriceKlineResponse struct {
CommonResponse `json:",inline"`
Result []MarkPriceKlineResult `json:"result"`
}
MarkPriceKlineResponse :
type MarkPriceKlineResult ¶
type MarkPriceKlineResult struct {
Symbol SymbolInverse `json:"symbol"`
Period Period `json:"period"`
StartAt int `json:"start_at"`
Open float64 `json:"open"`
High float64 `json:"high"`
Low float64 `json:"low"`
Close float64 `json:"close"`
}
MarkPriceKlineResult :
type OpenInterestParam ¶
type OpenInterestParam struct {
Symbol SymbolInverse `url:"symbol"`
Period Period `url:"period"`
Limit *int `url:"limit,omitempty"`
}
OpenInterestParam :
type OpenInterestResponse ¶
type OpenInterestResponse struct {
CommonResponse `json:",inline"`
Result []OpenInterestResult `json:"result"`
}
OpenInterestResponse :
type OpenInterestResult ¶
type OpenInterestResult struct {
OpenInterest int `json:"open_interest"`
Timestamp int `json:"timestamp"`
Symbol SymbolInverse `json:"symbol"`
}
OpenInterestResult :
type OrderBookResponse ¶
type OrderBookResponse struct {
CommonResponse `json:",inline"`
Result []OrderBookResult `json:"result"`
}
OrderBookResponse :
type OrderBookResult ¶
type OrderBookResult struct {
Symbol SymbolInverse `json:"symbol"`
Price string `json:"price"`
Size float64 `json:"size"`
Side Side `json:"side"`
}
OrderBookResult :
type PremiumIndexKlineParam ¶
type PremiumIndexKlineParam struct {
Symbol SymbolInverse `url:"symbol"`
Interval Interval `url:"interval"`
From int `url:"from"`
Limit *int `url:"limit,omitempty"`
}
PremiumIndexKlineParam :
type PremiumIndexKlineResponse ¶
type PremiumIndexKlineResponse struct {
CommonResponse `json:",inline"`
Result []PremiumIndexKlineResult `json:"result"`
}
PremiumIndexKlineResponse :
type PremiumIndexKlineResult ¶
type PremiumIndexKlineResult struct {
Symbol SymbolInverse `json:"symbol"`
Period Period `json:"period"`
OpenTime int `json:"open_time"`
Open string `json:"open"`
High string `json:"high"`
Low string `json:"low"`
Close string `json:"close"`
}
PremiumIndexKlineResult :
type PriceFilter ¶
type PriceFilter struct {
MinPrice string `json:"min_price"`
MaxPrice string `json:"max_price"`
TickSize string `json:"tick_size"`
}
PriceFilter :
type SaveLeverageParam ¶
type SaveLeverageParam struct {
Symbol SymbolInverse `json:"symbol"`
Leverage float64 `json:"leverage"`
}
SaveLeverageParam :
type SaveLeverageResponse ¶
type SaveLeverageResponse struct {
CommonResponse `json:",inline"`
Result float64 `json:"result"`
}
SaveLeverageResponse :
type SaveLinearLeverageParam ¶
type SaveLinearLeverageParam struct {
Symbol SymbolUSDT `json:"symbol"`
BuyLeverage float64 `json:"buy_leverage"`
SellLeverage float64 `json:"sell_leverage"`
}
SaveLinearLeverageParam :
type SaveLinearLeverageResponse ¶
type SaveLinearLeverageResponse struct {
CommonResponse `json:",inline"`
}
SaveLinearLeverageResponse :
type SpotDeleteOrderFastParam ¶
type SpotDeleteOrderFastParam struct {
Symbol SymbolSpot `url:"symbolId"`
OrderID *string `url:"orderId,omitempty"`
OrderLinkID *string `url:"orderLinkId,omitempty"`
}
type SpotDeleteOrderFastResponse ¶
type SpotDeleteOrderFastResponse struct {
CommonResponse `json:",inline"`
Result SpotDeleteOrderFastResult `json:"result"`
}
type SpotDeleteOrderFastResult ¶
type SpotDeleteOrderFastResult struct {
IsCancelled bool `json:"isCancelled"`
}
type SpotDeleteOrderParam ¶
type SpotDeleteOrderParam struct {
OrderID *string `url:"orderId,omitempty"`
OrderLinkID *string `url:"orderLinkId,omitempty"`
}
SpotDeleteOrderParam :
type SpotDeleteOrderResponse ¶
type SpotDeleteOrderResponse struct {
CommonResponse `json:",inline"`
Result SpotDeleteOrderResult `json:"result"`
}
SpotDeleteOrderResponse :
type SpotDeleteOrderResult ¶
type SpotDeleteOrderResult struct {
OrderId string `json:"orderId"`
OrderLinkId string `json:"orderLinkId"`
Symbol string `json:"symbol"`
Status string `json:"status"`
AccountId string `json:"accountId"`
TransactTime string `json:"transactTime"`
Price string `json:"price"`
OrigQty string `json:"origQty"`
ExecutedQty string `json:"executedQty"`
TimeInForce string `json:"timeInForce"`
Type string `json:"type"`
Side string `json:"side"`
}
SpotDeleteOrderResult :
type SpotGetOrderParam ¶
type SpotGetOrderParam struct {
OrderID *string `url:"orderId,omitempty"`
OrderLinkID *string `url:"orderLinkId,omitempty"`
}
SpotGetOrderParam :
type SpotGetOrderResponse ¶
type SpotGetOrderResponse struct {
CommonResponse `json:",inline"`
Result SpotGetOrderResult `json:"result"`
}
SpotGetOrderResponse :
type SpotGetOrderResult ¶
type SpotGetOrderResult struct {
AccountId string `json:"accountId"`
ExchangeId string `json:"exchangeId"`
Symbol string `json:"symbol"`
SymbolName string `json:"symbolName"`
OrderLinkId string `json:"orderLinkId"`
OrderId string `json:"orderId"`
Price string `json:"price"`
OrigQty string `json:"origQty"`
ExecutedQty string `json:"executedQty"`
CummulativeQuoteQty string `json:"cummulativeQuoteQty"`
AvgPrice string `json:"avgPrice"`
Status string `json:"status"`
TimeInForce string `json:"timeInForce"`
Type string `json:"type"`
Side string `json:"side"`
StopPrice string `json:"stopPrice"`
IcebergQty string `json:"icebergQty"`
Time string `json:"time"`
UpdateTime string `json:"updateTime"`
IsWorking bool `json:"isWorking"`
}
SpotGetOrderResult :
type SpotOrderBatchCancelByIDsResponse ¶
type SpotOrderBatchCancelByIDsResponse struct {
CommonResponse `json:",inline"`
Result []SpotOrderBatchCancelByIDsResult `json:"result"`
}
type SpotOrderBatchCancelParam ¶
type SpotOrderBatchCancelParam struct {
Symbol SymbolSpot `url:"symbolId"`
Side *Side `url:"side,omitempty"`
Types []OrderTypeSpot `url:"orderTypes,omitempty" del:","`
}
type SpotOrderBatchCancelResponse ¶
type SpotOrderBatchCancelResponse struct {
CommonResponse `json:",inline"`
Result SpotOrderBatchCancelResult `json:"result"`
}
type SpotOrderBatchCancelResult ¶
type SpotOrderBatchCancelResult struct {
Success bool `json:"success"`
}
type SpotOrderBatchFastCancelParam ¶
type SpotOrderBatchFastCancelParam struct {
Symbol SymbolSpot `url:"symbolId"`
Side *Side `url:"side,omitempty"`
Types []OrderTypeSpot `url:"orderTypes,omitempty" del:","`
}
type SpotOrderBatchFastCancelResponse ¶
type SpotOrderBatchFastCancelResponse struct {
CommonResponse `json:",inline"`
Result SpotOrderBatchFastCancelResult `json:"result"`
}
type SpotOrderBatchFastCancelResult ¶
type SpotOrderBatchFastCancelResult struct {
Success bool `json:"success"`
}
type SpotPostOrderParam ¶
type SpotPostOrderParam struct {
Symbol SymbolSpot `url:"symbol"`
Qty float64 `url:"qty"`
Side Side `url:"side"`
Type OrderTypeSpot `url:"type"`
TimeInForce *TimeInForceSpot `url:"timeInForce,omitempty"`
Price *float64 `url:"price,omitempty"`
OrderLinkID *string `url:"orderLinkId,omitempty"`
}
SpotPostOrderParam :
type SpotPostOrderResponse ¶
type SpotPostOrderResponse struct {
CommonResponse `json:",inline"`
Result SpotPostOrderResult `json:"result"`
}
SpotPostOrderResponse :
type SpotPostOrderResult ¶
type SpotPostOrderResult struct {
OrderID string `json:"orderId"`
OrderLinkID string `json:"orderLinkId"`
Symbol string `json:"symbol"`
TransactTime string `json:"transactTime"`
Price string `json:"price"`
OrigQty string `json:"origQty"`
Type OrderTypeSpot `json:"type"`
Side string `json:"side"`
Status OrderStatusSpot `json:"status"`
TimeInForce TimeInForceSpot `json:"timeInForce"`
AccountID string `json:"accountId"`
SymbolName string `json:"symbolName"`
ExecutedQty string `json:"executedQty"`
}
SpotPostOrderResult :
type SpotQuoteDepthBidAsk ¶
SpotQuoteDepthBidAsk :
type SpotQuoteDepthBidsAsks ¶
type SpotQuoteDepthBidsAsks []SpotQuoteDepthBidAsk
SpotQuoteDepthBidsAsks :
func (*SpotQuoteDepthBidsAsks) UnmarshalJSON ¶
func (r *SpotQuoteDepthBidsAsks) UnmarshalJSON(data []byte) error
UnmarshalJSON :
type SpotQuoteDepthMergedParam ¶
type SpotQuoteDepthMergedParam struct {
Symbol SymbolSpot `url:"symbol"`
Scale *int `url:"scale,omitempty"`
Limit *int `url:"limit,omitempty"`
}
SpotQuoteDepthMergedParam :
type SpotQuoteDepthMergedResponse ¶
type SpotQuoteDepthMergedResponse struct {
CommonResponse `json:",inline"`
Result SpotQuoteDepthMergedResult `json:"result"`
}
SpotQuoteDepthMergedResponse :
type SpotQuoteDepthMergedResult ¶
type SpotQuoteDepthMergedResult struct {
Time int `json:"time"`
Bids SpotQuoteDepthBidsAsks `json:"bids"`
Asks SpotQuoteDepthBidsAsks `json:"asks"`
}
SpotQuoteDepthMergedResult :
type SpotQuoteDepthParam ¶
type SpotQuoteDepthParam struct {
Symbol SymbolSpot `url:"symbol"`
Limit *int `url:"limit,omitempty"`
}
SpotQuoteDepthParam :
type SpotQuoteDepthResponse ¶
type SpotQuoteDepthResponse struct {
CommonResponse `json:",inline"`
Result SpotQuoteDepthResult `json:"result"`
}
SpotQuoteDepthResponse :
type SpotQuoteDepthResult ¶
type SpotQuoteDepthResult struct {
Time int `json:"time"`
Bids SpotQuoteDepthBidsAsks `json:"bids"`
Asks SpotQuoteDepthBidsAsks `json:"asks"`
}
SpotQuoteDepthResult :
type SpotQuoteKline ¶
type SpotQuoteKline struct {
StartTime int
Open string
High string
Low string
Close string
Volume string
EndTime int
QuoteAssetVolume string
Trades int
TakerBaseVolume string
TakerQuoteVolume string
}
SpotQuoteKline :
type SpotQuoteKlineParam ¶
type SpotQuoteKlineParam struct {
Symbol SymbolSpot `url:"symbol"`
Interval Interval `url:"interval"`
Limit *int `url:"limit,omitempty"`
StartTime *int `url:"startTime,omitempty"`
EndTime *int `url:"endTime,omitempty"`
}
SpotQuoteKlineParam :
type SpotQuoteKlineResponse ¶
type SpotQuoteKlineResponse struct {
CommonResponse `json:",inline"`
Result []SpotQuoteKlineResult `json:"result"`
}
SpotQuoteKlineResponse :
type SpotQuoteKlineResult ¶
type SpotQuoteKlineResult struct {
SpotQuoteKline SpotQuoteKline
}
SpotQuoteKlineResult :
func (*SpotQuoteKlineResult) UnmarshalJSON ¶
func (r *SpotQuoteKlineResult) UnmarshalJSON(data []byte) error
UnmarshalJSON :
type SpotQuoteTicker24hrParam ¶
type SpotQuoteTicker24hrParam struct {
Symbol *SymbolSpot `url:"symbol,omitempty"`
}
SpotQuoteTicker24hrParam :
type SpotQuoteTicker24hrResponse ¶
type SpotQuoteTicker24hrResponse struct {
CommonResponse `json:",inline"`
Result SpotQuoteTicker24hrResult `json:"result"`
}
SpotQuoteTicker24hrResponse :
type SpotQuoteTicker24hrResult ¶
type SpotQuoteTicker24hrResult struct {
Time int `json:"time"`
Symbol string `json:"symbol"`
BestBidPrice string `json:"bestBidPrice"`
BestAskPrice string `json:"bestAskPrice"`
LastPrice string `json:"lastPrice"`
OpenPrice string `json:"openPrice"`
HighPrice string `json:"highPrice"`
LowPrice string `json:"lowPrice"`
Volume string `json:"volume"`
QuoteVolume string `json:"quoteVolume"`
}
SpotQuoteTicker24hrResult :
type SpotQuoteTickerBookTickerParam ¶
type SpotQuoteTickerBookTickerParam struct {
Symbol *SymbolSpot `url:"symbol,omitempty"`
}
SpotQuoteTickerBookTickerParam :
type SpotQuoteTickerBookTickerResponse ¶
type SpotQuoteTickerBookTickerResponse struct {
CommonResponse `json:",inline"`
Result SpotQuoteTickerBookTickerResult `json:"result"`
}
SpotQuoteTickerBookTickerResponse :
type SpotQuoteTickerBookTickerResult ¶
type SpotQuoteTickerBookTickerResult struct {
Symbol string `json:"symbol"`
BidPrice string `json:"bidPrice"`
BidQty string `json:"bidQty"`
AskPrice string `json:"askPrice"`
AskQty string `json:"askQty"`
Time int `json:"time"`
}
SpotQuoteTickerBookTickerResult :
type SpotQuoteTickerPriceParam ¶
type SpotQuoteTickerPriceParam struct {
Symbol *SymbolSpot `url:"symbol,omitempty"`
}
SpotQuoteTickerPriceParam :
type SpotQuoteTickerPriceResponse ¶
type SpotQuoteTickerPriceResponse struct {
CommonResponse `json:",inline"`
Result SpotQuoteTickerPriceResult `json:"result"`
}
SpotQuoteTickerPriceResponse :
type SpotQuoteTickerPriceResult ¶
type SpotQuoteTickerPriceResult struct {
Symbol string `json:"symbol"`
Price string `json:"price"`
}
SpotQuoteTickerPriceResult :
type SpotQuoteTradesParam ¶
type SpotQuoteTradesParam struct {
Symbol SymbolSpot `url:"symbol"`
Limit *int `url:"limit,omitempty"`
}
SpotQuoteTradesParam :
type SpotQuoteTradesResponse ¶
type SpotQuoteTradesResponse struct {
CommonResponse `json:",inline"`
Result []SpotQuoteTradesResult `json:"result"`
}
SpotQuoteTradesResponse :
type SpotQuoteTradesResult ¶
type SpotQuoteTradesResult struct {
Price string `json:"price"`
Time int `json:"time"`
Qty string `json:"qty"`
IsBuyerMaker bool `json:"isBuyerMaker"`
}
SpotQuoteTradesResult :
type SpotService ¶
type SpotService struct {
// contains filtered or unexported fields
}
SpotService :
type SpotServiceI ¶
type SpotServiceI interface {
V1() SpotV1ServiceI
V3() *SpotV3Service
}
SpotServiceI :
type SpotSymbolsResponse ¶
type SpotSymbolsResponse struct {
CommonResponse `json:",inline"`
Result []SpotSymbolsResult `json:"result"`
}
SpotSymbolsResponse :
type SpotSymbolsResult ¶
type SpotSymbolsResult struct {
Name string `json:"name"`
Alias string `json:"alias"`
BaseCurrency string `json:"baseCurrency"`
QuoteCurrency string `json:"quoteCurrency"`
BasePrecision string `json:"basePrecision"`
QuotePrecision string `json:"quotePrecision"`
MinTradeQuantity string `json:"minTradeQuantity"`
MinTradeAmount string `json:"minTradeAmount"`
MinPricePrecision string `json:"minPricePrecision"`
MaxTradeQuantity string `json:"maxTradeQuantity"`
MaxTradeAmount string `json:"maxTradeAmount"`
Category int `json:"category"`
}
SpotSymbolsResult :
type SpotV1Service ¶
type SpotV1Service struct {
// contains filtered or unexported fields
}
SpotV1Service :
func (*SpotV1Service) SpotDeleteOrder ¶
func (s *SpotV1Service) SpotDeleteOrder(param SpotDeleteOrderParam) (*SpotDeleteOrderResponse, error)
SpotDeleteOrder :
func (*SpotV1Service) SpotDeleteOrderFast ¶
func (s *SpotV1Service) SpotDeleteOrderFast(param SpotDeleteOrderFastParam) (*SpotDeleteOrderFastResponse, error)
SpotDeleteOrderFast :
func (*SpotV1Service) SpotGetOrder ¶
func (s *SpotV1Service) SpotGetOrder(param SpotGetOrderParam) (*SpotGetOrderResponse, error)
SpotGetOrder :
func (*SpotV1Service) SpotOrderBatchCancel ¶
func (s *SpotV1Service) SpotOrderBatchCancel(param SpotOrderBatchCancelParam) (*SpotOrderBatchCancelResponse, error)
func (*SpotV1Service) SpotOrderBatchCancelByIDs ¶
func (s *SpotV1Service) SpotOrderBatchCancelByIDs(orderIDs []string) (*SpotOrderBatchCancelByIDsResponse, error)
TODO : have bug multiple orderIds
func (*SpotV1Service) SpotOrderBatchFastCancel ¶
func (s *SpotV1Service) SpotOrderBatchFastCancel(param SpotOrderBatchFastCancelParam) (*SpotOrderBatchFastCancelResponse, error)
func (*SpotV1Service) SpotPostOrder ¶
func (s *SpotV1Service) SpotPostOrder(param SpotPostOrderParam) (*SpotPostOrderResponse, error)
SpotPostOrder :
func (*SpotV1Service) SpotQuoteDepth ¶
func (s *SpotV1Service) SpotQuoteDepth(param SpotQuoteDepthParam) (*SpotQuoteDepthResponse, error)
SpotQuoteDepth :
func (*SpotV1Service) SpotQuoteDepthMerged ¶
func (s *SpotV1Service) SpotQuoteDepthMerged(param SpotQuoteDepthMergedParam) (*SpotQuoteDepthMergedResponse, error)
SpotQuoteDepthMerged :
func (*SpotV1Service) SpotQuoteKline ¶
func (s *SpotV1Service) SpotQuoteKline(param SpotQuoteKlineParam) (*SpotQuoteKlineResponse, error)
SpotQuoteKline :
func (*SpotV1Service) SpotQuoteTicker24hr ¶
func (s *SpotV1Service) SpotQuoteTicker24hr(param SpotQuoteTicker24hrParam) (*SpotQuoteTicker24hrResponse, error)
SpotQuoteTicker24hr :
func (*SpotV1Service) SpotQuoteTickerBookTicker ¶
func (s *SpotV1Service) SpotQuoteTickerBookTicker(param SpotQuoteTickerBookTickerParam) (*SpotQuoteTickerBookTickerResponse, error)
SpotQuoteTickerBookTicker :
func (*SpotV1Service) SpotQuoteTickerPrice ¶
func (s *SpotV1Service) SpotQuoteTickerPrice(param SpotQuoteTickerPriceParam) (*SpotQuoteTickerPriceResponse, error)
SpotQuoteTickerPrice :
func (*SpotV1Service) SpotQuoteTrades ¶
func (s *SpotV1Service) SpotQuoteTrades(param SpotQuoteTradesParam) (*SpotQuoteTradesResponse, error)
SpotQuoteTrades :
func (*SpotV1Service) SpotSymbols ¶
func (s *SpotV1Service) SpotSymbols() (*SpotSymbolsResponse, error)
SpotSymbols :
type SpotV1ServiceI ¶
type SpotV1ServiceI interface {
// Market Data Endpoints
SpotSymbols() (*SpotSymbolsResponse, error)
SpotQuoteDepth(SpotQuoteDepthParam) (*SpotQuoteDepthResponse, error)
SpotQuoteDepthMerged(SpotQuoteDepthMergedParam) (*SpotQuoteDepthMergedResponse, error)
SpotQuoteTrades(SpotQuoteTradesParam) (*SpotQuoteTradesResponse, error)
SpotQuoteKline(SpotQuoteKlineParam) (*SpotQuoteKlineResponse, error)
SpotQuoteTicker24hr(SpotQuoteTicker24hrParam) (*SpotQuoteTicker24hrResponse, error)
SpotQuoteTickerPrice(SpotQuoteTickerPriceParam) (*SpotQuoteTickerPriceResponse, error)
SpotQuoteTickerBookTicker(SpotQuoteTickerBookTickerParam) (*SpotQuoteTickerBookTickerResponse, error)
// Account Data Endpoints
SpotPostOrder(SpotPostOrderParam) (*SpotPostOrderResponse, error)
SpotGetOrder(SpotGetOrderParam) (*SpotGetOrderResponse, error)
SpotDeleteOrder(SpotDeleteOrderParam) (*SpotDeleteOrderResponse, error)
SpotDeleteOrderFast(SpotDeleteOrderFastParam) (*SpotDeleteOrderFastResponse, error)
SpotOrderBatchCancel(SpotOrderBatchCancelParam) (*SpotOrderBatchCancelResponse, error)
SpotOrderBatchFastCancel(SpotOrderBatchFastCancelParam) (*SpotOrderBatchFastCancelResponse, error)
SpotOrderBatchCancelByIDs(orderIDs []string) (*SpotOrderBatchCancelByIDsResponse, error)
}
SpotV1ServiceI :
type SpotV3Service ¶
type SpotV3Service struct {
// contains filtered or unexported fields
}
SpotV3Service :
type SpotWebsocketService ¶
type SpotWebsocketService struct {
// contains filtered or unexported fields
}
SpotWebsocketService :
type SpotWebsocketV1PrivateEventType ¶
type SpotWebsocketV1PrivateEventType string
SpotWebsocketV1PrivateEventType :
type SpotWebsocketV1PrivateOutboundAccountInfoResponse ¶
type SpotWebsocketV1PrivateOutboundAccountInfoResponse struct {
Content SpotWebsocketV1PrivateOutboundAccountInfoResponseContent
}
SpotWebsocketV1PrivateOutboundAccountInfoResponse :
func (*SpotWebsocketV1PrivateOutboundAccountInfoResponse) MarshalJSON ¶
func (r *SpotWebsocketV1PrivateOutboundAccountInfoResponse) MarshalJSON() ([]byte, error)
MarshalJSON :
func (*SpotWebsocketV1PrivateOutboundAccountInfoResponse) UnmarshalJSON ¶
func (r *SpotWebsocketV1PrivateOutboundAccountInfoResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON :
type SpotWebsocketV1PrivateOutboundAccountInfoResponseContent ¶
type SpotWebsocketV1PrivateOutboundAccountInfoResponseContent struct {
EventType SpotWebsocketV1PrivateEventType `json:"e"`
Timestamp string `json:"E"`
AllowTrade bool `json:"T"`
AllowWithdraw bool `json:"W"`
AllowWDeposit bool `json:"D"`
WalletBalanceChanges []SpotWebsocketV1PrivateOutboundAccountInfoResponseWalletBalanceChange `json:"B"`
}
SpotWebsocketV1PrivateOutboundAccountInfoResponseContent :
type SpotWebsocketV1PrivateOutboundAccountInfoResponseWalletBalanceChange ¶
type SpotWebsocketV1PrivateOutboundAccountInfoResponseWalletBalanceChange struct {
SymbolName string `json:"a"`
AvailableBalance string `json:"f"`
ReservedBalance string `json:"l"`
}
SpotWebsocketV1PrivateOutboundAccountInfoResponseWalletBalanceChange :
type SpotWebsocketV1PrivateParamKey ¶
type SpotWebsocketV1PrivateParamKey struct {
EventType SpotWebsocketV1PrivateEventType
}
SpotWebsocketV1PrivateParamKey :
type SpotWebsocketV1PrivateService ¶
type SpotWebsocketV1PrivateService struct {
// contains filtered or unexported fields
}
SpotWebsocketV1PrivateService :
func (*SpotWebsocketV1PrivateService) Close ¶
func (s *SpotWebsocketV1PrivateService) Close() error
Close :
func (*SpotWebsocketV1PrivateService) Ping ¶
func (s *SpotWebsocketV1PrivateService) Ping() error
Ping :
func (*SpotWebsocketV1PrivateService) RegisterFuncOutboundAccountInfo ¶
func (s *SpotWebsocketV1PrivateService) RegisterFuncOutboundAccountInfo(f func(SpotWebsocketV1PrivateOutboundAccountInfoResponse) error) error
RegisterFuncOutboundAccountInfo :
func (*SpotWebsocketV1PrivateService) Run ¶
func (s *SpotWebsocketV1PrivateService) Run() error
Run :
func (*SpotWebsocketV1PrivateService) Start ¶
func (s *SpotWebsocketV1PrivateService) Start(ctx context.Context)
Start :
func (*SpotWebsocketV1PrivateService) Subscribe ¶
func (s *SpotWebsocketV1PrivateService) Subscribe() error
Subscribe :
type SpotWebsocketV1PublicV1Event ¶
type SpotWebsocketV1PublicV1Event string
SpotWebsocketV1PublicV1Event :
type SpotWebsocketV1PublicV1Service ¶
type SpotWebsocketV1PublicV1Service struct {
// contains filtered or unexported fields
}
SpotWebsocketV1PublicV1Service :
func (*SpotWebsocketV1PublicV1Service) Close ¶
func (s *SpotWebsocketV1PublicV1Service) Close() error
Close :
func (*SpotWebsocketV1PublicV1Service) Ping ¶
func (s *SpotWebsocketV1PublicV1Service) Ping() error
Ping :
func (*SpotWebsocketV1PublicV1Service) Run ¶
func (s *SpotWebsocketV1PublicV1Service) Run() error
Run :
func (*SpotWebsocketV1PublicV1Service) Start ¶
func (s *SpotWebsocketV1PublicV1Service) Start(ctx context.Context)
Start :
func (*SpotWebsocketV1PublicV1Service) SubscribeTrade ¶
func (s *SpotWebsocketV1PublicV1Service) SubscribeTrade(symbol SymbolSpot, f func(response SpotWebsocketV1PublicV1TradeResponse) error) (func() error, error)
SubscribeTrade :
type SpotWebsocketV1PublicV1Topic ¶
type SpotWebsocketV1PublicV1Topic string
SpotWebsocketV1PublicV1Topic :
type SpotWebsocketV1PublicV1TradeContent ¶
type SpotWebsocketV1PublicV1TradeContent struct {
TradeID string `json:"v"`
Timestamp int `json:"t"`
Price string `json:"p"`
Quantity string `json:"q"`
IsBuySideTaker bool `json:"m"`
}
SpotWebsocketV1PublicV1TradeContent :
type SpotWebsocketV1PublicV1TradeParam ¶
type SpotWebsocketV1PublicV1TradeParam struct {
Symbol SymbolSpot `json:"symbol"`
Topic SpotWebsocketV1PublicV1Topic `json:"topic"`
Event SpotWebsocketV1PublicV1Event `json:"event"`
Params SpotWebsocketV1PublicV1TradeParamChild `json:"params"`
}
SpotWebsocketV1PublicV1TradeParam :
type SpotWebsocketV1PublicV1TradeParamChild ¶
type SpotWebsocketV1PublicV1TradeParamChild struct {
Binary bool `json:"binary"`
}
SpotWebsocketV1PublicV1TradeParamChild :
type SpotWebsocketV1PublicV1TradeParamKey ¶
type SpotWebsocketV1PublicV1TradeParamKey struct {
Symbol SymbolSpot
Topic SpotWebsocketV1PublicV1Topic
}
SpotWebsocketV1PublicV1TradeParamKey :
type SpotWebsocketV1PublicV1TradeResponse ¶
type SpotWebsocketV1PublicV1TradeResponse struct {
Symbol SymbolSpot `json:"symbol"`
SymbolName string `json:"symbolName"`
Topic SpotWebsocketV1PublicV1Topic `json:"topic"`
SendTime int `json:"sendTime"`
IsFirstMessage bool `json:"f"`
Params SpotWebsocketV1PublicV1TradeResponseParams `json:"params"`
Data []SpotWebsocketV1PublicV1TradeContent `json:"data"`
}
SpotWebsocketV1PublicV1TradeResponse :
type SpotWebsocketV1PublicV1TradeResponseParams ¶
type SpotWebsocketV1PublicV1TradeResponseParams struct {
RealtimeInterval string `json:"realtimeInterval"`
Binary string `json:"binary"`
}
SpotWebsocketV1PublicV1TradeResponseParams :
type SpotWebsocketV1PublicV2Event ¶
type SpotWebsocketV1PublicV2Event string
SpotWebsocketV1PublicV2Event :
type SpotWebsocketV1PublicV2Service ¶
type SpotWebsocketV1PublicV2Service struct {
// contains filtered or unexported fields
}
SpotWebsocketV1PublicV2Service :
func (*SpotWebsocketV1PublicV2Service) Close ¶
func (s *SpotWebsocketV1PublicV2Service) Close() error
Close :
func (*SpotWebsocketV1PublicV2Service) Ping ¶
func (s *SpotWebsocketV1PublicV2Service) Ping() error
Ping :
func (*SpotWebsocketV1PublicV2Service) Run ¶
func (s *SpotWebsocketV1PublicV2Service) Run() error
Run :
func (*SpotWebsocketV1PublicV2Service) Start ¶
func (s *SpotWebsocketV1PublicV2Service) Start(ctx context.Context)
Start :
func (*SpotWebsocketV1PublicV2Service) SubscribeTrade ¶
func (s *SpotWebsocketV1PublicV2Service) SubscribeTrade(symbol SymbolSpot, f func(response SpotWebsocketV1PublicV2TradeResponse) error) (func() error, error)
SubscribeTrade :
type SpotWebsocketV1PublicV2Topic ¶
type SpotWebsocketV1PublicV2Topic string
SpotWebsocketV1PublicV2Topic :
type SpotWebsocketV1PublicV2TradeContent ¶
type SpotWebsocketV1PublicV2TradeContent struct {
TradeID string `json:"v"`
Timestamp int `json:"t"`
Price string `json:"p"`
Quantity string `json:"q"`
IsBuySideTaker bool `json:"m"`
}
SpotWebsocketV1PublicV2TradeContent :
type SpotWebsocketV1PublicV2TradeParam ¶
type SpotWebsocketV1PublicV2TradeParam struct {
Topic SpotWebsocketV1PublicV2Topic `json:"topic"`
Event SpotWebsocketV1PublicV2Event `json:"event"`
Params SpotWebsocketV1PublicV2TradeParamChild `json:"params"`
}
SpotWebsocketV1PublicV2TradeParam :
type SpotWebsocketV1PublicV2TradeParamChild ¶
type SpotWebsocketV1PublicV2TradeParamChild struct {
Symbol SymbolSpot `json:"symbol"`
Binary bool `json:"binary"`
}
SpotWebsocketV1PublicV2TradeParamChild :
type SpotWebsocketV1PublicV2TradeParamKey ¶
type SpotWebsocketV1PublicV2TradeParamKey struct {
Symbol SymbolSpot
Topic SpotWebsocketV1PublicV2Topic
}
SpotWebsocketV1PublicV2TradeParamKey :
type SpotWebsocketV1PublicV2TradeResponse ¶
type SpotWebsocketV1PublicV2TradeResponse struct {
Topic SpotWebsocketV1PublicV2Topic `json:"topic"`
Params SpotWebsocketV1PublicV2TradeResponseParams `json:"params"`
Data SpotWebsocketV1PublicV2TradeContent `json:"data"`
}
SpotWebsocketV1PublicV2TradeResponse :
type SpotWebsocketV1PublicV2TradeResponseParams ¶
type SpotWebsocketV1PublicV2TradeResponseParams struct {
Symbol SymbolSpot `json:"symbol"`
SymbolName string `json:"symbolName"`
Binary string `json:"binary"`
}
SpotWebsocketV1PublicV2TradeResponseParams :
type SpotWebsocketV1Service ¶
type SpotWebsocketV1Service struct {
// contains filtered or unexported fields
}
SpotWebsocketV1Service :
func (*SpotWebsocketV1Service) Private ¶
func (s *SpotWebsocketV1Service) Private() (*SpotWebsocketV1PrivateService, error)
Private :
func (*SpotWebsocketV1Service) PublicV1 ¶
func (s *SpotWebsocketV1Service) PublicV1() (*SpotWebsocketV1PublicV1Service, error)
PublicV1 :
func (*SpotWebsocketV1Service) PublicV2 ¶
func (s *SpotWebsocketV1Service) PublicV2() (*SpotWebsocketV1PublicV2Service, error)
PublicV2 :
type SymbolsResponse ¶
type SymbolsResponse struct {
CommonResponse `json:",inline"`
Result []SymbolsResult `json:"result"`
}
SymbolsResponse :
type SymbolsResult ¶
type SymbolsResult struct {
Name string `json:"name"`
BaseCurrency string `json:"base_currency"`
QuoteCurrency string `json:"quote_currency"`
PriceScale float64 `json:"price_scale"`
TakerFee string `json:"taker_fee"`
MakerFee string `json:"maker_fee"`
LeverageFilter LeverageFilter `json:"leverage_filter"`
PriceFilter PriceFilter `json:"price_filter"`
LotSizeFilter LotSizeFilter `json:"lot_size_filter"`
}
SymbolsResult :
type TestClient ¶
type TestClient struct {
*Client
}
TestClient :
func (*TestClient) WithAuthFromEnv ¶
func (c *TestClient) WithAuthFromEnv() *TestClient
WithAuthFromEnv :
func (*TestClient) WithBaseURL ¶
func (c *TestClient) WithBaseURL(url string) *TestClient
WithBaseURL :
type TestWebSocketClient ¶
type TestWebSocketClient struct {
*WebSocketClient
}
TestWebSocketClient :
func NewTestWebsocketClient ¶
func NewTestWebsocketClient() *TestWebSocketClient
NewTestWebsocketClient :
func (*TestWebSocketClient) WithAuthFromEnv ¶
func (c *TestWebSocketClient) WithAuthFromEnv() *TestWebSocketClient
WithAuthFromEnv :
func (*TestWebSocketClient) WithBaseURL ¶
func (c *TestWebSocketClient) WithBaseURL(url string) *TestWebSocketClient
WithBaseURL :
type TickersResponse ¶
type TickersResponse struct {
CommonResponse `json:",inline"`
Result []TickersResult `json:"result"`
}
TickersResponse :
type TickersResult ¶
type TickersResult struct {
Symbol SymbolInverse `json:"symbol"`
BidPrice string `json:"bid_price"`
AskPrice string `json:"ask_price"`
LastPrice string `json:"last_price"`
LastTickDirection TickDirection `json:"last_tick_direction"`
PrevPrice24h string `json:"prev_price_24h"`
Price24hPcnt string `json:"price_24h_pcnt"`
HighPrice24h string `json:"high_price_24h"`
LowPrice24h string `json:"low_price_24h"`
PrevPrice1h string `json:"prev_price_1h"`
Price1hPcnt string `json:"price_1h_pcnt"`
MarkPrice string `json:"mark_price"`
IndexPrice string `json:"index_price"`
OpenInterest float64 `json:"open_interest"`
OpenValue string `json:"open_value"`
TotalTurnover string `json:"total_turnover"`
Turnover24h string `json:"turnover_24h"`
TotalVolume float64 `json:"total_volume"`
Volume24h float64 `json:"volume_24h"`
FundingRate string `json:"funding_rate"`
PredictedFundingRate string `json:"predicted_funding_rate"`
NextFundingTime string `json:"next_funding_time"`
CountdownHour float64 `json:"countdown_hour"`
}
TickersResult :
type TradingRecordsParam ¶
type TradingRecordsParam struct {
Symbol SymbolInverse `url:"symbol"`
From *int `url:"from,omitempty"`
Limit *int `url:"limit,omitempty"`
}
TradingRecordsParam :
type TradingRecordsResponse ¶
type TradingRecordsResponse struct {
CommonResponse `json:",inline"`
Result []TradingRecordsResult `json:"result"`
}
TradingRecordsResponse :
type TradingRecordsResult ¶
type TradingRecordsResult struct {
ID float64 `json:"id"`
Symbol SymbolInverse `json:"symbol"`
Price float64 `json:"price"`
Qty float64 `json:"qty"`
Side Side `json:"side"`
Time string `json:"time"`
}
TradingRecordsResult :
type USDCContractOptionService ¶
type USDCContractOptionService struct {
// contains filtered or unexported fields
}
USDCContractOptionService :
type USDCContractPerpetualService ¶
type USDCContractPerpetualService struct {
// contains filtered or unexported fields
}
USDCContractPerpetualService :
type USDCContractService ¶
type USDCContractService struct {
// contains filtered or unexported fields
}
USDCContractService :
func (*USDCContractService) Option ¶
func (s *USDCContractService) Option() *USDCContractOptionService
Option :
func (*USDCContractService) Perpetual ¶
func (s *USDCContractService) Perpetual() *USDCContractPerpetualService
Perpetual :
type USDCContractServiceI ¶
type USDCContractServiceI interface {
Option() *USDCContractOptionService
Perpetual() *USDCContractPerpetualService
}
USDCContractServiceI :
type WebSocketClient ¶
type WebSocketClient struct {
// contains filtered or unexported fields
}
WebSocketClient :
func (*WebSocketClient) Start ¶
func (c *WebSocketClient) Start(ctx context.Context, executors []WebsocketExecutor)
Start :
func (*WebSocketClient) WithAuth ¶
func (c *WebSocketClient) WithAuth(key string, secret string) *WebSocketClient
WithAuth :
type WebsocketExecutor ¶
WebsocketExecutor :
Source Files
¶
- account_asset.go
- client.go
- client_service.go
- client_web_socket.go
- copy_trading.go
- derivative.go
- enum.go
- future_common.go
- future_inverse_future.go
- future_inverse_perpetual.go
- future_usdt_perpetual.go
- response.go
- spot_v1.go
- spot_v3.go
- testclient.go
- testclient_websocket.go
- usdc_contract_option.go
- usdc_contract_perpetual.go
- ws_error.go
- ws_spot_v1.go
- ws_spot_v1_private.go
- ws_spot_v1_public_v1.go
- ws_spot_v1_public_v2.go