Documentation ¶
Index ¶
- Constants
- Variables
- func FormatTimestamp(t time.Time) int64
- func GetCurrentTime() int64
- func PrettyPrint(i interface{}) string
- type AccountClient
- func (s *AccountClient) GetAccountInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AccountClient) GetAccountWallet(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AccountClient) GetBorrowHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AccountClient) GetCoinGreeks(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AccountClient) GetCollateralInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AccountClient) GetFeeRates(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AccountClient) GetMMPState(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AccountClient) GetTransactionLog(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AccountClient) ResetMarketMakerProtection(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AccountClient) SetCollateralCoin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AccountClient) SetMarginMode(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AccountClient) SetMarketMakerProtection(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AccountClient) SetSpotHedgeMode(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AccountClient) UpgradeToUTA(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- type AssetClient
- func (s *AssetClient) CancelWithdrawAsset(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AssetClient) CreateInternalTransfer(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AssetClient) CreateUniversalTransfer(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AssetClient) GetAllCoinsBalance(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AssetClient) GetAllowedDepositCoin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AssetClient) GetAssetInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AssetClient) GetAssetOrderRecord(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AssetClient) GetCoinInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AssetClient) GetDeliveryRecord(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AssetClient) GetDepositRecords(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AssetClient) GetInternalDepositRecords(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AssetClient) GetInternalTransfer(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AssetClient) GetMasterDepositAddress(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AssetClient) GetSingleCoinsBalance(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AssetClient) GetSubDepositAddress(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AssetClient) GetSubDepositRecords(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AssetClient) GetSubUids(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AssetClient) GetTransferableCoin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AssetClient) GetUniversalTransfer(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AssetClient) GetUsdcSettlement(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AssetClient) GetWithdrawalAmount(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AssetClient) GetWithdrawalRecords(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AssetClient) SetDepositAccount(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *AssetClient) WithdrawAsset(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- type BrokerServiceClient
- type Client
- func (c *Client) NewAccountService(params map[string]interface{}) *AccountClient
- func (c *Client) NewAccountServiceNoParams() *AccountClient
- func (c *Client) NewAssetService(params map[string]interface{}) *AssetClient
- func (c *Client) NewBrokerService(params map[string]interface{}) *BrokerServiceClient
- func (c *Client) NewFundingTatesService() *MarketFundingRatesService
- func (c *Client) NewGetDeliveryPriceService() *GetDeliveryPriceService
- func (c *Client) NewGetHistoricalVolatilityService() *GetHistoricalVolatilityService
- func (c *Client) NewGetInsuranceInfoService() *GetInsuranceInfoService
- func (c *Client) NewGetMarketLSRatioService() *GetMarketLSRatioService
- func (c *Client) NewGetOpenInterestsService() *GetOpenInterestsService
- func (c *Client) NewGetPublicRecentTradesService() *GetPublicRecentTradesService
- func (c *Client) NewGetRiskLimitService() *GetRiskLimitService
- func (c *Client) NewGetServerTimeService() *GetServerTimeService
- func (c *Client) NewInstrumentsInfoService() *InstrumentsInfoService
- func (c *Client) NewLendingService(params map[string]interface{}) *LendingServiceClient
- func (c *Client) NewLendingServiceNoParams() *LendingServiceClient
- func (c *Client) NewMarketIndexPriceKlineService() *MarketIndexPriceKlineService
- func (c *Client) NewMarketKlineService() *MarketKlinesService
- func (c *Client) NewMarketMarkPriceKlineService() *MarketMarkPriceKlineService
- func (c *Client) NewMarketPremiumIndexPriceKlineService() *MarketPremiumIndexPriceKlineService
- func (c *Client) NewOrderBookService() *MarketOrderBookService
- func (c *Client) NewPlaceOrderService(category, symbol, side, orderType, qty string) *Order
- func (c *Client) NewPositionService(params map[string]interface{}) *PositionClient
- func (c *Client) NewPreUpgradeService(params map[string]interface{}) *PreUpgradeClient
- func (c *Client) NewSpotLeverageService(params map[string]interface{}) *SpotLeverageClient
- func (c *Client) NewSpotMarginDataService(params map[string]interface{}, isUta bool) *SpotMarginClient
- func (c *Client) NewTickersService() *MarketTickersService
- func (c *Client) NewTradeService(params map[string]interface{}) *TradeClient
- func (c *Client) NewUserService(params map[string]interface{}) *UserServiceClient
- func (c *Client) NewUserServiceNoParams() *UserServiceClient
- type ClientOption
- type GetDeliveryPriceResponse
- type GetDeliveryPriceService
- func (s *GetDeliveryPriceService) BaseCoin(baseCoin string) *GetDeliveryPriceService
- func (s *GetDeliveryPriceService) Category(category models.Category) *GetDeliveryPriceService
- func (s *GetDeliveryPriceService) Cursor(cursor string) *GetDeliveryPriceService
- func (s *GetDeliveryPriceService) Do(ctx context.Context, opts ...RequestOption) (res *models.DeliveryPriceInfo, err error)
- func (s *GetDeliveryPriceService) Limit(limit int) *GetDeliveryPriceService
- func (s *GetDeliveryPriceService) Symbol(symbol string) *GetDeliveryPriceService
- type GetHistoricalVolatilityService
- func (s *GetHistoricalVolatilityService) BaseCoin(baseCoin string) *GetHistoricalVolatilityService
- func (s *GetHistoricalVolatilityService) Category(category models.Category) *GetHistoricalVolatilityService
- func (s *GetHistoricalVolatilityService) Do(ctx context.Context, opts ...RequestOption) (res *models.HistoricalVolatilityInfo, err error)
- func (s *GetHistoricalVolatilityService) EndTime(endTime uint64) *GetHistoricalVolatilityService
- func (s *GetHistoricalVolatilityService) Period(period string) *GetHistoricalVolatilityService
- func (s *GetHistoricalVolatilityService) StartTime(startTime uint64) *GetHistoricalVolatilityService
- type GetInsuranceInfoResponse
- type GetInsuranceInfoService
- type GetMarketLSRatioResponse
- type GetMarketLSRatioService
- func (s *GetMarketLSRatioService) BaseCoin(baseCoin string) *GetMarketLSRatioService
- func (s *GetMarketLSRatioService) Category(category models.Category) *GetMarketLSRatioService
- func (s *GetMarketLSRatioService) Do(ctx context.Context, opts ...RequestOption) (res *models.MarketLongShortRatioInfo, err error)
- func (s *GetMarketLSRatioService) Limit(limit int) *GetMarketLSRatioService
- func (s *GetMarketLSRatioService) Period(period string) *GetMarketLSRatioService
- type GetOpenInterestsResponse
- type GetOpenInterestsService
- func (s *GetOpenInterestsService) Category(category models.Category) *GetOpenInterestsService
- func (s *GetOpenInterestsService) Cursor(cursor string) *GetOpenInterestsService
- func (s *GetOpenInterestsService) Do(ctx context.Context, opts ...RequestOption) (res *models.OpenInterestInfo, err error)
- func (s *GetOpenInterestsService) EndTime(endTime uint64) *GetOpenInterestsService
- func (s *GetOpenInterestsService) IntervalTime(intervalTime string) *GetOpenInterestsService
- func (s *GetOpenInterestsService) Limit(limit int) *GetOpenInterestsService
- func (s *GetOpenInterestsService) StartTime(startTime uint64) *GetOpenInterestsService
- func (s *GetOpenInterestsService) Symbol(symbol string) *GetOpenInterestsService
- type GetPublicRecentTradesResponse
- type GetPublicRecentTradesService
- func (s *GetPublicRecentTradesService) BaseCoin(baseCoin string) *GetPublicRecentTradesService
- func (s *GetPublicRecentTradesService) Category(category models.Category) *GetPublicRecentTradesService
- func (s *GetPublicRecentTradesService) Do(ctx context.Context, opts ...RequestOption) (res *models.PublicRecentTradeHistory, err error)
- func (s *GetPublicRecentTradesService) Limit(limit int) *GetPublicRecentTradesService
- func (s *GetPublicRecentTradesService) OptionType(optionType string) *GetPublicRecentTradesService
- func (s *GetPublicRecentTradesService) Symbol(symbol string) *GetPublicRecentTradesService
- type GetRiskLimitResponse
- type GetRiskLimitService
- type GetServerTimeResponse
- type GetServerTimeService
- type InstrumentsInfoService
- func (s *InstrumentsInfoService) BaseCoin(baseCoin string) *InstrumentsInfoService
- func (s *InstrumentsInfoService) Category(category models.Category) *InstrumentsInfoService
- func (s *InstrumentsInfoService) Cursor(cursor string) *InstrumentsInfoService
- func (s *InstrumentsInfoService) Do(ctx context.Context, opts ...RequestOption) (res *models.InstrumentInfoResponse, err error)
- func (s *InstrumentsInfoService) Limit(limit int) *InstrumentsInfoService
- func (s *InstrumentsInfoService) Status(status models.SymbolStatus) *InstrumentsInfoService
- func (s *InstrumentsInfoService) Symbol(symbol string) *InstrumentsInfoService
- type LendingServiceClient
- func (s *LendingServiceClient) C2cCancelRedeemFunds(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *LendingServiceClient) C2cDepositFunds(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *LendingServiceClient) C2cRedeemFunds(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *LendingServiceClient) GetC2cLendingAccountInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *LendingServiceClient) GetC2cLendingCoinInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *LendingServiceClient) GetC2cLendingOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *LendingServiceClient) GetInsLoanInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *LendingServiceClient) GetInsLoanOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *LendingServiceClient) GetInsLoanToValue(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *LendingServiceClient) GetInsMarginCoinInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *LendingServiceClient) GetInsRepayOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- type MarketFundingRatesResponse
- type MarketFundingRatesService
- func (s *MarketFundingRatesService) Category(category models.Category) *MarketFundingRatesService
- func (s *MarketFundingRatesService) Do(ctx context.Context, opts ...RequestOption) (res *models.FundingRate, err error)
- func (s *MarketFundingRatesService) EndTime(endTime uint64) *MarketFundingRatesService
- func (s *MarketFundingRatesService) Limit(limit int) *MarketFundingRatesService
- func (s *MarketFundingRatesService) StartTime(startTime uint64) *MarketFundingRatesService
- func (s *MarketFundingRatesService) Symbol(symbol string) *MarketFundingRatesService
- type MarketIndexPriceKlineService
- func (s *MarketIndexPriceKlineService) Category(category models.Category) *MarketIndexPriceKlineService
- func (s *MarketIndexPriceKlineService) Do(ctx context.Context, opts ...RequestOption) (res *models.MarketIndexPriceKlineResponse, err error)
- func (s *MarketIndexPriceKlineService) End(endTime uint64) *MarketIndexPriceKlineService
- func (s *MarketIndexPriceKlineService) Interval(interval string) *MarketIndexPriceKlineService
- func (s *MarketIndexPriceKlineService) Limit(limit int) *MarketIndexPriceKlineService
- func (s *MarketIndexPriceKlineService) Start(startTime uint64) *MarketIndexPriceKlineService
- func (s *MarketIndexPriceKlineService) Symbol(symbol string) *MarketIndexPriceKlineService
- type MarketKlinesService
- func (s *MarketKlinesService) Category(category models.Category) *MarketKlinesService
- func (s *MarketKlinesService) Do(ctx context.Context, opts ...RequestOption) (res *models.MarketKlineResponse, err error)
- func (s *MarketKlinesService) End(endTime uint64) *MarketKlinesService
- func (s *MarketKlinesService) Interval(interval string) *MarketKlinesService
- func (s *MarketKlinesService) Limit(limit int) *MarketKlinesService
- func (s *MarketKlinesService) Start(startTime uint64) *MarketKlinesService
- func (s *MarketKlinesService) Symbol(symbol string) *MarketKlinesService
- type MarketMarkPriceKlineService
- func (s *MarketMarkPriceKlineService) Category(category models.Category) *MarketMarkPriceKlineService
- func (s *MarketMarkPriceKlineService) Do(ctx context.Context, opts ...RequestOption) (res *models.MarketMarkPriceKlineResponse, err error)
- func (s *MarketMarkPriceKlineService) End(endTime uint64) *MarketMarkPriceKlineService
- func (s *MarketMarkPriceKlineService) Interval(interval string) *MarketMarkPriceKlineService
- func (s *MarketMarkPriceKlineService) Limit(limit int) *MarketMarkPriceKlineService
- func (s *MarketMarkPriceKlineService) Start(startTime uint64) *MarketMarkPriceKlineService
- func (s *MarketMarkPriceKlineService) Symbol(symbol string) *MarketMarkPriceKlineService
- type MarketOrderBookResponse
- type MarketOrderBookService
- func (s *MarketOrderBookService) Category(category models.Category) *MarketOrderBookService
- func (s *MarketOrderBookService) Do(ctx context.Context, opts ...RequestOption) (res *models.OrderBookInfo, err error)
- func (s *MarketOrderBookService) Limit(limit int) *MarketOrderBookService
- func (s *MarketOrderBookService) Symbol(symbol string) *MarketOrderBookService
- type MarketPremiumIndexPriceKlineService
- func (s *MarketPremiumIndexPriceKlineService) Category(category models.Category) *MarketPremiumIndexPriceKlineService
- func (s *MarketPremiumIndexPriceKlineService) Do(ctx context.Context, opts ...RequestOption) (res *models.MarketPremiumIndexPriceKlineResponse, err error)
- func (s *MarketPremiumIndexPriceKlineService) End(endTime uint64) *MarketPremiumIndexPriceKlineService
- func (s *MarketPremiumIndexPriceKlineService) Interval(interval string) *MarketPremiumIndexPriceKlineService
- func (s *MarketPremiumIndexPriceKlineService) Limit(limit int) *MarketPremiumIndexPriceKlineService
- func (s *MarketPremiumIndexPriceKlineService) Start(startTime uint64) *MarketPremiumIndexPriceKlineService
- func (s *MarketPremiumIndexPriceKlineService) Symbol(symbol string) *MarketPremiumIndexPriceKlineService
- type MarketTickersResponse
- type MarketTickersService
- func (s *MarketTickersService) BaseCoin(baseCoin string) *MarketTickersService
- func (s *MarketTickersService) Category(category models.Category) *MarketTickersService
- func (s *MarketTickersService) Do(ctx context.Context, opts ...RequestOption) (res *models.MarketTickers, err error)
- func (s *MarketTickersService) ExpDate(expDate string) *MarketTickersService
- func (s *MarketTickersService) Symbol(symbol string) *MarketTickersService
- type MessageHandler
- type Order
- func (order *Order) CloseOnTrigger(close bool) *Order
- func (order *Order) Do(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (order *Order) IsLeverage(isLeverage int) *Order
- func (order *Order) Mmp(mmp bool) *Order
- func (order *Order) OrderFilter(filter string) *Order
- func (order *Order) OrderIv(iv string) *Order
- func (order *Order) OrderLinkId(orderLinkId string) *Order
- func (order *Order) PositionIdx(idx int) *Order
- func (order *Order) Price(price string) *Order
- func (order *Order) ReduceOnly(reduce bool) *Order
- func (order *Order) SlLimitPrice(price string) *Order
- func (order *Order) SlOrderType(orderType string) *Order
- func (order *Order) SlTriggerBy(triggerBy string) *Order
- func (order *Order) SmpType(smp string) *Order
- func (order *Order) StopLoss(loss string) *Order
- func (order *Order) TakeProfit(profit string) *Order
- func (order *Order) TimeInForce(tif string) *Order
- func (order *Order) TpLimitPrice(price string) *Order
- func (order *Order) TpOrderType(orderType string) *Order
- func (order *Order) TpTriggerBy(triggerBy string) *Order
- func (order *Order) TpslMode(mode string) *Order
- func (order *Order) TriggerBy(triggerBy string) *Order
- func (order *Order) TriggerDirection(direction int) *Order
- func (order *Order) TriggerPrice(triggerPrice string) *Order
- type PositionClient
- func (s *PositionClient) ConfirmPositionRiskLimit(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *PositionClient) GetClosePnl(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *PositionClient) GetExecutionList(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *PositionClient) GetPositionList(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *PositionClient) SetPositionAutoMargin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *PositionClient) SetPositionLeverage(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *PositionClient) SetPositionRiskLimit(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *PositionClient) SetPositionTpslMode(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *PositionClient) SetPositionTradingStop(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *PositionClient) SwitchPositionMargin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *PositionClient) SwitchPositionMode(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *PositionClient) UpdatePositionMargin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- type PreUpgradeClient
- func (s *PreUpgradeClient) GetPreUpgradeClosedPnl(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *PreUpgradeClient) GetPreUpgradeExecutionList(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *PreUpgradeClient) GetPreUpgradeOptionDeliveryRecord(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *PreUpgradeClient) GetPreUpgradeOrderHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *PreUpgradeClient) GetPreUpgradeTransactionLog(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *PreUpgradeClient) GetPreUpgradeUsdcSettlement(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- type RequestOption
- type ServerResponse
- type SpotLeverageClient
- func (s *SpotLeverageClient) GetLeverageTokenInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *SpotLeverageClient) GetLeverageTokenMarket(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *SpotLeverageClient) GetLeverageTokenOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *SpotLeverageClient) PurchaseLeverageToken(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *SpotLeverageClient) RedeemLeverageToken(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- type SpotMarginClient
- func (s *SpotMarginClient) BorrowSpotMarginLoan(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *SpotMarginClient) GetSpotMarginBorrowCoin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *SpotMarginClient) GetSpotMarginBorrowOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *SpotMarginClient) GetSpotMarginCoin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *SpotMarginClient) GetSpotMarginData(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *SpotMarginClient) GetSpotMarginInterests(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *SpotMarginClient) GetSpotMarginLoanAccountInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *SpotMarginClient) GetSpotMarginRepaymentOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *SpotMarginClient) GetSpotMarginState(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *SpotMarginClient) RepaySpotMarginLoan(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *SpotMarginClient) SetSpotMarginLeverage(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *SpotMarginClient) ToggleSpotMarginTrade(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- type TradeClient
- func (s *TradeClient) AmendBatchOrder(ctx context.Context, opts ...RequestOption) (res *models.BatchOrderServerResponse, err error)
- func (s *TradeClient) AmendOrder(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *TradeClient) CancelAllOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *TradeClient) CancelBatchOrder(ctx context.Context, opts ...RequestOption) (res *models.BatchOrderServerResponse, err error)
- func (s *TradeClient) CancelOrder(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *TradeClient) GetOpenOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *TradeClient) GetOrderHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *TradeClient) GetSpotBorrowQuota(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *TradeClient) PlaceBatchOrder(ctx context.Context, opts ...RequestOption) (res *models.BatchOrderServerResponse, err error)
- func (s *TradeClient) PlaceOrder(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *TradeClient) SetDisconnectCancelAll(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- type UserServiceClient
- func (s *UserServiceClient) CreateSubApiKey(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *UserServiceClient) CreateSubMember(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *UserServiceClient) DeleteMasterAPIKey(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *UserServiceClient) DeleteSubAPIKey(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *UserServiceClient) DeleteSubUID(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *UserServiceClient) FreezeSubUID(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *UserServiceClient) GetAPIKeyInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *UserServiceClient) GetAffiliateUserInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *UserServiceClient) GetSubUidList(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *UserServiceClient) GetUidWalletType(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *UserServiceClient) ModifyMasterAPIKey(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *UserServiceClient) ModifySubAPIKey(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- type WebSocket
- type WebsocketOption
Constants ¶
const ( Name = "bybit.api.go" Version = "1.0.2" // Https MAINNET = "https://api.bybit.com" MAINNET_BACKT = "https://api.bytick.com" TESTNET = "https://api-testnet.bybit.com" // WebSocket public channel - Mainnet SPOT_MAINNET = "wss://stream.bybit.com/v5/public/spot" LINEAR_MAINNET = "wss://stream.bybit.com/v5/public/linear" INVERSE_MAINNET = "wss://stream.bybit.com/v5/public/inverse" OPTION_MAINNET = "wss://stream.bybit.com/v5/public/option" // WebSocket public channel - Testnet SPOT_TESTNET = "wss://stream-testnet.bybit.com/v5/public/spot" LINEAR_TESTNET = "wss://stream-testnet.bybit.com/v5/public/linear" INVERSE_TESTNET = "wss://stream-testnet.bybit.com/v5/public/inverse" OPTION_TESTNET = "wss://stream-testnet.bybit.com/v5/public/option" // WebSocket private channel WEBSOCKET_PRIVATE_MAINNET = "wss://stream.bybit.com/v5/private" WEBSOCKET_PRIVATE_TESTNET = "wss://stream-testnet.bybit.com/v5/private" // V3 V3_CONTRACT_PRIVATE = "wss://stream.bybit.com/contract/private/v3" V3_UNIFIED_PRIVATE = "wss://stream.bybit.com/unified/private/v3" V3_SPOT_PRIVATE = "wss://stream.bybit.com/spot/private/v3" )
Variables ¶
var ErrPingFailed = errors.New("failed to send ping")
Functions ¶
func FormatTimestamp ¶
FormatTimestamp formats a time into Unix timestamp in milliseconds, as requested by Binance.
func GetCurrentTime ¶
func GetCurrentTime() int64
func PrettyPrint ¶
func PrettyPrint(i interface{}) string
Types ¶
type AccountClient ¶
type AccountClient struct {
// contains filtered or unexported fields
}
func (*AccountClient) GetAccountInfo ¶
func (s *AccountClient) GetAccountInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AccountClient) GetAccountWallet ¶
func (s *AccountClient) GetAccountWallet(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AccountClient) GetBorrowHistory ¶
func (s *AccountClient) GetBorrowHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AccountClient) GetCoinGreeks ¶
func (s *AccountClient) GetCoinGreeks(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AccountClient) GetCollateralInfo ¶
func (s *AccountClient) GetCollateralInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AccountClient) GetFeeRates ¶
func (s *AccountClient) GetFeeRates(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AccountClient) GetMMPState ¶
func (s *AccountClient) GetMMPState(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AccountClient) GetTransactionLog ¶
func (s *AccountClient) GetTransactionLog(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AccountClient) ResetMarketMakerProtection ¶
func (s *AccountClient) ResetMarketMakerProtection(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AccountClient) SetCollateralCoin ¶
func (s *AccountClient) SetCollateralCoin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AccountClient) SetMarginMode ¶
func (s *AccountClient) SetMarginMode(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AccountClient) SetMarketMakerProtection ¶
func (s *AccountClient) SetMarketMakerProtection(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AccountClient) SetSpotHedgeMode ¶
func (s *AccountClient) SetSpotHedgeMode(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AccountClient) UpgradeToUTA ¶
func (s *AccountClient) UpgradeToUTA(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
type AssetClient ¶
type AssetClient struct {
// contains filtered or unexported fields
}
func (*AssetClient) CancelWithdrawAsset ¶
func (s *AssetClient) CancelWithdrawAsset(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AssetClient) CreateInternalTransfer ¶
func (s *AssetClient) CreateInternalTransfer(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AssetClient) CreateUniversalTransfer ¶
func (s *AssetClient) CreateUniversalTransfer(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AssetClient) GetAllCoinsBalance ¶
func (s *AssetClient) GetAllCoinsBalance(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AssetClient) GetAllowedDepositCoin ¶
func (s *AssetClient) GetAllowedDepositCoin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AssetClient) GetAssetInfo ¶
func (s *AssetClient) GetAssetInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AssetClient) GetAssetOrderRecord ¶
func (s *AssetClient) GetAssetOrderRecord(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AssetClient) GetCoinInfo ¶
func (s *AssetClient) GetCoinInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AssetClient) GetDeliveryRecord ¶
func (s *AssetClient) GetDeliveryRecord(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AssetClient) GetDepositRecords ¶
func (s *AssetClient) GetDepositRecords(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AssetClient) GetInternalDepositRecords ¶
func (s *AssetClient) GetInternalDepositRecords(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AssetClient) GetInternalTransfer ¶
func (s *AssetClient) GetInternalTransfer(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AssetClient) GetMasterDepositAddress ¶
func (s *AssetClient) GetMasterDepositAddress(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AssetClient) GetSingleCoinsBalance ¶
func (s *AssetClient) GetSingleCoinsBalance(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AssetClient) GetSubDepositAddress ¶
func (s *AssetClient) GetSubDepositAddress(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AssetClient) GetSubDepositRecords ¶
func (s *AssetClient) GetSubDepositRecords(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AssetClient) GetSubUids ¶
func (s *AssetClient) GetSubUids(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AssetClient) GetTransferableCoin ¶
func (s *AssetClient) GetTransferableCoin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AssetClient) GetUniversalTransfer ¶
func (s *AssetClient) GetUniversalTransfer(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AssetClient) GetUsdcSettlement ¶
func (s *AssetClient) GetUsdcSettlement(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AssetClient) GetWithdrawalAmount ¶
func (s *AssetClient) GetWithdrawalAmount(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AssetClient) GetWithdrawalRecords ¶
func (s *AssetClient) GetWithdrawalRecords(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AssetClient) SetDepositAccount ¶
func (s *AssetClient) SetDepositAccount(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*AssetClient) WithdrawAsset ¶
func (s *AssetClient) WithdrawAsset(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
type BrokerServiceClient ¶
type BrokerServiceClient struct {
// contains filtered or unexported fields
}
func (*BrokerServiceClient) GetBrokerAccountInfo ¶
func (s *BrokerServiceClient) GetBrokerAccountInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BrokerServiceClient) GetBrokerEarning ¶
func (s *BrokerServiceClient) GetBrokerEarning(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
type Client ¶
type Client struct { APIKey string APISecret string BaseURL string HTTPClient *http.Client Debug bool Logger *log.Logger // contains filtered or unexported fields }
Client define API client
func NewBybitHttpClient ¶
func NewBybitHttpClient(apiKey string, APISecret string, options ...ClientOption) *Client
NewBybitHttpClient NewClient Create client function for initialising new Bybit client
func (*Client) NewAccountService ¶
func (c *Client) NewAccountService(params map[string]interface{}) *AccountClient
func (*Client) NewAccountServiceNoParams ¶
func (c *Client) NewAccountServiceNoParams() *AccountClient
func (*Client) NewAssetService ¶
func (c *Client) NewAssetService(params map[string]interface{}) *AssetClient
func (*Client) NewBrokerService ¶
func (c *Client) NewBrokerService(params map[string]interface{}) *BrokerServiceClient
func (*Client) NewFundingTatesService ¶
func (c *Client) NewFundingTatesService() *MarketFundingRatesService
func (*Client) NewGetDeliveryPriceService ¶
func (c *Client) NewGetDeliveryPriceService() *GetDeliveryPriceService
GetDeliveryPriceService
func (*Client) NewGetHistoricalVolatilityService ¶
func (c *Client) NewGetHistoricalVolatilityService() *GetHistoricalVolatilityService
GetHistoricalVolatilityService
func (*Client) NewGetInsuranceInfoService ¶
func (c *Client) NewGetInsuranceInfoService() *GetInsuranceInfoService
GetInsuranceInfoService
func (*Client) NewGetMarketLSRatioService ¶
func (c *Client) NewGetMarketLSRatioService() *GetMarketLSRatioService
GetMarketLSRatioService
func (*Client) NewGetOpenInterestsService ¶
func (c *Client) NewGetOpenInterestsService() *GetOpenInterestsService
GetOpenInterestsServicdde
func (*Client) NewGetPublicRecentTradesService ¶
func (c *Client) NewGetPublicRecentTradesService() *GetPublicRecentTradesService
func (*Client) NewGetRiskLimitService ¶
func (c *Client) NewGetRiskLimitService() *GetRiskLimitService
GetRiskLimitService
func (*Client) NewGetServerTimeService ¶
func (c *Client) NewGetServerTimeService() *GetServerTimeService
GetServerTimeService
func (*Client) NewInstrumentsInfoService ¶
func (c *Client) NewInstrumentsInfoService() *InstrumentsInfoService
func (*Client) NewLendingService ¶
func (c *Client) NewLendingService(params map[string]interface{}) *LendingServiceClient
func (*Client) NewLendingServiceNoParams ¶
func (c *Client) NewLendingServiceNoParams() *LendingServiceClient
func (*Client) NewMarketIndexPriceKlineService ¶
func (c *Client) NewMarketIndexPriceKlineService() *MarketIndexPriceKlineService
NewMarketIndexPriceKlineService Market Index Price Kline Endpoints
func (*Client) NewMarketKlineService ¶
func (c *Client) NewMarketKlineService() *MarketKlinesService
NewMarketKlineService Market Kline Endpoints
func (*Client) NewMarketMarkPriceKlineService ¶
func (c *Client) NewMarketMarkPriceKlineService() *MarketMarkPriceKlineService
NewMarketMarkPriceKlineService Market Mark Price Kline Endpoints
func (*Client) NewMarketPremiumIndexPriceKlineService ¶
func (c *Client) NewMarketPremiumIndexPriceKlineService() *MarketPremiumIndexPriceKlineService
NewMarketPremiumIndexPriceKlineService Market Premium Index Price Kline Endpoints
func (*Client) NewOrderBookService ¶
func (c *Client) NewOrderBookService() *MarketOrderBookService
func (*Client) NewPlaceOrderService ¶
NewPlaceOrderService Trade Endpoints
func (*Client) NewPositionService ¶
func (c *Client) NewPositionService(params map[string]interface{}) *PositionClient
func (*Client) NewPreUpgradeService ¶
func (c *Client) NewPreUpgradeService(params map[string]interface{}) *PreUpgradeClient
func (*Client) NewSpotLeverageService ¶
func (c *Client) NewSpotLeverageService(params map[string]interface{}) *SpotLeverageClient
func (*Client) NewSpotMarginDataService ¶
func (c *Client) NewSpotMarginDataService(params map[string]interface{}, isUta bool) *SpotMarginClient
func (*Client) NewTickersService ¶
func (c *Client) NewTickersService() *MarketTickersService
func (*Client) NewTradeService ¶
func (c *Client) NewTradeService(params map[string]interface{}) *TradeClient
func (*Client) NewUserService ¶
func (c *Client) NewUserService(params map[string]interface{}) *UserServiceClient
func (*Client) NewUserServiceNoParams ¶
func (c *Client) NewUserServiceNoParams() *UserServiceClient
type ClientOption ¶
type ClientOption func(*Client)
func WithBaseURL ¶
func WithBaseURL(baseURL string) ClientOption
WithBaseURL is a client option to set the base URL of the Bybit HTTP client.
type GetDeliveryPriceResponse ¶
type GetDeliveryPriceResponse struct { RetCode int `json:"retCode"` RetMsg string `json:"retMsg"` Result models.DeliveryPriceInfo `json:"result"` RetExtInfo struct{} `json:"retExtInfo"` Time int64 `json:"time"` }
type GetDeliveryPriceService ¶
type GetDeliveryPriceService struct {
// contains filtered or unexported fields
}
func (*GetDeliveryPriceService) BaseCoin ¶
func (s *GetDeliveryPriceService) BaseCoin(baseCoin string) *GetDeliveryPriceService
func (*GetDeliveryPriceService) Category ¶
func (s *GetDeliveryPriceService) Category(category models.Category) *GetDeliveryPriceService
func (*GetDeliveryPriceService) Cursor ¶
func (s *GetDeliveryPriceService) Cursor(cursor string) *GetDeliveryPriceService
func (*GetDeliveryPriceService) Do ¶
func (s *GetDeliveryPriceService) Do(ctx context.Context, opts ...RequestOption) (res *models.DeliveryPriceInfo, err error)
func (*GetDeliveryPriceService) Limit ¶
func (s *GetDeliveryPriceService) Limit(limit int) *GetDeliveryPriceService
func (*GetDeliveryPriceService) Symbol ¶
func (s *GetDeliveryPriceService) Symbol(symbol string) *GetDeliveryPriceService
type GetHistoricalVolatilityService ¶
type GetHistoricalVolatilityService struct {
// contains filtered or unexported fields
}
func (*GetHistoricalVolatilityService) BaseCoin ¶
func (s *GetHistoricalVolatilityService) BaseCoin(baseCoin string) *GetHistoricalVolatilityService
func (*GetHistoricalVolatilityService) Category ¶
func (s *GetHistoricalVolatilityService) Category(category models.Category) *GetHistoricalVolatilityService
func (*GetHistoricalVolatilityService) Do ¶
func (s *GetHistoricalVolatilityService) Do(ctx context.Context, opts ...RequestOption) (res *models.HistoricalVolatilityInfo, err error)
func (*GetHistoricalVolatilityService) EndTime ¶
func (s *GetHistoricalVolatilityService) EndTime(endTime uint64) *GetHistoricalVolatilityService
func (*GetHistoricalVolatilityService) Period ¶
func (s *GetHistoricalVolatilityService) Period(period string) *GetHistoricalVolatilityService
func (*GetHistoricalVolatilityService) StartTime ¶
func (s *GetHistoricalVolatilityService) StartTime(startTime uint64) *GetHistoricalVolatilityService
type GetInsuranceInfoResponse ¶
type GetInsuranceInfoResponse struct { RetCode int `json:"retCode"` RetMsg string `json:"retMsg"` Result models.MarketInsuranceInfo `json:"result"` RetExtInfo struct{} `json:"retExtInfo"` Time int64 `json:"time"` }
type GetInsuranceInfoService ¶
type GetInsuranceInfoService struct {
// contains filtered or unexported fields
}
func (*GetInsuranceInfoService) Coin ¶
func (s *GetInsuranceInfoService) Coin(coin string) *GetInsuranceInfoService
func (*GetInsuranceInfoService) Do ¶
func (s *GetInsuranceInfoService) Do(ctx context.Context, opts ...RequestOption) (res *models.MarketInsuranceInfo, err error)
type GetMarketLSRatioResponse ¶
type GetMarketLSRatioResponse struct { RetCode int `json:"retCode"` RetMsg string `json:"retMsg"` Result models.MarketLongShortRatioInfo `json:"result"` RetExtInfo struct{} `json:"retExtInfo"` Time int64 `json:"time"` }
type GetMarketLSRatioService ¶
type GetMarketLSRatioService struct {
// contains filtered or unexported fields
}
func (*GetMarketLSRatioService) BaseCoin ¶
func (s *GetMarketLSRatioService) BaseCoin(baseCoin string) *GetMarketLSRatioService
func (*GetMarketLSRatioService) Category ¶
func (s *GetMarketLSRatioService) Category(category models.Category) *GetMarketLSRatioService
func (*GetMarketLSRatioService) Do ¶
func (s *GetMarketLSRatioService) Do(ctx context.Context, opts ...RequestOption) (res *models.MarketLongShortRatioInfo, err error)
func (*GetMarketLSRatioService) Limit ¶
func (s *GetMarketLSRatioService) Limit(limit int) *GetMarketLSRatioService
func (*GetMarketLSRatioService) Period ¶
func (s *GetMarketLSRatioService) Period(period string) *GetMarketLSRatioService
type GetOpenInterestsResponse ¶
type GetOpenInterestsResponse struct { RetCode int `json:"retCode"` RetMsg string `json:"retMsg"` Result models.OpenInterestInfo `json:"result"` RetExtInfo struct{} `json:"retExtInfo"` Time int64 `json:"time"` }
type GetOpenInterestsService ¶
type GetOpenInterestsService struct {
// contains filtered or unexported fields
}
func (*GetOpenInterestsService) Category ¶
func (s *GetOpenInterestsService) Category(category models.Category) *GetOpenInterestsService
func (*GetOpenInterestsService) Cursor ¶
func (s *GetOpenInterestsService) Cursor(cursor string) *GetOpenInterestsService
func (*GetOpenInterestsService) Do ¶
func (s *GetOpenInterestsService) Do(ctx context.Context, opts ...RequestOption) (res *models.OpenInterestInfo, err error)
func (*GetOpenInterestsService) EndTime ¶
func (s *GetOpenInterestsService) EndTime(endTime uint64) *GetOpenInterestsService
func (*GetOpenInterestsService) IntervalTime ¶
func (s *GetOpenInterestsService) IntervalTime(intervalTime string) *GetOpenInterestsService
func (*GetOpenInterestsService) Limit ¶
func (s *GetOpenInterestsService) Limit(limit int) *GetOpenInterestsService
func (*GetOpenInterestsService) StartTime ¶
func (s *GetOpenInterestsService) StartTime(startTime uint64) *GetOpenInterestsService
func (*GetOpenInterestsService) Symbol ¶
func (s *GetOpenInterestsService) Symbol(symbol string) *GetOpenInterestsService
type GetPublicRecentTradesResponse ¶
type GetPublicRecentTradesResponse struct { RetCode int `json:"retCode"` RetMsg string `json:"retMsg"` Result models.PublicRecentTradeHistory `json:"result"` RetExtInfo struct{} `json:"retExtInfo"` Time int64 `json:"time"` }
type GetPublicRecentTradesService ¶
type GetPublicRecentTradesService struct {
// contains filtered or unexported fields
}
func (*GetPublicRecentTradesService) BaseCoin ¶
func (s *GetPublicRecentTradesService) BaseCoin(baseCoin string) *GetPublicRecentTradesService
func (*GetPublicRecentTradesService) Category ¶
func (s *GetPublicRecentTradesService) Category(category models.Category) *GetPublicRecentTradesService
func (*GetPublicRecentTradesService) Do ¶
func (s *GetPublicRecentTradesService) Do(ctx context.Context, opts ...RequestOption) (res *models.PublicRecentTradeHistory, err error)
func (*GetPublicRecentTradesService) Limit ¶
func (s *GetPublicRecentTradesService) Limit(limit int) *GetPublicRecentTradesService
func (*GetPublicRecentTradesService) OptionType ¶
func (s *GetPublicRecentTradesService) OptionType(optionType string) *GetPublicRecentTradesService
func (*GetPublicRecentTradesService) Symbol ¶
func (s *GetPublicRecentTradesService) Symbol(symbol string) *GetPublicRecentTradesService
type GetRiskLimitResponse ¶
type GetRiskLimitResponse struct { RetCode int `json:"retCode"` RetMsg string `json:"retMsg"` Result models.MarketRiskLimitInfo `json:"result"` RetExtInfo struct{} `json:"retExtInfo"` Time int64 `json:"time"` }
type GetRiskLimitService ¶
type GetRiskLimitService struct {
// contains filtered or unexported fields
}
func (*GetRiskLimitService) Category ¶
func (s *GetRiskLimitService) Category(category models.Category) *GetRiskLimitService
func (*GetRiskLimitService) Do ¶
func (s *GetRiskLimitService) Do(ctx context.Context, opts ...RequestOption) (res *models.MarketRiskLimitInfo, err error)
func (*GetRiskLimitService) Symbol ¶
func (s *GetRiskLimitService) Symbol(symbol string) *GetRiskLimitService
type GetServerTimeResponse ¶
type GetServerTimeResponse struct { RetCode int `json:"retCode"` RetMsg string `json:"retMsg"` Result models.ServerTimeResult `json:"result"` RetExtInfo struct{} `json:"retExtInfo"` Time int64 `json:"time"` }
type GetServerTimeService ¶
type GetServerTimeService struct {
// contains filtered or unexported fields
}
func (*GetServerTimeService) Do ¶
func (s *GetServerTimeService) Do(ctx context.Context, opts ...RequestOption) (res *models.ServerTimeResult, err error)
type InstrumentsInfoService ¶
type InstrumentsInfoService struct {
// contains filtered or unexported fields
}
func (*InstrumentsInfoService) BaseCoin ¶
func (s *InstrumentsInfoService) BaseCoin(baseCoin string) *InstrumentsInfoService
BaseCoin set baseCoin
func (*InstrumentsInfoService) Category ¶
func (s *InstrumentsInfoService) Category(category models.Category) *InstrumentsInfoService
Category set category
func (*InstrumentsInfoService) Cursor ¶
func (s *InstrumentsInfoService) Cursor(cursor string) *InstrumentsInfoService
Cursor set cursor
func (*InstrumentsInfoService) Do ¶
func (s *InstrumentsInfoService) Do(ctx context.Context, opts ...RequestOption) (res *models.InstrumentInfoResponse, err error)
func (*InstrumentsInfoService) Limit ¶
func (s *InstrumentsInfoService) Limit(limit int) *InstrumentsInfoService
Limit set limit
func (*InstrumentsInfoService) Status ¶
func (s *InstrumentsInfoService) Status(status models.SymbolStatus) *InstrumentsInfoService
Status set status
func (*InstrumentsInfoService) Symbol ¶
func (s *InstrumentsInfoService) Symbol(symbol string) *InstrumentsInfoService
Symbol set symbol
type LendingServiceClient ¶
type LendingServiceClient struct {
// contains filtered or unexported fields
}
func (*LendingServiceClient) C2cCancelRedeemFunds ¶
func (s *LendingServiceClient) C2cCancelRedeemFunds(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*LendingServiceClient) C2cDepositFunds ¶
func (s *LendingServiceClient) C2cDepositFunds(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*LendingServiceClient) C2cRedeemFunds ¶
func (s *LendingServiceClient) C2cRedeemFunds(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*LendingServiceClient) GetC2cLendingAccountInfo ¶
func (s *LendingServiceClient) GetC2cLendingAccountInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*LendingServiceClient) GetC2cLendingCoinInfo ¶
func (s *LendingServiceClient) GetC2cLendingCoinInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*LendingServiceClient) GetC2cLendingOrders ¶
func (s *LendingServiceClient) GetC2cLendingOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*LendingServiceClient) GetInsLoanInfo ¶
func (s *LendingServiceClient) GetInsLoanInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*LendingServiceClient) GetInsLoanOrders ¶
func (s *LendingServiceClient) GetInsLoanOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*LendingServiceClient) GetInsLoanToValue ¶
func (s *LendingServiceClient) GetInsLoanToValue(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*LendingServiceClient) GetInsMarginCoinInfo ¶
func (s *LendingServiceClient) GetInsMarginCoinInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*LendingServiceClient) GetInsRepayOrders ¶
func (s *LendingServiceClient) GetInsRepayOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
type MarketFundingRatesResponse ¶
type MarketFundingRatesResponse struct { RetCode int `json:"retCode"` RetMsg string `json:"retMsg"` Result models.FundingRate `json:"result"` RetExtInfo struct{} `json:"retExtInfo"` Time int64 `json:"time"` }
type MarketFundingRatesService ¶
type MarketFundingRatesService struct {
// contains filtered or unexported fields
}
func (*MarketFundingRatesService) Category ¶
func (s *MarketFundingRatesService) Category(category models.Category) *MarketFundingRatesService
func (*MarketFundingRatesService) Do ¶
func (s *MarketFundingRatesService) Do(ctx context.Context, opts ...RequestOption) (res *models.FundingRate, err error)
func (*MarketFundingRatesService) EndTime ¶
func (s *MarketFundingRatesService) EndTime(endTime uint64) *MarketFundingRatesService
func (*MarketFundingRatesService) Limit ¶
func (s *MarketFundingRatesService) Limit(limit int) *MarketFundingRatesService
func (*MarketFundingRatesService) StartTime ¶
func (s *MarketFundingRatesService) StartTime(startTime uint64) *MarketFundingRatesService
func (*MarketFundingRatesService) Symbol ¶
func (s *MarketFundingRatesService) Symbol(symbol string) *MarketFundingRatesService
type MarketIndexPriceKlineService ¶
type MarketIndexPriceKlineService struct {
// contains filtered or unexported fields
}
MarketIndexPriceKlineService Market index price kline (GET /v5/market/index-price-kline)
func (*MarketIndexPriceKlineService) Category ¶
func (s *MarketIndexPriceKlineService) Category(category models.Category) *MarketIndexPriceKlineService
Category set category
func (*MarketIndexPriceKlineService) Do ¶
func (s *MarketIndexPriceKlineService) Do(ctx context.Context, opts ...RequestOption) (res *models.MarketIndexPriceKlineResponse, err error)
func (*MarketIndexPriceKlineService) End ¶
func (s *MarketIndexPriceKlineService) End(endTime uint64) *MarketIndexPriceKlineService
End set endTime
func (*MarketIndexPriceKlineService) Interval ¶
func (s *MarketIndexPriceKlineService) Interval(interval string) *MarketIndexPriceKlineService
Interval set interval
func (*MarketIndexPriceKlineService) Limit ¶
func (s *MarketIndexPriceKlineService) Limit(limit int) *MarketIndexPriceKlineService
Limit set limit
func (*MarketIndexPriceKlineService) Start ¶
func (s *MarketIndexPriceKlineService) Start(startTime uint64) *MarketIndexPriceKlineService
Start set startTime
func (*MarketIndexPriceKlineService) Symbol ¶
func (s *MarketIndexPriceKlineService) Symbol(symbol string) *MarketIndexPriceKlineService
Symbol set symbol
type MarketKlinesService ¶
type MarketKlinesService struct {
// contains filtered or unexported fields
}
MarketKlinesService Market Kline (GET /v5/market/kline)
func (*MarketKlinesService) Category ¶
func (s *MarketKlinesService) Category(category models.Category) *MarketKlinesService
Category set category
func (*MarketKlinesService) Do ¶
func (s *MarketKlinesService) Do(ctx context.Context, opts ...RequestOption) (res *models.MarketKlineResponse, err error)
func (*MarketKlinesService) End ¶
func (s *MarketKlinesService) End(endTime uint64) *MarketKlinesService
End set endTime
func (*MarketKlinesService) Interval ¶
func (s *MarketKlinesService) Interval(interval string) *MarketKlinesService
Interval set interval
func (*MarketKlinesService) Limit ¶
func (s *MarketKlinesService) Limit(limit int) *MarketKlinesService
Limit set limit
func (*MarketKlinesService) Start ¶
func (s *MarketKlinesService) Start(startTime uint64) *MarketKlinesService
Start set startTime
func (*MarketKlinesService) Symbol ¶
func (s *MarketKlinesService) Symbol(symbol string) *MarketKlinesService
Symbol set symbol
type MarketMarkPriceKlineService ¶
type MarketMarkPriceKlineService struct {
// contains filtered or unexported fields
}
MarketMarkPriceKlineService Market mark price kline (GET /v5/market/mark-price-kline)
func (*MarketMarkPriceKlineService) Category ¶
func (s *MarketMarkPriceKlineService) Category(category models.Category) *MarketMarkPriceKlineService
Category set category
func (*MarketMarkPriceKlineService) Do ¶
func (s *MarketMarkPriceKlineService) Do(ctx context.Context, opts ...RequestOption) (res *models.MarketMarkPriceKlineResponse, err error)
func (*MarketMarkPriceKlineService) End ¶
func (s *MarketMarkPriceKlineService) End(endTime uint64) *MarketMarkPriceKlineService
End set endTime
func (*MarketMarkPriceKlineService) Interval ¶
func (s *MarketMarkPriceKlineService) Interval(interval string) *MarketMarkPriceKlineService
Interval set interval
func (*MarketMarkPriceKlineService) Limit ¶
func (s *MarketMarkPriceKlineService) Limit(limit int) *MarketMarkPriceKlineService
Limit set limit
func (*MarketMarkPriceKlineService) Start ¶
func (s *MarketMarkPriceKlineService) Start(startTime uint64) *MarketMarkPriceKlineService
Start set startTime
func (*MarketMarkPriceKlineService) Symbol ¶
func (s *MarketMarkPriceKlineService) Symbol(symbol string) *MarketMarkPriceKlineService
Symbol set symbol
type MarketOrderBookResponse ¶
type MarketOrderBookResponse struct { RetCode int `json:"retCode"` RetMsg string `json:"retMsg"` Result models.OrderBookInfo `json:"result"` RetExtInfo struct{} `json:"retExtInfo"` Time int64 `json:"time"` }
type MarketOrderBookService ¶
type MarketOrderBookService struct {
// contains filtered or unexported fields
}
func (*MarketOrderBookService) Category ¶
func (s *MarketOrderBookService) Category(category models.Category) *MarketOrderBookService
Category set category
func (*MarketOrderBookService) Do ¶
func (s *MarketOrderBookService) Do(ctx context.Context, opts ...RequestOption) (res *models.OrderBookInfo, err error)
func (*MarketOrderBookService) Limit ¶
func (s *MarketOrderBookService) Limit(limit int) *MarketOrderBookService
func (*MarketOrderBookService) Symbol ¶
func (s *MarketOrderBookService) Symbol(symbol string) *MarketOrderBookService
Symbol set symbol
type MarketPremiumIndexPriceKlineService ¶
type MarketPremiumIndexPriceKlineService struct {
// contains filtered or unexported fields
}
MarketPremiumIndexPriceKlineService Market premium index price kline (GET /v5/market/premium-index-price-kline)
func (*MarketPremiumIndexPriceKlineService) Category ¶
func (s *MarketPremiumIndexPriceKlineService) Category(category models.Category) *MarketPremiumIndexPriceKlineService
Category set category
func (*MarketPremiumIndexPriceKlineService) Do ¶
func (s *MarketPremiumIndexPriceKlineService) Do(ctx context.Context, opts ...RequestOption) (res *models.MarketPremiumIndexPriceKlineResponse, err error)
func (*MarketPremiumIndexPriceKlineService) End ¶
func (s *MarketPremiumIndexPriceKlineService) End(endTime uint64) *MarketPremiumIndexPriceKlineService
End set endTime
func (*MarketPremiumIndexPriceKlineService) Interval ¶
func (s *MarketPremiumIndexPriceKlineService) Interval(interval string) *MarketPremiumIndexPriceKlineService
Interval set interval
func (*MarketPremiumIndexPriceKlineService) Limit ¶
func (s *MarketPremiumIndexPriceKlineService) Limit(limit int) *MarketPremiumIndexPriceKlineService
Limit set limit
func (*MarketPremiumIndexPriceKlineService) Start ¶
func (s *MarketPremiumIndexPriceKlineService) Start(startTime uint64) *MarketPremiumIndexPriceKlineService
Start set startTime
func (*MarketPremiumIndexPriceKlineService) Symbol ¶
func (s *MarketPremiumIndexPriceKlineService) Symbol(symbol string) *MarketPremiumIndexPriceKlineService
Symbol set symbol
type MarketTickersResponse ¶
type MarketTickersResponse struct { RetCode int `json:"retCode"` RetMsg string `json:"retMsg"` Result models.MarketTickers `json:"result"` RetExtInfo struct{} `json:"retExtInfo"` Time int64 `json:"time"` }
type MarketTickersService ¶
type MarketTickersService struct {
// contains filtered or unexported fields
}
func (*MarketTickersService) BaseCoin ¶
func (s *MarketTickersService) BaseCoin(baseCoin string) *MarketTickersService
func (*MarketTickersService) Category ¶
func (s *MarketTickersService) Category(category models.Category) *MarketTickersService
func (*MarketTickersService) Do ¶
func (s *MarketTickersService) Do(ctx context.Context, opts ...RequestOption) (res *models.MarketTickers, err error)
func (*MarketTickersService) ExpDate ¶
func (s *MarketTickersService) ExpDate(expDate string) *MarketTickersService
func (*MarketTickersService) Symbol ¶
func (s *MarketTickersService) Symbol(symbol string) *MarketTickersService
type MessageHandler ¶
type Order ¶
type Order struct {
// contains filtered or unexported fields
}
func (*Order) CloseOnTrigger ¶
func (*Order) Do ¶
func (order *Order) Do(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*Order) IsLeverage ¶
func (*Order) OrderFilter ¶
func (*Order) OrderLinkId ¶
func (*Order) PositionIdx ¶
func (*Order) ReduceOnly ¶
func (*Order) SlLimitPrice ¶
func (*Order) SlOrderType ¶
func (*Order) SlTriggerBy ¶
func (*Order) TakeProfit ¶
func (*Order) TimeInForce ¶
func (*Order) TpLimitPrice ¶
func (*Order) TpOrderType ¶
func (*Order) TpTriggerBy ¶
func (*Order) TriggerDirection ¶
func (*Order) TriggerPrice ¶
type PositionClient ¶
type PositionClient struct {
// contains filtered or unexported fields
}
func (*PositionClient) ConfirmPositionRiskLimit ¶
func (s *PositionClient) ConfirmPositionRiskLimit(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*PositionClient) GetClosePnl ¶
func (s *PositionClient) GetClosePnl(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*PositionClient) GetExecutionList ¶
func (s *PositionClient) GetExecutionList(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*PositionClient) GetPositionList ¶
func (s *PositionClient) GetPositionList(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*PositionClient) SetPositionAutoMargin ¶
func (s *PositionClient) SetPositionAutoMargin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*PositionClient) SetPositionLeverage ¶
func (s *PositionClient) SetPositionLeverage(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*PositionClient) SetPositionRiskLimit ¶
func (s *PositionClient) SetPositionRiskLimit(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*PositionClient) SetPositionTpslMode ¶
func (s *PositionClient) SetPositionTpslMode(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*PositionClient) SetPositionTradingStop ¶
func (s *PositionClient) SetPositionTradingStop(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*PositionClient) SwitchPositionMargin ¶
func (s *PositionClient) SwitchPositionMargin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*PositionClient) SwitchPositionMode ¶
func (s *PositionClient) SwitchPositionMode(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*PositionClient) UpdatePositionMargin ¶
func (s *PositionClient) UpdatePositionMargin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
type PreUpgradeClient ¶
type PreUpgradeClient struct {
// contains filtered or unexported fields
}
func (*PreUpgradeClient) GetPreUpgradeClosedPnl ¶
func (s *PreUpgradeClient) GetPreUpgradeClosedPnl(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*PreUpgradeClient) GetPreUpgradeExecutionList ¶
func (s *PreUpgradeClient) GetPreUpgradeExecutionList(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*PreUpgradeClient) GetPreUpgradeOptionDeliveryRecord ¶
func (s *PreUpgradeClient) GetPreUpgradeOptionDeliveryRecord(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*PreUpgradeClient) GetPreUpgradeOrderHistory ¶
func (s *PreUpgradeClient) GetPreUpgradeOrderHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*PreUpgradeClient) GetPreUpgradeTransactionLog ¶
func (s *PreUpgradeClient) GetPreUpgradeTransactionLog(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*PreUpgradeClient) GetPreUpgradeUsdcSettlement ¶
func (s *PreUpgradeClient) GetPreUpgradeUsdcSettlement(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
type RequestOption ¶
type RequestOption func(*request)
RequestOption define option type for request
func WithRecvWindow ¶
func WithRecvWindow(recvWindow string) RequestOption
WithRecvWindow Append `WithRecvWindow(insert_recvWindow)` to request to modify the default recvWindow value
type ServerResponse ¶
type SpotLeverageClient ¶
type SpotLeverageClient struct {
// contains filtered or unexported fields
}
func (*SpotLeverageClient) GetLeverageTokenInfo ¶
func (s *SpotLeverageClient) GetLeverageTokenInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*SpotLeverageClient) GetLeverageTokenMarket ¶
func (s *SpotLeverageClient) GetLeverageTokenMarket(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*SpotLeverageClient) GetLeverageTokenOrders ¶
func (s *SpotLeverageClient) GetLeverageTokenOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*SpotLeverageClient) PurchaseLeverageToken ¶
func (s *SpotLeverageClient) PurchaseLeverageToken(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*SpotLeverageClient) RedeemLeverageToken ¶
func (s *SpotLeverageClient) RedeemLeverageToken(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
type SpotMarginClient ¶
type SpotMarginClient struct {
// contains filtered or unexported fields
}
func (*SpotMarginClient) BorrowSpotMarginLoan ¶
func (s *SpotMarginClient) BorrowSpotMarginLoan(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*SpotMarginClient) GetSpotMarginBorrowCoin ¶
func (s *SpotMarginClient) GetSpotMarginBorrowCoin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*SpotMarginClient) GetSpotMarginBorrowOrders ¶
func (s *SpotMarginClient) GetSpotMarginBorrowOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*SpotMarginClient) GetSpotMarginCoin ¶
func (s *SpotMarginClient) GetSpotMarginCoin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*SpotMarginClient) GetSpotMarginData ¶
func (s *SpotMarginClient) GetSpotMarginData(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*SpotMarginClient) GetSpotMarginInterests ¶
func (s *SpotMarginClient) GetSpotMarginInterests(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*SpotMarginClient) GetSpotMarginLoanAccountInfo ¶
func (s *SpotMarginClient) GetSpotMarginLoanAccountInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*SpotMarginClient) GetSpotMarginRepaymentOrders ¶
func (s *SpotMarginClient) GetSpotMarginRepaymentOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*SpotMarginClient) GetSpotMarginState ¶
func (s *SpotMarginClient) GetSpotMarginState(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*SpotMarginClient) RepaySpotMarginLoan ¶
func (s *SpotMarginClient) RepaySpotMarginLoan(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*SpotMarginClient) SetSpotMarginLeverage ¶
func (s *SpotMarginClient) SetSpotMarginLeverage(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*SpotMarginClient) ToggleSpotMarginTrade ¶
func (s *SpotMarginClient) ToggleSpotMarginTrade(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
type TradeClient ¶
type TradeClient struct {
// contains filtered or unexported fields
}
func (*TradeClient) AmendBatchOrder ¶
func (s *TradeClient) AmendBatchOrder(ctx context.Context, opts ...RequestOption) (res *models.BatchOrderServerResponse, err error)
func (*TradeClient) AmendOrder ¶
func (s *TradeClient) AmendOrder(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*TradeClient) CancelAllOrders ¶
func (s *TradeClient) CancelAllOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*TradeClient) CancelBatchOrder ¶
func (s *TradeClient) CancelBatchOrder(ctx context.Context, opts ...RequestOption) (res *models.BatchOrderServerResponse, err error)
func (*TradeClient) CancelOrder ¶
func (s *TradeClient) CancelOrder(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*TradeClient) GetOpenOrders ¶
func (s *TradeClient) GetOpenOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*TradeClient) GetOrderHistory ¶
func (s *TradeClient) GetOrderHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*TradeClient) GetSpotBorrowQuota ¶
func (s *TradeClient) GetSpotBorrowQuota(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*TradeClient) PlaceBatchOrder ¶
func (s *TradeClient) PlaceBatchOrder(ctx context.Context, opts ...RequestOption) (res *models.BatchOrderServerResponse, err error)
func (*TradeClient) PlaceOrder ¶
func (s *TradeClient) PlaceOrder(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*TradeClient) SetDisconnectCancelAll ¶
func (s *TradeClient) SetDisconnectCancelAll(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
type UserServiceClient ¶
type UserServiceClient struct {
// contains filtered or unexported fields
}
func (*UserServiceClient) CreateSubApiKey ¶
func (s *UserServiceClient) CreateSubApiKey(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*UserServiceClient) CreateSubMember ¶
func (s *UserServiceClient) CreateSubMember(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*UserServiceClient) DeleteMasterAPIKey ¶
func (s *UserServiceClient) DeleteMasterAPIKey(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*UserServiceClient) DeleteSubAPIKey ¶
func (s *UserServiceClient) DeleteSubAPIKey(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*UserServiceClient) DeleteSubUID ¶
func (s *UserServiceClient) DeleteSubUID(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*UserServiceClient) FreezeSubUID ¶
func (s *UserServiceClient) FreezeSubUID(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*UserServiceClient) GetAPIKeyInfo ¶
func (s *UserServiceClient) GetAPIKeyInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*UserServiceClient) GetAffiliateUserInfo ¶
func (s *UserServiceClient) GetAffiliateUserInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*UserServiceClient) GetSubUidList ¶
func (s *UserServiceClient) GetSubUidList(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*UserServiceClient) GetUidWalletType ¶
func (s *UserServiceClient) GetUidWalletType(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*UserServiceClient) ModifyMasterAPIKey ¶
func (s *UserServiceClient) ModifyMasterAPIKey(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*UserServiceClient) ModifySubAPIKey ¶
func (s *UserServiceClient) ModifySubAPIKey(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
type WebSocket ¶
type WebSocket struct {
// contains filtered or unexported fields
}
func NewBybitPrivateWebSocket ¶
func NewBybitPrivateWebSocket(url, apiKey, apiSecret string, handler MessageHandler, options ...WebsocketOption) *WebSocket
func NewBybitPublicWebSocket ¶
func NewBybitPublicWebSocket(url string, pingInterval int, handler MessageHandler, options ...WebsocketOption) *WebSocket
func (*WebSocket) Disconnect ¶
func (*WebSocket) SendAsJson ¶
func (*WebSocket) SetMessageHandler ¶
func (b *WebSocket) SetMessageHandler(handler MessageHandler)
type WebsocketOption ¶
type WebsocketOption func(*WebSocket)
func WithMaxAliveTime ¶
func WithMaxAliveTime(maxAliveTime string) WebsocketOption
func WithPingInterval ¶
func WithPingInterval(pingInterval int) WebsocketOption