Documentation ¶
Index ¶
- Constants
- func FormatTimestamp(t time.Time) int64
- func GetBatchOrderServerResponse(err error, data []byte) (*models.BatchOrderServerResponse, error)
- func GetCurrentTime() int64
- func GetIndexPriceKline(err error, data []byte, res *models.MarketIndexPriceKlineResponse) (*models.MarketIndexPriceKlineResponse, error)
- func GetMarkPriceKline(err error, data []byte, res *models.MarketMarkPriceKlineResponse) (*models.MarketMarkPriceKlineResponse, error)
- func GetMarketKlineResponse(err error, data []byte, res *models.MarketKlineResponse) (*models.MarketKlineResponse, *models.MarketKlineResponse, error)
- func GetPremiumIndexKline(err error, data []byte, res *models.MarketPremiumIndexPriceKlineResponse) (*models.MarketPremiumIndexPriceKlineResponse, error)
- func PrettyPrint(i interface{}) string
- func SendRequest(ctx context.Context, opts []RequestOption, r *request, s *BybitClientRequest, ...) []byte
- type BybitClientRequest
- func (s *BybitClientRequest) AmendBatchOrder(ctx context.Context, opts ...RequestOption) (res *models.BatchOrderServerResponse, err error)
- func (s *BybitClientRequest) AmendOrder(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) AssociateInsLoan(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) BorrowSpotMarginLoan(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)deprecated
- func (s *BybitClientRequest) C2cCancelRedeemFunds(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)deprecated
- func (s *BybitClientRequest) C2cDepositFunds(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)deprecated
- func (s *BybitClientRequest) C2cRedeemFunds(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)deprecated
- func (s *BybitClientRequest) CancelAllOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) CancelBatchOrder(ctx context.Context, opts ...RequestOption) (res *models.BatchOrderServerResponse, err error)
- func (s *BybitClientRequest) CancelOrder(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) CancelWithdraw(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) ConfirmConvertQuote(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) ConfirmPositionRiskLimit(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) CreateInternalTransfer(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) CreateSubApiKey(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) CreateSubMember(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) CreateUniversalTransfer(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) CreateWithdraw(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) DeleteMasterAPIKey(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) DeleteSubAPIKey(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) DeleteSubUID(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) FreezeSubUID(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetAPIKeyInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetAccountInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetAccountWallet(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetAffiliateUserInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetAllCoinsBalance(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetAllSubMembersDepositRecords(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetAllowedDepositCoin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetAssetInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetAssetOrderRecord(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetBorrowHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetBrokerAccountInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetBrokerEarning(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetC2cLendingAccountInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)deprecated
- func (s *BybitClientRequest) GetC2cLendingCoinInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)deprecated
- func (s *BybitClientRequest) GetC2cLendingOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)deprecated
- func (s *BybitClientRequest) GetClosePnl(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetCoinGreeks(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetCoinInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetCollateralInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetConvertCoinList(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetConvertHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetConvertStatus(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetDeliveryPrice(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetDeliveryRecord(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetDepositRecords(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetDisconnectProtectionInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetFeeRates(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetFundingRateHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetHistoryVolatility(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetIndexPriceKline(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetInsLoanInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetInsLoanOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetInsLoanToValue(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetInsMarginCoinInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetInsRepayOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetInstrumentInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetInternalDepositRecords(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetInternalTransferRecords(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetLeverageTokenInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetLeverageTokenMarket(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetLeverageTokenOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetLongShortRatio(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetMMPState(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetMarkPriceKline(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetMarketInsurance(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetMarketKline(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetMarketRiskLimits(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetMarketTickers(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetMasterAccDepositAddress(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetMovePositionHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetOpenInterests(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetOpenOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetOrderBookInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetOrderHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetPositionList(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetPreUpgradeClosedPnl(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetPreUpgradeOptionDeliveryRecord(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetPreUpgradeOrderHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetPreUpgradeTradeHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetPreUpgradeTransactionLog(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetPreUpgradeUsdcSettlement(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetPremiumIndexPriceKline(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetPublicRecentTrades(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetSelfMarketProtectionGroup(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetServerTime(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetSingleCoinsBalance(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetSpotBorrowQuota(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetSpotMarginBorrowCoin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)deprecated
- func (s *BybitClientRequest) GetSpotMarginBorrowOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)deprecated
- func (s *BybitClientRequest) GetSpotMarginCoin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)deprecated
- func (s *BybitClientRequest) GetSpotMarginData(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetSpotMarginInterests(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetSpotMarginLoanAccountInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)deprecated
- func (s *BybitClientRequest) GetSpotMarginRepaymentOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)deprecated
- func (s *BybitClientRequest) GetSpotMarginState(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetSubAccDepositAddress(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetSubAccUids(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetSubMemberDepositRecords(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetSubUidList(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetSubUidListUnlimited(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetTradeHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetTransactionLog(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetTransferableCoin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetUidWalletType(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetUniversalTransferRecords(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetUsdcSettlement(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetWithdrawalAmount(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) GetWithdrawalRecords(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) ModifyMasterAPIKey(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) ModifySubAPIKey(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) MovePosition(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) PlaceBatchOrder(ctx context.Context, opts ...RequestOption) (res *models.BatchOrderServerResponse, err error)
- func (s *BybitClientRequest) PlaceOrder(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) PurchaseLeverageToken(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) RedeemLeverageToken(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) RepaySpotMarginLoan(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)deprecated
- func (s *BybitClientRequest) RequestConvertQuote(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) RequestTestFund(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) ResetMarketMakerProtection(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) SetCollateralCoin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) SetDepositAccount(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) SetDisconnectCancelAll(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) SetMarginMode(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) SetMarketMakerProtection(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) SetPositionAutoMargin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) SetPositionLeverage(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) SetPositionRiskLimit(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)deprecated
- func (s *BybitClientRequest) SetPositionTpslMode(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)deprecated
- func (s *BybitClientRequest) SetPositionTradingStop(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) SetSpotHedgeMode(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) SetSpotMarginLeverage(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) SwitchPositionMargin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) SwitchPositionMode(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) ToggleSpotMarginTrade(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) UpdatePositionMargin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- func (s *BybitClientRequest) UpgradeToUTA(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
- type Client
- func (c *Client) NewClassicalBybitServiceNoParams() *BybitClientRequest
- func (c *Client) NewClassicalBybitServiceWithParams(params map[string]interface{}) *BybitClientRequest
- func (c *Client) NewPlaceOrderService(category, symbol, side, orderType, qty string) *Order
- func (c *Client) NewUtaBybitServiceNoParams() *BybitClientRequest
- func (c *Client) NewUtaBybitServiceWithParams(params map[string]interface{}) *BybitClientRequest
- type ClientOption
- 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 RequestOption
- type ServerResponse
- type WebSocket
- type WebsocketOption
Constants ¶
const ( Name = "bybit.api.go" Version = "1.0.4" // Https MAINNET = "https://api.bybit.com" MAINNET_BACKT = "https://api.bytick.com" TESTNET = "https://api-testnet.bybit.com" DEMO_ENV = "https://api-demo.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_TRADE_MAINNET = "wss://stream.bybit.com/v5/trade" WEBSOCKET_PRIVATE_TESTNET = "wss://stream-testnet.bybit.com/v5/private" WEBSOCKET_TRADE_TESTNET = "wss://stream-testnet.bybit.com/v5/trade" WEBSOCKET_PRIVATE_DEMO = "wss://wss://stream-demo.bybit.com/v5/private" WEBSOCKET_TRADE_DEMO = "wss://wss://stream-demo.bybit.com/v5/trade" // Deprecated: V3 is deprecated and replaced by v5 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 ¶
This section is empty.
Functions ¶
func FormatTimestamp ¶
FormatTimestamp formats a time into Unix timestamp in milliseconds, as requested by Binance.
func GetBatchOrderServerResponse ¶
func GetBatchOrderServerResponse(err error, data []byte) (*models.BatchOrderServerResponse, error)
func GetCurrentTime ¶
func GetCurrentTime() int64
func GetIndexPriceKline ¶
func GetIndexPriceKline(err error, data []byte, res *models.MarketIndexPriceKlineResponse) (*models.MarketIndexPriceKlineResponse, error)
func GetMarkPriceKline ¶
func GetMarkPriceKline(err error, data []byte, res *models.MarketMarkPriceKlineResponse) (*models.MarketMarkPriceKlineResponse, error)
func GetMarketKlineResponse ¶
func GetMarketKlineResponse(err error, data []byte, res *models.MarketKlineResponse) (*models.MarketKlineResponse, *models.MarketKlineResponse, error)
func GetPremiumIndexKline ¶
func GetPremiumIndexKline(err error, data []byte, res *models.MarketPremiumIndexPriceKlineResponse) (*models.MarketPremiumIndexPriceKlineResponse, error)
func PrettyPrint ¶
func PrettyPrint(i interface{}) string
func SendRequest ¶
func SendRequest(ctx context.Context, opts []RequestOption, r *request, s *BybitClientRequest, err error) []byte
Types ¶
type BybitClientRequest ¶
type BybitClientRequest struct {
// contains filtered or unexported fields
}
func (*BybitClientRequest) AmendBatchOrder ¶
func (s *BybitClientRequest) AmendBatchOrder(ctx context.Context, opts ...RequestOption) (res *models.BatchOrderServerResponse, err error)
func (*BybitClientRequest) AmendOrder ¶
func (s *BybitClientRequest) AmendOrder(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) AssociateInsLoan ¶
func (s *BybitClientRequest) AssociateInsLoan(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) BorrowSpotMarginLoan
deprecated
func (s *BybitClientRequest) BorrowSpotMarginLoan(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
Deprecated: BorrowSpotMarginLoan is deprecated.
func (*BybitClientRequest) C2cCancelRedeemFunds
deprecated
func (s *BybitClientRequest) C2cCancelRedeemFunds(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
Deprecated: C2cCancelRedeemFunds is deprecated.
func (*BybitClientRequest) C2cDepositFunds
deprecated
func (s *BybitClientRequest) C2cDepositFunds(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
Deprecated: C2cDepositFunds is deprecated.
func (*BybitClientRequest) C2cRedeemFunds
deprecated
func (s *BybitClientRequest) C2cRedeemFunds(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
Deprecated: C2cRedeemFunds is deprecated.
func (*BybitClientRequest) CancelAllOrders ¶
func (s *BybitClientRequest) CancelAllOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) CancelBatchOrder ¶
func (s *BybitClientRequest) CancelBatchOrder(ctx context.Context, opts ...RequestOption) (res *models.BatchOrderServerResponse, err error)
func (*BybitClientRequest) CancelOrder ¶
func (s *BybitClientRequest) CancelOrder(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) CancelWithdraw ¶
func (s *BybitClientRequest) CancelWithdraw(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) ConfirmConvertQuote ¶
func (s *BybitClientRequest) ConfirmConvertQuote(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) ConfirmPositionRiskLimit ¶
func (s *BybitClientRequest) ConfirmPositionRiskLimit(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) CreateInternalTransfer ¶
func (s *BybitClientRequest) CreateInternalTransfer(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) CreateSubApiKey ¶
func (s *BybitClientRequest) CreateSubApiKey(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) CreateSubMember ¶
func (s *BybitClientRequest) CreateSubMember(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) CreateUniversalTransfer ¶
func (s *BybitClientRequest) CreateUniversalTransfer(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) CreateWithdraw ¶
func (s *BybitClientRequest) CreateWithdraw(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) DeleteMasterAPIKey ¶
func (s *BybitClientRequest) DeleteMasterAPIKey(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) DeleteSubAPIKey ¶
func (s *BybitClientRequest) DeleteSubAPIKey(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) DeleteSubUID ¶
func (s *BybitClientRequest) DeleteSubUID(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) FreezeSubUID ¶
func (s *BybitClientRequest) FreezeSubUID(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetAPIKeyInfo ¶
func (s *BybitClientRequest) GetAPIKeyInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetAccountInfo ¶
func (s *BybitClientRequest) GetAccountInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetAccountWallet ¶
func (s *BybitClientRequest) GetAccountWallet(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetAffiliateUserInfo ¶
func (s *BybitClientRequest) GetAffiliateUserInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetAllCoinsBalance ¶
func (s *BybitClientRequest) GetAllCoinsBalance(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetAllSubMembersDepositRecords ¶
func (s *BybitClientRequest) GetAllSubMembersDepositRecords(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetAllowedDepositCoin ¶
func (s *BybitClientRequest) GetAllowedDepositCoin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetAssetInfo ¶
func (s *BybitClientRequest) GetAssetInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetAssetOrderRecord ¶
func (s *BybitClientRequest) GetAssetOrderRecord(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetBorrowHistory ¶
func (s *BybitClientRequest) GetBorrowHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetBrokerAccountInfo ¶
func (s *BybitClientRequest) GetBrokerAccountInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetBrokerEarning ¶
func (s *BybitClientRequest) GetBrokerEarning(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetC2cLendingAccountInfo
deprecated
func (s *BybitClientRequest) GetC2cLendingAccountInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
Deprecated: GetC2cLendingAccountInfo is deprecated.
func (*BybitClientRequest) GetC2cLendingCoinInfo
deprecated
func (s *BybitClientRequest) GetC2cLendingCoinInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
Deprecated: GetC2cLendingCoinInfo is deprecated.
func (*BybitClientRequest) GetC2cLendingOrders
deprecated
func (s *BybitClientRequest) GetC2cLendingOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
Deprecated: GetC2cLendingOrders is deprecated.
func (*BybitClientRequest) GetClosePnl ¶
func (s *BybitClientRequest) GetClosePnl(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetCoinGreeks ¶
func (s *BybitClientRequest) GetCoinGreeks(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetCoinInfo ¶
func (s *BybitClientRequest) GetCoinInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetCollateralInfo ¶
func (s *BybitClientRequest) GetCollateralInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetConvertCoinList ¶
func (s *BybitClientRequest) GetConvertCoinList(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetConvertHistory ¶
func (s *BybitClientRequest) GetConvertHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetConvertStatus ¶
func (s *BybitClientRequest) GetConvertStatus(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetDeliveryPrice ¶
func (s *BybitClientRequest) GetDeliveryPrice(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetDeliveryRecord ¶
func (s *BybitClientRequest) GetDeliveryRecord(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetDepositRecords ¶
func (s *BybitClientRequest) GetDepositRecords(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetDisconnectProtectionInfo ¶
func (s *BybitClientRequest) GetDisconnectProtectionInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetFeeRates ¶
func (s *BybitClientRequest) GetFeeRates(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetFundingRateHistory ¶
func (s *BybitClientRequest) GetFundingRateHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetHistoryVolatility ¶
func (s *BybitClientRequest) GetHistoryVolatility(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetIndexPriceKline ¶
func (s *BybitClientRequest) GetIndexPriceKline(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetInsLoanInfo ¶
func (s *BybitClientRequest) GetInsLoanInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetInsLoanOrders ¶
func (s *BybitClientRequest) GetInsLoanOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetInsLoanToValue ¶
func (s *BybitClientRequest) GetInsLoanToValue(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetInsMarginCoinInfo ¶
func (s *BybitClientRequest) GetInsMarginCoinInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetInsRepayOrders ¶
func (s *BybitClientRequest) GetInsRepayOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetInstrumentInfo ¶
func (s *BybitClientRequest) GetInstrumentInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetInternalDepositRecords ¶
func (s *BybitClientRequest) GetInternalDepositRecords(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetInternalTransferRecords ¶
func (s *BybitClientRequest) GetInternalTransferRecords(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetLeverageTokenInfo ¶
func (s *BybitClientRequest) GetLeverageTokenInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetLeverageTokenMarket ¶
func (s *BybitClientRequest) GetLeverageTokenMarket(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetLeverageTokenOrders ¶
func (s *BybitClientRequest) GetLeverageTokenOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetLongShortRatio ¶
func (s *BybitClientRequest) GetLongShortRatio(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetMMPState ¶
func (s *BybitClientRequest) GetMMPState(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetMarkPriceKline ¶
func (s *BybitClientRequest) GetMarkPriceKline(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetMarketInsurance ¶
func (s *BybitClientRequest) GetMarketInsurance(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetMarketKline ¶
func (s *BybitClientRequest) GetMarketKline(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetMarketRiskLimits ¶
func (s *BybitClientRequest) GetMarketRiskLimits(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetMarketTickers ¶
func (s *BybitClientRequest) GetMarketTickers(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetMasterAccDepositAddress ¶
func (s *BybitClientRequest) GetMasterAccDepositAddress(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetMovePositionHistory ¶
func (s *BybitClientRequest) GetMovePositionHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetOpenInterests ¶
func (s *BybitClientRequest) GetOpenInterests(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetOpenOrders ¶
func (s *BybitClientRequest) GetOpenOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetOrderBookInfo ¶
func (s *BybitClientRequest) GetOrderBookInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetOrderHistory ¶
func (s *BybitClientRequest) GetOrderHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetPositionList ¶
func (s *BybitClientRequest) GetPositionList(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetPreUpgradeClosedPnl ¶
func (s *BybitClientRequest) GetPreUpgradeClosedPnl(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetPreUpgradeOptionDeliveryRecord ¶
func (s *BybitClientRequest) GetPreUpgradeOptionDeliveryRecord(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetPreUpgradeOrderHistory ¶
func (s *BybitClientRequest) GetPreUpgradeOrderHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetPreUpgradeTradeHistory ¶
func (s *BybitClientRequest) GetPreUpgradeTradeHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetPreUpgradeTransactionLog ¶
func (s *BybitClientRequest) GetPreUpgradeTransactionLog(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetPreUpgradeUsdcSettlement ¶
func (s *BybitClientRequest) GetPreUpgradeUsdcSettlement(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetPremiumIndexPriceKline ¶
func (s *BybitClientRequest) GetPremiumIndexPriceKline(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetPublicRecentTrades ¶
func (s *BybitClientRequest) GetPublicRecentTrades(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetSelfMarketProtectionGroup ¶
func (s *BybitClientRequest) GetSelfMarketProtectionGroup(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetServerTime ¶
func (s *BybitClientRequest) GetServerTime(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetSingleCoinsBalance ¶
func (s *BybitClientRequest) GetSingleCoinsBalance(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetSpotBorrowQuota ¶
func (s *BybitClientRequest) GetSpotBorrowQuota(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetSpotMarginBorrowCoin
deprecated
func (s *BybitClientRequest) GetSpotMarginBorrowCoin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
Deprecated: GetSpotMarginBorrowCoin is deprecated.
func (*BybitClientRequest) GetSpotMarginBorrowOrders
deprecated
func (s *BybitClientRequest) GetSpotMarginBorrowOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
Deprecated: GetSpotMarginBorrowOrders is deprecated.
func (*BybitClientRequest) GetSpotMarginCoin
deprecated
func (s *BybitClientRequest) GetSpotMarginCoin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
Deprecated: GetSpotMarginCoin is deprecated.
func (*BybitClientRequest) GetSpotMarginData ¶
func (s *BybitClientRequest) GetSpotMarginData(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetSpotMarginInterests ¶
func (s *BybitClientRequest) GetSpotMarginInterests(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetSpotMarginLoanAccountInfo
deprecated
func (s *BybitClientRequest) GetSpotMarginLoanAccountInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
Deprecated: GetSpotMarginLoanAccountInfo is deprecated.
func (*BybitClientRequest) GetSpotMarginRepaymentOrders
deprecated
func (s *BybitClientRequest) GetSpotMarginRepaymentOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
Deprecated: GetSpotMarginRepaymentOrders is deprecated.
func (*BybitClientRequest) GetSpotMarginState ¶
func (s *BybitClientRequest) GetSpotMarginState(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetSubAccDepositAddress ¶
func (s *BybitClientRequest) GetSubAccDepositAddress(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetSubAccUids ¶
func (s *BybitClientRequest) GetSubAccUids(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetSubMemberDepositRecords ¶
func (s *BybitClientRequest) GetSubMemberDepositRecords(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetSubUidList ¶
func (s *BybitClientRequest) GetSubUidList(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetSubUidListUnlimited ¶
func (s *BybitClientRequest) GetSubUidListUnlimited(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetTradeHistory ¶
func (s *BybitClientRequest) GetTradeHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetTransactionLog ¶
func (s *BybitClientRequest) GetTransactionLog(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetTransferableCoin ¶
func (s *BybitClientRequest) GetTransferableCoin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetUidWalletType ¶
func (s *BybitClientRequest) GetUidWalletType(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetUniversalTransferRecords ¶
func (s *BybitClientRequest) GetUniversalTransferRecords(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetUsdcSettlement ¶
func (s *BybitClientRequest) GetUsdcSettlement(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetWithdrawalAmount ¶
func (s *BybitClientRequest) GetWithdrawalAmount(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) GetWithdrawalRecords ¶
func (s *BybitClientRequest) GetWithdrawalRecords(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) ModifyMasterAPIKey ¶
func (s *BybitClientRequest) ModifyMasterAPIKey(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) ModifySubAPIKey ¶
func (s *BybitClientRequest) ModifySubAPIKey(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) MovePosition ¶
func (s *BybitClientRequest) MovePosition(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) PlaceBatchOrder ¶
func (s *BybitClientRequest) PlaceBatchOrder(ctx context.Context, opts ...RequestOption) (res *models.BatchOrderServerResponse, err error)
func (*BybitClientRequest) PlaceOrder ¶
func (s *BybitClientRequest) PlaceOrder(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) PurchaseLeverageToken ¶
func (s *BybitClientRequest) PurchaseLeverageToken(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) RedeemLeverageToken ¶
func (s *BybitClientRequest) RedeemLeverageToken(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) RepaySpotMarginLoan
deprecated
func (s *BybitClientRequest) RepaySpotMarginLoan(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
Deprecated: RepaySpotMarginLoan is deprecated.
func (*BybitClientRequest) RequestConvertQuote ¶
func (s *BybitClientRequest) RequestConvertQuote(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) RequestTestFund ¶
func (s *BybitClientRequest) RequestTestFund(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) ResetMarketMakerProtection ¶
func (s *BybitClientRequest) ResetMarketMakerProtection(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) SetCollateralCoin ¶
func (s *BybitClientRequest) SetCollateralCoin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) SetDepositAccount ¶
func (s *BybitClientRequest) SetDepositAccount(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) SetDisconnectCancelAll ¶
func (s *BybitClientRequest) SetDisconnectCancelAll(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) SetMarginMode ¶
func (s *BybitClientRequest) SetMarginMode(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) SetMarketMakerProtection ¶
func (s *BybitClientRequest) SetMarketMakerProtection(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) SetPositionAutoMargin ¶
func (s *BybitClientRequest) SetPositionAutoMargin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) SetPositionLeverage ¶
func (s *BybitClientRequest) SetPositionLeverage(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) SetPositionRiskLimit
deprecated
func (s *BybitClientRequest) SetPositionRiskLimit(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
Deprecated: SetPositionRiskLimit is deprecated. Since bybit has launched auto risk limit depends on current leverage
func (*BybitClientRequest) SetPositionTpslMode
deprecated
func (s *BybitClientRequest) SetPositionTpslMode(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
Deprecated: SetPositionTpslMode is deprecated. now tpsl is based on order level
func (*BybitClientRequest) SetPositionTradingStop ¶
func (s *BybitClientRequest) SetPositionTradingStop(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) SetSpotHedgeMode ¶
func (s *BybitClientRequest) SetSpotHedgeMode(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) SetSpotMarginLeverage ¶
func (s *BybitClientRequest) SetSpotMarginLeverage(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) SwitchPositionMargin ¶
func (s *BybitClientRequest) SwitchPositionMargin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) SwitchPositionMode ¶
func (s *BybitClientRequest) SwitchPositionMode(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) ToggleSpotMarginTrade ¶
func (s *BybitClientRequest) ToggleSpotMarginTrade(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) UpdatePositionMargin ¶
func (s *BybitClientRequest) UpdatePositionMargin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)
func (*BybitClientRequest) UpgradeToUTA ¶
func (s *BybitClientRequest) UpgradeToUTA(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 ProxyURL string // 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) NewClassicalBybitServiceNoParams ¶
func (c *Client) NewClassicalBybitServiceNoParams() *BybitClientRequest
func (*Client) NewClassicalBybitServiceWithParams ¶
func (c *Client) NewClassicalBybitServiceWithParams(params map[string]interface{}) *BybitClientRequest
func (*Client) NewPlaceOrderService ¶
NewPlaceOrderService quick order endpoint
func (*Client) NewUtaBybitServiceNoParams ¶
func (c *Client) NewUtaBybitServiceNoParams() *BybitClientRequest
func (*Client) NewUtaBybitServiceWithParams ¶
func (c *Client) NewUtaBybitServiceWithParams(params map[string]interface{}) *BybitClientRequest
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.
func WithProxyURL ¶
func WithProxyURL(proxyURL string) ClientOption
WithProxyURL is a client option to set the proxy url
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 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 ServerResponse struct { RetCode int `json:"retCode"` RetMsg string `json:"retMsg"` Result interface{} `json:"result"` RetExtInfo struct{} `json:"retExtInfo"` Time int64 `json:"time"` }
func GetServerResponse ¶
func GetServerResponse(err error, data []byte) (*ServerResponse, 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, handler MessageHandler) *WebSocket
func (*WebSocket) Disconnect ¶
func (*WebSocket) IsConnected ¶
func (*WebSocket) SendSubscription ¶
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