bybit_connector

package module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2025 License: MIT Imports: 20 Imported by: 0

README

bybit-go-api

GO 1.21.0 Contributor Victor

Table of Contents

About

The Official Go Lang API connector for Bybit's HTTP and WebSocket APIs.

Dive into a plethora of functionalities:

  • Market Data Retrieval
  • Trade Execution
  • Position Management
  • Account and Asset Info Retrieval
  • User and Upgrade Management
  • Public Websocket Streaming
  • Private Websocket Streaming
  • Institution Loan
  • Crypto Loan
  • Broker
  • Earn
  • Spread Trade

bybit-go-api provides an official, robust, and high-performance go connector to Bybit's trading APIs.

Initially conceptualized by go developer Victor, this module is now maintained by Bybit's in-house go experts.

Your contributions are most welcome!

Development

bybit-go-api is under active development with the latest features and updates from Bybit's API implemented promptly. The module utilizes minimal external libraries to provide a lightweight and efficient experience. If you've made enhancements or fixed bugs, please submit a pull request.

Installation

Ensure you have go 1.21.0 or higher. And use dependencies as below

require (
	github.com/google/uuid v1.4.0
	github.com/gorilla/websocket v1.5.1
	github.com/stretchr/testify v1.8.4
)

To import my package you need just to put the link to your go mode file github.com/khanbekov/go-bybit

Usage

Note: Replace placeholders (like YOUR_API_KEY, links, or other details) with the actual information. You can also customize this template to better fit the actual state and details of your Java API.

Rest API
  • Place an order by Map
client := bybit.NewBybitHttpClient("YOUR_API_KEY", "YOUR_API_SECRET", bybit.WithBaseURL(bybit.TESTNET))
params := map[string]interface{}{"category": "linear", "symbol": "BTCUSDT", "side": "Buy", "positionIdx": 0, "orderType": "Limit", "qty": "0.001", "price": "10000", "timeInForce": "GTC"}
orderResult, err := client.NewUtaBybitServiceWithParams(params).PlaceOrder(context.Background())
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(bybit.PrettyPrint(orderResult))
  • Place an order by Trade Class
client := bybit.NewBybitHttpClient("YOUR_API_KEY", "YOUR_API_SECRET", bybit.WithBaseURL(bybit.TESTNET))
orderResult, err := client.NewPlaceOrderService("linear", "XRPUSDT", "Buy", "Market", "10").Do(context.Background())
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(bybit.PrettyPrint(orderResult))
  • Place batch order
client := bybit.NewBybitHttpClient("YOUR_API_KEY", "YOUR_API_SECRET", bybit.WithBaseURL(bybit.TESTNET))
params := map[string]interface{}{"category": "option",
	"request": []map[string]interface{}{
		{
			"category":    "option",
			"symbol":      "BTC-10FEB23-24000-C",
			"orderType":   "Limit",
			"side":        "Buy",
			"qty":         "0.1",
			"price":       "5",
			"orderIv":     "0.1",
			"timeInForce": "GTC",
			"orderLinkId": "9b381bb1-401",
			"mmp":         false,
			"reduceOnly":  false,
		},
		{
			"category":    "option",
			"symbol":      "BTC-10FEB23-24000-C",
			"orderType":   "Limit",
			"side":        "Buy",
			"qty":         "0.1",
			"price":       "5",
			"orderIv":     "0.1",
			"timeInForce": "GTC",
			"orderLinkId": "82ee86dd-001",
			"mmp":         false,
			"reduceOnly":  false,
		},
	},
}
orderResult, err := client.NewUtaBybitServiceWithParams(params).PlaceBatchOrder(context.Background())
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(bybit.PrettyPrint(orderResult))
  • Get Position
client := bybit.NewBybitHttpClient("YOUR_API_KEY", "YOUR_API_SECRET", bybit.WithBaseURL(bybit.TESTNET))
params := map[string]interface{}{"category": "linear", "settleCoin": "USDT", "limit": 10}
orderResult, err := client.NewUtaBybitServiceWithParams(params).GetPositionList(context.Background())
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(bybit.PrettyPrint(orderResult))
  • Get Transaction Log
client := bybit.NewBybitHttpClient("YOUR_API_KEY", "YOUR_API_SECRET", bybit.WithBaseURL(bybit.TESTNET))
params := map[string]interface{}{"accountType": "UNIFIED", "category": "linear"}
accountResult, err := client.NewUtaBybitServiceWithParams(params).GetTransactionLog(context.Background())
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(bybit.PrettyPrint(accountResult))
Websocket Trade channel
ws := bybit.NewBybitPrivateWebSocket(bybit.WEBSOCKET_TRADE_TESTNET, "YOUR_API_KEY", "YOUR_API_SECRET", func(message string) error {
fmt.Println("Received:", message)
return nil
}, bybit.WithPingInterval(10))
_, _ = ws.Connect().SendTradeRequest(map[string]interface{}{
"reqId": "test-005",
"header": map[string]string{
"X-BAPI-TIMESTAMP":   fmt.Sprintf("%d", time.Now().UnixMilli()),
"X-BAPI-RECV-WINDOW": "8000",
"Referer":            "bot-001",
},
"op": "order.create",
"args": []interface{}{
map[string]interface{}{
"symbol":      "ETHUSDT",
"side":        "Buy",
"orderType":   "Limit",
"qty":         "0.2",
"price":       "2800",
"category":    "linear",
"timeInForce": "PostOnly",
},
},
})
select {}
Websocket public channel
  • Order book Subscribe
ws := bybit.NewBybitPublicWebSocket("wss://stream.bybit.com/v5/public/spot", func(message string) error {
fmt.Println("Received:", message)
return nil
})
_ = ws.Connect([]string{"orderbook.1.BTCUSDT"})
select {}
Websocket private channel
ws := bybit.NewBybitPrivateWebSocket("wss://stream-testnet.bybit.com/v5/private", "YOUR_API_KEY", "YOUR_API_SECRET", func(message string) error {
	fmt.Println("Received:", message)
	return nil
})
_ = ws.Connect([]string{"order"})
select {}

Contact

For support, join our Bybit API community on Telegram.

Contributors

List of other contributors


Victor

💻 📖

Documentation

Index

Constants

View Source
const (
	Name    = "bybit.api.go"
	Version = "1.0.7"
	// 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"
	NETHERLAND_ENV = "https://api.bybit.nl"
	HONGKONG_ENV   = "https://api.byhkbit.com"
	TURKEY_ENV     = "https://api.bybit-tr.com"
	KAZAKHSTAN_ENV = "https://api.bybit.kz"

	// 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"
	SPREAD_MAINNET  = "wss://stream.bybit.com/v5/public/spread"

	// 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"
	SPREAD_TESTNET  = "wss://stream-testnet.bybit.com/v5/public/spread"

	// 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://stream-demo.bybit.com/v5/private"
	WEBSOCKET_TRADE_DEMO      = "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

func FormatTimestamp(t time.Time) int64

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 PrettyPrint

func PrettyPrint(i interface{}) string

func SendRequest

func SendRequest(ctx context.Context, opts []RequestOption, r *request, s *BybitClientRequest, err error) ([]byte, error)

Types

type BybitClientRequest

type BybitClientRequest struct {
	// contains filtered or unexported fields
}

func (*BybitClientRequest) AdjustCollateralAmount

func (s *BybitClientRequest) AdjustCollateralAmount(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) AdjustCryptoLoanToValue deprecated

func (s *BybitClientRequest) AdjustCryptoLoanToValue(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

Deprecated: AdjustCryptoLoanToValue is deprecated.

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) AmendSpreadTradeOrder

func (s *BybitClientRequest) AmendSpreadTradeOrder(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) BatchSetCollateralCoin

func (s *BybitClientRequest) BatchSetCollateralCoin(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) BorrowCryptoLoan deprecated

func (s *BybitClientRequest) BorrowCryptoLoan(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

Deprecated: BorrowCryptoLoan is deprecated.

func (*BybitClientRequest) BorrowFixedLoan

func (s *BybitClientRequest) BorrowFixedLoan(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) BorrowFlexibleLoan

func (s *BybitClientRequest) BorrowFlexibleLoan(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) CancelAllSpreadTradeOrder

func (s *BybitClientRequest) CancelAllSpreadTradeOrder(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) CancelBorrowFixedLoan

func (s *BybitClientRequest) CancelBorrowFixedLoan(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) CancelOrder

func (s *BybitClientRequest) CancelOrder(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) CancelSpreadTradeOrder

func (s *BybitClientRequest) CancelSpreadTradeOrder(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) CancelSupplyFixedLoan

func (s *BybitClientRequest) CancelSupplyFixedLoan(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) DistributeBrokerVoucher

func (s *BybitClientRequest) DistributeBrokerVoucher(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) FixedLoanRepaymentHistory

func (s *BybitClientRequest) FixedLoanRepaymentHistory(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) GetAffiliateUserList

func (s *BybitClientRequest) GetAffiliateUserList(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) GetBorrowableCoins

func (s *BybitClientRequest) GetBorrowableCoins(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) GetCollateralAdjustHistory

func (s *BybitClientRequest) GetCollateralAdjustHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) GetCollateralCoins

func (s *BybitClientRequest) GetCollateralCoins(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) GetCryptoLoanAdjustHistory deprecated

func (s *BybitClientRequest) GetCryptoLoanAdjustHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

Deprecated: GetCryptoLoanAdjustHistory is deprecated.

func (*BybitClientRequest) GetCryptoLoanBorrowHistory deprecated

func (s *BybitClientRequest) GetCryptoLoanBorrowHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

Deprecated: GetCryptoLoanBorrowHistory is deprecated.

func (*BybitClientRequest) GetCryptoLoanBorrowInfo deprecated

func (s *BybitClientRequest) GetCryptoLoanBorrowInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

Deprecated: GetCryptoLoanBorrowInfo is deprecated.

func (*BybitClientRequest) GetCryptoLoanBorrowLimit deprecated

func (s *BybitClientRequest) GetCryptoLoanBorrowLimit(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

Deprecated: GetCryptoLoanBorrowLimit is deprecated.

func (*BybitClientRequest) GetCryptoLoanCollateralInfo deprecated

func (s *BybitClientRequest) GetCryptoLoanCollateralInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

Deprecated: GetCryptoLoanCollateralInfo is deprecated.

func (*BybitClientRequest) GetCryptoLoanCompletedHistory deprecated

func (s *BybitClientRequest) GetCryptoLoanCompletedHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

Deprecated: GetCryptoLoanCompletedHistory is deprecated.

func (*BybitClientRequest) GetCryptoLoanMaxCollateral deprecated

func (s *BybitClientRequest) GetCryptoLoanMaxCollateral(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

Deprecated: GetCryptoLoanMaxCollateral is deprecated.

func (*BybitClientRequest) GetCryptoLoanPosition

func (s *BybitClientRequest) GetCryptoLoanPosition(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) GetCryptoLoanRepaymentHistory deprecated

func (s *BybitClientRequest) GetCryptoLoanRepaymentHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

Deprecated: GetCryptoLoanRepaymentHistory is deprecated.

func (*BybitClientRequest) GetCryptoLoanUnpaidLoans deprecated

func (s *BybitClientRequest) GetCryptoLoanUnpaidLoans(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

Deprecated: GetCryptoLoanUnpaidLoans is deprecated.

func (*BybitClientRequest) GetCustodianSubAccounts

func (s *BybitClientRequest) GetCustodianSubAccounts(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) GetEarnProductInfo

func (s *BybitClientRequest) GetEarnProductInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) GetEarnRedeemOrder

func (s *BybitClientRequest) GetEarnRedeemOrder(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) GetEarnRedeemPosition

func (s *BybitClientRequest) GetEarnRedeemPosition(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) GetExchangeEntityList

func (s *BybitClientRequest) GetExchangeEntityList(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) GetFixedBorrowContract

func (s *BybitClientRequest) GetFixedBorrowContract(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) GetFixedBorrowHistory

func (s *BybitClientRequest) GetFixedBorrowHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) GetFixedBorrowingMarket

func (s *BybitClientRequest) GetFixedBorrowingMarket(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) GetFixedSupplyContract

func (s *BybitClientRequest) GetFixedSupplyContract(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) GetFixedSupplyHistory

func (s *BybitClientRequest) GetFixedSupplyHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) GetFixedSupplyingMarket

func (s *BybitClientRequest) GetFixedSupplyingMarket(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) GetFlexibleBorrowHistory

func (s *BybitClientRequest) GetFlexibleBorrowHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) GetFlexibleLoans

func (s *BybitClientRequest) GetFlexibleLoans(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) GetFlexibleRepaymentHistory

func (s *BybitClientRequest) GetFlexibleRepaymentHistory(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 deprecated

func (s *BybitClientRequest) GetLeverageTokenInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

Deprecated: GetLeverageTokenInfo is deprecated.

func (*BybitClientRequest) GetLeverageTokenMarket deprecated

func (s *BybitClientRequest) GetLeverageTokenMarket(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

Deprecated: GetLeverageTokenMarket is deprecated.

func (*BybitClientRequest) GetLeverageTokenOrders deprecated

func (s *BybitClientRequest) GetLeverageTokenOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

Deprecated: GetLeverageTokenOrders is deprecated.

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) GetMaxCollateralAmount

func (s *BybitClientRequest) GetMaxCollateralAmount(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) GetOptionClosedPosition

func (s *BybitClientRequest) GetOptionClosedPosition(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) GetOrderPriceLimit

func (s *BybitClientRequest) GetOrderPriceLimit(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) GetSpreadRecentTrade

func (s *BybitClientRequest) GetSpreadRecentTrade(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) GetSpreadTradeHistory

func (s *BybitClientRequest) GetSpreadTradeHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) GetSpreadTradeInstrumentsInfo

func (s *BybitClientRequest) GetSpreadTradeInstrumentsInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) GetSpreadTradeOrderBook

func (s *BybitClientRequest) GetSpreadTradeOrderBook(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) GetSpreadTradeOrderHistory

func (s *BybitClientRequest) GetSpreadTradeOrderHistory(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) GetSpreadTradeTickers

func (s *BybitClientRequest) GetSpreadTradeTickers(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) GetSubUidApiKeysInfo

func (s *BybitClientRequest) GetSubUidApiKeysInfo(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) GetTieredCollateralData

func (s *BybitClientRequest) GetTieredCollateralData(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) GetTransferableAmount

func (s *BybitClientRequest) GetTransferableAmount(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) PlacePreCheckOrder

func (s *BybitClientRequest) PlacePreCheckOrder(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) PlaceSpreadTradeOrder

func (s *BybitClientRequest) PlaceSpreadTradeOrder(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) PurchaseLeverageToken deprecated

func (s *BybitClientRequest) PurchaseLeverageToken(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

Deprecated: PurchaseLeverageToken is deprecated.

func (*BybitClientRequest) QueryBrokerVoucherSpec

func (s *BybitClientRequest) QueryBrokerVoucherSpec(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

Broker Reward

func (*BybitClientRequest) QueryDistributedBrokerVoucher

func (s *BybitClientRequest) QueryDistributedBrokerVoucher(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) RedeemEarnOrder

func (s *BybitClientRequest) RedeemEarnOrder(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) RedeemLeverageToken deprecated

func (s *BybitClientRequest) RedeemLeverageToken(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

Deprecated: RedeemLeverageToken is deprecated.

func (*BybitClientRequest) RepayCryptoLoan deprecated

func (s *BybitClientRequest) RepayCryptoLoan(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

Deprecated: RepayCryptoLoan is deprecated.

func (*BybitClientRequest) RepayFixedLoan

func (s *BybitClientRequest) RepayFixedLoan(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) RepayFlexibleLoan

func (s *BybitClientRequest) RepayFlexibleLoan(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*BybitClientRequest) RepayLiability

func (s *BybitClientRequest) RepayLiability(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) SupplyFixedLoan

func (s *BybitClientRequest) SupplyFixedLoan(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

func (c *Client) NewPlaceOrderService(category, symbol, side, orderType, qty string) *Order

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 WithDebug

func WithDebug(debug bool) ClientOption

WithDebug print more details in debug mode

func WithProxyURL

func WithProxyURL(proxyURL string) ClientOption

WithProxyURL is a client option to set the proxy url

type MessageHandler

type MessageHandler func(message string) error

type Order

type Order struct {
	// contains filtered or unexported fields
}

func (*Order) CloseOnTrigger

func (order *Order) CloseOnTrigger(close bool) *Order

func (*Order) Do

func (order *Order) Do(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error)

func (*Order) IsLeverage

func (order *Order) IsLeverage(isLeverage int) *Order

func (*Order) MarketUnit

func (order *Order) MarketUnit(marketUnit string) *Order

func (*Order) Mmp

func (order *Order) Mmp(mmp bool) *Order

func (*Order) OrderFilter

func (order *Order) OrderFilter(filter string) *Order

func (*Order) OrderIv

func (order *Order) OrderIv(iv string) *Order

func (*Order) OrderLinkId

func (order *Order) OrderLinkId(orderLinkId string) *Order

func (*Order) PositionIdx

func (order *Order) PositionIdx(idx int) *Order

func (*Order) Price

func (order *Order) Price(price string) *Order

func (*Order) ReduceOnly

func (order *Order) ReduceOnly(reduce bool) *Order

func (*Order) SlLimitPrice

func (order *Order) SlLimitPrice(price string) *Order

func (*Order) SlOrderType

func (order *Order) SlOrderType(orderType string) *Order

func (*Order) SlTriggerBy

func (order *Order) SlTriggerBy(triggerBy string) *Order

func (*Order) SlippageTolerance

func (order *Order) SlippageTolerance(slippageTolerance string) *Order

func (*Order) SlippageToleranceType

func (order *Order) SlippageToleranceType(slippageToleranceType string) *Order

func (*Order) SmpType

func (order *Order) SmpType(smp string) *Order

func (*Order) StopLoss

func (order *Order) StopLoss(loss string) *Order

func (*Order) TakeProfit

func (order *Order) TakeProfit(profit string) *Order

func (*Order) TimeInForce

func (order *Order) TimeInForce(tif string) *Order

func (*Order) TpLimitPrice

func (order *Order) TpLimitPrice(price string) *Order

func (*Order) TpOrderType

func (order *Order) TpOrderType(orderType string) *Order

func (*Order) TpTriggerBy

func (order *Order) TpTriggerBy(triggerBy string) *Order

func (*Order) TpslMode

func (order *Order) TpslMode(mode string) *Order

func (*Order) TriggerBy

func (order *Order) TriggerBy(triggerBy string) *Order

func (*Order) TriggerDirection

func (order *Order) TriggerDirection(direction int) *Order

func (*Order) TriggerPrice

func (order *Order) TriggerPrice(triggerPrice string) *Order

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) Connect

func (b *WebSocket) Connect() *WebSocket

func (*WebSocket) Disconnect

func (b *WebSocket) Disconnect() error

func (*WebSocket) SendRequest

func (b *WebSocket) SendRequest(op string, args map[string]interface{}, headers map[string]string, reqId ...string) (*WebSocket, error)

SendRequest sendRequest sends a custom request over the WebSocket connection.

func (*WebSocket) SendSubscription

func (b *WebSocket) SendSubscription(args []string) (*WebSocket, error)

func (*WebSocket) SendTradeRequest

func (b *WebSocket) SendTradeRequest(tradeTruest map[string]interface{}) (*WebSocket, error)

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

Directories

Path Synopsis
examples
Account command
Asset command
Earn command
Market command
Position command
SpreadTrade command
Trade command
Websocket command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL