bybit

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 12 Imported by: 0

README

bybit-go

test lint Go Reference

Go client for the Bybit REST APIs. Typed as strongly as possible.

Domains:

  • market
  • order
  • position
  • pre-upgrade
  • account
  • asset
  • user
  • spread
  • rfq
  • spot-margin-uta
  • new-crypto-loan
  • crypto-loan
  • otc
  • broker
  • earn

Usage

package main

import (
	"context"
	"fmt"
	"os"

	"github.com/fullpipe/bybit-go"
)

func main() {
	ctx := context.Background()
	apiKey := os.Getenv("BYBIT_API_KEY")
	apiSecret := os.Getenv("BYBIT_API_SECRET")

	client, err := bybit.NewBybitClient(apiKey, apiSecret, bybit.WithBaseURL(bybit.MAINNET))
	if err != nil {
		panic(err)
	}

	// Set current Leverage
	err = client.SpotMarginTradeSetLeverage(ctx, bybit.SpotMarginTradeSetLeverageParams{Leverage: "5"})
	if err != nil {
		panic(err)
	}

	// Get MarkPriceKline
	mk, err := client.GetMarketMarkPriceKline(ctx, bybit.MarketMarkPriceKlineQuery{
		Category: bybit.CategoryLinear,
		Symbol:   bybit.SymbolBtcusdt,
		Interval: bybit.Interval1,
		Limit:    5,
	})
	if err != nil {
		panic(err)
	}

	fmt.Println(mk)
}

TODO

  • websocket client
  • parse types with ... (ms) in comments as int64, even its is string originaly
  • not all enums detected, like AssetSettlementRecordListItem.Symbol
  • remove github.com/google/go-querystring/query dep?
  • as I understand "price" field are strings because possible overflow of int64, parse them to big.Int or add custom string type wrapper

Contributing

Contributions are welcome!

  • but if you found problem within *_gen.go files please open issue first.
  • if some domain is missing also open issue first

Documentation

Index

Constants

View Source
const (
	MAINNET        = "https://api.bybit.com"
	MAINNET_BACKT  = "https://api.bytick.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"

	TESTNET  = "https://api-testnet.bybit.com"
	DEMO_ENV = "https://api-demo.bybit.com"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	// Code is the status code of the error response.
	Code int `json:"retCode"`

	// Message contains a human-readable description of the error.
	Message string `json:"retMsg"`

	// Path contains the URL where the request was made.
	Path string `json:"-"`

	// Method contains the HTTP method used in the request.
	Method string `json:"-"`
}

APIError represents an error response from Bybit API.

func (APIError) Error

func (e APIError) Error() string

type AccountBorrowHistory

type AccountBorrowHistory struct {
	// Object
	List []AccountBorrowHistoryListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type AccountBorrowHistoryListItem

type AccountBorrowHistoryListItem struct {
	// `USDC`,`USDT`,`BTC`,`ETH`
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
	// Created timestamp (ms)
	CreatedTime int64 `json:"createdTime,omitempty" url:"createdTime,omitempty"`
	// Interest
	BorrowCost string `json:"borrowCost,omitempty" url:"borrowCost,omitempty"`
	// Hourly Borrow Rate
	HourlyBorrowRate string `json:"hourlyBorrowRate,omitempty" url:"hourlyBorrowRate,omitempty"`
	// Interest Bearing Borrow Size
	InterestBearingBorrowSize string `json:"InterestBearingBorrowSize,omitempty" url:"InterestBearingBorrowSize,omitempty"`
	// Cost exemption
	CostExemption string `json:"costExemption,omitempty" url:"costExemption,omitempty"`
	// Total borrow amount
	BorrowAmount string `json:"borrowAmount,omitempty" url:"borrowAmount,omitempty"`
	// Unrealised loss
	UnrealisedLoss string `json:"unrealisedLoss,omitempty" url:"unrealisedLoss,omitempty"`
	// The borrowed amount for interest free
	FreeBorrowedAmount string `json:"freeBorrowedAmount,omitempty" url:"freeBorrowedAmount,omitempty"`
}

type AccountBorrowHistoryQuery

type AccountBorrowHistoryQuery struct {
	// `USDC`,`USDT`,`BTC`,`ETH` etc, uppercase only
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
	// The start timestamp (ms)
	//
	// 	- startTime and endTime are not passed, return 30 days by default
	// 	- Only startTime is passed, return range between startTime and startTime + 30 days
	// 	- Only endTime is passed, return range between endTime-30 days and endTime
	// 	- If both are passed, the rule is endTime - startTime <= 30 days
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end time. timestamp (ms)
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Limit for data size per page. \[`1`, `50`\]. Default: `20`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type AccountBorrowParams

type AccountBorrowParams struct {
	// coin name, uppercase only
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Borrow amount
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
}

type AccountBorrowResult

type AccountBorrowResult struct {
	// coin name, uppercase only
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Borrow amount
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
}

type AccountCollateralInfo

type AccountCollateralInfo struct {
	// Object
	List []AccountCollateralInfoListItem `json:"list,omitempty" url:"list,omitempty"`
}

type AccountCollateralInfoListItem

type AccountCollateralInfoListItem struct {
	// Currency of all current collateral
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
	// Hourly borrow rate
	HourlyBorrowRate string `json:"hourlyBorrowRate,omitempty" url:"hourlyBorrowRate,omitempty"`
	// Max borrow amount. This value is shared across main-sub UIDs
	MaxBorrowingAmount string `json:"maxBorrowingAmount,omitempty" url:"maxBorrowingAmount,omitempty"`
	// The maximum limit for interest-free borrowing
	//
	// 	- Only the borrowing caused by contracts unrealised loss has interest-free amount
	// 	- Spot margin borrowing always has interest
	FreeBorrowingLimit string `json:"freeBorrowingLimit,omitempty" url:"freeBorrowingLimit,omitempty"`
	// The amount of borrowing within your total borrowing amount that is exempt from interest charges
	FreeBorrowAmount string `json:"freeBorrowAmount,omitempty" url:"freeBorrowAmount,omitempty"`
	// Borrow amount
	BorrowAmount string `json:"borrowAmount,omitempty" url:"borrowAmount,omitempty"`
	// The sum of borrowing amount for other accounts under the same main account
	OtherBorrowAmount string `json:"otherBorrowAmount,omitempty" url:"otherBorrowAmount,omitempty"`
	// Available amount to borrow. This value is shared across main-sub UIDs
	AvailableToBorrow string `json:"availableToBorrow,omitempty" url:"availableToBorrow,omitempty"`
	// Whether currency can be borrowed
	Borrowable bool `json:"borrowable,omitempty" url:"borrowable,omitempty"`
	// Borrow usage rate: sum of main & sub accounts borrowAmount/maxBorrowingAmount, it is an actual value, 0.5 means 50%
	BorrowUsageRate string `json:"borrowUsageRate,omitempty" url:"borrowUsageRate,omitempty"`
	// Whether it can be used as a margin collateral currency (platform), `true`: YES, `false`: NO
	//
	// 	- When marginCollateral=false, then collateralSwitch is meaningless
	MarginCollateral bool `json:"marginCollateral,omitempty" url:"marginCollateral,omitempty"`
	// Whether the collateral is turned on by user (user), `true`: ON, `false`: OFF
	//
	// 	- When marginCollateral=true, then collateralSwitch is meaningful
	CollateralSwitch bool `json:"collateralSwitch,omitempty" url:"collateralSwitch,omitempty"`
	// **Deprecated** field. Due to the new Tiered Collateral value logic, this field will no longer be accurate starting on February 19, 2025. Please refer to [Get Tiered Collateral Ratio](/docs/v5/spot-margin-uta/tier-collateral-ratio)
	CollateralRatio string `json:"collateralRatio,omitempty" url:"collateralRatio,omitempty"`
	// **Deprecated** field, always return `""`, please refer to `freeBorrowingLimit`
	FreeBorrowingAmount string `json:"freeBorrowingAmount,omitempty" url:"freeBorrowingAmount,omitempty"`
}

type AccountCollateralInfoQuery

type AccountCollateralInfoQuery struct {
	// Asset currency of all current collateral, uppercase only
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
}

type AccountDemoApplyMoneyParams

type AccountDemoApplyMoneyParams struct {
	// `0`(default): add demo funds; `1`: reduce demo funds
	AdjustType        int64                                              `json:"adjustType,omitempty" url:"adjustType,omitempty"`
	UtaDemoApplyMoney []AccountDemoApplyMoneyParamsUtaDemoApplyMoneyItem `json:"utaDemoApplyMoney,omitempty" url:"utaDemoApplyMoney,omitempty"`
}

type AccountDemoApplyMoneyParamsUtaDemoApplyMoneyItem

type AccountDemoApplyMoneyParamsUtaDemoApplyMoneyItem struct {
	// Applied coin, supports `BTC`, `ETH`, `USDT`, `USDC`
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Applied amount, the max applied amount in each request
	//
	// 	- `BTC`: "15"
	// 	- `ETH`: "200"
	// 	- `USDT`: "100000"
	// 	- `USDC`: "100000"
	AmountStr string `json:"amountStr,omitempty" url:"amountStr,omitempty"`
}

type AccountDemoApplyMoneyResult

type AccountDemoApplyMoneyResult struct {
	// Demo account ID
	SubMemberId string `json:"subMemberId,omitempty" url:"subMemberId,omitempty"`
}

type AccountFeeRate

type AccountFeeRate struct {
	// Product type. `spot`, `option`. _Derivatives does not have this field_
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Object
	List []AccountFeeRateListItem `json:"list,omitempty" url:"list,omitempty"`
}

type AccountFeeRateListItem

type AccountFeeRateListItem struct {
	// Symbol name. Keeps `""` for Options
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Base coin. `SOL`, `BTC`, `ETH`
	//
	// 	- Spot and Derivatives does not have this field
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
	// Taker fee rate
	TakerFeeRate string `json:"takerFeeRate,omitempty" url:"takerFeeRate,omitempty"`
	// Maker fee rate
	MakerFeeRate string `json:"makerFeeRate,omitempty" url:"makerFeeRate,omitempty"`
}

type AccountFeeRateQuery

type AccountFeeRateQuery struct {
	// Product type. `spot`, `linear`, `inverse`, `option`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only. Valid for `linear`, `inverse`, `spot`
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Base coin, uppercase only. `SOL`, `BTC`, `ETH`. Valid for `option`
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
}

type AccountInfo

type AccountInfo struct {
	// Account status
	UnifiedMarginStatus UnifiedMarginStatus `json:"unifiedMarginStatus,omitempty" url:"unifiedMarginStatus,omitempty"`
	// `ISOLATED_MARGIN`, `REGULAR_MARGIN`, `PORTFOLIO_MARGIN`
	MarginMode string `json:"marginMode,omitempty" url:"marginMode,omitempty"`
	// Whether this account is a leader (copytrading). `true`, `false`
	IsMasterTrader bool `json:"isMasterTrader,omitempty" url:"isMasterTrader,omitempty"`
	// Whether the unified account enables Spot hedging. `ON`, `OFF`
	SpotHedgingStatus string `json:"spotHedgingStatus,omitempty" url:"spotHedgingStatus,omitempty"`
	// Account data updated timestamp (ms)
	UpdatedTime string `json:"updatedTime,omitempty" url:"updatedTime,omitempty"`
	// deprecated, always `OFF`. Please use [Get DCP Info](/docs/v5/account/dcp-info)
	DcpStatus string `json:"dcpStatus,omitempty" url:"dcpStatus,omitempty"`
	// deprecated, always `0`. Please use [Get DCP Info](/docs/v5/account/dcp-info)
	TimeWindow int64 `json:"timeWindow,omitempty" url:"timeWindow,omitempty"`
	// deprecated, always `0`. Please query [Get SMP Group ID](/docs/v5/account/smp-group) endpoint
	SmpGroup int64 `json:"smpGroup,omitempty" url:"smpGroup,omitempty"`
}

type AccountInstrumentsInfoQuery

type AccountInstrumentsInfoQuery struct {
	// Product type. `spot`,`linear`,`inverse`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Limit for data size per page. \[`1`, `200`\]. Default: `200`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type AccountMmpModifyParams

type AccountMmpModifyParams struct {
	// Base coin, uppercase only
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
	// Time window (ms)
	Window string `json:"window,omitempty" url:"window,omitempty"`
	// Frozen period (ms). "0" means the trade will remain frozen until manually reset
	FrozenPeriod string `json:"frozenPeriod,omitempty" url:"frozenPeriod,omitempty"`
	// Trade qty limit (positive and up to 2 decimal places)
	QtyLimit string `json:"qtyLimit,omitempty" url:"qtyLimit,omitempty"`
	// Delta limit (positive and up to 2 decimal places)
	DeltaLimit string `json:"deltaLimit,omitempty" url:"deltaLimit,omitempty"`
}

type AccountMmpResetParams

type AccountMmpResetParams struct {
	// Base coin, uppercase only
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
}

type AccountMmpState

type AccountMmpState struct {
	// Base coin
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
	// Whether the account is enabled mmp
	MmpEnabled bool `json:"mmpEnabled,omitempty" url:"mmpEnabled,omitempty"`
	// Time window (ms)
	Window string `json:"window,omitempty" url:"window,omitempty"`
	// Frozen period (ms)
	FrozenPeriod string `json:"frozenPeriod,omitempty" url:"frozenPeriod,omitempty"`
	// Trade qty limit
	QtyLimit string `json:"qtyLimit,omitempty" url:"qtyLimit,omitempty"`
	// Delta limit
	DeltaLimit string `json:"deltaLimit,omitempty" url:"deltaLimit,omitempty"`
	// Unfreeze timestamp (ms)
	MmpFrozenUntil string `json:"mmpFrozenUntil,omitempty" url:"mmpFrozenUntil,omitempty"`
	// Whether the mmp is triggered.
	//
	// 	- `true`: mmpFrozenUntil is meaningful
	// 	- `false`: please ignore the value of mmpFrozenUntil
	MmpFrozen bool `json:"mmpFrozen,omitempty" url:"mmpFrozen,omitempty"`
}

type AccountMmpStateQuery

type AccountMmpStateQuery struct {
	// Base coin, uppercase only
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
}

type AccountNoConvertRepayParams

type AccountNoConvertRepayParams struct {
	// coin name, uppercase only
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Repay amount. If `coin` is not passed in input parameter, `amount` can not be passed in input parameter
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
}

type AccountNoConvertRepayResult

type AccountNoConvertRepayResult struct {
	// - `P`: Processing
	// 	- `SU`: Success
	// 	- `FA`: Failed
	ResultStatus string `json:"resultStatus,omitempty" url:"resultStatus,omitempty"`
}

type AccountQueryDcpInfo

type AccountQueryDcpInfo struct {
	// DCP config for each product
	DcpInfos []AccountQueryDcpInfoDcpInfosItem `json:"dcpInfos,omitempty" url:"dcpInfos,omitempty"`
}

type AccountQueryDcpInfoDcpInfosItem

type AccountQueryDcpInfoDcpInfosItem struct {
	// `SPOT`, `DERIVATIVES`, `OPTIONS`
	Product string `json:"product,omitempty" url:"product,omitempty"`
	// [Disconnected-CancelAll-Prevention](/docs/v5/order/dcp) status: `ON`
	DcpStatus string `json:"dcpStatus,omitempty" url:"dcpStatus,omitempty"`
	// DCP trigger time window which user pre-set. Between \[3, 300\] seconds, default: 10 sec
	TimeWindow string `json:"timeWindow,omitempty" url:"timeWindow,omitempty"`
}

type AccountQuickRepaymentParams

type AccountQuickRepaymentParams struct {
	// The coin with liability, uppercase only
	//
	// 	- Input the specific coin: repay the liability of this coin in particular
	// 	- No coin specified: repay the liability of all coins
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
}

type AccountQuickRepaymentResult

type AccountQuickRepaymentResult struct {
	// Object
	List []AccountQuickRepaymentResultListItem `json:"list,omitempty" url:"list,omitempty"`
}

type AccountQuickRepaymentResultListItem

type AccountQuickRepaymentResultListItem struct {
	// Coin used for repayment
	//
	// 	- The order of currencies used to repay liability is based on `liquidationOrder` from [this endpoint](/docs/v5/spot-margin-uta/vip-margin)
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Repayment qty
	RepaymentQty string `json:"repaymentQty,omitempty" url:"repaymentQty,omitempty"`
}

type AccountRepayParams

type AccountRepayParams struct {
	// coin name, uppercase only
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Repay amount. If `coin` is not passed in input parameter, `amount` can not be passed in input parameter
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
}

type AccountRepayResult

type AccountRepayResult struct {
	// - `P`: Processing
	// 	- `SU`: Success
	// 	- `FA`: Failed
	ResultStatus string `json:"resultStatus,omitempty" url:"resultStatus,omitempty"`
}

type AccountSetCollateralSwitchBatchParams

type AccountSetCollateralSwitchBatchParams struct {
	// Object
	Request []AccountSetCollateralSwitchBatchParamsRequestItem `json:"request,omitempty" url:"request,omitempty"`
}

type AccountSetCollateralSwitchBatchParamsRequestItem

type AccountSetCollateralSwitchBatchParamsRequestItem struct {
	// Coin name, uppercase only
	//
	// 	- You can get collateral coin from [here](/docs/v5/account/collateral-info)
	// 	- USDT, USDC cannot be set
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// `ON`: switch on collateral, `OFF`: switch off collateral
	CollateralSwitch string `json:"collateralSwitch,omitempty" url:"collateralSwitch,omitempty"`
}

type AccountSetCollateralSwitchBatchResult

type AccountSetCollateralSwitchBatchResult struct {
	// Object
	List []AccountSetCollateralSwitchBatchResultListItem `json:"list,omitempty" url:"list,omitempty"`
}

type AccountSetCollateralSwitchBatchResultListItem

type AccountSetCollateralSwitchBatchResultListItem struct {
	// Coin name
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// `ON`: switch on collateral, `OFF`: switch off collateral
	CollateralSwitch string `json:"collateralSwitch,omitempty" url:"collateralSwitch,omitempty"`
}

type AccountSetCollateralSwitchParams

type AccountSetCollateralSwitchParams struct {
	// Coin name, uppercase only
	//
	// 	- You can get collateral coin from [here](/docs/v5/account/collateral-info)
	// 	- USDT, USDC cannot be set
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// `ON`: switch on collateral, `OFF`: switch off collateral
	CollateralSwitch string `json:"collateralSwitch,omitempty" url:"collateralSwitch,omitempty"`
}

type AccountSetHedgingModeParams

type AccountSetHedgingModeParams struct {
	// `ON`, `OFF`
	SetHedgingMode string `json:"setHedgingMode,omitempty" url:"setHedgingMode,omitempty"`
}

type AccountSetHedgingModeResult

type AccountSetHedgingModeResult struct {
	// Result code
	RetCode int64 `json:"retCode,omitempty" url:"retCode,omitempty"`
	// Result message
	RetMsg string `json:"retMsg,omitempty" url:"retMsg,omitempty"`
}

type AccountSetLimitPxActionParams

type AccountSetLimitPxActionParams struct {
	// `linear`, `inverse`, `spot`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// `true`: allow the system to modify the order price
	// `false`: reject your order request
	ModifyEnable bool `json:"modifyEnable,omitempty" url:"modifyEnable,omitempty"`
}

type AccountSetMarginModeParams

type AccountSetMarginModeParams struct {
	// `ISOLATED_MARGIN`, `REGULAR_MARGIN`(i.e. Cross margin), `PORTFOLIO_MARGIN`
	SetMarginMode string `json:"setMarginMode,omitempty" url:"setMarginMode,omitempty"`
}

type AccountSetMarginModeResult

type AccountSetMarginModeResult struct {
	// Object. If requested successfully, it is an empty array
	Reasons []AccountSetMarginModeResultReasonsItem `json:"reasons,omitempty" url:"reasons,omitempty"`
}

type AccountSetMarginModeResultReasonsItem

type AccountSetMarginModeResultReasonsItem struct {
	// Fail reason code
	ReasonCode string `json:"reasonCode,omitempty" url:"reasonCode,omitempty"`
	// Fail reason msg
	ReasonMsg string `json:"reasonMsg,omitempty" url:"reasonMsg,omitempty"`
}

type AccountSmpGroup

type AccountSmpGroup struct {
	// Smp group ID. If the UID has no group, it is `0` by default
	SmpGroup int64 `json:"smpGroup,omitempty" url:"smpGroup,omitempty"`
}

type AccountTransactionLog

type AccountTransactionLog struct {
	// Object
	List []AccountTransactionLogListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type AccountTransactionLogListItem

type AccountTransactionLogListItem struct {
	// Unique id
	Id string `json:"id,omitempty" url:"id,omitempty"`
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Product type
	Category string `json:"category,omitempty" url:"category,omitempty"`
	// Side. `Buy`,`Sell`,`None`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Transaction timestamp (ms)
	TransactionTime string `json:"transactionTime,omitempty" url:"transactionTime,omitempty"`
	// Type
	Type string `json:"type,omitempty" url:"type,omitempty"`
	// Transaction sub type, `movePosition`, used for the logs generated by move position. `""` by default
	TransSubType string `json:"transSubType,omitempty" url:"transSubType,omitempty"`
	// Quantity
	//
	// 	- Spot: the negative means the qty of this currency is decreased, the positive means the qty of this currency is increased
	// 	- Perps & Futures: it is the quantity for each trade entry and it does not have direction
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
	// Size. The rest position size after the trade is executed, and it has direction, i.e., short with "-"
	Size string `json:"size,omitempty" url:"size,omitempty"`
	// e.g., USDC, USDT, BTC, ETH
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
	// Trade price
	TradePrice string `json:"tradePrice,omitempty" url:"tradePrice,omitempty"`
	// Funding fee
	//
	// 	- Positive fee value means receive funding; negative fee value means pay funding. This is opposite to the `execFee` from [Get Trade History](https://bybit-exchange.github.io/docs/v5/order/execution).
	// 	- For USDC Perp, as funding settlement and session settlement occur at the same time, they are represented in a single record at settlement. Please refer to `funding` to understand funding fee, and `cashFlow` to understand 8-hour P&L.
	Funding string `json:"funding,omitempty" url:"funding,omitempty"`
	// Trading fee
	//
	// 	- Positive fee value means expense
	// 	- Negative fee value means rebates
	Fee string `json:"fee,omitempty" url:"fee,omitempty"`
	// Cash flow, e.g., (1) close the position, and unRPL converts to RPL, (2) 8-hour session settlement for USDC Perp and Futures, (3) transfer in or transfer out. This does not include trading fee, funding fee
	CashFlow string `json:"cashFlow,omitempty" url:"cashFlow,omitempty"`
	// Change = cashFlow + funding - fee
	Change string `json:"change,omitempty" url:"change,omitempty"`
	// Cash balance. This is the wallet balance after a cash change
	CashBalance string `json:"cashBalance,omitempty" url:"cashBalance,omitempty"`
	// - When type=`TRADE`, then it is trading fee rate
	// 	- When type=`SETTLEMENT`, it means funding fee rate. For side=Buy, feeRate=market fee rate; For side=Sell, feeRate= - market fee rate
	FeeRate string `json:"feeRate,omitempty" url:"feeRate,omitempty"`
	// The change of bonus
	BonusChange string `json:"bonusChange,omitempty" url:"bonusChange,omitempty"`
	// Trade ID
	TradeId string `json:"tradeId,omitempty" url:"tradeId,omitempty"`
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// Trading fee rate information. Currently, this data is returned only for spot orders placed on the Indonesian site or spot fiat currency orders placed on the EU site. In other cases, an empty string is returned. Enum: [feeType](/docs/v5/enum#extrafeesfeetype), [subFeeType](/docs/v5/enum#extrafeessubfeetype)
	ExtraFees string `json:"extraFees,omitempty" url:"extraFees,omitempty"`
}

type AccountTransactionLogQuery

type AccountTransactionLogQuery struct {
	// Account Type. `UNIFIED`
	AccountType AccountType `json:"accountType,omitempty" url:"accountType,omitempty"`
	// Product type `spot`,`linear`,`option`,`inverse`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Currency, uppercase only
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
	// BaseCoin, uppercase only. e.g., BTC of BTCPERP
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
	// Types of transaction logs
	Type string `json:"type,omitempty" url:"type,omitempty"`
	// `movePosition`, used to filter trans logs of Move Position only
	TransSubType string `json:"transSubType,omitempty" url:"transSubType,omitempty"`
	// The start timestamp (ms)
	//
	// 	- startTime and endTime are not passed, return 24 hours by default
	// 	- Only startTime is passed, return range between startTime and startTime+24 hours
	// 	- Only endTime is passed, return range between endTime-24 hours and endTime
	// 	- If both are passed, the rule is endTime - startTime <= 7 days
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms)
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Limit for data size per page. \[`1`, `50`\]. Default: `20`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type AccountType

type AccountType string
const (
	AccountTypeUnified AccountType = "UNIFIED"
	AccountTypeFund    AccountType = "FUND"
)

type AccountUpgradeToUtaResult

type AccountUpgradeToUtaResult struct {
	// Upgrade status. `FAIL`,`PROCESS`,`SUCCESS`
	UnifiedUpdateStatus string `json:"unifiedUpdateStatus,omitempty" url:"unifiedUpdateStatus,omitempty"`
	// If `PROCESS`,`SUCCESS`, it returns `null`
	UnifiedUpdateMsg AccountUpgradeToUtaResultUnifiedUpdateMsg `json:"unifiedUpdateMsg" url:"unifiedUpdateMsg"`
}

type AccountUpgradeToUtaResultUnifiedUpdateMsg

type AccountUpgradeToUtaResultUnifiedUpdateMsg struct {
	// Error message array. Only `FAIL` will have this field
	Msg []string `json:"msg,omitempty" url:"msg,omitempty"`
}

type AccountUserSettingConfig

type AccountUserSettingConfig struct {
	// - `true`: If the order price exceeds the limit, the system will automatically adjust the price to the nearest allowed price
	// 	- `false`: If the order price exceeds the limit, the system rejects the request.
	LpaSpot bool `json:"lpaSpot,omitempty" url:"lpaSpot,omitempty"`
	// - `true`: If the order price exceeds the limit, the system rejects the request.
	// 	- `false`: If the order price exceeds the limit, the system will automatically adjust the price to the nearest allowed price.
	LpaPerp bool `json:"lpaPerp,omitempty" url:"lpaPerp,omitempty"`
}

type AccountWalletBalance

type AccountWalletBalance struct {
	// Object
	List []AccountWalletBalanceListItem `json:"list,omitempty" url:"list,omitempty"`
}

type AccountWalletBalanceListItem

type AccountWalletBalanceListItem struct {
	// Account type
	AccountType string `json:"accountType,omitempty" url:"accountType,omitempty"`
	// Account IM rate
	//
	// 	- You can refer to this [Glossary](https://www.bybit.com/en/help-center/article/Glossary-Unified-Trading-Account) to understand the below fields calculation and mearning
	// 	- All account wide fields are **not** applicable to isolated margin
	AccountImRate string `json:"accountIMRate,omitempty" url:"accountIMRate,omitempty"`
	// Account MM rate
	AccountMmRate string `json:"accountMMRate,omitempty" url:"accountMMRate,omitempty"`
	// Account total equity (USD): ∑Asset Equity By USD value of each asset
	TotalEquity string `json:"totalEquity,omitempty" url:"totalEquity,omitempty"`
	// Account wallet balance (USD): ∑Asset Wallet Balance By USD value of each asset
	TotalWalletBalance string `json:"totalWalletBalance,omitempty" url:"totalWalletBalance,omitempty"`
	// Account margin balance (USD): totalWalletBalance + totalPerpUPL
	TotalMarginBalance string `json:"totalMarginBalance,omitempty" url:"totalMarginBalance,omitempty"`
	// Account available balance (USD),
	//
	// 	- Cross Margin: totalMarginBalance - Haircut - totalInitialMargin.
	// 	- Porfolio Margin: total Equity - Haircut - totalInitialMargin.
	TotalAvailableBalance string `json:"totalAvailableBalance,omitempty" url:"totalAvailableBalance,omitempty"`
	// Account Perps and Futures unrealised p&l (USD): ∑Each Perp and USDC Futures upl by base coin
	TotalPerpUpl string `json:"totalPerpUPL,omitempty" url:"totalPerpUPL,omitempty"`
	// Account initial margin (USD): ∑Asset Total Initial Margin Base Coin
	TotalInitialMargin string `json:"totalInitialMargin,omitempty" url:"totalInitialMargin,omitempty"`
	// Account maintenance margin (USD): ∑ Asset Total Maintenance Margin Base Coin
	TotalMaintenanceMargin string `json:"totalMaintenanceMargin,omitempty" url:"totalMaintenanceMargin,omitempty"`
	// You can **ignore** this field, and refer to `accountIMRate`, which has the same calculation
	AccountImRateByMp string `json:"accountIMRateByMp,omitempty" url:"accountIMRateByMp,omitempty"`
	// You can **ignore** this field, and refer to `accountMMRate`, which has the same calculation
	AccountMmRateByMp string `json:"accountMMRateByMp,omitempty" url:"accountMMRateByMp,omitempty"`
	// You can **ignore** this field, and refer to `totalInitialMargin`, which has the same calculation
	TotalInitialMarginByMp string `json:"totalInitialMarginByMp,omitempty" url:"totalInitialMarginByMp,omitempty"`
	// You can **ignore** this field, and refer to `totalMaintenanceMargin`, which has the same calculation
	TotalMaintenanceMarginByMp string `json:"totalMaintenanceMarginByMp,omitempty" url:"totalMaintenanceMarginByMp,omitempty"`
	// **Deprecated** field
	AccountLtv string `json:"accountLTV,omitempty" url:"accountLTV,omitempty"`
	// Object
	Coin []AccountWalletBalanceListItemCoinItem `json:"coin,omitempty" url:"coin,omitempty"`
}

type AccountWalletBalanceListItemCoinItem

type AccountWalletBalanceListItemCoinItem struct {
	// Coin name, such as BTC, ETH, USDT, USDC
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Equity of coin. Asset Equity = Asset Wallet Balance + Asset Perp UPL + Asset Future UPL + Asset Option Value = `walletBalance` - `spotBorrow` + `unrealisedPnl` + Asset Option Value
	Equity string `json:"equity,omitempty" url:"equity,omitempty"`
	// USD value of coin
	UsdValue string `json:"usdValue,omitempty" url:"usdValue,omitempty"`
	// Wallet balance of coin
	WalletBalance string `json:"walletBalance,omitempty" url:"walletBalance,omitempty"`
	// Locked balance due to the Spot open order
	Locked string `json:"locked,omitempty" url:"locked,omitempty"`
	// The spot asset qty that is used to hedge in the portfolio margin, truncate to 8 decimals and "0" by default
	SpotHedgingQty string `json:"spotHedgingQty,omitempty" url:"spotHedgingQty,omitempty"`
	// Borrow amount of current coin = spot liabilities + derivatives liabilities
	BorrowAmount string `json:"borrowAmount,omitempty" url:"borrowAmount,omitempty"`
	// Accrued interest
	AccruedInterest string `json:"accruedInterest,omitempty" url:"accruedInterest,omitempty"`
	// Pre-occupied margin for order. For portfolio margin mode, it returns ""
	TotalOrderIm string `json:"totalOrderIM,omitempty" url:"totalOrderIM,omitempty"`
	// Sum of initial margin of all positions + Pre-occupied liquidation fee. For portfolio margin mode, it returns ""
	TotalPositionIm string `json:"totalPositionIM,omitempty" url:"totalPositionIM,omitempty"`
	// Sum of maintenance margin for all positions. For portfolio margin mode, it returns ""
	TotalPositionMm string `json:"totalPositionMM,omitempty" url:"totalPositionMM,omitempty"`
	// Unrealised P&L
	UnrealisedPnl string `json:"unrealisedPnl,omitempty" url:"unrealisedPnl,omitempty"`
	// Cumulative Realised P&L
	CumRealisedPnl string `json:"cumRealisedPnl,omitempty" url:"cumRealisedPnl,omitempty"`
	// Bonus
	Bonus string `json:"bonus,omitempty" url:"bonus,omitempty"`
	// Whether it can be used as a margin collateral currency (platform), `true`: YES, `false`: NO
	//
	// 	- When marginCollateral=false, then collateralSwitch is meaningless
	MarginCollateral bool `json:"marginCollateral,omitempty" url:"marginCollateral,omitempty"`
	// Whether the collateral is turned on by user (user), `true`: ON, `false`: OFF
	//
	// 	- When marginCollateral=true, then collateralSwitch is meaningful
	CollateralSwitch bool `json:"collateralSwitch,omitempty" url:"collateralSwitch,omitempty"`
	// Borrow amount by spot margin trade and manual borrow amount (does not include borrow amount by spot margin active order). `spotBorrow` field corresponding to spot liabilities is detailed in the [announcement](https://announcements.bybit.com/en/article/bybit-uta-function-optimization-manual-coin-borrowing-will-be-launched-soon-blt5d858199bd12e849/).
	SpotBorrow string `json:"spotBorrow,omitempty" url:"spotBorrow,omitempty"`
	// **Deprecated** since there is no Spot wallet any more
	Free string `json:"free,omitempty" url:"free,omitempty"`
	// **Deprecated** for `accountType=UNIFIED` from 9 Jan, 2025
	//
	// 	- Transferable balance: you can use [Get Transferable Amount (Unified)](/docs/v5/account/unified-trans-amnt) or [Get All Coins Balance](/docs/v5/asset/balance/all-balance) instead
	// 	- Derivatives available balance:
	// **isolated margin**: walletBalance - totalPositionIM - totalOrderIM - locked - bonus
	// **cross & portfolio margin**: look at field `totalAvailableBalance`(USD), which needs to be converted into the available balance of accordingly coin through index price
	// 	- Spot (margin) available balance: refer to [Get Borrow Quota (Spot)](/docs/v5/order/spot-borrow-quota)
	AvailableToWithdraw string `json:"availableToWithdraw,omitempty" url:"availableToWithdraw,omitempty"`
	// **Deprecated** field, always return `""`. Please refer to `availableToBorrow` in the [Get Collateral Info](/docs/v5/account/collateral-info)
	AvailableToBorrow string `json:"availableToBorrow,omitempty" url:"availableToBorrow,omitempty"`
}

type AccountWalletBalanceQuery

type AccountWalletBalanceQuery struct {
	// Account type `UNIFIED`. To get Funding wallet balance, please go to this [endpoint](/docs/v5/asset/balance/all-balance)
	AccountType AccountType `json:"accountType,omitempty" url:"accountType,omitempty"`
	// Coin name, uppercase only
	//
	// 	- If not passed, it returns non-zero asset info
	// 	- You can pass multiple coins to query, separated by comma. `USDT,USDC`
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
}

type AccountWithdrawal

type AccountWithdrawal struct {
	// Transferable amount for the 1st coin in the request
	AvailableWithdrawal string `json:"availableWithdrawal,omitempty" url:"availableWithdrawal,omitempty"`
	// Transferable amount map for each requested coin. In the map, key is the requested coin, and value is the accordingly amount(string)
	// e.g., "availableWithdrawalMap":{"BTC":"4.54549050","SOL":"33.16713007","XRP":"10805.54548970","ETH":"17.76451865"}
	AvailableWithdrawalMap map[string]string `json:"availableWithdrawalMap,omitempty" url:"availableWithdrawalMap,omitempty"`
}

type AccountWithdrawalQuery

type AccountWithdrawalQuery struct {
	// Coin name, uppercase only. Supports up to 20 coins per request, use comma to separate. `BTC,USDC,USDT,SOL`
	CoinName string `json:"coinName,omitempty" url:"coinName,omitempty"`
}

type AdlRankIndicator

type AdlRankIndicator string
const (
	AdlRankIndicator0 AdlRankIndicator = "0"
	AdlRankIndicator1 AdlRankIndicator = "1"
	AdlRankIndicator2 AdlRankIndicator = "2"
	AdlRankIndicator3 AdlRankIndicator = "3"
	AdlRankIndicator4 AdlRankIndicator = "4"
	AdlRankIndicator5 AdlRankIndicator = "5"
)

type AnnouncementTag

type AnnouncementTag string
const (
	AnnouncementTagSpot                      AnnouncementTag = "Spot"
	AnnouncementTagDerivatives               AnnouncementTag = "Derivatives"
	AnnouncementTagSpotListings              AnnouncementTag = "Spot Listings"
	AnnouncementTagBtc                       AnnouncementTag = "BTC"
	AnnouncementTagEth                       AnnouncementTag = "ETH"
	AnnouncementTagTradingBots               AnnouncementTag = "Trading Bots"
	AnnouncementTagUsdc                      AnnouncementTag = "USDC"
	AnnouncementTagLeveragedTokens           AnnouncementTag = "Leveraged Tokens"
	AnnouncementTagUsdt                      AnnouncementTag = "USDT"
	AnnouncementTagMarginTrading             AnnouncementTag = "Margin Trading"
	AnnouncementTagPartnerships              AnnouncementTag = "Partnerships"
	AnnouncementTagLaunchpad                 AnnouncementTag = "Launchpad"
	AnnouncementTagUpgrades                  AnnouncementTag = "Upgrades"
	AnnouncementTagByVotes                   AnnouncementTag = "ByVotes"
	AnnouncementTagDelistings                AnnouncementTag = "Delistings"
	AnnouncementTagVip                       AnnouncementTag = "VIP"
	AnnouncementTagFutures                   AnnouncementTag = "Futures"
	AnnouncementTagInstitutions              AnnouncementTag = "Institutions"
	AnnouncementTagOptions                   AnnouncementTag = "Options"
	AnnouncementTagWeb3                      AnnouncementTag = "WEB3"
	AnnouncementTagCopyTrading               AnnouncementTag = "Copy Trading"
	AnnouncementTagEarn                      AnnouncementTag = "Earn"
	AnnouncementTagBybitSavings              AnnouncementTag = "Bybit Savings"
	AnnouncementTagDualAsset                 AnnouncementTag = "Dual Asset"
	AnnouncementTagLiquidityMining           AnnouncementTag = "Liquidity Mining"
	AnnouncementTagSharkFin                  AnnouncementTag = "Shark Fin"
	AnnouncementTagLaunchpool                AnnouncementTag = "Launchpool"
	AnnouncementTagNftGrabPic                AnnouncementTag = "NFT     GrabPic"
	AnnouncementTagBuyCrypto                 AnnouncementTag = "Buy Crypto"
	AnnouncementTagP2PTrading                AnnouncementTag = "P2P Trading"
	AnnouncementTagFiatDeposit               AnnouncementTag = "Fiat Deposit"
	AnnouncementTagCryptoDeposit             AnnouncementTag = "Crypto Deposit"
	AnnouncementTagСпот                      AnnouncementTag = "Спот"
	AnnouncementTagСпотЛістинги              AnnouncementTag = "Спот лістинги"
	AnnouncementTagТорговіБоти               AnnouncementTag = "Торгові боти"
	AnnouncementTagТокениЗКредитнимПлечем    AnnouncementTag = "Токени з кредитним плечем"
	AnnouncementTagМаржинальнаТоргівля       AnnouncementTag = "Маржинальна торгівля"
	AnnouncementTagПартнерство               AnnouncementTag = "Партнерство"
	AnnouncementTagОновлення                 AnnouncementTag = "Оновлення"
	AnnouncementTagДелістинги                AnnouncementTag = "Делістинги"
	AnnouncementTagФЮчерси                   AnnouncementTag = "Ф'ючерси"
	AnnouncementTagОпціони                   AnnouncementTag = "Опціони"
	AnnouncementTagКопітрейдинг              AnnouncementTag = "Копітрейдинг"
	AnnouncementTagBybitНакопичення          AnnouncementTag = "Bybit Накопичення"
	AnnouncementTagБівалютніІнвестиції       AnnouncementTag = "Бівалютні інвестиції"
	AnnouncementTagМайнінгЛіквідності        AnnouncementTag = "Майнінг ліквідності"
	AnnouncementTagКупівляКриптовалюти       AnnouncementTag = "Купівля криптовалюти"
	AnnouncementTagP2PТоргівля               AnnouncementTag = "P2P торгівля"
	AnnouncementTagФіатніДепозити            AnnouncementTag = "Фіатні депозити"
	AnnouncementTagКриптодепозити            AnnouncementTag = "Криптодепозити"
	AnnouncementTagКопитрейдинг              AnnouncementTag = "Копитрейдинг"
	AnnouncementTagТорговыеБоты              AnnouncementTag = "Торговые боты"
	AnnouncementTagДеривативы                AnnouncementTag = "Деривативы"
	AnnouncementTagP2P                       AnnouncementTag = "P2P"
	AnnouncementTagСпотЛистинги              AnnouncementTag = "Спот листинги"
	AnnouncementTagДеривативи                AnnouncementTag = "Деривативи"
	AnnouncementTagMt4                       AnnouncementTag = "MT4"
	AnnouncementTagLuckyDraw                 AnnouncementTag = "Lucky Draw"
	AnnouncementTagUnifiedTradingAccount     AnnouncementTag = "Unified Trading Account"
	AnnouncementTagЄдинийТорговийАкаунт      AnnouncementTag = "Єдиний торговий акаунт"
	AnnouncementTagЕдиныйТорговыйАккаунт     AnnouncementTag = "Единый торговый аккаунт"
	AnnouncementTagИнституциональныйТрейдинг AnnouncementTag = "Институциональный трейдинг"
	AnnouncementTagІнституціональнийТрейдинг AnnouncementTag = "Інституціональний трейдинг"
	AnnouncementTagДелистинг                 AnnouncementTag = "Делистинг"
)

type AnnouncementType

type AnnouncementType string
const (
	AnnouncementTypeNewCrypto          AnnouncementType = "new_crypto"
	AnnouncementTypeLatestBybitNews    AnnouncementType = "latest_bybit_news"
	AnnouncementTypeDelistings         AnnouncementType = "delistings"
	AnnouncementTypeLatestActivities   AnnouncementType = "latest_activities"
	AnnouncementTypeProductUpdates     AnnouncementType = "product_updates"
	AnnouncementTypeMaintenanceUpdates AnnouncementType = "maintenance_updates"
	AnnouncementTypeNewFiatListings    AnnouncementType = "new_fiat_listings"
	AnnouncementTypeOther              AnnouncementType = "other"
)

type AnnouncementsIndex

type AnnouncementsIndex struct {
	// Total records
	Total int64 `json:"total,omitempty" url:"total,omitempty"`
	// Object
	List []AnnouncementsIndexListItem `json:"list,omitempty" url:"list,omitempty"`
}

type AnnouncementsIndexListItem

type AnnouncementsIndexListItem struct {
	// Announcement title
	Title string `json:"title,omitempty" url:"title,omitempty"`
	// Announcement description
	Description string                         `json:"description,omitempty" url:"description,omitempty"`
	Type        AnnouncementsIndexListItemType `json:"type" url:"type"`
	// The tag of announcement
	Tags AnnouncementTag `json:"tags,omitempty" url:"tags,omitempty"`
	// Announcement url
	Url string `json:"url,omitempty" url:"url,omitempty"`
	// Timestamp that author fills
	DateTimestamp int64 `json:"dateTimestamp,omitempty" url:"dateTimestamp,omitempty"`
	// The start timestamp (ms) of the event, only valid when `list.type.key == "latest_activities"`
	StartDataTimestamp int64 `json:"startDataTimestamp,omitempty" url:"startDataTimestamp,omitempty"`
	// The end timestamp (ms) of the event, only valid when `list.type.key == "latest_activities"`
	EndDataTimestamp int64 `json:"endDataTimestamp,omitempty" url:"endDataTimestamp,omitempty"`
	// The published timestamp for the announcement
	PublishTime int64 `json:"publishTime,omitempty" url:"publishTime,omitempty"`
}

type AnnouncementsIndexListItemType

type AnnouncementsIndexListItemType struct {
	// The title of announcement type
	Title string `json:"title,omitempty" url:"title,omitempty"`
	// The key of announcement type
	Key AnnouncementType `json:"key,omitempty" url:"key,omitempty"`
}

type AnnouncementsIndexQuery

type AnnouncementsIndexQuery struct {
	// Language symbol
	Locale Locale `json:"locale,omitempty" url:"locale,omitempty"`
	// Announcement type
	Type AnnouncementType `json:"type,omitempty" url:"type,omitempty"`
	// Announcement tag
	Tag AnnouncementTag `json:"tag,omitempty" url:"tag,omitempty"`
	// Page number. Default: `1`
	Page int64 `json:"page,omitempty" url:"page,omitempty"`
	// Limit for data size per page. Default: `20`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
}

type ApiResponse

type ApiResponse[T any] struct {
	RetCode    int             `json:"retCode"`
	RetMsg     string          `json:"retMsg"`
	Result     T               `json:"result"`
	RetExtInfo json.RawMessage `json:"retExtInfo"`
	Time       int64           `json:"time"`
}

type AssetCoinGreeks

type AssetCoinGreeks struct {
	// Object
	List []AssetCoinGreeksListItem `json:"list,omitempty" url:"list,omitempty"`
}

type AssetCoinGreeksListItem

type AssetCoinGreeksListItem struct {
	// Base coin. e.g.,`BTC`,`ETH`,`SOL`
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
	// Delta value
	TotalDelta string `json:"totalDelta,omitempty" url:"totalDelta,omitempty"`
	// Gamma value
	TotalGamma string `json:"totalGamma,omitempty" url:"totalGamma,omitempty"`
	// Vega value
	TotalVega string `json:"totalVega,omitempty" url:"totalVega,omitempty"`
	// Theta value
	TotalTheta string `json:"totalTheta,omitempty" url:"totalTheta,omitempty"`
}

type AssetCoinGreeksQuery

type AssetCoinGreeksQuery struct {
	// Base coin, uppercase only. If not passed, all supported base coin greeks will be returned by default
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
}

type AssetCoinQueryInfo

type AssetCoinQueryInfo struct {
	// Object
	Rows []AssetCoinQueryInfoRowsItem `json:"rows,omitempty" url:"rows,omitempty"`
}

type AssetCoinQueryInfoQuery

type AssetCoinQueryInfoQuery struct {
	// Coin, uppercase only
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
}

type AssetCoinQueryInfoRowsItem

type AssetCoinQueryInfoRowsItem struct {
	// Coin name
	Name string `json:"name,omitempty" url:"name,omitempty"`
	// Coin
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Maximum withdraw amount per transaction
	RemainAmount string `json:"remainAmount,omitempty" url:"remainAmount,omitempty"`
	// Object
	Chains []AssetCoinQueryInfoRowsItemChainsItem `json:"chains,omitempty" url:"chains,omitempty"`
}

type AssetCoinQueryInfoRowsItemChainsItem

type AssetCoinQueryInfoRowsItemChainsItem struct {
	// Chain
	Chain string `json:"chain,omitempty" url:"chain,omitempty"`
	// Chain type
	ChainType string `json:"chainType,omitempty" url:"chainType,omitempty"`
	// Number of confirmations for deposit: Once this number is reached, your funds will be credited to your account and available for trading
	Confirmation string `json:"confirmation,omitempty" url:"confirmation,omitempty"`
	// withdraw fee. _If withdraw fee is empty, It means that this coin does not support withdrawal_
	WithdrawFee string `json:"withdrawFee,omitempty" url:"withdrawFee,omitempty"`
	// Min. deposit
	DepositMin string `json:"depositMin,omitempty" url:"depositMin,omitempty"`
	// Min. withdraw
	WithdrawMin string `json:"withdrawMin,omitempty" url:"withdrawMin,omitempty"`
	// The precision of withdraw or deposit
	MinAccuracy string `json:"minAccuracy,omitempty" url:"minAccuracy,omitempty"`
	// The chain status of deposit. `0`: suspend. `1`: normal
	ChainDeposit string `json:"chainDeposit,omitempty" url:"chainDeposit,omitempty"`
	// The chain status of withdraw. `0`: suspend. `1`: normal
	ChainWithdraw string `json:"chainWithdraw,omitempty" url:"chainWithdraw,omitempty"`
	// The withdraw fee percentage. It is a real figure, e.g., 0.022 means 2.2%
	WithdrawPercentageFee string `json:"withdrawPercentageFee,omitempty" url:"withdrawPercentageFee,omitempty"`
	// Contract address. `""` means no contract address
	ContractAddress string `json:"contractAddress,omitempty" url:"contractAddress,omitempty"`
	// Number of security confirmations: Once this number is reached, your USD equivalent worth funds will be fully unlocked and available for withdrawal.
	SafeConfirmNumber string `json:"safeConfirmNumber,omitempty" url:"safeConfirmNumber,omitempty"`
}

type AssetCovertGetQuoteParams

type AssetCovertGetQuoteParams struct {
	// Wallet type `eb_convert_uta`. Only supports the Unified wallet
	AccountType AccountType `json:"accountType,omitempty" url:"accountType,omitempty"`
	// Source currency list `["BTC", "XRP", "ETH"]`, up to 20 coins in one transaction
	FromCoinList []string `json:"fromCoinList,omitempty" url:"fromCoinList,omitempty"`
	// Target currency, each request supports one of MNT, USDT, or USDC
	ToCoin string `json:"toCoin,omitempty" url:"toCoin,omitempty"`
}

type AssetCovertGetQuoteResult

type AssetCovertGetQuoteResult struct {
	// Quote transaction ID. It is system generated, and it is used to confirm quote and query the result of transaction
	QuoteId string                          `json:"quoteId,omitempty" url:"quoteId,omitempty"`
	Result  AssetCovertGetQuoteResultResult `json:"result" url:"result"`
}

type AssetCovertGetQuoteResultResult

type AssetCovertGetQuoteResultResult struct {
	// Quote created ts
	QuoteCreateTime string `json:"quoteCreateTime,omitempty" url:"quoteCreateTime,omitempty"`
	// Quote expired ts, 30 seconds
	QuoteExpireTime string `json:"quoteExpireTime,omitempty" url:"quoteExpireTime,omitempty"`
	// Quote details
	ExchangeCoins []AssetCovertGetQuoteResultResultExchangeCoinsItem `json:"exchangeCoins,omitempty" url:"exchangeCoins,omitempty"`
	// Total exchange fee details
	TotalFeeInfo AssetCovertGetQuoteResultResultTotalFeeInfo `json:"totalFeeInfo" url:"totalFeeInfo"`
	// Total tax fee info
	TotalTaxFeeInfo AssetCovertGetQuoteResultResultTotalTaxFeeInfo `json:"totalTaxFeeInfo" url:"totalTaxFeeInfo"`
}

type AssetCovertGetQuoteResultResultExchangeCoinsItem

type AssetCovertGetQuoteResultResultExchangeCoinsItem struct {
	// Source currency
	FromCoin string `json:"fromCoin,omitempty" url:"fromCoin,omitempty"`
	// `1`: support, `2`: not supported
	SupportConvert int64 `json:"supportConvert,omitempty" url:"supportConvert,omitempty"`
	// Withdrawable balance
	AvailableBalance string `json:"availableBalance,omitempty" url:"availableBalance,omitempty"`
	// USDT equivalent value
	BaseValue string `json:"baseValue,omitempty" url:"baseValue,omitempty"`
	// Target currency
	ToCoin string `json:"toCoin,omitempty" url:"toCoin,omitempty"`
	// Est.received amount
	ToAmount string `json:"toAmount,omitempty" url:"toAmount,omitempty"`
	// Exchange rate
	ExchangeRate string `json:"exchangeRate,omitempty" url:"exchangeRate,omitempty"`
	// Exchange fee info
	FeeInfo AssetCovertGetQuoteResultResultExchangeCoinsItemFeeInfo `json:"feeInfo" url:"feeInfo"`
	// Tax fee info
	TaxFeeInfo AssetCovertGetQuoteResultResultExchangeCoinsItemTaxFeeInfo `json:"taxFeeInfo" url:"taxFeeInfo"`
}

type AssetCovertGetQuoteResultResultExchangeCoinsItemFeeInfo

type AssetCovertGetQuoteResultResultExchangeCoinsItemFeeInfo struct {
	// Fee currency
	FeeCoin string `json:"feeCoin,omitempty" url:"feeCoin,omitempty"`
	// Fee
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
	// Fee rate
	FeeRate string `json:"feeRate,omitempty" url:"feeRate,omitempty"`
}

type AssetCovertGetQuoteResultResultExchangeCoinsItemTaxFeeInfo

type AssetCovertGetQuoteResultResultExchangeCoinsItemTaxFeeInfo struct {
	// Tax fee
	TotalAmount string `json:"totalAmount,omitempty" url:"totalAmount,omitempty"`
	// Tax fee coin
	FeeCoin string `json:"feeCoin,omitempty" url:"feeCoin,omitempty"`
	// Tax fee items
	TaxFeeItems []string `json:"taxFeeItems,omitempty" url:"taxFeeItems,omitempty"`
}

type AssetCovertGetQuoteResultResultTotalFeeInfo

type AssetCovertGetQuoteResultResultTotalFeeInfo struct {
	// Fee currency
	FeeCoin string `json:"feeCoin,omitempty" url:"feeCoin,omitempty"`
	// Total fee
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
	// Fee rate
	FeeRate string `json:"feeRate,omitempty" url:"feeRate,omitempty"`
}

type AssetCovertGetQuoteResultResultTotalTaxFeeInfo

type AssetCovertGetQuoteResultResultTotalTaxFeeInfo struct {
	// Total tax fee
	TotalAmount string `json:"totalAmount,omitempty" url:"totalAmount,omitempty"`
	// Tax fee coin
	FeeCoin string `json:"feeCoin,omitempty" url:"feeCoin,omitempty"`
	// Tax fee items
	TaxFeeItems []string `json:"taxFeeItems,omitempty" url:"taxFeeItems,omitempty"`
}

type AssetCovertSmallBalanceExecuteParams

type AssetCovertSmallBalanceExecuteParams struct {
	// The quote ID from [Request a Quote](/docs/v5/asset/convert-small-balance/request-quote#response-parameters)
	QuoteId string `json:"quoteId,omitempty" url:"quoteId,omitempty"`
}

type AssetCovertSmallBalanceExecuteResult

type AssetCovertSmallBalanceExecuteResult struct {
	// Quote ID
	QuoteId string `json:"quoteId,omitempty" url:"quoteId,omitempty"`
	// Exchange ID, the same value as `quoteId`
	ExchangeTxId string `json:"exchangeTxId,omitempty" url:"exchangeTxId,omitempty"`
	// Submit ts
	SubmitTime string `json:"submitTime,omitempty" url:"submitTime,omitempty"`
	// `init`, `processing`, `success`, `failure`, `partial_fulfillment`
	Status Status `json:"status,omitempty" url:"status,omitempty"`
	// By default is `""`
	Msg Msg `json:"msg,omitempty" url:"msg,omitempty"`
}

type AssetCovertSmallBalanceHistory

type AssetCovertSmallBalanceHistory struct {
	// Current page number
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
	// Curreng page size
	Size string `json:"size,omitempty" url:"size,omitempty"`
	// Last page number
	LastPage string `json:"lastPage,omitempty" url:"lastPage,omitempty"`
	// Total number of records
	TotalCount string                                      `json:"totalCount,omitempty" url:"totalCount,omitempty"`
	Records    []AssetCovertSmallBalanceHistoryRecordsItem `json:"records,omitempty" url:"records,omitempty"`
}

type AssetCovertSmallBalanceHistoryQuery

type AssetCovertSmallBalanceHistoryQuery struct {
	// `eb_convert_uta`, `eb_convert_funding`
	AccountType AccountType `json:"accountType,omitempty" url:"accountType,omitempty"`
	// Quote ID, highest priority when querying
	QuoteId string `json:"quoteId,omitempty" url:"quoteId,omitempty"`
	// The start timestamp (ms)
	StartTime string `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms)
	EndTime string `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Page number
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
	// Page size, default is 50, maximum is 100
	Size string `json:"size,omitempty" url:"size,omitempty"`
}

type AssetCovertSmallBalanceHistoryRecordsItem

type AssetCovertSmallBalanceHistoryRecordsItem struct {
	// `eb_convert_uta`: unified wallet, `eb_convert_funding`: funding wallet
	AccountType string `json:"accountType,omitempty" url:"accountType,omitempty"`
	// Exchange transaction ID
	ExchangeTxId string `json:"exchangeTxId,omitempty" url:"exchangeTxId,omitempty"`
	// Target currency
	ToCoin string `json:"toCoin,omitempty" url:"toCoin,omitempty"`
	// Actual total amount received
	ToAmount string `json:"toAmount,omitempty" url:"toAmount,omitempty"`
	// details
	SubRecords []AssetCovertSmallBalanceHistoryRecordsItemSubRecordsItem `json:"subRecords,omitempty" url:"subRecords,omitempty"`
	// `init`, `processing`, `success`, `failure`, `partial_fulfillment`
	Status string `json:"status,omitempty" url:"status,omitempty"`
	// Quote created timestamp
	CreatedAt string `json:"createdAt,omitempty" url:"createdAt,omitempty"`
	// Exchange source `small_asset_uta`, `small_asset_funding`
	ExchangeSource string `json:"exchangeSource,omitempty" url:"exchangeSource,omitempty"`
	// Exchange fee currency
	FeeCoin string `json:"feeCoin,omitempty" url:"feeCoin,omitempty"`
	// Total exchange fee amount
	TotalFeeAmount  string                                                   `json:"totalFeeAmount,omitempty" url:"totalFeeAmount,omitempty"`
	TotalTaxFeeInfo AssetCovertSmallBalanceHistoryRecordsItemTotalTaxFeeInfo `json:"totalTaxFeeInfo" url:"totalTaxFeeInfo"`
}

type AssetCovertSmallBalanceHistoryRecordsItemSubRecordsItem

type AssetCovertSmallBalanceHistoryRecordsItemSubRecordsItem struct {
	// Source currency
	FromCoin string `json:"fromCoin,omitempty" url:"fromCoin,omitempty"`
	// Source currency amount
	FromAmount string `json:"fromAmount,omitempty" url:"fromAmount,omitempty"`
	// Target currency
	ToCoin string `json:"toCoin,omitempty" url:"toCoin,omitempty"`
	// Actual amount received
	ToAmount string `json:"toAmount,omitempty" url:"toAmount,omitempty"`
	// Exchange fee currency
	FeeCoin string `json:"feeCoin,omitempty" url:"feeCoin,omitempty"`
	// Exchange fee
	FeeAmount string `json:"feeAmount,omitempty" url:"feeAmount,omitempty"`
	// `init`, `processing`, `success`, `failure`, `partial_fulfillment`
	Status     string                                                            `json:"status,omitempty" url:"status,omitempty"`
	TaxFeeInfo AssetCovertSmallBalanceHistoryRecordsItemSubRecordsItemTaxFeeInfo `json:"taxFeeInfo" url:"taxFeeInfo"`
}

type AssetCovertSmallBalanceHistoryRecordsItemSubRecordsItemTaxFeeInfo

type AssetCovertSmallBalanceHistoryRecordsItemSubRecordsItemTaxFeeInfo struct {
	// Tax fee amount
	TotalAmount string `json:"totalAmount,omitempty" url:"totalAmount,omitempty"`
	// Tax fee currency
	FeeCoin string `json:"feeCoin,omitempty" url:"feeCoin,omitempty"`
	// Tax fee items
	TaxFeeItems []string `json:"taxFeeItems,omitempty" url:"taxFeeItems,omitempty"`
}

type AssetCovertSmallBalanceHistoryRecordsItemTotalTaxFeeInfo

type AssetCovertSmallBalanceHistoryRecordsItemTotalTaxFeeInfo struct {
	// Total tax fee amount
	TotalAmount string `json:"totalAmount,omitempty" url:"totalAmount,omitempty"`
	// Tax fee currency
	FeeCoin string `json:"feeCoin,omitempty" url:"feeCoin,omitempty"`
	// Tax fee items
	TaxFeeItems []string `json:"taxFeeItems,omitempty" url:"taxFeeItems,omitempty"`
}

type AssetCovertSmallBalanceList

type AssetCovertSmallBalanceList struct {
	// Small balance info
	SmallAssetCoins []AssetCovertSmallBalanceListSmallAssetCoinsItem `json:"smallAssetCoins,omitempty" url:"smallAssetCoins,omitempty"`
	// `["MNT","USDT","USDC"]`
	SupportToCoins []string `json:"supportToCoins,omitempty" url:"supportToCoins,omitempty"`
}

type AssetCovertSmallBalanceListQuery

type AssetCovertSmallBalanceListQuery struct {
	// Wallet type `eb_convert_uta`. Only supports the Unified wallet
	AccountType AccountType `json:"accountType,omitempty" url:"accountType,omitempty"`
	// Source currency
	FromCoin string `json:"fromCoin,omitempty" url:"fromCoin,omitempty"`
}

type AssetCovertSmallBalanceListSmallAssetCoinsItem

type AssetCovertSmallBalanceListSmallAssetCoinsItem struct {
	// Source currency
	FromCoin string `json:"fromCoin,omitempty" url:"fromCoin,omitempty"`
	// `1`: support, `2`: not supported
	SupportConvert int64 `json:"supportConvert,omitempty" url:"supportConvert,omitempty"`
	// Available balance, the value might be bigger than the actual balance you can convert
	AvailableBalance string `json:"availableBalance,omitempty" url:"availableBalance,omitempty"`
	// USDT equivalent value
	BaseValue string `json:"baseValue,omitempty" url:"baseValue,omitempty"`
	// **Ignore**, reserved field
	ToAmount []byte `json:"toAmount,omitempty" url:"toAmount,omitempty"`
	// **Ignore**, reserved field
	ExchangeRate []byte `json:"exchangeRate,omitempty" url:"exchangeRate,omitempty"`
	// **Ignore**, reserved field
	FeeInfo []byte `json:"feeInfo,omitempty" url:"feeInfo,omitempty"`
	// **Ignore**, reserved field
	TaxFeeInfo []byte `json:"taxFeeInfo,omitempty" url:"taxFeeInfo,omitempty"`
}

type AssetDeliveryRecord

type AssetDeliveryRecord struct {
	// Product type
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Object
	List []AssetDeliveryRecordListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type AssetDeliveryRecordListItem

type AssetDeliveryRecordListItem struct {
	// Delivery time (ms)
	DeliveryTime int64 `json:"deliveryTime,omitempty" url:"deliveryTime,omitempty"`
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// `Buy`,`Sell`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Executed size
	Position string `json:"position,omitempty" url:"position,omitempty"`
	// Avg entry price
	EntryPrice string `json:"entryPrice,omitempty" url:"entryPrice,omitempty"`
	// Delivery price
	DeliveryPrice string `json:"deliveryPrice,omitempty" url:"deliveryPrice,omitempty"`
	// Exercise price
	Strike string `json:"strike,omitempty" url:"strike,omitempty"`
	// Trading fee
	Fee string `json:"fee,omitempty" url:"fee,omitempty"`
	// Realized PnL of the delivery
	DeliveryRpl string `json:"deliveryRpl,omitempty" url:"deliveryRpl,omitempty"`
}

type AssetDeliveryRecordQuery

type AssetDeliveryRecordQuery struct {
	// Product type `inverse`(inverse futures), `linear`(USDT/USDC futures), `option`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// The start timestamp (ms)
	//
	// 	- startTime and endTime are not passed, return 30 days by default
	// 	- Only startTime is passed, return range between startTime and startTime + 30 days
	// 	- Only endTime is passed, return range between endTime - 30 days and endTime
	// 	- If both are passed, the rule is endTime - startTime <= 30 days
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms)
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Expiry date. `25MAR22`. Default: return all
	ExpDate string `json:"expDate,omitempty" url:"expDate,omitempty"`
	// Limit for data size per page. \[`1`, `50`\]. Default: `20`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type AssetDepositDepositToAccountParams

type AssetDepositDepositToAccountParams struct {
	// Account type `UNIFIED`, `FUND`
	AccountType AccountType `json:"accountType,omitempty" url:"accountType,omitempty"`
}

type AssetDepositDepositToAccountResult

type AssetDepositDepositToAccountResult struct {
	// Request result:
	//
	// 	- `1`: SUCCESS
	// 	- `0`: FAIL
	Status Status `json:"status,omitempty" url:"status,omitempty"`
}

type AssetDepositQueryAddress

type AssetDepositQueryAddress struct {
	// Coin
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Object
	Chains []AssetDepositQueryAddressChainsItem `json:"chains,omitempty" url:"chains,omitempty"`
}

type AssetDepositQueryAddressChainsItem

type AssetDepositQueryAddressChainsItem struct {
	// Chain type
	ChainType string `json:"chainType,omitempty" url:"chainType,omitempty"`
	// The address for deposit
	AddressDeposit string `json:"addressDeposit,omitempty" url:"addressDeposit,omitempty"`
	// Tag of deposit
	TagDeposit string `json:"tagDeposit,omitempty" url:"tagDeposit,omitempty"`
	// Chain
	Chain string `json:"chain,omitempty" url:"chain,omitempty"`
	// The deposit limit for this coin in this chain. `"-1"` means no limit
	BatchReleaseLimit string `json:"batchReleaseLimit,omitempty" url:"batchReleaseLimit,omitempty"`
	// The contract address of the coin. Only display last 6 characters, if there is no contract address, it shows `""`
	ContractAddress string `json:"contractAddress,omitempty" url:"contractAddress,omitempty"`
}

type AssetDepositQueryAddressQuery

type AssetDepositQueryAddressQuery struct {
	// Coin, uppercase only
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Please use the value of `>> chain` from [coin-info](/docs/v5/asset/coin-info) endpoint
	ChainType string `json:"chainType,omitempty" url:"chainType,omitempty"`
}

type AssetDepositQueryInternalRecord

type AssetDepositQueryInternalRecord struct {
	// Object
	Rows []AssetDepositQueryInternalRecordRowsItem `json:"rows,omitempty" url:"rows,omitempty"`
	// cursor information: used for pagination. Default value: `""`
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type AssetDepositQueryInternalRecordQuery

type AssetDepositQueryInternalRecordQuery struct {
	// Internal transfer transaction ID
	TxId string `json:"txID,omitempty" url:"txID,omitempty"`
	// Start time (ms). Default value: 30 days before the current time
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// End time (ms). Default value: current time
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Coin name: for example, BTC. Default value: all
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Cursor, used for pagination
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
	// Number of items per page, \[`1`, `50`\]. Default value: 50
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
}

type AssetDepositQueryInternalRecordRowsItem

type AssetDepositQueryInternalRecordRowsItem struct {
	// ID
	Id string `json:"id,omitempty" url:"id,omitempty"`
	// `1`: Internal deposit
	Type int64 `json:"type,omitempty" url:"type,omitempty"`
	// Deposit coin
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Deposit amount
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
	// - 1=Processing
	// 	- 2=Success
	// 	- 3=deposit failed
	Status int64 `json:"status,omitempty" url:"status,omitempty"`
	// Email address or phone number
	Address string `json:"address,omitempty" url:"address,omitempty"`
	// Deposit created timestamp
	CreatedTime string `json:"createdTime,omitempty" url:"createdTime,omitempty"`
	// Sender UID
	FromMemberId string `json:"fromMemberId,omitempty" url:"fromMemberId,omitempty"`
	// Internal transfer transaction ID
	TxId string `json:"txID,omitempty" url:"txID,omitempty"`
	// This field is used for tax purposes by Bybit EU (Austria) users, declare tax id
	TaxDepositRecordsId string `json:"taxDepositRecordsId,omitempty" url:"taxDepositRecordsId,omitempty"`
	// This field is used for tax purposes by Bybit EU (Austria) users
	//
	// 	- 0: No reporting required
	// 	- 1: Reporting pending
	// 	- 2: Reporting completed
	TaxStatus int64 `json:"taxStatus,omitempty" url:"taxStatus,omitempty"`
}

type AssetDepositQueryRecord

type AssetDepositQueryRecord struct {
	// Object
	Rows []AssetDepositQueryRecordRowsItem `json:"rows,omitempty" url:"rows,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type AssetDepositQueryRecordQuery

type AssetDepositQueryRecordQuery struct {
	// Internal ID: Can be used to uniquely identify and filter the deposit. When combined with other parameters, this field takes the highest priority
	Id string `json:"id,omitempty" url:"id,omitempty"`
	// Transaction ID: Please note that data generated before Jan 1, 2024 cannot be queried using txID
	TxId string `json:"txID,omitempty" url:"txID,omitempty"`
	// Coin, uppercase only
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// The start timestamp (ms) _Note: the query logic is actually effective based on **second** level_
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms) _Note: the query logic is actually effective based on **second** level_
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Limit for data size per page. \[`1`, `50`\]. Default: `50`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type AssetDepositQueryRecordRowsItem

type AssetDepositQueryRecordRowsItem struct {
	// Coin
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Chain
	Chain string `json:"chain,omitempty" url:"chain,omitempty"`
	// Amount
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
	// Transaction ID
	TxId string `json:"txID,omitempty" url:"txID,omitempty"`
	// Deposit status
	Status DepositStatus `json:"status,omitempty" url:"status,omitempty"`
	// Deposit target address
	ToAddress string `json:"toAddress,omitempty" url:"toAddress,omitempty"`
	// Tag of deposit target address
	Tag string `json:"tag,omitempty" url:"tag,omitempty"`
	// Deposit fee
	DepositFee string `json:"depositFee,omitempty" url:"depositFee,omitempty"`
	// Deposit's success time
	SuccessAt string `json:"successAt,omitempty" url:"successAt,omitempty"`
	// Number of confirmation blocks
	Confirmations string `json:"confirmations,omitempty" url:"confirmations,omitempty"`
	// Transaction sequence number
	TxIndex string `json:"txIndex,omitempty" url:"txIndex,omitempty"`
	// Hash number on the chain
	BlockHash string `json:"blockHash,omitempty" url:"blockHash,omitempty"`
	// The deposit limit for this coin in this chain. `"-1"` means no limit
	BatchReleaseLimit string `json:"batchReleaseLimit,omitempty" url:"batchReleaseLimit,omitempty"`
	// The deposit type. `0`: normal deposit, `10`: the deposit reaches daily deposit limit, `20`: abnormal deposit
	DepositType string `json:"depositType,omitempty" url:"depositType,omitempty"`
	// From address of deposit, only shown when the deposit comes from on-chain and from address is unique, otherwise gives `""`
	FromAddress string `json:"fromAddress,omitempty" url:"fromAddress,omitempty"`
	// This field is used for tax purposes by Bybit EU (Austria) users, declare tax id
	TaxDepositRecordsId string `json:"taxDepositRecordsId,omitempty" url:"taxDepositRecordsId,omitempty"`
	// This field is used for tax purposes by Bybit EU (Austria) users
	//
	// 	- 0: No reporting required
	// 	- 1: Reporting pending
	// 	- 2: Reporting completed
	TaxStatus int64 `json:"taxStatus,omitempty" url:"taxStatus,omitempty"`
	// Unique ID
	Id string `json:"id,omitempty" url:"id,omitempty"`
}

type AssetDepositQuerySubMemberAddress

type AssetDepositQuerySubMemberAddress struct {
	// Coin
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Object
	Chains []AssetDepositQuerySubMemberAddressChainsItem `json:"chains,omitempty" url:"chains,omitempty"`
}

type AssetDepositQuerySubMemberAddressChainsItem

type AssetDepositQuerySubMemberAddressChainsItem struct {
	// Chain type
	ChainType string `json:"chainType,omitempty" url:"chainType,omitempty"`
	// The address for deposit
	AddressDeposit string `json:"addressDeposit,omitempty" url:"addressDeposit,omitempty"`
	// Tag of deposit
	TagDeposit string `json:"tagDeposit,omitempty" url:"tagDeposit,omitempty"`
	// Chain
	Chain string `json:"chain,omitempty" url:"chain,omitempty"`
	// The deposit limit for this coin in this chain. `"-1"` means no limit
	BatchReleaseLimit string `json:"batchReleaseLimit,omitempty" url:"batchReleaseLimit,omitempty"`
	// The contract address of the coin. Only display last 6 characters, if there is no contract address, it shows `""`
	ContractAddress string `json:"contractAddress,omitempty" url:"contractAddress,omitempty"`
}

type AssetDepositQuerySubMemberAddressQuery

type AssetDepositQuerySubMemberAddressQuery struct {
	// Coin, uppercase only
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Please use the value of `chain` from [coin-info](/docs/v5/asset/coin-info) endpoint
	ChainType string `json:"chainType,omitempty" url:"chainType,omitempty"`
	// Sub user ID
	SubMemberId string `json:"subMemberId,omitempty" url:"subMemberId,omitempty"`
}

type AssetDepositQuerySubMemberRecord

type AssetDepositQuerySubMemberRecord struct {
	// Object
	Rows []AssetDepositQuerySubMemberRecordRowsItem `json:"rows,omitempty" url:"rows,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type AssetDepositQuerySubMemberRecordQuery

type AssetDepositQuerySubMemberRecordQuery struct {
	// Internal ID: Can be used to uniquely identify and filter the deposit. When combined with other parameters, this field takes the highest priority
	Id string `json:"id,omitempty" url:"id,omitempty"`
	// Transaction ID: Please note that data generated before Jan 1, 2024 cannot be queried using txID
	TxId string `json:"txID,omitempty" url:"txID,omitempty"`
	// Sub UID
	SubMemberId string `json:"subMemberId,omitempty" url:"subMemberId,omitempty"`
	// Coin, uppercase only
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// The start timestamp (ms) _Note: the query logic is actually effective based on **second** level_
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms) _Note: the query logic is actually effective based on **second** level_
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Limit for data size per page. \[`1`, `50`\]. Default: `50`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type AssetDepositQuerySubMemberRecordRowsItem

type AssetDepositQuerySubMemberRecordRowsItem struct {
	// Unique ID
	Id string `json:"id,omitempty" url:"id,omitempty"`
	// Coin
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Chain
	Chain string `json:"chain,omitempty" url:"chain,omitempty"`
	// Amount
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
	// Transaction ID
	TxId string `json:"txID,omitempty" url:"txID,omitempty"`
	// Deposit status
	Status DepositStatus `json:"status,omitempty" url:"status,omitempty"`
	// Deposit target address
	ToAddress string `json:"toAddress,omitempty" url:"toAddress,omitempty"`
	// Tag of deposit target address
	Tag string `json:"tag,omitempty" url:"tag,omitempty"`
	// Deposit fee
	DepositFee string `json:"depositFee,omitempty" url:"depositFee,omitempty"`
	// Deposit's success time
	SuccessAt string `json:"successAt,omitempty" url:"successAt,omitempty"`
	// Number of confirmation blocks
	Confirmations string `json:"confirmations,omitempty" url:"confirmations,omitempty"`
	// Transaction sequence number
	TxIndex string `json:"txIndex,omitempty" url:"txIndex,omitempty"`
	// Hash number on the chain
	BlockHash string `json:"blockHash,omitempty" url:"blockHash,omitempty"`
	// The deposit limit for this coin in this chain. `"-1"` means no limit
	BatchReleaseLimit string `json:"batchReleaseLimit,omitempty" url:"batchReleaseLimit,omitempty"`
	// The deposit type. `0`: normal deposit, `10`: the deposit reaches daily deposit limit, `20`: abnormal deposit
	DepositType string `json:"depositType,omitempty" url:"depositType,omitempty"`
	// From address of deposit, only shown when the deposit comes from on-chain and from address is unique, otherwise gives `""`
	FromAddress string `json:"fromAddress,omitempty" url:"fromAddress,omitempty"`
	// This field is used for tax purposes by Bybit EU (Austria) users, declare tax id
	TaxDepositRecordsId string `json:"taxDepositRecordsId,omitempty" url:"taxDepositRecordsId,omitempty"`
	// This field is used for tax purposes by Bybit EU (Austria) users
	//
	// 	- 0: No reporting required
	// 	- 1: Reporting pending
	// 	- 2: Reporting completed
	TaxStatus int64 `json:"taxStatus,omitempty" url:"taxStatus,omitempty"`
}

type AssetExchangeConvertExecuteParams

type AssetExchangeConvertExecuteParams struct {
	// The quote tx ID from [Request a Quote](/docs/v5/asset/convert/apply-quote#response-parameters)
	QuoteTxId string `json:"quoteTxId,omitempty" url:"quoteTxId,omitempty"`
}

type AssetExchangeConvertExecuteResult

type AssetExchangeConvertExecuteResult struct {
	// Quote transaction ID
	QuoteTxId string `json:"quoteTxId,omitempty" url:"quoteTxId,omitempty"`
	// Exchange status
	//
	// 	- init
	// 	- processing
	// 	- success
	// 	- failure
	ExchangeStatus string `json:"exchangeStatus,omitempty" url:"exchangeStatus,omitempty"`
}

type AssetExchangeConvertResultQuery

type AssetExchangeConvertResultQuery struct {
	// Wallet type
	AccountType ConvertAccountType `json:"accountType,omitempty" url:"accountType,omitempty"`
	// Exchange tx ID, same as quote tx ID
	ExchangeTxId string `json:"exchangeTxId,omitempty" url:"exchangeTxId,omitempty"`
	// User ID
	UserId string `json:"userId,omitempty" url:"userId,omitempty"`
	// From coin
	FromCoin string `json:"fromCoin,omitempty" url:"fromCoin,omitempty"`
	// From coin type. `crypto`
	FromCoinType string `json:"fromCoinType,omitempty" url:"fromCoinType,omitempty"`
	// To coin
	ToCoin string `json:"toCoin,omitempty" url:"toCoin,omitempty"`
	// To coin type. `crypto`
	ToCoinType string `json:"toCoinType,omitempty" url:"toCoinType,omitempty"`
	// From coin amount (amount to sell)
	FromAmount string `json:"fromAmount,omitempty" url:"fromAmount,omitempty"`
	// To coin amount (amount to buy according to exchange rate)
	ToAmount string `json:"toAmount,omitempty" url:"toAmount,omitempty"`
	// Exchange status
	//
	// 	- init
	// 	- processing
	// 	- success
	// 	- failure
	ExchangeStatus string `json:"exchangeStatus,omitempty" url:"exchangeStatus,omitempty"`
	// Reserved field, ignored for now
	ExtInfo []byte `json:"extInfo,omitempty" url:"extInfo,omitempty"`
	// Exchange rate
	ConvertRate string `json:"convertRate,omitempty" url:"convertRate,omitempty"`
	// Quote created time
	CreatedAt string `json:"createdAt,omitempty" url:"createdAt,omitempty"`
}

type AssetExchangeConvertResultQueryQuery

type AssetExchangeConvertResultQueryQuery struct {
	// Quote tx ID
	QuoteTxId string `json:"quoteTxId,omitempty" url:"quoteTxId,omitempty"`
	// Wallet type
	AccountType ConvertAccountType `json:"accountType,omitempty" url:"accountType,omitempty"`
}

type AssetExchangeOrderRecord

type AssetExchangeOrderRecord struct {
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
	// Object
	OrderBody []AssetExchangeOrderRecordOrderBodyItem `json:"orderBody,omitempty" url:"orderBody,omitempty"`
}

type AssetExchangeOrderRecordOrderBodyItem

type AssetExchangeOrderRecordOrderBodyItem struct {
	// The currency to convert from
	FromCoin string `json:"fromCoin,omitempty" url:"fromCoin,omitempty"`
	// The amount to convert from
	FromAmount string `json:"fromAmount,omitempty" url:"fromAmount,omitempty"`
	// The currency to convert to
	ToCoin string `json:"toCoin,omitempty" url:"toCoin,omitempty"`
	// The amount to convert to
	ToAmount string `json:"toAmount,omitempty" url:"toAmount,omitempty"`
	// Exchange rate
	ExchangeRate string `json:"exchangeRate,omitempty" url:"exchangeRate,omitempty"`
	// Exchange created timestamp (sec)
	CreatedTime string `json:"createdTime,omitempty" url:"createdTime,omitempty"`
	// Exchange transaction ID
	ExchangeTxId string `json:"exchangeTxId,omitempty" url:"exchangeTxId,omitempty"`
}

type AssetExchangeOrderRecordQuery

type AssetExchangeOrderRecordQuery struct {
	// The currency to convert from, uppercase only. e.g,`BTC`
	FromCoin string `json:"fromCoin,omitempty" url:"fromCoin,omitempty"`
	// The currency to convert to, uppercase only. e.g,`USDT`
	ToCoin string `json:"toCoin,omitempty" url:"toCoin,omitempty"`
	// Limit for data size per page. \[`1`, `50`\]. Default: `10`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type AssetExchangeQueryCoinList

type AssetExchangeQueryCoinList struct {
	// Coin spec
	Coins []AssetExchangeQueryCoinListCoinsItem `json:"coins,omitempty" url:"coins,omitempty"`
}

type AssetExchangeQueryCoinListCoinsItem

type AssetExchangeQueryCoinListCoinsItem struct {
	// Coin
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Full coin name
	FullName string `json:"fullName,omitempty" url:"fullName,omitempty"`
	// Coin icon url
	Icon string `json:"icon,omitempty" url:"icon,omitempty"`
	// Coin icon url (dark mode)
	IconNight string `json:"iconNight,omitempty" url:"iconNight,omitempty"`
	// Coin precision
	AccuracyLength int64 `json:"accuracyLength,omitempty" url:"accuracyLength,omitempty"`
	// `crypto`
	CoinType string `json:"coinType,omitempty" url:"coinType,omitempty"`
	// Balance
	//
	// 	- When side=0, it gives available balance but cannot used to convert. To get an exact balance to convert, you need specify `side=1` and `coin` parameter
	Balance string `json:"balance,omitempty" url:"balance,omitempty"`
	// Coin balance in USDT worth value
	UBalance string `json:"uBalance,omitempty" url:"uBalance,omitempty"`
	// The minimum amount of fromCoin per transaction
	SingleFromMinLimit string `json:"singleFromMinLimit,omitempty" url:"singleFromMinLimit,omitempty"`
	// The maximum amount of fromCoin per transaction
	SingleFromMaxLimit string `json:"singleFromMaxLimit,omitempty" url:"singleFromMaxLimit,omitempty"`
	// `true`: the coin is disabled to be fromCoin, `false`: the coin is allowed to be fromCoin
	DisableFrom bool `json:"disableFrom,omitempty" url:"disableFrom,omitempty"`
	// `true`: the coin is disabled to be toCoin, `false`: the coin is allowed to be toCoin
	DisableTo bool `json:"disableTo,omitempty" url:"disableTo,omitempty"`
	// Reserved field, ignored for now
	TimePeriod []byte `json:"timePeriod,omitempty" url:"timePeriod,omitempty"`
	// Reserved field, ignored for now
	SingleToMinLimit []byte `json:"singleToMinLimit,omitempty" url:"singleToMinLimit,omitempty"`
	// Reserved field, ignored for now
	SingleToMaxLimit []byte `json:"singleToMaxLimit,omitempty" url:"singleToMaxLimit,omitempty"`
	// Reserved field, ignored for now
	DailyFromMinLimit []byte `json:"dailyFromMinLimit,omitempty" url:"dailyFromMinLimit,omitempty"`
	// Reserved field, ignored for now
	DailyFromMaxLimit []byte `json:"dailyFromMaxLimit,omitempty" url:"dailyFromMaxLimit,omitempty"`
	// Reserved field, ignored for now
	DailyToMinLimit []byte `json:"dailyToMinLimit,omitempty" url:"dailyToMinLimit,omitempty"`
	// Reserved field, ignored for now
	DailyToMaxLimit []byte `json:"dailyToMaxLimit,omitempty" url:"dailyToMaxLimit,omitempty"`
}

type AssetExchangeQueryCoinListQuery

type AssetExchangeQueryCoinListQuery struct {
	// Wallet type
	//
	// 	- `eb_convert_funding`
	// 	- `eb_convert_uta`
	// 	- `eb_convert_spot`
	// 	- `eb_convert_contract`
	// 	- `eb_convert_inverse`
	AccountType ConvertAccountType `json:"accountType,omitempty" url:"accountType,omitempty"`
	// Coin, uppercase only
	//
	// 	- Convert from coin (coin to sell)
	// 	- when side=0, coin field is ignored
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// `0`: fromCoin list, the balance is given if you have it; `1`: toCoin list (coin to buy)
	//
	// 	- when side=1 and coin field is filled, it returns toCoin list based on coin field
	Side int64 `json:"side,omitempty" url:"side,omitempty"`
}

type AssetExchangeQueryConvertHistory

type AssetExchangeQueryConvertHistory struct {
	// Array of quotes
	List []AssetExchangeQueryConvertHistoryListItem `json:"list,omitempty" url:"list,omitempty"`
}

type AssetExchangeQueryConvertHistoryListItem

type AssetExchangeQueryConvertHistoryListItem struct {
	// Wallet type
	// `eb_convert_funding`: funding wallet convert records via API
	// `eb_convert_uta`: uta wallet convert records via API
	// `funding`: normal crypto convert via web/app
	// `funding_fiat`: fiat crypto convert via web/app
	// `funding_fbtc_convert`: FBTC to BTC convert via web/app
	// `funding_block_trade`: block trade convert via web/app
	AccountType ConvertAccountType `json:"accountType,omitempty" url:"accountType,omitempty"`
	// Exchange tx ID, same as quote tx ID
	ExchangeTxId string `json:"exchangeTxId,omitempty" url:"exchangeTxId,omitempty"`
	// User ID
	UserId string `json:"userId,omitempty" url:"userId,omitempty"`
	// From coin
	FromCoin string `json:"fromCoin,omitempty" url:"fromCoin,omitempty"`
	// From coin type. `crypto`
	FromCoinType string `json:"fromCoinType,omitempty" url:"fromCoinType,omitempty"`
	// To coin
	ToCoin string `json:"toCoin,omitempty" url:"toCoin,omitempty"`
	// To coin type. `crypto`
	ToCoinType string `json:"toCoinType,omitempty" url:"toCoinType,omitempty"`
	// From coin amount (amount to sell)
	FromAmount string `json:"fromAmount,omitempty" url:"fromAmount,omitempty"`
	// To coin amount (amount to buy according to exchange rate)
	ToAmount string `json:"toAmount,omitempty" url:"toAmount,omitempty"`
	// Exchange status
	//
	// 	- init
	// 	- processing
	// 	- success
	// 	- failure
	ExchangeStatus string                                          `json:"exchangeStatus,omitempty" url:"exchangeStatus,omitempty"`
	ExtInfo        AssetExchangeQueryConvertHistoryListItemExtInfo `json:"extInfo" url:"extInfo"`
	// Exchange rate
	ConvertRate string `json:"convertRate,omitempty" url:"convertRate,omitempty"`
	// Quote created time
	CreatedAt string `json:"createdAt,omitempty" url:"createdAt,omitempty"`
}

type AssetExchangeQueryConvertHistoryListItemExtInfo

type AssetExchangeQueryConvertHistoryListItemExtInfo struct {
	// This field is published when you send it in the [Request a Quote](/docs/v5/asset/convert/apply-quote)
	ParamType string `json:"paramType,omitempty" url:"paramType,omitempty"`
	// This field is published when you send it in the [Request a Quote](/docs/v5/asset/convert/apply-quote)
	ParamValue string `json:"paramValue,omitempty" url:"paramValue,omitempty"`
}

type AssetExchangeQueryConvertHistoryQuery

type AssetExchangeQueryConvertHistoryQuery struct {
	// Wallet type
	// `eb_convert_funding`: funding wallet convert records via API
	// `eb_convert_uta`: uta wallet convert records via API
	// `funding`: normal crypto convert via web/app
	// `funding_fiat`: fiat crypto convert via web/app
	// `funding_fbtc_convert`: FBTC to BTC convert via web/app
	// `funding_block_trade`: block trade convert via web/app
	//
	// 	- Supports passing multiple types, separated by comma e.g., `eb_convert_funding,eb_convert_uta`
	// 	- Return all wallet types data if not passed
	AccountType ConvertAccountType `json:"accountType,omitempty" url:"accountType,omitempty"`
	// Page number	- started from 1
	// 	- 1st page by default
	Index int64 `json:"index,omitempty" url:"index,omitempty"`
	// Page size	- 20 records by default
	// 	- up to 100 records, return 100 when exceeds 100
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
}

type AssetExchangeQuoteApplyParams

type AssetExchangeQuoteApplyParams struct {
	// Wallet type
	AccountType ConvertAccountType `json:"accountType,omitempty" url:"accountType,omitempty"`
	// Convert from coin (coin to sell)
	FromCoin string `json:"fromCoin,omitempty" url:"fromCoin,omitempty"`
	// Convert to coin (coin to buy)
	ToCoin string `json:"toCoin,omitempty" url:"toCoin,omitempty"`
	// Request coin, same as fromCoin
	//
	// 	- In the future, we may support requestCoin=toCoin
	RequestCoin string `json:"requestCoin,omitempty" url:"requestCoin,omitempty"`
	// request coin amount (the amount you want to sell)
	RequestAmount string `json:"requestAmount,omitempty" url:"requestAmount,omitempty"`
	// `crypto`
	FromCoinType string `json:"fromCoinType,omitempty" url:"fromCoinType,omitempty"`
	// `crypto`
	ToCoinType string `json:"toCoinType,omitempty" url:"toCoinType,omitempty"`
	// `opFrom`, mainly used for API broker user
	ParamType string `json:"paramType,omitempty" url:"paramType,omitempty"`
	// Broker ID, mainly used for API broker user
	ParamValue string `json:"paramValue,omitempty" url:"paramValue,omitempty"`
	// Customised request ID
	//
	// 	- a maximum length of 36
	// 	- Generally it is useless, but it is convenient to track the quote request internally if you fill this field
	RequestId string `json:"requestId,omitempty" url:"requestId,omitempty"`
}

type AssetExchangeQuoteApplyResult

type AssetExchangeQuoteApplyResult struct {
	// Quote transaction ID. It is system generated, and it is used to confirm quote and query the result of transaction
	QuoteTxId string `json:"quoteTxId,omitempty" url:"quoteTxId,omitempty"`
	// Exchange rate
	ExchangeRate string `json:"exchangeRate,omitempty" url:"exchangeRate,omitempty"`
	// From coin
	FromCoin string `json:"fromCoin,omitempty" url:"fromCoin,omitempty"`
	// From coin type. `crypto`
	FromCoinType string `json:"fromCoinType,omitempty" url:"fromCoinType,omitempty"`
	// To coin
	ToCoin string `json:"toCoin,omitempty" url:"toCoin,omitempty"`
	// To coin type. `crypto`
	ToCoinType string `json:"toCoinType,omitempty" url:"toCoinType,omitempty"`
	// From coin amount (amount to sell)
	FromAmount string `json:"fromAmount,omitempty" url:"fromAmount,omitempty"`
	// To coin amount (amount to buy according to exchange rate)
	ToAmount string `json:"toAmount,omitempty" url:"toAmount,omitempty"`
	// The expiry time for this quote (15 seconds)
	ExpiredTime string `json:"expiredTime,omitempty" url:"expiredTime,omitempty"`
	// Customised request ID
	RequestId string `json:"requestId,omitempty" url:"requestId,omitempty"`
	// Compliance-related field. Currently returns an empty array, which may be used in the future
	ExtTaxAndFee []string `json:"extTaxAndFee,omitempty" url:"extTaxAndFee,omitempty"`
}

type AssetSettlementRecord

type AssetSettlementRecord struct {
	// Product type
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Object
	List []AssetSettlementRecordListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type AssetSettlementRecordListItem

type AssetSettlementRecordListItem struct {
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// `Buy`,`Sell`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Position size
	Size string `json:"size,omitempty" url:"size,omitempty"`
	// Settlement price
	SessionAvgPrice string `json:"sessionAvgPrice,omitempty" url:"sessionAvgPrice,omitempty"`
	// Mark price
	MarkPrice string `json:"markPrice,omitempty" url:"markPrice,omitempty"`
	// Realised PnL
	RealisedPnl string `json:"realisedPnl,omitempty" url:"realisedPnl,omitempty"`
	// Created time (ms)
	CreatedTime string `json:"createdTime,omitempty" url:"createdTime,omitempty"`
}

type AssetSettlementRecordQuery

type AssetSettlementRecordQuery struct {
	// Product type `linear`(USDC contract)
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCPERP`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// The start timestamp (ms)
	//
	// 	- startTime and endTime are not passed, return 30 days by default
	// 	- Only startTime is passed, return range between startTime and startTime + 30 days
	// 	- Only endTime is passed, return range between endTime-30 days and endTime
	// 	- If both are passed, the rule is endTime - startTime <= 30 days
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end time. timestamp (ms)
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Limit for data size per page. \[`1`, `50`\]. Default: `20`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type AssetTransferInterTransferParams

type AssetTransferInterTransferParams struct {
	// [UUID](https://www.uuidgenerator.net/dev-corner). Please manually generate a UUID
	TransferId string `json:"transferId,omitempty" url:"transferId,omitempty"`
	// Coin, uppercase only
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Amount
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
	// From account type
	FromAccountType AccountType `json:"fromAccountType,omitempty" url:"fromAccountType,omitempty"`
	// To account type
	ToAccountType AccountType `json:"toAccountType,omitempty" url:"toAccountType,omitempty"`
}

type AssetTransferInterTransferResult

type AssetTransferInterTransferResult struct {
	// UUID
	TransferId string `json:"transferId,omitempty" url:"transferId,omitempty"`
	// Transfer status
	//
	// 	- `STATUS_UNKNOWN`
	// 	- `SUCCESS`
	// 	- `PENDING`
	// 	- `FAILED`
	Status Status `json:"status,omitempty" url:"status,omitempty"`
}

type AssetTransferQueryAccountCoinBalance

type AssetTransferQueryAccountCoinBalance struct {
	// Account type
	AccountType AccountType `json:"accountType,omitempty" url:"accountType,omitempty"`
	// Biz type
	BizType BizType `json:"bizType,omitempty" url:"bizType,omitempty"`
	// Account ID
	AccountId string `json:"accountId,omitempty" url:"accountId,omitempty"`
	// Uid
	MemberId string                                      `json:"memberId,omitempty" url:"memberId,omitempty"`
	Balance  AssetTransferQueryAccountCoinBalanceBalance `json:"balance" url:"balance"`
}

type AssetTransferQueryAccountCoinBalanceBalance

type AssetTransferQueryAccountCoinBalanceBalance struct {
	// Coin
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Wallet balance
	WalletBalance string `json:"walletBalance,omitempty" url:"walletBalance,omitempty"`
	// Transferable balance
	TransferBalance string `json:"transferBalance,omitempty" url:"transferBalance,omitempty"`
	// bonus
	Bonus string `json:"bonus,omitempty" url:"bonus,omitempty"`
	// Safe amount to transfer. Keep `""` if not query
	TransferSafeAmount string `json:"transferSafeAmount,omitempty" url:"transferSafeAmount,omitempty"`
	// Transferable amount for ins loan account. Keep `""` if not query
	LtvTransferSafeAmount string `json:"ltvTransferSafeAmount,omitempty" url:"ltvTransferSafeAmount,omitempty"`
}

type AssetTransferQueryAccountCoinBalanceQuery

type AssetTransferQueryAccountCoinBalanceQuery struct {
	// UID. **Required** when querying sub UID balance with master api key
	MemberId string `json:"memberId,omitempty" url:"memberId,omitempty"`
	// UID. **Required** when querying the transferable balance between different UIDs
	ToMemberId string `json:"toMemberId,omitempty" url:"toMemberId,omitempty"`
	// Account type
	AccountType AccountType `json:"accountType,omitempty" url:"accountType,omitempty"`
	// To account type. **Required** when querying the transferable balance between different account types
	ToAccountType AccountType `json:"toAccountType,omitempty" url:"toAccountType,omitempty"`
	// Coin, uppercase only
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// `0`(default): not query bonus. `1`: query bonus
	WithBonus int64 `json:"withBonus,omitempty" url:"withBonus,omitempty"`
	// Whether query delay withdraw/transfer safe amount
	//
	// 	- `0`(default): false, `1`: true
	// 	- What is [delay withdraw amount](/docs/v5/asset/balance/delay-amount)?
	WithTransferSafeAmount int64 `json:"withTransferSafeAmount,omitempty" url:"withTransferSafeAmount,omitempty"`
	// For OTC loan users in particular, you can check the transferable amount under risk level
	//
	// 	- `0`(default): false, `1`: true
	// 	- `toAccountType` is mandatory
	WithLtvTransferSafeAmount int64 `json:"withLtvTransferSafeAmount,omitempty" url:"withLtvTransferSafeAmount,omitempty"`
}

type AssetTransferQueryAccountCoinsBalance

type AssetTransferQueryAccountCoinsBalance struct {
	// Account type
	AccountType AccountType `json:"accountType,omitempty" url:"accountType,omitempty"`
	// UserID
	MemberId string `json:"memberId,omitempty" url:"memberId,omitempty"`
	// Object
	Balance []AssetTransferQueryAccountCoinsBalanceBalanceItem `json:"balance,omitempty" url:"balance,omitempty"`
}

type AssetTransferQueryAccountCoinsBalanceBalanceItem

type AssetTransferQueryAccountCoinsBalanceBalanceItem struct {
	// Currency
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Wallet balance
	WalletBalance string `json:"walletBalance,omitempty" url:"walletBalance,omitempty"`
	// Transferable balance
	TransferBalance string `json:"transferBalance,omitempty" url:"transferBalance,omitempty"`
	// Bonus
	Bonus string `json:"bonus,omitempty" url:"bonus,omitempty"`
}

type AssetTransferQueryAccountCoinsBalanceQuery

type AssetTransferQueryAccountCoinsBalanceQuery struct {
	// User Id. It is **required** when you use master api key to check sub account coin balance
	MemberId string `json:"memberId,omitempty" url:"memberId,omitempty"`
	// Account type
	AccountType AccountType `json:"accountType,omitempty" url:"accountType,omitempty"`
	// Coin name, uppercase only
	//
	// 	- Query all coins if not passed
	// 	- Can query multiple coins, separated by comma. `USDT,USDC,ETH`
	//
	// **Note:** this field is **mandatory** for accountType=`UNIFIED`, and supports up to 10 coins each request
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// `0`(default): not query bonus. `1`: query bonus
	WithBonus int64 `json:"withBonus,omitempty" url:"withBonus,omitempty"`
}

type AssetTransferQueryInterTransferList

type AssetTransferQueryInterTransferList struct {
	// Object
	List []AssetTransferQueryInterTransferListListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type AssetTransferQueryInterTransferListListItem

type AssetTransferQueryInterTransferListListItem struct {
	// Transfer ID
	TransferId string `json:"transferId,omitempty" url:"transferId,omitempty"`
	// Transferred coin
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Transferred amount
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
	// From account type
	FromAccountType AccountType `json:"fromAccountType,omitempty" url:"fromAccountType,omitempty"`
	// To account type
	ToAccountType AccountType `json:"toAccountType,omitempty" url:"toAccountType,omitempty"`
	// Transfer created timestamp (ms)
	Timestamp string `json:"timestamp,omitempty" url:"timestamp,omitempty"`
	// Transfer status
	Status TransferStatus `json:"status,omitempty" url:"status,omitempty"`
}

type AssetTransferQueryInterTransferListQuery

type AssetTransferQueryInterTransferListQuery struct {
	// UUID. Use the one you generated in [createTransfer](/docs/v5/asset/transfer/create-inter-transfer#response-parameters)
	TransferId string `json:"transferId,omitempty" url:"transferId,omitempty"`
	// Coin, uppercase only
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Transfer status
	Status TransferStatus `json:"status,omitempty" url:"status,omitempty"`
	// The start timestamp (ms) _Note: the query logic is actually effective based on **second** level_
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms) _Note: the query logic is actually effective based on **second** level_
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Limit for data size per page. \[`1`, `50`\]. Default: `20`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type AssetTransferQuerySubMemberList

type AssetTransferQuerySubMemberList struct {
	// All sub UIDs under the main UID
	SubMemberIds []string `json:"subMemberIds,omitempty" url:"subMemberIds,omitempty"`
	// All sub UIDs that have universal transfer enabled
	TransferableSubMemberIds []string `json:"transferableSubMemberIds,omitempty" url:"transferableSubMemberIds,omitempty"`
}

type AssetTransferQueryTransferCoinList

type AssetTransferQueryTransferCoinList struct {
	// A list of coins (as strings)
	List []string `json:"list,omitempty" url:"list,omitempty"`
}

type AssetTransferQueryTransferCoinListQuery

type AssetTransferQueryTransferCoinListQuery struct {
	// From account type
	FromAccountType AccountType `json:"fromAccountType,omitempty" url:"fromAccountType,omitempty"`
	// To account type
	ToAccountType AccountType `json:"toAccountType,omitempty" url:"toAccountType,omitempty"`
}

type AssetTransferQueryUniversalTransferList

type AssetTransferQueryUniversalTransferList struct {
	// Object
	List []AssetTransferQueryUniversalTransferListListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type AssetTransferQueryUniversalTransferListListItem

type AssetTransferQueryUniversalTransferListListItem struct {
	// Transfer ID
	TransferId string `json:"transferId,omitempty" url:"transferId,omitempty"`
	// Transferred coin
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Transferred amount
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
	// From UID
	FromMemberId string `json:"fromMemberId,omitempty" url:"fromMemberId,omitempty"`
	// TO UID
	ToMemberId string `json:"toMemberId,omitempty" url:"toMemberId,omitempty"`
	// From account type
	FromAccountType string `json:"fromAccountType,omitempty" url:"fromAccountType,omitempty"`
	// To account type
	ToAccountType string `json:"toAccountType,omitempty" url:"toAccountType,omitempty"`
	// Transfer created timestamp (ms)
	Timestamp string `json:"timestamp,omitempty" url:"timestamp,omitempty"`
	// Transfer status
	Status TransferStatus `json:"status,omitempty" url:"status,omitempty"`
}

type AssetTransferQueryUniversalTransferListQuery

type AssetTransferQueryUniversalTransferListQuery struct {
	// UUID. Use the one you generated in [createTransfer](/docs/v5/asset/transfer/create-inter-transfer#response-parameters)
	TransferId string `json:"transferId,omitempty" url:"transferId,omitempty"`
	// Coin, uppercase only
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Transfer status. `SUCCESS`,`FAILED`,`PENDING`
	Status TransferStatus `json:"status,omitempty" url:"status,omitempty"`
	// The start timestamp (ms) _Note: the query logic is actually effective based on **second** level_
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms) _Note: the query logic is actually effective based on **second** level_
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Limit for data size per page. \[`1`, `50`\]. Default: `20`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type AssetTransferUniversalTransferParams

type AssetTransferUniversalTransferParams struct {
	// [UUID](https://www.uuidgenerator.net/dev-corner). Please manually generate a UUID
	TransferId string `json:"transferId,omitempty" url:"transferId,omitempty"`
	// Coin, uppercase only
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Amount
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
	// From UID
	FromMemberId int64 `json:"fromMemberId,omitempty" url:"fromMemberId,omitempty"`
	// To UID
	ToMemberId int64 `json:"toMemberId,omitempty" url:"toMemberId,omitempty"`
	// From account type
	FromAccountType AccountType `json:"fromAccountType,omitempty" url:"fromAccountType,omitempty"`
	// To account type
	ToAccountType AccountType `json:"toAccountType,omitempty" url:"toAccountType,omitempty"`
}

type AssetTransferUniversalTransferResult

type AssetTransferUniversalTransferResult struct {
	// UUID
	TransferId string `json:"transferId,omitempty" url:"transferId,omitempty"`
	// Transfer status
	//
	// 	- `STATUS_UNKNOWN`
	// 	- `SUCCESS`
	// 	- `PENDING`
	// 	- `FAILED`
	Status Status `json:"status,omitempty" url:"status,omitempty"`
}

type AssetWithdrawCancelParams

type AssetWithdrawCancelParams struct {
	// Withdrawal ID
	Id string `json:"id,omitempty" url:"id,omitempty"`
}

type AssetWithdrawCancelResult

type AssetWithdrawCancelResult struct {
	// `0`: fail. `1`: success
	Status Status `json:"status,omitempty" url:"status,omitempty"`
}

type AssetWithdrawCreateParams

type AssetWithdrawCreateParams struct {
	// Coin, uppercase only
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Chain
	//
	// 	- `forceChain`\=0 or 1: this field is **required**
	// 	- `forceChain`\=2: this field can be null
	Chain string `json:"chain,omitempty" url:"chain,omitempty"`
	// - `forceChain`\=0 or 1: fill wallet address, and make sure you add address in the [address book](https://www.bybit.com/user/assets/money-address) first. Please note that the address is case sensitive, so use the exact same address added in address book
	// 	- `forceChain`\=2: fill Bybit UID, and it can only be another Bybit **main** account UID. Make sure you add UID in the [address book](https://www.bybit.com/user/assets/money-address) first
	Address string `json:"address,omitempty" url:"address,omitempty"`
	// Tag
	//
	// 	- **Required** if tag exists in the wallet address list.
	// 	- **Note**: please do not set a tag/memo in the address book if the chain does not support tag
	Tag string `json:"tag,omitempty" url:"tag,omitempty"`
	// Withdraw amount
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
	// Current timestamp (ms). Used for preventing from withdraw replay
	Timestamp int64 `json:"timestamp,omitempty" url:"timestamp,omitempty"`
	// Whether or not to force an on-chain withdrawal
	//
	// 	- `0`(default): If the address is parsed out to be an internal address, then internal transfer (**Bybit main account only**)
	// 	- `1`: Force the withdrawal to occur on-chain
	// 	- `2`: Use UID to withdraw
	ForceChain int64 `json:"forceChain,omitempty" url:"forceChain,omitempty"`
	// Select the wallet to be withdrawn from
	//
	// 	- `FUND`: Funding wallet
	// 	- `UTA`: System transfers the funds to Funding wallet to withdraw
	// 	- `FUND,UTA`: For combo withdrawals, funds will be deducted from the Funding wallet first. If the balance is insufficient, the remaining amount will be deducted from the UTA wallet.
	AccountType AccountType `json:"accountType,omitempty" url:"accountType,omitempty"`
	// Handling fee option
	//
	// 	- `0`(default): input amount is the actual amount received, so you have to calculate handling fee manually
	// 	- `1`: input amount is not the actual amount you received, the system will help to deduct the handling fee automatically
	FeeType int64 `json:"feeType,omitempty" url:"feeType,omitempty"`
	// Customised ID, globally unique, it is used for idempotent verification
	//
	// 	- A combination of letters (case sensitive) and numbers, which can be pure letters or pure numbers and the length must be between 1 and 32 digits
	RequestId string `json:"requestId,omitempty" url:"requestId,omitempty"`
}

type AssetWithdrawCreateResult

type AssetWithdrawCreateResult struct {
	// Withdrawal ID
	Id string `json:"id,omitempty" url:"id,omitempty"`
}

type AssetWithdrawQueryAddress

type AssetWithdrawQueryAddress struct {
	// Object
	Rows []AssetWithdrawQueryAddressRowsItem `json:"rows,omitempty" url:"rows,omitempty"`
	// Cursor. Used for pagination
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type AssetWithdrawQueryAddressQuery

type AssetWithdrawQueryAddressQuery struct {
	// Coin:
	//
	// 	- When passing `coin=baseCoin`, it refers to the universal addresses.
	// 	- When passing a coin name, it refers to the regular address on the chain.
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Chain name:
	//
	// 	- When only passing the chain name, it returns both regular addresses and universal addresses.
	// 	- When passing the chain name and `coin=baseCoin`, it only returns the universal address corresponding to the chain.
	Chain string `json:"chain,omitempty" url:"chain,omitempty"`
	// Address type. `0`: OnChain Address Type(Regular Address Type and Universal Address Type). `1`: Internal Transfer Address Type(Invalid "coin" & "chain" Parameters) `2`: On chain address and internal transfer address type (Invalid "coin" & "chain" Parameters)
	AddressType int64 `json:"addressType,omitempty" url:"addressType,omitempty"`
	// Limit for data size per page. \[`1`, `50`\]. Default: `50`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type AssetWithdrawQueryAddressRowsItem

type AssetWithdrawQueryAddressRowsItem struct {
	// Coin
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Chain name
	Chain string `json:"chain,omitempty" url:"chain,omitempty"`
	// Address
	Address string `json:"address,omitempty" url:"address,omitempty"`
	// Address tag
	Tag string `json:"tag,omitempty" url:"tag,omitempty"`
	// remark
	Remark string `json:"remark,omitempty" url:"remark,omitempty"`
	// Address status:`0`: Normal. `1`: New Addresses are prohibited from withdrawing coins for 24 Hours.
	Status int64 `json:"status,omitempty" url:"status,omitempty"`
	// Address type. `0`: OnChain Address Type(Regular Address Type And Universal Address Type) `1`: Internal Transfer Address Type. `2`: Internal Transfer Address Type And OnChain Address Type
	AddressType int64 `json:"addressType,omitempty" url:"addressType,omitempty"`
	// Whether the address has been verified or not: `0`: Unverified Address. `1`: Verified Address.
	Verified int64 `json:"verified,omitempty" url:"verified,omitempty"`
	// Address create time
	CreateAt string `json:"createAt,omitempty" url:"createAt,omitempty"`
}

type AssetWithdrawQueryRecord

type AssetWithdrawQueryRecord struct {
	// Object
	Rows []AssetWithdrawQueryRecordRowsItem `json:"rows,omitempty" url:"rows,omitempty"`
	// Cursor. Used for pagination
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type AssetWithdrawQueryRecordQuery

type AssetWithdrawQueryRecordQuery struct {
	// Withdraw ID
	WithdrawId string `json:"withdrawID,omitempty" url:"withdrawID,omitempty"`
	// Transaction hash ID
	TxId string `json:"txID,omitempty" url:"txID,omitempty"`
	// Coin, uppercase only
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Withdraw type. `0`(default): on chain. `1`: off chain. `2`: all
	WithdrawType int64 `json:"withdrawType,omitempty" url:"withdrawType,omitempty"`
	// The start timestamp (ms)
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms)
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Limit for data size per page. \[`1`, `50`\]. Default: `50`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type AssetWithdrawQueryRecordRowsItem

type AssetWithdrawQueryRecordRowsItem struct {
	// Transaction ID. It returns `""` when withdrawal failed, withdrawal cancelled
	TxId string `json:"txID,omitempty" url:"txID,omitempty"`
	// Coin
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Chain
	Chain string `json:"chain,omitempty" url:"chain,omitempty"`
	// Amount
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
	// Withdraw fee
	WithdrawFee string `json:"withdrawFee,omitempty" url:"withdrawFee,omitempty"`
	// Withdraw status
	Status WithdrawStatus `json:"status,omitempty" url:"status,omitempty"`
	// To withdrawal address. Shows the Bybit UID for internal transfers
	ToAddress string `json:"toAddress,omitempty" url:"toAddress,omitempty"`
	// Tag
	Tag string `json:"tag,omitempty" url:"tag,omitempty"`
	// Withdraw created timestamp (ms)
	CreateTime string `json:"createTime,omitempty" url:"createTime,omitempty"`
	// Withdraw updated timestamp (ms)
	UpdateTime string `json:"updateTime,omitempty" url:"updateTime,omitempty"`
	// Withdraw ID
	WithdrawId string `json:"withdrawId,omitempty" url:"withdrawId,omitempty"`
	// Withdraw type. `0`: on chain. `1`: off chain
	WithdrawType int64  `json:"withdrawType,omitempty" url:"withdrawType,omitempty"`
	Fee          string `json:"fee,omitempty" url:"fee,omitempty"`
	Tax          string `json:"tax,omitempty" url:"tax,omitempty"`
	TaxRate      string `json:"taxRate,omitempty" url:"taxRate,omitempty"`
	TaxType      string `json:"taxType,omitempty" url:"taxType,omitempty"`
}

type AssetWithdrawVaspList

type AssetWithdrawVaspList struct {
	// Exchange entity info
	Vasp []AssetWithdrawVaspListVaspItem `json:"vasp,omitempty" url:"vasp,omitempty"`
}

type AssetWithdrawVaspListVaspItem

type AssetWithdrawVaspListVaspItem struct {
	// Receiver platform id. When transfer to the exchanges that are not in the list, please use vaspEntityId='others'
	VaspEntityId string `json:"vaspEntityId,omitempty" url:"vaspEntityId,omitempty"`
	// Receiver platform name
	VaspName string `json:"vaspName,omitempty" url:"vaspName,omitempty"`
}

type AssetWithdrawWithdrawableAmount

type AssetWithdrawWithdrawableAmount struct {
	// The frozen amount due to risk, in USD
	LimitAmountUsd     string                                            `json:"limitAmountUsd,omitempty" url:"limitAmountUsd,omitempty"`
	WithdrawableAmount AssetWithdrawWithdrawableAmountWithdrawableAmount `json:"withdrawableAmount" url:"withdrawableAmount"`
}

type AssetWithdrawWithdrawableAmountQuery

type AssetWithdrawWithdrawableAmountQuery struct {
	// Coin name, uppercase only
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
}

type AssetWithdrawWithdrawableAmountWithdrawableAmount

type AssetWithdrawWithdrawableAmountWithdrawableAmount struct {
	// Spot wallet, it is not returned if spot wallet is removed
	Spot AssetWithdrawWithdrawableAmountWithdrawableAmountSpot `json:"SPOT" url:"SPOT"`
	// Funding wallet
	Fund AssetWithdrawWithdrawableAmountWithdrawableAmountFund `json:"FUND" url:"FUND"`
	// Unified wallet
	Uta AssetWithdrawWithdrawableAmountWithdrawableAmountUta `json:"UTA" url:"UTA"`
}

type AssetWithdrawWithdrawableAmountWithdrawableAmountFund

type AssetWithdrawWithdrawableAmountWithdrawableAmountFund struct {
	// Coin name
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Amount that can be withdrawn
	WithdrawableAmount string `json:"withdrawableAmount,omitempty" url:"withdrawableAmount,omitempty"`
	// Available balance
	AvailableBalance string `json:"availableBalance,omitempty" url:"availableBalance,omitempty"`
}

type AssetWithdrawWithdrawableAmountWithdrawableAmountSpot

type AssetWithdrawWithdrawableAmountWithdrawableAmountSpot struct {
	// Coin name
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Amount that can be withdrawn
	WithdrawableAmount string `json:"withdrawableAmount,omitempty" url:"withdrawableAmount,omitempty"`
	// Available balance
	AvailableBalance string `json:"availableBalance,omitempty" url:"availableBalance,omitempty"`
}

type AssetWithdrawWithdrawableAmountWithdrawableAmountUta

type AssetWithdrawWithdrawableAmountWithdrawableAmountUta struct {
	// Coin name
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Amount that can be withdrawn
	WithdrawableAmount string `json:"withdrawableAmount,omitempty" url:"withdrawableAmount,omitempty"`
	// Available balance
	AvailableBalance string `json:"availableBalance,omitempty" url:"availableBalance,omitempty"`
}

type BizType

type BizType string
const (
	BizTypeSpot        BizType = "SPOT"
	BizTypeDerivatives BizType = "DERIVATIVES"
	BizTypeOptions     BizType = "OPTIONS"
)

type BrokerAccountInfo

type BrokerAccountInfo struct {
	// The qty of sub account has been created
	SubAcctQty string `json:"subAcctQty,omitempty" url:"subAcctQty,omitempty"`
	// The max limit of sub account can be created
	MaxSubAcctQty string `json:"maxSubAcctQty,omitempty" url:"maxSubAcctQty,omitempty"`
	// Rebate percentage of the base fee
	BaseFeeRebateRate BrokerAccountInfoBaseFeeRebateRate `json:"baseFeeRebateRate" url:"baseFeeRebateRate"`
	// Rebate percentage of the mark up fee
	MarkupFeeRebateRate BrokerAccountInfoMarkupFeeRebateRate `json:"markupFeeRebateRate" url:"markupFeeRebateRate"`
	// System timestamp (ms)
	Ts string `json:"ts,omitempty" url:"ts,omitempty"`
}

type BrokerAccountInfoBaseFeeRebateRate

type BrokerAccountInfoBaseFeeRebateRate struct {
	// Rebate percentage of the base fee for spot, e.g., 10.00%
	Spot string `json:"spot,omitempty" url:"spot,omitempty"`
	// Rebate percentage of the base fee for derivatives, e.g., 10.00%
	Derivatives string `json:"derivatives,omitempty" url:"derivatives,omitempty"`
}

type BrokerAccountInfoMarkupFeeRebateRate

type BrokerAccountInfoMarkupFeeRebateRate struct {
	// Rebate percentage of the mark up fee for spot, e.g., 10.00%
	Spot string `json:"spot,omitempty" url:"spot,omitempty"`
	// Rebate percentage of the mark up fee for derivatives, e.g., 10.00%
	Derivatives string `json:"derivatives,omitempty" url:"derivatives,omitempty"`
	// Rebate percentage of the mark up fee for convert, e.g., 10.00%
	Convert string `json:"convert,omitempty" url:"convert,omitempty"`
}

type BrokerApilimitQueryAll

type BrokerApilimitQueryAll struct {
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
	// Object
	List []BrokerApilimitQueryAllListItem `json:"list,omitempty" url:"list,omitempty"`
}

type BrokerApilimitQueryAllListItem

type BrokerApilimitQueryAllListItem struct {
	// Multiple UIDs separated by commas
	Uids string `json:"uids,omitempty" url:"uids,omitempty"`
	// Business type
	BizType BizType `json:"bizType,omitempty" url:"bizType,omitempty"`
	// API Rate limit per second
	Rate int64 `json:"rate,omitempty" url:"rate,omitempty"`
}

type BrokerApilimitQueryAllQuery

type BrokerApilimitQueryAllQuery struct {
	// Limit for data size per page. \[`1`, `1000`\]. Default: `1000`
	Limit string `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
	// Multiple UIDs across different master accounts, separated by commas. Returns all subaccounts by default
	Uids string `json:"uids,omitempty" url:"uids,omitempty"`
}

type BrokerApilimitQueryCap

type BrokerApilimitQueryCap struct {
	// Object
	List []BrokerApilimitQueryCapListItem `json:"list,omitempty" url:"list,omitempty"`
}

type BrokerApilimitQueryCapListItem

type BrokerApilimitQueryCapListItem struct {
	// Business type
	BizType BizType `json:"bizType,omitempty" url:"bizType,omitempty"`
	// Total API rate limit usage accross all subaccounts and master account
	TotalRate string `json:"totalRate,omitempty" url:"totalRate,omitempty"`
	// Entity-level API rate limit per second
	EbCap string `json:"ebCap,omitempty" url:"ebCap,omitempty"`
	// UID-level API rate limit per second
	UidCap string `json:"uidCap,omitempty" url:"uidCap,omitempty"`
}

type BrokerApilimitSetParams

type BrokerApilimitSetParams struct {
	// Object
	List []BrokerApilimitSetParamsListItem `json:"list,omitempty" url:"list,omitempty"`
}

type BrokerApilimitSetParamsListItem

type BrokerApilimitSetParamsListItem struct {
	// Multiple UIDs separated by commas, e.g., "uid1,uid2,uid3"
	Uids string `json:"uids,omitempty" url:"uids,omitempty"`
	// Business type
	BizType BizType `json:"bizType,omitempty" url:"bizType,omitempty"`
	// API rate limit per second
	Rate int64 `json:"rate,omitempty" url:"rate,omitempty"`
}

type BrokerApilimitSetResult

type BrokerApilimitSetResult struct {
	// Multiple UIDs separated by commas
	Uids string `json:"uids,omitempty" url:"uids,omitempty"`
	// Business type
	BizType BizType `json:"bizType,omitempty" url:"bizType,omitempty"`
	// API rate limit per second
	Rate int64 `json:"rate,omitempty" url:"rate,omitempty"`
	// Whether or not the request was successful
	Success bool `json:"success,omitempty" url:"success,omitempty"`
	// Result message
	Msg Msg `json:"msg,omitempty" url:"msg,omitempty"`
}

type BrokerAssetQuerySubMemberDepositRecord

type BrokerAssetQuerySubMemberDepositRecord struct {
	// Object
	Rows []BrokerAssetQuerySubMemberDepositRecordRowsItem `json:"rows,omitempty" url:"rows,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type BrokerAssetQuerySubMemberDepositRecordQuery

type BrokerAssetQuerySubMemberDepositRecordQuery struct {
	// Internal ID: Can be used to uniquely identify and filter the deposit. When combined with other parameters, this field takes the highest priority
	Id string `json:"id,omitempty" url:"id,omitempty"`
	// Transaction ID: Please note that data generated before Jan 1, 2024 cannot be queried using txID
	TxId string `json:"txID,omitempty" url:"txID,omitempty"`
	// Sub UID
	SubMemberId string `json:"subMemberId,omitempty" url:"subMemberId,omitempty"`
	// Coin, uppercase only
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// The start timestamp (ms) _Note: the query logic is actually effective based on **second** level_
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms) _Note: the query logic is actually effective based on **second** level_
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Limit for data size per page. \[`1`, `50`\]. Default: `50`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type BrokerAssetQuerySubMemberDepositRecordRowsItem

type BrokerAssetQuerySubMemberDepositRecordRowsItem struct {
	// Unique ID
	Id string `json:"id,omitempty" url:"id,omitempty"`
	// Sub account user ID
	SubMemberId string `json:"subMemberId,omitempty" url:"subMemberId,omitempty"`
	// Coin
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Chain
	Chain string `json:"chain,omitempty" url:"chain,omitempty"`
	// Amount
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
	// Transaction ID
	TxId string `json:"txID,omitempty" url:"txID,omitempty"`
	// Deposit status
	Status DepositStatus `json:"status,omitempty" url:"status,omitempty"`
	// Deposit target address
	ToAddress string `json:"toAddress,omitempty" url:"toAddress,omitempty"`
	// Tag of deposit target address
	Tag string `json:"tag,omitempty" url:"tag,omitempty"`
	// Deposit fee
	DepositFee string `json:"depositFee,omitempty" url:"depositFee,omitempty"`
	// Deposit's success time
	SuccessAt string `json:"successAt,omitempty" url:"successAt,omitempty"`
	// Number of confirmation blocks
	Confirmations string `json:"confirmations,omitempty" url:"confirmations,omitempty"`
	// Transaction sequence number
	TxIndex string `json:"txIndex,omitempty" url:"txIndex,omitempty"`
	// Hash number on the chain
	BlockHash string `json:"blockHash,omitempty" url:"blockHash,omitempty"`
	// The deposit limit for this coin in this chain. `"-1"` means no limit
	BatchReleaseLimit string `json:"batchReleaseLimit,omitempty" url:"batchReleaseLimit,omitempty"`
	// The deposit type. `0`: normal deposit, `10`: the deposit reaches daily deposit limit, `20`: abnormal deposit
	DepositType string `json:"depositType,omitempty" url:"depositType,omitempty"`
	// From address of deposit, only shown when the deposit comes from on-chain and from address is unique, otherwise gives `""`
	FromAddress string `json:"fromAddress,omitempty" url:"fromAddress,omitempty"`
	// This field is used for tax purposes by Bybit EU (Austria) users, declare tax id
	TaxDepositRecordsId string `json:"taxDepositRecordsId,omitempty" url:"taxDepositRecordsId,omitempty"`
	// This field is used for tax purposes by Bybit EU (Austria) users
	//
	// 	- 0: No reporting required
	// 	- 1: Reporting pending
	// 	- 2: Reporting completed
	TaxStatus int64 `json:"taxStatus,omitempty" url:"taxStatus,omitempty"`
}

type BrokerAwardDistributeAwardParams

type BrokerAwardDistributeAwardParams struct {
	// User ID
	AccountId string `json:"accountId,omitempty" url:"accountId,omitempty"`
	// Voucher ID
	AwardId string `json:"awardId,omitempty" url:"awardId,omitempty"`
	// Customised unique spec code, up to 8 characters
	SpecCode string `json:"specCode,omitempty" url:"specCode,omitempty"`
	// Issue amount
	//
	// 	- Spot airdrop supports up to 16 decimals
	// 	- Other types supports up to 4 decimals
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
	// Broker ID
	BrokerId string `json:"brokerId,omitempty" url:"brokerId,omitempty"`
}

type BrokerAwardDistributionRecordParams

type BrokerAwardDistributionRecordParams struct {
	// User ID
	AccountId string `json:"accountId,omitempty" url:"accountId,omitempty"`
	// Voucher ID
	AwardId string `json:"awardId,omitempty" url:"awardId,omitempty"`
	// Customised unique spec code, up to 8 characters
	SpecCode string `json:"specCode,omitempty" url:"specCode,omitempty"`
	// Whether or not to return the amount used by the user
	//
	// 	- `true`
	// 	- `false` (default)
	WithUsedAmount bool `json:"withUsedAmount,omitempty" url:"withUsedAmount,omitempty"`
}

type BrokerAwardDistributionRecordResult

type BrokerAwardDistributionRecordResult struct {
	// User ID
	AccountId string `json:"accountId,omitempty" url:"accountId,omitempty"`
	// Voucher ID
	AwardId string `json:"awardId,omitempty" url:"awardId,omitempty"`
	// Spec code
	SpecCode string `json:"specCode,omitempty" url:"specCode,omitempty"`
	// Amount of voucher
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
	// `true`, `false`
	IsClaimed bool `json:"isClaimed,omitempty" url:"isClaimed,omitempty"`
	// Claim start timestamp (sec)
	StartAt string `json:"startAt,omitempty" url:"startAt,omitempty"`
	// Claim end timestamp (sec)
	EndAt string `json:"endAt,omitempty" url:"endAt,omitempty"`
	// Voucher effective timestamp (sec) after claimed
	EffectiveAt string `json:"effectiveAt,omitempty" url:"effectiveAt,omitempty"`
	// Voucher inactive timestamp (sec) after claimed
	IneffectiveAt string `json:"ineffectiveAt,omitempty" url:"ineffectiveAt,omitempty"`
	// Amount used by the user
	UsedAmount string `json:"usedAmount,omitempty" url:"usedAmount,omitempty"`
}

type BrokerAwardInfoParams

type BrokerAwardInfoParams struct {
	// Voucher ID
	Id string `json:"id,omitempty" url:"id,omitempty"`
}

type BrokerAwardInfoResult

type BrokerAwardInfoResult struct {
	// Voucher ID
	Id string `json:"id,omitempty" url:"id,omitempty"`
	// Coin
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// - `AWARD_AMOUNT_UNIT_USD`
	// 	- `AWARD_AMOUNT_UNIT_COIN`
	AmountUnit string `json:"amountUnit,omitempty" url:"amountUnit,omitempty"`
	// Product line
	ProductLine string `json:"productLine,omitempty" url:"productLine,omitempty"`
	// Sub product line
	SubProductLine string `json:"subProductLine,omitempty" url:"subProductLine,omitempty"`
	// Total amount of voucher
	TotalAmount string `json:"totalAmount,omitempty" url:"totalAmount,omitempty"`
	// Used amount of voucher
	UsedAmount string `json:"usedAmount,omitempty" url:"usedAmount,omitempty"`
}

type BrokerEarningsInfo

type BrokerEarningsInfo struct {
	// Category statistics for total earning data
	TotalEarningCat BrokerEarningsInfoTotalEarningCat `json:"totalEarningCat" url:"totalEarningCat"`
	// Object. Detailed trading information for each sub UID and each category
	Details []BrokerEarningsInfoDetailsItem `json:"details,omitempty" url:"details,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type BrokerEarningsInfoDetailsItem

type BrokerEarningsInfoDetailsItem struct {
	// Sub UID
	UserId string `json:"userId,omitempty" url:"userId,omitempty"`
	// Business type. `SPOT`, `DERIVATIVES`, `OPTIONS`, `CONVERT`
	BizType string `json:"bizType,omitempty" url:"bizType,omitempty"`
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Rebate coin name
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Rebate amount
	Earning string `json:"earning,omitempty" url:"earning,omitempty"`
	// Earning generated from markup fee rate
	MarkupEarning string `json:"markupEarning,omitempty" url:"markupEarning,omitempty"`
	// Earning generated from base fee rate
	BaseFeeEarning string `json:"baseFeeEarning,omitempty" url:"baseFeeEarning,omitempty"`
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Trade ID
	ExecId string `json:"execId,omitempty" url:"execId,omitempty"`
	// Order execution timestamp (ms)
	ExecTime string `json:"execTime,omitempty" url:"execTime,omitempty"`
}

type BrokerEarningsInfoQuery

type BrokerEarningsInfoQuery struct {
	// Business type. `SPOT`, `DERIVATIVES`, `OPTIONS`, `CONVERT`
	BizType BizType `json:"bizType,omitempty" url:"bizType,omitempty"`
	// Begin date, in the format of YYYYMMDD, e.g, 20231201, search the data from 1st Dec 2023 00:00:00 UTC (include)
	Begin string `json:"begin,omitempty" url:"begin,omitempty"`
	// End date, in the format of YYYYMMDD, e.g, 20231201, search the data before 2nd Dec 2023 00:00:00 UTC (exclude)
	End string `json:"end,omitempty" url:"end,omitempty"`
	// - To get results for a specific subaccount: Enter the subaccount UID
	// 	- To get results for all subaccounts: Leave the field empty
	Uid string `json:"uid,omitempty" url:"uid,omitempty"`
	// Limit for data size per page. \[`1`, `1000`\]. Default: `1000`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type BrokerEarningsInfoTotalEarningCat

type BrokerEarningsInfoTotalEarningCat struct {
	// Object. Earning for Spot trading. If do not have any rebate, keep empty array
	Spot []BrokerEarningsInfoTotalEarningCatSpotItem `json:"spot,omitempty" url:"spot,omitempty"`
	// Object. Earning for Derivatives trading. If do not have any rebate, keep empty array
	Derivatives []BrokerEarningsInfoTotalEarningCatDerivativesItem `json:"derivatives,omitempty" url:"derivatives,omitempty"`
	// Object. Earning for Option trading. If do not have any rebate, keep empty array
	Options []BrokerEarningsInfoTotalEarningCatOptionsItem `json:"options,omitempty" url:"options,omitempty"`
	// Object. Earning for Convert trading. If do not have any rebate, keep empty array
	Convert []BrokerEarningsInfoTotalEarningCatConvertItem `json:"convert,omitempty" url:"convert,omitempty"`
	// Object. Sum earnings of all categories. If do not have any rebate, keep empty array
	Total []BrokerEarningsInfoTotalEarningCatTotalItem `json:"total,omitempty" url:"total,omitempty"`
}

type BrokerEarningsInfoTotalEarningCatConvertItem

type BrokerEarningsInfoTotalEarningCatConvertItem struct {
	// Rebate coin name
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Rebate amount of the coin
	Earning string `json:"earning,omitempty" url:"earning,omitempty"`
}

type BrokerEarningsInfoTotalEarningCatDerivativesItem

type BrokerEarningsInfoTotalEarningCatDerivativesItem struct {
	// Rebate coin name
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Rebate amount of the coin
	Earning string `json:"earning,omitempty" url:"earning,omitempty"`
}

type BrokerEarningsInfoTotalEarningCatOptionsItem

type BrokerEarningsInfoTotalEarningCatOptionsItem struct {
	// Rebate coin name
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Rebate amount of the coin
	Earning string `json:"earning,omitempty" url:"earning,omitempty"`
}

type BrokerEarningsInfoTotalEarningCatSpotItem

type BrokerEarningsInfoTotalEarningCatSpotItem struct {
	// Rebate coin name
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Rebate amount of the coin
	Earning string `json:"earning,omitempty" url:"earning,omitempty"`
}

type BrokerEarningsInfoTotalEarningCatTotalItem

type BrokerEarningsInfoTotalEarningCatTotalItem struct {
	// Rebate coin name
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Rebate amount of the coin
	Earning string `json:"earning,omitempty" url:"earning,omitempty"`
}

type BybitApi

type BybitApi interface {
	// Get Announcement
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/announcement
	GetAnnouncementsIndex(context.Context, AnnouncementsIndexQuery) (AnnouncementsIndex, error)

	// Demo Trading Service
	//
	// **Mainnet Demo Trading URL:**
	// Rest API: `https://api-demo.bybit.com`
	// Websocket: `wss://stream-demo.bybit.com` (note that this only supports the private streams; public data is identical to that found on mainnet with `wss://stream.bybit.com`; WS Trade is not supported)
	//
	// Bybit v5 Open API supports demo trading account, but please note **not** every API is available for demo trading account because demo trading service is mainly for trading experience purpose, so that it does not have a complete function compared with the real trading service.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/demo
	AccountDemoApplyMoney(context.Context, AccountDemoApplyMoneyParams) (AccountDemoApplyMoneyResult, error)

	// Get System Status
	//
	// Get the system status when there is a platform maintenance or service incident.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/system-status
	GetSystemStatus(context.Context, SystemStatusQuery) (SystemStatus, error)

	// Get Bybit Server Time
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/market/time
	GetMarketTime(context.Context) (MarketTime, error)

	// Get Kline
	//
	// Query for historical klines (also known as candles/candlesticks). Charts are returned in groups based on the requested interval.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/market/kline
	GetMarketKline(context.Context, MarketKlineQuery) (MarketKline, error)

	// Get Mark Price Kline
	//
	// Query for historical [mark price](https://www.bybit.com/en-US/help-center/s/article/Glossary-Bybit-Trading-Terms) klines. Charts are returned in groups based on the requested interval.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/market/mark-kline
	GetMarketMarkPriceKline(context.Context, MarketMarkPriceKlineQuery) (MarketMarkPriceKline, error)

	// Get Index Price Kline
	//
	// Query for historical [index price](https://www.bybit.com/en-US/help-center/s/article/Glossary-Bybit-Trading-Terms) klines. Charts are returned in groups based on the requested interval.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/market/index-kline
	GetMarketIndexPriceKline(context.Context, MarketIndexPriceKlineQuery) (MarketIndexPriceKline, error)

	// Get Premium Index Price Kline
	//
	// Query for historical [premium index](https://www.bybit.com/data/basic/linear/index-price/premium-index?symbol=BTCUSDT) klines. Charts are returned in groups based on the requested interval.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/market/premium-index-kline
	GetMarketPremiumIndexPriceKline(context.Context, MarketPremiumIndexPriceKlineQuery) (MarketPremiumIndexPriceKline, error)

	// Get Instruments Info
	//
	// Query for the instrument specification of online trading pairs.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/market/instrument
	GetMarketInstrumentsInfo(context.Context, MarketInstrumentsInfoQuery) error

	// Get Orderbook
	//
	// Query for orderbook depth data.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/market/orderbook
	GetMarketOrderbook(context.Context, MarketOrderbookQuery) (MarketOrderbook, error)

	// Get RPI Orderbook
	//
	// Query for orderbook depth data.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/market/rpi-orderbook
	GetMarketRpiOrderbook(context.Context, MarketRpiOrderbookQuery) (MarketRpiOrderbook, error)

	// Get Tickers
	//
	// Query for the latest price snapshot, best bid/ask price, and trading volume in the last 24 hours.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/market/tickers
	GetMarketTickers(context.Context, MarketTickersQuery) error

	// Get Funding Rate History
	//
	// To query the funding rate interval, please refer to the [instruments-info](/docs/v5/market/instrument) endpoint.
	//
	// Query for historical funding rates. Each symbol has a different funding interval. For example, if the interval is 8 hours and the current time is UTC 12, then it returns the last funding rate, which settled at UTC 8.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/market/history-fund-rate
	GetMarketFundingHistory(context.Context, MarketFundingHistoryQuery) (MarketFundingHistory, error)

	// Get Recent Public Trades
	//
	// You can download archived historical trades from the [website](https://www.bybit.com/derivatives/en/history-data)
	//
	// Query recent public trading history in Bybit.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/market/recent-trade
	GetMarketRecentTrade(context.Context, MarketRecentTradeQuery) (MarketRecentTrade, error)

	// Get Open Interest
	//
	// Get the [open interest](https://www.bybit.com/en-US/help-center/s/article/Glossary-Bybit-Trading-Terms) of each symbol.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/market/open-interest
	GetMarketOpenInterest(context.Context, MarketOpenInterestQuery) (MarketOpenInterest, error)

	// Get Historical Volatility
	//
	// Query option historical volatility
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/market/iv
	GetMarketHistoricalVolatility(context.Context, MarketHistoricalVolatilityQuery) (MarketHistoricalVolatility, error)

	// Get Insurance Pool
	//
	// Query for Bybit [insurance pool](https://www.bybit.com/en/announcement-info/insurance-fund/) data (BTC/USDT/USDC etc)
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/market/insurance
	GetMarketInsurance(context.Context, MarketInsuranceQuery) (MarketInsurance, error)

	// Get Risk Limit
	//
	// Query for the [risk limit](https://www.bybit.com/en/help-center/article/Risk-Limit-Perpetual-and-Futures) margin parameters. This information is also displayed on the website [here](https://www.bybit.com/en/announcement-info/margin-parameters/).
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/market/risk-limit
	GetMarketRiskLimit(context.Context, MarketRiskLimitQuery) (MarketRiskLimit, error)

	// Get Delivery Price
	//
	// Get the delivery price.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/market/delivery-price
	GetMarketDeliveryPrice(context.Context, MarketDeliveryPriceQuery) (MarketDeliveryPrice, error)

	// Get New Delivery Price
	//
	// Get historical option delivery prices.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/market/new-delivery-price
	GetMarketNewDeliveryPrice(context.Context, MarketNewDeliveryPriceQuery) (MarketNewDeliveryPrice, error)

	// Get Long Short Ratio
	//
	// This refers to the net long and short positions as percentages of all position holders during the selected time.
	// Long account ratio = Number of holders with long positions / Total number of holders
	// Short account ratio = Number of holders with short positions / Total number of holders
	// Long-short account ratio = Long account ratio / Short account ratio
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/market/long-short-ratio
	GetMarketAccountRatio(context.Context, MarketAccountRatioQuery) (MarketAccountRatio, error)

	// Get Index Price Components
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/market/index-components
	GetMarketIndexPriceComponents(context.Context, MarketIndexPriceComponentsQuery) (MarketIndexPriceComponents, error)

	// Get Order Price Limit
	//
	// For derivative trading order price limit, refer to [announcement](https://announcements.bybit.com/en/article/adjustments-to-bybit-s-derivative-trading-limit-order-mechanism-blt469228de1902fff6/)
	// For spot trading order price limit, refer to [announcement](https://announcements.bybit.com/en/article/title-adjustments-to-bybit-s-spot-trading-limit-order-mechanism-blt786c0c5abf865983/)
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/market/order-price-limit
	GetMarketPriceLimit(context.Context, MarketPriceLimitQuery) (MarketPriceLimit, error)

	// Get ADL Alert
	//
	// Subscribe to the [ADL WebSocket topic](/docs/v5/websocket/public/adl-alert) for faster updates.
	//
	// Query for [ADL](https://www.bybit.com/en/help-center/article/Auto-Deleveraging-ADL) (auto-deleveraging mechanism) alerts and insurance pool information.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/market/adl-alert
	GetMarketAdlAlert(context.Context, MarketAdlAlertQuery) (MarketAdlAlert, error)

	// Get Fee Group Structure
	//
	// For more details please refer to the [fee structure update announcement](https://announcements.bybit.com/article/bybit-fee-structure-update-for-pro-and-market-maker-clients-blt06875b6d623e7581/).
	//
	// Query for the [group fee structure](https://www.bybit.com/en/help-center/article/Group-Fee-Structure-Symbol-Grouping) and fee rates.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/market/fee-group-info
	GetMarketFeeGroupInfo(context.Context, MarketFeeGroupInfoQuery) (MarketFeeGroupInfo, error)

	// Place Order
	//
	// This endpoint supports to create the order for Spot, Margin trading, USDT perpetual, USDT futures, USDC perpetual, USDC futures, Inverse Futures and Options.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/order/create-order
	OrderCreate(context.Context, OrderCreateParams) (OrderCreateResult, error)

	// Amend Order
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/order/amend-order
	OrderAmend(context.Context, OrderAmendParams) (OrderAmendResult, error)

	// Cancel Order
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/order/cancel-order
	OrderCancel(context.Context, OrderCancelParams) (OrderCancelResult, error)

	// Get Open & Closed Orders
	//
	// Primarily query unfilled or partially filled orders in **real-time**, but also supports querying recent 500 closed status (Cancelled, Filled) orders. Please see the usage of request param `openOnly`.
	// And to query older order records, please use the [order history](/docs/v5/order/order-list) interface.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/order/open-order
	GetOrderRealtime(context.Context, OrderRealtimeQuery) (OrderRealtime, error)

	// Cancel All Orders
	//
	// Cancel all open orders
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/order/cancel-all
	OrderCancelAll(context.Context, OrderCancelAllParams) (OrderCancelAllResult, error)

	// Get Order History
	//
	// Query order history. As order creation/cancellation is **asynchronous**, the data returned from this endpoint may delay. If you want to get real-time order information, you could query this [endpoint](/docs/v5/order/open-order) or rely on the [websocket stream](/docs/v5/websocket/private/order) (recommended).
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/order/order-list
	GetOrderHistory(context.Context, OrderHistoryQuery) (OrderHistory, error)

	// Get Trade History
	//
	// Query users' execution records, sorted by `execTime` in descending order.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/order/execution
	GetExecutionList(context.Context, ExecutionListQuery) (ExecutionList, error)

	// Batch Place Order
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/order/batch-place
	OrderCreateBatch(context.Context, OrderCreateBatchParams) (OrderCreateBatchResult, error)

	// Batch Amend Order
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/order/batch-amend
	OrderAmendBatch(context.Context, OrderAmendBatchParams) (OrderAmendBatchResult, error)

	// Batch Cancel Order
	//
	// This endpoint allows you to cancel more than one open order in a single request.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/order/batch-cancel
	OrderCancelBatch(context.Context, OrderCancelBatchParams) (OrderCancelBatchResult, error)

	// Get Borrow Quota (Spot)
	//
	// Query the available balance for Spot trading and Margin trading
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/order/spot-borrow-quota
	GetOrderSpotBorrowCheck(context.Context, OrderSpotBorrowCheckQuery) (OrderSpotBorrowCheck, error)

	// Set Disconnect Cancel All
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/order/dcp
	OrderDisconnectedCancelAll(context.Context, OrderDisconnectedCancelAllParams) error

	// Pre Check Order
	//
	// This endpoint is used to calculate the changes in IMR and MMR of UTA account before and after placing an order.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/order/pre-check-order
	OrderPreCheck(context.Context) (OrderPreCheckResult, error)

	// Get Position Info
	//
	// Query real-time position data, such as position size, cumulative realized PNL, etc.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/position
	GetPositionList(context.Context, PositionListQuery) (PositionList, error)

	// Set Leverage
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/position/leverage
	PositionSetLeverage(context.Context, PositionSetLeverageParams) error

	// Switch Position Mode
	//
	// It supports to switch the position mode for **USDT perpetual** and **Inverse futures**. If you are in one-way Mode, you can only open one position on Buy or Sell side. If you are in hedge mode, you can open both Buy and Sell side positions simultaneously.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/position/position-mode
	PositionSwitchMode(context.Context, PositionSwitchModeParams) error

	// Set Trading Stop
	//
	// Set the take profit, stop loss or trailing stop for the position.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/position/trading-stop
	PositionTradingStop(context.Context, PositionTradingStopParams) error

	// Set Auto Add Margin
	//
	// Turn on/off auto-add-margin for **isolated** margin position
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/position/auto-add-margin
	PositionSetAutoAddMargin(context.Context, PositionSetAutoAddMarginParams) error

	// Add Or Reduce Margin
	//
	// Manually add or reduce margin for **isolated** margin position
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/position/manual-add-margin
	PositionAddMargin(context.Context, PositionAddMarginParams) (PositionAddMarginResult, error)

	// Get Closed PnL
	//
	// Query user's closed profit and loss records
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/position/close-pnl
	GetPositionClosedPnl(context.Context, PositionClosedPnlQuery) (PositionClosedPnl, error)

	// Get Closed Options Positions
	//
	// Query user's closed options positions, sorted by `closeTime` in descending order.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/position/close-position
	GetPositionGetClosedPositions(context.Context, PositionGetClosedPositionsQuery) (PositionGetClosedPositions, error)

	// Move Position
	//
	// You can move positions between sub-master, master-sub, or sub-sub UIDs when necessary
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/position/move-position
	PositionMovePositions(context.Context, PositionMovePositionsParams) (PositionMovePositionsResult, error)

	// Get Move Position History
	//
	// You can query moved position data by master UID api key
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/position/move-position-history
	GetPositionMoveHistory(context.Context, PositionMoveHistoryQuery) (PositionMoveHistory, error)

	// Confirm New Risk Limit
	//
	// It is only applicable when the user is marked as only reducing positions (please see the isReduceOnly field in the [Get Position Info](/docs/v5/position) interface). After the user actively adjusts the risk level, this interface is called to try to calculate the adjusted risk level, and if it passes (retCode=0), the system will remove the position reduceOnly mark. You are recommended to call [Get Position Info](/docs/v5/position) to check `isReduceOnly` field.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/position/confirm-mmr
	PositionConfirmPendingMmr(context.Context, PositionConfirmPendingMmrParams) error

	// Get Pre-upgrade Order History
	//
	// By category="linear", you can query USDT Perps, USDC Perps data occurred during classic account
	// By category="spot", you can query Spot data occurred during classic account
	// By category="option", you can query Options data occurred during classic account
	// By category="inverse", you can query Inverse Contract data occurred during **classic account or [UTA1.0](/docs/v5/acct-mode#uta-10)**
	//
	// After the account is upgraded to a Unified account, you can get the orders which occurred before the upgrade.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/pre-upgrade/order-list
	GetPreUpgradeOrderHistory(context.Context, PreUpgradeOrderHistoryQuery) (PreUpgradeOrderHistory, error)

	// Get Pre-upgrade Trade History
	//
	// By category="linear", you can query USDT Perps, USDC Perps data occurred during classic account
	// By category="spot", you can query Spot data occurred during classic account
	// By category="option", you can query Options data occurred during classic account
	// By category="inverse", you can query Inverse Contract data occurred during **classic account or [UTA1.0](/docs/v5/acct-mode#uta-10)**
	//
	// Get users' execution records which occurred before you upgraded the account to a Unified account, sorted by `execTime` in descending order It supports to query USDT perpetual, USDC perpetual, Inverse perpetual, Inverse futures, Spot and Option.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/pre-upgrade/execution
	GetPreUpgradeExecutionList(context.Context, PreUpgradeExecutionListQuery) (PreUpgradeExecutionList, error)

	// Get Pre-upgrade Closed PnL
	//
	// Query user's closed profit and loss records from before you upgraded the account to a Unified account. The results are sorted by `updatedTime` in descending order. it only supports to query USDT perpetual, Inverse perpetual and Inverse Futures.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/pre-upgrade/close-pnl
	GetPreUpgradePositionClosedPnl(context.Context, PreUpgradePositionClosedPnlQuery) (PreUpgradePositionClosedPnl, error)

	// Get Pre-upgrade Transaction Log
	//
	// You can get USDC Perpetual, Option records.
	//
	// By category="linear", you can query USDC Perps transaction logs occurred during classic account By category="option", you can query Options transaction logs occurred during classic account
	//
	// Query transaction logs which occurred in the USDC Derivatives wallet before the account was upgraded to a Unified account.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/pre-upgrade/transaction-log
	GetPreUpgradeAccountTransactionLog(context.Context, PreUpgradeAccountTransactionLogQuery) (PreUpgradeAccountTransactionLog, error)

	// Get Pre-upgrade Delivery Record
	//
	// Query delivery records of Options before you upgraded the account to a Unified account, sorted by `deliveryTime` in descending order
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/pre-upgrade/delivery
	GetPreUpgradeAssetDeliveryRecord(context.Context, PreUpgradeAssetDeliveryRecordQuery) (PreUpgradeAssetDeliveryRecord, error)

	// Get Pre-upgrade USDC Session Settlement
	//
	// Query session settlement records of USDC perpetual before you upgrade the account to Unified account.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/pre-upgrade/settlement
	GetPreUpgradeAssetSettlementRecord(context.Context, PreUpgradeAssetSettlementRecordQuery) (PreUpgradeAssetSettlementRecord, error)

	// Get Wallet Balance
	//
	// Obtain wallet balance, query asset information of each currency. By default, currency information with assets or liabilities of 0 is not returned.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/account/wallet-balance
	GetAccountWalletBalance(context.Context, AccountWalletBalanceQuery) (AccountWalletBalance, error)

	// Get Transferable Amount (Unified)
	//
	// Query the available amount to transfer of a specific coin in the Unified wallet.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/account/unified-trans-amnt
	GetAccountWithdrawal(context.Context, AccountWithdrawalQuery) (AccountWithdrawal, error)

	// Get Transaction Log
	//
	// Query for transaction logs in your Unified account. It supports up to 2 years worth of data.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/account/transaction-log
	GetAccountTransactionLog(context.Context, AccountTransactionLogQuery) (AccountTransactionLog, error)

	// Get Account Info
	//
	// Query the account information, like margin mode, account mode, etc.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/account/account-info
	GetAccountInfo(context.Context) (AccountInfo, error)

	// Get Account Instruments Info
	//
	// Query for the instrument specification of online trading pairs that available to users.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/account/instrument
	GetAccountInstrumentsInfo(context.Context, AccountInstrumentsInfoQuery) error

	// Manual Borrow
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/account/borrow
	AccountBorrow(context.Context, AccountBorrowParams) (AccountBorrowResult, error)

	// Manual Repay Without Asset Conversion
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/account/no-convert-repay
	AccountNoConvertRepay(context.Context, AccountNoConvertRepayParams) (AccountNoConvertRepayResult, error)

	// Manual Repay
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/account/repay
	AccountRepay(context.Context, AccountRepayParams) (AccountRepayResult, error)

	// Get Fee Rate
	//
	// Get the trading fee rate.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/account/fee-rate
	GetAccountFeeRate(context.Context, AccountFeeRateQuery) (AccountFeeRate, error)

	// Get Collateral Info
	//
	// Get the collateral information of the current unified margin account, including loan interest rate, loanable amount, collateral conversion rate, whether it can be mortgaged as margin, etc.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/account/collateral-info
	GetAccountCollateralInfo(context.Context, AccountCollateralInfoQuery) (AccountCollateralInfo, error)

	// Get DCP Info
	//
	// Query the DCP configuration of the account. Before calling the interface, please make sure you have applied for the UTA account DCP configuration with your account manager
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/account/dcp-info
	GetAccountQueryDcpInfo(context.Context) (AccountQueryDcpInfo, error)

	// Set Collateral Coin
	//
	// You can decide whether the assets in the Unified account needs to be collateral coins.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/account/set-collateral
	AccountSetCollateralSwitch(context.Context, AccountSetCollateralSwitchParams) error

	// Set Margin Mode
	//
	// Default is regular margin mode
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/account/set-margin-mode
	AccountSetMarginMode(context.Context, AccountSetMarginModeParams) (AccountSetMarginModeResult, error)

	// Set Spot Hedging
	//
	// You can turn on/off Spot hedging feature in Portfolio margin
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/account/set-spot-hedge
	AccountSetHedgingMode(context.Context, AccountSetHedgingModeParams) (AccountSetHedgingModeResult, error)

	// Get Borrow History
	//
	// Get interest records, sorted in reverse order of creation time.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/account/borrow-history
	GetAccountBorrowHistory(context.Context, AccountBorrowHistoryQuery) (AccountBorrowHistory, error)

	// Batch Set Collateral Coin
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/account/batch-set-collateral
	AccountSetCollateralSwitchBatch(context.Context, AccountSetCollateralSwitchBatchParams) (AccountSetCollateralSwitchBatchResult, error)

	// Get Coin Greeks
	//
	// Get current account Greeks information
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/account/coin-greeks
	GetAssetCoinGreeks(context.Context, AssetCoinGreeksQuery) (AssetCoinGreeks, error)

	// Get MMP State
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/account/get-mmp-state
	GetAccountMmpState(context.Context, AccountMmpStateQuery) (AccountMmpState, error)

	// Reset MMP
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/account/reset-mmp
	AccountMmpReset(context.Context, AccountMmpResetParams) error

	// Set MMP
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/account/set-mmp
	AccountMmpModify(context.Context, AccountMmpModifyParams) error

	// Get SMP Group ID
	//
	// Query the SMP group ID of self match prevention
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/account/smp-group
	GetAccountSmpGroup(context.Context) (AccountSmpGroup, error)

	// Get Trade Behaviour Config
	//
	// Futures
	//
	// Spot
	//
	// Where x% is [priceLimitRatioX](/docs/v5/market/instrument); and y% is the [priceLimitRatioY](/docs/v5/market/instrument):
	//
	// You can get configuration how the system behaves when your limit order price exceeds the highest bid or lowest ask price.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/account/get-user-setting-config
	GetAccountUserSettingConfig(context.Context) (AccountUserSettingConfig, error)

	// Set Price Limit Behaviour
	//
	// Futures
	//
	// Spot
	//
	// Where x% is [priceLimitRatioX](/docs/v5/market/instrument); and y% is the [priceLimitRatioY](/docs/v5/market/instrument):
	//
	// You can configure how the system behaves when your limit order price exceeds the highest bid or lowest ask price. You can query your current configuration with [Get Trade Behaviour Setting](/docs/v5/account/get-user-setting-config). Learn more about the price limit for [spot](https://www.bybit.com/en/help-center/article/Bybit-Spot-Trading-Rules#A) and [futures](https://www.bybit.com/en/help-center/article?id=000002177#D) in the help centre.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/account/set-price-limit
	AccountSetLimitPxAction(context.Context, AccountSetLimitPxActionParams) error

	// Repay Liability
	//
	// You can manually repay the liabilities of Unified account
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/account/repay-liability
	AccountQuickRepayment(context.Context, AccountQuickRepaymentParams) (AccountQuickRepaymentResult, error)

	// Upgrade to Unified Account Pro
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/account/upgrade-unified-account
	AccountUpgradeToUta(context.Context) (AccountUpgradeToUtaResult, error)

	// Get Delivery Record
	//
	// Query delivery records of Invese Futures, USDC Futures, USDT Futures and Options, sorted by `deliveryTime` in descending order
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/delivery
	GetAssetDeliveryRecord(context.Context, AssetDeliveryRecordQuery) (AssetDeliveryRecord, error)

	// Get USDC Session Settlement
	//
	// Query session settlement records of USDC perpetual and futures
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/settlement
	GetAssetSettlementRecord(context.Context, AssetSettlementRecordQuery) (AssetSettlementRecord, error)

	// Get Coin Exchange Records
	//
	// Query the coin exchange records.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/exchange
	GetAssetExchangeOrderRecord(context.Context, AssetExchangeOrderRecordQuery) (AssetExchangeOrderRecord, error)

	// Get Coin Info
	//
	// Query coin information, including chain information, withdraw and deposit status.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/coin-info
	GetAssetCoinQueryInfo(context.Context, AssetCoinQueryInfoQuery) (AssetCoinQueryInfo, error)

	// Get Sub UID
	//
	// Query the sub UIDs under a main UID. It returns up to 2000 sub accounts, if you need more, please call this [endpoint](/docs/v5/user/page-subuid).
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/sub-uid-list
	GetAssetTransferQuerySubMemberList(context.Context) (AssetTransferQuerySubMemberList, error)

	// Get Single Coin Balance
	//
	// Query the balance of a specific coin in a specific [account type](/docs/v5/enum#accounttype). Supports querying sub UID's balance. Also, you can check the transferable amount from master to sub account, sub to master account or sub to sub account, especially for user who has an institutional loan.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/balance/account-coin-balance
	GetAssetTransferQueryAccountCoinBalance(context.Context, AssetTransferQueryAccountCoinBalanceQuery) (AssetTransferQueryAccountCoinBalance, error)

	// Get All Coins Balance
	//
	// You could get all coin balance of all account types under the master account, and sub account.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/balance/all-balance
	GetAssetTransferQueryAccountCoinsBalance(context.Context, AssetTransferQueryAccountCoinsBalanceQuery) (AssetTransferQueryAccountCoinsBalance, error)

	// Get Withdrawable Amount
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/balance/delay-amount
	GetAssetWithdrawWithdrawableAmount(context.Context, AssetWithdrawWithdrawableAmountQuery) (AssetWithdrawWithdrawableAmount, error)

	// Create Internal Transfer
	//
	// Create the internal transfer between different [account types](/docs/v5/enum#accounttype) under the same UID.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/transfer/create-inter-transfer
	AssetTransferInterTransfer(context.Context, AssetTransferInterTransferParams) (AssetTransferInterTransferResult, error)

	// Get Internal Transfer Records
	//
	// Query the internal transfer records between different [account types](/docs/v5/enum#accounttype) under the same UID.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/transfer/inter-transfer-list
	GetAssetTransferQueryInterTransferList(context.Context, AssetTransferQueryInterTransferListQuery) (AssetTransferQueryInterTransferList, error)

	// Create Universal Transfer
	//
	// Transfer between sub-sub or main-sub.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/transfer/unitransfer
	AssetTransferUniversalTransfer(context.Context, AssetTransferUniversalTransferParams) (AssetTransferUniversalTransferResult, error)

	// Get Universal Transfer Records
	//
	// Query universal transfer records
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/transfer/unitransfer-list
	GetAssetTransferQueryUniversalTransferList(context.Context, AssetTransferQueryUniversalTransferListQuery) (AssetTransferQueryUniversalTransferList, error)

	// Get Transferable Coin
	//
	// Query the transferable coin list between each [account type](/docs/v5/enum#accounttype)
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/transfer/transferable-coin
	GetAssetTransferQueryTransferCoinList(context.Context, AssetTransferQueryTransferCoinListQuery) (AssetTransferQueryTransferCoinList, error)

	// Set Deposit Account
	//
	// Set auto transfer account after deposit. The same function as the setting for Deposit on [web GUI](https://www.bybit.com/app/user/settings)
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/deposit/set-deposit-acct
	AssetDepositDepositToAccount(context.Context, AssetDepositDepositToAccountParams) (AssetDepositDepositToAccountResult, error)

	// Get Deposit Records (on-chain)
	//
	// Query deposit records
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/deposit/deposit-record
	GetAssetDepositQueryRecord(context.Context, AssetDepositQueryRecordQuery) (AssetDepositQueryRecord, error)

	// Get Sub Deposit Records (on-chain)
	//
	// Query subaccount's deposit records by **main** UID's API key.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/deposit/sub-deposit-record
	GetAssetDepositQuerySubMemberRecord(context.Context, AssetDepositQuerySubMemberRecordQuery) (AssetDepositQuerySubMemberRecord, error)

	// Get Internal Deposit Records (off-chain)
	//
	// Query deposit records within the Bybit platform. These transactions are not on the blockchain.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/deposit/internal-deposit-record
	GetAssetDepositQueryInternalRecord(context.Context, AssetDepositQueryInternalRecordQuery) (AssetDepositQueryInternalRecord, error)

	// Get Master Deposit Address
	//
	// Query the deposit address information of MASTER account.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/deposit/master-deposit-addr
	GetAssetDepositQueryAddress(context.Context, AssetDepositQueryAddressQuery) (AssetDepositQueryAddress, error)

	// Get Sub Deposit Address
	//
	// Query the deposit address information of SUB account.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/deposit/sub-deposit-addr
	GetAssetDepositQuerySubMemberAddress(context.Context, AssetDepositQuerySubMemberAddressQuery) (AssetDepositQuerySubMemberAddress, error)

	// Get Withdrawal Address List
	//
	// Query the withdrawal addresses in the address book.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/withdraw/withdraw-address
	GetAssetWithdrawQueryAddress(context.Context, AssetWithdrawQueryAddressQuery) (AssetWithdrawQueryAddress, error)

	// Get Withdrawal Records
	//
	// Query withdrawal records.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/withdraw/withdraw-record
	GetAssetWithdrawQueryRecord(context.Context, AssetWithdrawQueryRecordQuery) (AssetWithdrawQueryRecord, error)

	// Get available VASPs
	//
	// This endpoint is used for query the available VASPs. This API distinguishes which compliance zone the user belongs to and the corresponding list of exchanges based on the user's UID.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/withdraw/vasp-list
	GetAssetWithdrawVaspList(context.Context) (AssetWithdrawVaspList, error)

	// Withdraw
	//
	// Note that, although the API rate limit for this endpoint is 5 req/s, there is also a secondary limit: you can only withdraw once every 10 seconds per chain/coin combination.
	//
	// Withdraw assets from your Bybit account. You can make an off-chain transfer if the target wallet address is from Bybit. This means that no blockchain fee will be charged.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/withdraw
	AssetWithdrawCreate(context.Context, AssetWithdrawCreateParams) (AssetWithdrawCreateResult, error)

	// Cancel Withdrawal
	//
	// Cancel the withdrawal
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/withdraw/cancel-withdraw
	AssetWithdrawCancel(context.Context, AssetWithdrawCancelParams) (AssetWithdrawCancelResult, error)

	// Get Convert Coin List
	//
	// Query for the list of coins you can convert to/from.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/convert/convert-coin-list
	GetAssetExchangeQueryCoinList(context.Context, AssetExchangeQueryCoinListQuery) (AssetExchangeQueryCoinList, error)

	// Request a Quote
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/convert/apply-quote
	AssetExchangeQuoteApply(context.Context, AssetExchangeQuoteApplyParams) (AssetExchangeQuoteApplyResult, error)

	// Confirm a Quote
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/convert/confirm-quote
	AssetExchangeConvertExecute(context.Context, AssetExchangeConvertExecuteParams) (AssetExchangeConvertExecuteResult, error)

	// Get Convert Status
	//
	// You can query the exchange result by sending quoteTxId.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/convert/get-convert-result
	GetAssetExchangeConvertResultQuery(context.Context, AssetExchangeConvertResultQueryQuery) (AssetExchangeConvertResultQuery, error)

	// Get Convert History
	//
	// Returns all confirmed quotes.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/convert/get-convert-history
	GetAssetExchangeQueryConvertHistory(context.Context, AssetExchangeQueryConvertHistoryQuery) (AssetExchangeQueryConvertHistory, error)

	// Get Small Balance Coins
	//
	// Query small-balance coins with a USDT equivalent of less than 10 USDT, and ensure that the total amount for each conversion transaction is between 1.0e-8 and 200 USDT.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/convert-small-balance/small-balanc-coins
	GetAssetCovertSmallBalanceList(context.Context, AssetCovertSmallBalanceListQuery) (AssetCovertSmallBalanceList, error)

	// Request a Quote
	//
	// Custody accounts, like copper, fireblock, etc are **not supported** to make a convertion
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/convert-small-balance/request-quote
	AssetCovertGetQuote(context.Context, AssetCovertGetQuoteParams) (AssetCovertGetQuoteResult, error)

	// Confirm a Quote
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/convert-small-balance/confirm-quote
	AssetCovertSmallBalanceExecute(context.Context, AssetCovertSmallBalanceExecuteParams) (AssetCovertSmallBalanceExecuteResult, error)

	// Get Exchange History
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/convert-small-balance/exchange-history
	GetAssetCovertSmallBalanceHistory(context.Context, AssetCovertSmallBalanceHistoryQuery) (AssetCovertSmallBalanceHistory, error)

	// Get Trading Pair List
	//
	// Query for the list of coins you can convert to/from.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/fiat-convert/query-coin-list
	GetFiatQueryCoinList(context.Context, FiatQueryCoinListQuery) (FiatQueryCoinList, error)

	// Get Reference Price
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/fiat-convert/reference-price
	GetFiatReferencePrice(context.Context, FiatReferencePriceQuery) (FiatReferencePrice, error)

	// Request a Quote
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/fiat-convert/quote-apply
	FiatQuoteApply(context.Context, FiatQuoteApplyParams) (FiatQuoteApplyResult, error)

	// Confirm a Quote
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/fiat-convert/confirm-quote
	FiatTradeExecute(context.Context, FiatTradeExecuteParams) (FiatTradeExecuteResult, error)

	// Get Convert Status
	//
	// Returns the details of this convert.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/fiat-convert/query-trade
	GetFiatTradeQuery(context.Context, FiatTradeQueryQuery) (FiatTradeQuery, error)

	// Get Convert History
	//
	// Returns all the convert history
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/fiat-convert/query-trade-history
	GetFiatQueryTradeHistory(context.Context, FiatQueryTradeHistoryQuery) (FiatQueryTradeHistory, error)

	// Get Balance
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/asset/fiat-convert/balance-query
	GetFiatBalanceQuery(context.Context, FiatBalanceQueryQuery) (FiatBalanceQuery, error)

	// Create Sub UID
	//
	// Create a new sub user id. Use **master** account's api key.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/user/create-subuid
	UserCreateSubMember(context.Context, UserCreateSubMemberParams) (UserCreateSubMemberResult, error)

	// Create Sub UID API Key
	//
	// To create new API key for those newly created sub UID. Use **master user's api key** **only**.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/user/create-subuid-apikey
	UserCreateSubApi(context.Context, UserCreateSubApiParams) (UserCreateSubApiResult, error)

	// Get Sub UID List (Limited)
	//
	// Get at most 10k sub UID of master account. Use **master user's api key** **only**.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/user/subuid-list
	GetUserQuerySubMembers(context.Context) (UserQuerySubMembers, error)

	// Get Sub UID List (Unlimited)
	//
	// This API is applicable to the client who has over 10k sub accounts. Use **master user's api key** **only**.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/user/page-subuid
	GetUserSubmembers(context.Context, UserSubmembersQuery) (UserSubmembers, error)

	// Get Fund Custodial Sub Acct
	//
	// The institutional client can query the fund custodial sub accounts.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/user/fund-subuid-list
	GetUserEscrowSubMembers(context.Context, UserEscrowSubMembersQuery) (UserEscrowSubMembers, error)

	// Freeze Sub UID
	//
	// Freeze Sub UID. Use **master user's api key** **only**.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/user/froze-subuid
	UserFrozenSubMember(context.Context, UserFrozenSubMemberParams) error

	// Get API Key Information
	//
	// Get the information of the api key. Use the api key pending to be checked to call the endpoint. Both **master and sub user's api key** are applicable.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/user/apikey-info
	GetUserQueryApi(context.Context) (UserQueryApi, error)

	// Get Sub Account All API Keys
	//
	// Query all api keys information of a sub UID.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/user/list-sub-apikeys
	GetUserSubApikeys(context.Context, UserSubApikeysQuery) (UserSubApikeys, error)

	// Get UID Wallet Type
	//
	// Get available wallet types for the master account or sub account
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/user/wallet-type
	GetUserGetMemberType(context.Context, UserGetMemberTypeQuery) (UserGetMemberType, error)

	// Modify Master API Key
	//
	// Modify the settings of master api key. Use the api key pending to be modified to call the endpoint. Use **master user's api key** **only**.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/user/modify-master-apikey
	UserUpdateApi(context.Context, UserUpdateApiParams) (UserUpdateApiResult, error)

	// Modify Sub API Key
	//
	// Modify the settings of sub api key. Use the sub account api key pending to be modified to call the endpoint or use master account api key to manage its sub account api key.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/user/modify-sub-apikey
	UserUpdateSubApi(context.Context, UserUpdateSubApiParams) (UserUpdateSubApiResult, error)

	// Delete Sub UID
	//
	// Delete a sub UID. Before deleting the UID, please make sure there is no asset.
	// Use **master** user's api key\*\*.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/user/rm-subuid
	UserDelSubmember(context.Context, UserDelSubmemberParams) error

	// Delete Master API Key
	//
	// Delete the api key of master account. Use the api key pending to be delete to call the endpoint. Use **master user's api key** **only**.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/user/rm-master-apikey
	UserDeleteApi(context.Context) error

	// Delete Sub API Key
	//
	// Delete the api key of sub account. Use the sub api key pending to be delete to call the endpoint or use the master api key to delete corresponding sub account api key
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/user/rm-sub-apikey
	UserDeleteSubApi(context.Context, UserDeleteSubApiParams) error

	// Get Instruments Info
	//
	// Query for the instrument specification of spread combinations.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/spread/market/instrument
	GetSpreadInstrument(context.Context, SpreadInstrumentQuery) (SpreadInstrument, error)

	// Get Orderbook
	//
	// Query spread orderbook depth data.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/spread/market/orderbook
	GetSpreadOrderbook(context.Context, SpreadOrderbookQuery) (SpreadOrderbook, error)

	// Get Tickers
	//
	// Query for the latest price snapshot, best bid/ask price, and trading volume of different spread combinations in the last 24 hours.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/spread/market/tickers
	GetSpreadTickers(context.Context, SpreadTickersQuery) (SpreadTickers, error)

	// Get Recent Public Trades
	//
	// Query recent public spread trading history in Bybit.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/spread/market/recent-trade
	GetSpreadRecentTrade(context.Context, SpreadRecentTradeQuery) (SpreadRecentTrade, error)

	// Create Order
	//
	// Place a spread combination order. **Up to 50 open orders** per account.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/spread/trade/create-order
	SpreadOrderCreate(context.Context, SpreadOrderCreateParams) (SpreadOrderCreateResult, error)

	// Amend Order
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/spread/trade/amend-order
	SpreadOrderAmend(context.Context, SpreadOrderAmendParams) (SpreadOrderAmendResult, error)

	// Cancel Order
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/spread/trade/cancel-order
	SpreadOrderCancel(context.Context, SpreadOrderCancelParams) (SpreadOrderCancelResult, error)

	// Cancel All Orders
	//
	// Cancel all open orders
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/spread/trade/cancel-all
	SpreadOrderCancelAll(context.Context, SpreadOrderCancelAllParams) (SpreadOrderCancelAllResult, error)

	// Get Open Orders
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/spread/trade/open-order
	GetSpreadOrderRealtime(context.Context, SpreadOrderRealtimeQuery) (SpreadOrderRealtime, error)

	// Get Order History
	//
	// **Single leg orders can also be found with "createType"=`CreateByFutureSpread` via [Get Order History](/docs/v5/order/order-list)**
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/spread/trade/order-history
	GetSpreadOrderHistory(context.Context, SpreadOrderHistoryQuery) (SpreadOrderHistory, error)

	// Get Trade History
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/spread/trade/trade-history
	GetSpreadExecutionList(context.Context, SpreadExecutionListQuery) (SpreadExecutionList, error)

	// Create RFQ
	//
	// Create RFQ. **Up to 50 requests** per second.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/rfq/trade/create-rfq
	RfqCreateRfq(context.Context, RfqCreateRfqParams) (RfqCreateRfqResult, error)

	// Get RFQ Configuration
	//
	// RFQ Config. **Up to 50 requests** per second.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/rfq/trade/rfq-config
	GetRfqConfig(context.Context) (RfqConfig, error)

	// Cancel RFQ
	//
	// Cancel RFQ. **Up to 50 requests per second**
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/rfq/trade/cancel-rfq
	RfqCancelRfq(context.Context, RfqCancelRfqParams) (RfqCancelRfqResult, error)

	// Cancel All RFQs
	//
	// Cancel all active RFQs. **Up to 50 requests per second**
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/rfq/trade/cancel-all-rfq
	RfqCancelAllRfq(context.Context) (RfqCancelAllRfqResult, error)

	// Accept non-LP Quote
	//
	// Accept non-LP Quote. **Up to 50 requests** per second.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/rfq/trade/accept-other-quote
	RfqAcceptOtherQuote(context.Context, RfqAcceptOtherQuoteParams) (RfqAcceptOtherQuoteResult, error)

	// Create Quote
	//
	// Create a quote. **Up to 50 requests** per second. The quoting party sends a quote in response to the inquirier.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/rfq/trade/create-quote
	RfqCreateQuote(context.Context, RfqCreateQuoteParams) (RfqCreateQuoteResult, error)

	// Execute Quote
	//
	// Execute quote – only for the creator of the RFQ. **Up to 50 requests** per second.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/rfq/trade/execute-quote
	RfqExecuteQuote(context.Context, RfqExecuteQuoteParams) (RfqExecuteQuoteResult, error)

	// Cancel Quote
	//
	// Cancel a quote. **Up to 50 requests per second**
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/rfq/trade/cancel-quote
	RfqCancelQuote(context.Context, RfqCancelQuoteParams) (RfqCancelQuoteResult, error)

	// Cancel All Quotes
	//
	// Cancel all active quotes. **Up to 50 requests per second**
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/rfq/trade/cancel-all-quotes
	RfqCancelAllQuotes(context.Context) (RfqCancelAllQuotesResult, error)

	// Get RFQs (real-time)
	//
	// Obtain real-time inquiry information. **Up to 50 requests per second**
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/rfq/trade/rfq-realtime
	GetRfqRfqRealtime(context.Context, RfqRfqRealtimeQuery) (RfqRfqRealtime, error)

	// Get RFQs
	//
	// Obtain historical inquiry information. **Up to 50 requests per second**
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/rfq/trade/rfq-list
	GetRfqRfqList(context.Context, RfqRfqListQuery) (RfqRfqList, error)

	// Get Quotes (real-time)
	//
	// Get real-time quote information. **Up to 50 requests per second**
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/rfq/trade/quote-realtime
	GetRfqQuoteRealtime(context.Context, RfqQuoteRealtimeQuery) (RfqQuoteRealtime, error)

	// Get Quotes
	//
	// Obtain historical quote information. **Up to 50 requests per second**
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/rfq/trade/quote-list
	GetRfqQuoteList(context.Context, RfqQuoteListQuery) (RfqQuoteList, error)

	// Get Trade History
	//
	// Obtain transaction information. **Up to 50 requests per second**
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/rfq/trade/trade-list
	GetRfqTradeList(context.Context, RfqTradeListQuery) (RfqTradeList, error)

	// Get Public Trades
	//
	// Get the recently executed rfq successfully. **Up to 50 requests per second**
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/rfq/trade/public-trades
	GetRfqPublicTrades(context.Context, RfqPublicTradesQuery) (RfqPublicTrades, error)

	// Get Tiered Collateral Ratio
	//
	// UTA loan tiered collateral ratio
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/spot-margin-uta/tier-collateral-ratio
	GetSpotMarginTradeCollateral(context.Context, SpotMarginTradeCollateralQuery) (SpotMarginTradeCollateral, error)

	// Get Historical Interest Rate
	//
	// You can query up to six months borrowing interest rate of Margin trading.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/spot-margin-uta/historical-interest
	GetSpotMarginTradeInterestRateHistory(context.Context, SpotMarginTradeInterestRateHistoryQuery) (SpotMarginTradeInterestRateHistory, error)

	// Toggle Margin Trade
	//
	// Turn on / off spot margin trade
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/spot-margin-uta/switch-mode
	SpotMarginTradeSwitchMode(context.Context, SpotMarginTradeSwitchModeParams) (SpotMarginTradeSwitchModeResult, error)

	// Set Leverage
	//
	// Set the user's maximum leverage in spot cross margin
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/spot-margin-uta/set-leverage
	SpotMarginTradeSetLeverage(context.Context, SpotMarginTradeSetLeverageParams) error

	// Get Status And Leverage
	//
	// Query the Spot margin status and leverage
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/spot-margin-uta/status
	GetSpotMarginTradeState(context.Context) (SpotMarginTradeState, error)

	// Get Max Borrowable Amount
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/spot-margin-uta/max-borrowable
	GetSpotMarginTradeMaxBorrowable(context.Context, SpotMarginTradeMaxBorrowableQuery) (SpotMarginTradeMaxBorrowable, error)

	// Get Position Tiers
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/spot-margin-uta/position-tiers
	GetSpotMarginTradePositionTiers(context.Context, SpotMarginTradePositionTiersQuery) (SpotMarginTradePositionTiers, error)

	// Get Coin State
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/spot-margin-uta/coinstate
	GetSpotMarginTradeCoinstate(context.Context, SpotMarginTradeCoinstateQuery) (SpotMarginTradeCoinstate, error)

	// Get Available Amount to Repay
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/spot-margin-uta/repayment-available-amount
	GetSpotMarginTradeRepaymentAvailableAmount(context.Context, SpotMarginTradeRepaymentAvailableAmountQuery) (SpotMarginTradeRepaymentAvailableAmount, error)

	// Set Auto Repay Mode
	//
	// Set spot automatic repayment mode
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/spot-margin-uta/set-auto-repay-mode
	SpotMarginTradeSetAutoRepayMode(context.Context, SpotMarginTradeSetAutoRepayModeParams) (SpotMarginTradeSetAutoRepayModeResult, error)

	// Get Auto Repay Mode
	//
	// Get spot automatic repayment mode
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/spot-margin-uta/get-auto-repay-mode
	GetSpotMarginTradeGetAutoRepayMode(context.Context, SpotMarginTradeGetAutoRepayModeQuery) (SpotMarginTradeGetAutoRepayMode, error)

	// Get Borrowable Coins
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/loan-coin
	GetCryptoLoanCommonLoanableData(context.Context, CryptoLoanCommonLoanableDataQuery) (CryptoLoanCommonLoanableData, error)

	// Get Collateral Coins
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/collateral-coin
	GetCryptoLoanCommonCollateralData(context.Context, CryptoLoanCommonCollateralDataQuery) (CryptoLoanCommonCollateralData, error)

	// Get Max. Allowed Collateral Reduction Amount
	//
	// Retrieve the maximum redeemable amount of your collateral asset based on LTV.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/reduce-max-collateral-amt
	GetCryptoLoanCommonMaxCollateralAmount(context.Context, CryptoLoanCommonMaxCollateralAmountQuery) (CryptoLoanCommonMaxCollateralAmount, error)

	// Adjust Collateral Amount
	//
	// You can increase or reduce your collateral amount. When you reduce, please obey the [Get Max. Allowed Collateral Reduction Amount](/docs/v5/new-crypto-loan/reduce-max-collateral-amt)
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/adjust-collateral
	CryptoLoanCommonAdjustLtv(context.Context, CryptoLoanCommonAdjustLtvParams) (CryptoLoanCommonAdjustLtvResult, error)

	// Get Collateral Adjustment History
	//
	// Query for your LTV adjustment history.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/ltv-adjust-history
	GetCryptoLoanCommonAdjustmentHistory(context.Context, CryptoLoanCommonAdjustmentHistoryQuery) (CryptoLoanCommonAdjustmentHistory, error)

	// Get Crypto Loan Position
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/crypto-loan-position
	GetCryptoLoanCommonPosition(context.Context) (CryptoLoanCommonPosition, error)

	// Obtain Max Loan Amount
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/max-loan-amt
	CryptoLoanCommonMaxLoan(context.Context, CryptoLoanCommonMaxLoanParams) (CryptoLoanCommonMaxLoanResult, error)

	// Borrow
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/flexible/borrow
	CryptoLoanFlexibleBorrow(context.Context, CryptoLoanFlexibleBorrowParams) (CryptoLoanFlexibleBorrowResult, error)

	// Repay
	//
	// Fully or partially repay a loan. If interest is due, that is paid off first, with the loaned amount being paid off only after due interest.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/flexible/repay
	CryptoLoanFlexibleRepay(context.Context, CryptoLoanFlexibleRepayParams) (CryptoLoanFlexibleRepayResult, error)

	// Collateral Repayment
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/flexible/repay-collateral
	CryptoLoanFlexibleRepayCollateral(context.Context, CryptoLoanFlexibleRepayCollateralParams) error

	// Get Flexible Loans
	//
	// Query for your ongoing loans
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/flexible/unpaid-loan-order
	GetCryptoLoanFlexibleOngoingCoin(context.Context, CryptoLoanFlexibleOngoingCoinQuery) (CryptoLoanFlexibleOngoingCoin, error)

	// Get Borrowing History
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/flexible/loan-orders
	GetCryptoLoanFlexibleBorrowHistory(context.Context, CryptoLoanFlexibleBorrowHistoryQuery) (CryptoLoanFlexibleBorrowHistory, error)

	// Get Repayment History
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/flexible/repay-orders
	GetCryptoLoanFlexibleRepaymentHistory(context.Context, CryptoLoanFlexibleRepaymentHistoryQuery) (CryptoLoanFlexibleRepaymentHistory, error)

	// Get Lending Market
	//
	// If you want to supply, you can use this endpoint to check whether there are any suitable counterparty borrow orders available.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/fixed/supply-market
	GetCryptoLoanFixedSupplyOrderQuote(context.Context, CryptoLoanFixedSupplyOrderQuoteQuery) (CryptoLoanFixedSupplyOrderQuote, error)

	// Get Borrowing Market
	//
	// If you want to borrow, you can use this endpoint to check whether there are any suitable counterparty supply orders available.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/fixed/borrow-market
	GetCryptoLoanFixedBorrowOrderQuote(context.Context, CryptoLoanFixedBorrowOrderQuoteQuery) (CryptoLoanFixedBorrowOrderQuote, error)

	// Create Borrow Order
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/fixed/borrow
	CryptoLoanFixedBorrow(context.Context, CryptoLoanFixedBorrowParams) (CryptoLoanFixedBorrowResult, error)

	// Renew Borrow Order
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/fixed/renew
	CryptoLoanFixedRenew(context.Context, CryptoLoanFixedRenewParams) (CryptoLoanFixedRenewResult, error)

	// Create Supply Order
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/fixed/supply
	CryptoLoanFixedSupply(context.Context, CryptoLoanFixedSupplyParams) (CryptoLoanFixedSupplyResult, error)

	// Cancel Borrow Order
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/fixed/cancel-borrow
	CryptoLoanFixedBorrowOrderCancel(context.Context, CryptoLoanFixedBorrowOrderCancelParams) error

	// Cancel Supply Order
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/fixed/cancel-supply
	CryptoLoanFixedSupplyOrderCancel(context.Context, CryptoLoanFixedSupplyOrderCancelParams) error

	// Get Borrow Contract Info
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/fixed/borrow-contract
	GetCryptoLoanFixedBorrowContractInfo(context.Context, CryptoLoanFixedBorrowContractInfoQuery) (CryptoLoanFixedBorrowContractInfo, error)

	// Get Supply Contract Info
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/fixed/supply-contract copy
	GetCryptoLoanFixedSupplyContractInfo(context.Context, CryptoLoanFixedSupplyContractInfoQuery) (CryptoLoanFixedSupplyContractInfo, error)

	// Get Borrow Order Info
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/fixed/borrow-order
	GetCryptoLoanFixedBorrowOrderInfo(context.Context, CryptoLoanFixedBorrowOrderInfoQuery) (CryptoLoanFixedBorrowOrderInfo, error)

	// Get Renew Order Info
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/fixed/renew-order
	GetCryptoLoanFixedRenewInfo(context.Context, CryptoLoanFixedRenewInfoQuery) (CryptoLoanFixedRenewInfo, error)

	// Get Supply Order Info
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/fixed/supply-order
	GetCryptoLoanFixedSupplyOrderInfo(context.Context, CryptoLoanFixedSupplyOrderInfoQuery) (CryptoLoanFixedSupplyOrderInfo, error)

	// Repay
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/fixed/repay
	CryptoLoanFixedFullyRepay(context.Context, CryptoLoanFixedFullyRepayParams) (CryptoLoanFixedFullyRepayResult, error)

	// Collateral Repayment
	//
	// There are limits on the repayment amount in a single transaction. Please read this [announcement](https://announcements.bybit.com/article/crypto-loan-manual-repayment-update-bltde33509ddde5e8fd/) before repaying with collateral.
	// When repaying with collateral, Bybit will charge a repayment fee. The applicable fee rate is the higher of the repayment fee rates for the collateral asset and the debt asset. You can call this endpoint: [View fee rates by asset](https://www.bybit.com/x-api/spot/api/fixed-loan/v1/coin-config) to get "reapyFee" where "pledgeEnable" = 1 for coins' repayment fee rates.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/fixed/repay-collateral
	CryptoLoanFixedRepayCollateral(context.Context, CryptoLoanFixedRepayCollateralParams) error

	// Get Repayment History
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/new-crypto-loan/fixed/repay-history
	GetCryptoLoanFixedRepaymentHistory(context.Context, CryptoLoanFixedRepaymentHistoryQuery) (CryptoLoanFixedRepaymentHistory, error)

	// Get Collateral Coins
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/crypto-loan/collateral-coin
	GetCryptoLoanCollateralData(context.Context, CryptoLoanCollateralDataQuery) (CryptoLoanCollateralData, error)

	// Get Borrowable Coins
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/crypto-loan/loan-coin
	GetCryptoLoanLoanableData(context.Context, CryptoLoanLoanableDataQuery) (CryptoLoanLoanableData, error)

	// Get Account Borrowable/Collateralizable Limit
	//
	// Query for the minimum and maximum amounts your account can borrow and how much collateral you can put up.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/crypto-loan/acct-borrow-collateral
	GetCryptoLoanBorrowableCollateralisableNumber(context.Context, CryptoLoanBorrowableCollateralisableNumberQuery) (CryptoLoanBorrowableCollateralisableNumber, error)

	// Repay
	//
	// Fully or partially repay a loan. If interest is due, that is paid off first, with the loaned amount being paid off only after due interest.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/crypto-loan/repay
	CryptoLoanRepay(context.Context, CryptoLoanRepayParams) (CryptoLoanRepayResult, error)

	// Get Unpaid Loans
	//
	// Query for your ongoing loans.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/crypto-loan/unpaid-loan-order
	GetCryptoLoanOngoingOrders(context.Context, CryptoLoanOngoingOrdersQuery) (CryptoLoanOngoingOrders, error)

	// Get Loan Repayment History
	//
	// Query for loan repayment transactions. A loan may be repaid in multiple repayments.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/crypto-loan/repay-transaction
	GetCryptoLoanRepaymentHistory(context.Context, CryptoLoanRepaymentHistoryQuery) (CryptoLoanRepaymentHistory, error)

	// Get Completed Loan History
	//
	// Query for the last 6 months worth of your completed (fully paid off) loans.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/crypto-loan/completed-loan-order
	GetCryptoLoanBorrowHistory(context.Context, CryptoLoanBorrowHistoryQuery) (CryptoLoanBorrowHistory, error)

	// Get Max. Allowed Collateral Reduction Amount
	//
	// Query for the maximum amount by which collateral may be reduced by.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/crypto-loan/reduce-max-collateral-amt
	GetCryptoLoanMaxCollateralAmount(context.Context, CryptoLoanMaxCollateralAmountQuery) (CryptoLoanMaxCollateralAmount, error)

	// Adjust Collateral Amount
	//
	// You can increase or reduce your collateral amount. When you reduce, please obey the [max. allowed reduction amount](https://bybit-exchange.github.io/docs/v5/crypto-loan/reduce-max-collateral-amt).
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/crypto-loan/adjust-collateral
	CryptoLoanAdjustLtv(context.Context, CryptoLoanAdjustLtvParams) (CryptoLoanAdjustLtvResult, error)

	// Get Loan LTV Adjustment History
	//
	// Query for your LTV adjustment history.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/crypto-loan/ltv-adjust-history
	GetCryptoLoanAdjustmentHistory(context.Context, CryptoLoanAdjustmentHistoryQuery) (CryptoLoanAdjustmentHistory, error)

	// Get Product Info
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/otc/margin-product-info
	GetInsLoanProductInfos(context.Context, InsLoanProductInfosQuery) (InsLoanProductInfos, error)

	// Get Margin Coin Info
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/otc/margin-coin-convert-info
	GetInsLoanEnsureTokensConvert(context.Context, InsLoanEnsureTokensConvertQuery) (InsLoanEnsureTokensConvert, error)

	// Get Loan Orders
	//
	// Get up to 2 years worth of historical loan orders.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/otc/loan-info
	GetInsLoanLoanOrder(context.Context, InsLoanLoanOrderQuery) (InsLoanLoanOrder, error)

	// Get Repayment Orders
	//
	// Get a list of your loan repayment orders (orders which repaid the loan).
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/otc/repay-info
	GetInsLoanRepaidHistory(context.Context, InsLoanRepaidHistoryQuery) (InsLoanRepaidHistory, error)

	// Get LTV
	//
	// Get your loan-to-value (LTV) ratio.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/otc/ltv-convert
	GetInsLoanLtvConvert(context.Context) (InsLoanLtvConvert, error)

	// Bind Or Unbind UID
	//
	// For the institutional loan product, you can bind new UIDs to the risk unit or unbind UID from the risk unit.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/otc/bind-uid
	InsLoanAssociationUid(context.Context, InsLoanAssociationUidParams) (InsLoanAssociationUidResult, error)

	// Repay
	//
	// You can repay the INS loan by calling this API.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/otc/repay
	InsLoanRepayLoan(context.Context, InsLoanRepayLoanParams) (InsLoanRepayLoanResult, error)

	// Get Earning
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/broker/exchange-broker/exchange-earning
	GetBrokerEarningsInfo(context.Context, BrokerEarningsInfoQuery) (BrokerEarningsInfo, error)

	// Get Account Info
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/broker/exchange-broker/account-info
	GetBrokerAccountInfo(context.Context) (BrokerAccountInfo, error)

	// Get Sub Account Deposit Records
	//
	// Exchange broker can query subaccount's deposit records by **main** UID's API key without specifying uid.
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/broker/exchange-broker/sub-deposit-record
	GetBrokerAssetQuerySubMemberDepositRecord(context.Context, BrokerAssetQuerySubMemberDepositRecordQuery) (BrokerAssetQuerySubMemberDepositRecord, error)

	// Set Rate Limit
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/broker/exchange-broker/rate-limit/set
	BrokerApilimitSet(context.Context, BrokerApilimitSetParams) (BrokerApilimitSetResult, error)

	// Get Rate Limit Cap
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/broker/exchange-broker/rate-limit/query-cap
	GetBrokerApilimitQueryCap(context.Context) (BrokerApilimitQueryCap, error)

	// Get All Rate Limits
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/broker/exchange-broker/rate-limit/query-all
	GetBrokerApilimitQueryAll(context.Context, BrokerApilimitQueryAllQuery) (BrokerApilimitQueryAll, error)

	// Get Voucher Spec
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/broker/reward/voucher
	BrokerAwardInfo(context.Context, BrokerAwardInfoParams) (BrokerAwardInfoResult, error)

	// Issue Voucher
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/broker/reward/issue-voucher
	BrokerAwardDistributeAward(context.Context, BrokerAwardDistributeAwardParams) error

	// Get Issued Voucher
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/broker/reward/get-issue-voucher
	BrokerAwardDistributionRecord(context.Context, BrokerAwardDistributionRecordParams) (BrokerAwardDistributionRecordResult, error)

	// Get Product Info
	//
	// [Bybit Saving FAQ](https://www.bybit.com/en/help-center/article/FAQ-Bybit-Savings)
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/earn/product-info
	GetEarnProduct(context.Context, EarnProductQuery) (EarnProduct, error)

	// Stake / Redeem
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/earn/create-order
	EarnPlaceOrder(context.Context, EarnPlaceOrderParams) (EarnPlaceOrderResult, error)

	// Get Stake/Redeem Order History
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/earn/order-history
	GetEarnOrder(context.Context, EarnOrderQuery) (EarnOrder, error)

	// Get Staked Position
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/earn/position
	GetEarnPosition(context.Context, EarnPositionQuery) (EarnPosition, error)

	// Get Yield History
	//
	// You can get the past 3 months data
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/earn/yield-history
	GetEarnYield(context.Context, EarnYieldQuery) (EarnYield, error)

	// Get Hourly Yield History
	//
	// Doc: https://bybit-exchange.github.io/docs/v5/earn/hourly-yield
	GetEarnHourlyYield(context.Context, EarnHourlyYieldQuery) (EarnHourlyYield, error)
}

func NewBybitClient

func NewBybitClient(apiKey string, APISecret string, options ...ClientOption) (BybitApi, error)

type CancelType

type CancelType string
const (
	CancelTypeCancelByUser                       CancelType = "CancelByUser"
	CancelTypeCancelByReduceOnly                 CancelType = "CancelByReduceOnly"
	CancelTypeCancelByPrepareLiq                 CancelType = "CancelByPrepareLiq"
	CancelTypeCancelAllBeforeLiq                 CancelType = "CancelAllBeforeLiq"
	CancelTypeCancelByPrepareAdl                 CancelType = "CancelByPrepareAdl"
	CancelTypeCancelAllBeforeAdl                 CancelType = "CancelAllBeforeAdl"
	CancelTypeCancelByAdmin                      CancelType = "CancelByAdmin"
	CancelTypeCancelBySettle                     CancelType = "CancelBySettle"
	CancelTypeCancelByTpSlTsClear                CancelType = "CancelByTpSlTsClear"
	CancelTypeCancelBySmp                        CancelType = "CancelBySmp"
	CancelTypeCancelByDcp                        CancelType = "CancelByDCP"
	CancelTypeCancelByRebalance                  CancelType = "CancelByRebalance"
	CancelTypeCancelByOcoTpcanceledBySlTriggered CancelType = "CancelByOCOTpCanceledBySlTriggered"
	CancelTypeCancelByOcoSlcanceledByTpTriggered CancelType = "CancelByOCOSlCanceledByTpTriggered"
	CancelTypeCancelByCannotAffordOrderCost      CancelType = "CancelByCannotAffordOrderCost"
	CancelTypeCancelByPmTrialMmOverEquity        CancelType = "CancelByPmTrialMmOverEquity"
	CancelTypeCancelByAccountBlocking            CancelType = "CancelByAccountBlocking"
	CancelTypeCancelByDelivery                   CancelType = "CancelByDelivery"
	CancelTypeCancelByMmpTriggered               CancelType = "CancelByMmpTriggered"
	CancelTypeCancelByCrossSelfMuch              CancelType = "CancelByCrossSelfMuch"
	CancelTypeCancelByCrossReachMaxTradeNum      CancelType = "CancelByCrossReachMaxTradeNum"
)

type Category

type Category string
const (
	CategorySpot    Category = "spot"
	CategoryLinear  Category = "linear"
	CategoryInverse Category = "inverse"
	CategoryOption  Category = "option"
)

type ClientOption

type ClientOption func(*bybitClient)

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL is a client option to set the base URL of the Bybit HTTP client.

func WithHttpClient

func WithHttpClient(httpClient httpClient) ClientOption

type ContractType

type ContractType string
const (
	ContractTypeInversePerpetual ContractType = "InversePerpetual"
	ContractTypeLinearPerpetual  ContractType = "LinearPerpetual"
	ContractTypeLinearFutures    ContractType = "LinearFutures"
	ContractTypeInverseFutures   ContractType = "InverseFutures"
)

type ConvertAccountType

type ConvertAccountType string
const (
	ConvertAccountTypeEbConvertUta     ConvertAccountType = "eb_convert_uta"
	ConvertAccountTypeEbConvertFunding ConvertAccountType = "eb_convert_funding"
)

type CopyTrading

type CopyTrading string
const (
	CopyTradingNone       CopyTrading = "none"
	CopyTradingBoth       CopyTrading = "both"
	CopyTradingUtaOnly    CopyTrading = "utaOnly"
	CopyTradingNormalOnly CopyTrading = "normalOnly"
)

type CreateType

type CreateType string
const (
	CreateTypeCreateByUser                              CreateType = "CreateByUser"
	CreateTypeCreateByFutureSpread                      CreateType = "CreateByFutureSpread"
	CreateTypeCreateByAdminClosing                      CreateType = "CreateByAdminClosing"
	CreateTypeCreateBySettle                            CreateType = "CreateBySettle"
	CreateTypeCreateByStopOrder                         CreateType = "CreateByStopOrder"
	CreateTypeCreateByTakeProfit                        CreateType = "CreateByTakeProfit"
	CreateTypeCreateByPartialTakeProfit                 CreateType = "CreateByPartialTakeProfit"
	CreateTypeCreateByStopLoss                          CreateType = "CreateByStopLoss"
	CreateTypeCreateByPartialStopLoss                   CreateType = "CreateByPartialStopLoss"
	CreateTypeCreateByTrailingStop                      CreateType = "CreateByTrailingStop"
	CreateTypeCreateByTrailingProfit                    CreateType = "CreateByTrailingProfit"
	CreateTypeCreateByLiq                               CreateType = "CreateByLiq"
	CreateTypeCreateByTakeOverPassThrough               CreateType = "CreateByTakeOver_PassThrough"
	CreateTypeCreateByAdlPassThrough                    CreateType = "CreateByAdl_PassThrough"
	CreateTypeCreateByBlockPassThrough                  CreateType = "CreateByBlock_PassThrough"
	CreateTypeCreateByBlockTradeMovePositionPassThrough CreateType = "CreateByBlockTradeMovePosition_PassThrough"
	CreateTypeCreateByClosing                           CreateType = "CreateByClosing"
	CreateTypeCreateByFgridBot                          CreateType = "CreateByFGridBot"
	CreateTypeCloseByFgridBot                           CreateType = "CloseByFGridBot"
	CreateTypeCreateByTwap                              CreateType = "CreateByTWAP"
	CreateTypeCreateByTvSignal                          CreateType = "CreateByTVSignal"
	CreateTypeCreateByMmRateClose                       CreateType = "CreateByMmRateClose"
	CreateTypeCreateByMartingaleBot                     CreateType = "CreateByMartingaleBot"
	CreateTypeCloseByMartingaleBot                      CreateType = "CloseByMartingaleBot"
	CreateTypeCreateByIceBerg                           CreateType = "CreateByIceBerg"
	CreateTypeCreateByArbitrage                         CreateType = "CreateByArbitrage"
	CreateTypeCreateByDdh                               CreateType = "CreateByDdh"
	CreateTypeCreateByBboOrder                          CreateType = "CreateByBboOrder"
)

type CryptoLoanAdjustLtvParams

type CryptoLoanAdjustLtvParams struct {
	// Loan order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Adjustment amount
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
	// `0`: add collateral; `1`: reduce collateral
	Direction string `json:"direction,omitempty" url:"direction,omitempty"`
}

type CryptoLoanAdjustLtvResult

type CryptoLoanAdjustLtvResult struct {
	// Collateral adjustment transaction ID
	AdjustId string `json:"adjustId,omitempty" url:"adjustId,omitempty"`
}

type CryptoLoanAdjustmentHistory

type CryptoLoanAdjustmentHistory struct {
	// Object
	List []CryptoLoanAdjustmentHistoryListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type CryptoLoanAdjustmentHistoryListItem

type CryptoLoanAdjustmentHistoryListItem struct {
	// Collateral coin
	CollateralCurrency string `json:"collateralCurrency,omitempty" url:"collateralCurrency,omitempty"`
	// Loan order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Collateral adjustment transaction ID
	AdjustId string `json:"adjustId,omitempty" url:"adjustId,omitempty"`
	// Adjust timestamp
	AdjustTime string `json:"adjustTime,omitempty" url:"adjustTime,omitempty"`
	// LTV before the adjustment
	PreLtv string `json:"preLTV,omitempty" url:"preLTV,omitempty"`
	// LTV after the adjustment
	AfterLtv string `json:"afterLTV,omitempty" url:"afterLTV,omitempty"`
	// The direction of adjustment, `0`: add collateral; `1`: reduce collateral
	Direction int64 `json:"direction,omitempty" url:"direction,omitempty"`
}

type CryptoLoanAdjustmentHistoryQuery

type CryptoLoanAdjustmentHistoryQuery struct {
	// Loan order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Collateral adjustment transaction ID
	AdjustId string `json:"adjustId,omitempty" url:"adjustId,omitempty"`
	// Collateral coin name
	CollateralCurrency string `json:"collateralCurrency,omitempty" url:"collateralCurrency,omitempty"`
	// Limit for data size per page. \[`1`, `100`\]. Default: `10`
	Limit string `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type CryptoLoanBorrowHistory

type CryptoLoanBorrowHistory struct {
	// Object
	List []CryptoLoanBorrowHistoryListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type CryptoLoanBorrowHistoryListItem

type CryptoLoanBorrowHistoryListItem struct {
	// The timestamp to borrow
	BorrowTime string `json:"borrowTime,omitempty" url:"borrowTime,omitempty"`
	// Collateral coin
	CollateralCurrency string `json:"collateralCurrency,omitempty" url:"collateralCurrency,omitempty"`
	// Loan maturity time, keeps `""` for flexible loan
	ExpirationTime string `json:"expirationTime,omitempty" url:"expirationTime,omitempty"`
	// Hourly interest rate
	//
	// 	- Flexible loan, it is real-time interest rate
	// 	- Fixed term loan: it is fixed term interest rate
	HourlyInterestRate string `json:"hourlyInterestRate,omitempty" url:"hourlyInterestRate,omitempty"`
	// Initial amount to mortgage
	InitialCollateralAmount string `json:"initialCollateralAmount,omitempty" url:"initialCollateralAmount,omitempty"`
	// Initial loan amount
	InitialLoanAmount string `json:"initialLoanAmount,omitempty" url:"initialLoanAmount,omitempty"`
	// Loan coin
	LoanCurrency string `json:"loanCurrency,omitempty" url:"loanCurrency,omitempty"`
	// Loan term, `7`, `14`, `30`, `90`, `180` days, keep `""` for flexible loan
	LoanTerm string `json:"loanTerm,omitempty" url:"loanTerm,omitempty"`
	// Loan order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Total interest repaid
	RepaidInterest string `json:"repaidInterest,omitempty" url:"repaidInterest,omitempty"`
	// Total penalty interest repaid
	RepaidPenaltyInterest string `json:"repaidPenaltyInterest,omitempty" url:"repaidPenaltyInterest,omitempty"`
	// Loan order status `1`: fully repaid manually; `2`: fully repaid by liquidation
	Status int64 `json:"status,omitempty" url:"status,omitempty"`
}

type CryptoLoanBorrowHistoryQuery

type CryptoLoanBorrowHistoryQuery struct {
	// Loan order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Loan coin name
	LoanCurrency string `json:"loanCurrency,omitempty" url:"loanCurrency,omitempty"`
	// Collateral coin name
	CollateralCurrency string `json:"collateralCurrency,omitempty" url:"collateralCurrency,omitempty"`
	// Limit for data size per page. \[`1`, `100`\]. Default: `10`
	Limit string `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type CryptoLoanBorrowableCollateralisableNumber

type CryptoLoanBorrowableCollateralisableNumber struct {
	// Collateral coin name
	CollateralCurrency string `json:"collateralCurrency,omitempty" url:"collateralCurrency,omitempty"`
	// Loan coin name
	LoanCurrency string `json:"loanCurrency,omitempty" url:"loanCurrency,omitempty"`
	// Max. limit to mortgage
	MaxCollateralAmount string `json:"maxCollateralAmount,omitempty" url:"maxCollateralAmount,omitempty"`
	// Max. limit to borrow
	MaxLoanAmount string `json:"maxLoanAmount,omitempty" url:"maxLoanAmount,omitempty"`
	// Min. limit to mortgage
	MinCollateralAmount string `json:"minCollateralAmount,omitempty" url:"minCollateralAmount,omitempty"`
	// Min. limit to borrow
	MinLoanAmount string `json:"minLoanAmount,omitempty" url:"minLoanAmount,omitempty"`
}

type CryptoLoanBorrowableCollateralisableNumberQuery

type CryptoLoanBorrowableCollateralisableNumberQuery struct {
	// Loan coin name
	LoanCurrency string `json:"loanCurrency,omitempty" url:"loanCurrency,omitempty"`
	// Collateral coin name
	CollateralCurrency string `json:"collateralCurrency,omitempty" url:"collateralCurrency,omitempty"`
}

type CryptoLoanCollateralData

type CryptoLoanCollateralData struct {
	// Object
	VipCoinList []CryptoLoanCollateralDataVipCoinListItem `json:"vipCoinList,omitempty" url:"vipCoinList,omitempty"`
}

type CryptoLoanCollateralDataQuery

type CryptoLoanCollateralDataQuery struct {
	// VIP level
	//
	// 	- `VIP0`, `VIP1`, `VIP2`, `VIP3`, `VIP4`, `VIP5`, `VIP99`(supreme VIP)
	// 	- `PRO1`, `PRO2`, `PRO3`, `PRO4`, `PRO5`, `PRO6`
	VipLevel VipLevel `json:"vipLevel,omitempty" url:"vipLevel,omitempty"`
	// Coin name, uppercase only
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
}

type CryptoLoanCollateralDataVipCoinListItem

type CryptoLoanCollateralDataVipCoinListItem struct {
	// Object
	List []CryptoLoanCollateralDataVipCoinListItemListItem `json:"list,omitempty" url:"list,omitempty"`
	// VIP level
	VipLevel string `json:"vipLevel,omitempty" url:"vipLevel,omitempty"`
}

type CryptoLoanCollateralDataVipCoinListItemListItem

type CryptoLoanCollateralDataVipCoinListItemListItem struct {
	// Valid collateral coin precision
	CollateralAccuracy int64 `json:"collateralAccuracy,omitempty" url:"collateralAccuracy,omitempty"`
	// The Initial LTV ratio determines the initial amount of coins that can be borrowed. The initial LTV ratio may vary for different collateral
	InitialLtv string `json:"initialLTV,omitempty" url:"initialLTV,omitempty"`
	// If the LTV ratio (Loan Amount/Collateral Amount) reaches the threshold, you will be required to add more collateral to your loan
	MarginCallLtv string `json:"marginCallLTV,omitempty" url:"marginCallLTV,omitempty"`
	// If the LTV ratio (Loan Amount/Collateral Amount) reaches the threshold, Bybit will liquidate your collateral assets to repay your loan and interest in full
	LiquidationLtv string `json:"liquidationLTV,omitempty" url:"liquidationLTV,omitempty"`
	// Collateral limit
	MaxLimit string `json:"maxLimit,omitempty" url:"maxLimit,omitempty"`
}

type CryptoLoanCommonAdjustLtvParams

type CryptoLoanCommonAdjustLtvParams struct {
	// Collateral coin
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
	// Adjustment amount
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
	// `0`: add collateral; `1`: reduce collateral
	Direction string `json:"direction,omitempty" url:"direction,omitempty"`
}

type CryptoLoanCommonAdjustLtvResult

type CryptoLoanCommonAdjustLtvResult struct {
	// Collateral adjustment transaction ID
	AdjustId int64 `json:"adjustId,omitempty" url:"adjustId,omitempty"`
}

type CryptoLoanCommonAdjustmentHistory

type CryptoLoanCommonAdjustmentHistory struct {
	// Object
	List []CryptoLoanCommonAdjustmentHistoryListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type CryptoLoanCommonAdjustmentHistoryListItem

type CryptoLoanCommonAdjustmentHistoryListItem struct {
	// Collateral coin
	CollateralCurrency string `json:"collateralCurrency,omitempty" url:"collateralCurrency,omitempty"`
	// amount
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
	// Collateral adjustment transaction ID
	AdjustId int64 `json:"adjustId,omitempty" url:"adjustId,omitempty"`
	// Adjust timestamp
	AdjustTime int64 `json:"adjustTime,omitempty" url:"adjustTime,omitempty"`
	// LTV before the adjustment
	PreLtv string `json:"preLTV,omitempty" url:"preLTV,omitempty"`
	// LTV after the adjustment
	AfterLtv string `json:"afterLTV,omitempty" url:"afterLTV,omitempty"`
	// The direction of adjustment, `0`: add collateral; `1`: reduce collateral
	Direction int64 `json:"direction,omitempty" url:"direction,omitempty"`
	// The status of adjustment, `1`: success; `2`: processing; `3`: fail
	Status int64 `json:"status,omitempty" url:"status,omitempty"`
}

type CryptoLoanCommonAdjustmentHistoryQuery

type CryptoLoanCommonAdjustmentHistoryQuery struct {
	// Collateral adjustment transaction ID
	AdjustId string `json:"adjustId,omitempty" url:"adjustId,omitempty"`
	// Collateral coin name
	CollateralCurrency string `json:"collateralCurrency,omitempty" url:"collateralCurrency,omitempty"`
	// Limit for data size per page. \[`1`, `100`\]. Default: `10`
	Limit string `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type CryptoLoanCommonCollateralData

type CryptoLoanCommonCollateralData struct {
	// Object
	CollateralRatioConfigList []CryptoLoanCommonCollateralDataCollateralRatioConfigListItem `json:"collateralRatioConfigList,omitempty" url:"collateralRatioConfigList,omitempty"`
	// Object
	CurrencyLiquidationList []CryptoLoanCommonCollateralDataCurrencyLiquidationListItem `json:"currencyLiquidationList,omitempty" url:"currencyLiquidationList,omitempty"`
}

type CryptoLoanCommonCollateralDataCollateralRatioConfigListItem

type CryptoLoanCommonCollateralDataCollateralRatioConfigListItem struct {
	// Object
	CollateralRatioList []CryptoLoanCommonCollateralDataCollateralRatioConfigListItemCollateralRatioListItem `json:"collateralRatioList,omitempty" url:"collateralRatioList,omitempty"`
	// Currenies with the same collateral ratio, e.g., `BTC,ETH,XRP`
	Currencies string `json:"currencies,omitempty" url:"currencies,omitempty"`
}

type CryptoLoanCommonCollateralDataCollateralRatioConfigListItemCollateralRatioListItem

type CryptoLoanCommonCollateralDataCollateralRatioConfigListItemCollateralRatioListItem struct {
	// Collateral ratio
	CollateralRatio string `json:"collateralRatio,omitempty" url:"collateralRatio,omitempty"`
	// Max qty
	MaxValue string `json:"maxValue,omitempty" url:"maxValue,omitempty"`
	// Min qty
	MinValue string `json:"minValue,omitempty" url:"minValue,omitempty"`
}

type CryptoLoanCommonCollateralDataCurrencyLiquidationListItem

type CryptoLoanCommonCollateralDataCurrencyLiquidationListItem struct {
	// Coin name
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
	// Liquidation order
	LiquidationOrder int64 `json:"liquidationOrder,omitempty" url:"liquidationOrder,omitempty"`
}

type CryptoLoanCommonCollateralDataQuery

type CryptoLoanCommonCollateralDataQuery struct {
	// Coin name, uppercase only
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
}

type CryptoLoanCommonLoanableData

type CryptoLoanCommonLoanableData struct {
	// Object
	List []CryptoLoanCommonLoanableDataListItem `json:"list,omitempty" url:"list,omitempty"`
}

type CryptoLoanCommonLoanableDataListItem

type CryptoLoanCommonLoanableDataListItem struct {
	// Coin name
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
	// Whether support fixed loan
	FixedBorrowable bool `json:"fixedBorrowable,omitempty" url:"fixedBorrowable,omitempty"`
	// Coin precision for fixed loan
	FixedBorrowingAccuracy int64 `json:"fixedBorrowingAccuracy,omitempty" url:"fixedBorrowingAccuracy,omitempty"`
	// Whether support flexible loan
	FlexibleBorrowable bool `json:"flexibleBorrowable,omitempty" url:"flexibleBorrowable,omitempty"`
	// Coin precision for flexible loan
	FlexibleBorrowingAccuracy int64 `json:"flexibleBorrowingAccuracy,omitempty" url:"flexibleBorrowingAccuracy,omitempty"`
	// Max borrow limit
	MaxBorrowingAmount string `json:"maxBorrowingAmount,omitempty" url:"maxBorrowingAmount,omitempty"`
	// Minimum amount for each fixed loan order
	MinFixedBorrowingAmount string `json:"minFixedBorrowingAmount,omitempty" url:"minFixedBorrowingAmount,omitempty"`
	// Minimum amount for each flexible loan order
	MinFlexibleBorrowingAmount string `json:"minFlexibleBorrowingAmount,omitempty" url:"minFlexibleBorrowingAmount,omitempty"`
	// VIP level
	VipLevel string `json:"vipLevel,omitempty" url:"vipLevel,omitempty"`
	// The annualized interest rate for flexible borrowing. If the loan currency does not support flexible borrowing, it will always be """"
	FlexibleAnnualizedInterestRate int64 `json:"flexibleAnnualizedInterestRate,omitempty" url:"flexibleAnnualizedInterestRate,omitempty"`
	// The lowest annualized interest rate for fixed borrowing for 7 days that the market can currently provide. If there is no lending in the current market, then it is empty string
	AnnualizedInterestRate7D string `json:"annualizedInterestRate7D,omitempty" url:"annualizedInterestRate7D,omitempty"`
	// The lowest annualized interest rate for fixed borrowing for 14 days that the market can currently provide. If there is no lending in the current market, then it is empty string
	AnnualizedInterestRate14D string `json:"annualizedInterestRate14D,omitempty" url:"annualizedInterestRate14D,omitempty"`
	// The lowest annualized interest rate for fixed borrowing for 30 days that the market can currently provide. If there is no lending in the current market, then it is empty string
	AnnualizedInterestRate30D string `json:"annualizedInterestRate30D,omitempty" url:"annualizedInterestRate30D,omitempty"`
	// The lowest annualized interest rate for fixed borrowing for 60 days that the market can currently provide. If there is no lending in the current market, then it is empty string
	AnnualizedInterestRate60D string `json:"annualizedInterestRate60D,omitempty" url:"annualizedInterestRate60D,omitempty"`
	// The lowest annualized interest rate for fixed borrowing for 90 days that the market can currently provide. If there is no lending in the current market, then it is empty string
	AnnualizedInterestRate90D string `json:"annualizedInterestRate90D,omitempty" url:"annualizedInterestRate90D,omitempty"`
	// The lowest annualized interest rate for fixed borrowing for 180 days that the market can currently provide. If there is no lending in the current market, then it is empty string
	AnnualizedInterestRate180D string `json:"annualizedInterestRate180D,omitempty" url:"annualizedInterestRate180D,omitempty"`
}

type CryptoLoanCommonLoanableDataQuery

type CryptoLoanCommonLoanableDataQuery struct {
	// VIP level
	//
	// 	- `VIP0`, `VIP1`, `VIP2`, `VIP3`, `VIP4`, `VIP5`, `VIP99`(supreme VIP)
	// 	- `PRO1`, `PRO2`, `PRO3`, `PRO4`, `PRO5`, `PRO6`
	VipLevel VipLevel `json:"vipLevel,omitempty" url:"vipLevel,omitempty"`
	// Coin name, uppercase only
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
}

type CryptoLoanCommonMaxCollateralAmount

type CryptoLoanCommonMaxCollateralAmount struct {
	// Maximum reduction amount
	MaxCollateralAmount string `json:"maxCollateralAmount,omitempty" url:"maxCollateralAmount,omitempty"`
}

type CryptoLoanCommonMaxCollateralAmountQuery

type CryptoLoanCommonMaxCollateralAmountQuery struct {
	// Collateral coin
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
}

type CryptoLoanCommonMaxLoanParams

type CryptoLoanCommonMaxLoanParams struct {
	// Coin to borrow
	Currency       string                                            `json:"currency,omitempty" url:"currency,omitempty"`
	CollateralList []CryptoLoanCommonMaxLoanParamsCollateralListItem `json:"collateralList,omitempty" url:"collateralList,omitempty"`
}

type CryptoLoanCommonMaxLoanParamsCollateralListItem

type CryptoLoanCommonMaxLoanParamsCollateralListItem struct {
	// Collateral amount. Only check funding account balance
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
	// Collateral coin. Both `amount` & `ccy` are required, when you pass "collateralList"
	Ccy string `json:"ccy,omitempty" url:"ccy,omitempty"`
}

type CryptoLoanCommonMaxLoanResult

type CryptoLoanCommonMaxLoanResult struct {
	// Coin to borrow
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
	// Based on your current collateral, and with the option to add more collateral, you can borrow up to `maxLoan`
	MaxLoan string `json:"maxLoan,omitempty" url:"maxLoan,omitempty"`
	// Nontional USD value
	NotionalUsd string `json:"notionalUsd,omitempty" url:"notionalUsd,omitempty"`
	// The **remaining** individual platform borrowing limit (shared between main and sub accounts)
	RemainingQuota string `json:"remainingQuota,omitempty" url:"remainingQuota,omitempty"`
}

type CryptoLoanCommonPosition

type CryptoLoanCommonPosition struct {
	// Object
	BorrowList []CryptoLoanCommonPositionBorrowListItem `json:"borrowList,omitempty" url:"borrowList,omitempty"`
	// Object
	CollateralList []CryptoLoanCommonPositionCollateralListItem `json:"collateralList,omitempty" url:"collateralList,omitempty"`
	// LTV
	Ltv string `json:"ltv,omitempty" url:"ltv,omitempty"`
	// Object
	SupplyList []CryptoLoanCommonPositionSupplyListItem `json:"supplyList,omitempty" url:"supplyList,omitempty"`
	// Total collateral amount (USD)
	TotalCollateral string `json:"totalCollateral,omitempty" url:"totalCollateral,omitempty"`
	// Total debt (fixed + flexible, in USD)
	TotalDebt string `json:"totalDebt,omitempty" url:"totalDebt,omitempty"`
	// Total supply amount (USD)
	TotalSupply string `json:"totalSupply,omitempty" url:"totalSupply,omitempty"`
}

type CryptoLoanCommonPositionBorrowListItem

type CryptoLoanCommonPositionBorrowListItem struct {
	// Total debt of fixed loan (coin)
	FixedTotalDebt string `json:"fixedTotalDebt,omitempty" url:"fixedTotalDebt,omitempty"`
	// Total debt of fixed loan (USD)
	FixedTotalDebtUsd string `json:"fixedTotalDebtUSD,omitempty" url:"fixedTotalDebtUSD,omitempty"`
	// Flebible loan hourly interest rate
	FlexibleHourlyInterestRate string `json:"flexibleHourlyInterestRate,omitempty" url:"flexibleHourlyInterestRate,omitempty"`
	// Total debt of flexible loan (coin)
	FlexibleTotalDebt string `json:"flexibleTotalDebt,omitempty" url:"flexibleTotalDebt,omitempty"`
	// Total debt of flexible loan (USD)
	FlexibleTotalDebtUsd string `json:"flexibleTotalDebtUSD,omitempty" url:"flexibleTotalDebtUSD,omitempty"`
	// Loan coin
	LoanCurrency string `json:"loanCurrency,omitempty" url:"loanCurrency,omitempty"`
}

type CryptoLoanCommonPositionCollateralListItem

type CryptoLoanCommonPositionCollateralListItem struct {
	// Collateral amount in coin
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
	// Collateral amount in USD (after tierd collateral ratio calculation)
	AmountUsd string `json:"amountUSD,omitempty" url:"amountUSD,omitempty"`
	// Collateral coin
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
}

type CryptoLoanCommonPositionSupplyListItem

type CryptoLoanCommonPositionSupplyListItem struct {
	// Supply amount in coin
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
	// Supply amount in USD
	AmountUsd string `json:"amountUSD,omitempty" url:"amountUSD,omitempty"`
	// Supply coin
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
}

type CryptoLoanFixedBorrowContractInfo

type CryptoLoanFixedBorrowContractInfo struct {
	// Object
	List []CryptoLoanFixedBorrowContractInfoListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type CryptoLoanFixedBorrowContractInfoListItem

type CryptoLoanFixedBorrowContractInfoListItem struct {
	// Annual rate for the borrowing
	AnnualRate string `json:"annualRate,omitempty" url:"annualRate,omitempty"`
	// Deprecated. `"true"`: enable auto repay, default; `"false"`: disable auto repay
	AutoRepay string `json:"autoRepay,omitempty" url:"autoRepay,omitempty"`
	// Loan coin
	BorrowCurrency string `json:"borrowCurrency,omitempty" url:"borrowCurrency,omitempty"`
	// Loan order timestamp
	BorrowTime string `json:"borrowTime,omitempty" url:"borrowTime,omitempty"`
	// Paid interest
	InterestPaid string `json:"interestPaid,omitempty" url:"interestPaid,omitempty"`
	// Loan contract ID
	LoanId string `json:"loanId,omitempty" url:"loanId,omitempty"`
	// Loan order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Time to repay
	RepaymentTime string `json:"repaymentTime,omitempty" url:"repaymentTime,omitempty"`
	// Unpaid interest
	ResidualPenaltyInterest string `json:"residualPenaltyInterest,omitempty" url:"residualPenaltyInterest,omitempty"`
	// Unpaid principal
	ResidualPrincipal string `json:"residualPrincipal,omitempty" url:"residualPrincipal,omitempty"`
	// Loan order status `1`: unrepaid; `2`: fully repaid; `3`: overdue
	Status int64 `json:"status,omitempty" url:"status,omitempty"`
	// Fixed term `7`: 7 days; `14`: 14 days; `30`: 30 days; `90`: 90 days; `180`: 180 days
	Term string `json:"term,omitempty" url:"term,omitempty"`
	// `1`:Auto Repayment; `2`:Transfer to flexible loan; `0`: No Automatic Repayment. Compatible with existing orders;
	RepayType string `json:"repayType,omitempty" url:"repayType,omitempty"`
}

type CryptoLoanFixedBorrowContractInfoQuery

type CryptoLoanFixedBorrowContractInfoQuery struct {
	// Loan order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Loan ID
	LoanId string `json:"loanId,omitempty" url:"loanId,omitempty"`
	// Loan coin name
	OrderCurrency string `json:"orderCurrency,omitempty" url:"orderCurrency,omitempty"`
	// Fixed term `7`: 7 days; `14`: 14 days; `30`: 30 days; `90`: 90 days; `180`: 180 days
	Term string `json:"term,omitempty" url:"term,omitempty"`
	// Limit for data size per page. \[`1`, `100`\]. Default: `10`
	Limit string `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type CryptoLoanFixedBorrowOrderCancelParams

type CryptoLoanFixedBorrowOrderCancelParams struct {
	// Order ID of fixed borrow order
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
}

type CryptoLoanFixedBorrowOrderInfo

type CryptoLoanFixedBorrowOrderInfo struct {
	// Object
	List []CryptoLoanFixedBorrowOrderInfoListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type CryptoLoanFixedBorrowOrderInfoListItem

type CryptoLoanFixedBorrowOrderInfoListItem struct {
	// Annual rate for the borrowing
	AnnualRate string `json:"annualRate,omitempty" url:"annualRate,omitempty"`
	// Loan order ID
	OrderId int64 `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Order created time
	OrderTime string `json:"orderTime,omitempty" url:"orderTime,omitempty"`
	// Filled qty
	FilledQty string `json:"filledQty,omitempty" url:"filledQty,omitempty"`
	// Order qty
	OrderQty string `json:"orderQty,omitempty" url:"orderQty,omitempty"`
	// Coin name
	OrderCurrency string `json:"orderCurrency,omitempty" url:"orderCurrency,omitempty"`
	// Borrow order status, `1`: matching; `2`: partially filled and cancelled; `3`: Fully filled; `4`: Cancelled; `5`: fail
	State int64 `json:"state,omitempty" url:"state,omitempty"`
	// Fixed term `7`: 7 days; `14`: 14 days; `30`: 30 days; `90`: 90 days; `180`: 180 days
	Term int64 `json:"term,omitempty" url:"term,omitempty"`
	// `1`:Auto Repayment; `2`:Transfer to flexible loan; `0`: No Automatic Repayment. Compatible with existing orders;
	RepayType string `json:"repayType,omitempty" url:"repayType,omitempty"`
}

type CryptoLoanFixedBorrowOrderInfoQuery

type CryptoLoanFixedBorrowOrderInfoQuery struct {
	// Loan order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Loan coin name
	OrderCurrency string `json:"orderCurrency,omitempty" url:"orderCurrency,omitempty"`
	// Borrow order status, `1`: matching; `2`: partially filled and cancelled; `3`: Fully filled; `4`: Cancelled
	State State `json:"state,omitempty" url:"state,omitempty"`
	// Fixed term `7`: 7 days; `14`: 14 days; `30`: 30 days; `90`: 90 days; `180`: 180 days
	Term string `json:"term,omitempty" url:"term,omitempty"`
	// Limit for data size per page. \[`1`, `100`\]. Default: `10`
	Limit string `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type CryptoLoanFixedBorrowOrderQuote

type CryptoLoanFixedBorrowOrderQuote struct {
	// Object
	List []CryptoLoanFixedBorrowOrderQuoteListItem `json:"list,omitempty" url:"list,omitempty"`
}

type CryptoLoanFixedBorrowOrderQuoteListItem

type CryptoLoanFixedBorrowOrderQuoteListItem struct {
	// Coin name
	OrderCurrency string `json:"orderCurrency,omitempty" url:"orderCurrency,omitempty"`
	// Fixed term `7`: 7 days; `14`: 14 days; `30`: 30 days; `90`: 90 days; `180`: 180 days
	Term int64 `json:"term,omitempty" url:"term,omitempty"`
	// Annual rate
	AnnualRate string `json:"annualRate,omitempty" url:"annualRate,omitempty"`
	// Quantity
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
}

type CryptoLoanFixedBorrowOrderQuoteQuery

type CryptoLoanFixedBorrowOrderQuoteQuery struct {
	// Coin name
	OrderCurrency string `json:"orderCurrency,omitempty" url:"orderCurrency,omitempty"`
	// Order by, `apy`: annual rate; `term`; `quantity`
	OrderBy string `json:"orderBy,omitempty" url:"orderBy,omitempty"`
	// Fixed term `7`: 7 days; `14`: 14 days; `30`: 30 days; `90`: 90 days; `180`: 180 days
	Term string `json:"term,omitempty" url:"term,omitempty"`
	// `0`: ascend, default; `1`: descend
	Sort int64 `json:"sort,omitempty" url:"sort,omitempty"`
	// Limit for data size per page. \[`1`, `100`\]. Default: `10`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
}

type CryptoLoanFixedBorrowParams

type CryptoLoanFixedBorrowParams struct {
	// Currency to borrow
	OrderCurrency string `json:"orderCurrency,omitempty" url:"orderCurrency,omitempty"`
	// Amount to borrow
	OrderAmount string `json:"orderAmount,omitempty" url:"orderAmount,omitempty"`
	// Customizable annual interest rate, e.g., `0.02` means 2%
	AnnualRate string `json:"annualRate,omitempty" url:"annualRate,omitempty"`
	// Fixed term `7`: 7 days; `14`: 14 days; `30`: 30 days; `90`: 90 days; `180`: 180 days
	Term string `json:"term,omitempty" url:"term,omitempty"`
	// Deprecated. Enable Auto-Repay to have assets in your Funding Account automatically repay your loan upon Borrowing order expiration, preventing overdue penalties. Ensure your Funding Account maintains sufficient amount for repayment to avoid automatic repayment failures.
	// `"true"`: enable, default; `"false"`: disable
	AutoRepay string `json:"autoRepay,omitempty" url:"autoRepay,omitempty"`
	// `1`:Auto Repayment (default); Enable "Auto Repayment" to automatically repay your loan using assets in your funding account when it dues, avoiding overdue penalties. `2`:Transfer to flexible loan
	RepayType string `json:"repayType,omitempty" url:"repayType,omitempty"`
	// Collateral coin list, supports putting up to 100 currency in the array
	CollateralList []CryptoLoanFixedBorrowParamsCollateralListItem `json:"collateralList,omitempty" url:"collateralList,omitempty"`
}

type CryptoLoanFixedBorrowParamsCollateralListItem

type CryptoLoanFixedBorrowParamsCollateralListItem struct {
	// Currency used to mortgage
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
	// Amount to mortgage
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
}

type CryptoLoanFixedBorrowResult

type CryptoLoanFixedBorrowResult struct {
	// Loan order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
}

type CryptoLoanFixedFullyRepayParams

type CryptoLoanFixedFullyRepayParams struct {
	// Loan contract ID. Either `loanId` or `loanCurrency` needs to be passed
	LoanId string `json:"loanId,omitempty" url:"loanId,omitempty"`
	// Loan coin. Either `loanId` or `loanCurrency` needs to be passed
	LoanCurrency string `json:"loanCurrency,omitempty" url:"loanCurrency,omitempty"`
}

type CryptoLoanFixedFullyRepayResult

type CryptoLoanFixedFullyRepayResult struct {
	// Repayment transaction ID
	RepayId string `json:"repayId,omitempty" url:"repayId,omitempty"`
}

type CryptoLoanFixedRenewInfo

type CryptoLoanFixedRenewInfo struct {
	// Object
	List []CryptoLoanFixedRenewInfoListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type CryptoLoanFixedRenewInfoListItem

type CryptoLoanFixedRenewInfoListItem struct {
	// Borrow currency
	BorrowCurrency string `json:"borrowCurrency,omitempty" url:"borrowCurrency,omitempty"`
	// loan amount
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
	// `1`: Auto Repayment; `2`: Transfer to flexible loan; `0`: No Automatic Repayment. Compatible with existing orders;
	AutoRepay int64 `json:"autoRepay,omitempty" url:"autoRepay,omitempty"`
	// Contract number
	ContractNo string `json:"contractNo,omitempty" url:"contractNo,omitempty"`
	// Due time
	DueTime string `json:"dueTime,omitempty" url:"dueTime,omitempty"`
	// Order Id
	OrderId int64 `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Loan Id
	LoanId string `json:"loanId,omitempty" url:"loanId,omitempty"`
	// Renew Loan number
	RenewLoanNo string `json:"renewLoanNo,omitempty" url:"renewLoanNo,omitempty"`
	// timestamps
	Time string `json:"time,omitempty" url:"time,omitempty"`
}

type CryptoLoanFixedRenewInfoQuery

type CryptoLoanFixedRenewInfoQuery struct {
	// Loan order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Loan coin name
	OrderCurrency string `json:"orderCurrency,omitempty" url:"orderCurrency,omitempty"`
	// Limit for data size per page. \[`1`, `100`\]. Default: `10`
	Limit string `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type CryptoLoanFixedRenewParams

type CryptoLoanFixedRenewParams struct {
	// Loan ID
	LoanId string `json:"loanId,omitempty" url:"loanId,omitempty"`
	// Collateral coin list, supports putting up to 100 currency in the array
	CollateralList []CryptoLoanFixedRenewParamsCollateralListItem `json:"collateralList,omitempty" url:"collateralList,omitempty"`
}

type CryptoLoanFixedRenewParamsCollateralListItem

type CryptoLoanFixedRenewParamsCollateralListItem struct {
	// Currency used to mortgage
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
	// Amount to mortgage
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
}

type CryptoLoanFixedRenewResult

type CryptoLoanFixedRenewResult struct {
	// Loan order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
}

type CryptoLoanFixedRepayCollateralParams

type CryptoLoanFixedRepayCollateralParams struct {
	// Loan contract ID. If not passed, the fixed currency offset logic will apply.
	LoanId string `json:"loanId,omitempty" url:"loanId,omitempty"`
	// Loan coin name
	LoanCurrency string `json:"loanCurrency,omitempty" url:"loanCurrency,omitempty"`
	// Collateral currencies: Use commas to separate multiple collateral currencies
	CollateralCoin string `json:"collateralCoin,omitempty" url:"collateralCoin,omitempty"`
	// Repay amount
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
}

type CryptoLoanFixedRepaymentHistory

type CryptoLoanFixedRepaymentHistory struct {
	// Object
	List []CryptoLoanFixedRepaymentHistoryListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type CryptoLoanFixedRepaymentHistoryListItem

type CryptoLoanFixedRepaymentHistoryListItem struct {
	// Object
	Details []CryptoLoanFixedRepaymentHistoryListItemDetailsItem `json:"details,omitempty" url:"details,omitempty"`
	// Loan coin name
	LoanCurrency string `json:"loanCurrency,omitempty" url:"loanCurrency,omitempty"`
	// Repay amount
	RepayAmount int64 `json:"repayAmount,omitempty" url:"repayAmount,omitempty"`
	// Repay order ID
	RepayId string `json:"repayId,omitempty" url:"repayId,omitempty"`
	// Status, `1`: success, `2`: processing, `3`: fail
	RepayStatus int64 `json:"repayStatus,omitempty" url:"repayStatus,omitempty"`
	// Repay time
	RepayTime int64 `json:"repayTime,omitempty" url:"repayTime,omitempty"`
	// Repay type, `1`: repay by user; `2`: repay by liquidation; `3`: auto repay; `4`: overdue repay; `5`: repay by delisting; `6`: repay by delay liquidation; `7`: repay by currency; `8`: transfer to flexible loan
	RepayType int64 `json:"repayType,omitempty" url:"repayType,omitempty"`
}

type CryptoLoanFixedRepaymentHistoryListItemDetailsItem

type CryptoLoanFixedRepaymentHistoryListItemDetailsItem struct {
	// Loan coin name
	LoanCurrency string `json:"loanCurrency,omitempty" url:"loanCurrency,omitempty"`
	// Repay amount
	RepayAmount int64 `json:"repayAmount,omitempty" url:"repayAmount,omitempty"`
	// Loan ID. One repayment may involve multiple loan contracts.
	LoanId string `json:"loanId,omitempty" url:"loanId,omitempty"`
}

type CryptoLoanFixedRepaymentHistoryQuery

type CryptoLoanFixedRepaymentHistoryQuery struct {
	// Repayment order ID
	RepayId string `json:"repayId,omitempty" url:"repayId,omitempty"`
	// Loan coin name
	LoanCurrency string `json:"loanCurrency,omitempty" url:"loanCurrency,omitempty"`
	// Limit for data size per page. \[`1`, `100`\]. Default: `10`
	Limit string `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type CryptoLoanFixedSupplyContractInfo

type CryptoLoanFixedSupplyContractInfo struct {
	// Object
	List []CryptoLoanFixedSupplyContractInfoListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type CryptoLoanFixedSupplyContractInfoListItem

type CryptoLoanFixedSupplyContractInfoListItem struct {
	// Annual rate for the supply
	AnnualRate string `json:"annualRate,omitempty" url:"annualRate,omitempty"`
	// Supply coin
	SupplyCurrency string `json:"supplyCurrency,omitempty" url:"supplyCurrency,omitempty"`
	// Supply timestamp
	SupplyTime string `json:"supplyTime,omitempty" url:"supplyTime,omitempty"`
	// Supply amount
	SupplyAmount string `json:"supplyAmount,omitempty" url:"supplyAmount,omitempty"`
	// Paid interest
	InterestPaid string `json:"interestPaid,omitempty" url:"interestPaid,omitempty"`
	// Supply contract ID
	SupplyId string `json:"supplyId,omitempty" url:"supplyId,omitempty"`
	// Supply order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Planned time to redeem
	RedemptionTime string `json:"redemptionTime,omitempty" url:"redemptionTime,omitempty"`
	// Overdue interest
	PenaltyInterest string `json:"penaltyInterest,omitempty" url:"penaltyInterest,omitempty"`
	// Actual time to redeem
	ActualRedemptionTime string `json:"actualRedemptionTime,omitempty" url:"actualRedemptionTime,omitempty"`
	// Supply contract status `1`: Supplying; `2`: Redeemed
	Status int64 `json:"status,omitempty" url:"status,omitempty"`
	// Fixed term `7`: 7 days; `14`: 14 days; `30`: 30 days; `90`: 90 days; `180`: 180 days
	Term string `json:"term,omitempty" url:"term,omitempty"`
}

type CryptoLoanFixedSupplyContractInfoQuery

type CryptoLoanFixedSupplyContractInfoQuery struct {
	// Supply order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Supply contract ID
	SupplyId string `json:"supplyId,omitempty" url:"supplyId,omitempty"`
	// Supply coin name
	SupplyCurrency string `json:"supplyCurrency,omitempty" url:"supplyCurrency,omitempty"`
	// Fixed term `7`: 7 days; `14`: 14 days; `30`: 30 days; `90`: 90 days; `180`: 180 days
	Term string `json:"term,omitempty" url:"term,omitempty"`
	// Limit for data size per page. \[`1`, `100`\]. Default: `10`
	Limit string `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type CryptoLoanFixedSupplyOrderCancelParams

type CryptoLoanFixedSupplyOrderCancelParams struct {
	// Order ID of fixed supply order
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
}

type CryptoLoanFixedSupplyOrderInfo

type CryptoLoanFixedSupplyOrderInfo struct {
	// Object
	List []CryptoLoanFixedSupplyOrderInfoListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type CryptoLoanFixedSupplyOrderInfoListItem

type CryptoLoanFixedSupplyOrderInfoListItem struct {
	// Annual rate for the supply
	AnnualRate string `json:"annualRate,omitempty" url:"annualRate,omitempty"`
	// Supply order ID
	OrderId int64 `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Order created time
	OrderTime string `json:"orderTime,omitempty" url:"orderTime,omitempty"`
	// Filled qty
	FilledQty string `json:"filledQty,omitempty" url:"filledQty,omitempty"`
	// Order qty
	OrderQty string `json:"orderQty,omitempty" url:"orderQty,omitempty"`
	// Coin name
	OrderCurrency string `json:"orderCurrency,omitempty" url:"orderCurrency,omitempty"`
	// Supply order status, `1`: matching; `2`: partially filled and cancelled; `3`: Fully filled; `4`: Cancelled; `5`: fail
	State int64 `json:"state,omitempty" url:"state,omitempty"`
	// Fixed term `7`: 7 days; `14`: 14 days; `30`: 30 days; `90`: 90 days; `180`: 180 days
	Term int64 `json:"term,omitempty" url:"term,omitempty"`
}

type CryptoLoanFixedSupplyOrderInfoQuery

type CryptoLoanFixedSupplyOrderInfoQuery struct {
	// Supply order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Supply coin name
	OrderCurrency string `json:"orderCurrency,omitempty" url:"orderCurrency,omitempty"`
	// Supply order status, `1`: matching; `2`: partially filled and cancelled; `3`: Fully filled; `4`: Cancelled
	State State `json:"state,omitempty" url:"state,omitempty"`
	// Fixed term `7`: 7 days; `14`: 14 days; `30`: 30 days; `90`: 90 days; `180`: 180 days
	Term string `json:"term,omitempty" url:"term,omitempty"`
	// Limit for data size per page. \[`1`, `100`\]. Default: `10`
	Limit string `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type CryptoLoanFixedSupplyOrderQuote

type CryptoLoanFixedSupplyOrderQuote struct {
	// Object
	List []CryptoLoanFixedSupplyOrderQuoteListItem `json:"list,omitempty" url:"list,omitempty"`
}

type CryptoLoanFixedSupplyOrderQuoteListItem

type CryptoLoanFixedSupplyOrderQuoteListItem struct {
	// Coin name
	OrderCurrency string `json:"orderCurrency,omitempty" url:"orderCurrency,omitempty"`
	// Fixed term `7`: 7 days; `14`: 14 days; `30`: 30 days; `90`: 90 days; `180`: 180 days
	Term int64 `json:"term,omitempty" url:"term,omitempty"`
	// Annual rate
	AnnualRate string `json:"annualRate,omitempty" url:"annualRate,omitempty"`
	// Quantity
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
}

type CryptoLoanFixedSupplyOrderQuoteQuery

type CryptoLoanFixedSupplyOrderQuoteQuery struct {
	// Coin name
	OrderCurrency string `json:"orderCurrency,omitempty" url:"orderCurrency,omitempty"`
	// Fixed term `7`: 7 days; `14`: 14 days; `30`: 30 days; `90`: 90 days; `180`: 180 days
	Term string `json:"term,omitempty" url:"term,omitempty"`
	// Order by, `apy`: annual rate; `term`; `quantity`
	OrderBy string `json:"orderBy,omitempty" url:"orderBy,omitempty"`
	// `0`: ascend, default; `1`: descend
	Sort int64 `json:"sort,omitempty" url:"sort,omitempty"`
	// Limit for data size per page. \[`1`, `100`\]. Default: `10`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
}

type CryptoLoanFixedSupplyParams

type CryptoLoanFixedSupplyParams struct {
	// Currency to supply
	OrderCurrency string `json:"orderCurrency,omitempty" url:"orderCurrency,omitempty"`
	// Amount to supply
	OrderAmount string `json:"orderAmount,omitempty" url:"orderAmount,omitempty"`
	// Customizable annual interest rate, e.g., `0.02` means 2%
	AnnualRate string `json:"annualRate,omitempty" url:"annualRate,omitempty"`
	// Fixed term `7`: 7 days; `14`: 14 days; `30`: 30 days; `90`: 90 days; `180`: 180 days
	Term string `json:"term,omitempty" url:"term,omitempty"`
}

type CryptoLoanFixedSupplyResult

type CryptoLoanFixedSupplyResult struct {
	// Supply order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
}

type CryptoLoanFlexibleBorrowHistory

type CryptoLoanFlexibleBorrowHistory struct {
	// Object
	List []CryptoLoanFlexibleBorrowHistoryListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type CryptoLoanFlexibleBorrowHistoryListItem

type CryptoLoanFlexibleBorrowHistoryListItem struct {
	// The timestamp to borrow
	BorrowTime int64 `json:"borrowTime,omitempty" url:"borrowTime,omitempty"`
	// Loan amount
	InitialLoanAmount string `json:"initialLoanAmount,omitempty" url:"initialLoanAmount,omitempty"`
	// Loan coin
	LoanCurrency string `json:"loanCurrency,omitempty" url:"loanCurrency,omitempty"`
	// Loan order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Loan order status `1`: success; `2`: processing; `3`: fail
	Status int64 `json:"status,omitempty" url:"status,omitempty"`
}

type CryptoLoanFlexibleBorrowHistoryQuery

type CryptoLoanFlexibleBorrowHistoryQuery struct {
	// Loan order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Loan coin name
	LoanCurrency string `json:"loanCurrency,omitempty" url:"loanCurrency,omitempty"`
	// Limit for data size per page. \[`1`, `100`\]. Default: `10`
	Limit string `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type CryptoLoanFlexibleBorrowParams

type CryptoLoanFlexibleBorrowParams struct {
	// Loan coin name
	LoanCurrency string `json:"loanCurrency,omitempty" url:"loanCurrency,omitempty"`
	// Amount to borrow
	LoanAmount string `json:"loanAmount,omitempty" url:"loanAmount,omitempty"`
	// Collateral coin list, supports putting up to 100 currency in the array
	CollateralList []CryptoLoanFlexibleBorrowParamsCollateralListItem `json:"collateralList,omitempty" url:"collateralList,omitempty"`
}

type CryptoLoanFlexibleBorrowParamsCollateralListItem

type CryptoLoanFlexibleBorrowParamsCollateralListItem struct {
	// Currency used to mortgage
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
	// Amount to mortgage
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
}

type CryptoLoanFlexibleBorrowResult

type CryptoLoanFlexibleBorrowResult struct {
	// Loan order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
}

type CryptoLoanFlexibleOngoingCoin

type CryptoLoanFlexibleOngoingCoin struct {
	// Object
	List []CryptoLoanFlexibleOngoingCoinListItem `json:"list,omitempty" url:"list,omitempty"`
}

type CryptoLoanFlexibleOngoingCoinListItem

type CryptoLoanFlexibleOngoingCoinListItem struct {
	// Latest hourly flexible interest rate
	HourlyInterestRate string `json:"hourlyInterestRate,omitempty" url:"hourlyInterestRate,omitempty"`
	// Loan coin
	LoanCurrency string `json:"loanCurrency,omitempty" url:"loanCurrency,omitempty"`
	// Unpaid principal and interest
	TotalDebt string `json:"totalDebt,omitempty" url:"totalDebt,omitempty"`
	// Unpaid principal
	UnpaidAmount string `json:"unpaidAmount,omitempty" url:"unpaidAmount,omitempty"`
	// Unpaid interest
	UnpaidInterest string `json:"unpaidInterest,omitempty" url:"unpaidInterest,omitempty"`
}

type CryptoLoanFlexibleOngoingCoinQuery

type CryptoLoanFlexibleOngoingCoinQuery struct {
	// Loan coin name
	LoanCurrency string `json:"loanCurrency,omitempty" url:"loanCurrency,omitempty"`
}

type CryptoLoanFlexibleRepayCollateralParams

type CryptoLoanFlexibleRepayCollateralParams struct {
	// Loan coin name
	LoanCurrency string `json:"loanCurrency,omitempty" url:"loanCurrency,omitempty"`
	// Collateral currencies: Use commas to separate multiple collateral currencies
	CollateralCoin string `json:"collateralCoin,omitempty" url:"collateralCoin,omitempty"`
	// Repay amount
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
}

type CryptoLoanFlexibleRepayParams

type CryptoLoanFlexibleRepayParams struct {
	// Loan coin name
	LoanCurrency string `json:"loanCurrency,omitempty" url:"loanCurrency,omitempty"`
	// Amount to repay
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
}

type CryptoLoanFlexibleRepayResult

type CryptoLoanFlexibleRepayResult struct {
	// Repayment transaction ID
	RepayId string `json:"repayId,omitempty" url:"repayId,omitempty"`
}

type CryptoLoanFlexibleRepaymentHistory

type CryptoLoanFlexibleRepaymentHistory struct {
	// Object
	List []CryptoLoanFlexibleRepaymentHistoryListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type CryptoLoanFlexibleRepaymentHistoryListItem

type CryptoLoanFlexibleRepaymentHistoryListItem struct {
	// Loan coin
	LoanCurrency string `json:"loanCurrency,omitempty" url:"loanCurrency,omitempty"`
	// Repayment amount
	RepayAmount string `json:"repayAmount,omitempty" url:"repayAmount,omitempty"`
	// Repayment transaction ID
	RepayId string `json:"repayId,omitempty" url:"repayId,omitempty"`
	// Repayment status, `1`: success; `2`: processing; `3`: fail
	RepayStatus int64 `json:"repayStatus,omitempty" url:"repayStatus,omitempty"`
	// Repay timestamp
	RepayTime int64 `json:"repayTime,omitempty" url:"repayTime,omitempty"`
	// Repayment type, `1`: repay by user; `2`: repay by liquidation; `5`: repay by delisting; `6`: repay by delay liquidation; `7`: repay by currency
	RepayType int64 `json:"repayType,omitempty" url:"repayType,omitempty"`
}

type CryptoLoanFlexibleRepaymentHistoryQuery

type CryptoLoanFlexibleRepaymentHistoryQuery struct {
	// Repayment tranaction ID
	RepayId string `json:"repayId,omitempty" url:"repayId,omitempty"`
	// Loan coin name
	LoanCurrency string `json:"loanCurrency,omitempty" url:"loanCurrency,omitempty"`
	// Limit for data size per page. \[`1`, `100`\]. Default: `10`
	Limit string `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type CryptoLoanLoanableData

type CryptoLoanLoanableData struct {
	// Object
	VipCoinList []CryptoLoanLoanableDataVipCoinListItem `json:"vipCoinList,omitempty" url:"vipCoinList,omitempty"`
}

type CryptoLoanLoanableDataQuery

type CryptoLoanLoanableDataQuery struct {
	// VIP level
	//
	// 	- `VIP0`, `VIP1`, `VIP2`, `VIP3`, `VIP4`, `VIP5`, `VIP99`(supreme VIP)
	// 	- `PRO1`, `PRO2`, `PRO3`, `PRO4`, `PRO5`, `PRO6`
	VipLevel VipLevel `json:"vipLevel,omitempty" url:"vipLevel,omitempty"`
	// Coin name, uppercase only
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
}

type CryptoLoanLoanableDataVipCoinListItem

type CryptoLoanLoanableDataVipCoinListItem struct {
	// Object
	List []CryptoLoanLoanableDataVipCoinListItemListItem `json:"list,omitempty" url:"list,omitempty"`
	// VIP level
	VipLevel string `json:"vipLevel,omitempty" url:"vipLevel,omitempty"`
}

type CryptoLoanLoanableDataVipCoinListItemListItem

type CryptoLoanLoanableDataVipCoinListItemListItem struct {
	// The number of decimal places (precision) of this coin
	BorrowingAccuracy int64 `json:"borrowingAccuracy,omitempty" url:"borrowingAccuracy,omitempty"`
	// Coin name
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
	// Flexible hourly variable interest rate
	//
	// 	- Flexible Crypto Loans offer an hourly variable interest rate, calculated based on the actual borrowing time per hour, with the option for early repayment
	// 	- Is `""` if the coin does not support flexible loan
	FlexibleHourlyInterestRate string `json:"flexibleHourlyInterestRate,omitempty" url:"flexibleHourlyInterestRate,omitempty"`
	// Hourly interest rate for 7 days loan. Is `""` if the coin does not support 7 days loan
	HourlyInterestRate7D string `json:"hourlyInterestRate7D,omitempty" url:"hourlyInterestRate7D,omitempty"`
	// Hourly interest rate for 14 days loan. Is `""` if the coin does not support 14 days loan
	HourlyInterestRate14D string `json:"hourlyInterestRate14D,omitempty" url:"hourlyInterestRate14D,omitempty"`
	// Hourly interest rate for 30 days loan. Is `""` if the coin does not support 30 days loan
	HourlyInterestRate30D string `json:"hourlyInterestRate30D,omitempty" url:"hourlyInterestRate30D,omitempty"`
	// Hourly interest rate for 90 days loan. Is `""` if the coin does not support 90 days loan
	HourlyInterestRate90D string `json:"hourlyInterestRate90D,omitempty" url:"hourlyInterestRate90D,omitempty"`
	// Hourly interest rate for 180 days loan. Is `""` if the coin does not support 180 days loan
	HourlyInterestRate180D string `json:"hourlyInterestRate180D,omitempty" url:"hourlyInterestRate180D,omitempty"`
	// Max. amount to borrow
	MaxBorrowingAmount string `json:"maxBorrowingAmount,omitempty" url:"maxBorrowingAmount,omitempty"`
	// Min. amount to borrow
	MinBorrowingAmount string `json:"minBorrowingAmount,omitempty" url:"minBorrowingAmount,omitempty"`
}

type CryptoLoanMaxCollateralAmount

type CryptoLoanMaxCollateralAmount struct {
	// Max. reduction collateral amount
	MaxCollateralAmount string `json:"maxCollateralAmount,omitempty" url:"maxCollateralAmount,omitempty"`
}

type CryptoLoanMaxCollateralAmountQuery

type CryptoLoanMaxCollateralAmountQuery struct {
	// Loan coin ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
}

type CryptoLoanOngoingOrders

type CryptoLoanOngoingOrders struct {
	// Object
	List []CryptoLoanOngoingOrdersListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type CryptoLoanOngoingOrdersListItem

type CryptoLoanOngoingOrdersListItem struct {
	// Collateral amount
	CollateralAmount string `json:"collateralAmount,omitempty" url:"collateralAmount,omitempty"`
	// Collateral coin
	CollateralCurrency string `json:"collateralCurrency,omitempty" url:"collateralCurrency,omitempty"`
	// Current LTV
	CurrentLtv string `json:"currentLTV,omitempty" url:"currentLTV,omitempty"`
	// Loan maturity time, keeps `""` for flexible loan
	ExpirationTime string `json:"expirationTime,omitempty" url:"expirationTime,omitempty"`
	// Hourly interest rate
	//
	// 	- Flexible loan, it is real-time interest rate
	// 	- Fixed term loan: it is fixed term interest rate
	HourlyInterestRate string `json:"hourlyInterestRate,omitempty" url:"hourlyInterestRate,omitempty"`
	// Loan coin
	LoanCurrency string `json:"loanCurrency,omitempty" url:"loanCurrency,omitempty"`
	// Loan term, `7`, `14`, `30`, `90`, `180` days, keep `""` for flexible loan
	LoanTerm string `json:"loanTerm,omitempty" url:"loanTerm,omitempty"`
	// Loan order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Unpaid interest
	ResidualInterest string `json:"residualInterest,omitempty" url:"residualInterest,omitempty"`
	// Unpaid penalty interest
	ResidualPenaltyInterest string `json:"residualPenaltyInterest,omitempty" url:"residualPenaltyInterest,omitempty"`
	// Unpaid principal
	TotalDebt string `json:"totalDebt,omitempty" url:"totalDebt,omitempty"`
}

type CryptoLoanOngoingOrdersQuery

type CryptoLoanOngoingOrdersQuery struct {
	// Loan order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Loan coin name
	LoanCurrency string `json:"loanCurrency,omitempty" url:"loanCurrency,omitempty"`
	// Collateral coin name
	CollateralCurrency string `json:"collateralCurrency,omitempty" url:"collateralCurrency,omitempty"`
	// - `1`: fixed term, when query this type, `loanTerm` must be filled
	// 	- `2`: flexible term
	//
	// By default, query all types
	LoanTermType string `json:"loanTermType,omitempty" url:"loanTermType,omitempty"`
	// `7`, `14`, `30`, `90`, `180` days, working when `loanTermType`\=1
	LoanTerm string `json:"loanTerm,omitempty" url:"loanTerm,omitempty"`
	// Limit for data size per page. \[`1`, `100`\]. Default: `10`
	Limit string `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type CryptoLoanRepayParams

type CryptoLoanRepayParams struct {
	// Loan order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Repay amount
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
}

type CryptoLoanRepayResult

type CryptoLoanRepayResult struct {
	// Repayment transaction ID
	RepayId string `json:"repayId,omitempty" url:"repayId,omitempty"`
}

type CryptoLoanRepaymentHistory

type CryptoLoanRepaymentHistory struct {
	// Object
	List []CryptoLoanRepaymentHistoryListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type CryptoLoanRepaymentHistoryListItem

type CryptoLoanRepaymentHistoryListItem struct {
	// Collateral coin
	CollateralCurrency string `json:"collateralCurrency,omitempty" url:"collateralCurrency,omitempty"`
	// Amount of collateral returned as a result of this repayment. `"0"` if this isn't the final loan repayment
	CollateralReturn string `json:"collateralReturn,omitempty" url:"collateralReturn,omitempty"`
	// Loan coin
	LoanCurrency string `json:"loanCurrency,omitempty" url:"loanCurrency,omitempty"`
	// Loan term, `7`, `14`, `30`, `90`, `180` days, keep `""` for flexible loan
	LoanTerm string `json:"loanTerm,omitempty" url:"loanTerm,omitempty"`
	// Loan order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Repayment amount
	RepayAmount string `json:"repayAmount,omitempty" url:"repayAmount,omitempty"`
	// Repayment transaction ID
	RepayId string `json:"repayId,omitempty" url:"repayId,omitempty"`
	// Repayment status, `1`: success; `2`: processing
	RepayStatus int64 `json:"repayStatus,omitempty" url:"repayStatus,omitempty"`
	// Repay timestamp
	RepayTime string `json:"repayTime,omitempty" url:"repayTime,omitempty"`
	// Repayment type, `1`: repay by user; `2`: repay by liquidation
	RepayType string `json:"repayType,omitempty" url:"repayType,omitempty"`
}

type CryptoLoanRepaymentHistoryQuery

type CryptoLoanRepaymentHistoryQuery struct {
	// Loan order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Repayment tranaction ID
	RepayId string `json:"repayId,omitempty" url:"repayId,omitempty"`
	// Loan coin name
	LoanCurrency string `json:"loanCurrency,omitempty" url:"loanCurrency,omitempty"`
	// Limit for data size per page. \[`1`, `100`\]. Default: `10`
	Limit string `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type CurAuctionPhase

type CurAuctionPhase string
const (
	CurAuctionPhaseNotStarted          CurAuctionPhase = "NotStarted"
	CurAuctionPhaseFinished            CurAuctionPhase = "Finished"
	CurAuctionPhaseCallAuction         CurAuctionPhase = "CallAuction"
	CurAuctionPhaseCallAuctionNoCancel CurAuctionPhase = "CallAuctionNoCancel"
	CurAuctionPhaseCrossMatching       CurAuctionPhase = "CrossMatching"
	CurAuctionPhaseContinuousTrading   CurAuctionPhase = "ContinuousTrading"
)

type DataRecordingPeriod

type DataRecordingPeriod string
const (
	DataRecordingPeriod5Min  DataRecordingPeriod = "5min"
	DataRecordingPeriod15Min DataRecordingPeriod = "15min"
	DataRecordingPeriod30Min DataRecordingPeriod = "30min"
	DataRecordingPeriod1H    DataRecordingPeriod = "1h"
	DataRecordingPeriod4H    DataRecordingPeriod = "4h"
	DataRecordingPeriod4D    DataRecordingPeriod = "4d"
)

type DepositStatus

type DepositStatus string
const (
	DepositStatus0     DepositStatus = "0"
	DepositStatus1     DepositStatus = "1"
	DepositStatus2     DepositStatus = "2"
	DepositStatus3     DepositStatus = "3"
	DepositStatus4     DepositStatus = "4"
	DepositStatus10011 DepositStatus = "10011"
	DepositStatus10012 DepositStatus = "10012"
)

type EarnHourlyYield

type EarnHourlyYield struct {
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
	// Object
	List []EarnHourlyYieldListItem `json:"list,omitempty" url:"list,omitempty"`
}

type EarnHourlyYieldListItem

type EarnHourlyYieldListItem struct {
	// Product ID
	ProductId string `json:"productId,omitempty" url:"productId,omitempty"`
	// Coin name: "BTC", "ETH"
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Unique key (guaranteed to be unique only under the same user)
	Id string `json:"id,omitempty" url:"id,omitempty"`
	// Yield Amount. Example: 10
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
	// Effective staking amount, e.g., 1000.00
	EffectiveStakingAmount string `json:"effectiveStakingAmount,omitempty" url:"effectiveStakingAmount,omitempty"`
	// Order status: `Pending`, `Success`, `Fail`
	Status string `json:"status,omitempty" url:"status,omitempty"`
	// Hourly yield time(ms) eg: 1755478800000
	HourlyDate string `json:"hourlyDate,omitempty" url:"hourlyDate,omitempty"`
	// Order creation time in milliseconds, e.g., 1684738540561
	CreatedAt string `json:"createdAt,omitempty" url:"createdAt,omitempty"`
}

type EarnHourlyYieldQuery

type EarnHourlyYieldQuery struct {
	// `FlexibleSaving`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Product ID
	ProductId string `json:"productId,omitempty" url:"productId,omitempty"`
	// The start timestamp (ms).
	//
	// 	- 1\. If both are not provided, the default is to return data from the last 7 days.
	// 	- 2\. If both are provided, the difference between the endTime and startTime must be less than or equal to 7 days.
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The endTime timestamp (ms)
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Limit for data size per page. Range: \[1, 100\]. Default: 50
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor, use the returned `nextPageCursor` to query data for the next page.
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type EarnOrder

type EarnOrder struct {
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
	// Object
	List []EarnOrderListItem `json:"list,omitempty" url:"list,omitempty"`
}

type EarnOrderListItem

type EarnOrderListItem struct {
	// Coin name
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// amount
	OrderValue string `json:"orderValue,omitempty" url:"orderValue,omitempty"`
	// `Redeem`, `Stake`
	OrderType string `json:"orderType,omitempty" url:"orderType,omitempty"`
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Order link ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// Order status `Success`, `Fail`, `Pending`
	Status string `json:"status,omitempty" url:"status,omitempty"`
	// Order created time, in milliseconds
	CreatedAt string `json:"createdAt,omitempty" url:"createdAt,omitempty"`
	// Product ID
	ProductId string `json:"productId,omitempty" url:"productId,omitempty"`
	// Order updated time, in milliseconds
	UpdatedAt string `json:"updatedAt,omitempty" url:"updatedAt,omitempty"`
	// Swap order value. Only for LST Onchain.
	SwapOrderValue string `json:"swapOrderValue,omitempty" url:"swapOrderValue,omitempty"`
	// Estimate redeem time, in milliseconds. Only for Onchain
	EstimateRedeemTime string `json:"estimateRedeemTime,omitempty" url:"estimateRedeemTime,omitempty"`
	// Estimate stake time, in milliseconds. Only for Onchain
	EstimateStakeTime string `json:"estimateStakeTime,omitempty" url:"estimateStakeTime,omitempty"`
}

type EarnOrderQuery

type EarnOrderQuery struct {
	// `FlexibleSaving`,`OnChain`
	// **Remarks**: currently, only flexible savings and OnChain is supported
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Order ID.
	//
	// 	- For category = `OnChain`, either orderId or orderLinkId is **required**
	// 	- if both are passed, make sure they're matched, otherwise returning empty result
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Order link ID
	// **Remarks**: Always return the latest one if order link id is ever reused when querying by orderLinkId only
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// Product ID
	ProductId string `json:"productId,omitempty" url:"productId,omitempty"`
	// The start timestamp (ms).
	//
	// 	- 1\. If both are not provided, the default is to return data from the last 7 days.
	// 	- 2\. If both are provided, the difference between the endTime and startTime must be less than or equal to 7 days.
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The endTime timestamp (ms)
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Limit for data size per page. Range: \[1, 100\]. Default: 50
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor, use the returned `nextPageCursor` to query data for the next page.
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type EarnPlaceOrderParams

type EarnPlaceOrderParams struct {
	// `FlexibleSaving`,`OnChain`
	// **Remarks**: currently, only flexible savings and on chain is supported
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// `Stake`, `Redeem`
	OrderType OrderType `json:"orderType,omitempty" url:"orderType,omitempty"`
	// `FUND`, `UNIFIED`. Onchain only supports FUND
	AccountType AccountType `json:"accountType,omitempty" url:"accountType,omitempty"`
	// - Stake amount needs to satisfy minStake and maxStake
	// 	- Both stake and redeem amount need to satify precision requirement
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
	// Coin name
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Product ID
	ProductId string `json:"productId,omitempty" url:"productId,omitempty"`
	// Customised order ID, used to prevent from replay
	//
	// 	- support up to 36 characters
	// 	- The same orderLinkId can't be used in 30 mins
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// The position ID that the user needs to redeem. Only is required in Onchain non-LST mode
	RedeemPositionId string `json:"redeemPositionId,omitempty" url:"redeemPositionId,omitempty"`
	// `FUND`, `UNIFIED`. Onchain LST mode supports `FUND` and `UNIFIED`(Private wealth management custodial subaccount only supports `UNIFIED`). Onchain non-LST mode only supports `FUND`
	ToAccountType string `json:"toAccountType,omitempty" url:"toAccountType,omitempty"`
}

type EarnPlaceOrderResult

type EarnPlaceOrderResult struct {
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Order link ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
}

type EarnPosition

type EarnPosition struct {
	// Object
	List []EarnPositionListItem `json:"list,omitempty" url:"list,omitempty"`
}

type EarnPositionListItem

type EarnPositionListItem struct {
	// Coin name
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Product ID
	ProductId string `json:"productId,omitempty" url:"productId,omitempty"`
	// Total staked amount
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
	// Return the profit of the current position. Only has value in Onchain non-LST mode
	TotalPnl string `json:"totalPnl,omitempty" url:"totalPnl,omitempty"`
	// Yield accrues on an hourly basis and is distributed at 00:30 UTC daily. If you unstake your assets before yield distribution, any undistributed yield will be credited to your account along with your principal. Onchain products do not return values
	ClaimableYield string `json:"claimableYield,omitempty" url:"claimableYield,omitempty"`
	// Position Id. Only for Onchain
	Id string `json:"id,omitempty" url:"id,omitempty"`
	// `Processing`,`Active`. Only for Onchain
	Status string `json:"status,omitempty" url:"status,omitempty"`
	// Order Id. Only for Onchain
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Estimate redeem time, in milliseconds. Only for Onchain
	EstimateRedeemTime string `json:"estimateRedeemTime,omitempty" url:"estimateRedeemTime,omitempty"`
	// Estimate stake time, in milliseconds. Only for Onchain
	EstimateStakeTime string `json:"estimateStakeTime,omitempty" url:"estimateStakeTime,omitempty"`
	// Estimated Interest accrual time, in milliseconds. Only for Onchain
	EstimateInterestCalculationTime string `json:"estimateInterestCalculationTime,omitempty" url:"estimateInterestCalculationTime,omitempty"`
	// Settlement time, in milliseconds. Only has value for Onchain `Fixed` product
	SettlementTime string `json:"settlementTime,omitempty" url:"settlementTime,omitempty"`
}

type EarnPositionQuery

type EarnPositionQuery struct {
	// `FlexibleSaving`,`OnChain`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Product ID
	ProductId string `json:"productId,omitempty" url:"productId,omitempty"`
	// Coin name
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
}

type EarnProduct

type EarnProduct struct {
	// Object
	List []EarnProductListItem `json:"list,omitempty" url:"list,omitempty"`
}

type EarnProductListItem

type EarnProductListItem struct {
	// `FlexibleSaving`,`OnChain`
	Category string `json:"category,omitempty" url:"category,omitempty"`
	// Estimated APR, e.g., `3%`, `4.25%`
	// **Remarks**: 1)The Est. APR provides a dynamic preview of your potential returns, updated every 10 minutes in response to market conditions.
	// 2) Please note that this is an estimate and may differ from the actual APR you will receive.
	// 3) Platform Reward APRs are not shown
	EstimateApr string `json:"estimateApr,omitempty" url:"estimateApr,omitempty"`
	// Coin name
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Minimum stake amount
	MinStakeAmount string `json:"minStakeAmount,omitempty" url:"minStakeAmount,omitempty"`
	// Maximum stake amount
	MaxStakeAmount string `json:"maxStakeAmount,omitempty" url:"maxStakeAmount,omitempty"`
	// Amount precision
	Precision string `json:"precision,omitempty" url:"precision,omitempty"`
	// Product ID
	ProductId string `json:"productId,omitempty" url:"productId,omitempty"`
	// `Available`, `NotAvailable`
	Status string `json:"status,omitempty" url:"status,omitempty"`
	// Bonus
	BonusEvents []EarnProductListItemBonusEventsItem `json:"bonusEvents,omitempty" url:"bonusEvents,omitempty"`
	// Minimum redemption amount. Only has value in Onchain LST mode
	MinRedeemAmount string `json:"minRedeemAmount,omitempty" url:"minRedeemAmount,omitempty"`
	// Maximum redemption amount. Only has value in Onchain LST mode
	MaxRedeemAmount string `json:"maxRedeemAmount,omitempty" url:"maxRedeemAmount,omitempty"`
	// `Fixed`,`Flexible`. Product Type
	Duration string `json:"duration,omitempty" url:"duration,omitempty"`
	// Unit: Day. Only when duration = `Fixed` for OnChain
	Term int64 `json:"term,omitempty" url:"term,omitempty"`
	// swap coin. Only has value in Onchain LST mode
	SwapCoin string `json:"swapCoin,omitempty" url:"swapCoin,omitempty"`
	// swap coin precision. Only has value in Onchain LST mode
	SwapCoinPrecision string `json:"swapCoinPrecision,omitempty" url:"swapCoinPrecision,omitempty"`
	// Estimated stake exchange rate. Only has value in Onchain LST mode
	StakeExchangeRate string `json:"stakeExchangeRate,omitempty" url:"stakeExchangeRate,omitempty"`
	// Estimated redeem exchange rate. Only has value in Onchain LST mode
	RedeemExchangeRate string `json:"redeemExchangeRate,omitempty" url:"redeemExchangeRate,omitempty"`
	// `Simple`: Simple interest, `Compound`: Compound interest, `Other`: LST. Only has value for Onchain
	RewardDistributionType string `json:"rewardDistributionType,omitempty" url:"rewardDistributionType,omitempty"`
	// Frequency of reward distribution (minutes)
	RewardIntervalMinute int64 `json:"rewardIntervalMinute,omitempty" url:"rewardIntervalMinute,omitempty"`
	// Estimated redemption minutes
	RedeemProcessingMinute string `json:"redeemProcessingMinute,omitempty" url:"redeemProcessingMinute,omitempty"`
	// Staking on-chain time, in milliseconds
	StakeTime string `json:"stakeTime,omitempty" url:"stakeTime,omitempty"`
	// Interest accrual time, in milliseconds
	InterestCalculationTime string `json:"interestCalculationTime,omitempty" url:"interestCalculationTime,omitempty"`
}

type EarnProductListItemBonusEventsItem

type EarnProductListItemBonusEventsItem struct {
	// Yesterday's Rewards APR
	Apr string `json:"apr,omitempty" url:"apr,omitempty"`
	// Reward coin
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Announcement link
	Announcement string `json:"announcement,omitempty" url:"announcement,omitempty"`
}

type EarnProductQuery

type EarnProductQuery struct {
	// `FlexibleSaving`,`OnChain`
	// **Remarks**: currently, only flexible savings and on chain is supported
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Coin name, uppercase only
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
}

type EarnYield

type EarnYield struct {
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
	// Object
	List []EarnYieldListItem `json:"list,omitempty" url:"list,omitempty"`
}

type EarnYieldListItem

type EarnYieldListItem struct {
	// Product ID
	ProductId string `json:"productId,omitempty" url:"productId,omitempty"`
	// Coin name: "BTC", "ETH"
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Unique key (guaranteed to be unique only under the same user)
	Id string `json:"id,omitempty" url:"id,omitempty"`
	// Yield Amount.Example: 10
	Amount string `json:"amount,omitempty" url:"amount,omitempty"`
	// Yield type: `Normal`, `Bonus` (Flexible saving only supports `Normal`)
	YieldType string `json:"yieldType,omitempty" url:"yieldType,omitempty"`
	// Distribution type: `Auto`, `Manual`, `Reinvest`
	//
	// 	- `Auto`: Automatically distributed daily
	// 	- `Manual`: Distributed when the user redeems
	// 	- `Reinvest`: Reinvestment (not yet available)
	DistributionMode string `json:"distributionMode,omitempty" url:"distributionMode,omitempty"`
	// Effective staking amount, e.g., 1000.00
	EffectiveStakingAmount string `json:"effectiveStakingAmount,omitempty" url:"effectiveStakingAmount,omitempty"`
	// Redemption order UUID ,For `FlexibleSaving`,Only returns order ID if `distribution_mode` is `Manual`
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Order status: `Pending`, `Success`, `Fail`
	Status string `json:"status,omitempty" url:"status,omitempty"`
	// Order creation time in milliseconds, e.g., 1684738540561
	CreatedAt string `json:"createdAt,omitempty" url:"createdAt,omitempty"`
}

type EarnYieldQuery

type EarnYieldQuery struct {
	// `FlexibleSaving`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Product ID
	ProductId string `json:"productId,omitempty" url:"productId,omitempty"`
	// The start timestamp (ms).
	//
	// 	- 1\. If both are not provided, the default is to return data from the last 7 days.
	// 	- 2\. If both are provided, the difference between the endTime and startTime must be less than or equal to 7 days.
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The endTime timestamp (ms)
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Limit for data size per page. Range: \[1, 100\]. Default: 50
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor, use the returned `nextPageCursor` to query data for the next page.
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type Env

type Env string
const (
	Env1 Env = "1"
	Env2 Env = "2"
)

type ExecType

type ExecType string
const (
	ExecTypeTrade        ExecType = "Trade"
	ExecTypeAdlTrade     ExecType = "AdlTrade"
	ExecTypeFunding      ExecType = "Funding"
	ExecTypeBustTrade    ExecType = "BustTrade"
	ExecTypeDelivery     ExecType = "Delivery"
	ExecTypeSettle       ExecType = "Settle"
	ExecTypeBlockTrade   ExecType = "BlockTrade"
	ExecTypeMovePosition ExecType = "MovePosition"
	ExecTypeFutureSpread ExecType = "FutureSpread"
	ExecTypeUnknown      ExecType = "UNKNOWN"
)

type ExecutionList

type ExecutionList struct {
	// Product type
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Object
	List []ExecutionListListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type ExecutionListListItem

type ExecutionListListItem struct {
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customized order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// Side. `Buy`,`Sell`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Order price
	OrderPrice string `json:"orderPrice,omitempty" url:"orderPrice,omitempty"`
	// Order qty
	OrderQty string `json:"orderQty,omitempty" url:"orderQty,omitempty"`
	// The remaining qty not executed
	LeavesQty string `json:"leavesQty,omitempty" url:"leavesQty,omitempty"`
	// Order create type	- Spot does not have this key
	CreateType CreateType `json:"createType,omitempty" url:"createType,omitempty"`
	// Order type. `Market`,`Limit`
	OrderType OrderType `json:"orderType,omitempty" url:"orderType,omitempty"`
	// Stop order type. If the order is not stop order, it either returns `UNKNOWN` or `""`
	StopOrderType StopOrderType `json:"stopOrderType,omitempty" url:"stopOrderType,omitempty"`
	// Executed trading fee. You can get spot fee currency instruction [here](/docs/v5/enum#spot-fee-currency-instruction)
	ExecFee string `json:"execFee,omitempty" url:"execFee,omitempty"`
	// Spot leg transaction fee, only works for execType=`FutureSpread`
	ExecFeeV2 string `json:"execFeeV2,omitempty" url:"execFeeV2,omitempty"`
	// Execution ID
	ExecId string `json:"execId,omitempty" url:"execId,omitempty"`
	// Execution price
	ExecPrice string `json:"execPrice,omitempty" url:"execPrice,omitempty"`
	// Execution qty
	ExecQty string `json:"execQty,omitempty" url:"execQty,omitempty"`
	// Executed type
	ExecType ExecType `json:"execType,omitempty" url:"execType,omitempty"`
	// Executed order value
	ExecValue string `json:"execValue,omitempty" url:"execValue,omitempty"`
	// Executed timestamp (ms)
	ExecTime string `json:"execTime,omitempty" url:"execTime,omitempty"`
	// Trading fee currency
	FeeCurrency string `json:"feeCurrency,omitempty" url:"feeCurrency,omitempty"`
	// Is maker order. `true`: maker, `false`: taker
	IsMaker bool `json:"isMaker,omitempty" url:"isMaker,omitempty"`
	// Trading fee rate
	FeeRate string `json:"feeRate,omitempty" url:"feeRate,omitempty"`
	// Implied volatility. _Valid for `option`_
	TradeIv string `json:"tradeIv,omitempty" url:"tradeIv,omitempty"`
	// Implied volatility of mark price. _Valid for `option`_
	MarkIv string `json:"markIv,omitempty" url:"markIv,omitempty"`
	// The mark price of the symbol when executing
	MarkPrice string `json:"markPrice,omitempty" url:"markPrice,omitempty"`
	// The index price of the symbol when executing. _Valid for `option` only_
	IndexPrice string `json:"indexPrice,omitempty" url:"indexPrice,omitempty"`
	// The underlying price of the symbol when executing. _Valid for `option`_
	UnderlyingPrice string `json:"underlyingPrice,omitempty" url:"underlyingPrice,omitempty"`
	// Paradigm block trade ID
	BlockTradeId string `json:"blockTradeId,omitempty" url:"blockTradeId,omitempty"`
	// Closed position size
	ClosedSize string `json:"closedSize,omitempty" url:"closedSize,omitempty"`
	// Cross sequence, used to associate each fill and each position update
	//
	// 	- The seq will be the same when conclude multiple transactions at the same time
	// 	- Different symbols may have the same seq, please use seq + symbol to check unique
	Seq int64 `json:"seq,omitempty" url:"seq,omitempty"`
	// Trading fee rate information. Currently, this data is returned only for kyc=Indian user or spot orders placed on the Indonesian site or spot fiat currency orders placed on the EU site. In other cases, an empty string is returned. Enum: [feeType](/docs/v5/enum#extrafeesfeetype), [subFeeType](/docs/v5/enum#extrafeessubfeetype)
	ExtraFees string `json:"extraFees,omitempty" url:"extraFees,omitempty"`
}

type ExecutionListQuery

type ExecutionListQuery struct {
	// Product type `linear`, `inverse`, `spot`, `option`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// Base coin, uppercase only. For type `option`, default value is BTC
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
	// Settle coin, uppercase only. Only for `linear`, `inverse`,`option`
	SettleCoin string `json:"settleCoin,omitempty" url:"settleCoin,omitempty"`
	// The start timestamp (ms)
	//
	// 	- startTime and endTime are not passed, return 7 days by default
	// 	- Only startTime is passed, return range between startTime and startTime+7 days
	// 	- Only endTime is passed, return range between endTime-7 days and endTime
	// If both are passed, the rule is endTime - startTime <= 7 days
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms)
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Execution type
	ExecType ExecType `json:"execType,omitempty" url:"execType,omitempty"`
	// Limit for data size per page. \[`1`, `100`\]. Default: `50`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type ExtraFeesFeeType

type ExtraFeesFeeType string
const (
	ExtraFeesFeeTypeUnknown ExtraFeesFeeType = "UNKNOWN"
	ExtraFeesFeeTypeTax     ExtraFeesFeeType = "TAX"
	ExtraFeesFeeTypeCfx     ExtraFeesFeeType = "CFX"
	ExtraFeesFeeTypeWht     ExtraFeesFeeType = "WHT"
	ExtraFeesFeeTypeGst     ExtraFeesFeeType = "GST"
	ExtraFeesFeeTypeVat     ExtraFeesFeeType = "VAT"
)

type ExtraFeesSubFeeType

type ExtraFeesSubFeeType string
const (
	ExtraFeesSubFeeTypeUnknown           ExtraFeesSubFeeType = "UNKNOWN"
	ExtraFeesSubFeeTypeTaxPnn            ExtraFeesSubFeeType = "TAX_PNN"
	ExtraFeesSubFeeTypeTaxPph            ExtraFeesSubFeeType = "TAX_PPH"
	ExtraFeesSubFeeTypeCfxFiee           ExtraFeesSubFeeType = "CFX_FIEE"
	ExtraFeesSubFeeTypeAutWithholdingTax ExtraFeesSubFeeType = "AUT_WITHHOLDING_TAX"
	ExtraFeesSubFeeTypeIndGst            ExtraFeesSubFeeType = "IND_GST"
	ExtraFeesSubFeeTypeAreVat            ExtraFeesSubFeeType = "ARE_VAT"
)

type FiatBalanceQuery

type FiatBalanceQuery struct {
	// Total balance
	TotalBalance string `json:"totalBalance,omitempty" url:"totalBalance,omitempty"`
	// Available balance
	Balance string `json:"balance,omitempty" url:"balance,omitempty"`
	// Frozen balance
	FrozenBalance string `json:"frozenBalance,omitempty" url:"frozenBalance,omitempty"`
	// Currency
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
}

type FiatBalanceQueryQuery

type FiatBalanceQueryQuery struct {
	// `Fiat`: fiat currency code (ISO 4217) etc: KZT. not set will query all fiat balance list
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
}

type FiatQueryCoinList

type FiatQueryCoinList struct {
	// Fiat coin list
	Fiats []FiatQueryCoinListFiatsItem `json:"fiats,omitempty" url:"fiats,omitempty"`
	// Crypto coin list
	Cryptos []FiatQueryCoinListCryptosItem `json:"cryptos,omitempty" url:"cryptos,omitempty"`
}

type FiatQueryCoinListCryptosItem

type FiatQueryCoinListCryptosItem struct {
	// Fiat coin code
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Fiat full coin name
	FullName string `json:"fullName,omitempty" url:"fullName,omitempty"`
	// Coin icon url
	Icon string `json:"icon,omitempty" url:"icon,omitempty"`
	// Coin icon url (dark mode)
	IconNight string `json:"iconNight,omitempty" url:"iconNight,omitempty"`
	// Fiat precision
	Precision int64 `json:"precision,omitempty" url:"precision,omitempty"`
	// `true`: the coin is disabled, `false`: the coin is allowed
	Disable bool `json:"disable,omitempty" url:"disable,omitempty"`
	// For sell side, the minimum amount of cryptoCoin per transaction
	SingleFromMinLimit string `json:"singleFromMinLimit,omitempty" url:"singleFromMinLimit,omitempty"`
	// For sell side, the maximum amount of cryptoCoin per transaction
	SingleFromMaxLimit string `json:"singleFromMaxLimit,omitempty" url:"singleFromMaxLimit,omitempty"`
}

type FiatQueryCoinListFiatsItem

type FiatQueryCoinListFiatsItem struct {
	// Fiat coin code
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Fiat full coin name
	FullName string `json:"fullName,omitempty" url:"fullName,omitempty"`
	// Coin icon url
	Icon string `json:"icon,omitempty" url:"icon,omitempty"`
	// Coin icon url (dark mode)
	IconNight string `json:"iconNight,omitempty" url:"iconNight,omitempty"`
	// Fiat precision
	Precision int64 `json:"precision,omitempty" url:"precision,omitempty"`
	// `true`: the coin is disabled, `false`: the coin is allowed
	Disable bool `json:"disable,omitempty" url:"disable,omitempty"`
	// For buy side, the minimum amount of fiatCoin per transaction
	SingleFromMinLimit string `json:"singleFromMinLimit,omitempty" url:"singleFromMinLimit,omitempty"`
	// For buy side, the maximum amount of fiatCoin per transaction
	SingleFromMaxLimit string `json:"singleFromMaxLimit,omitempty" url:"singleFromMaxLimit,omitempty"`
}

type FiatQueryCoinListQuery

type FiatQueryCoinListQuery struct {
	// `0`: buy, buy crypto sell fiat; `1`: sell, sell crypto buy fiat
	Side int64 `json:"side,omitempty" url:"side,omitempty"`
}

type FiatQueryTradeHistory

type FiatQueryTradeHistory struct {
	// Trade order No
	TradeNo string `json:"tradeNo,omitempty" url:"tradeNo,omitempty"`
	// Trade status:
	//
	// 	- processing
	// 	- success
	// 	- failed
	Status string `json:"status,omitempty" url:"status,omitempty"`
	// Quote transaction ID. It is system generated, and it is used to confirm quote
	QuoteTxId string `json:"quoteTxId,omitempty" url:"quoteTxId,omitempty"`
	// Exchange rate
	ExchangeRate string `json:"exchangeRate,omitempty" url:"exchangeRate,omitempty"`
	// Convert from coin (coin to sell)
	FromCoin string `json:"fromCoin,omitempty" url:"fromCoin,omitempty"`
	// From coin type. `fiat` or `crypto`
	FromCoinType string `json:"fromCoinType,omitempty" url:"fromCoinType,omitempty"`
	// Convert to coin (coin to buy)
	ToCoin string `json:"toCoin,omitempty" url:"toCoin,omitempty"`
	// To coin type. `fiat` or `crypto`
	ToCoinType string `json:"toCoinType,omitempty" url:"toCoinType,omitempty"`
	// From coin amount (amount to sell)
	FromAmount string `json:"fromAmount,omitempty" url:"fromAmount,omitempty"`
	// To coin amount (amount to buy according to exchange rate)
	ToAmount string `json:"toAmount,omitempty" url:"toAmount,omitempty"`
	// Trade created timee (Millisecond timestamp)
	CreatedAt string `json:"createdAt,omitempty" url:"createdAt,omitempty"`
	// The user's sub userId in bybit
	SubUserId string `json:"subUserId,omitempty" url:"subUserId,omitempty"`
}

type FiatQueryTradeHistoryQuery

type FiatQueryTradeHistoryQuery struct {
	// Page number,started from 1, default 1
	Index int64 `json:"index,omitempty" url:"index,omitempty"`
	// Page Size \[20-100\] 20 records by default,up to 100 records, return 100 when exceeds 100
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Query start time(Millisecond timestamp)
	StartTime string `json:"startTime,omitempty" url:"startTime,omitempty"`
	// Query end time(Millisecond timestamp)
	EndTime string `json:"endTime,omitempty" url:"endTime,omitempty"`
}

type FiatQuoteApplyParams

type FiatQuoteApplyParams struct {
	// Convert from coin (coin to sell)
	FromCoin string `json:"fromCoin,omitempty" url:"fromCoin,omitempty"`
	// `fiat` or `crypto`
	FromCoinType string `json:"fromCoinType,omitempty" url:"fromCoinType,omitempty"`
	// Convert to coin (coin to buy)
	ToCoin string `json:"toCoin,omitempty" url:"toCoin,omitempty"`
	// `fiat` or `crypto`
	ToCoinType string `json:"toCoinType,omitempty" url:"toCoinType,omitempty"`
	// request coin amount (the amount you want to sell)
	RequestAmount string `json:"requestAmount,omitempty" url:"requestAmount,omitempty"`
	// coinType you want to sell, `fiat` or `crypto`, default to `fiat`
	RequestCoinType string `json:"requestCoinType,omitempty" url:"requestCoinType,omitempty"`
}

type FiatQuoteApplyResult

type FiatQuoteApplyResult struct {
	// Quote transaction ID. It is system generated, and it is used to confirm quote
	QuoteTxId string `json:"quoteTxId,omitempty" url:"quoteTxId,omitempty"`
	// Exchange rate
	ExchangeRate string `json:"exchangeRate,omitempty" url:"exchangeRate,omitempty"`
	// Convert from coin (coin to sell)
	FromCoin string `json:"fromCoin,omitempty" url:"fromCoin,omitempty"`
	// From coin type. `fiat` or `crypto`
	FromCoinType string `json:"fromCoinType,omitempty" url:"fromCoinType,omitempty"`
	// Convert to coin (coin to buy)
	ToCoin string `json:"toCoin,omitempty" url:"toCoin,omitempty"`
	// To coin type. `fiat` or `crypto`
	ToCoinType string `json:"toCoinType,omitempty" url:"toCoinType,omitempty"`
	// From coin amount (amount to sell)
	FromAmount string `json:"fromAmount,omitempty" url:"fromAmount,omitempty"`
	// To coin amount (amount to buy according to exchange rate)
	ToAmount string `json:"toAmount,omitempty" url:"toAmount,omitempty"`
	// The expiry time for this quote (milliseconds)
	ExpiredTime string `json:"expiredTime,omitempty" url:"expiredTime,omitempty"`
}

type FiatReferencePrice

type FiatReferencePrice struct {
	// Trading pair symbol
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Fiat currency of the trading pair (e.g: "EUR")
	Fiat string `json:"fiat,omitempty" url:"fiat,omitempty"`
	// Cryptocurrency of the trading pair (e.g:"USDT")
	Crypto string `json:"crypto,omitempty" url:"crypto,omitempty"`
	// Unix timestamp
	Timestamp string `json:"timestamp,omitempty" url:"timestamp,omitempty"`
	// Array of buy quote objects
	Buys []FiatReferencePriceBuysItem `json:"buys,omitempty" url:"buys,omitempty"`
	// Array of sell quote objects
	Sells []FiatReferencePriceSellsItem `json:"sells,omitempty" url:"sells,omitempty"`
}

type FiatReferencePriceBuysItem

type FiatReferencePriceBuysItem struct {
	// unitPrice: 1 crypto=x fiat
	UnitPrice string `json:"unitPrice,omitempty" url:"unitPrice,omitempty"`
	// From coin type. `fiat` or `crypto`
	PaymentMethod string `json:"paymentMethod,omitempty" url:"paymentMethod,omitempty"`
}

type FiatReferencePriceQuery

type FiatReferencePriceQuery struct {
	// Coin Pair, such as EUR-USDT
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
}

type FiatReferencePriceSellsItem

type FiatReferencePriceSellsItem struct {
	// unitPrice: 1 crypto=x fiat
	UnitPrice string `json:"unitPrice,omitempty" url:"unitPrice,omitempty"`
	// From coin type. `fiat` or `crypto`
	PaymentMethod string `json:"paymentMethod,omitempty" url:"paymentMethod,omitempty"`
}

type FiatTradeExecuteParams

type FiatTradeExecuteParams struct {
	// The quote tx ID from [Request a Quote](/docs/v5/asset/fiat-convert/quote-apply#response-parameters)
	QuoteTxId string `json:"quoteTxId,omitempty" url:"quoteTxId,omitempty"`
	// The user's sub userId in bybit
	SubUserId string `json:"subUserId,omitempty" url:"subUserId,omitempty"`
	// API URL to call when order is successful or failed (max 256 characters)
	WebhookUrl string `json:"webhookUrl,omitempty" url:"webhookUrl,omitempty"`
	// Customised request ID(maximum length of 36)
	//
	// 	- Generally it is useless, but it is convenient to track the quote request internally if you fill this field
	MerchantRequestId string `json:"MerchantRequestId,omitempty" url:"MerchantRequestId,omitempty"`
}

type FiatTradeExecuteResult

type FiatTradeExecuteResult struct {
	// Trade order No
	TradeNo string `json:"tradeNo,omitempty" url:"tradeNo,omitempty"`
	// Customised request ID
	MerchantRequestId string `json:"merchantRequestId,omitempty" url:"merchantRequestId,omitempty"`
}

type FiatTradeQuery

type FiatTradeQuery struct {
	// Trade order No
	TradeNo string `json:"tradeNo,omitempty" url:"tradeNo,omitempty"`
	// Trade status:
	//
	// 	- processing
	// 	- success
	// 	- failed
	Status string `json:"status,omitempty" url:"status,omitempty"`
	// Quote transaction ID. It is system generated, and it is used to confirm quote
	QuoteTxId string `json:"quoteTxId,omitempty" url:"quoteTxId,omitempty"`
	// Exchange rate
	ExchangeRate string `json:"exchangeRate,omitempty" url:"exchangeRate,omitempty"`
	// Convert from coin (coin to sell)
	FromCoin string `json:"fromCoin,omitempty" url:"fromCoin,omitempty"`
	// From coin type. `fiat` or `crypto`
	FromCoinType string `json:"fromCoinType,omitempty" url:"fromCoinType,omitempty"`
	// Convert to coin (coin to buy)
	ToCoin string `json:"toCoin,omitempty" url:"toCoin,omitempty"`
	// To coin type. `fiat` or `crypto`
	ToCoinType string `json:"toCoinType,omitempty" url:"toCoinType,omitempty"`
	// From coin amount (amount to sell)
	FromAmount string `json:"fromAmount,omitempty" url:"fromAmount,omitempty"`
	// To coin amount (amount to buy according to exchange rate)
	ToAmount string `json:"toAmount,omitempty" url:"toAmount,omitempty"`
	// Trade created time
	CreatedAt string `json:"createdAt,omitempty" url:"createdAt,omitempty"`
	// The user's sub userId in bybit
	SubUserId string `json:"subUserId,omitempty" url:"subUserId,omitempty"`
}

type FiatTradeQueryQuery

type FiatTradeQueryQuery struct {
	// Trade order No,tradeNo or merchantRequestId must be provided
	TradeNo string `json:"tradeNo,omitempty" url:"tradeNo,omitempty"`
	// Customised request ID,tradeNo or merchantRequestId must be provided
	MerchantRequestId string `json:"merchantRequestId,omitempty" url:"merchantRequestId,omitempty"`
}

type GroupId

type GroupId string
const (
	GroupId1 GroupId = "1"
	GroupId2 GroupId = "2"
	GroupId3 GroupId = "3"
	GroupId4 GroupId = "4"
	GroupId5 GroupId = "5"
	GroupId6 GroupId = "6"
	GroupId7 GroupId = "7"
	GroupId8 GroupId = "8"
)

type GroupName

type GroupName string
const (
	GroupNameG1MajorCoins        GroupName = "G1(Major Coins)"
	GroupNameG2HighGrowth        GroupName = "G2(High Growth)"
	GroupNameG3MidTierLiquidity  GroupName = "G3(Mid-Tier Liquidity)"
	GroupNameG4MidTierActivation GroupName = "G4(Mid-Tier Activation)"
	GroupNameG5LongTail          GroupName = "G5(Long Tail)"
	GroupNameInnovationZone      GroupName = "Innovation-Zone"
	GroupNamePreListing          GroupName = "Pre-listing"
	GroupNameUsdc                GroupName = "USDC"
)

type InsLoanAssociationUidParams

type InsLoanAssociationUidParams struct {
	// UID
	//
	// 	- **Bind**
	// a) the key used must be from one of UIDs in the risk unit;
	// b) input UID must not have an INS loan
	// 	- **Unbind**
	// a) the key used must be from one of UIDs in the risk unit;
	// b) input UID cannot be the same as the UID used to access the API
	Uid string `json:"uid,omitempty" url:"uid,omitempty"`
	// `0`: bind, `1`: unbind
	Operate string `json:"operate,omitempty" url:"operate,omitempty"`
}

type InsLoanAssociationUidResult

type InsLoanAssociationUidResult struct {
	// UID
	Uid string `json:"uid,omitempty" url:"uid,omitempty"`
	// `0`: bind, `1`: unbind
	Operate string `json:"operate,omitempty" url:"operate,omitempty"`
}

type InsLoanEnsureTokensConvert

type InsLoanEnsureTokensConvert struct {
	// Object
	MarginToken []InsLoanEnsureTokensConvertMarginTokenItem `json:"marginToken,omitempty" url:"marginToken,omitempty"`
}

type InsLoanEnsureTokensConvertMarginTokenItem

type InsLoanEnsureTokensConvertMarginTokenItem struct {
	// Product Id
	ProductId string `json:"productId,omitempty" url:"productId,omitempty"`
	// Spot margin coin
	TokenInfo []InsLoanEnsureTokensConvertMarginTokenItemTokenInfoItem `json:"tokenInfo,omitempty" url:"tokenInfo,omitempty"`
}

type InsLoanEnsureTokensConvertMarginTokenItemTokenInfoItem

type InsLoanEnsureTokensConvertMarginTokenItemTokenInfoItem struct {
	// Margin coin
	Token string `json:"token,omitempty" url:"token,omitempty"`
	// Margin coin convert ratio List
	ConvertRatioList []InsLoanEnsureTokensConvertMarginTokenItemTokenInfoItemConvertRatioListItem `json:"convertRatioList,omitempty" url:"convertRatioList,omitempty"`
}

type InsLoanEnsureTokensConvertMarginTokenItemTokenInfoItemConvertRatioListItem

type InsLoanEnsureTokensConvertMarginTokenItemTokenInfoItemConvertRatioListItem struct {
	// ladder
	Ladder string `json:"ladder,omitempty" url:"ladder,omitempty"`
	// Margin coin convert ratio
	ConvertRatio string `json:"convertRatio,omitempty" url:"convertRatio,omitempty"`
}

type InsLoanEnsureTokensConvertQuery

type InsLoanEnsureTokensConvertQuery struct {
	// Product ID. If not passed, returns all margin products. For spot, it returns coins with a `convertRatio` greater than 0.
	ProductId string `json:"productId,omitempty" url:"productId,omitempty"`
}

type InsLoanLoanOrder

type InsLoanLoanOrder struct {
	// Object
	LoanInfo []InsLoanLoanOrderLoanInfoItem `json:"loanInfo,omitempty" url:"loanInfo,omitempty"`
}

type InsLoanLoanOrderLoanInfoItem

type InsLoanLoanOrderLoanInfoItem struct {
	// Loan order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Product ID
	OrderProductId string `json:"orderProductId,omitempty" url:"orderProductId,omitempty"`
	// The designated UID that was used to bind with the INS loan
	ParentUid string `json:"parentUid,omitempty" url:"parentUid,omitempty"`
	// Loan timestamp, in milliseconds
	LoanTime string `json:"loanTime,omitempty" url:"loanTime,omitempty"`
	// Loan coin
	LoanCoin string `json:"loanCoin,omitempty" url:"loanCoin,omitempty"`
	// Loan amount
	LoanAmount string `json:"loanAmount,omitempty" url:"loanAmount,omitempty"`
	// Unpaid principal
	UnpaidAmount string `json:"unpaidAmount,omitempty" url:"unpaidAmount,omitempty"`
	// Unpaid interest
	UnpaidInterest string `json:"unpaidInterest,omitempty" url:"unpaidInterest,omitempty"`
	// Repaid principal
	RepaidAmount string `json:"repaidAmount,omitempty" url:"repaidAmount,omitempty"`
	// Repaid interest
	RepaidInterest string `json:"repaidInterest,omitempty" url:"repaidInterest,omitempty"`
	// Daily interest rate
	InterestRate string `json:"interestRate,omitempty" url:"interestRate,omitempty"`
	// `1`: outstanding; `2`: paid off
	Status string `json:"status,omitempty" url:"status,omitempty"`
	// The maximum leverage for this loan product
	Leverage string `json:"leverage,omitempty" url:"leverage,omitempty"`
	// Whether to support spot. `0`:false; `1`:true
	SupportSpot string `json:"supportSpot,omitempty" url:"supportSpot,omitempty"`
	// Whether to support contract . `0`:false; `1`:true
	SupportContract string `json:"supportContract,omitempty" url:"supportContract,omitempty"`
	// Restrict line for withdrawal
	WithdrawLine string `json:"withdrawLine,omitempty" url:"withdrawLine,omitempty"`
	// Restrict line for transfer
	TransferLine string `json:"transferLine,omitempty" url:"transferLine,omitempty"`
	// Restrict line for SPOT buy
	SpotBuyLine string `json:"spotBuyLine,omitempty" url:"spotBuyLine,omitempty"`
	// Restrict line for SPOT sell
	SpotSellLine string `json:"spotSellLine,omitempty" url:"spotSellLine,omitempty"`
	// Restrict line for USDT Perpetual open position
	ContractOpenLine string `json:"contractOpenLine,omitempty" url:"contractOpenLine,omitempty"`
	// Line for deferred liquidation
	DeferredLiquidationLine string `json:"deferredLiquidationLine,omitempty" url:"deferredLiquidationLine,omitempty"`
	// Time for deferred liquidation
	DeferredLiquidationTime string `json:"deferredLiquidationTime,omitempty" url:"deferredLiquidationTime,omitempty"`
	// Reserve token
	ReserveToken string `json:"reserveToken,omitempty" url:"reserveToken,omitempty"`
	// Reserve token qty
	ReserveQuantity string `json:"reserveQuantity,omitempty" url:"reserveQuantity,omitempty"`
	// Line for liquidation
	LiquidationLine string `json:"liquidationLine,omitempty" url:"liquidationLine,omitempty"`
	// Line for stop liquidation
	StopLiquidationLine string `json:"stopLiquidationLine,omitempty" url:"stopLiquidationLine,omitempty"`
	// The allowed default leverage for USDT Perpetual
	ContractLeverage string `json:"contractLeverage,omitempty" url:"contractLeverage,omitempty"`
	// The transfer ratio for loan funds to transfer from Spot wallet to Contract wallet
	TransferRatio string `json:"transferRatio,omitempty" url:"transferRatio,omitempty"`
	// The whitelist of spot trading pairs. If there is no whitelist, then "\[\]"
	SpotSymbols []string `json:"spotSymbols,omitempty" url:"spotSymbols,omitempty"`
	// The whitelist of contract trading pairs
	//
	// 	- If `supportContract`\="0", then this is "\[\]"
	// 	- If there is no whitelist, this is "\[\]"
	ContractSymbols []string `json:"contractSymbols,omitempty" url:"contractSymbols,omitempty"`
	// Whether to support USDC contract. `"0"`:false; `"1"`:true
	SupportUsdcContract string `json:"supportUSDCContract,omitempty" url:"supportUSDCContract,omitempty"`
	// Whether to support Option. `"0"`:false; `"1"`:true
	SupportUsdcOptions string `json:"supportUSDCOptions,omitempty" url:"supportUSDCOptions,omitempty"`
	// Whether to support Spot margin trading. `"0"`:false; `"1"`:true
	SupportMarginTrading string `json:"supportMarginTrading,omitempty" url:"supportMarginTrading,omitempty"`
	// Restrict line to open USDT Perpetual position
	UsdtPerpetualOpenLine string `json:"USDTPerpetualOpenLine,omitempty" url:"USDTPerpetualOpenLine,omitempty"`
	// Restrict line to open USDC Contract position
	UsdcContractOpenLine []string `json:"USDCContractOpenLine,omitempty" url:"USDCContractOpenLine,omitempty"`
	// Restrict line to open Option position
	UsdcOptionsOpenLine string `json:"USDCOptionsOpenLine,omitempty" url:"USDCOptionsOpenLine,omitempty"`
	// Restrict line to trade USDT Perpetual position
	UsdtPerpetualCloseLine string `json:"USDTPerpetualCloseLine,omitempty" url:"USDTPerpetualCloseLine,omitempty"`
	// Restrict line to trade USDC Contract position
	UsdcContractCloseLine []string `json:"USDCContractCloseLine,omitempty" url:"USDCContractCloseLine,omitempty"`
	// Restrict line to trade Option position
	UsdcOptionsCloseLine string `json:"USDCOptionsCloseLine,omitempty" url:"USDCOptionsCloseLine,omitempty"`
	// The whitelist of USDC contract trading pairs
	//
	// 	- If no whitelist symbols, it is `[]`, and you can trade any
	// 	- If supportUSDCContract="0", it is `[]`
	UsdcContractSymbols []string `json:"USDCContractSymbols,omitempty" url:"USDCContractSymbols,omitempty"`
	// The whitelist of Option symbols
	//
	// 	- If no whitelisted, it is `[]`, and you can trade any
	// 	- If supportUSDCOptions="0", it is `[]`
	UsdcOptionsSymbols []string `json:"USDCOptionsSymbols,omitempty" url:"USDCOptionsSymbols,omitempty"`
	// The allowable maximum leverage for Spot margin
	MarginLeverage string `json:"marginLeverage,omitempty" url:"marginLeverage,omitempty"`
	// Object
	//
	// 	- If supportContract="0", it is `[]`
	// 	- If no whitelist USDT perp symbols, it returns all trading symbols and leverage by default
	// 	- If there are whitelist symbols, it return those whitelist data
	UsdtPerpetualLeverage []InsLoanLoanOrderLoanInfoItemUsdtPerpetualLeverageItem `json:"USDTPerpetualLeverage,omitempty" url:"USDTPerpetualLeverage,omitempty"`
	// Object
	//
	// 	- If supportUSDCContract="0", it is `[]`
	// 	- If no whitelist USDC contract symbols, it returns all trading symbols and leverage by default
	// 	- If there are whitelist symbols, it return those whitelist data
	UsdcContractLeverage []InsLoanLoanOrderLoanInfoItemUsdcContractLeverageItem `json:"USDCContractLeverage,omitempty" url:"USDCContractLeverage,omitempty"`
}

type InsLoanLoanOrderLoanInfoItemUsdcContractLeverageItem

type InsLoanLoanOrderLoanInfoItemUsdcContractLeverageItem struct {
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Maximum leverage
	Leverage string `json:"leverage,omitempty" url:"leverage,omitempty"`
}

type InsLoanLoanOrderLoanInfoItemUsdtPerpetualLeverageItem

type InsLoanLoanOrderLoanInfoItemUsdtPerpetualLeverageItem struct {
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Maximum leverage
	Leverage string `json:"leverage,omitempty" url:"leverage,omitempty"`
}

type InsLoanLoanOrderQuery

type InsLoanLoanOrderQuery struct {
	// Loan order ID. If not passed, returns all orders sorted by `loanTime` in descending order
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// The start timestamp (ms)
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms)
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Limit for data size. \[`1`, `100`\], Default: `10`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
}

type InsLoanLtvConvert

type InsLoanLtvConvert struct {
	// Object
	LtvInfo []InsLoanLtvConvertLtvInfoItem `json:"ltvInfo,omitempty" url:"ltvInfo,omitempty"`
	// Liquidation status.
	//
	// 	- `0`: Normal
	// 	- `1`: Under liquidation
	// 	- `2`: Manual repayment in progress
	// 	- `3`: Transfer in progress
	LiqStatus int64 `json:"liqStatus,omitempty" url:"liqStatus,omitempty"`
}

type InsLoanLtvConvertLtvInfoItem

type InsLoanLtvConvertLtvInfoItem struct {
	// Risk rate
	//
	// 	- ltv is calculated in real time
	// 	- If you have an INS loan, it is highly recommended to query this data every second. Liquidation occurs when it reachs 0.9 (90%)
	//
	// . When `liqStatus` != 0, empty string is returned.
	Ltv string `json:"ltv,omitempty" url:"ltv,omitempty"`
	// Remaining liquidation time (UTC time in seconds). When it is not triggered, it is displayed as an empty string. When `liqStatus` != 0, empty string is returned.
	Rst string `json:"rst,omitempty" url:"rst,omitempty"`
	// The designated Risk Unit ID that was used to bind with the INS loan
	ParentUid string `json:"parentUid,omitempty" url:"parentUid,omitempty"`
	// Bound user ID
	SubAccountUids []string `json:"subAccountUids,omitempty" url:"subAccountUids,omitempty"`
	// Total debt(USDT). When `liqStatus` != 0, empty string is returned.
	UnpaidAmount string `json:"unpaidAmount,omitempty" url:"unpaidAmount,omitempty"`
	// Debt details. When `liqStatus` != 0, empty array is returned.
	UnpaidInfo []InsLoanLtvConvertLtvInfoItemUnpaidInfoItem `json:"unpaidInfo,omitempty" url:"unpaidInfo,omitempty"`
	// Total asset (margin coins converted to USDT). Please read [here](https://www.bybit.com/en-US/help-center/s/article/Over-the-counter-OTC-Lending) to understand the calculation. When `liqStatus` != 0, empty string is returned.
	Balance string `json:"balance,omitempty" url:"balance,omitempty"`
	// Asset details. When `liqStatus` != 0, empty array is returned.
	BalanceInfo []InsLoanLtvConvertLtvInfoItemBalanceInfoItem `json:"balanceInfo,omitempty" url:"balanceInfo,omitempty"`
	// Liquidation status.
	//
	// 	- `0`: Normal
	// 	- `1`: Under liquidation
	// 	- `2`: Manual repayment in progress
	// 	- `3`: Transfer in progress
	LiqStatus int64 `json:"liqStatus,omitempty" url:"liqStatus,omitempty"`
}

type InsLoanLtvConvertLtvInfoItemBalanceInfoItem

type InsLoanLtvConvertLtvInfoItemBalanceInfoItem struct {
	// Margin coin
	Token string `json:"token,omitempty" url:"token,omitempty"`
	// Margin coin price
	Price string `json:"price,omitempty" url:"price,omitempty"`
	// Margin coin quantity
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
	// Margin conversion amount
	ConvertedAmount string `json:"convertedAmount,omitempty" url:"convertedAmount,omitempty"`
}

type InsLoanLtvConvertLtvInfoItemUnpaidInfoItem

type InsLoanLtvConvertLtvInfoItemUnpaidInfoItem struct {
	// coin
	Token string `json:"token,omitempty" url:"token,omitempty"`
	// Unpaid principle
	UnpaidQty string `json:"unpaidQty,omitempty" url:"unpaidQty,omitempty"`
	// Useless field, please ignore this for now
	UnpaidInterest string `json:"unpaidInterest,omitempty" url:"unpaidInterest,omitempty"`
}

type InsLoanProductInfos

type InsLoanProductInfos struct {
	// Object
	MarginProductInfo []InsLoanProductInfosMarginProductInfoItem `json:"marginProductInfo,omitempty" url:"marginProductInfo,omitempty"`
}

type InsLoanProductInfosMarginProductInfoItem

type InsLoanProductInfosMarginProductInfoItem struct {
	// Product ID
	ProductId string `json:"productId,omitempty" url:"productId,omitempty"`
	// The maximum leverage for this loan product
	Leverage string `json:"leverage,omitempty" url:"leverage,omitempty"`
	// Whether or not Spot is supported. 0:false; 1:true
	SupportSpot int64 `json:"supportSpot,omitempty" url:"supportSpot,omitempty"`
	// Whether USDT Perpetuals are supported. 0:false; 1:true
	SupportContract int64 `json:"supportContract,omitempty" url:"supportContract,omitempty"`
	// Whether or not Spot margin trading is supported. 0:false; 1:true
	SupportMarginTrading int64 `json:"supportMarginTrading,omitempty" url:"supportMarginTrading,omitempty"`
	// Line for deferred liquidation
	DeferredLiquidationLine string `json:"deferredLiquidationLine,omitempty" url:"deferredLiquidationLine,omitempty"`
	// Time for deferred liquidation
	DeferredLiquidationTime string `json:"deferredLiquidationTime,omitempty" url:"deferredLiquidationTime,omitempty"`
	// Restrict line for withdrawal
	WithdrawLine string `json:"withdrawLine,omitempty" url:"withdrawLine,omitempty"`
	// Restrict line for transfer
	TransferLine string `json:"transferLine,omitempty" url:"transferLine,omitempty"`
	// Restrict line for Spot buy
	SpotBuyLine string `json:"spotBuyLine,omitempty" url:"spotBuyLine,omitempty"`
	// Restrict line for Spot trading
	SpotSellLine string `json:"spotSellLine,omitempty" url:"spotSellLine,omitempty"`
	// Restrict line for USDT Perpetual open position
	ContractOpenLine string `json:"contractOpenLine,omitempty" url:"contractOpenLine,omitempty"`
	// Line for liquidation
	LiquidationLine string `json:"liquidationLine,omitempty" url:"liquidationLine,omitempty"`
	// Line for stop liquidation
	StopLiquidationLine string `json:"stopLiquidationLine,omitempty" url:"stopLiquidationLine,omitempty"`
	// The allowed default leverage for USDT Perpetual
	ContractLeverage string `json:"contractLeverage,omitempty" url:"contractLeverage,omitempty"`
	// The transfer ratio for loan funds to transfer from Spot wallet to Contract wallet
	TransferRatio string `json:"transferRatio,omitempty" url:"transferRatio,omitempty"`
	// The whitelist of spot trading pairs
	//
	// 	- If `supportSpot`\="0", then it returns "\[\]"
	// 	- If empty array, then you can trade any symbols
	// 	- If not empty, then you can only trade listed symbols
	SpotSymbols []string `json:"spotSymbols,omitempty" url:"spotSymbols,omitempty"`
	// The whitelist of contract trading pairs
	//
	// 	- If `supportContract`\="0", then it returns "\[\]"
	// 	- If empty array, then you can trade any symbols
	// 	- If not empty, then you can only trade listed symbols
	ContractSymbols []string `json:"contractSymbols,omitempty" url:"contractSymbols,omitempty"`
	// Whether or not USDC contracts are supported. `'0'`:false; `'1'`:true
	SupportUsdcContract int64 `json:"supportUSDCContract,omitempty" url:"supportUSDCContract,omitempty"`
	// Whether or not Options are supported. `'0'`:false; `'1'`:true
	SupportUsdcOptions int64 `json:"supportUSDCOptions,omitempty" url:"supportUSDCOptions,omitempty"`
	// Restrict line to open USDT Perpetual position
	UsdtPerpetualOpenLine string `json:"USDTPerpetualOpenLine,omitempty" url:"USDTPerpetualOpenLine,omitempty"`
	// Restrict line to open USDC Contract position
	UsdcContractOpenLine []string `json:"USDCContractOpenLine,omitempty" url:"USDCContractOpenLine,omitempty"`
	// Restrict line to open Option position
	UsdcOptionsOpenLine string `json:"USDCOptionsOpenLine,omitempty" url:"USDCOptionsOpenLine,omitempty"`
	// Restrict line to trade USDT Perpetual
	UsdtPerpetualCloseLine string `json:"USDTPerpetualCloseLine,omitempty" url:"USDTPerpetualCloseLine,omitempty"`
	// Restrict line to trade USDC Contract
	UsdcContractCloseLine []string `json:"USDCContractCloseLine,omitempty" url:"USDCContractCloseLine,omitempty"`
	// Restrict line to trade Option
	UsdcOptionsCloseLine string `json:"USDCOptionsCloseLine,omitempty" url:"USDCOptionsCloseLine,omitempty"`
	// The whitelist of USDC contract trading pairs
	//
	// 	- If `supportContract`\="0", then it returns "\[\]"
	// 	- If no whitelist symbols, it is `[]`, and you can trade any
	// 	- If supportUSDCContract="0", it is `[]`
	UsdcContractSymbols []string `json:"USDCContractSymbols,omitempty" url:"USDCContractSymbols,omitempty"`
	// The whitelist of Option symbols
	//
	// 	- If `supportContract`\="0", then it returns "\[\]"
	// 	- If no whitelisted, it is `[]`, and you can trade any
	// 	- If supportUSDCOptions="0", it is `[]`
	UsdcOptionsSymbols []string `json:"USDCOptionsSymbols,omitempty" url:"USDCOptionsSymbols,omitempty"`
	// The allowable maximum leverage for Spot margin trading. If `supportMarginTrading`\=0, then it returns ""
	MarginLeverage string `json:"marginLeverage,omitempty" url:"marginLeverage,omitempty"`
	// Object
	//
	// 	- If supportContract="0", it is `[]`
	// 	- If no whitelist USDT perp symbols, it returns all trading symbols and leverage by default
	// 	- If there are whitelist symbols, it return those whitelist data
	UsdtPerpetualLeverage []InsLoanProductInfosMarginProductInfoItemUsdtPerpetualLeverageItem `json:"USDTPerpetualLeverage,omitempty" url:"USDTPerpetualLeverage,omitempty"`
	// Object
	//
	// 	- If supportUSDCContract="0", it is `[]`
	// 	- If no whitelist USDC contract symbols, it returns all trading symbols and leverage by default
	// 	- If there are whitelist symbols, it return those whitelist data
	UsdcContractLeverage []InsLoanProductInfosMarginProductInfoItemUsdcContractLeverageItem `json:"USDCContractLeverage,omitempty" url:"USDCContractLeverage,omitempty"`
}

type InsLoanProductInfosMarginProductInfoItemUsdcContractLeverageItem

type InsLoanProductInfosMarginProductInfoItemUsdcContractLeverageItem struct {
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Maximum leverage
	Leverage string `json:"leverage,omitempty" url:"leverage,omitempty"`
}

type InsLoanProductInfosMarginProductInfoItemUsdtPerpetualLeverageItem

type InsLoanProductInfosMarginProductInfoItemUsdtPerpetualLeverageItem struct {
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Maximum leverage
	Leverage string `json:"leverage,omitempty" url:"leverage,omitempty"`
}

type InsLoanProductInfosQuery

type InsLoanProductInfosQuery struct {
	// Product ID. If not passed, returns all products
	ProductId string `json:"productId,omitempty" url:"productId,omitempty"`
}

type InsLoanRepaidHistory

type InsLoanRepaidHistory struct {
	// Object
	RepayInfo []InsLoanRepaidHistoryRepayInfoItem `json:"repayInfo,omitempty" url:"repayInfo,omitempty"`
}

type InsLoanRepaidHistoryQuery

type InsLoanRepaidHistoryQuery struct {
	// The start timestamp (ms)
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms)
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Limit for data size. \[`1`, `100`\]. Default: `100`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
}

type InsLoanRepaidHistoryRepayInfoItem

type InsLoanRepaidHistoryRepayInfoItem struct {
	// Repaid order ID
	RepayOrderId string `json:"repayOrderId,omitempty" url:"repayOrderId,omitempty"`
	// Repaid timestamp (ms)
	RepaidTime string `json:"repaidTime,omitempty" url:"repaidTime,omitempty"`
	// Repaid coin
	Token string `json:"token,omitempty" url:"token,omitempty"`
	// Repaid principle
	Quantity string `json:"quantity,omitempty" url:"quantity,omitempty"`
	// Repaid interest
	Interest string `json:"interest,omitempty" url:"interest,omitempty"`
	// Repaid type. `1`: normal repayment; `2`: repaid by liquidation
	BusinessType string `json:"businessType,omitempty" url:"businessType,omitempty"`
	// `1`: success; `2`: fail
	Status string `json:"status,omitempty" url:"status,omitempty"`
}

type InsLoanRepayLoanParams

type InsLoanRepayLoanParams struct {
	// Coin name
	Token string `json:"token,omitempty" url:"token,omitempty"`
	// The qty to be repaid
	Quantity string `json:"quantity,omitempty" url:"quantity,omitempty"`
}

type InsLoanRepayLoanResult

type InsLoanRepayLoanResult struct {
	// `P`: processing
	RepayOrderStatus string `json:"repayOrderStatus,omitempty" url:"repayOrderStatus,omitempty"`
}

type Interval

type Interval string
const (
	Interval1   Interval = "1"
	Interval3   Interval = "3"
	Interval5   Interval = "5"
	Interval15  Interval = "15"
	Interval30  Interval = "30"
	Interval60  Interval = "60"
	Interval120 Interval = "120"
	Interval240 Interval = "240"
	Interval360 Interval = "360"
	Interval720 Interval = "720"
	IntervalD   Interval = "D"
	IntervalW   Interval = "W"
	IntervalM   Interval = "M"
)

type IntervalTime

type IntervalTime string
const (
	IntervalTime5Min  IntervalTime = "5min"
	IntervalTime15Min IntervalTime = "15min"
	IntervalTime30Min IntervalTime = "30min"
	IntervalTime1H    IntervalTime = "1h"
	IntervalTime4H    IntervalTime = "4h"
	IntervalTime1D    IntervalTime = "1d"
)

type Locale

type Locale string
const (
	LocaleDeDe  Locale = "de-DE"
	LocaleEnUs  Locale = "en-US"
	LocaleEsAr  Locale = "es-AR"
	LocaleEsEs  Locale = "es-ES"
	LocaleEsMx  Locale = "es-MX"
	LocaleFrFr  Locale = "fr-FR"
	LocaleKkKz  Locale = "kk-KZ"
	LocaleIdId  Locale = "id-ID"
	LocaleUkUa  Locale = "uk-UA"
	LocaleJaJp  Locale = "ja-JP"
	LocaleRuRu  Locale = "ru-RU"
	LocaleThTh  Locale = "th-TH"
	LocalePtBr  Locale = "pt-BR"
	LocaleTrTr  Locale = "tr-TR"
	LocaleViVn  Locale = "vi-VN"
	LocaleZhTw  Locale = "zh-TW"
	LocaleArSa  Locale = "ar-SA"
	LocaleHiIn  Locale = "hi-IN"
	LocaleFilPh Locale = "fil-PH"
)

type MaintainType

type MaintainType string
const (
	MaintainType1 MaintainType = "1"
	MaintainType2 MaintainType = "2"
	MaintainType3 MaintainType = "3"
)

type MarginTrading

type MarginTrading string
const (
	MarginTradingNone           MarginTrading = "none"
	MarginTradingBoth           MarginTrading = "both"
	MarginTradingUtaOnly        MarginTrading = "utaOnly"
	MarginTradingNormalSpotOnly MarginTrading = "normalSpotOnly"
)

type MarketAccountRatio

type MarketAccountRatio struct {
	// Object
	List []MarketAccountRatioListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type MarketAccountRatioListItem

type MarketAccountRatioListItem struct {
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// The ratio of the number of long position
	BuyRatio string `json:"buyRatio,omitempty" url:"buyRatio,omitempty"`
	// The ratio of the number of short position
	SellRatio string `json:"sellRatio,omitempty" url:"sellRatio,omitempty"`
	// Timestamp (ms)
	Timestamp string `json:"timestamp,omitempty" url:"timestamp,omitempty"`
}

type MarketAccountRatioQuery

type MarketAccountRatioQuery struct {
	// Product type. `linear`(USDT Contract),`inverse`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Data recording period. `5min`, `15min`, `30min`, `1h`, `4h`, `1d`
	Period DataRecordingPeriod `json:"period,omitempty" url:"period,omitempty"`
	// The start timestamp (ms)
	StartTime string `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms)
	EndTime string `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Limit for data size per page. \[`1`, `500`\]. Default: `50`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type MarketAdlAlert

type MarketAdlAlert struct {
	// Latest data update timestamp (ms)
	UpdateTime string `json:"updateTime,omitempty" url:"updateTime,omitempty"`
	// Object
	List []MarketAdlAlertListItem `json:"list,omitempty" url:"list,omitempty"`
}

type MarketAdlAlertListItem

type MarketAdlAlertListItem struct {
	// Token of the insurance pool
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Trading pair name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Balance of the insurance fund. Used to determine if ADL is triggered. For shared insurance pool, the "balance" field will follow a T+1 refresh mechanism and will be updated daily at 00:00 UTC.
	Balance string `json:"balance,omitempty" url:"balance,omitempty"`
	// Deprecated, always return "". Maximum balance of the insurance pool in the last 8 hours
	MaxBalance string `json:"maxBalance,omitempty" url:"maxBalance,omitempty"`
	// PnL ratio threshold for triggering **contract PnL drawdown ADL**
	//
	// 	- ADL is triggered when the symbol's PnL drawdown ratio in the last 8 hours exceeds this value
	InsurancePnlRatio string `json:"insurancePnlRatio,omitempty" url:"insurancePnlRatio,omitempty"`
	// Symbol's PnL drawdown ratio in the last 8 hours. Used to determine whether ADL is triggered or stopped
	PnlRatio string `json:"pnlRatio,omitempty" url:"pnlRatio,omitempty"`
	// Trigger threshold for **contract PnL drawdown ADL**
	//
	// 	- This condition is only effective when the insurance pool balance is greater than this value; if so, an 8 hours drawdown exceeding n% may trigger ADL
	AdlTriggerThreshold string `json:"adlTriggerThreshold,omitempty" url:"adlTriggerThreshold,omitempty"`
	// Stop ratio threshold for **contract PnL drawdown ADL**
	//
	// 	- ADL stops when the symbol's 8 hours drawdown ratio falls below this value
	AdlStopRatio string `json:"adlStopRatio,omitempty" url:"adlStopRatio,omitempty"`
}

type MarketAdlAlertQuery

type MarketAdlAlertQuery struct {
	// Contract name, e.g. `BTCUSDT`. Uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
}

type MarketDeliveryPrice

type MarketDeliveryPrice struct {
	// Product type
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Object
	List []MarketDeliveryPriceListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type MarketDeliveryPriceListItem

type MarketDeliveryPriceListItem struct {
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Delivery price
	DeliveryPrice string `json:"deliveryPrice,omitempty" url:"deliveryPrice,omitempty"`
	// Delivery timestamp (ms)
	DeliveryTime string `json:"deliveryTime,omitempty" url:"deliveryTime,omitempty"`
}

type MarketDeliveryPriceQuery

type MarketDeliveryPriceQuery struct {
	// Product type. `linear`, `inverse`, `option`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Base coin, uppercase only. Default: `BTC`. _Valid for `option` only_
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
	// Settle coin, uppercase only. Default: `USDC`.
	SettleCoin string `json:"settleCoin,omitempty" url:"settleCoin,omitempty"`
	// Limit for data size per page. \[`1`, `200`\]. Default: `50`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type MarketFeeGroupInfo

type MarketFeeGroupInfo struct {
	// List of fee group objects
	List []MarketFeeGroupInfoListItem `json:"list,omitempty" url:"list,omitempty"`
}

type MarketFeeGroupInfoListItem

type MarketFeeGroupInfoListItem struct {
	// Fee group name
	GroupName GroupName `json:"groupName,omitempty" url:"groupName,omitempty"`
	// Group weighting factor
	WeightingFactor int64 `json:"weightingFactor,omitempty" url:"weightingFactor,omitempty"`
	// Symbols number
	SymbolsNumbers int64 `json:"symbolsNumbers,omitempty" url:"symbolsNumbers,omitempty"`
	// Symbol name
	Symbols []string `json:"symbols,omitempty" url:"symbols,omitempty"`
	// Fee rate details for different categories. `pro`, `marketMaker`
	FeeRates MarketFeeGroupInfoListItemFeeRates `json:"feeRates" url:"feeRates"`
	// Latest data update timestamp (ms)
	UpdateTime string `json:"updateTime,omitempty" url:"updateTime,omitempty"`
}

type MarketFeeGroupInfoListItemFeeRates

type MarketFeeGroupInfoListItemFeeRates struct {
	// Pro-level fee structures
	Pro []MarketFeeGroupInfoListItemFeeRatesProItem `json:"pro,omitempty" url:"pro,omitempty"`
	// Market Maker-level fee structures
	MarketMaker []MarketFeeGroupInfoListItemFeeRatesMarketMakerItem `json:"marketMaker,omitempty" url:"marketMaker,omitempty"`
}

type MarketFeeGroupInfoListItemFeeRatesMarketMakerItem

type MarketFeeGroupInfoListItemFeeRatesMarketMakerItem struct {
	// Market Maker level name. `MM 1`, `MM 2`, `MM 3`
	Level string `json:"level,omitempty" url:"level,omitempty"`
	// Taker fee rate
	TakerFeeRate string `json:"takerFeeRate,omitempty" url:"takerFeeRate,omitempty"`
	// Maker fee rate
	MakerFeeRate string `json:"makerFeeRate,omitempty" url:"makerFeeRate,omitempty"`
	// Maker rebate fee rate
	MakerRebate string `json:"makerRebate,omitempty" url:"makerRebate,omitempty"`
}

type MarketFeeGroupInfoListItemFeeRatesProItem

type MarketFeeGroupInfoListItemFeeRatesProItem struct {
	// Pro level name. `Pro 1`, `Pro 2`, `Pro 3`, `Pro 4`, `Pro 5`, `Pro 6`
	Level string `json:"level,omitempty" url:"level,omitempty"`
	// Taker fee rate
	TakerFeeRate string `json:"takerFeeRate,omitempty" url:"takerFeeRate,omitempty"`
	// Maker fee rate
	MakerFeeRate string `json:"makerFeeRate,omitempty" url:"makerFeeRate,omitempty"`
	// Maker rebate fee rate
	MakerRebate string `json:"makerRebate,omitempty" url:"makerRebate,omitempty"`
}

type MarketFeeGroupInfoQuery

type MarketFeeGroupInfoQuery struct {
	// Product type. `contract` only
	ProductType string `json:"productType,omitempty" url:"productType,omitempty"`
	// Group ID. `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`
	GroupId GroupId `json:"groupId,omitempty" url:"groupId,omitempty"`
}

type MarketFundingHistory

type MarketFundingHistory struct {
	// Product type
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Object
	List []MarketFundingHistoryListItem `json:"list,omitempty" url:"list,omitempty"`
}

type MarketFundingHistoryListItem

type MarketFundingHistoryListItem struct {
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Funding rate
	FundingRate string `json:"fundingRate,omitempty" url:"fundingRate,omitempty"`
	// Funding rate timestamp (ms)
	FundingRateTimestamp string `json:"fundingRateTimestamp,omitempty" url:"fundingRateTimestamp,omitempty"`
}

type MarketFundingHistoryQuery

type MarketFundingHistoryQuery struct {
	// Product type. `linear`,`inverse`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// The start timestamp (ms)
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms)
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Limit for data size per page. \[`1`, `200`\]. Default: `200`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
}

type MarketHistoricalVolatility

type MarketHistoricalVolatility struct {
	// Product type
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Object
	List []MarketHistoricalVolatilityListItem `json:"list,omitempty" url:"list,omitempty"`
}

type MarketHistoricalVolatilityListItem

type MarketHistoricalVolatilityListItem struct {
	// Period
	Period int64 `json:"period,omitempty" url:"period,omitempty"`
	// Volatility
	Value string `json:"value,omitempty" url:"value,omitempty"`
	// Timestamp (ms)
	Time string `json:"time,omitempty" url:"time,omitempty"`
}

type MarketHistoricalVolatilityQuery

type MarketHistoricalVolatilityQuery struct {
	// Product type. `option`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Base coin, uppercase only. Default: return BTC data
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
	// Quote coin, `USD` or `USDT`. Default: return quoteCoin=USD
	QuoteCoin string `json:"quoteCoin,omitempty" url:"quoteCoin,omitempty"`
	// Period. If not specified, it will return data with a 7-day average by default
	Period OptionPeriod `json:"period,omitempty" url:"period,omitempty"`
	// The start timestamp (ms)
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms)
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
}

type MarketIndexPriceComponents

type MarketIndexPriceComponents struct {
	// Name of the index (e.g., BTCUSDT)
	IndexName string `json:"indexName,omitempty" url:"indexName,omitempty"`
	// Last price of the index
	LastPrice string `json:"lastPrice,omitempty" url:"lastPrice,omitempty"`
	// Timestamp of the last update in milliseconds
	UpdateTime string `json:"updateTime,omitempty" url:"updateTime,omitempty"`
	// List of components contributing to the index price
	Components []MarketIndexPriceComponentsComponentsItem `json:"components,omitempty" url:"components,omitempty"`
}

type MarketIndexPriceComponentsComponentsItem

type MarketIndexPriceComponentsComponentsItem struct {
	// Name of the exchange
	Exchange string `json:"exchange,omitempty" url:"exchange,omitempty"`
	// Spot trading pair on the exchange (e.g., BTCUSDT)
	SpotPair string `json:"spotPair,omitempty" url:"spotPair,omitempty"`
	// Equivalent price
	EquivalentPrice string `json:"equivalentPrice,omitempty" url:"equivalentPrice,omitempty"`
	// Multiplier used for the component price
	Multiplier string `json:"multiplier,omitempty" url:"multiplier,omitempty"`
	// Actual price
	Price string `json:"price,omitempty" url:"price,omitempty"`
	// Weight in the index calculation
	Weight string `json:"weight,omitempty" url:"weight,omitempty"`
}

type MarketIndexPriceComponentsQuery

type MarketIndexPriceComponentsQuery struct {
	// Index name, like `BTCUSDT`
	IndexName string `json:"indexName,omitempty" url:"indexName,omitempty"`
}

type MarketIndexPriceKline

type MarketIndexPriceKline struct {
	// Product type
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// - An string array of individual candle
	// 	- Sort in reverse by `startTime`
	List []MarketIndexPriceKlineListItem `json:"list,omitempty" url:"list,omitempty"`
}

type MarketIndexPriceKlineListItem

type MarketIndexPriceKlineListItem struct {
	// Start time of the candle (ms)
	StartTime string
	// Open price
	OpenPrice string
	// Highest price
	HighPrice string
	// Lowest price
	LowPrice string
	// Close price. _Is the last traded price when the candle is not closed_
	ClosePrice string
}

func (*MarketIndexPriceKlineListItem) UnmarshalJSON

func (o *MarketIndexPriceKlineListItem) UnmarshalJSON(data []byte) error

type MarketIndexPriceKlineQuery

type MarketIndexPriceKlineQuery struct {
	// Product type. `linear`,`inverse`
	//
	// 	- When `category` is not passed, use `linear` by default
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Kline interval. `1`,`3`,`5`,`15`,`30`,`60`,`120`,`240`,`360`,`720`,`D`,`W`,`M`
	Interval Interval `json:"interval,omitempty" url:"interval,omitempty"`
	// The start timestamp (ms)
	Start int64 `json:"start,omitempty" url:"start,omitempty"`
	// The end timestamp (ms)
	End int64 `json:"end,omitempty" url:"end,omitempty"`
	// Limit for data size per page. \[`1`, `1000`\]. Default: `200`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
}

type MarketInstrumentsInfoQuery

type MarketInstrumentsInfoQuery struct {
	// Product type. `spot`,`linear`,`inverse`,`option`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// SymbolType:The region to which the trading pair belongs,only for`linear`,`inverse`,`spot`
	SymbolType SymbolType `json:"symbolType,omitempty" url:"symbolType,omitempty"`
	// Symbol status filter
	//
	// 	- `linear` & `inverse` & `spot` By default returns only `Trading` symbols
	// 	- `option` By default returns `PreLaunch`, `Trading`, and `Delivering`
	// 	- Spot has `Trading` only
	// 	- `linear` & `inverse`: when status=PreLaunch, it returns [Pre-Market contracts](https://www.bybit.com/help-center/article/Introduction-to-Pre-Market-Perpetual)
	Status Status `json:"status,omitempty" url:"status,omitempty"`
	// Base coin, uppercase only
	//
	// 	- Applies to `linear`,`inverse`,`option` **only**
	// 	- `option`: returns BTC by default
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
	// Limit for data size per page. \[`1`, `1000`\]. Default: `500`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type MarketInsurance

type MarketInsurance struct {
	// Data updated time (ms)
	UpdatedTime string `json:"updatedTime,omitempty" url:"updatedTime,omitempty"`
	// Object
	List []MarketInsuranceListItem `json:"list,omitempty" url:"list,omitempty"`
}

type MarketInsuranceListItem

type MarketInsuranceListItem struct {
	// Coin
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// - symbols with `"BTCUSDT,ETHUSDT,SOLUSDT"` mean these contracts are shared with one insurance pool
	// 	- For an isolated insurance pool, it returns one contract
	Symbols []string `json:"symbols,omitempty" url:"symbols,omitempty"`
	// Balance
	Balance string `json:"balance,omitempty" url:"balance,omitempty"`
	// USD value
	Value string `json:"value,omitempty" url:"value,omitempty"`
}

type MarketInsuranceQuery

type MarketInsuranceQuery struct {
	// coin, uppercase only. Default: return all insurance coins
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
}

type MarketKline

type MarketKline struct {
	// Product type
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// - An string array of individual candle
	// 	- Sort in reverse by `startTime`
	List []MarketKlineListItem `json:"list,omitempty" url:"list,omitempty"`
}

type MarketKlineListItem

type MarketKlineListItem struct {
	// Start time of the candle (ms)
	StartTime string
	// Open price
	OpenPrice string
	// Highest price
	HighPrice string
	// Lowest price
	LowPrice string
	// Close price. _Is the last traded price when the candle is not closed_
	ClosePrice string
	// Trade volume
	//
	// 	- USDT or USDC contract: unit is base coin (e.g., BTC)
	// 	- Inverse contract: unit is quote coin (e.g., USD)
	Volume string
	// Turnover.
	//
	// 	- USDT or USDC contract: unit is quote coin (e.g., USDT)
	// 	- Inverse contract: unit is base coin (e.g., BTC)
	Turnover string
}

func (*MarketKlineListItem) UnmarshalJSON

func (o *MarketKlineListItem) UnmarshalJSON(data []byte) error

type MarketKlineQuery

type MarketKlineQuery struct {
	// Product type. `spot`,`linear`,`inverse`
	//
	// 	- When `category` is not passed, use `linear` by default
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Kline interval. `1`,`3`,`5`,`15`,`30`,`60`,`120`,`240`,`360`,`720`,`D`,`W`,`M`
	Interval Interval `json:"interval,omitempty" url:"interval,omitempty"`
	// The start timestamp (ms)
	Start int64 `json:"start,omitempty" url:"start,omitempty"`
	// The end timestamp (ms)
	End int64 `json:"end,omitempty" url:"end,omitempty"`
	// Limit for data size per page. \[`1`, `1000`\]. Default: `200`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
}

type MarketMarkPriceKline

type MarketMarkPriceKline struct {
	// Product type
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// - An string array of individual candle
	// 	- Sort in reverse by `startTime`
	List []MarketMarkPriceKlineListItem `json:"list,omitempty" url:"list,omitempty"`
}

type MarketMarkPriceKlineListItem

type MarketMarkPriceKlineListItem struct {
	// Start time of the candle (ms)
	StartTime string
	// Open price
	OpenPrice string
	// Highest price
	HighPrice string
	// Lowest price
	LowPrice string
	// Close price. _Is the last traded price when the candle is not closed_
	ClosePrice string
}

func (*MarketMarkPriceKlineListItem) UnmarshalJSON

func (o *MarketMarkPriceKlineListItem) UnmarshalJSON(data []byte) error

type MarketMarkPriceKlineQuery

type MarketMarkPriceKlineQuery struct {
	// Product type. `linear`,`inverse`
	//
	// 	- When `category` is not passed, use `linear` by default
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Kline interval. `1`,`3`,`5`,`15`,`30`,`60`,`120`,`240`,`360`,`720`,`D`,`M`,`W`
	Interval Interval `json:"interval,omitempty" url:"interval,omitempty"`
	// The start timestamp (ms)
	Start int64 `json:"start,omitempty" url:"start,omitempty"`
	// The end timestamp (ms)
	End int64 `json:"end,omitempty" url:"end,omitempty"`
	// Limit for data size per page. \[`1`, `1000`\]. Default: `200`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
}

type MarketNewDeliveryPrice

type MarketNewDeliveryPrice struct {
	// Product type
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Object
	List []MarketNewDeliveryPriceListItem `json:"list,omitempty" url:"list,omitempty"`
}

type MarketNewDeliveryPriceListItem

type MarketNewDeliveryPriceListItem struct {
	// Delivery price
	DeliveryPrice string `json:"deliveryPrice,omitempty" url:"deliveryPrice,omitempty"`
	// Delivery timestamp (ms)
	DeliveryTime string `json:"deliveryTime,omitempty" url:"deliveryTime,omitempty"`
}

type MarketNewDeliveryPriceQuery

type MarketNewDeliveryPriceQuery struct {
	// Product type. _Valid for `option` only_
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Base coin, uppercase only. _Valid for `option` only_
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
	// Settle coin, uppercase only. Default: `USDT`.
	SettleCoin string `json:"settleCoin,omitempty" url:"settleCoin,omitempty"`
}

type MarketOpenInterest

type MarketOpenInterest struct {
	// Product type
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Object
	List []MarketOpenInterestListItem `json:"list,omitempty" url:"list,omitempty"`
	// Used to paginate
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type MarketOpenInterestListItem

type MarketOpenInterestListItem struct {
	// Open interest. The value is the sum of both sides.
	// The unit of value, e.g., BTCUSD(inverse) is USD, BTCUSDT(linear) is BTC
	OpenInterest string `json:"openInterest,omitempty" url:"openInterest,omitempty"`
	// The timestamp (ms)
	Timestamp string `json:"timestamp,omitempty" url:"timestamp,omitempty"`
}

type MarketOpenInterestQuery

type MarketOpenInterestQuery struct {
	// Product type. `linear`,`inverse`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Interval time. `5min`,`15min`,`30min`,`1h`,`4h`,`1d`
	IntervalTime IntervalTime `json:"intervalTime,omitempty" url:"intervalTime,omitempty"`
	// The start timestamp (ms)
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms)
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Limit for data size per page. \[`1`, `200`\]. Default: `50`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Used to paginate
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type MarketOrderbook

type MarketOrderbook struct {
	// Symbol name
	S string `json:"s,omitempty" url:"s,omitempty"`
	// Bid, buyer. Sorted by price in descending order
	B []MarketOrderbookBItem `json:"b,omitempty" url:"b,omitempty"`
	// Ask, seller. Sorted by price in ascending order
	A []MarketOrderbookAItem `json:"a,omitempty" url:"a,omitempty"`
	// The timestamp (ms) that the system generates the data
	Ts int64 `json:"ts,omitempty" url:"ts,omitempty"`
	// Update ID, is always in sequence
	//
	// 	- For contract, corresponds to `u` in the 1000-level [WebSocket orderbook stream](https://bybit-exchange.github.io/docs/v5/websocket/public/orderbook)
	// 	- For spot, corresponds to `u` in the 1000-level [WebSocket orderbook stream](https://bybit-exchange.github.io/docs/v5/websocket/public/orderbook)
	U int64 `json:"u,omitempty" url:"u,omitempty"`
	// Cross sequence
	//
	// 	- You can use this field to compare different levels orderbook data, and for the smaller seq, then it means the data is generated earlier.
	Seq int64 `json:"seq,omitempty" url:"seq,omitempty"`
	// The timestamp from the matching engine when this orderbook data is produced. It can be correlated with `T` from [public trade channel](/docs/v5/websocket/public/trade)
	Cts int64 `json:"cts,omitempty" url:"cts,omitempty"`
}

type MarketOrderbookAItem

type MarketOrderbookAItem struct {
	// Ask price
	A0 string
	// Ask size
	A1 string
}

func (*MarketOrderbookAItem) UnmarshalJSON

func (o *MarketOrderbookAItem) UnmarshalJSON(data []byte) error

type MarketOrderbookBItem

type MarketOrderbookBItem struct {
	// Bid price
	B0 string
	// Bid size
	B1 string
}

func (*MarketOrderbookBItem) UnmarshalJSON

func (o *MarketOrderbookBItem) UnmarshalJSON(data []byte) error

type MarketOrderbookQuery

type MarketOrderbookQuery struct {
	// Product type. `spot`, `linear`, `inverse`, `option`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Limit size for each bid and ask
	//
	// 	- `spot`: \[`1`, `200`\]. Default: `1`.
	// 	- `linear`&`inverse`: \[`1`, `500`\]. Default: `25`.
	// 	- `option`: \[`1`, `25`\]. Default: `1`.
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
}

type MarketPremiumIndexPriceKline

type MarketPremiumIndexPriceKline struct {
	// Product type
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// - An string array of individual candle
	// 	- Sort in reverse by `start`
	List []MarketPremiumIndexPriceKlineListItem `json:"list,omitempty" url:"list,omitempty"`
}

type MarketPremiumIndexPriceKlineListItem

type MarketPremiumIndexPriceKlineListItem struct {
	// Start time of the candle (ms)
	List0 string
	// Open price
	List1 string
	// Highest price
	List2 string
	// Lowest price
	List3 string
	// Close price. _Is the last traded price when the candle is not closed_
	List4 string
}

func (*MarketPremiumIndexPriceKlineListItem) UnmarshalJSON

func (o *MarketPremiumIndexPriceKlineListItem) UnmarshalJSON(data []byte) error

type MarketPremiumIndexPriceKlineQuery

type MarketPremiumIndexPriceKlineQuery struct {
	// Product type. `linear`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Kline interval. `1`,`3`,`5`,`15`,`30`,`60`,`120`,`240`,`360`,`720`,`D`,`W`,`M`
	Interval Interval `json:"interval,omitempty" url:"interval,omitempty"`
	// The start timestamp (ms)
	Start int64 `json:"start,omitempty" url:"start,omitempty"`
	// The end timestamp (ms)
	End int64 `json:"end,omitempty" url:"end,omitempty"`
	// Limit for data size per page. \[`1`, `1000`\]. Default: `200`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
}

type MarketPriceLimit

type MarketPriceLimit struct {
	// Symbol name
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Highest Bid Price
	BuyLmt string `json:"buyLmt,omitempty" url:"buyLmt,omitempty"`
	// Lowest Ask Price
	SellLmt string `json:"sellLmt,omitempty" url:"sellLmt,omitempty"`
	// timestamp in milliseconds
	Ts string `json:"ts,omitempty" url:"ts,omitempty"`
}

type MarketPriceLimitQuery

type MarketPriceLimitQuery struct {
	// Product type. `spot`,`linear`,`inverse`
	//
	// 	- When `category` is not passed, use `linear` by default
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
}

type MarketRecentTrade

type MarketRecentTrade struct {
	// Products category
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Object
	List []MarketRecentTradeListItem `json:"list,omitempty" url:"list,omitempty"`
}

type MarketRecentTradeListItem

type MarketRecentTradeListItem struct {
	// Execution ID
	ExecId string `json:"execId,omitempty" url:"execId,omitempty"`
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Trade price
	Price string `json:"price,omitempty" url:"price,omitempty"`
	// Trade size
	Size string `json:"size,omitempty" url:"size,omitempty"`
	// Side of taker `Buy`, `Sell`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Trade time (ms)
	Time string `json:"time,omitempty" url:"time,omitempty"`
	// Whether the trade is block trade
	IsBlockTrade bool `json:"isBlockTrade,omitempty" url:"isBlockTrade,omitempty"`
	// Whether the trade is RPI trade
	IsRpiTrade bool `json:"isRPITrade,omitempty" url:"isRPITrade,omitempty"`
	// Mark price, unique field for `option`
	MP string `json:"mP,omitempty" url:"mP,omitempty"`
	// Index price, unique field for `option`
	IP string `json:"iP,omitempty" url:"iP,omitempty"`
	// Mark iv, unique field for `option`
	MIv string `json:"mIv,omitempty" url:"mIv,omitempty"`
	// iv, unique field for `option`
	Iv string `json:"iv,omitempty" url:"iv,omitempty"`
	// cross sequence
	Seq string `json:"seq,omitempty" url:"seq,omitempty"`
}

type MarketRecentTradeQuery

type MarketRecentTradeQuery struct {
	// Product type. `spot`,`linear`,`inverse`,`option`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	//
	// 	- **required** for spot/linear/inverse
	// 	- optional for option
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Base coin, uppercase only
	//
	// 	- Apply to `option` **only**
	// 	- If the field is not passed, return **BTC** data by default
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
	// Option type. `Call` or `Put`. Apply to `option` **only**
	OptionType string `json:"optionType,omitempty" url:"optionType,omitempty"`
	// Limit for data size per page
	//
	// 	- `spot`: \[1,60\], default: `60`
	// 	- others: \[1,1000\], default: `500`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
}

type MarketRiskLimit

type MarketRiskLimit struct {
	// Product type
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Object
	List []MarketRiskLimitListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type MarketRiskLimitListItem

type MarketRiskLimitListItem struct {
	// Risk ID
	Id int64 `json:"id,omitempty" url:"id,omitempty"`
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Position limit
	RiskLimitValue string `json:"riskLimitValue,omitempty" url:"riskLimitValue,omitempty"`
	// Maintain margin rate
	MaintenanceMargin int64 `json:"maintenanceMargin,omitempty" url:"maintenanceMargin,omitempty"`
	// Initial margin rate
	InitialMargin int64 `json:"initialMargin,omitempty" url:"initialMargin,omitempty"`
	// `1`: true, `0`: false
	IsLowestRisk int64 `json:"isLowestRisk,omitempty" url:"isLowestRisk,omitempty"`
	// Allowed max leverage
	MaxLeverage string `json:"maxLeverage,omitempty" url:"maxLeverage,omitempty"`
	// The maintenance margin deduction value when risk limit tier changed
	MmDeduction string `json:"mmDeduction,omitempty" url:"mmDeduction,omitempty"`
}

type MarketRiskLimitQuery

type MarketRiskLimitQuery struct {
	// Product type. `linear`,`inverse`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the data set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type MarketRpiOrderbook

type MarketRpiOrderbook struct {
	// Symbol name
	S string `json:"s,omitempty" url:"s,omitempty"`
	// Bids. For `snapshot` stream. Sorted by price in descending order
	B []MarketRpiOrderbookBItem `json:"b,omitempty" url:"b,omitempty"`
	// Asks. For `snapshot` stream. Sorted by price in ascending order
	A []MarketRpiOrderbookAItem `json:"a,omitempty" url:"a,omitempty"`
	// The timestamp (ms) that the system generates the data
	Ts int64 `json:"ts,omitempty" url:"ts,omitempty"`
	// Update ID, is always in sequence corresponds to `u` in the 50-level [WebSocket RPI orderbook stream](https://bybit-exchange.github.io/docs/v5/websocket/public/orderbook-rpi)
	U int64 `json:"u,omitempty" url:"u,omitempty"`
	// Cross sequence
	//
	// 	- You can use this field to compare different levels orderbook data, and for the smaller seq, then it means the data is generated earlier.
	Seq int64 `json:"seq,omitempty" url:"seq,omitempty"`
	// The timestamp from the matching engine when this orderbook data is produced. It can be correlated with `T` from [public trade channel](/docs/v5/websocket/public/trade)
	Cts int64 `json:"cts,omitempty" url:"cts,omitempty"`
}

type MarketRpiOrderbookAItem

type MarketRpiOrderbookAItem struct {
	// Ask price
	A0 string
	// None RPI ask size
	//
	// 	- The delta data has size=0, which means that all quotations for this price have been filled or cancelled
	A1 string
	// RPI ask size
	//
	// 	- When an ask RPI order crosses with a non-RPI bid price, the quantity of the ask RPI becomes invalid and is hidden
	A2 string
}

func (*MarketRpiOrderbookAItem) UnmarshalJSON

func (o *MarketRpiOrderbookAItem) UnmarshalJSON(data []byte) error

type MarketRpiOrderbookBItem

type MarketRpiOrderbookBItem struct {
	// Bid price
	B0 string
	// None RPI bid size
	//
	// 	- The delta data has size=0, which means that all quotations for this price have been filled or cancelled
	B1 string
	// RPI bid size
	//
	// 	- When a bid RPI order crosses with a non-RPI ask price, the quantity of the bid RPI becomes invalid and is hidden
	B2 string
}

func (*MarketRpiOrderbookBItem) UnmarshalJSON

func (o *MarketRpiOrderbookBItem) UnmarshalJSON(data []byte) error

type MarketRpiOrderbookQuery

type MarketRpiOrderbookQuery struct {
	// Product type. `spot`, `linear`, `inverse`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Limit size for each bid and ask: \[1, 50\]
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
}

type MarketTickersQuery

type MarketTickersQuery struct {
	// Product type. `spot`,`linear`,`inverse`,`option`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Base coin, uppercase only. Apply to `option` **only**
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
	// Expiry date. e.g., 25DEC22. Apply to `option` **only**
	ExpDate string `json:"expDate,omitempty" url:"expDate,omitempty"`
}

type MarketTime

type MarketTime struct {
	// Bybit server timestamp (sec)
	TimeSecond string `json:"timeSecond,omitempty" url:"timeSecond,omitempty"`
	// Bybit server timestamp (nano)
	TimeNano string `json:"timeNano,omitempty" url:"timeNano,omitempty"`
}

type Msg

type Msg string
const (
	MsgApiLimitUpdatedSuccessfully                 Msg = "API limit updated successfully"
	MsgRequestedLimitExceedsMaximumAllowedPerUser  Msg = "Requested limit exceeds maximum allowed per user"
	MsgNoPermissionToOperateTheseUiDs              Msg = "No permission to operate these UIDs"
	MsgApiCapConfigurationNotFound                 Msg = "API cap configuration not found"
	MsgApiCapConfigurationNotFoundForBizType       Msg = "API cap configuration not found for bizType"
	MsgRequestedLimitWouldExceedInstitutionalQuota Msg = "Requested limit would exceed institutional quota"
)

type OptionPeriod

type OptionPeriod string
const (
	OptionPeriod7   OptionPeriod = "7"
	OptionPeriod14  OptionPeriod = "14"
	OptionPeriod21  OptionPeriod = "21"
	OptionPeriod30  OptionPeriod = "30"
	OptionPeriod60  OptionPeriod = "60"
	OptionPeriod90  OptionPeriod = "90"
	OptionPeriod180 OptionPeriod = "180"
	OptionPeriod270 OptionPeriod = "270"
)

type OrderAmendBatchParams

type OrderAmendBatchParams struct {
	// Product type `linear`, `option`, `spot`, `inverse`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Object
	Request []OrderAmendBatchParamsRequestItem `json:"request,omitempty" url:"request,omitempty"`
}

type OrderAmendBatchParamsRequestItem

type OrderAmendBatchParamsRequestItem struct {
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Order ID. Either `orderId` or `orderLinkId` is required
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID. Either `orderId` or `orderLinkId` is required
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// Implied volatility. `option` **only**. Pass the real value, e.g for 10%, 0.1 should be passed
	OrderIv string `json:"orderIv,omitempty" url:"orderIv,omitempty"`
	// - For Perps & Futures, it is the conditional order trigger price. If you expect the price to rise to trigger your conditional order, make sure:
	// _triggerPrice > market price_
	// Else, _triggerPrice < market price_
	// 	- For spot, it is for tpslOrder or stopOrder trigger price
	TriggerPrice string `json:"triggerPrice,omitempty" url:"triggerPrice,omitempty"`
	// Order quantity after modification. Do not pass it if not modify the qty
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
	// Order price after modification. Do not pass it if not modify the price
	Price string `json:"price,omitempty" url:"price,omitempty"`
	// TP/SL mode
	//
	// 	- `Full`: entire position for TP/SL. Then, tpOrderType or slOrderType must be `Market`
	// 	- `Partial`: partial position tp/sl. Limit TP/SL order are supported. Note: When create limit tp/sl, tpslMode is **required** and it must be `Partial`
	TpslMode string `json:"tpslMode,omitempty" url:"tpslMode,omitempty"`
	// Take profit price after modification. If pass "0", it means cancel the existing take profit of the order. Do not pass it if you do not want to modify the take profit
	TakeProfit string `json:"takeProfit,omitempty" url:"takeProfit,omitempty"`
	// Stop loss price after modification. If pass "0", it means cancel the existing stop loss of the order. Do not pass it if you do not want to modify the stop loss
	StopLoss string `json:"stopLoss,omitempty" url:"stopLoss,omitempty"`
	// The price type to trigger take profit. When set a take profit, this param is **required** if no initial value for the order
	TpTriggerBy TriggerBy `json:"tpTriggerBy,omitempty" url:"tpTriggerBy,omitempty"`
	// The price type to trigger stop loss. When set a take profit, this param is **required** if no initial value for the order
	SlTriggerBy TriggerBy `json:"slTriggerBy,omitempty" url:"slTriggerBy,omitempty"`
	// Trigger price type
	TriggerBy TriggerBy `json:"triggerBy,omitempty" url:"triggerBy,omitempty"`
	// Limit order price when take profit is triggered. Only working when original order sets partial limit tp/sl
	TpLimitPrice string `json:"tpLimitPrice,omitempty" url:"tpLimitPrice,omitempty"`
	// Limit order price when stop loss is triggered. Only working when original order sets partial limit tp/sl
	SlLimitPrice string `json:"slLimitPrice,omitempty" url:"slLimitPrice,omitempty"`
}

type OrderAmendBatchResult

type OrderAmendBatchResult struct {
	// Object
	List       []OrderAmendBatchResultListItem `json:"list,omitempty" url:"list,omitempty"`
	RetExtInfo OrderAmendBatchResultRetExtInfo `json:"retExtInfo" url:"retExtInfo"`
}

type OrderAmendBatchResultListItem

type OrderAmendBatchResultListItem struct {
	// Product type
	Category string `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
}

type OrderAmendBatchResultRetExtInfo

type OrderAmendBatchResultRetExtInfo struct {
	// Object
	List []OrderAmendBatchResultRetExtInfoListItem `json:"list,omitempty" url:"list,omitempty"`
}

type OrderAmendBatchResultRetExtInfoListItem

type OrderAmendBatchResultRetExtInfoListItem struct {
	// Success/error code
	Code int64 `json:"code,omitempty" url:"code,omitempty"`
	// Success/error message
	Msg string `json:"msg,omitempty" url:"msg,omitempty"`
}

type OrderAmendParams

type OrderAmendParams struct {
	// Product type `linear`, `inverse`, `spot`, `option`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Order ID. Either `orderId` or `orderLinkId` is required
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID. Either `orderId` or `orderLinkId` is required
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// Implied volatility. `option` **only**. Pass the real value, e.g for 10%, 0.1 should be passed
	OrderIv string `json:"orderIv,omitempty" url:"orderIv,omitempty"`
	// - For Perps & Futures, it is the conditional order trigger price. If you expect the price to rise to trigger your conditional order, make sure:
	// _triggerPrice > market price_
	// Else, _triggerPrice < market price_
	// 	- For spot, it is the TP/SL and Conditional order trigger price
	TriggerPrice string `json:"triggerPrice,omitempty" url:"triggerPrice,omitempty"`
	// Order quantity after modification. Do not pass it if not modify the qty
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
	// Order price after modification. Do not pass it if not modify the price
	Price string `json:"price,omitempty" url:"price,omitempty"`
	// TP/SL mode
	//
	// 	- `Full`: entire position for TP/SL. Then, tpOrderType or slOrderType must be `Market`
	// 	- `Partial`: partial position tp/sl. Limit TP/SL order are supported. Note: When create limit tp/sl, tpslMode is **required** and it must be `Partial`
	//
	// Valid for `linear` & `inverse`
	TpslMode string `json:"tpslMode,omitempty" url:"tpslMode,omitempty"`
	// Take profit price after modification. If pass "0", it means cancel the existing take profit of the order. Do not pass it if you do not want to modify the take profit
	TakeProfit string `json:"takeProfit,omitempty" url:"takeProfit,omitempty"`
	// Stop loss price after modification. If pass "0", it means cancel the existing stop loss of the order. Do not pass it if you do not want to modify the stop loss
	StopLoss string `json:"stopLoss,omitempty" url:"stopLoss,omitempty"`
	// The price type to trigger take profit. When set a take profit, this param is **required** if no initial value for the order
	TpTriggerBy TriggerBy `json:"tpTriggerBy,omitempty" url:"tpTriggerBy,omitempty"`
	// The price type to trigger stop loss. When set a take profit, this param is **required** if no initial value for the order
	SlTriggerBy TriggerBy `json:"slTriggerBy,omitempty" url:"slTriggerBy,omitempty"`
	// Trigger price type
	TriggerBy TriggerBy `json:"triggerBy,omitempty" url:"triggerBy,omitempty"`
	// Limit order price when take profit is triggered. Only working when original order sets partial limit tp/sl. _Option not supported_
	TpLimitPrice string `json:"tpLimitPrice,omitempty" url:"tpLimitPrice,omitempty"`
	// Limit order price when stop loss is triggered. Only working when original order sets partial limit tp/sl. _Option not supported\`_
	SlLimitPrice string `json:"slLimitPrice,omitempty" url:"slLimitPrice,omitempty"`
}

type OrderAmendResult

type OrderAmendResult struct {
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
}

type OrderCancelAllParams

type OrderCancelAllParams struct {
	// Product type. `linear`, `inverse`, `spot`, `option`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	// `linear`&`inverse`: **Required** if not passing baseCoin or settleCoin
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Base coin, uppercase only. `linear` & `inverse`: If cancel all by baseCoin, it will cancel all of the corresponding category's orders. **Required** if not passing symbol or settleCoin
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
	// Settle coin, uppercase only
	//
	// 	- `linear` & `inverse`: **Required** if not passing symbol or baseCoin
	// 	- `option`: USDT or USDC
	// 	- Not support `spot`
	SettleCoin string `json:"settleCoin,omitempty" url:"settleCoin,omitempty"`
	// - category=`spot`, you can pass `Order`, `tpslOrder`, `StopOrder`, `OcoOrder`, `BidirectionalTpslOrder`
	// If not passed, `Order` by default
	// 	- category=`linear` or `inverse`, you can pass `Order`, `StopOrder`,`OpenOrder`
	// If not passed, all kinds of orders will be cancelled, like active order, conditional order, TP/SL order and trailing stop order
	// 	- category=`option`, you can pass `Order`,`StopOrder`
	// If not passed, all kinds of orders will be cancelled, like active order, conditional order, TP/SL order and trailing stop order
	OrderFilter string `json:"orderFilter,omitempty" url:"orderFilter,omitempty"`
	// Stop order type `Stop`
	//
	// 	- Only used for category=`linear` or `inverse` and orderFilter=`StopOrder`,you can cancel conditional orders except TP/SL order and Trailing stop orders with this param
	StopOrderType StopOrderType `json:"stopOrderType,omitempty" url:"stopOrderType,omitempty"`
}

type OrderCancelAllResult

type OrderCancelAllResult struct {
	// Object
	List []OrderCancelAllResultListItem `json:"list,omitempty" url:"list,omitempty"`
	// "1": success, "0": fail. [UTA1.0](/docs/v5/acct-mode#uta-10) (inverse) does not return this field
	Success string `json:"success,omitempty" url:"success,omitempty"`
}

type OrderCancelAllResultListItem

type OrderCancelAllResultListItem struct {
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
}

type OrderCancelBatchParams

type OrderCancelBatchParams struct {
	// Product type `linear`, `option`, `spot`, `inverse`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Object
	Request []OrderCancelBatchParamsRequestItem `json:"request,omitempty" url:"request,omitempty"`
}

type OrderCancelBatchParamsRequestItem

type OrderCancelBatchParamsRequestItem struct {
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Order ID. Either `orderId` or `orderLinkId` is required
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID. Either `orderId` or `orderLinkId` is required
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
}

type OrderCancelBatchResult

type OrderCancelBatchResult struct {
	// Object
	List       []OrderCancelBatchResultListItem `json:"list,omitempty" url:"list,omitempty"`
	RetExtInfo OrderCancelBatchResultRetExtInfo `json:"retExtInfo" url:"retExtInfo"`
}

type OrderCancelBatchResultListItem

type OrderCancelBatchResultListItem struct {
	// Product type
	Category string `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
}

type OrderCancelBatchResultRetExtInfo

type OrderCancelBatchResultRetExtInfo struct {
	// Object
	List []OrderCancelBatchResultRetExtInfoListItem `json:"list,omitempty" url:"list,omitempty"`
}

type OrderCancelBatchResultRetExtInfoListItem

type OrderCancelBatchResultRetExtInfoListItem struct {
	// Success/error code
	Code int64 `json:"code,omitempty" url:"code,omitempty"`
	// Success/error message
	Msg string `json:"msg,omitempty" url:"msg,omitempty"`
}

type OrderCancelParams

type OrderCancelParams struct {
	// Product type. `linear`, `inverse`, `spot`, `option`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Order ID. Either `orderId` or `orderLinkId` is **required**
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID. Either `orderId` or `orderLinkId` is **required**
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// Spot trading **only**
	//
	// 	- `Order`
	// 	- `tpslOrder`
	// 	- `StopOrder`
	//
	// If not passed, `Order` by default
	OrderFilter string `json:"orderFilter,omitempty" url:"orderFilter,omitempty"`
}

type OrderCancelResult

type OrderCancelResult struct {
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
}

type OrderCreateBatchParams

type OrderCreateBatchParams struct {
	// Product type `linear`, `option`, `spot`, `inverse`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Object
	Request []OrderCreateBatchParamsRequestItem `json:"request,omitempty" url:"request,omitempty"`
}

type OrderCreateBatchParamsRequestItem

type OrderCreateBatchParamsRequestItem struct {
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Whether to borrow, `spot`\*\* only. `0`(default): false then spot trading, `1`: true then margin trading
	IsLeverage int64 `json:"isLeverage,omitempty" url:"isLeverage,omitempty"`
	// `Buy`, `Sell`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// `Market`, `Limit`
	OrderType OrderType `json:"orderType,omitempty" url:"orderType,omitempty"`
	// Order quantity
	//
	// 	- Spot: set `marketUnit` for market order qty unit, `quoteCoin` for market buy by default, `baseCoin` for market sell by default
	// 	- Perps, Futures & Option: always use base coin as unit.
	// 	- Perps & Futures: If you pass `qty`\="0" and specify `reduceOnly`\=true&`closeOnTrigger`\=true, you can close the position up to `maxMktOrderQty` or `maxOrderQty` shown on [Get Instruments Info](/docs/v5/market/instrument) of current symbol
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
	// The unit for `qty` when create **Spot market** orders, `orderFilter`\="tpslOrder" and "StopOrder" are supported as well.
	//
	// 	- `baseCoin`: for example, buy BTCUSDT, then "qty" unit is BTC
	// 	- `quoteCoin`: for example, sell BTCUSDT, then "qty" unit is USDT
	MarketUnit string `json:"marketUnit,omitempty" url:"marketUnit,omitempty"`
	// Order price
	//
	// 	- Market order will ignore this field
	// 	- Please check the min price and price precision from [instrument info](/docs/v5/market/instrument#response-parameters) endpoint
	// 	- If you have position, price needs to be better than liquidation price
	Price string `json:"price,omitempty" url:"price,omitempty"`
	// Conditional order param. Used to identify the expected direction of the conditional order.
	//
	// 	- `1`: triggered when market price rises to `triggerPrice`
	// 	- `2`: triggered when market price falls to `triggerPrice`
	//
	// Valid for `linear`
	TriggerDirection int64 `json:"triggerDirection,omitempty" url:"triggerDirection,omitempty"`
	// If it is not passed, `Order` by default.
	//
	// 	- `Order`
	// 	- `tpslOrder`: Spot TP/SL order, the assets are occupied even before the order is triggered
	// 	- `StopOrder`: Spot conditional order, the assets will not be occupied until the price of the underlying asset reaches the trigger price, and the required assets will be occupied after the Conditional order is triggered
	//
	// Valid for `spot` **only**
	OrderFilter string `json:"orderFilter,omitempty" url:"orderFilter,omitempty"`
	// - For Perps & Futures, it is the conditional order trigger price. If you expect the price to rise to trigger your conditional order, make sure:
	// _triggerPrice > market price_
	// Else, _triggerPrice < market price_
	// 	- For spot, it is the `orderFilter`\="tpslOrder", or "StopOrder" trigger price
	TriggerPrice string `json:"triggerPrice,omitempty" url:"triggerPrice,omitempty"`
	// Conditional order param (Perps & Futures). Trigger price type. `LastPrice`, `IndexPrice`, `MarkPrice`
	TriggerBy TriggerBy `json:"triggerBy,omitempty" url:"triggerBy,omitempty"`
	// Implied volatility. `option` **only**. Pass the real value, e.g for 10%, 0.1 should be passed. `orderIv` has a higher priority when `price` is passed as well
	OrderIv string `json:"orderIv,omitempty" url:"orderIv,omitempty"`
	// [Time in force](https://www.bybit.com/en/help-center/article/What-Are-Time-In-Force-TIF-GTC-IOC-FOK)
	//
	// 	- Market order will use `IOC` directly
	// 	- If not passed, `GTC` is used by default
	TimeInForce TimeInForce `json:"timeInForce,omitempty" url:"timeInForce,omitempty"`
	// Used to identify positions in different position modes. Under hedge-mode, this param is **required**
	//
	// 	- `0`: one-way mode
	// 	- `1`: hedge-mode Buy side
	// 	- `2`: hedge-mode Sell side
	PositionIdx PositionIdx `json:"positionIdx,omitempty" url:"positionIdx,omitempty"`
	// User customised order ID. A max of 36 characters. Combinations of numbers, letters (upper and lower cases), dashes, and underscores are supported.
	// _Futures, Perps & Spot: orderLinkId rules:_
	//
	// 	- optional param
	// 	- always unique
	//
	// _Options orderLinkId rules:_
	//
	// 	- **required** param
	// 	- always unique
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// Take profit price
	TakeProfit string `json:"takeProfit,omitempty" url:"takeProfit,omitempty"`
	// Stop loss price
	StopLoss string `json:"stopLoss,omitempty" url:"stopLoss,omitempty"`
	// The price type to trigger take profit. `MarkPrice`, `IndexPrice`, default: `LastPrice`.
	// Valid for `linear`, `inverse`
	TpTriggerBy TriggerBy `json:"tpTriggerBy,omitempty" url:"tpTriggerBy,omitempty"`
	// The price type to trigger stop loss. `MarkPrice`, `IndexPrice`, default: `LastPrice`
	// Valid for `linear`, `inverse`
	SlTriggerBy TriggerBy `json:"slTriggerBy,omitempty" url:"slTriggerBy,omitempty"`
	// [What is a reduce-only order?](https://www.bybit.com/en/help-center/article/Reduce-Only-Order) `true` means your position can only reduce in size if this order is triggered.
	//
	// 	- You **must** specify it as `true` when you are about to close/reduce the position
	// 	- When reduceOnly is true, take profit/stop loss cannot be set
	//
	// Valid for `linear`, `inverse` & `option`
	ReduceOnly bool `json:"reduceOnly,omitempty" url:"reduceOnly,omitempty"`
	// [What is a close on trigger order?](https://www.bybit.com/en/help-center/article/Close-On-Trigger-Order) For a closing order. It can only reduce your position, not increase it. If the account has insufficient available balance when the closing order is triggered, then other active orders of similar contracts will be cancelled or reduced. It can be used to ensure your stop loss reduces your position regardless of current available margin.
	// Valid for `linear`, `inverse`
	CloseOnTrigger bool `json:"closeOnTrigger,omitempty" url:"closeOnTrigger,omitempty"`
	// Smp execution type. [What is SMP?](/docs/v5/smp)
	SmpType SmpType `json:"smpType,omitempty" url:"smpType,omitempty"`
	// Market maker protection. `option` **only**. `true` means set the order as a market maker protection order. [What is mmp?](/docs/v5/account/set-mmp)
	Mmp bool `json:"mmp,omitempty" url:"mmp,omitempty"`
	// TP/SL mode
	//
	// 	- `Full`: entire position for TP/SL. Then, tpOrderType or slOrderType must be `Market`
	// 	- `Partial`: partial position tp/sl (as there is no size option, so it will create tp/sl orders with the qty you actually fill). Limit TP/SL order are supported. Note: When create limit tp/sl, tpslMode is **required** and it must be `Partial`
	//
	// Valid for `linear`, `inverse`
	TpslMode string `json:"tpslMode,omitempty" url:"tpslMode,omitempty"`
	// The limit order price when take profit price is triggered
	//
	// 	- `linear`&`inverse`: only works when tpslMode=Partial and tpOrderType=Limit
	// 	- Spot: it is required when the order has `takeProfit` and `tpOrderType=Limit`
	TpLimitPrice string `json:"tpLimitPrice,omitempty" url:"tpLimitPrice,omitempty"`
	// The limit order price when stop loss price is triggered
	//
	// 	- `linear`&`inverse`: only works when tpslMode=Partial and slOrderType=Limit
	// 	- Spot: it is required when the order has `stopLoss` and `slOrderType=Limit`
	SlLimitPrice string `json:"slLimitPrice,omitempty" url:"slLimitPrice,omitempty"`
	// The order type when take profit is triggered
	//
	// 	- `linear`&`inverse`: `Market`(default), `Limit`. For tpslMode=Full, it only supports tpOrderType=Market
	// 	- Spot:
	// `Market`: when you set "takeProfit",
	// `Limit`: when you set "takeProfit" and "tpLimitPrice"
	TpOrderType string `json:"tpOrderType,omitempty" url:"tpOrderType,omitempty"`
	// The order type when stop loss is triggered
	//
	// 	- `linear`&`inverse`: `Market`(default), `Limit`. For tpslMode=Full, it only supports slOrderType=Market
	// 	- Spot:
	// `Market`: when you set "stopLoss",
	// `Limit`: when you set "stopLoss" and "slLimitPrice"
	SlOrderType string `json:"slOrderType,omitempty" url:"slOrderType,omitempty"`
}

type OrderCreateBatchResult

type OrderCreateBatchResult struct {
	// Object
	List       []OrderCreateBatchResultListItem `json:"list,omitempty" url:"list,omitempty"`
	RetExtInfo OrderCreateBatchResultRetExtInfo `json:"retExtInfo" url:"retExtInfo"`
}

type OrderCreateBatchResultListItem

type OrderCreateBatchResultListItem struct {
	// Product type
	Category string `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// Order created time (ms)
	CreateAt string `json:"createAt,omitempty" url:"createAt,omitempty"`
}

type OrderCreateBatchResultRetExtInfo

type OrderCreateBatchResultRetExtInfo struct {
	// Object
	List []OrderCreateBatchResultRetExtInfoListItem `json:"list,omitempty" url:"list,omitempty"`
}

type OrderCreateBatchResultRetExtInfoListItem

type OrderCreateBatchResultRetExtInfoListItem struct {
	// Success/error code
	Code int64 `json:"code,omitempty" url:"code,omitempty"`
	// Success/error message
	Msg string `json:"msg,omitempty" url:"msg,omitempty"`
}

type OrderCreateParams

type OrderCreateParams struct {
	// Product type `linear`, `inverse`, `spot`, `option`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Whether to borrow.
	//
	// 	- `0`(default): false, spot trading
	// 	- `1`: true, margin trading, _make sure you turn on margin trading, and set the relevant currency as collateral_
	IsLeverage int64 `json:"isLeverage,omitempty" url:"isLeverage,omitempty"`
	// `Buy`, `Sell`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// `Market`, `Limit`
	OrderType OrderType `json:"orderType,omitempty" url:"orderType,omitempty"`
	// Order quantity
	//
	// 	- Spot: Market Buy order by value by default, you can set `marketUnit` field to choose order by value or qty for market orders
	// 	- Perps, Futures & Option: always order by qty
	// 	- Perps & Futures: if you pass `qty`\="0" and specify `reduceOnly`\=true&`closeOnTrigger`\=true, you can close the position up to `maxMktOrderQty` or `maxOrderQty` shown on [Get Instruments Info](/docs/v5/market/instrument) of current symbol
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
	// Select the unit for `qty` when create **Spot market** orders
	//
	// 	- `baseCoin`: for example, buy BTCUSDT, then "qty" unit is BTC
	// 	- `quoteCoin`: for example, sell BTCUSDT, then "qty" unit is USDT
	MarketUnit string `json:"marketUnit,omitempty" url:"marketUnit,omitempty"`
	// Slippage tolerance Type for **market order**, `TickSize`, `Percent`
	//
	// 	- take profit, stoploss, conditional orders are not supported
	// 	- **TickSize**:
	// the highest price of Buy order = ask1 + `slippageTolerance` x tickSize;
	// the lowest price of Sell order = bid1 - `slippageTolerance` x tickSize
	// 	- **Percent**:
	// the highest price of Buy order = ask1 x (1 + `slippageTolerance` x 0.01);
	// the lowest price of Sell order = bid1 x (1 - `slippageTolerance` x 0.01)
	// 	- Learn more about slippage tolerance in the [help centre](https://www.bybit.com/en/help-center/article/Market-Order-with-Slippage-Tolerance)
	SlippageToleranceType string `json:"slippageToleranceType,omitempty" url:"slippageToleranceType,omitempty"`
	// Slippage tolerance value
	//
	// 	- `TickSize`: range is \[1, 10000\], integer only
	// 	- `Percent`: range is \[0.01, 10\], up to 2 decimals
	SlippageTolerance string `json:"slippageTolerance,omitempty" url:"slippageTolerance,omitempty"`
	// Order price
	//
	// 	- Market order will ignore this field
	// 	- Please check the min price and price precision from [instrument info](/docs/v5/market/instrument#response-parameters) endpoint
	// 	- If you have position, price needs to be better than liquidation price
	Price string `json:"price,omitempty" url:"price,omitempty"`
	// Conditional order param. Used to identify the expected direction of the conditional order.
	//
	// 	- `1`: triggered when market price rises to `triggerPrice`
	// 	- `2`: triggered when market price falls to `triggerPrice`
	//
	// Valid for `linear` & `inverse`
	TriggerDirection int64 `json:"triggerDirection,omitempty" url:"triggerDirection,omitempty"`
	// If it is not passed, `Order` by default.
	//
	// 	- `Order`
	// 	- `tpslOrder`: Spot TP/SL order, the assets are occupied even before the order is triggered
	// 	- `StopOrder`: Spot conditional order, the assets will not be occupied until the price of the underlying asset reaches the trigger price, and the required assets will be occupied after the Conditional order is triggered
	//
	// Valid for `spot` **only**
	OrderFilter string `json:"orderFilter,omitempty" url:"orderFilter,omitempty"`
	// - For Perps & Futures, it is the conditional order trigger price. If you expect the price to rise to trigger your conditional order, make sure:
	// _triggerPrice > market price_
	// Else, _triggerPrice < market price_
	// 	- For spot, it is the TP/SL and Conditional order trigger price
	TriggerPrice string `json:"triggerPrice,omitempty" url:"triggerPrice,omitempty"`
	// Trigger price type, Conditional order param for Perps & Futures.
	//
	// 	- `LastPrice`
	// 	- `IndexPrice`
	// 	- `MarkPrice`
	//
	// Valid for `linear` & `inverse`
	TriggerBy TriggerBy `json:"triggerBy,omitempty" url:"triggerBy,omitempty"`
	// Implied volatility. `option` **only**. Pass the real value, e.g for 10%, 0.1 should be passed. `orderIv` has a higher priority when `price` is passed as well
	OrderIv string `json:"orderIv,omitempty" url:"orderIv,omitempty"`
	// [Time in force](https://www.bybit.com/en/help-center/article/What-Are-Time-In-Force-TIF-GTC-IOC-FOK)
	//
	// 	- Market order will always use `IOC`
	// 	- If not passed, `GTC` is used by default
	TimeInForce TimeInForce `json:"timeInForce,omitempty" url:"timeInForce,omitempty"`
	// Used to identify positions in different position modes. Under hedge-mode, this param is **required**
	//
	// 	- `0`: one-way mode
	// 	- `1`: hedge-mode Buy side
	// 	- `2`: hedge-mode Sell side
	PositionIdx PositionIdx `json:"positionIdx,omitempty" url:"positionIdx,omitempty"`
	// User customised order ID. A max of 36 characters. Combinations of numbers, letters (upper and lower cases), dashes, and underscores are supported.
	// _Futures, Perps & Spot: orderLinkId rules:_
	//
	// 	- optional param
	// 	- always unique
	//
	// _Options orderLinkId rules:_
	//
	// 	- **required** param
	// 	- always unique
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// Take profit price
	//
	// 	- Spot Limit order supports take profit, stop loss or limit take profit, limit stop loss when creating an order
	TakeProfit string `json:"takeProfit,omitempty" url:"takeProfit,omitempty"`
	// Stop loss price
	//
	// 	- Spot Limit order supports take profit, stop loss or limit take profit, limit stop loss when creating an order
	StopLoss string `json:"stopLoss,omitempty" url:"stopLoss,omitempty"`
	// The price type to trigger take profit. `MarkPrice`, `IndexPrice`, default: `LastPrice`. Valid for `linear` & `inverse`
	TpTriggerBy TriggerBy `json:"tpTriggerBy,omitempty" url:"tpTriggerBy,omitempty"`
	// The price type to trigger stop loss. `MarkPrice`, `IndexPrice`, default: `LastPrice`. Valid for `linear` & `inverse`
	SlTriggerBy TriggerBy `json:"slTriggerBy,omitempty" url:"slTriggerBy,omitempty"`
	// [What is a reduce-only order?](https://www.bybit.com/en/help-center/article/Reduce-Only-Order) `true` means your position can only reduce in size if this order is triggered.
	//
	// 	- You **must** specify it as `true` when you are about to close/reduce the position
	// 	- When reduceOnly is true, take profit/stop loss cannot be set
	//
	// Valid for `linear`, `inverse` & `option`
	ReduceOnly bool `json:"reduceOnly,omitempty" url:"reduceOnly,omitempty"`
	// [What is a close on trigger order?](https://www.bybit.com/en/help-center/article/Close-On-Trigger-Order) For a closing order. It can only reduce your position, not increase it. If the account has insufficient available balance when the closing order is triggered, then other active orders of similar contracts will be cancelled or reduced. It can be used to ensure your stop loss reduces your position regardless of current available margin.
	// Valid for `linear` & `inverse`
	CloseOnTrigger bool `json:"closeOnTrigger,omitempty" url:"closeOnTrigger,omitempty"`
	// Smp execution type. [What is SMP?](/docs/v5/smp)
	SmpType SmpType `json:"smpType,omitempty" url:"smpType,omitempty"`
	// Market maker protection. `option` **only**. `true` means set the order as a market maker protection order. [What is mmp?](/docs/v5/account/set-mmp)
	Mmp bool `json:"mmp,omitempty" url:"mmp,omitempty"`
	// TP/SL mode
	//
	// 	- `Full`: entire position for TP/SL. Then, tpOrderType or slOrderType must be `Market`
	// 	- `Partial`: partial position tp/sl (as there is no size option, so it will create tp/sl orders with the qty you actually fill). Limit TP/SL order are supported. Note: When create limit tp/sl, tpslMode is **required** and it must be `Partial`
	//
	// Valid for `linear` & `inverse`
	TpslMode string `json:"tpslMode,omitempty" url:"tpslMode,omitempty"`
	// The limit order price when take profit price is triggered
	//
	// 	- `linear` & `inverse`: only works when tpslMode=Partial and tpOrderType=Limit
	// 	- Spot: it is required when the order has `takeProfit` and "tpOrderType"=`Limit`
	TpLimitPrice string `json:"tpLimitPrice,omitempty" url:"tpLimitPrice,omitempty"`
	// The limit order price when stop loss price is triggered
	//
	// 	- `linear` & `inverse`: only works when tpslMode=Partial and slOrderType=Limit
	// 	- Spot: it is required when the order has `stopLoss` and "slOrderType"=`Limit`
	SlLimitPrice string `json:"slLimitPrice,omitempty" url:"slLimitPrice,omitempty"`
	// The order type when take profit is triggered
	//
	// 	- `linear` & `inverse`: `Market`(default), `Limit`. For tpslMode=Full, it only supports tpOrderType=Market
	// 	- Spot:
	// `Market`: when you set "takeProfit",
	// `Limit`: when you set "takeProfit" and "tpLimitPrice"
	TpOrderType string `json:"tpOrderType,omitempty" url:"tpOrderType,omitempty"`
	// The order type when stop loss is triggered
	//
	// 	- `linear` & `inverse`: `Market`(default), `Limit`. For tpslMode=Full, it only supports slOrderType=Market
	// 	- Spot:
	// `Market`: when you set "stopLoss",
	// `Limit`: when you set "stopLoss" and "slLimitPrice"
	SlOrderType string `json:"slOrderType,omitempty" url:"slOrderType,omitempty"`
	// - `Queue`: use the order price on the orderbook in the same direction as the `side`
	// 	- `Counterparty`: use the order price on the orderbook in the opposite direction as the `side`
	//
	// Valid for `linear` & `inverse`
	BboSideType string `json:"bboSideType,omitempty" url:"bboSideType,omitempty"`
	// `1`,`2`,`3`,`4`,`5` Valid for `linear` & `inverse`
	BboLevel string `json:"bboLevel,omitempty" url:"bboLevel,omitempty"`
}

type OrderCreateResult

type OrderCreateResult struct {
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
}

type OrderDisconnectedCancelAllParams

type OrderDisconnectedCancelAllParams struct {
	// `OPTIONS`(default), `DERIVATIVES`, `SPOT`
	Product Product `json:"product,omitempty" url:"product,omitempty"`
	// Disconnection timing window time. \[`3`, `300`\], unit: second
	TimeWindow int64 `json:"timeWindow,omitempty" url:"timeWindow,omitempty"`
}

type OrderHistory

type OrderHistory struct {
	// Product type
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Object
	List []OrderHistoryListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type OrderHistoryListItem

type OrderHistoryListItem struct {
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// Indicates the linked parent order for attached take-profit and stop-loss orders. Supported for futures and options.
	//
	// 	- [Amending](/docs/v5/order/amend-order) take-profit or stop-loss orders does not change the parentOrderLinkId
	// 	- **Futures**: using [set trading stop](/docs/v5/position/trading-stop) to update attached TP/SL from the original order does not change the parentOrderLinkId.
	// 	- **Options**: using [set trading stop](/docs/v5/position/trading-stop) to update attached TP/SL from the original order will change the parentOrderLinkId.
	// 	- **Futures & Options**: if TP/SL is set via [set trading stop](/docs/v5/position/trading-stop) for a position that originally has no attached TP/SL, the parentOrderLinkId is meaningless.
	ParentOrderLinkId string `json:"parentOrderLinkId,omitempty" url:"parentOrderLinkId,omitempty"`
	// Block trade ID
	BlockTradeId string `json:"blockTradeId,omitempty" url:"blockTradeId,omitempty"`
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Order price
	Price string `json:"price,omitempty" url:"price,omitempty"`
	// Order qty
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
	// Side. `Buy`,`Sell`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Whether to borrow. `0`: false, `1`: true.
	IsLeverage string `json:"isLeverage,omitempty" url:"isLeverage,omitempty"`
	// Position index. Used to identify positions in different position modes
	PositionIdx PositionIdx `json:"positionIdx,omitempty" url:"positionIdx,omitempty"`
	// Order status
	OrderStatus OrderStatus `json:"orderStatus,omitempty" url:"orderStatus,omitempty"`
	// Order create type. Spot does not have this key
	CreateType CreateType `json:"createType,omitempty" url:"createType,omitempty"`
	// Cancel type
	CancelType CancelType `json:"cancelType,omitempty" url:"cancelType,omitempty"`
	// Reject reason
	RejectReason RejectReason `json:"rejectReason,omitempty" url:"rejectReason,omitempty"`
	// Average filled price, returns `""` for those orders without avg price
	AvgPrice string `json:"avgPrice,omitempty" url:"avgPrice,omitempty"`
	// The remaining qty not executed
	LeavesQty string `json:"leavesQty,omitempty" url:"leavesQty,omitempty"`
	// The estimated value not executed
	LeavesValue string `json:"leavesValue,omitempty" url:"leavesValue,omitempty"`
	// Cumulative executed order qty
	CumExecQty string `json:"cumExecQty,omitempty" url:"cumExecQty,omitempty"`
	// Cumulative executed order value
	CumExecValue string `json:"cumExecValue,omitempty" url:"cumExecValue,omitempty"`
	// - `inverse`, `option`: Cumulative executed trading fee.
	// 	- `linear`, `spot`: Deprecated. Use `cumFeeDetail` instead.
	CumExecFee string `json:"cumExecFee,omitempty" url:"cumExecFee,omitempty"`
	// Time in force
	TimeInForce TimeInForce `json:"timeInForce,omitempty" url:"timeInForce,omitempty"`
	// Order type. `Market`,`Limit`. For TP/SL orders, is the order type after the order was triggered
	//
	// 	- `Block trade Roll Back`, `Block trade-Limit`: Unique enum values for Unified account block trades
	OrderType OrderType `json:"orderType,omitempty" url:"orderType,omitempty"`
	// Stop order type
	StopOrderType StopOrderType `json:"stopOrderType,omitempty" url:"stopOrderType,omitempty"`
	// Implied volatility
	OrderIv string `json:"orderIv,omitempty" url:"orderIv,omitempty"`
	// The unit for `qty` when create **Spot market** orders. `baseCoin`, `quoteCoin`
	MarketUnit string `json:"marketUnit,omitempty" url:"marketUnit,omitempty"`
	// Spot and Futures market order slippage tolerance type `TickSize`, `Percent`, `UNKNOWN`(default)
	SlippageToleranceType string `json:"slippageToleranceType,omitempty" url:"slippageToleranceType,omitempty"`
	// Slippage tolerance value
	SlippageTolerance string `json:"slippageTolerance,omitempty" url:"slippageTolerance,omitempty"`
	// Trigger price. If `stopOrderType`\=_TrailingStop_, it is activate price. Otherwise, it is trigger price
	TriggerPrice string `json:"triggerPrice,omitempty" url:"triggerPrice,omitempty"`
	// Take profit price
	TakeProfit string `json:"takeProfit,omitempty" url:"takeProfit,omitempty"`
	// Stop loss price
	StopLoss string `json:"stopLoss,omitempty" url:"stopLoss,omitempty"`
	// TP/SL mode, `Full`: entire position for TP/SL. `Partial`: partial position tp/sl. Spot does not have this field, and Option returns always ""
	TpslMode string `json:"tpslMode,omitempty" url:"tpslMode,omitempty"`
	// The trigger type of Spot OCO order.`OcoTriggerByUnknown`, `OcoTriggerByTp`, `OcoTriggerBySl`
	OcoTriggerBy string `json:"ocoTriggerBy,omitempty" url:"ocoTriggerBy,omitempty"`
	// The limit order price when take profit price is triggered
	TpLimitPrice string `json:"tpLimitPrice,omitempty" url:"tpLimitPrice,omitempty"`
	// The limit order price when stop loss price is triggered
	SlLimitPrice string `json:"slLimitPrice,omitempty" url:"slLimitPrice,omitempty"`
	// The price type to trigger take profit
	TpTriggerBy TriggerBy `json:"tpTriggerBy,omitempty" url:"tpTriggerBy,omitempty"`
	// The price type to trigger stop loss
	SlTriggerBy TriggerBy `json:"slTriggerBy,omitempty" url:"slTriggerBy,omitempty"`
	// Trigger direction. `1`: rise, `2`: fall
	TriggerDirection int64 `json:"triggerDirection,omitempty" url:"triggerDirection,omitempty"`
	// The price type of trigger price
	TriggerBy TriggerBy `json:"triggerBy,omitempty" url:"triggerBy,omitempty"`
	// Last price when place the order, Spot is not applicable
	LastPriceOnCreated string `json:"lastPriceOnCreated,omitempty" url:"lastPriceOnCreated,omitempty"`
	// Last price when place the order, Spot has this field only
	BasePrice string `json:"basePrice,omitempty" url:"basePrice,omitempty"`
	// Reduce only. `true` means reduce position size
	ReduceOnly bool `json:"reduceOnly,omitempty" url:"reduceOnly,omitempty"`
	// Close on trigger. [What is a close on trigger order?](https://www.bybit.com/en/help-center/article/Close-On-Trigger-Order)
	CloseOnTrigger bool `json:"closeOnTrigger,omitempty" url:"closeOnTrigger,omitempty"`
	// Place type, `option` used. `iv`, `price`
	PlaceType string `json:"placeType,omitempty" url:"placeType,omitempty"`
	// SMP execution type
	SmpType SmpType `json:"smpType,omitempty" url:"smpType,omitempty"`
	// Smp group ID. If the UID has no group, it is `0` by default
	SmpGroup int64 `json:"smpGroup,omitempty" url:"smpGroup,omitempty"`
	// The counterparty's orderID which triggers this SMP execution
	SmpOrderId string `json:"smpOrderId,omitempty" url:"smpOrderId,omitempty"`
	// Order created timestamp (ms)
	CreatedTime string `json:"createdTime,omitempty" url:"createdTime,omitempty"`
	// Order updated timestamp (ms)
	UpdatedTime string `json:"updatedTime,omitempty" url:"updatedTime,omitempty"`
	// Trading fee rate information. Currently, this data is returned only for spot orders placed on the Indonesian site or spot fiat currency orders placed on the EU site. In other cases, an empty string is returned. Enum: [feeType](/docs/v5/enum#extrafeesfeetype), [subFeeType](/docs/v5/enum#extrafeessubfeetype)
	ExtraFees string `json:"extraFees,omitempty" url:"extraFees,omitempty"`
	// - `linear`, `spot`: Cumulative trading fee details instead of `cumExecFee`
	CumFeeDetail []byte `json:"cumFeeDetail,omitempty" url:"cumFeeDetail,omitempty"`
}

type OrderHistoryQuery

type OrderHistoryQuery struct {
	// Product type `linear`, `inverse`, `spot`, `option`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Base coin, uppercase only
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
	// Settle coin, uppercase only
	SettleCoin string `json:"settleCoin,omitempty" url:"settleCoin,omitempty"`
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// `Order`: active order
	// `StopOrder`: conditional order for Futures and Spot
	// `tpslOrder`: spot TP/SL order
	// `OcoOrder`: spot OCO orders
	// `BidirectionalTpslOrder`: Spot bidirectional TPSL order
	//
	// 	- all kinds of orders are returned by default
	OrderFilter string `json:"orderFilter,omitempty" url:"orderFilter,omitempty"`
	// Order status
	OrderStatus OrderStatus `json:"orderStatus,omitempty" url:"orderStatus,omitempty"`
	// The start timestamp (ms)
	//
	// 	- startTime and endTime are not passed, return 7 days by default
	// 	- Only startTime is passed, return range between startTime and startTime+7 days
	// 	- Only endTime is passed, return range between endTime-7 days and endTime
	// 	- If both are passed, the rule is endTime - startTime <= 7 days
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms)
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Limit for data size per page. \[`1`, `50`\]. Default: `20`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type OrderPreCheckResult

type OrderPreCheckResult struct {
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// Initial margin rate before checking, keep four decimal places. For examples, 30 means IMR = 30/1e4 = 0.30%
	PreImrE4 int64 `json:"preImrE4,omitempty" url:"preImrE4,omitempty"`
	// Maintenance margin rate before checking, keep four decimal places. For examples, 30 means MMR = 30/1e4 = 0.30%
	PreMmrE4 int64 `json:"preMmrE4,omitempty" url:"preMmrE4,omitempty"`
	// Initial margin rate calculated after checking, keep four decimal places. For examples, 30 means IMR = 30/1e4 = 0.30%
	PostImrE4 int64 `json:"postImrE4,omitempty" url:"postImrE4,omitempty"`
	// Maintenance margin rate calculated after checking, keep four decimal places. For examples, 30 means MMR = 30/1e4 = 0.30%
	PostMmrE4 int64 `json:"postMmrE4,omitempty" url:"postMmrE4,omitempty"`
}

type OrderRealtime

type OrderRealtime struct {
	// Product type
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
	// Object
	List []OrderRealtimeListItem `json:"list,omitempty" url:"list,omitempty"`
}

type OrderRealtimeListItem

type OrderRealtimeListItem struct {
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// Indicates the linked parent order for attached take-profit and stop-loss orders. Supported for futures and options.
	//
	// 	- [Amending](/docs/v5/order/amend-order) take-profit or stop-loss orders does not change the parentOrderLinkId
	// 	- **Futures**: using [set trading stop](/docs/v5/position/trading-stop) to update attached TP/SL from the original order does not change the parentOrderLinkId.
	// 	- **Options**: using [set trading stop](/docs/v5/position/trading-stop) to update attached TP/SL from the original order will change the parentOrderLinkId.
	// 	- **Futures & Options**: if TP/SL is set via [set trading stop](/docs/v5/position/trading-stop)for a position that originally has no attached TP/SL, the parentOrderLinkId is meaningless.
	ParentOrderLinkId string `json:"parentOrderLinkId,omitempty" url:"parentOrderLinkId,omitempty"`
	// Paradigm block trade ID
	BlockTradeId string `json:"blockTradeId,omitempty" url:"blockTradeId,omitempty"`
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Order price
	Price string `json:"price,omitempty" url:"price,omitempty"`
	// Order qty
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
	// Side. `Buy`,`Sell`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Whether to borrow `0`: false, `1`: true
	IsLeverage string `json:"isLeverage,omitempty" url:"isLeverage,omitempty"`
	// Position index. Used to identify positions in different position modes.
	PositionIdx PositionIdx `json:"positionIdx,omitempty" url:"positionIdx,omitempty"`
	// Order status
	OrderStatus OrderStatus `json:"orderStatus,omitempty" url:"orderStatus,omitempty"`
	// Order create type
	//
	// 	- Spot does not have this key
	CreateType CreateType `json:"createType,omitempty" url:"createType,omitempty"`
	// Cancel type
	CancelType CancelType `json:"cancelType,omitempty" url:"cancelType,omitempty"`
	// Reject reason
	RejectReason RejectReason `json:"rejectReason,omitempty" url:"rejectReason,omitempty"`
	// Average filled price, returns `""` for those orders without avg price
	AvgPrice string `json:"avgPrice,omitempty" url:"avgPrice,omitempty"`
	// The remaining qty not executed
	LeavesQty string `json:"leavesQty,omitempty" url:"leavesQty,omitempty"`
	// The estimated value not executed
	LeavesValue string `json:"leavesValue,omitempty" url:"leavesValue,omitempty"`
	// Cumulative executed order qty
	CumExecQty string `json:"cumExecQty,omitempty" url:"cumExecQty,omitempty"`
	// Cumulative executed order value
	CumExecValue string `json:"cumExecValue,omitempty" url:"cumExecValue,omitempty"`
	// - `inverse`, `option`: Cumulative executed trading fee.
	// 	- `linear`, `spot`: Deprecated. Use `cumFeeDetail` instead.
	CumExecFee string `json:"cumExecFee,omitempty" url:"cumExecFee,omitempty"`
	// Time in force
	TimeInForce TimeInForce `json:"timeInForce,omitempty" url:"timeInForce,omitempty"`
	// Order type. `Market`,`Limit`. For TP/SL orders, is the order type after the order was triggered
	OrderType OrderType `json:"orderType,omitempty" url:"orderType,omitempty"`
	// Stop order type
	StopOrderType StopOrderType `json:"stopOrderType,omitempty" url:"stopOrderType,omitempty"`
	// Implied volatility
	OrderIv string `json:"orderIv,omitempty" url:"orderIv,omitempty"`
	// The unit for `qty` when create **Spot market** orders. `baseCoin`, `quoteCoin`
	MarketUnit string `json:"marketUnit,omitempty" url:"marketUnit,omitempty"`
	// Trigger price. If `stopOrderType`\=_TrailingStop_, it is activate price. Otherwise, it is trigger price
	TriggerPrice string `json:"triggerPrice,omitempty" url:"triggerPrice,omitempty"`
	// Take profit price
	TakeProfit string `json:"takeProfit,omitempty" url:"takeProfit,omitempty"`
	// Stop loss price
	StopLoss string `json:"stopLoss,omitempty" url:"stopLoss,omitempty"`
	// TP/SL mode, `Full`: entire position for TP/SL. `Partial`: partial position tp/sl. Spot does not have this field, and Option returns always ""
	TpslMode string `json:"tpslMode,omitempty" url:"tpslMode,omitempty"`
	// The trigger type of Spot OCO order.`OcoTriggerByUnknown`, `OcoTriggerByTp`, `OcoTriggerByBySl`
	OcoTriggerBy string `json:"ocoTriggerBy,omitempty" url:"ocoTriggerBy,omitempty"`
	// The limit order price when take profit price is triggered
	TpLimitPrice string `json:"tpLimitPrice,omitempty" url:"tpLimitPrice,omitempty"`
	// The limit order price when stop loss price is triggered
	SlLimitPrice string `json:"slLimitPrice,omitempty" url:"slLimitPrice,omitempty"`
	// The price type to trigger take profit
	TpTriggerBy TriggerBy `json:"tpTriggerBy,omitempty" url:"tpTriggerBy,omitempty"`
	// The price type to trigger stop loss
	SlTriggerBy TriggerBy `json:"slTriggerBy,omitempty" url:"slTriggerBy,omitempty"`
	// Trigger direction. `1`: rise, `2`: fall
	TriggerDirection int64 `json:"triggerDirection,omitempty" url:"triggerDirection,omitempty"`
	// The price type of trigger price
	TriggerBy TriggerBy `json:"triggerBy,omitempty" url:"triggerBy,omitempty"`
	// Last price when place the order, Spot is not applicable
	LastPriceOnCreated string `json:"lastPriceOnCreated,omitempty" url:"lastPriceOnCreated,omitempty"`
	// Last price when place the order, Spot has this field only
	BasePrice string `json:"basePrice,omitempty" url:"basePrice,omitempty"`
	// Reduce only. `true` means reduce position size
	ReduceOnly bool `json:"reduceOnly,omitempty" url:"reduceOnly,omitempty"`
	// Close on trigger. [What is a close on trigger order?](https://www.bybit.com/en/help-center/article/Close-On-Trigger-Order)
	CloseOnTrigger bool `json:"closeOnTrigger,omitempty" url:"closeOnTrigger,omitempty"`
	// Place type, `option` used. `iv`, `price`
	PlaceType string `json:"placeType,omitempty" url:"placeType,omitempty"`
	// SMP execution type
	SmpType SmpType `json:"smpType,omitempty" url:"smpType,omitempty"`
	// Smp group ID. If the UID has no group, it is `0` by default
	SmpGroup int64 `json:"smpGroup,omitempty" url:"smpGroup,omitempty"`
	// The counterparty's orderID which triggers this SMP execution
	SmpOrderId string `json:"smpOrderId,omitempty" url:"smpOrderId,omitempty"`
	// Order created timestamp (ms)
	CreatedTime string `json:"createdTime,omitempty" url:"createdTime,omitempty"`
	// Order updated timestamp (ms)
	UpdatedTime string `json:"updatedTime,omitempty" url:"updatedTime,omitempty"`
	// - `linear`, `spot`: Cumulative trading fee details instead of `cumExecFee`
	CumFeeDetail []byte `json:"cumFeeDetail,omitempty" url:"cumFeeDetail,omitempty"`
}

type OrderRealtimeQuery

type OrderRealtimeQuery struct {
	// Product type `linear`, `inverse`, `spot`, `option`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only. For **linear**, either `symbol`, `baseCoin`, `settleCoin` is **required**
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Base coin, uppercase only
	//
	// 	- Supports `linear`, `inverse` & `option`
	// 	- `option`: it returns all option open orders by default
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
	// Settle coin, uppercase only
	//
	// 	- **linear**: either `symbol`, `baseCoin` or `settleCoin` is **required**
	// 	- `spot`: not supported
	// 	- `option`: USDT or USDC
	SettleCoin string `json:"settleCoin,omitempty" url:"settleCoin,omitempty"`
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// - `0`(default): query open status orders (e.g., New, PartiallyFilled) **only**
	// 	- `1`: Query a maximum of recent 500 closed status records are kept under each account each category (e.g., Cancelled, Rejected, Filled orders).
	// _If the Bybit service is restarted due to an update, this part of the data will be cleared and accumulated again, but the order records will still be queried in [order history](/docs/v5/order/order-list)_
	// 	- `openOnly` param will be ignored when query by _orderId_ or _orderLinkId_
	OpenOnly int64 `json:"openOnly,omitempty" url:"openOnly,omitempty"`
	// `Order`: active order, `StopOrder`: conditional order for Futures and Spot, `tpslOrder`: spot TP/SL order, `OcoOrder`: Spot oco order, `BidirectionalTpslOrder`: Spot bidirectional TPSL order
	//
	// 	- all kinds of orders by default
	OrderFilter string `json:"orderFilter,omitempty" url:"orderFilter,omitempty"`
	// Limit for data size per page. \[`1`, `50`\]. Default: `20`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type OrderSpotBorrowCheck

type OrderSpotBorrowCheck struct {
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Side
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// The maximum base coin qty can be traded
	//
	// 	- If spot margin trade on and symbol is margin trading pair, it returns available balance + max.borrowable quantity = min(The maximum quantity that a single user can borrow on the platform, The maximum quantity that can be borrowed calculated by IMR MMR of UTA account, The available quantity of the platform's capital pool)
	// 	- Otherwise, it returns actual available balance
	// 	- up to 4 decimals
	MaxTradeQty string `json:"maxTradeQty,omitempty" url:"maxTradeQty,omitempty"`
	// The maximum quote coin amount can be traded
	//
	// 	- If spot margin trade on and symbol is margin trading pair, it returns available balance + max.borrowable amount = min(The maximum amount that a single user can borrow on the platform, The maximum amount that can be borrowed calculated by IMR MMR of UTA account, The available amount of the platform's capital pool)
	// 	- Otherwise, it returns actual available balance
	// 	- up to 8 decimals
	MaxTradeAmount string `json:"maxTradeAmount,omitempty" url:"maxTradeAmount,omitempty"`
	// No matter your Spot margin switch on or not, it always returns actual qty of base coin you can trade or you have (borrowable qty is not included), up to 4 decimals
	SpotMaxTradeQty string `json:"spotMaxTradeQty,omitempty" url:"spotMaxTradeQty,omitempty"`
	// No matter your Spot margin switch on or not, it always returns actual amount of quote coin you can trade or you have (borrowable amount is not included), up to 8 decimals
	SpotMaxTradeAmount string `json:"spotMaxTradeAmount,omitempty" url:"spotMaxTradeAmount,omitempty"`
	// Borrow coin
	BorrowCoin string `json:"borrowCoin,omitempty" url:"borrowCoin,omitempty"`
}

type OrderSpotBorrowCheckQuery

type OrderSpotBorrowCheckQuery struct {
	// Product type `spot`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Transaction side. `Buy`,`Sell`
	Side string `json:"side,omitempty" url:"side,omitempty"`
}

type OrderStatus

type OrderStatus string
const (
	OrderStatusNew                     OrderStatus = "New"
	OrderStatusPartiallyFilled         OrderStatus = "PartiallyFilled"
	OrderStatusUntriggered             OrderStatus = "Untriggered"
	OrderStatusRejected                OrderStatus = "Rejected"
	OrderStatusPartiallyFilledCanceled OrderStatus = "PartiallyFilledCanceled"
	OrderStatusFilled                  OrderStatus = "Filled"
	OrderStatusCancelled               OrderStatus = "Cancelled"
	OrderStatusTriggered               OrderStatus = "Triggered"
	OrderStatusDeactivated             OrderStatus = "Deactivated"
)

type OrderType

type OrderType string
const (
	OrderTypeMarket   OrderType = "Market"
	OrderTypeLimit    OrderType = "Limit"
	OrderTypeUnknown  OrderType = "UNKNOWN"
	OrderTypeExecType OrderType = "execType"
	OrderTypeFunding  OrderType = "Funding"
)

type PositionAddMarginParams

type PositionAddMarginParams struct {
	// Product type `linear`, `inverse`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Add or reduce. To add, then `10`; To reduce, then `-10`. Support up to 4 decimal
	Margin string `json:"margin,omitempty" url:"margin,omitempty"`
	// Used to identify positions in different position modes. For hedge mode position, this param is **required**
	//
	// 	- `0`: one-way mode
	// 	- `1`: hedge-mode Buy side
	// 	- `2`: hedge-mode Sell side
	PositionIdx PositionIdx `json:"positionIdx,omitempty" url:"positionIdx,omitempty"`
}

type PositionAddMarginResult

type PositionAddMarginResult struct {
	// Product type
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Position idx, used to identify positions in different position modes
	//
	// 	- `0`: One-Way Mode
	// 	- `1`: Buy side of both side mode
	// 	- `2`: Sell side of both side mode
	PositionIdx PositionIdx `json:"positionIdx,omitempty" url:"positionIdx,omitempty"`
	// Risk limit ID
	RiskId int64 `json:"riskId,omitempty" url:"riskId,omitempty"`
	// Risk limit value
	RiskLimitValue string `json:"riskLimitValue,omitempty" url:"riskLimitValue,omitempty"`
	// Position size
	Size string `json:"size,omitempty" url:"size,omitempty"`
	// Average entry price
	AvgPrice string `json:"avgPrice,omitempty" url:"avgPrice,omitempty"`
	// Liquidation price
	LiqPrice string `json:"liqPrice,omitempty" url:"liqPrice,omitempty"`
	// Bankruptcy price
	BustPrice string `json:"bustPrice,omitempty" url:"bustPrice,omitempty"`
	// Last mark price
	MarkPrice string `json:"markPrice,omitempty" url:"markPrice,omitempty"`
	// Position value
	PositionValue string `json:"positionValue,omitempty" url:"positionValue,omitempty"`
	// Position leverage
	Leverage string `json:"leverage,omitempty" url:"leverage,omitempty"`
	// Whether to add margin automatically. `0`: false, `1`: true
	AutoAddMargin int64 `json:"autoAddMargin,omitempty" url:"autoAddMargin,omitempty"`
	// Position status. `Normal`, `Liq`, `Adl`
	PositionStatus PositionStatus `json:"positionStatus,omitempty" url:"positionStatus,omitempty"`
	// Initial margin
	PositionIm string `json:"positionIM,omitempty" url:"positionIM,omitempty"`
	// Maintenance margin
	PositionMm string `json:"positionMM,omitempty" url:"positionMM,omitempty"`
	// Take profit price
	TakeProfit string `json:"takeProfit,omitempty" url:"takeProfit,omitempty"`
	// Stop loss price
	StopLoss string `json:"stopLoss,omitempty" url:"stopLoss,omitempty"`
	// Trailing stop (The distance from market price)
	TrailingStop string `json:"trailingStop,omitempty" url:"trailingStop,omitempty"`
	// Unrealised PnL
	UnrealisedPnl string `json:"unrealisedPnl,omitempty" url:"unrealisedPnl,omitempty"`
	// Cumulative realised pnl
	CumRealisedPnl string `json:"cumRealisedPnl,omitempty" url:"cumRealisedPnl,omitempty"`
	// Timestamp of the first time a position was created on this symbol (ms)
	CreatedTime string `json:"createdTime,omitempty" url:"createdTime,omitempty"`
	// Position updated timestamp (ms)
	UpdatedTime string `json:"updatedTime,omitempty" url:"updatedTime,omitempty"`
}

type PositionClosedPnl

type PositionClosedPnl struct {
	// Product type
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Object
	List []PositionClosedPnlListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type PositionClosedPnlListItem

type PositionClosedPnlListItem struct {
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// `Buy`, `Sell`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Order qty
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
	// Order price
	OrderPrice string `json:"orderPrice,omitempty" url:"orderPrice,omitempty"`
	// Order type. `Market`,`Limit`
	OrderType OrderType `json:"orderType,omitempty" url:"orderType,omitempty"`
	// Exec type
	// `Trade`, `BustTrade`
	// `SessionSettlePnL`
	// `Settle`, `MovePosition`
	ExecType string `json:"execType,omitempty" url:"execType,omitempty"`
	// Closed size
	ClosedSize string `json:"closedSize,omitempty" url:"closedSize,omitempty"`
	// Cumulated Position value
	CumEntryValue string `json:"cumEntryValue,omitempty" url:"cumEntryValue,omitempty"`
	// Average entry price
	AvgEntryPrice string `json:"avgEntryPrice,omitempty" url:"avgEntryPrice,omitempty"`
	// Cumulated exit position value
	CumExitValue string `json:"cumExitValue,omitempty" url:"cumExitValue,omitempty"`
	// Average exit price
	AvgExitPrice string `json:"avgExitPrice,omitempty" url:"avgExitPrice,omitempty"`
	// Closed PnL
	ClosedPnl string `json:"closedPnl,omitempty" url:"closedPnl,omitempty"`
	// The number of fills in a single order
	FillCount string `json:"fillCount,omitempty" url:"fillCount,omitempty"`
	// leverage
	Leverage string `json:"leverage,omitempty" url:"leverage,omitempty"`
	// Open position trading fee
	OpenFee string `json:"openFee,omitempty" url:"openFee,omitempty"`
	// Close position trading fee
	CloseFee string `json:"closeFee,omitempty" url:"closeFee,omitempty"`
	// The created time (ms)
	CreatedTime string `json:"createdTime,omitempty" url:"createdTime,omitempty"`
	// The updated time (ms)
	UpdatedTime string `json:"updatedTime,omitempty" url:"updatedTime,omitempty"`
}

type PositionClosedPnlQuery

type PositionClosedPnlQuery struct {
	// Product type `linear`(USDT Contract, USDC Contract)
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// The start timestamp (ms)
	//
	// 	- startTime and endTime are not passed, return 7 days by default
	// 	- Only startTime is passed, return range between startTime and startTime+7 days
	// 	- Only endTime is passed, return range between endTime-7 days and endTime
	// 	- If both are passed, the rule is endTime - startTime <= 7 days
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms)
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Limit for data size per page. \[`1`, `100`\]. Default: `50`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type PositionConfirmPendingMmrParams

type PositionConfirmPendingMmrParams struct {
	// Product type `linear`, `inverse`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
}

type PositionGetClosedPositions

type PositionGetClosedPositions struct {
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
	// Product type
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Object
	List []PositionGetClosedPositionsListItem `json:"list,omitempty" url:"list,omitempty"`
}

type PositionGetClosedPositionsListItem

type PositionGetClosedPositionsListItem struct {
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// `Buy`, `Sell`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Total open fee
	TotalOpenFee string `json:"totalOpenFee,omitempty" url:"totalOpenFee,omitempty"`
	// Delivery fee
	DeliveryFee string `json:"deliveryFee,omitempty" url:"deliveryFee,omitempty"`
	// Total close fee
	TotalCloseFee string `json:"totalCloseFee,omitempty" url:"totalCloseFee,omitempty"`
	// Order qty
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
	// The closed time (ms)
	CloseTime int64 `json:"closeTime,omitempty" url:"closeTime,omitempty"`
	// Average exit price
	AvgExitPrice string `json:"avgExitPrice,omitempty" url:"avgExitPrice,omitempty"`
	// Delivery price
	DeliveryPrice string `json:"deliveryPrice,omitempty" url:"deliveryPrice,omitempty"`
	// The opened time (ms)
	OpenTime int64 `json:"openTime,omitempty" url:"openTime,omitempty"`
	// Average entry price
	AvgEntryPrice string `json:"avgEntryPrice,omitempty" url:"avgEntryPrice,omitempty"`
	// Total PnL
	TotalPnl string `json:"totalPnl,omitempty" url:"totalPnl,omitempty"`
}

type PositionGetClosedPositionsQuery

type PositionGetClosedPositionsQuery struct {
	// `option`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// The start timestamp (ms)
	//
	// 	- startTime and endTime are not passed, return 1 days by default
	// 	- Only startTime is passed, return range between startTime and startTime+1 days
	// 	- Only endTime is passed, return range between endTime-1 days and endTime
	// 	- If both are passed, the rule is endTime - startTime <= 7 days
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms)
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Limit for data size per page. \[`1`, `100`\]. Default: `50`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type PositionIdx

type PositionIdx string
const (
	PositionIdx0 PositionIdx = "0"
	PositionIdx1 PositionIdx = "1"
	PositionIdx2 PositionIdx = "2"
)

type PositionList

type PositionList struct {
	// Product type
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
	// Object
	List []PositionListListItem `json:"list,omitempty" url:"list,omitempty"`
}

type PositionListListItem

type PositionListListItem struct {
	// Position idx, used to identify positions in different position modes
	//
	// 	- `0`: One-Way Mode
	// 	- `1`: Buy side of both side mode
	// 	- `2`: Sell side of both side mode
	PositionIdx PositionIdx `json:"positionIdx,omitempty" url:"positionIdx,omitempty"`
	// Risk tier ID
	// _for portfolio margin mode, this field returns 0, which means risk limit rules are invalid_
	RiskId int64 `json:"riskId,omitempty" url:"riskId,omitempty"`
	// Risk limit value, become meaningless when auto risk-limit tier is applied
	// _for portfolio margin mode, this field returns 0, which means risk limit rules are invalid_
	RiskLimitValue string `json:"riskLimitValue,omitempty" url:"riskLimitValue,omitempty"`
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Position side. `Buy`: long, `Sell`: short
	// return an empty string `""` for an empty position
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Position size, always positive
	Size string `json:"size,omitempty" url:"size,omitempty"`
	// Average entry price
	//
	// 	- For USDC Perp & Futures, it indicates average entry price, and it will not be changed with 8-hour session settlement
	AvgPrice string `json:"avgPrice,omitempty" url:"avgPrice,omitempty"`
	// Position value
	PositionValue string `json:"positionValue,omitempty" url:"positionValue,omitempty"`
	// Whether to add margin automatically when using isolated margin mode
	//
	// 	- `0`: false
	// 	- `1`: true
	AutoAddMargin int64 `json:"autoAddMargin,omitempty" url:"autoAddMargin,omitempty"`
	// Position status. `Normal`, `Liq`, `Adl`
	PositionStatus PositionStatus `json:"positionStatus,omitempty" url:"positionStatus,omitempty"`
	// Position leverage
	// _for portfolio margin mode, this field returns "", which means leverage rules are invalid_
	Leverage string `json:"leverage,omitempty" url:"leverage,omitempty"`
	// Break even price, Only for `linear`,`inverse`.	- breakeven\_price = (entry\_price _qty - realized\_pnl) / (qty - abs(qty)_ max(taker fee rate, 0.00055))
	BreakEvenPrice string `json:"breakEvenPrice,omitempty" url:"breakEvenPrice,omitempty"`
	// Mark price
	MarkPrice string `json:"markPrice,omitempty" url:"markPrice,omitempty"`
	// Position liquidation price
	//
	// 	- Isolated margin:
	// it is the real price for isolated and cross positions, and keeps `""` when liqPrice <= minPrice or liqPrice >= maxPrice
	// 	- Cross margin:
	// it is an **estimated** price for cross positions(because the unified mode controls the risk rate according to the account), and keeps `""` when liqPrice <= minPrice or liqPrice >= maxPrice
	//
	// _this field is empty for Portfolio Margin Mode, and no liquidation price will be provided_
	LiqPrice string `json:"liqPrice,omitempty" url:"liqPrice,omitempty"`
	// Initial margin, the same value as `positionIMByMp`, please note this change [The New Margin Calculation: Adjustments and Implications](https://www.bybit.com/en/help-center/article/Understanding-the-Adjustment-and-Impact-of-the-New-Margin-Calculation)
	//
	// 	- Portfolio margin mode: returns ""
	PositionIm string `json:"positionIM,omitempty" url:"positionIM,omitempty"`
	// Initial margin calculated by mark price, the same value as `positionIM`
	//
	// 	- Portfolio margin mode: returns ""
	PositionImBymp string `json:"positionIMByMp,omitempty" url:"positionIMByMp,omitempty"`
	// Maintenance margin, the same value as `positionMMByMp`
	//
	// 	- Portfolio margin mode: returns ""
	PositionMm string `json:"positionMM,omitempty" url:"positionMM,omitempty"`
	// Maintenance margin calculated by mark price, the same value as `positionMM`
	//
	// 	- Portfolio margin mode: returns ""
	PositionMmBymp string `json:"positionMMByMp,omitempty" url:"positionMMByMp,omitempty"`
	// Take profit price
	TakeProfit string `json:"takeProfit,omitempty" url:"takeProfit,omitempty"`
	// Stop loss price
	StopLoss string `json:"stopLoss,omitempty" url:"stopLoss,omitempty"`
	// Trailing stop (the distance from market price)
	TrailingStop string `json:"trailingStop,omitempty" url:"trailingStop,omitempty"`
	// USDC contract session avg price, it is the same figure as avg entry price shown in the web UI
	SessionAvgPrice string `json:"sessionAvgPrice,omitempty" url:"sessionAvgPrice,omitempty"`
	// Delta
	Delta string `json:"delta,omitempty" url:"delta,omitempty"`
	// Gamma
	Gamma string `json:"gamma,omitempty" url:"gamma,omitempty"`
	// Vega
	Vega string `json:"vega,omitempty" url:"vega,omitempty"`
	// Theta
	Theta string `json:"theta,omitempty" url:"theta,omitempty"`
	// Unrealised PnL
	UnrealisedPnl string `json:"unrealisedPnl,omitempty" url:"unrealisedPnl,omitempty"`
	// The realised PnL for the current holding position
	CurRealisedPnl string `json:"curRealisedPnl,omitempty" url:"curRealisedPnl,omitempty"`
	// Cumulative realised pnl
	//
	// 	- Futures & Perps: it is the all time cumulative realised P&L
	// 	- Option: always "", meaningless
	CumRealisedPnl string `json:"cumRealisedPnl,omitempty" url:"cumRealisedPnl,omitempty"`
	// Auto-deleverage rank indicator. [What is Auto-Deleveraging?](https://www.bybit.com/en-US/help-center/s/article/What-is-Auto-Deleveraging-ADL)
	AdlRankIndicator AdlRankIndicator `json:"adlRankIndicator,omitempty" url:"adlRankIndicator,omitempty"`
	// Timestamp of the first time a position was created on this symbol (ms)
	CreatedTime string `json:"createdTime,omitempty" url:"createdTime,omitempty"`
	// Position updated timestamp (ms)
	UpdatedTime string `json:"updatedTime,omitempty" url:"updatedTime,omitempty"`
	// Cross sequence, used to associate each fill and each position update
	//
	// 	- Different symbols may have the same seq, please use seq + symbol to check unique
	// 	- Returns `"-1"` if the symbol has never been traded
	// 	- Returns the seq updated by the last transaction when there are settings like leverage, risk limit
	Seq int64 `json:"seq,omitempty" url:"seq,omitempty"`
	// Useful when Bybit lower the risk limit
	//
	// 	- `true`: Only allowed to reduce the position. You can consider a series of measures, e.g., lower the risk limit, decrease leverage or reduce the position, add margin, or cancel orders, after these operations, you can call [confirm new risk limit](/docs/v5/position/confirm-mmr) endpoint to check if your position can be removed the reduceOnly mark
	// 	- `false`: There is no restriction, and it means your position is under the risk when the risk limit is systematically adjusted
	// 	- Only meaningful for isolated margin & cross margin of USDT Perp, USDC Perp, USDC Futures, Inverse Perp and Inverse Futures, meaningless for others
	IsReduceOnly bool `json:"isReduceOnly,omitempty" url:"isReduceOnly,omitempty"`
	// Useful when Bybit lower the risk limit
	//
	// 	- When isReduceOnly=`true`: the timestamp (ms) when the MMR will be forcibly adjusted by the system
	// When isReduceOnly=`false`: the timestamp when the MMR had been adjusted by system
	//
	// 	- It returns the timestamp when the system operates, and if you manually operate, there is no timestamp
	// 	- Keeps `""` by default, if there was a lower risk limit system adjustment previously, it shows that system operation timestamp
	// 	- Only meaningful for isolated margin & cross margin of USDT Perp, USDC Perp, USDC Futures, Inverse Perp and Inverse Futures, meaningless for others
	MmrSysUpdatedTime string `json:"mmrSysUpdatedTime,omitempty" url:"mmrSysUpdatedTime,omitempty"`
	// Useful when Bybit lower the risk limit
	//
	// 	- When isReduceOnly=`true`: the timestamp (ms) when the leverage will be forcibly adjusted by the system
	// When isReduceOnly=`false`: the timestamp when the leverage had been adjusted by system
	//
	// 	- It returns the timestamp when the system operates, and if you manually operate, there is no timestamp
	// 	- Keeps `""` by default, if there was a lower risk limit system adjustment previously, it shows that system operation timestamp
	// 	- Only meaningful for isolated margin & cross margin of USDT Perp, USDC Perp, USDC Futures, Inverse Perp and Inverse Futures, meaningless for others
	LeverageSysUpdatedTime string `json:"leverageSysUpdatedTime,omitempty" url:"leverageSysUpdatedTime,omitempty"`
	// **Deprecated**, always "Full"
	TpslMode string `json:"tpslMode,omitempty" url:"tpslMode,omitempty"`
	// **Deprecated**, always `""`
	BustPrice string `json:"bustPrice,omitempty" url:"bustPrice,omitempty"`
	// **Deprecated**, can refer to `positionIM` or `positionIMByMp` field
	PositionBalance string `json:"positionBalance,omitempty" url:"positionBalance,omitempty"`
	// **Deprecated**, always `0`, check [Get Account Info](/docs/v5/account/account-info) to know the margin mode
	TradeMode int64 `json:"tradeMode,omitempty" url:"tradeMode,omitempty"`
}

type PositionListQuery

type PositionListQuery struct {
	// Product type `linear`, `inverse`, `option`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	//
	// 	- If `symbol` passed, it returns data regardless of having position or not.
	// 	- If `symbol`\=null and `settleCoin` specified, it returns position size greater than zero.
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Base coin, uppercase only. `option` **only**. Return all option positions if not passed
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
	// Settle coin
	//
	// 	- `linear`: either `symbol` or `settleCoin` is **required**. `symbol` has a higher priority
	SettleCoin string `json:"settleCoin,omitempty" url:"settleCoin,omitempty"`
	// Limit for data size per page. \[`1`, `200`\]. Default: `20`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type PositionMoveHistory

type PositionMoveHistory struct {
	// Object
	List []PositionMoveHistoryListItem `json:"list,omitempty" url:"list,omitempty"`
	// Used to get the next page data
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type PositionMoveHistoryListItem

type PositionMoveHistoryListItem struct {
	// Block trade ID
	BlockTradeId string `json:"blockTradeId,omitempty" url:"blockTradeId,omitempty"`
	// Product type. `linear`, `spot`, `option`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Bybit order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User ID
	UserId int64 `json:"userId,omitempty" url:"userId,omitempty"`
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Order side from taker's perspective. `Buy`, `Sell`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Order price
	Price string `json:"price,omitempty" url:"price,omitempty"`
	// Order quantity
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
	// The fee for taker or maker in the base currency paid to the Exchange executing the block trade
	ExecFee string `json:"execFee,omitempty" url:"execFee,omitempty"`
	// Block trade status. `Processing`, `Filled`, `Rejected`
	Status string `json:"status,omitempty" url:"status,omitempty"`
	// The unique trade ID from the exchange
	ExecId string `json:"execId,omitempty" url:"execId,omitempty"`
	// The result code of the order. `0` means success
	ResultCode int64 `json:"resultCode,omitempty" url:"resultCode,omitempty"`
	// The error message. `""` when resultCode=0
	ResultMessage string `json:"resultMessage,omitempty" url:"resultMessage,omitempty"`
	// The timestamp (ms) when the order is created
	CreatedAt int64 `json:"createdAt,omitempty" url:"createdAt,omitempty"`
	// The timestamp (ms) when the order is updated
	UpdatedAt int64 `json:"updatedAt,omitempty" url:"updatedAt,omitempty"`
	// - `""` means the status=`Filled`
	// 	- `Taker`, `Maker` when status=`Rejected`
	// 	- `bybit` means error is occurred on the Bybit side
	RejectParty string `json:"rejectParty,omitempty" url:"rejectParty,omitempty"`
}

type PositionMoveHistoryQuery

type PositionMoveHistoryQuery struct {
	// Product type `linear`, `inverse`, `spot`, `option`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// The order creation start timestamp. The interval is 7 days
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The order creation end timestamp. The interval is 7 days
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Order status. `Processing`, `Filled`, `Rejected`
	Status Status `json:"status,omitempty" url:"status,omitempty"`
	// Block trade ID
	BlockTradeId string `json:"blockTradeId,omitempty" url:"blockTradeId,omitempty"`
	// Limit for data size per page. \[`1`, `200`\]. Default: `20`
	Limit string `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type PositionMovePositionsParams

type PositionMovePositionsParams struct {
	// From UID
	//
	// 	- Must be UTA
	// 	- Must be in one-way mode for Futures
	FromUid string `json:"fromUid,omitempty" url:"fromUid,omitempty"`
	// To UID
	//
	// 	- Must be UTA
	// 	- Must be in one-way mode for Futures
	ToUid string `json:"toUid,omitempty" url:"toUid,omitempty"`
	// Object. Up to 25 legs per request
	List []PositionMovePositionsParamsListItem `json:"list,omitempty" url:"list,omitempty"`
}

type PositionMovePositionsParamsListItem

type PositionMovePositionsParamsListItem struct {
	// Product type `linear`, `spot`, `option`,`inverse`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Trade price
	//
	// 	- `linear`&`inverse`: the price needs to be between \[95% of mark price, 105% of mark price\]
	// 	- `spot`&`option`: the price needs to follow the price rule from [Instruments Info](/docs/v5/market/instrument)
	Price string `json:"price,omitempty" url:"price,omitempty"`
	// Trading side of `fromUid`
	//
	// 	- For example, `fromUid` has a long position, when side=`Sell`, then once executed, the position of `fromUid` will be reduced or open a short position depending on `qty` input
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Executed qty
	//
	// 	- The value must satisfy the qty rule from [Instruments Info](/docs/v5/market/instrument), in particular, category=`linear` is able to input `maxOrderQty` \* 5
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
}

type PositionMovePositionsResult

type PositionMovePositionsResult struct {
	// Result code. `0` means request is successfully accepted
	RetCode int64 `json:"retCode,omitempty" url:"retCode,omitempty"`
	// Result message
	RetMsg string `json:"retMsg,omitempty" url:"retMsg,omitempty"`
	// Object
	Result PositionMovePositionsResultResult `json:"result" url:"result"`
}

type PositionMovePositionsResultResult

type PositionMovePositionsResultResult struct {
	// Block trade ID
	BlockTradeId string `json:"blockTradeId,omitempty" url:"blockTradeId,omitempty"`
	// Status. `Processing`, `Rejected`
	Status string `json:"status,omitempty" url:"status,omitempty"`
	// - `""` means initial validation is passed, please check the order status via [Get Move Position History](/docs/v5/position/move-position-history)
	// 	- `Taker`, `Maker` when status=`Rejected`
	// 	- `bybit` means error is occurred on the Bybit side
	RejectParty string `json:"rejectParty,omitempty" url:"rejectParty,omitempty"`
}

type PositionSetAutoAddMarginParams

type PositionSetAutoAddMarginParams struct {
	// Product type `linear` (USDT Contract, USDC Contract)
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Turn on/off. `0`: off. `1`: on
	AutoAddMargin int64 `json:"autoAddMargin,omitempty" url:"autoAddMargin,omitempty"`
	// Used to identify positions in different position modes. For hedge mode position, this param is **required**
	//
	// 	- `0`: one-way mode
	// 	- `1`: hedge-mode Buy side
	// 	- `2`: hedge-mode Sell side
	PositionIdx PositionIdx `json:"positionIdx,omitempty" url:"positionIdx,omitempty"`
}

type PositionSetLeverageParams

type PositionSetLeverageParams struct {
	// Product type `linear`, `inverse`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// \[`1`, max leverage\]
	//
	// 	- one-way mode: `buyLeverage` must be the same as `sellLeverage`
	// 	- Hedge mode:
	// isolated margin: `buyLeverage` and `sellLeverage` can be different;
	// cross margin: `buyLeverage` must be the same as `sellLeverage`
	BuyLeverage string `json:"buyLeverage,omitempty" url:"buyLeverage,omitempty"`
	// \[`1`, max leverage\]
	SellLeverage string `json:"sellLeverage,omitempty" url:"sellLeverage,omitempty"`
}

type PositionStatus

type PositionStatus string
const (
	PositionStatusNormal PositionStatus = "Normal"
	PositionStatusLiq    PositionStatus = "Liq"
	PositionStatusAdl    PositionStatus = "Adl"
)

type PositionSwitchModeParams

type PositionSwitchModeParams struct {
	// Product type `linear`, USDT Contract
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only. Either `symbol` or `coin` is **required**. `symbol` has a higher priority
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Coin, uppercase only
	Coin string `json:"coin,omitempty" url:"coin,omitempty"`
	// Position mode. `0`: Merged Single. `3`: Both Sides
	Mode int64 `json:"mode,omitempty" url:"mode,omitempty"`
}

type PositionTradingStopParams

type PositionTradingStopParams struct {
	// Product type `linear`, `inverse`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// TP/SL mode
	//
	// 	- `Full`: entire position TP/SL
	// 	- `Partial`: partial position TP/SL
	TpslMode string `json:"tpslMode,omitempty" url:"tpslMode,omitempty"`
	// Used to identify positions in different position modes.
	//
	// 	- `0`: one-way mode
	// 	- `1`: hedge-mode Buy side
	// 	- `2`: hedge-mode Sell side
	PositionIdx PositionIdx `json:"positionIdx,omitempty" url:"positionIdx,omitempty"`
	// Cannot be less than 0, 0 means cancel TP
	TakeProfit string `json:"takeProfit,omitempty" url:"takeProfit,omitempty"`
	// Cannot be less than 0, 0 means cancel SL
	StopLoss string `json:"stopLoss,omitempty" url:"stopLoss,omitempty"`
	// Trailing stop by price distance. Cannot be less than 0, 0 means cancel TS
	TrailingStop string `json:"trailingStop,omitempty" url:"trailingStop,omitempty"`
	// Take profit trigger price type
	TpTriggerBy TriggerBy `json:"tpTriggerBy,omitempty" url:"tpTriggerBy,omitempty"`
	// Stop loss trigger price type
	SlTriggerBy TriggerBy `json:"slTriggerBy,omitempty" url:"slTriggerBy,omitempty"`
	// Trailing stop trigger price. Trailing stop will be triggered when this price is reached **only**
	ActivePrice string `json:"activePrice,omitempty" url:"activePrice,omitempty"`
	// Take profit size
	// valid for TP/SL partial mode, note: the value of tpSize and slSize must equal
	TpSize string `json:"tpSize,omitempty" url:"tpSize,omitempty"`
	// Stop loss size
	// valid for TP/SL partial mode, note: the value of tpSize and slSize must equal
	SlSize string `json:"slSize,omitempty" url:"slSize,omitempty"`
	// The limit order price when take profit price is triggered. Only works when tpslMode=Partial and tpOrderType=Limit
	TpLimitPrice string `json:"tpLimitPrice,omitempty" url:"tpLimitPrice,omitempty"`
	// The limit order price when stop loss price is triggered. Only works when tpslMode=Partial and slOrderType=Limit
	SlLimitPrice string `json:"slLimitPrice,omitempty" url:"slLimitPrice,omitempty"`
	// The order type when take profit is triggered. `Market`(default), `Limit`
	// For tpslMode=Full, it only supports tpOrderType="Market"
	TpOrderType string `json:"tpOrderType,omitempty" url:"tpOrderType,omitempty"`
	// The order type when stop loss is triggered. `Market`(default), `Limit`
	// For tpslMode=Full, it only supports slOrderType="Market"
	SlOrderType string `json:"slOrderType,omitempty" url:"slOrderType,omitempty"`
}

type PreUpgradeAccountTransactionLog

type PreUpgradeAccountTransactionLog struct {
	// Object
	List []PreUpgradeAccountTransactionLogListItem `json:"list,omitempty" url:"list,omitempty"`
	// Cursor. Used for pagination
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type PreUpgradeAccountTransactionLogListItem

type PreUpgradeAccountTransactionLogListItem struct {
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Product type
	Category string `json:"category,omitempty" url:"category,omitempty"`
	// Side. `Buy`,`Sell`,`None`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Transaction timestamp (ms)
	TransactionTime string `json:"transactionTime,omitempty" url:"transactionTime,omitempty"`
	// Type
	Type string `json:"type,omitempty" url:"type,omitempty"`
	// Quantity
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
	// Size
	Size string `json:"size,omitempty" url:"size,omitempty"`
	// USDC、USDT、BTC、ETH
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
	// Trade price
	TradePrice string `json:"tradePrice,omitempty" url:"tradePrice,omitempty"`
	// Funding fee
	//
	// 	- Positive value means receiving funding fee
	// 	- Negative value means deducting funding fee
	Funding string `json:"funding,omitempty" url:"funding,omitempty"`
	// Trading fee
	//
	// 	- Positive fee value means expense
	// 	- Negative fee value means rebates
	Fee string `json:"fee,omitempty" url:"fee,omitempty"`
	// Cash flow
	CashFlow string `json:"cashFlow,omitempty" url:"cashFlow,omitempty"`
	// Change
	Change string `json:"change,omitempty" url:"change,omitempty"`
	// Cash balance
	CashBalance string `json:"cashBalance,omitempty" url:"cashBalance,omitempty"`
	// - When type=`TRADE`, then it is trading fee rate
	// 	- When type=`SETTLEMENT`, it means funding fee rate. For side=Buy, feeRate=market fee rate; For side=Sell, feeRate= - market fee rate
	FeeRate string `json:"feeRate,omitempty" url:"feeRate,omitempty"`
	// The change of bonus
	BonusChange string `json:"bonusChange,omitempty" url:"bonusChange,omitempty"`
	// Trade ID
	TradeId string `json:"tradeId,omitempty" url:"tradeId,omitempty"`
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
}

type PreUpgradeAccountTransactionLogQuery

type PreUpgradeAccountTransactionLogQuery struct {
	// Product type `linear`, `option`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// BaseCoin, uppercase only. e.g., BTC of BTCPERP
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
	// Types of transaction logs
	Type string `json:"type,omitempty" url:"type,omitempty"`
	// The start timestamp (ms)
	//
	// 	- startTime and endTime are not passed, return 7 days by default
	// 	- Only startTime is passed, return range between startTime and startTime+7 days
	// 	- Only endTime is passed, return range between endTime-7 days and endTime
	// 	- If both are passed, the rule is endTime - startTime <= 7 days
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms)
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Limit for data size per page. \[`1`, `50`\]. Default: `20`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Used for pagination
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type PreUpgradeAssetDeliveryRecord

type PreUpgradeAssetDeliveryRecord struct {
	// Product type
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Object
	List []PreUpgradeAssetDeliveryRecordListItem `json:"list,omitempty" url:"list,omitempty"`
	// Cursor. Used for pagination
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type PreUpgradeAssetDeliveryRecordListItem

type PreUpgradeAssetDeliveryRecordListItem struct {
	// Delivery time (ms)
	DeliveryTime int64 `json:"deliveryTime,omitempty" url:"deliveryTime,omitempty"`
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// `Buy`,`Sell`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Executed size
	Position string `json:"position,omitempty" url:"position,omitempty"`
	// Delivery price
	DeliveryPrice string `json:"deliveryPrice,omitempty" url:"deliveryPrice,omitempty"`
	// Exercise price
	Strike string `json:"strike,omitempty" url:"strike,omitempty"`
	// Trading fee
	Fee string `json:"fee,omitempty" url:"fee,omitempty"`
	// Realized PnL of the delivery
	DeliveryRpl string `json:"deliveryRpl,omitempty" url:"deliveryRpl,omitempty"`
}

type PreUpgradeAssetDeliveryRecordQuery

type PreUpgradeAssetDeliveryRecordQuery struct {
	// Product type `option`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Expiry date. `25MAR22`. Default: return all
	ExpDate string `json:"expDate,omitempty" url:"expDate,omitempty"`
	// Limit for data size per page. \[`1`, `50`\]. Default: `20`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Used for pagination
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type PreUpgradeAssetSettlementRecord

type PreUpgradeAssetSettlementRecord struct {
	// Product type
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Object
	List []PreUpgradeAssetSettlementRecordListItem `json:"list,omitempty" url:"list,omitempty"`
	// Cursor. Used for pagination
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type PreUpgradeAssetSettlementRecordListItem

type PreUpgradeAssetSettlementRecordListItem struct {
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// `Buy`,`Sell`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Position size
	Size string `json:"size,omitempty" url:"size,omitempty"`
	// Settlement price
	SessionAvgPrice string `json:"sessionAvgPrice,omitempty" url:"sessionAvgPrice,omitempty"`
	// Mark price
	MarkPrice string `json:"markPrice,omitempty" url:"markPrice,omitempty"`
	// Realised PnL
	RealisedPnl string `json:"realisedPnl,omitempty" url:"realisedPnl,omitempty"`
	// Created time (ms)
	CreatedTime string `json:"createdTime,omitempty" url:"createdTime,omitempty"`
}

type PreUpgradeAssetSettlementRecordQuery

type PreUpgradeAssetSettlementRecordQuery struct {
	// Product type `linear`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Limit for data size per page. \[`1`, `50`\]. Default: `20`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Used for pagination
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type PreUpgradeExecutionList

type PreUpgradeExecutionList struct {
	// Product type
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Object
	List []PreUpgradeExecutionListListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type PreUpgradeExecutionListListItem

type PreUpgradeExecutionListListItem struct {
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customized order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// Side. `Buy`,`Sell`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Order price
	OrderPrice string `json:"orderPrice,omitempty" url:"orderPrice,omitempty"`
	// Order qty
	OrderQty string `json:"orderQty,omitempty" url:"orderQty,omitempty"`
	// The remaining qty not executed
	LeavesQty string `json:"leavesQty,omitempty" url:"leavesQty,omitempty"`
	// Order type. `Market`,`Limit`
	OrderType OrderType `json:"orderType,omitempty" url:"orderType,omitempty"`
	// Stop order type. If the order is not stop order, any type is not returned
	StopOrderType StopOrderType `json:"stopOrderType,omitempty" url:"stopOrderType,omitempty"`
	// Executed trading fee
	ExecFee string `json:"execFee,omitempty" url:"execFee,omitempty"`
	// Execution ID
	ExecId string `json:"execId,omitempty" url:"execId,omitempty"`
	// Execution price
	ExecPrice string `json:"execPrice,omitempty" url:"execPrice,omitempty"`
	// Execution qty
	ExecQty string `json:"execQty,omitempty" url:"execQty,omitempty"`
	// Executed type
	ExecType ExecType `json:"execType,omitempty" url:"execType,omitempty"`
	// Executed order value
	ExecValue string `json:"execValue,omitempty" url:"execValue,omitempty"`
	// Executed timestamp (ms)
	ExecTime string `json:"execTime,omitempty" url:"execTime,omitempty"`
	// Is maker order. `true`: maker, `false`: taker
	IsMaker bool `json:"isMaker,omitempty" url:"isMaker,omitempty"`
	// Trading fee rate
	FeeRate string `json:"feeRate,omitempty" url:"feeRate,omitempty"`
	// Implied volatility
	TradeIv string `json:"tradeIv,omitempty" url:"tradeIv,omitempty"`
	// Implied volatility of mark price
	MarkIv string `json:"markIv,omitempty" url:"markIv,omitempty"`
	// The mark price of the symbol when executing
	MarkPrice string `json:"markPrice,omitempty" url:"markPrice,omitempty"`
	// The index price of the symbol when executing
	IndexPrice string `json:"indexPrice,omitempty" url:"indexPrice,omitempty"`
	// The underlying price of the symbol when executing
	UnderlyingPrice string `json:"underlyingPrice,omitempty" url:"underlyingPrice,omitempty"`
	// Paradigm block trade ID
	BlockTradeId string `json:"blockTradeId,omitempty" url:"blockTradeId,omitempty"`
	// Closed position size
	ClosedSize string `json:"closedSize,omitempty" url:"closedSize,omitempty"`
}

type PreUpgradeExecutionListQuery

type PreUpgradeExecutionListQuery struct {
	// Product type `linear`, `inverse`, `option`, `spot`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// Base coin, uppercase only. Used for `option`
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
	// The start timestamp (ms)
	//
	// 	- startTime and endTime are not passed, return 7 days by default
	// 	- Only startTime is passed, return range between startTime and startTime+7 days
	// 	- Only endTime is passed, return range between endTime-7 days and endTime
	// 	- If both are passed, the rule is endTime - startTime <= 7 days
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms)
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Execution type
	ExecType ExecType `json:"execType,omitempty" url:"execType,omitempty"`
	// Limit for data size per page. \[`1`, `100`\]. Default: `50`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type PreUpgradeOrderHistory

type PreUpgradeOrderHistory struct {
	// Product type
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Object
	List []PreUpgradeOrderHistoryListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type PreUpgradeOrderHistoryListItem

type PreUpgradeOrderHistoryListItem struct {
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// Block trade ID
	BlockTradeId string `json:"blockTradeId,omitempty" url:"blockTradeId,omitempty"`
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Order price
	Price string `json:"price,omitempty" url:"price,omitempty"`
	// Order qty
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
	// Side. `Buy`,`Sell`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Useless field for those orders before upgraded
	IsLeverage string `json:"isLeverage,omitempty" url:"isLeverage,omitempty"`
	// Position index. Used to identify positions in different position modes
	PositionIdx PositionIdx `json:"positionIdx,omitempty" url:"positionIdx,omitempty"`
	// Order status
	OrderStatus OrderStatus `json:"orderStatus,omitempty" url:"orderStatus,omitempty"`
	// Cancel type
	CancelType CancelType `json:"cancelType,omitempty" url:"cancelType,omitempty"`
	// Reject reason
	RejectReason RejectReason `json:"rejectReason,omitempty" url:"rejectReason,omitempty"`
	// Average filled price. If unfilled, it is `""`, and also for those orders have partilly filled but cancelled at the end
	AvgPrice string `json:"avgPrice,omitempty" url:"avgPrice,omitempty"`
	// The remaining qty not executed
	LeavesQty string `json:"leavesQty,omitempty" url:"leavesQty,omitempty"`
	// The estimated value not executed
	LeavesValue string `json:"leavesValue,omitempty" url:"leavesValue,omitempty"`
	// Cumulative executed order qty
	CumExecQty string `json:"cumExecQty,omitempty" url:"cumExecQty,omitempty"`
	// Cumulative executed order value
	CumExecValue string `json:"cumExecValue,omitempty" url:"cumExecValue,omitempty"`
	// Cumulative executed trading fee
	CumExecFee string `json:"cumExecFee,omitempty" url:"cumExecFee,omitempty"`
	// Time in force
	TimeInForce TimeInForce `json:"timeInForce,omitempty" url:"timeInForce,omitempty"`
	// Order type. `Market`,`Limit`
	OrderType OrderType `json:"orderType,omitempty" url:"orderType,omitempty"`
	// Stop order type
	StopOrderType StopOrderType `json:"stopOrderType,omitempty" url:"stopOrderType,omitempty"`
	// Implied volatility
	OrderIv string `json:"orderIv,omitempty" url:"orderIv,omitempty"`
	// Trigger price. If `stopOrderType`\=_TrailingStop_, it is activate price. Otherwise, it is trigger price
	TriggerPrice string `json:"triggerPrice,omitempty" url:"triggerPrice,omitempty"`
	// Take profit price
	TakeProfit string `json:"takeProfit,omitempty" url:"takeProfit,omitempty"`
	// Stop loss price
	StopLoss string `json:"stopLoss,omitempty" url:"stopLoss,omitempty"`
	// The price type to trigger take profit
	TpTriggerBy TriggerBy `json:"tpTriggerBy,omitempty" url:"tpTriggerBy,omitempty"`
	// The price type to trigger stop loss
	SlTriggerBy TriggerBy `json:"slTriggerBy,omitempty" url:"slTriggerBy,omitempty"`
	// Trigger direction. `1`: rise, `2`: fall
	TriggerDirection int64 `json:"triggerDirection,omitempty" url:"triggerDirection,omitempty"`
	// The price type of trigger price
	TriggerBy TriggerBy `json:"triggerBy,omitempty" url:"triggerBy,omitempty"`
	// Last price when place the order
	LastPriceOnCreated string `json:"lastPriceOnCreated,omitempty" url:"lastPriceOnCreated,omitempty"`
	// Reduce only. `true` means reduce position size
	ReduceOnly bool `json:"reduceOnly,omitempty" url:"reduceOnly,omitempty"`
	// Close on trigger. [What is a close on trigger order?](https://www.bybit.com/en/help-center/article/Close-On-Trigger-Order)
	CloseOnTrigger bool `json:"closeOnTrigger,omitempty" url:"closeOnTrigger,omitempty"`
	// Place type, `option` used. `iv`, `price`
	PlaceType string `json:"placeType,omitempty" url:"placeType,omitempty"`
	// SMP execution type
	SmpType SmpType `json:"smpType,omitempty" url:"smpType,omitempty"`
	// Smp group ID. If the UID has no group, it is `0` by default
	SmpGroup int64 `json:"smpGroup,omitempty" url:"smpGroup,omitempty"`
	// The counterparty's orderID which triggers this SMP execution
	SmpOrderId string `json:"smpOrderId,omitempty" url:"smpOrderId,omitempty"`
	// Order created timestamp (ms)
	CreatedTime string `json:"createdTime,omitempty" url:"createdTime,omitempty"`
	// Order updated timestamp (ms)
	UpdatedTime string `json:"updatedTime,omitempty" url:"updatedTime,omitempty"`
}

type PreUpgradeOrderHistoryQuery

type PreUpgradeOrderHistoryQuery struct {
	// Product type `linear`, `inverse`, `option`, `spot`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only.
	//
	// 	- If not passed, return settleCoin=USDT by default
	// 	- To get USDC perp, please pass symbol
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Base coin, uppercase only. Used for `option` query
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// `Order`: active order, `StopOrder`: conditional order
	OrderFilter string `json:"orderFilter,omitempty" url:"orderFilter,omitempty"`
	// Order status. Not supported for `spot` category
	OrderStatus OrderStatus `json:"orderStatus,omitempty" url:"orderStatus,omitempty"`
	// The start timestamp (ms)
	//
	// 	- `startTime` and `endTime` must be passed together or both are not passed
	// 	- endTime - startTime <= 7 days
	// 	- If both are not passed, it returns recent 7 days by default
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms)
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Limit for data size per page. \[`1`, `50`\]. Default: `20`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type PreUpgradePositionClosedPnl

type PreUpgradePositionClosedPnl struct {
	// Product type
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Object
	List []PreUpgradePositionClosedPnlListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type PreUpgradePositionClosedPnlListItem

type PreUpgradePositionClosedPnlListItem struct {
	// Symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// `Buy`, `Side`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Order qty
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
	// Order price
	OrderPrice string `json:"orderPrice,omitempty" url:"orderPrice,omitempty"`
	// Order type. `Market`,`Limit`
	OrderType OrderType `json:"orderType,omitempty" url:"orderType,omitempty"`
	// Exec type. `Trade`, `BustTrade`, `SessionSettlePnL`, `Settle`
	ExecType string `json:"execType,omitempty" url:"execType,omitempty"`
	// Closed size
	ClosedSize string `json:"closedSize,omitempty" url:"closedSize,omitempty"`
	// Cumulated Position value
	CumEntryValue string `json:"cumEntryValue,omitempty" url:"cumEntryValue,omitempty"`
	// Average entry price
	AvgEntryPrice string `json:"avgEntryPrice,omitempty" url:"avgEntryPrice,omitempty"`
	// Cumulated exit position value
	CumExitValue string `json:"cumExitValue,omitempty" url:"cumExitValue,omitempty"`
	// Average exit price
	AvgExitPrice string `json:"avgExitPrice,omitempty" url:"avgExitPrice,omitempty"`
	// Closed PnL
	ClosedPnl string `json:"closedPnl,omitempty" url:"closedPnl,omitempty"`
	// The number of fills in a single order
	FillCount string `json:"fillCount,omitempty" url:"fillCount,omitempty"`
	// leverage
	Leverage string `json:"leverage,omitempty" url:"leverage,omitempty"`
	// The created time (ms)
	CreatedTime string `json:"createdTime,omitempty" url:"createdTime,omitempty"`
	// The updated time (ms)
	UpdatedTime string `json:"updatedTime,omitempty" url:"updatedTime,omitempty"`
}

type PreUpgradePositionClosedPnlQuery

type PreUpgradePositionClosedPnlQuery struct {
	// Product type `linear`, `inverse`
	Category Category `json:"category,omitempty" url:"category,omitempty"`
	// Symbol name, like `BTCUSDT`, uppercase only
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// The start timestamp (ms)
	//
	// 	- startTime and endTime are not passed, return 7 days by default
	// 	- Only startTime is passed, return range between startTime and startTime+7 days
	// 	- Only endTime is passed, return range between endTime-7 days and endTime
	// 	- If both are passed, the rule is endTime - startTime <= 7 days
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms)
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Limit for data size per page. \[`1`, `100`\]. Default: `50`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type Product

type Product string
const (
	Product1 Product = "1"
	Product2 Product = "2"
	Product3 Product = "3"
	Product4 Product = "4"
)

type RejectReason

type RejectReason string
const (
	RejectReasonEcNoError                      RejectReason = "EC_NoError"
	RejectReasonEcOthers                       RejectReason = "EC_Others"
	RejectReasonEcUnknownMessageType           RejectReason = "EC_UnknownMessageType"
	RejectReasonEcMissingClOrdId               RejectReason = "EC_MissingClOrdID"
	RejectReasonEcMissingOrigClOrdId           RejectReason = "EC_MissingOrigClOrdID"
	RejectReasonEcClOrdIdOrigClOrdIdAreTheSame RejectReason = "EC_ClOrdIDOrigClOrdIDAreTheSame"
	RejectReasonEcDuplicatedClOrdId            RejectReason = "EC_DuplicatedClOrdID"
	RejectReasonEcOrigClOrdIdDoesNotExist      RejectReason = "EC_OrigClOrdIDDoesNotExist"
	RejectReasonEcTooLateToCancel              RejectReason = "EC_TooLateToCancel"
	RejectReasonEcUnknownOrderType             RejectReason = "EC_UnknownOrderType"
	RejectReasonEcUnknownSide                  RejectReason = "EC_UnknownSide"
	RejectReasonEcUnknownTimeInForce           RejectReason = "EC_UnknownTimeInForce"
	RejectReasonEcWronglyRouted                RejectReason = "EC_WronglyRouted"
	RejectReasonEcMarketOrderPriceIsNotZero    RejectReason = "EC_MarketOrderPriceIsNotZero"
	RejectReasonEcLimitOrderInvalidPrice       RejectReason = "EC_LimitOrderInvalidPrice"
	RejectReasonEcNoEnoughQtyToFill            RejectReason = "EC_NoEnoughQtyToFill"
	RejectReasonEcNoImmediateQtyToFill         RejectReason = "EC_NoImmediateQtyToFill"
	RejectReasonEcPerCancelRequest             RejectReason = "EC_PerCancelRequest"
	RejectReasonEcMarketOrderCannotBePostOnly  RejectReason = "EC_MarketOrderCannotBePostOnly"
	RejectReasonEcPostOnlyWillTakeLiquidity    RejectReason = "EC_PostOnlyWillTakeLiquidity"
	RejectReasonEcCancelReplaceOrder           RejectReason = "EC_CancelReplaceOrder"
	RejectReasonEcInvalidSymbolStatus          RejectReason = "EC_InvalidSymbolStatus"
	RejectReasonEcCancelForNoFullFill          RejectReason = "EC_CancelForNoFullFill"
	RejectReasonEcBySelfMatch                  RejectReason = "EC_BySelfMatch"
	RejectReasonEcInCallAuctionStatus          RejectReason = "EC_InCallAuctionStatus"
	RejectReasonEcQtyCannotBeZero              RejectReason = "EC_QtyCannotBeZero"
	RejectReasonEcMarketOrderNoSupportTif      RejectReason = "EC_MarketOrderNoSupportTIF"
	RejectReasonEcReachMaxTradeNum             RejectReason = "EC_ReachMaxTradeNum"
	RejectReasonEcInvalidPriceScale            RejectReason = "EC_InvalidPriceScale"
	RejectReasonEcBitIndexInvalid              RejectReason = "EC_BitIndexInvalid"
	RejectReasonEcStopBySelfMatch              RejectReason = "EC_StopBySelfMatch"
	RejectReasonEcInvalidSmpType               RejectReason = "EC_InvalidSmpType"
	RejectReasonEcCancelByMmp                  RejectReason = "EC_CancelByMMP"
	RejectReasonEcInvalidUserType              RejectReason = "EC_InvalidUserType"
	RejectReasonEcInvalidMirrorOid             RejectReason = "EC_InvalidMirrorOid"
	RejectReasonEcInvalidMirrorUid             RejectReason = "EC_InvalidMirrorUid"
	RejectReasonEcEcInvalidQty                 RejectReason = "EC_EcInvalidQty"
	RejectReasonEcInvalidAmount                RejectReason = "EC_InvalidAmount"
	RejectReasonEcLoadOrderCancel              RejectReason = "EC_LoadOrderCancel"
	RejectReasonEcMarketQuoteNoSuppSell        RejectReason = "EC_MarketQuoteNoSuppSell"
	RejectReasonEcDisorderOrderId              RejectReason = "EC_DisorderOrderID"
	RejectReasonEcInvalidBaseValue             RejectReason = "EC_InvalidBaseValue"
	RejectReasonEcLoadOrderCanMatch            RejectReason = "EC_LoadOrderCanMatch"
	RejectReasonEcSecurityStatusFail           RejectReason = "EC_SecurityStatusFail"
	RejectReasonEcReachRiskPriceLimit          RejectReason = "EC_ReachRiskPriceLimit"
	RejectReasonEcOrderNotExist                RejectReason = "EC_OrderNotExist"
	RejectReasonEcCancelByOrderValueZero       RejectReason = "EC_CancelByOrderValueZero"
	RejectReasonEcCancelByMatchValueZero       RejectReason = "EC_CancelByMatchValueZero"
	RejectReasonEcReachMarketPriceLimit        RejectReason = "EC_ReachMarketPriceLimit"
)

type RfqAcceptOtherQuoteParams

type RfqAcceptOtherQuoteParams struct {
	// Inquiry ID
	RfqId string `json:"rfqId,omitempty" url:"rfqId,omitempty"`
}

type RfqAcceptOtherQuoteResult

type RfqAcceptOtherQuoteResult struct {
	// Inquiry ID
	RfqId string `json:"rfqId,omitempty" url:"rfqId,omitempty"`
}

type RfqCancelAllQuotesResult

type RfqCancelAllQuotesResult struct {
	// Inquiry ID
	RfqId string `json:"rfqId,omitempty" url:"rfqId,omitempty"`
	// Quote ID
	QuoteId string `json:"quoteId,omitempty" url:"quoteId,omitempty"`
	// Custom quote ID
	QuoteLinkId string `json:"quoteLinkId,omitempty" url:"quoteLinkId,omitempty"`
	// Whether or not cancellation was a success, `0`: success
	Code string `json:"code,omitempty" url:"code,omitempty"`
	// Cancellation failure reason
	Msg string `json:"msg,omitempty" url:"msg,omitempty"`
}

type RfqCancelAllRfqResult

type RfqCancelAllRfqResult struct {
	// Inquiry ID
	RfqId string `json:"rfqId,omitempty" url:"rfqId,omitempty"`
	// Custom inquiry ID
	RfqLinkId string `json:"rfqLinkId,omitempty" url:"rfqLinkId,omitempty"`
	// Whether or not the cancellations were a success, `0`: success
	Code string `json:"code,omitempty" url:"code,omitempty"`
	// Cancellation failure reason
	Msg string `json:"msg,omitempty" url:"msg,omitempty"`
}

type RfqCancelQuoteParams

type RfqCancelQuoteParams struct {
	// Quote ID
	QuoteId string `json:"quoteId,omitempty" url:"quoteId,omitempty"`
	// Inquiry ID
	RfqId string `json:"rfqId,omitempty" url:"rfqId,omitempty"`
	// Custom quote ID
	QuoteLinkId string `json:"quoteLinkId,omitempty" url:"quoteLinkId,omitempty"`
}

type RfqCancelQuoteResult

type RfqCancelQuoteResult struct {
	// Inquiry ID
	RfqId string `json:"rfqId,omitempty" url:"rfqId,omitempty"`
	// Quote ID
	QuoteId string `json:"quoteId,omitempty" url:"quoteId,omitempty"`
	// Custom quote ID
	QuoteLinkId string `json:"quoteLinkId,omitempty" url:"quoteLinkId,omitempty"`
}

type RfqCancelRfqParams

type RfqCancelRfqParams struct {
	// Inquiry ID
	RfqId string `json:"rfqId,omitempty" url:"rfqId,omitempty"`
	// Custom inquiry ID
	RfqLinkId string `json:"rfqLinkId,omitempty" url:"rfqLinkId,omitempty"`
}

type RfqCancelRfqResult

type RfqCancelRfqResult struct {
	// Inquiry ID
	RfqId string `json:"rfqId,omitempty" url:"rfqId,omitempty"`
	// Custom inquiry ID
	RfqLinkId string `json:"rfqLinkId,omitempty" url:"rfqLinkId,omitempty"`
}

type RfqConfig

type RfqConfig struct {
	List RfqConfigList `json:"list" url:"list"`
	// Contract minimum order quantity
	MinLimitQtyContractOrder int64 `json:"minLimitQtyContractOrder,omitempty" url:"minLimitQtyContractOrder,omitempty"`
	// Option minimum order
	MinLimitQtyOptionOrder int64 `json:"minLimitQtyOptionOrder,omitempty" url:"minLimitQtyOptionOrder,omitempty"`
	// Product strategy
	StrategyTypes []RfqConfigStrategyTypesItem `json:"strategyTypes,omitempty" url:"strategyTypes,omitempty"`
}

type RfqConfigList

type RfqConfigList struct {
	// Your deskCode, a unique identification code
	DeskCode string `json:"deskCode,omitempty" url:"deskCode,omitempty"`
	// Maximum number of legs
	MaxLegs int64 `json:"maxLegs,omitempty" url:"maxLegs,omitempty"`
	// The maximum number of LPs (liquidity providers) selected in the inquiry
	MaxLp int64 `json:"maxLP,omitempty" url:"maxLP,omitempty"`
	// The maximum number of unfinished inquiry orders allowed by a user
	MaxActiveRfq int64 `json:"maxActiveRfq,omitempty" url:"maxActiveRfq,omitempty"`
	// Inquiry expiration time (mins)
	RfqExpireTime int64 `json:"rfqExpireTime,omitempty" url:"rfqExpireTime,omitempty"`
	// Spot minimum order quantity
	MinLimitQtySpotOrder int64 `json:"minLimitQtySpotOrder,omitempty" url:"minLimitQtySpotOrder,omitempty"`
}

type RfqConfigStrategyTypesItem

type RfqConfigStrategyTypesItem struct {
	// Information on the quoters who can participate in the transaction
	Counterparties []RfqConfigStrategyTypesItemCounterpartiesItem `json:"counterparties,omitempty" url:"counterparties,omitempty"`
}

type RfqConfigStrategyTypesItemCounterpartiesItem

type RfqConfigStrategyTypesItemCounterpartiesItem struct {
	// Name of the quoter
	TraderName string `json:"traderName,omitempty" url:"traderName,omitempty"`
	// The unique identification code of the quoting party
	DeskCode string `json:"deskCode,omitempty" url:"deskCode,omitempty"`
	// Quoter type. `LP` is an automated market maker connected via API, null means a normal quoting party
	Type string `json:"type,omitempty" url:"type,omitempty"`
}

type RfqCreateQuoteParams

type RfqCreateQuoteParams struct {
	// Inquiry ID
	RfqId string `json:"rfqId,omitempty" url:"rfqId,omitempty"`
	// Custom quote ID:
	//
	// 	- The length should be between 1-32 bits
	// 	- Combination of letters (case sensitive) and numbers
	// 	- An rfqLinkId expires after three months – after which it can be reused
	// 	- Open orders must have a unique ID whereas orders that have reached a final/terminated status do not have to be unique.
	QuoteLinkId string `json:"quoteLinkId,omitempty" url:"quoteLinkId,omitempty"`
	// Whether or not it is anonymous quote. The default value is `false`. When it is `true` the identity of the quoting party will not be revealed even after the transaction is concluded.
	Anonymous bool `json:"anonymous,omitempty" url:"anonymous,omitempty"`
	// Duration of the quote (in secs). \[`10`, `120`\]. Default: `60`
	ExpireIn int64 `json:"expireIn,omitempty" url:"expireIn,omitempty"`
	// Quote direction
	//
	// 	- In the `Buy` direction, for the maker (the quoting party), the execution direction is the same as the direction of the legs
	// 	- For the taker (the inquiring party) it is opposite direction
	QuoteBuyList []RfqCreateQuoteParamsQuoteBuyListItem `json:"quoteBuyList,omitempty" url:"quoteBuyList,omitempty"`
	// Ask direction
	//
	// 	- In the `Sell` direction, for the maker (the quoting party), the execution direction is opposite to the direction of the legs
	// 	- For the taker (the inquiring party) it is the same direction
	QuoteSellList []RfqCreateQuoteParamsQuoteSellListItem `json:"quoteSellList,omitempty" url:"quoteSellList,omitempty"`
}

type RfqCreateQuoteParamsQuoteBuyListItem

type RfqCreateQuoteParamsQuoteBuyListItem struct {
	// Product type: Unified account: `spot`, `linear`,`option`
	Category string `json:"category,omitempty" url:"category,omitempty"`
	// Name of the trading contract
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Quote price
	Price string `json:"price,omitempty" url:"price,omitempty"`
}

type RfqCreateQuoteParamsQuoteSellListItem

type RfqCreateQuoteParamsQuoteSellListItem struct {
	// Product type: Unified account: `spot`, `linear`,`option`
	Category string `json:"category,omitempty" url:"category,omitempty"`
	// Name of the trading contract
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Quote price
	Price string `json:"price,omitempty" url:"price,omitempty"`
}

type RfqCreateQuoteResult

type RfqCreateQuoteResult struct {
	// Inquiry ID
	RfqId string `json:"rfqId,omitempty" url:"rfqId,omitempty"`
	// Quote ID
	QuoteId string `json:"quoteId,omitempty" url:"quoteId,omitempty"`
	// Custom quote ID
	QuoteLinkId string `json:"quoteLinkId,omitempty" url:"quoteLinkId,omitempty"`
	// The quote's expiration time (ms)
	ExpiresAt string `json:"expiresAt,omitempty" url:"expiresAt,omitempty"`
	// Quoter's unique identification code
	DeskCode string `json:"deskCode,omitempty" url:"deskCode,omitempty"`
	// Status of quotation: `Active` `Canceled` `Filled` `Expired` `Failed`
	Status string `json:"status,omitempty" url:"status,omitempty"`
}

type RfqCreateRfqParams

type RfqCreateRfqParams struct {
	// Spread combination symbol name
	Counterparties []string `json:"counterparties,omitempty" url:"counterparties,omitempty"`
	// Custom RFQ ID
	//
	// 	- The length should be between 1-32 bits
	// 	- Combination of letters (case sensitive) and numbers
	// 	- An rfqLinkId expires after three months – after which it can be reused
	// 	- Open orders must have a unique ID whereas orders that have reached a final/terminated status do not have to be unique.
	RfqLinkId string `json:"rfqLinkId,omitempty" url:"rfqLinkId,omitempty"`
	// Whether or not it is anonymous inquiry. The default value is `false`. When it is `true` the identity of the inquiring party will not be revealed even after the transaction is concluded.
	Anonymous bool `json:"anonymous,omitempty" url:"anonymous,omitempty"`
	// Strategy type, if it is a custom inquiry, strategyType is `custom`, if it is a product combination provided by the system, it is the combination type; the default is `custom`; non-custom combinations have rate optimization, currently 50%; the transaction rate between LPs is currently 30%
	StrategyType string `json:"strategyType,omitempty" url:"strategyType,omitempty"`
	// Combination transaction list
	//
	// 	- Use [Get RFQ Configuration](/docs/v5/rfq/trade/rfq-config) to confirm the maximum length of the combination (`maxLegs`)
	// 	- The base coin and settle coin of all combinations must be the same
	// 	- Symbols under the same category must be unique
	List []RfqCreateRfqParamsListItem `json:"list,omitempty" url:"list,omitempty"`
}

type RfqCreateRfqParamsListItem

type RfqCreateRfqParamsListItem struct {
	// Product type: Unified account: `spot`, `linear`,`option`
	Category string `json:"category,omitempty" url:"category,omitempty"`
	// Name of the transaction contract. No inquiries are allowed in the last 30 minutes before contract settlement
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Inquiry transaction direction: `Buy` , `Sell`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// If the number of transactions exceeds the position size, the position will then open in the reverse direction
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
}

type RfqCreateRfqResult

type RfqCreateRfqResult struct {
	List []RfqCreateRfqResultListItem `json:"list,omitempty" url:"list,omitempty"`
}

type RfqCreateRfqResultListItem

type RfqCreateRfqResultListItem struct {
	// Inquiry ID
	RfqId string `json:"rfqId,omitempty" url:"rfqId,omitempty"`
	// Custom inquiry ID
	RfqLinkId string `json:"rfqLinkId,omitempty" url:"rfqLinkId,omitempty"`
	// Status of the RFQ: `Active` `Canceled` `Filled` `Expired` `Failed`
	Status string `json:"status,omitempty" url:"status,omitempty"`
	// The inquiry's expiration time (ms)
	ExpiresAt string `json:"expiresAt,omitempty" url:"expiresAt,omitempty"`
	// Inquiring party's unique identification code
	DeskCode string `json:"deskCode,omitempty" url:"deskCode,omitempty"`
}

type RfqExecuteQuoteParams

type RfqExecuteQuoteParams struct {
	// Inquiry ID
	RfqId string `json:"rfqId,omitempty" url:"rfqId,omitempty"`
	// Quote ID
	QuoteId string `json:"quoteId,omitempty" url:"quoteId,omitempty"`
	// The direction of the quote is `Buy` or `Sell` . When the direction of the quote is `Buy` , for the maker, the execution direction is the same as the direction in legs, and for the taker, it is opposite. Conversely, the same applies
	QuoteSide string `json:"quoteSide,omitempty" url:"quoteSide,omitempty"`
}

type RfqExecuteQuoteResult

type RfqExecuteQuoteResult struct {
	// Inquiry ID
	RfqId     string `json:"rfqId,omitempty" url:"rfqId,omitempty"`
	RfqLinkId string `json:"rfqLinkId,omitempty" url:"rfqLinkId,omitempty"`
	// Quote ID
	QuoteId string `json:"quoteId,omitempty" url:"quoteId,omitempty"`
	// Order status:
	//
	// 	- `PendingFill`: Order has been sent to the matching engine but not yet filled.
	// 	- `Failed`: Order failed
	Status string `json:"status,omitempty" url:"status,omitempty"`
}

type RfqPublicTrades

type RfqPublicTrades struct {
	// Refer to the `cursor` request parameter
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
	// An array of RFQs
	List []RfqPublicTradesListItem `json:"list,omitempty" url:"list,omitempty"`
}

type RfqPublicTradesListItem

type RfqPublicTradesListItem struct {
	// Inquiry ID
	RfqId string `json:"rfqId,omitempty" url:"rfqId,omitempty"`
	// Policy type
	StrategyType string `json:"strategyType,omitempty" url:"strategyType,omitempty"`
	// Time (ms) when the trade is created in epoch, such as 1650380963
	CreatedAt string `json:"createdAt,omitempty" url:"createdAt,omitempty"`
	// Time (ms) when the trade is updated in epoch, such as 1650380964
	UpdatedAt string `json:"updatedAt,omitempty" url:"updatedAt,omitempty"`
	// Combination transaction
	Legs []RfqPublicTradesListItemLegsItem `json:"legs,omitempty" url:"legs,omitempty"`
}

type RfqPublicTradesListItemLegsItem

type RfqPublicTradesListItemLegsItem struct {
	// category. Valid values include: `linear`, `option` and `spot`
	Category string `json:"category,omitempty" url:"category,omitempty"`
	// The unique instrument ID
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Direction, valid values are `Buy` and `Sell`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Execution price
	Price string `json:"price,omitempty" url:"price,omitempty"`
	// Number of executions
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
	// The futures markPrice at the time of transaction, the spot is indexPrice, and the option is the markPrice of the underlying Price.
	MarkPrice string `json:"markPrice,omitempty" url:"markPrice,omitempty"`
}

type RfqPublicTradesQuery

type RfqPublicTradesQuery struct {
	// The timestamp (ms), `startTime` and `endTime` of the order transaction are 30 days
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The closing timestamp (ms), `startTime` and `endTime` of the order are 30 days
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Return the number of items. \[`1`, `100`\]. Default: `50`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type RfqQuoteList

type RfqQuoteList struct {
	// Refer to the `cursor` request parameter
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
	// An array of quotes
	List []RfqQuoteListListItem `json:"list,omitempty" url:"list,omitempty"`
}

type RfqQuoteListListItem

type RfqQuoteListListItem struct {
	// Inquiry ID
	RfqId string `json:"rfqId,omitempty" url:"rfqId,omitempty"`
	// Custom RFQ ID. Not publicly disclosed.
	RfqLinkId string `json:"rfqLinkId,omitempty" url:"rfqLinkId,omitempty"`
	// Quote ID
	QuoteId string `json:"quoteId,omitempty" url:"quoteId,omitempty"`
	// Custom quote ID. Not publicly disclosed.
	QuoteLinkId string `json:"quoteLinkId,omitempty" url:"quoteLinkId,omitempty"`
	// The quote's expiration time (ms)
	ExpiresAt string `json:"expiresAt,omitempty" url:"expiresAt,omitempty"`
	// The unique identification code of the inquiring party, which is not visible when anonymous was set to `true` when the quote was created
	DeskCode string `json:"deskCode,omitempty" url:"deskCode,omitempty"`
	// Status of the RFQ: `Active` `PendingFill` `Canceled` `Filled` `Expired` `Failed`
	Status string `json:"status,omitempty" url:"status,omitempty"`
	// Execute the quote direction, `Buy` or `Sell` . When the quote direction is `Buy` , for maker, the execution direction is the same as the direction in legs, and opposite for taker. Conversely, the same applies
	ExecQuoteSide string `json:"execQuoteSide,omitempty" url:"execQuoteSide,omitempty"`
	// Time (ms) when the trade is created in epoch, such as 1650380963
	CreatedAt string `json:"createdAt,omitempty" url:"createdAt,omitempty"`
	// Time (ms) when the trade is updated in epoch, such as 1650380964
	UpdatedAt string `json:"updatedAt,omitempty" url:"updatedAt,omitempty"`
	// Quote `Buy` Direction
	QuoteBuyList []RfqQuoteListListItemQuoteBuyListItem `json:"quoteBuyList,omitempty" url:"quoteBuyList,omitempty"`
	// Quote `Sell` Direction
	QuoteSellList []RfqQuoteListListItemQuoteSellListItem `json:"quoteSellList,omitempty" url:"quoteSellList,omitempty"`
}

type RfqQuoteListListItemQuoteBuyListItem

type RfqQuoteListListItemQuoteBuyListItem struct {
	// Product type: `spot`,`linear`,`option`
	Category string `json:"category,omitempty" url:"category,omitempty"`
	// The unique instrument ID
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Order price in the quote currency of the instrument.
	Price string `json:"price,omitempty" url:"price,omitempty"`
	// Order quantity of the instrument.
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
}

type RfqQuoteListListItemQuoteSellListItem

type RfqQuoteListListItemQuoteSellListItem struct {
	// Product type: `spot`,`linear`,`option`
	Category string `json:"category,omitempty" url:"category,omitempty"`
	// The unique instrument ID
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Order price in the quote currency of the instrument.
	Price string `json:"price,omitempty" url:"price,omitempty"`
	// Order quantity of the instrument.
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
}

type RfqQuoteListQuery

type RfqQuoteListQuery struct {
	// Inquiry ID
	RfqId string `json:"rfqId,omitempty" url:"rfqId,omitempty"`
	// Quote ID
	QuoteId string `json:"quoteId,omitempty" url:"quoteId,omitempty"`
	// Custom quote ID. If traderType is `request` this field is invalid
	QuoteLinkId string `json:"quoteLinkId,omitempty" url:"quoteLinkId,omitempty"`
	// Trader type, `quote` , `request`. Default: `quote`
	TraderType string `json:"traderType,omitempty" url:"traderType,omitempty"`
	// Status of the RFQ: `Active` `Canceled` `PendingFill` `Filled` `Expired` `Failed`
	Status Status `json:"status,omitempty" url:"status,omitempty"`
	// Return the number of items. \[`1`, `100`\]. Default: `50`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type RfqQuoteRealtime

type RfqQuoteRealtime struct {
	// An array of quotes
	List []RfqQuoteRealtimeListItem `json:"list,omitempty" url:"list,omitempty"`
}

type RfqQuoteRealtimeListItem

type RfqQuoteRealtimeListItem struct {
	// Inquiry ID
	RfqId string `json:"rfqId,omitempty" url:"rfqId,omitempty"`
	// Custom RFQ ID. Not publicly disclosed.
	RfqLinkId string `json:"rfqLinkId,omitempty" url:"rfqLinkId,omitempty"`
	// Quote ID
	QuoteId string `json:"quoteId,omitempty" url:"quoteId,omitempty"`
	// Custom quote ID. Not publicly disclosed.
	QuoteLinkId string `json:"quoteLinkId,omitempty" url:"quoteLinkId,omitempty"`
	// The quote's expiration time (ms)
	ExpiresAt string `json:"expiresAt,omitempty" url:"expiresAt,omitempty"`
	// The unique identification code of the inquiring party, which is not visible when anonymous was set to `true` when the RFQ was created
	DeskCode string `json:"deskCode,omitempty" url:"deskCode,omitempty"`
	// Status of the RFQ: `Active` `PendingFill` `Canceled` `Filled` `Expired` `Failed`
	Status string `json:"status,omitempty" url:"status,omitempty"`
	// Execute the quote direction, `Buy` or `Sell` . When the quote direction is `Buy` , for maker, the execution direction is the same as the direction in legs, and opposite for taker. Conversely, the same applies
	ExecQuoteSide string `json:"execQuoteSide,omitempty" url:"execQuoteSide,omitempty"`
	// Time (ms) when the trade is created in epoch, such as 1650380963
	CreatedAt string `json:"createdAt,omitempty" url:"createdAt,omitempty"`
	// Time (ms) when the trade is updated in epoch, such as 1650380964
	UpdatedAt string `json:"updatedAt,omitempty" url:"updatedAt,omitempty"`
	// Quote `Buy` Direction
	QuoteBuyList []RfqQuoteRealtimeListItemQuoteBuyListItem `json:"quoteBuyList,omitempty" url:"quoteBuyList,omitempty"`
	// Quote `Sell` Direction
	QuoteSellList []RfqQuoteRealtimeListItemQuoteSellListItem `json:"quoteSellList,omitempty" url:"quoteSellList,omitempty"`
}

type RfqQuoteRealtimeListItemQuoteBuyListItem

type RfqQuoteRealtimeListItemQuoteBuyListItem struct {
	// Product type: `spot`,`linear`,`option`
	Category string `json:"category,omitempty" url:"category,omitempty"`
	// The unique instrument ID
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Quote price
	Price string `json:"price,omitempty" url:"price,omitempty"`
	// Order quantity of the instrument.
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
}

type RfqQuoteRealtimeListItemQuoteSellListItem

type RfqQuoteRealtimeListItemQuoteSellListItem struct {
	// Product type: `spot`,`linear`,`option`
	Category string `json:"category,omitempty" url:"category,omitempty"`
	// The unique instrument ID
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Quote price
	Price string `json:"price,omitempty" url:"price,omitempty"`
	// Order quantity of the instrument.
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
}

type RfqQuoteRealtimeQuery

type RfqQuoteRealtimeQuery struct {
	// Inquiry ID
	RfqId string `json:"rfqId,omitempty" url:"rfqId,omitempty"`
	// Quote ID
	QuoteId string `json:"quoteId,omitempty" url:"quoteId,omitempty"`
	// Quote custom ID, traderType is `request` , this field is invalid
	QuoteLinkId string `json:"quoteLinkId,omitempty" url:"quoteLinkId,omitempty"`
	// Trader type, `quote` , `request`. Default: `quote`
	TraderType string `json:"traderType,omitempty" url:"traderType,omitempty"`
}

type RfqRfqList

type RfqRfqList struct {
	// Refer to the `cursor` request parameter
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
	// An array of RFQs
	List []RfqRfqListListItem `json:"list,omitempty" url:"list,omitempty"`
}

type RfqRfqListListItem

type RfqRfqListListItem struct {
	// Inquiry ID
	RfqId string `json:"rfqId,omitempty" url:"rfqId,omitempty"`
	// Custom RFQ ID. Not publicly disclosed.
	RfqLinkId string `json:"rfqLinkId,omitempty" url:"rfqLinkId,omitempty"`
	// List of bidders
	Counterparties []string `json:"counterparties,omitempty" url:"counterparties,omitempty"`
	// The inquiry's expiration time (ms)
	ExpiresAt string `json:"expiresAt,omitempty" url:"expiresAt,omitempty"`
	// Inquiry label
	StrategyType string `json:"strategyType,omitempty" url:"strategyType,omitempty"`
	// Status of the RFQ: `Active` `PendingFill` `Canceled` `Filled` `Expired` `Failed`
	Status string `json:"status,omitempty" url:"status,omitempty"`
	// Whether to accept non-LP quotes. The default value is `false`: `false`: Default value, do not accept non-LP quotes. `true`: Accept non-LP quotes
	AcceptOtherQuoteStatus string `json:"acceptOtherQuoteStatus,omitempty" url:"acceptOtherQuoteStatus,omitempty"`
	// The unique identification code of the inquiring party, which is not visible when anonymous was set to `true` when the RFQ was created
	DeskCode string `json:"deskCode,omitempty" url:"deskCode,omitempty"`
	// Time (ms) when the trade is created in epoch, such as 1650380963
	CreatedAt string `json:"createdAt,omitempty" url:"createdAt,omitempty"`
	// Time (ms) when the trade is updated in epoch, such as 1650380964
	UpdatedAt string `json:"updatedAt,omitempty" url:"updatedAt,omitempty"`
	// Combination transaction
	Legs []RfqRfqListListItemLegsItem `json:"legs,omitempty" url:"legs,omitempty"`
}

type RfqRfqListListItemLegsItem

type RfqRfqListListItemLegsItem struct {
	// category. Valid values include: `linear`, `option` and `spot`
	Category string `json:"category,omitempty" url:"category,omitempty"`
	// The unique instrument ID
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Inquiry direction: Valid values are `Buy` and `Sell`.
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Order quantity of the instrument.
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
}

type RfqRfqListQuery

type RfqRfqListQuery struct {
	// Inquiry ID
	RfqId string `json:"rfqId,omitempty" url:"rfqId,omitempty"`
	// Custom ID for RFQ; specify rfqLinkId to only check the last 3 months, traderType is quote, this field is invalid
	RfqLinkId string `json:"rfqLinkId,omitempty" url:"rfqLinkId,omitempty"`
	// Trader type, `quote` , `request`. Default: `quote`
	TraderType string `json:"traderType,omitempty" url:"traderType,omitempty"`
	// Status of the RFQ: `Active` `Canceled` `Filled` `Expired` `Failed`
	Status Status `json:"status,omitempty" url:"status,omitempty"`
	// Return the number of items. \[`1`, `100`\]. Default: `50`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type RfqRfqRealtime

type RfqRfqRealtime struct {
	// An array of RFQs
	List []RfqRfqRealtimeListItem `json:"list,omitempty" url:"list,omitempty"`
}

type RfqRfqRealtimeListItem

type RfqRfqRealtimeListItem struct {
	// Inquiry ID
	RfqId string `json:"rfqId,omitempty" url:"rfqId,omitempty"`
	// Custom RFQ ID. Not publicly disclosed.
	RfqLinkId string `json:"rfqLinkId,omitempty" url:"rfqLinkId,omitempty"`
	// List of bidders
	Counterparties []string `json:"counterparties,omitempty" url:"counterparties,omitempty"`
	// The inquiry's expiration time (ms)
	ExpiresAt string `json:"expiresAt,omitempty" url:"expiresAt,omitempty"`
	// Inquiry label
	StrategyType string `json:"strategyType,omitempty" url:"strategyType,omitempty"`
	// Status of the RFQ: `Active` `PendingFill` `Canceled` `Filled` `Expired` `Failed`
	Status string `json:"status,omitempty" url:"status,omitempty"`
	// Whether to accept non-LP quotes. The default value is `false`: `false`: Default value, do not accept non-LP quotes. `true`: Accept non-LP quotes
	AcceptOtherQuoteStatus string `json:"acceptOtherQuoteStatus,omitempty" url:"acceptOtherQuoteStatus,omitempty"`
	// The unique identification code of the inquiring party, which is not visible when anonymous was set to `true` when the RFQ was created
	DeskCode string `json:"deskCode,omitempty" url:"deskCode,omitempty"`
	// Time (ms) when the trade is created in epoch, such as 1650380963
	CreatedAt string `json:"createdAt,omitempty" url:"createdAt,omitempty"`
	// Time (ms) when the trade is updated in epoch, such as 1650380964
	UpdatedAt string `json:"updatedAt,omitempty" url:"updatedAt,omitempty"`
	// Combination transaction
	Legs []RfqRfqRealtimeListItemLegsItem `json:"legs,omitempty" url:"legs,omitempty"`
}

type RfqRfqRealtimeListItemLegsItem

type RfqRfqRealtimeListItemLegsItem struct {
	// category. Valid values include: "linear", "option" and "spot"
	Category string `json:"category,omitempty" url:"category,omitempty"`
	// The unique instrument ID
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Inquiry direction: Valid values are `Buy` and `Sell` .
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Order quantity of the instrument.
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
}

type RfqRfqRealtimeQuery

type RfqRfqRealtimeQuery struct {
	// Inquiry ID
	RfqId string `json:"rfqId,omitempty" url:"rfqId,omitempty"`
	// Custom inquiry ID, traderType is quote, this field is invalid
	RfqLinkId string `json:"rfqLinkId,omitempty" url:"rfqLinkId,omitempty"`
	// Trader type, `quote` , `request`. Default: `quote`
	TraderType string `json:"traderType,omitempty" url:"traderType,omitempty"`
}

type RfqTradeList

type RfqTradeList struct {
	// Refer to the `cursor` request parameter
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
	// An array of RFQs
	List []RfqTradeListListItem `json:"list,omitempty" url:"list,omitempty"`
}

type RfqTradeListListItem

type RfqTradeListListItem struct {
	// Inquiry ID
	RfqId string `json:"rfqId,omitempty" url:"rfqId,omitempty"`
	// Custom RFQ ID. Not publicly disclosed.
	RfqLinkId string `json:"rfqLinkId,omitempty" url:"rfqLinkId,omitempty"`
	// Return the completed RFQ and the executed quote id.
	QuoteId string `json:"quoteId,omitempty" url:"quoteId,omitempty"`
	// Custom quote ID. Not publicly disclosed.
	QuoteLinkId string `json:"quoteLinkId,omitempty" url:"quoteLinkId,omitempty"`
	// Return of completed inquiry, execution of quote direction, `Buy` or `Sell`
	QuoteSide string `json:"quoteSide,omitempty" url:"quoteSide,omitempty"`
	// Inquiry label
	StrategyType string `json:"strategyType,omitempty" url:"strategyType,omitempty"`
	// Status : `Filled` `Failed`
	Status string `json:"status,omitempty" url:"status,omitempty"`
	// The unique identification code of the inquiring party, which is not visible when anonymous was set to `true` when the RFQ was created
	RfqDeskCode string `json:"rfqDeskCode,omitempty" url:"rfqDeskCode,omitempty"`
	// The unique identification code of the quoting party, which is not visible when anonymous is set to `true` during quotation
	QuoteDeskCode string `json:"quoteDeskCode,omitempty" url:"quoteDeskCode,omitempty"`
	// Time (ms) when the trade is created in epoch, such as 1650380963
	CreatedAt string `json:"createdAt,omitempty" url:"createdAt,omitempty"`
	// Time (ms) when the trade is updated in epoch, such as 1650380964
	UpdatedAt string `json:"updatedAt,omitempty" url:"updatedAt,omitempty"`
	// Combination transaction
	Legs []RfqTradeListListItemLegsItem `json:"legs,omitempty" url:"legs,omitempty"`
}

type RfqTradeListListItemLegsItem

type RfqTradeListListItemLegsItem struct {
	// category. Valid values include: `linear`, `option` and `spot`
	Category string `json:"category,omitempty" url:"category,omitempty"`
	// bybit order id
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// The unique instrument ID
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Direction, valid values are `Buy` and `Sell`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Execution price
	Price string `json:"price,omitempty" url:"price,omitempty"`
	// Number of executions
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
	// The futures markPrice at the time of transaction, the spot is indexPrice, and the option is the markPrice of the underlying Price.
	MarkPrice string `json:"markPrice,omitempty" url:"markPrice,omitempty"`
	// The fee for taker or maker in the base currency paid to the Exchange executing the Block Trade.
	ExecFee string `json:"execFee,omitempty" url:"execFee,omitempty"`
	// The unique exec(trade) ID from the exchange
	ExecId string `json:"execId,omitempty" url:"execId,omitempty"`
	// The status code of the this order. "0" means success
	ResultCode int64 `json:"resultCode,omitempty" url:"resultCode,omitempty"`
	// Error message about resultCode. If resultCode is "0", resultMessage is "".
	ResultMessage string `json:"resultMessage,omitempty" url:"resultMessage,omitempty"`
	// Empty if status is `Filled`. Valid values: `Taker` or `Maker` if status is `Rejected`, "rejectParty='bybit'" to indicate errors that occur on the Bybit side.
	RejectParty string `json:"rejectParty,omitempty" url:"rejectParty,omitempty"`
}

type RfqTradeListQuery

type RfqTradeListQuery struct {
	// Inquiry ID
	RfqId string `json:"rfqId,omitempty" url:"rfqId,omitempty"`
	// Custom ID for RFQ; specify rfqLinkId to only check the last 3 months
	RfqLinkId string `json:"rfqLinkId,omitempty" url:"rfqLinkId,omitempty"`
	// Quote ID
	QuoteId string `json:"quoteId,omitempty" url:"quoteId,omitempty"`
	// quote custom ID; specifying quoteLinkId can only check the last 3 months
	QuoteLinkId string `json:"quoteLinkId,omitempty" url:"quoteLinkId,omitempty"`
	// Trader type, `quote` , `request` , default `quote`
	TraderType string `json:"traderType,omitempty" url:"traderType,omitempty"`
	// Status : `Filled` `Failed`
	Status Status `json:"status,omitempty" url:"status,omitempty"`
	// Return the number of items. \[`1`, `100`\]. Default: `50`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type SbeOrderStatus

type SbeOrderStatus string
const (
	SbeOrderStatus5 SbeOrderStatus = "5"
	SbeOrderStatus6 SbeOrderStatus = "6"
	SbeOrderStatus7 SbeOrderStatus = "7"
	SbeOrderStatus8 SbeOrderStatus = "8"
	SbeOrderStatus9 SbeOrderStatus = "9"
	SbeOrderStatus0 SbeOrderStatus = "0"
)

type SbeRejectReason

type SbeRejectReason string
const (
	SbeRejectReason0   SbeRejectReason = "0"
	SbeRejectReason1   SbeRejectReason = "1"
	SbeRejectReason2   SbeRejectReason = "2"
	SbeRejectReason3   SbeRejectReason = "3"
	SbeRejectReason4   SbeRejectReason = "4"
	SbeRejectReason5   SbeRejectReason = "5"
	SbeRejectReason6   SbeRejectReason = "6"
	SbeRejectReason7   SbeRejectReason = "7"
	SbeRejectReason8   SbeRejectReason = "8"
	SbeRejectReason9   SbeRejectReason = "9"
	SbeRejectReason10  SbeRejectReason = "10"
	SbeRejectReason11  SbeRejectReason = "11"
	SbeRejectReason12  SbeRejectReason = "12"
	SbeRejectReason13  SbeRejectReason = "13"
	SbeRejectReason14  SbeRejectReason = "14"
	SbeRejectReason15  SbeRejectReason = "15"
	SbeRejectReason16  SbeRejectReason = "16"
	SbeRejectReason17  SbeRejectReason = "17"
	SbeRejectReason18  SbeRejectReason = "18"
	SbeRejectReason19  SbeRejectReason = "19"
	SbeRejectReason20  SbeRejectReason = "20"
	SbeRejectReason21  SbeRejectReason = "21"
	SbeRejectReason22  SbeRejectReason = "22"
	SbeRejectReason23  SbeRejectReason = "23"
	SbeRejectReason24  SbeRejectReason = "24"
	SbeRejectReason25  SbeRejectReason = "25"
	SbeRejectReason28  SbeRejectReason = "28"
	SbeRejectReason29  SbeRejectReason = "29"
	SbeRejectReason30  SbeRejectReason = "30"
	SbeRejectReason31  SbeRejectReason = "31"
	SbeRejectReason34  SbeRejectReason = "34"
	SbeRejectReason35  SbeRejectReason = "35"
	SbeRejectReason36  SbeRejectReason = "36"
	SbeRejectReason100 SbeRejectReason = "100"
	SbeRejectReason101 SbeRejectReason = "101"
	SbeRejectReason102 SbeRejectReason = "102"
	SbeRejectReason103 SbeRejectReason = "103"
	SbeRejectReason104 SbeRejectReason = "104"
	SbeRejectReason105 SbeRejectReason = "105"
	SbeRejectReason106 SbeRejectReason = "106"
	SbeRejectReason107 SbeRejectReason = "107"
	SbeRejectReason108 SbeRejectReason = "108"
	SbeRejectReason110 SbeRejectReason = "110"
	SbeRejectReason111 SbeRejectReason = "111"
	SbeRejectReason112 SbeRejectReason = "112"
	SbeRejectReason113 SbeRejectReason = "113"
	SbeRejectReason200 SbeRejectReason = "200"
)

type ServiceTypes

type ServiceTypes string
const (
	ServiceTypes1 ServiceTypes = "1"
	ServiceTypes2 ServiceTypes = "2"
	ServiceTypes3 ServiceTypes = "3"
	ServiceTypes4 ServiceTypes = "4"
	ServiceTypes5 ServiceTypes = "5"
)

type SmpType

type SmpType string
const (
	SmpTypeNone        SmpType = "None"
	SmpTypeCancelMaker SmpType = "CancelMaker"
	SmpTypeCancelTaker SmpType = "CancelTaker"
	SmpTypeCancelBoth  SmpType = "CancelBoth"
)

type SpotFeeCurrencyInstruction

type SpotFeeCurrencyInstruction string

type SpotMarginTradeCoinstate

type SpotMarginTradeCoinstate struct {
	// Object
	List []SpotMarginTradeCoinstateListItem `json:"list,omitempty" url:"list,omitempty"`
}

type SpotMarginTradeCoinstateListItem

type SpotMarginTradeCoinstateListItem struct {
	// Coin name, uppercase only
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
	// Spot margin leverage. Returns "" if spot margin mode is turned off
	SpotLeverage string `json:"spotLeverage,omitempty" url:"spotLeverage,omitempty"`
}

type SpotMarginTradeCoinstateQuery

type SpotMarginTradeCoinstateQuery struct {
	// Coin name, uppercase only
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
}

type SpotMarginTradeCollateral

type SpotMarginTradeCollateral struct {
	// Object
	List []SpotMarginTradeCollateralListItem `json:"list,omitempty" url:"list,omitempty"`
}

type SpotMarginTradeCollateralListItem

type SpotMarginTradeCollateralListItem struct {
	// Coin name
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
	// Object
	CollateralRatioList []SpotMarginTradeCollateralListItemCollateralRatioListItem `json:"collateralRatioList,omitempty" url:"collateralRatioList,omitempty"`
}

type SpotMarginTradeCollateralListItemCollateralRatioListItem

type SpotMarginTradeCollateralListItemCollateralRatioListItem struct {
	// Upper limit(in coin) of the tiered range, `""` means positive infinity
	MaxQty string `json:"maxQty,omitempty" url:"maxQty,omitempty"`
	// lower limit(in coin) of the tiered range
	MinQty string `json:"minQty,omitempty" url:"minQty,omitempty"`
	// Collateral ratio
	CollateralRatio string `json:"collateralRatio,omitempty" url:"collateralRatio,omitempty"`
}

type SpotMarginTradeCollateralQuery

type SpotMarginTradeCollateralQuery struct {
	// Coin name, uppercase only
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
}

type SpotMarginTradeGetAutoRepayMode

type SpotMarginTradeGetAutoRepayMode struct {
	// Object
	Data []SpotMarginTradeGetAutoRepayModeDataItem `json:"data,omitempty" url:"data,omitempty"`
}

type SpotMarginTradeGetAutoRepayModeDataItem

type SpotMarginTradeGetAutoRepayModeDataItem struct {
	// Coin name, uppercase only.
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
	// - `1`: On
	// 	- `0`: Off
	AutoRepayMode string `json:"autoRepayMode,omitempty" url:"autoRepayMode,omitempty"`
}

type SpotMarginTradeGetAutoRepayModeQuery

type SpotMarginTradeGetAutoRepayModeQuery struct {
	// Coin name, uppercase only. If `currency` is not passed, automatic repay mode for all currencies will be returned.
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
}

type SpotMarginTradeInterestRateHistory

type SpotMarginTradeInterestRateHistory struct {
	List []SpotMarginTradeInterestRateHistoryListItem `json:"list,omitempty" url:"list,omitempty"`
}

type SpotMarginTradeInterestRateHistoryListItem

type SpotMarginTradeInterestRateHistoryListItem struct {
	// timestamp
	Timestamp int64 `json:"timestamp,omitempty" url:"timestamp,omitempty"`
	// coin name
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
	// Hourly borrowing rate
	HourlyBorrowRate string `json:"hourlyBorrowRate,omitempty" url:"hourlyBorrowRate,omitempty"`
	// VIP/Pro level
	VipLevel string `json:"vipLevel,omitempty" url:"vipLevel,omitempty"`
}

type SpotMarginTradeInterestRateHistoryQuery

type SpotMarginTradeInterestRateHistoryQuery struct {
	// Coin name, uppercase only
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
	// VIP level
	//
	// 	- Please note that "No VIP" should be passed like "No%20VIP" in the query string
	// 	- If not passed, it returns your account's VIP level data
	VipLevel VipLevel `json:"vipLevel,omitempty" url:"vipLevel,omitempty"`
	// The start timestamp (ms)
	//
	// 	- Either both time parameters are passed or neither is passed.
	// 	- Returns 7 days data when both are not passed
	// 	- Supports up to 30 days interval when both are passed
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms)
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
}

type SpotMarginTradeMaxBorrowable

type SpotMarginTradeMaxBorrowable struct {
	// Coin name, uppercase only
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
	// Max borrowable amount
	MaxLoan string `json:"maxLoan,omitempty" url:"maxLoan,omitempty"`
}

type SpotMarginTradeMaxBorrowableQuery

type SpotMarginTradeMaxBorrowableQuery struct {
	// Coin name, uppercase only
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
}

type SpotMarginTradePositionTiers

type SpotMarginTradePositionTiers struct {
	// Object
	List []SpotMarginTradePositionTiersListItem `json:"list,omitempty" url:"list,omitempty"`
	// Tiers. Display from small to large
	Tier string `json:"tier,omitempty" url:"tier,omitempty"`
	// Tiers Accumulation Borrow limit
	BorrowLimit string `json:"borrowLimit,omitempty" url:"borrowLimit,omitempty"`
	// Loan Maintenance Margin Rate. Precision 8 decimal places
	PositionMmr string `json:"positionMMR,omitempty" url:"positionMMR,omitempty"`
	// Loan Initial Margin Rate. Precision 8 decimal places
	PositionImr string `json:"positionIMR,omitempty" url:"positionIMR,omitempty"`
	// Max Loan Leverage
	MaxLeverage string `json:"maxLeverage,omitempty" url:"maxLeverage,omitempty"`
}

type SpotMarginTradePositionTiersListItem

type SpotMarginTradePositionTiersListItem struct {
	// Coin name, uppercase only
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
	// Object
	PositionTiersRatioList string `json:"positionTiersRatioList,omitempty" url:"positionTiersRatioList,omitempty"`
}

type SpotMarginTradePositionTiersQuery

type SpotMarginTradePositionTiersQuery struct {
	// Coin name, uppercase only
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
}

type SpotMarginTradeRepaymentAvailableAmount

type SpotMarginTradeRepaymentAvailableAmount struct {
	// Coin name, uppercase only
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
	// Repayment amount = min(spot coin available balance, coin borrow amount)
	LossLessRepaymentAmount string `json:"lossLessRepaymentAmount,omitempty" url:"lossLessRepaymentAmount,omitempty"`
}

type SpotMarginTradeRepaymentAvailableAmountQuery

type SpotMarginTradeRepaymentAvailableAmountQuery struct {
	// Coin name, uppercase only
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
}

type SpotMarginTradeSetAutoRepayModeParams

type SpotMarginTradeSetAutoRepayModeParams struct {
	// Coin name, uppercase only. If `currency` is not passed, spot automatic repayment will be enabled for all currencies.
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
	// - `1`: On
	// 	- `0`: Off
	AutoRepayMode string `json:"autoRepayMode,omitempty" url:"autoRepayMode,omitempty"`
}

type SpotMarginTradeSetAutoRepayModeResult

type SpotMarginTradeSetAutoRepayModeResult struct {
	// Object
	Data []SpotMarginTradeSetAutoRepayModeResultDataItem `json:"data,omitempty" url:"data,omitempty"`
}

type SpotMarginTradeSetAutoRepayModeResultDataItem

type SpotMarginTradeSetAutoRepayModeResultDataItem struct {
	// Coin name, uppercase only.
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
	// - `1`: On
	// 	- `0`: Off
	AutoRepayMode string `json:"autoRepayMode,omitempty" url:"autoRepayMode,omitempty"`
}

type SpotMarginTradeSetLeverageParams

type SpotMarginTradeSetLeverageParams struct {
	// Leverage. \[`2`, `10`\].
	Leverage string `json:"leverage,omitempty" url:"leverage,omitempty"`
	// Coin name, uppercase only
	Currency string `json:"currency,omitempty" url:"currency,omitempty"`
}

type SpotMarginTradeState

type SpotMarginTradeState struct {
	// Spot margin leverage. Returns `""` if the margin trade is turned off
	SpotLeverage string `json:"spotLeverage,omitempty" url:"spotLeverage,omitempty"`
	// Spot margin status. `1`: on, `0`: off
	SpotMarginMode string `json:"spotMarginMode,omitempty" url:"spotMarginMode,omitempty"`
	// actual leverage ratio. Precision retains 2 decimal places, truncate downwards
	EffectiveLeverage string `json:"effectiveLeverage,omitempty" url:"effectiveLeverage,omitempty"`
}

type SpotMarginTradeSwitchModeParams

type SpotMarginTradeSwitchModeParams struct {
	// `1`: on, `0`: off
	SpotMarginMode string `json:"spotMarginMode,omitempty" url:"spotMarginMode,omitempty"`
}

type SpotMarginTradeSwitchModeResult

type SpotMarginTradeSwitchModeResult struct {
	// Spot margin status. `1`: on, `0`: off
	SpotMarginMode string `json:"spotMarginMode,omitempty" url:"spotMarginMode,omitempty"`
}

type SpreadExecutionList

type SpreadExecutionList struct {
	// Trade info
	List []SpreadExecutionListListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type SpreadExecutionListListItem

type SpreadExecutionListListItem struct {
	// Spread combination symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// Side, `Buy`, `Sell`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Spread combination order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Combo Exec price
	ExecPrice string `json:"execPrice,omitempty" url:"execPrice,omitempty"`
	// Combo exec timestamp (ms)
	ExecTime string `json:"execTime,omitempty" url:"execTime,omitempty"`
	// Combo exec type, `Trade`
	ExecType string `json:"execType,omitempty" url:"execType,omitempty"`
	// Combo exec qty
	ExecQty string `json:"execQty,omitempty" url:"execQty,omitempty"`
	// Combo exec ID
	ExecId string `json:"execId,omitempty" url:"execId,omitempty"`
	// Legs execution info
	Legs []SpreadExecutionListListItemLegsItem `json:"legs,omitempty" url:"legs,omitempty"`
}

type SpreadExecutionListListItemLegsItem

type SpreadExecutionListListItemLegsItem struct {
	// Leg symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Leg order side, `Buy`, `Sell`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Leg exec price
	ExecPrice string `json:"execPrice,omitempty" url:"execPrice,omitempty"`
	// Leg exec timestamp (ms)
	ExecTime string `json:"execTime,omitempty" url:"execTime,omitempty"`
	// Leg exec value
	ExecValue string `json:"execValue,omitempty" url:"execValue,omitempty"`
	// Leg exec type
	ExecType ExecType `json:"execType,omitempty" url:"execType,omitempty"`
	// Leg category, `linear`, `spot`
	Category string `json:"category,omitempty" url:"category,omitempty"`
	// Leg exec qty
	ExecQty string `json:"execQty,omitempty" url:"execQty,omitempty"`
	// Leg exec fee, deprecated for Spot leg
	ExecFee string `json:"execFee,omitempty" url:"execFee,omitempty"`
	// Leg exec fee, used for Spot leg only
	ExecFeeV2 string `json:"execFeeV2,omitempty" url:"execFeeV2,omitempty"`
	// Leg fee currency
	FeeCurrency string `json:"feeCurrency,omitempty" url:"feeCurrency,omitempty"`
	// Leg exec ID
	ExecId string `json:"execId,omitempty" url:"execId,omitempty"`
}

type SpreadExecutionListQuery

type SpreadExecutionListQuery struct {
	// Spread combination symbol name
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Spread combination order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// The start timestamp (ms)
	//
	// 	- startTime and endTime are not passed, return 7 days by default
	// 	- Only startTime is passed, return range between startTime and startTime+7 days
	// 	- Only endTime is passed, return range between endTime-7 days and endTime
	// 	- If both are passed, the rule is endTime - startTime <= 7 days
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms)
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Limit for parent order data size per page. \[`1`, `50`\]. Default: `20`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type SpreadInstrument

type SpreadInstrument struct {
	// instrument info
	List []SpreadInstrumentListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type SpreadInstrumentListItem

type SpreadInstrumentListItem struct {
	// Spread combination symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Product type
	//
	// 	- `FundingRateArb`: perpetual & spot combination
	// 	- `CarryTrade`: futures & spot combination
	// 	- `FutureSpread`: different expiry futures combination
	// 	- `PerpBasis`: futures & perpetual
	ContractType string `json:"contractType,omitempty" url:"contractType,omitempty"`
	// Spread status. `Trading`, `Settling`
	Status string `json:"status,omitempty" url:"status,omitempty"`
	// Base coin
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
	// Quote coin
	QuoteCoin string `json:"quoteCoin,omitempty" url:"quoteCoin,omitempty"`
	// Settle coin
	SettleCoin string `json:"settleCoin,omitempty" url:"settleCoin,omitempty"`
	// The step to increase/reduce order price
	TickSize string `json:"tickSize,omitempty" url:"tickSize,omitempty"`
	// Min. order price
	MinPrice string `json:"minPrice,omitempty" url:"minPrice,omitempty"`
	// Max. order price
	MaxPrice string `json:"maxPrice,omitempty" url:"maxPrice,omitempty"`
	// Order qty precision
	LotSize string `json:"lotSize,omitempty" url:"lotSize,omitempty"`
	// Min. order qty
	MinSize string `json:"minSize,omitempty" url:"minSize,omitempty"`
	// Max. order qty
	MaxSize string `json:"maxSize,omitempty" url:"maxSize,omitempty"`
	// Launch timestamp (ms)
	LaunchTime string `json:"launchTime,omitempty" url:"launchTime,omitempty"`
	// Delivery timestamp (ms)
	DeliveryTime string `json:"deliveryTime,omitempty" url:"deliveryTime,omitempty"`
	// Legs information
	Legs []SpreadInstrumentListItemLegsItem `json:"legs,omitempty" url:"legs,omitempty"`
}

type SpreadInstrumentListItemLegsItem

type SpreadInstrumentListItemLegsItem struct {
	// Legs symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Legs contract type. `LinearPerpetual`, `LinearFutures`, `Spot`
	ContractType string `json:"contractType,omitempty" url:"contractType,omitempty"`
}

type SpreadInstrumentQuery

type SpreadInstrumentQuery struct {
	// Spread combination symbol name
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Base coin, uppercase only
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
	// Limit for data size per page. \[`1`, `500`\]. Default: `200`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type SpreadOrderAmendParams

type SpreadOrderAmendParams struct {
	// Spread combination symbol name
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Spread combination order ID. Either `orderId` or `orderLinkId` is **required**
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID. Either `orderId` or `orderLinkId` is **required**
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// Order quantity after modification. Either `qty` or `price` is **required**
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
	// Order price after modification
	//
	// 	- Either `qty` or `price` is **required**
	// 	- price="" means the price remains unchanged, while price="0" updates the price to 0.
	Price string `json:"price,omitempty" url:"price,omitempty"`
}

type SpreadOrderAmendResult

type SpreadOrderAmendResult struct {
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
}

type SpreadOrderCancelAllParams

type SpreadOrderCancelAllParams struct {
	// Spread combination symbol name
	//
	// 	- When a symbol is specified, all orders for that symbol will be cancelled regardless of the `cancelAll` field.
	// 	- When a symbol is not specified and `cancelAll`\=true, all orders, regardless of the symbol, will be cancelled
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// `true`, `false`
	CancelAll bool `json:"cancelAll,omitempty" url:"cancelAll,omitempty"`
}

type SpreadOrderCancelAllResult

type SpreadOrderCancelAllResult struct {
	List []SpreadOrderCancelAllResultListItem `json:"list,omitempty" url:"list,omitempty"`
	// The field can be ignored
	Success string `json:"success,omitempty" url:"success,omitempty"`
}

type SpreadOrderCancelAllResultListItem

type SpreadOrderCancelAllResultListItem struct {
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
}

type SpreadOrderCancelParams

type SpreadOrderCancelParams struct {
	// Spread combination order ID. Either `orderId` or `orderLinkId` is **required**
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID. Either `orderId` or `orderLinkId` is **required**
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
}

type SpreadOrderCancelResult

type SpreadOrderCancelResult struct {
	// Order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
}

type SpreadOrderCreateParams

type SpreadOrderCreateParams struct {
	// Spread combination symbol name
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Order side. `Buy`, `Sell`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// `Limit`, `Market`
	OrderType OrderType `json:"orderType,omitempty" url:"orderType,omitempty"`
	// Order qty
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
	// Order price
	Price string `json:"price,omitempty" url:"price,omitempty"`
	// User customised order ID, a max of 45 characters. Combinations of numbers, letters (upper and lower cases), dashes, and underscores are supported.
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// [Time in force](https://www.bybit.com/en/help-center/article/What-Are-Time-In-Force-TIF-GTC-IOC-FOK). `IOC`, `FOK`, `GTC`, `PostOnly`
	TimeInForce TimeInForce `json:"timeInForce,omitempty" url:"timeInForce,omitempty"`
}

type SpreadOrderCreateResult

type SpreadOrderCreateResult struct {
	// Spread combination order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
}

type SpreadOrderHistory

type SpreadOrderHistory struct {
	// Order info
	List []SpreadOrderHistoryListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type SpreadOrderHistoryListItem

type SpreadOrderHistoryListItem struct {
	// Spread combination symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Order type, `Market`, `Limit`
	OrderType string `json:"orderType,omitempty" url:"orderType,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// Spread combination order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// Combo type
	//
	// 	- `FundingRateArb`: perpetual & spot combination
	// 	- `CarryTrade`: futures & spot combination
	// 	- `FutureSpread`: different expiry futures combination
	// 	- `PerpBasis`: futures & perpetual
	ContractType string `json:"contractType,omitempty" url:"contractType,omitempty"`
	// Reject reason
	CxlRejReason RejectReason `json:"cxlRejReason,omitempty" url:"cxlRejReason,omitempty"`
	// Order status, `Rejected`, `Cancelled`, `Filled`
	OrderStatus OrderStatus `json:"orderStatus,omitempty" url:"orderStatus,omitempty"`
	// Order price
	Price string `json:"price,omitempty" url:"price,omitempty"`
	// Order qty
	OrderQty string `json:"orderQty,omitempty" url:"orderQty,omitempty"`
	// Time in force, `GTC`, `FOK`, `IOC`, `PostOnly`
	TimeInForce string `json:"timeInForce,omitempty" url:"timeInForce,omitempty"`
	// Base coin
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
	// Order created timestamp (ms)
	CreatedAt string `json:"createdAt,omitempty" url:"createdAt,omitempty"`
	// Order updated timestamp (ms)
	UpdatedAt string `json:"updatedAt,omitempty" url:"updatedAt,omitempty"`
	// Side, `Buy`, `Sell`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// The remaining qty not executed. It is meaningless for a cancelled order
	LeavesQty string `json:"leavesQty,omitempty" url:"leavesQty,omitempty"`
	// Settle coin
	SettleCoin string `json:"settleCoin,omitempty" url:"settleCoin,omitempty"`
	// Cumulative executed order qty
	CumExecQty string `json:"cumExecQty,omitempty" url:"cumExecQty,omitempty"`
	// Order qty
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
	// Leg1 symbol name
	Leg1Symbol string `json:"leg1Symbol,omitempty" url:"leg1Symbol,omitempty"`
	// Leg1 product type, `Futures`, `Spot`
	Leg1ProdType string `json:"leg1ProdType,omitempty" url:"leg1ProdType,omitempty"`
	// Leg1 order ID
	Leg1OrderId string `json:"leg1OrderId,omitempty" url:"leg1OrderId,omitempty"`
	// Leg1 order side
	Leg1Side string `json:"leg1Side,omitempty" url:"leg1Side,omitempty"`
	// Leg2 product type, `Futures`, `Spot`
	Leg2ProdType string `json:"leg2ProdType,omitempty" url:"leg2ProdType,omitempty"`
	// Leg2 order ID
	Leg2OrderId string `json:"leg2OrderId,omitempty" url:"leg2OrderId,omitempty"`
	// Leg2 symbol name
	Leg2Symbol string `json:"leg2Symbol,omitempty" url:"leg2Symbol,omitempty"`
	// Leg2 orde side
	Leg2Side string `json:"leg2Side,omitempty" url:"leg2Side,omitempty"`
}

type SpreadOrderHistoryQuery

type SpreadOrderHistoryQuery struct {
	// Spread combination symbol name
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Base coin
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
	// Spread combination order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// The start timestamp (ms)
	//
	// 	- startTime and endTime are not passed, return 7 days by default
	// 	- Only startTime is passed, return range between startTime and startTime+7 days
	// 	- Only endTime is passed, return range between endTime-7 days and endTime
	// 	- If both are passed, the rule is endTime - startTime <= 7 days
	StartTime int64 `json:"startTime,omitempty" url:"startTime,omitempty"`
	// The end timestamp (ms)
	EndTime int64 `json:"endTime,omitempty" url:"endTime,omitempty"`
	// Limit for data size per page. \[`1`, `50`\]. Default: `20`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type SpreadOrderRealtime

type SpreadOrderRealtime struct {
	// Order info
	List []SpreadOrderRealtimeListItem `json:"list,omitempty" url:"list,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type SpreadOrderRealtimeListItem

type SpreadOrderRealtimeListItem struct {
	// Spread combination symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Base coin
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
	// Order type, `Market`, `Limit`
	OrderType string `json:"orderType,omitempty" url:"orderType,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// Side, `Buy`, `Sell`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Time in force, `GTC`, `FOK`, `IOC`, `PostOnly`
	TimeInForce string `json:"timeInForce,omitempty" url:"timeInForce,omitempty"`
	// Spread combination order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// The remaining qty not executed
	LeavesQty string `json:"leavesQty,omitempty" url:"leavesQty,omitempty"`
	// Order status, `New`, `PartiallyFilled`
	OrderStatus string `json:"orderStatus,omitempty" url:"orderStatus,omitempty"`
	// Cumulative executed order qty
	CumExecQty string `json:"cumExecQty,omitempty" url:"cumExecQty,omitempty"`
	// Order price
	Price string `json:"price,omitempty" url:"price,omitempty"`
	// Order qty
	Qty string `json:"qty,omitempty" url:"qty,omitempty"`
	// Order created timestamp (ms)
	CreatedTime string `json:"createdTime,omitempty" url:"createdTime,omitempty"`
	// Order updated timestamp (ms)
	UpdatedTime string `json:"updatedTime,omitempty" url:"updatedTime,omitempty"`
}

type SpreadOrderRealtimeQuery

type SpreadOrderRealtimeQuery struct {
	// Spread combination symbol name
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Base coin
	BaseCoin string `json:"baseCoin,omitempty" url:"baseCoin,omitempty"`
	// Spread combination order ID
	OrderId string `json:"orderId,omitempty" url:"orderId,omitempty"`
	// User customised order ID
	OrderLinkId string `json:"orderLinkId,omitempty" url:"orderLinkId,omitempty"`
	// Limit for data size per page. \[`1`, `50`\]. Default: `20`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type SpreadOrderbook

type SpreadOrderbook struct {
	// Spread combination symbol name
	S string `json:"s,omitempty" url:"s,omitempty"`
	// Bid, buyer. Sorted by price in descending order
	B []SpreadOrderbookBItem `json:"b,omitempty" url:"b,omitempty"`
	// Ask, seller. Sorted by price in ascending order
	A []SpreadOrderbookAItem `json:"a,omitempty" url:"a,omitempty"`
	// The timestamp (ms) that the system generates the data
	Ts int64 `json:"ts,omitempty" url:"ts,omitempty"`
	// Update ID. Is always in sequence. Corresponds to `u` in the 25-level [WebSocket orderbook stream](https://bybit-exchange.github.io/docs/v5/spread/websocket/public/orderbook)
	U int64 `json:"u,omitempty" url:"u,omitempty"`
	// Cross sequence
	Seq int64 `json:"seq,omitempty" url:"seq,omitempty"`
	// The timestamp from the matching engine when this orderbook data is produced. It can be correlated with `T` from [public trade channel](/docs/v5/spread/websocket/public/trade)
	Cts int64 `json:"cts,omitempty" url:"cts,omitempty"`
}

type SpreadOrderbookAItem

type SpreadOrderbookAItem struct {
	// Ask price
	A0 string
	// Ask size
	A1 string
}

func (*SpreadOrderbookAItem) UnmarshalJSON

func (o *SpreadOrderbookAItem) UnmarshalJSON(data []byte) error

type SpreadOrderbookBItem

type SpreadOrderbookBItem struct {
	// Bid price
	B0 string
	// Bid size
	B1 string
}

func (*SpreadOrderbookBItem) UnmarshalJSON

func (o *SpreadOrderbookBItem) UnmarshalJSON(data []byte) error

type SpreadOrderbookQuery

type SpreadOrderbookQuery struct {
	// Spread combination symbol name
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Limit size for each bid and ask \[`1`, `25`\]. Default: `1`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
}

type SpreadRecentTrade

type SpreadRecentTrade struct {
	// Public trade info
	List []SpreadRecentTradeListItem `json:"list,omitempty" url:"list,omitempty"`
}

type SpreadRecentTradeListItem

type SpreadRecentTradeListItem struct {
	// Execution ID
	ExecId string `json:"execId,omitempty" url:"execId,omitempty"`
	// Spread combination symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Trade price
	Price string `json:"price,omitempty" url:"price,omitempty"`
	// Trade size
	Size string `json:"size,omitempty" url:"size,omitempty"`
	// Side of taker `Buy`, `Sell`
	Side string `json:"side,omitempty" url:"side,omitempty"`
	// Trade time (ms)
	Time string `json:"time,omitempty" url:"time,omitempty"`
	// Cross sequence
	Seq string `json:"seq,omitempty" url:"seq,omitempty"`
}

type SpreadRecentTradeQuery

type SpreadRecentTradeQuery struct {
	// Spread combination symbol name
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Limit for data size per page \[`1`,`1000`\], default: `500`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
}

type SpreadTickers

type SpreadTickers struct {
	// Ticker info
	List []SpreadTickersListItem `json:"list,omitempty" url:"list,omitempty"`
}

type SpreadTickersListItem

type SpreadTickersListItem struct {
	// Spread combination symbol name
	Symbol string `json:"symbol,omitempty" url:"symbol,omitempty"`
	// Bid 1 price
	BidPrice string `json:"bidPrice,omitempty" url:"bidPrice,omitempty"`
	// Bid 1 size
	BidSize string `json:"bidSize,omitempty" url:"bidSize,omitempty"`
	// Ask 1 price
	AskPrice string `json:"askPrice,omitempty" url:"askPrice,omitempty"`
	// Ask 1 size
	AskSize string `json:"askSize,omitempty" url:"askSize,omitempty"`
	// Last trade price
	LastPrice string `json:"lastPrice,omitempty" url:"lastPrice,omitempty"`
	// The highest price in the last 24 hours
	HighPrice24H string `json:"highPrice24h,omitempty" url:"highPrice24h,omitempty"`
	// The lowest price in the last 24 hours
	LowPrice24H string `json:"lowPrice24h,omitempty" url:"lowPrice24h,omitempty"`
	// Price 24 hours ago
	PrevPrice24H string `json:"prevPrice24h,omitempty" url:"prevPrice24h,omitempty"`
	// Volume for 24h
	Volume24H string `json:"volume24h,omitempty" url:"volume24h,omitempty"`
}

type SpreadTickersQuery

type SpreadTickersQuery struct {
	// Spread combination symbol name
	Symbol Symbol `json:"symbol,omitempty" url:"symbol,omitempty"`
}

type State

type State string
const (
	StateScheduled State = "scheduled"
	StateOngoing   State = "ongoing"
	StateCompleted State = "completed"
	StateCanceled  State = "canceled"
)

type Status

type Status string
const (
	StatusPreLaunch  Status = "PreLaunch"
	StatusTrading    Status = "Trading"
	StatusDelivering Status = "Delivering"
	StatusClosed     Status = "Closed"
)

type StopOrderType

type StopOrderType string
const (
	StopOrderTypeTakeProfit             StopOrderType = "TakeProfit"
	StopOrderTypeStopLoss               StopOrderType = "StopLoss"
	StopOrderTypeTrailingStop           StopOrderType = "TrailingStop"
	StopOrderTypeStop                   StopOrderType = "Stop"
	StopOrderTypePartialTakeProfit      StopOrderType = "PartialTakeProfit"
	StopOrderTypePartialStopLoss        StopOrderType = "PartialStopLoss"
	StopOrderTypeTpslOrder              StopOrderType = "tpslOrder"
	StopOrderTypeOcoOrder               StopOrderType = "OcoOrder"
	StopOrderTypeMmRateClose            StopOrderType = "MmRateClose"
	StopOrderTypeBidirectionalTpslOrder StopOrderType = "BidirectionalTpslOrder"
)

type Symbol

type Symbol string
const (
	SymbolBtcusdt              Symbol = "BTCUSDT"
	SymbolEthusdt              Symbol = "ETHUSDT"
	SymbolBtcusdt21Feb25       Symbol = "BTCUSDT-21FEB25"
	SymbolEthusdt14Feb25       Symbol = "ETHUSDT-14FEB25"
	SymbolBtcperp              Symbol = "BTCPERP"
	SymbolEthperp              Symbol = "ETHPERP"
	SymbolBtc24Mar23           Symbol = "BTC-24MAR23"
	SymbolBtcusd               Symbol = "BTCUSD"
	SymbolEthusd               Symbol = "ETHUSD"
	SymbolBtcusdh23            Symbol = "BTCUSDH23"
	SymbolBtcusdm23            Symbol = "BTCUSDM23"
	SymbolBtcusdu23            Symbol = "BTCUSDU23"
	SymbolBtcusdz23            Symbol = "BTCUSDZ23"
	SymbolEthusdc              Symbol = "ETHUSDC"
	SymbolBtc13Feb2589000PUsdt Symbol = "BTC-13FEB25-89000-P-USDT"
	SymbolEth28Feb252800C      Symbol = "ETH-28FEB25-2800-C"
)

type SymbolType

type SymbolType string
const (
	SymbolTypeInnovation SymbolType = "innovation"
	SymbolTypeAdventure  SymbolType = "adventure"
	SymbolTypeXstocks    SymbolType = "xstocks"
)

type SystemStatus

type SystemStatus struct {
	// Object
	List []SystemStatusListItem `json:"list,omitempty" url:"list,omitempty"`
}

type SystemStatusListItem

type SystemStatusListItem struct {
	// Id. Unique identifier
	Id string `json:"id,omitempty" url:"id,omitempty"`
	// Title of system maintenance
	Title string `json:"title,omitempty" url:"title,omitempty"`
	// System state
	State State `json:"state,omitempty" url:"state,omitempty"`
	// Start time of system maintenance, timestamp in milliseconds
	Begin string `json:"begin,omitempty" url:"begin,omitempty"`
	// End time of system maintenance, timestamp in milliseconds. Before maintenance is completed, it is the expected end time; After maintenance is completed, it will be changed to the actual end time.
	End string `json:"end,omitempty" url:"end,omitempty"`
	// Hyperlink to system maintenance details. Default value is empty string
	Href string `json:"href,omitempty" url:"href,omitempty"`
	// Service Type
	ServiceTypes ServiceTypes `json:"serviceTypes,omitempty" url:"serviceTypes,omitempty"`
	// Product
	Product Product `json:"product,omitempty" url:"product,omitempty"`
	// Affected UID tail number
	UidSuffix []int64 `json:"uidSuffix,omitempty" url:"uidSuffix,omitempty"`
	// Maintenance type
	MaintainType MaintainType `json:"maintainType,omitempty" url:"maintainType,omitempty"`
	// Environment
	Env Env `json:"env,omitempty" url:"env,omitempty"`
}

type SystemStatusQuery

type SystemStatusQuery struct {
	// id. Unique identifier
	Id string `json:"id,omitempty" url:"id,omitempty"`
	// system state
	State State `json:"state,omitempty" url:"state,omitempty"`
}

type TickDirection

type TickDirection string
const (
	TickDirectionPlusTick      TickDirection = "PlusTick"
	TickDirectionZeroPlusTick  TickDirection = "ZeroPlusTick"
	TickDirectionMinusTick     TickDirection = "MinusTick"
	TickDirectionZeroMinusTick TickDirection = "ZeroMinusTick"
)

type TimeInForce

type TimeInForce string
const (
	TimeInForceGtc TimeInForce = "GTC"
	TimeInForceIoc TimeInForce = "IOC"
	TimeInForceFok TimeInForce = "FOK"
)

type TransferStatus

type TransferStatus string
const (
	TransferStatusSuccess TransferStatus = "SUCCESS"
	TransferStatusPending TransferStatus = "PENDING"
	TransferStatusFailed  TransferStatus = "FAILED"
)

type TriggerBy

type TriggerBy string
const (
	TriggerByLastPrice  TriggerBy = "LastPrice"
	TriggerByIndexPrice TriggerBy = "IndexPrice"
	TriggerByMarkPrice  TriggerBy = "MarkPrice"
)

type TypeContractTranslog

type TypeContractTranslog string
const (
	TypeContractTranslogTransferIn     TypeContractTranslog = "TRANSFER_IN"
	TypeContractTranslogTransferOut    TypeContractTranslog = "TRANSFER_OUT"
	TypeContractTranslogTrade          TypeContractTranslog = "TRADE"
	TypeContractTranslogSettlement     TypeContractTranslog = "SETTLEMENT"
	TypeContractTranslogDelivery       TypeContractTranslog = "DELIVERY"
	TypeContractTranslogLiquidation    TypeContractTranslog = "LIQUIDATION"
	TypeContractTranslogAdl            TypeContractTranslog = "ADL"
	TypeContractTranslogAirdrop        TypeContractTranslog = "AIRDROP"
	TypeContractTranslogBonus          TypeContractTranslog = "BONUS"
	TypeContractTranslogBonusRecollect TypeContractTranslog = "BONUS_RECOLLECT"
	TypeContractTranslogFeeRefund      TypeContractTranslog = "FEE_REFUND"
	TypeContractTranslogCurrencyBuy    TypeContractTranslog = "CURRENCY_BUY"
	TypeContractTranslogCurrencySell   TypeContractTranslog = "CURRENCY_SELL"
	TypeContractTranslogAutoDeduction  TypeContractTranslog = "AUTO_DEDUCTION"
	TypeContractTranslogOthers         TypeContractTranslog = "Others"
)

type TypeUtaTranslog

type TypeUtaTranslog string
const (
	TypeUtaTranslogTransferIn                            TypeUtaTranslog = "TRANSFER_IN"
	TypeUtaTranslogTransferOut                           TypeUtaTranslog = "TRANSFER_OUT"
	TypeUtaTranslogTrade                                 TypeUtaTranslog = "TRADE"
	TypeUtaTranslogSettlement                            TypeUtaTranslog = "SETTLEMENT"
	TypeUtaTranslogDelivery                              TypeUtaTranslog = "DELIVERY"
	TypeUtaTranslogLiquidation                           TypeUtaTranslog = "LIQUIDATION"
	TypeUtaTranslogAdl                                   TypeUtaTranslog = "ADL"
	TypeUtaTranslogAirdrop                               TypeUtaTranslog = "AIRDROP"
	TypeUtaTranslogBonus                                 TypeUtaTranslog = "BONUS"
	TypeUtaTranslogBonusRecollect                        TypeUtaTranslog = "BONUS_RECOLLECT"
	TypeUtaTranslogFeeRefund                             TypeUtaTranslog = "FEE_REFUND"
	TypeUtaTranslogInterest                              TypeUtaTranslog = "INTEREST"
	TypeUtaTranslogCurrencyBuy                           TypeUtaTranslog = "CURRENCY_BUY"
	TypeUtaTranslogCurrencySell                          TypeUtaTranslog = "CURRENCY_SELL"
	TypeUtaTranslogBorrowedAmountInsLoan                 TypeUtaTranslog = "BORROWED_AMOUNT_INS_LOAN"
	TypeUtaTranslogPrincipleRepaymentInsLoan             TypeUtaTranslog = "PRINCIPLE_REPAYMENT_INS_LOAN"
	TypeUtaTranslogInterestRepaymentInsLoan              TypeUtaTranslog = "INTEREST_REPAYMENT_INS_LOAN"
	TypeUtaTranslogAutoSoldCollateralInsLoan             TypeUtaTranslog = "AUTO_SOLD_COLLATERAL_INS_LOAN"
	TypeUtaTranslogAutoBuyLiabilityInsLoan               TypeUtaTranslog = "AUTO_BUY_LIABILITY_INS_LOAN"
	TypeUtaTranslogAutoPrincipleRepaymentInsLoan         TypeUtaTranslog = "AUTO_PRINCIPLE_REPAYMENT_INS_LOAN"
	TypeUtaTranslogAutoInterestRepaymentInsLoan          TypeUtaTranslog = "AUTO_INTEREST_REPAYMENT_INS_LOAN"
	TypeUtaTranslogTransferInInsLoan                     TypeUtaTranslog = "TRANSFER_IN_INS_LOAN"
	TypeUtaTranslogTransferOutInsLoan                    TypeUtaTranslog = "TRANSFER_OUT_INS_LOAN"
	TypeUtaTranslogSpotRepaymentSell                     TypeUtaTranslog = "SPOT_REPAYMENT_SELL"
	TypeUtaTranslogSpotRepaymentBuy                      TypeUtaTranslog = "SPOT_REPAYMENT_BUY"
	TypeUtaTranslogTokensSubscription                    TypeUtaTranslog = "TOKENS_SUBSCRIPTION"
	TypeUtaTranslogTokensRedemption                      TypeUtaTranslog = "TOKENS_REDEMPTION"
	TypeUtaTranslogAutoDeduction                         TypeUtaTranslog = "AUTO_DEDUCTION"
	TypeUtaTranslogFlexibleStakingSubscription           TypeUtaTranslog = "FLEXIBLE_STAKING_SUBSCRIPTION"
	TypeUtaTranslogFlexibleStakingRedemption             TypeUtaTranslog = "FLEXIBLE_STAKING_REDEMPTION"
	TypeUtaTranslogFixedStakingSubscription              TypeUtaTranslog = "FIXED_STAKING_SUBSCRIPTION"
	TypeUtaTranslogFlexibleStakingRefund                 TypeUtaTranslog = "FLEXIBLE_STAKING_REFUND"
	TypeUtaTranslogFixedStakingRefund                    TypeUtaTranslog = "FIXED_STAKING_REFUND"
	TypeUtaTranslogPremarketTransferOut                  TypeUtaTranslog = "PREMARKET_TRANSFER_OUT"
	TypeUtaTranslogPremarketDeliverySellNewCoin          TypeUtaTranslog = "PREMARKET_DELIVERY_SELL_NEW_COIN"
	TypeUtaTranslogPremarketDeliveryBuyNewCoin           TypeUtaTranslog = "PREMARKET_DELIVERY_BUY_NEW_COIN"
	TypeUtaTranslogPremarketDeliveryPledgePaySeller      TypeUtaTranslog = "PREMARKET_DELIVERY_PLEDGE_PAY_SELLER"
	TypeUtaTranslogPremarketDeliveryPledgeBack           TypeUtaTranslog = "PREMARKET_DELIVERY_PLEDGE_BACK"
	TypeUtaTranslogPremarketRollbackPledgeBack           TypeUtaTranslog = "PREMARKET_ROLLBACK_PLEDGE_BACK"
	TypeUtaTranslogPremarketRollbackPledgePenaltyToBuyer TypeUtaTranslog = "PREMARKET_ROLLBACK_PLEDGE_PENALTY_TO_BUYER"
	TypeUtaTranslogCustodyNetworkFee                     TypeUtaTranslog = "CUSTODY_NETWORK_FEE"
	TypeUtaTranslogCustodySettleFee                      TypeUtaTranslog = "CUSTODY_SETTLE_FEE"
	TypeUtaTranslogCustodyLock                           TypeUtaTranslog = "CUSTODY_LOCK"
	TypeUtaTranslogCustodyUnlock                         TypeUtaTranslog = "CUSTODY_UNLOCK"
	TypeUtaTranslogCustodyUnlockRefund                   TypeUtaTranslog = "CUSTODY_UNLOCK_REFUND"
	TypeUtaTranslogLoansBorrowFunds                      TypeUtaTranslog = "LOANS_BORROW_FUNDS"
	TypeUtaTranslogLoansPledgeAsset                      TypeUtaTranslog = "LOANS_PLEDGE_ASSET"
	TypeUtaTranslogBonusTransferIn                       TypeUtaTranslog = "BONUS_TRANSFER_IN"
	TypeUtaTranslogBonusTransferOut                      TypeUtaTranslog = "BONUS_TRANSFER_OUT"
	TypeUtaTranslogPefTransferIn                         TypeUtaTranslog = "PEF_TRANSFER_IN"
	TypeUtaTranslogPefTransferOut                        TypeUtaTranslog = "PEF_TRANSFER_OUT"
	TypeUtaTranslogPefProfitShare                        TypeUtaTranslog = "PEF_PROFIT_SHARE"
	TypeUtaTranslogOnchainearnSubscription               TypeUtaTranslog = "ONCHAINEARN_SUBSCRIPTION"
	TypeUtaTranslogOnchainearnRedemption                 TypeUtaTranslog = "ONCHAINEARN_REDEMPTION"
	TypeUtaTranslogOnchainearnRefund                     TypeUtaTranslog = "ONCHAINEARN_REFUND"
	TypeUtaTranslogStructureProductSubscription          TypeUtaTranslog = "STRUCTURE_PRODUCT_SUBSCRIPTION"
	TypeUtaTranslogStructureProductRefund                TypeUtaTranslog = "STRUCTURE_PRODUCT_REFUND"
	TypeUtaTranslogClassicWealthManagementSubscription   TypeUtaTranslog = "CLASSIC_WEALTH_MANAGEMENT_SUBSCRIPTION"
	TypeUtaTranslogPremimumWealthManagementSubscription  TypeUtaTranslog = "PREMIMUM_WEALTH_MANAGEMENT_SUBSCRIPTION"
	TypeUtaTranslogPremimumWealthManagementRefund        TypeUtaTranslog = "PREMIMUM_WEALTH_MANAGEMENT_REFUND"
	TypeUtaTranslogLiquidityMiningSubscription           TypeUtaTranslog = "LIQUIDITY_MINING_SUBSCRIPTION"
	TypeUtaTranslogLiquidityMiningRefund                 TypeUtaTranslog = "LIQUIDITY_MINING_REFUND"
	TypeUtaTranslogPwmSubscription                       TypeUtaTranslog = "PWM_SUBSCRIPTION"
	TypeUtaTranslogPwmRefund                             TypeUtaTranslog = "PWM_REFUND"
	TypeUtaTranslogDefiInvestmentSubscription            TypeUtaTranslog = "DEFI_INVESTMENT_SUBSCRIPTION"
	TypeUtaTranslogDefiInvestmentRefund                  TypeUtaTranslog = "DEFI_INVESTMENT_REFUND"
	TypeUtaTranslogDefiInvestmentRedemption              TypeUtaTranslog = "DEFI_INVESTMENT_REDEMPTION"
	TypeUtaTranslogInstitutionLoanIn                     TypeUtaTranslog = "INSTITUTION_LOAN_IN"
	TypeUtaTranslogInstitutionPaybackPrincipalOut        TypeUtaTranslog = "INSTITUTION_PAYBACK_PRINCIPAL_OUT"
	TypeUtaTranslogInstitutionPaybackInterestOut         TypeUtaTranslog = "INSTITUTION_PAYBACK_INTEREST_OUT"
	TypeUtaTranslogInstitutionExchangeSell               TypeUtaTranslog = "INSTITUTION_EXCHANGE_SELL"
	TypeUtaTranslogInstitutionExchangeBuy                TypeUtaTranslog = "INSTITUTION_EXCHANGE_BUY"
	TypeUtaTranslogInstitutionLiqPrincipalOut            TypeUtaTranslog = "INSTITUTION_LIQ_PRINCIPAL_OUT"
	TypeUtaTranslogInstitutionLiqInterestOut             TypeUtaTranslog = "INSTITUTION_LIQ_INTEREST_OUT"
	TypeUtaTranslogInstitutionLoanTransferIn             TypeUtaTranslog = "INSTITUTION_LOAN_TRANSFER_IN"
	TypeUtaTranslogInstitutionLoanTransferOut            TypeUtaTranslog = "INSTITUTION_LOAN_TRANSFER_OUT"
	TypeUtaTranslogInstitutionLoanWithoutWithdraw        TypeUtaTranslog = "INSTITUTION_LOAN_WITHOUT_WITHDRAW"
	TypeUtaTranslogInstitutionLoanReserveIn              TypeUtaTranslog = "INSTITUTION_LOAN_RESERVE_IN"
	TypeUtaTranslogInstitutionLoanReserveOut             TypeUtaTranslog = "INSTITUTION_LOAN_RESERVE_OUT"
	TypeUtaTranslogSpreadFeeOut                          TypeUtaTranslog = "SPREAD_FEE_OUT"
	TypeUtaTranslogPlatformTokenMntLiqrecalledmmnt       TypeUtaTranslog = "PLATFORM_TOKEN_MNT_LIQRECALLEDMMNT"
	TypeUtaTranslogPlatformTokenMntLiqreturnedmnt        TypeUtaTranslog = "PLATFORM_TOKEN_MNT_LIQRETURNEDMNT"
	TypeUtaTranslogBorrow                                TypeUtaTranslog = "BORROW"
	TypeUtaTranslogRepay                                 TypeUtaTranslog = "REPAY"
	TypeUtaTranslogConvert                               TypeUtaTranslog = "CONVERT"
	TypeUtaTranslogBrokerAbaccountFee                    TypeUtaTranslog = "BROKER_ABACCOUNT_FEE"
	TypeUtaTranslogEarningRedemptionSell                 TypeUtaTranslog = "EARNING_REDEMPTION_SELL"
	TypeUtaTranslogEarningRedemptionBuy                  TypeUtaTranslog = "EARNING_REDEMPTION_BUY"
	TypeUtaTranslogDbsCashOut                            TypeUtaTranslog = "DBS_CASH_OUT"
	TypeUtaTranslogDbsCashIn                             TypeUtaTranslog = "DBS_CASH_IN"
	TypeUtaTranslogDbsCashOutTr                          TypeUtaTranslog = "DBS_CASH_OUT_TR"
	TypeUtaTranslogDbsCashInTr                           TypeUtaTranslog = "DBS_CASH_IN_TR"
	TypeUtaTranslogCustodyCashRecoverTr                  TypeUtaTranslog = "CUSTODY_CASH_RECOVER_TR"
	TypeUtaTranslogAlphaSmallTokenRefund                 TypeUtaTranslog = "ALPHA_SMALL_TOKEN_REFUND"
	TypeUtaTranslogTwapBudgetAirdrop                     TypeUtaTranslog = "TWAP_BUDGET_AIRDROP"
	TypeUtaTranslogTwapBudgetRecall                      TypeUtaTranslog = "TWAP_BUDGET_RECALL"
	TypeUtaTranslogFloatingToFixedBorrow                 TypeUtaTranslog = "FLOATING_TO_FIXED_BORROW"
	TypeUtaTranslogFloatingToFixedRepay                  TypeUtaTranslog = "FLOATING_TO_FIXED_REPAY"
	TypeUtaTranslogIdnConvertIn                          TypeUtaTranslog = "IDN_CONVERT_IN"
	TypeUtaTranslogIdnConvertOut                         TypeUtaTranslog = "IDN_CONVERT_OUT"
)

type UnifiedMarginStatus

type UnifiedMarginStatus string
const (
	UnifiedMarginStatus1 UnifiedMarginStatus = "1"
	UnifiedMarginStatus3 UnifiedMarginStatus = "3"
	UnifiedMarginStatus4 UnifiedMarginStatus = "4"
	UnifiedMarginStatus5 UnifiedMarginStatus = "5"
	UnifiedMarginStatus6 UnifiedMarginStatus = "6"
)

type UserCreateSubApiParams

type UserCreateSubApiParams struct {
	// Sub user Id
	Subuid int64 `json:"subuid,omitempty" url:"subuid,omitempty"`
	// Set a remark
	Note string `json:"note,omitempty" url:"note,omitempty"`
	// `0`: Read and Write. `1`: Read only
	ReadOnly int64 `json:"readOnly,omitempty" url:"readOnly,omitempty"`
	// Set the IP bind. example: `"192.168.0.1,192.168.0.2"`**note:**
	//
	// 	- don't pass ips or pass with `"*"` means no bind
	// 	- No ip bound api key will be **invalid after 90 days**
	// 	- api key without IP bound will be invalid after **7 days** once the account password is changed
	Ips []string `json:"ips,omitempty" url:"ips,omitempty"`
	// Tick the types of permission.
	//
	// 	- one of below types must be passed, otherwise the error is thrown
	Permissions UserCreateSubApiParamsPermissions `json:"permissions" url:"permissions"`
}

type UserCreateSubApiParamsPermissions

type UserCreateSubApiParamsPermissions struct {
	// Contract Trade. `["Order","Position"]`
	ContractTrade []string `json:"ContractTrade,omitempty" url:"ContractTrade,omitempty"`
	// Spot Trade. `["SpotTrade"]`
	Spot []string `json:"Spot,omitempty" url:"Spot,omitempty"`
	// USDC Contract. `["OptionsTrade"]`
	Options []string `json:"Options,omitempty" url:"Options,omitempty"`
	// Wallet. `["AccountTransfer","SubMemberTransferList"]`
	// _Note: Fund Custodial account is not supported_
	Wallet []string `json:"Wallet,omitempty" url:"Wallet,omitempty"`
	// Convert. `["ExchangeHistory"]`
	Exchange []string `json:"Exchange,omitempty" url:"Exchange,omitempty"`
	// Earn product. `["Earn"]`
	Earn []string `json:"Earn,omitempty" url:"Earn,omitempty"`
}

type UserCreateSubApiResult

type UserCreateSubApiResult struct {
	// Unique id. Internal used
	Id string `json:"id,omitempty" url:"id,omitempty"`
	// The remark
	Note string `json:"note,omitempty" url:"note,omitempty"`
	// Api key
	ApiKey string `json:"apiKey,omitempty" url:"apiKey,omitempty"`
	// `0`: Read and Write. `1`: Read only
	ReadOnly int64 `json:"readOnly,omitempty" url:"readOnly,omitempty"`
	// The secret paired with api key.
	//
	// 	- The secret can't be queried by GET api. Please keep it properly
	Secret string `json:"secret,omitempty" url:"secret,omitempty"`
	// The types of permission
	Permissions UserCreateSubApiResultPermissions `json:"permissions" url:"permissions"`
}

type UserCreateSubApiResultPermissions

type UserCreateSubApiResultPermissions struct {
	// Permisson of contract trade
	ContractTrade []string `json:"ContractTrade,omitempty" url:"ContractTrade,omitempty"`
	// Permisson of spot
	Spot []string `json:"Spot,omitempty" url:"Spot,omitempty"`
	// Permisson of wallet
	Wallet []string `json:"Wallet,omitempty" url:"Wallet,omitempty"`
	// Permission of USDC Contract. It supports trade option and usdc perpetual.
	Options []string `json:"Options,omitempty" url:"Options,omitempty"`
	// Permission of Unified account
	Derivatives []string `json:"Derivatives,omitempty" url:"Derivatives,omitempty"`
	// Permission of convert
	Exchange []string `json:"Exchange,omitempty" url:"Exchange,omitempty"`
	// Permission of earn product
	Earn []string `json:"Earn,omitempty" url:"Earn,omitempty"`
	// Not applicable to sub account, always `[]`
	BlockTrade []string `json:"BlockTrade,omitempty" url:"BlockTrade,omitempty"`
	// Not applicable to sub account, always `[]`
	Affiliate []string `json:"Affiliate,omitempty" url:"Affiliate,omitempty"`
	// Not applicable to sub account, always `[]`
	FiatP2P []string `json:"FiatP2P,omitempty" url:"FiatP2P,omitempty"`
	// Not applicable to sub account, always `[]`
	FiatBybitPay []string `json:"FiatBybitPay,omitempty" url:"FiatBybitPay,omitempty"`
	// Not applicable to sub account, always `[]`
	FiatConvertBroker []string `json:"FiatConvertBroker,omitempty" url:"FiatConvertBroker,omitempty"`
	// **Deprecated**, always `[]`
	Nft []string `json:"NFT,omitempty" url:"NFT,omitempty"`
	// **Deprecated** always `[]`
	CopyTrading []string `json:"CopyTrading,omitempty" url:"CopyTrading,omitempty"`
}

type UserCreateSubMemberParams

type UserCreateSubMemberParams struct {
	// Username of the new sub user.
	//
	// 	- 6-16 characters, must include both numbers and letters.
	// 	- Cannot be the same as the existing or deleted usernames.
	Username string `json:"username,omitempty" url:"username,omitempty"`
	// Password for the new sub user.
	//
	// 	- 8-30 characters, must include numbers, upper and lowercase letters.
	Password string `json:"password,omitempty" url:"password,omitempty"`
	// `1`: normal subaccount, `6`: [custodial subaccount](https://www.bybit.com/en/help-center/article?id=000001683)
	MemberType int64 `json:"memberType,omitempty" url:"memberType,omitempty"`
	// - `0`: turn off quick login (default)
	// 	- `1`: turn on quick login.
	Switch int64 `json:"switch,omitempty" url:"switch,omitempty"`
	// **Deprecated** param, always UTA account
	IsUta bool `json:"isUta,omitempty" url:"isUta,omitempty"`
	// Set a remark
	Note string `json:"note,omitempty" url:"note,omitempty"`
}

type UserCreateSubMemberResult

type UserCreateSubMemberResult struct {
	// Sub user Id
	Uid string `json:"uid,omitempty" url:"uid,omitempty"`
	// Username of the new sub user.
	//
	// 	- 6-16 characters, must include both numbers and letters.
	// 	- Cannot be the same as the existing or deleted usernames.
	Username string `json:"username,omitempty" url:"username,omitempty"`
	// `1`: normal subaccount, `6`: [custodial subaccount](https://www.bybit.com/en/help-center/article?id=000001683)
	MemberType int64 `json:"memberType,omitempty" url:"memberType,omitempty"`
	// The status of the user account
	//
	// 	- `1`: normal
	// 	- `2`: login banned
	// 	- `4`: frozen
	Status Status `json:"status,omitempty" url:"status,omitempty"`
	// The remark
	Remark string `json:"remark,omitempty" url:"remark,omitempty"`
}

type UserDelSubmemberParams

type UserDelSubmemberParams struct {
	// Sub UID
	SubMemberId string `json:"subMemberId,omitempty" url:"subMemberId,omitempty"`
}

type UserDeleteSubApiParams

type UserDeleteSubApiParams struct {
	// Sub account api key
	//
	// 	- You must pass this param when you use master account manage sub account api key settings
	// 	- If you use corresponding sub uid api key call this endpoint, `apikey` param cannot be passed, otherwise throwing an error
	Apikey string `json:"apikey,omitempty" url:"apikey,omitempty"`
}

type UserEscrowSubMembers

type UserEscrowSubMembers struct {
	// Object
	SubMembers []UserEscrowSubMembersSubMembersItem `json:"subMembers,omitempty" url:"subMembers,omitempty"`
	// 下一頁數據的游標. 返回"0"表示沒有更多的數據了
	NextCursor string `json:"nextCursor,omitempty" url:"nextCursor,omitempty"`
}

type UserEscrowSubMembersQuery

type UserEscrowSubMembersQuery struct {
	// Data size per page. Return up to 100 records per request
	PageSize string `json:"pageSize,omitempty" url:"pageSize,omitempty"`
	// Cursor. Use the `nextCursor` token from the response to retrieve the next page of the result set
	NextCursor string `json:"nextCursor,omitempty" url:"nextCursor,omitempty"`
}

type UserEscrowSubMembersSubMembersItem

type UserEscrowSubMembersSubMembersItem struct {
	// 子帳戶userId
	Uid string `json:"uid,omitempty" url:"uid,omitempty"`
	// 用戶名
	Username string `json:"username,omitempty" url:"username,omitempty"`
	// `12`: 基金託管子帳戶
	MemberType int64 `json:"memberType,omitempty" url:"memberType,omitempty"`
	// 帳戶狀態.
	//
	// 	- `1`: 正常
	// 	- `2`: 登陸封禁
	// 	- `4`: 凍結
	Status int64 `json:"status,omitempty" url:"status,omitempty"`
	// 帳戶模式.
	//
	// 	- `1`: 經典帳戶
	// 	- `3`: UTA帳戶
	AccountMode int64 `json:"accountMode,omitempty" url:"accountMode,omitempty"`
	// 備註
	Remark string `json:"remark,omitempty" url:"remark,omitempty"`
}

type UserFrozenSubMemberParams

type UserFrozenSubMemberParams struct {
	// Sub user Id
	Subuid int64 `json:"subuid,omitempty" url:"subuid,omitempty"`
	// `0`: unfreeze, `1`: freeze
	Frozen int64 `json:"frozen,omitempty" url:"frozen,omitempty"`
}

type UserGetMemberType

type UserGetMemberType struct {
	// Object
	Accounts []UserGetMemberTypeAccountsItem `json:"accounts,omitempty" url:"accounts,omitempty"`
}

type UserGetMemberTypeAccountsItem

type UserGetMemberTypeAccountsItem struct {
	// Master/Sub user Id
	Uid string `json:"uid,omitempty" url:"uid,omitempty"`
	// Wallets array. `FUND`,`UNIFIED`
	AccountType AccountType `json:"accountType,omitempty" url:"accountType,omitempty"`
}

type UserGetMemberTypeQuery

type UserGetMemberTypeQuery struct {
	// - Query itself wallet types when not passed
	// 	- When use master api key to query sub UID, master UID data is always returned in the top of the array
	// 	- Multiple sub UID are supported, separated by commas
	// 	- This param is ignored when you use sub account api key
	MemberIds string `json:"memberIds,omitempty" url:"memberIds,omitempty"`
}

type UserQueryApi

type UserQueryApi struct {
	// Unique ID. Internal use
	Id string `json:"id,omitempty" url:"id,omitempty"`
	// The remark
	Note string `json:"note,omitempty" url:"note,omitempty"`
	// Api key
	ApiKey string `json:"apiKey,omitempty" url:"apiKey,omitempty"`
	// `0`: Read and Write. `1`: Read only
	ReadOnly int64 `json:"readOnly,omitempty" url:"readOnly,omitempty"`
	// Always `""`
	Secret string `json:"secret,omitempty" url:"secret,omitempty"`
	// The types of permission
	Permissions UserQueryApiPermissions `json:"permissions" url:"permissions"`
	// IP bound
	Ips []string `json:"ips,omitempty" url:"ips,omitempty"`
	// The type of api key. `1`: personal, `2`: connected to the third-party app
	Type int64 `json:"type,omitempty" url:"type,omitempty"`
	// The remaining valid days of api key. Only for those api key with no IP bound or the password has been changed
	DeadlineDay int64 `json:"deadlineDay,omitempty" url:"deadlineDay,omitempty"`
	// The expiry day of the api key. Only for those api key with no IP bound or the password has been changed
	ExpiredAt time.Time `json:"expiredAt" url:"expiredAt"`
	// The create day of the api key
	CreatedAt time.Time `json:"createdAt" url:"createdAt"`
	// **Deprecated** field
	Unified int64 `json:"unified,omitempty" url:"unified,omitempty"`
	// Whether the account to which the account upgrade to unified trade account. `0`: regular account; `1`: unified trade account
	Uta int64 `json:"uta,omitempty" url:"uta,omitempty"`
	// User ID
	UserId int64 `json:"userID,omitempty" url:"userID,omitempty"`
	// Inviter ID (the UID of the account which invited this account to the platform)
	InviterId int64 `json:"inviterID,omitempty" url:"inviterID,omitempty"`
	// VIP Level
	VipLevel VipLevel `json:"vipLevel,omitempty" url:"vipLevel,omitempty"`
	// Market maker level
	MktMakerLevel string `json:"mktMakerLevel,omitempty" url:"mktMakerLevel,omitempty"`
	// Affiliate Id. `0` represents that there is no binding relationship.
	AffiliateId int64 `json:"affiliateID,omitempty" url:"affiliateID,omitempty"`
	// Rsa public key
	RsaPublicKey string `json:"rsaPublicKey,omitempty" url:"rsaPublicKey,omitempty"`
	// If this api key belongs to master account or not
	IsMaster bool `json:"isMaster,omitempty" url:"isMaster,omitempty"`
	// The main account uid. Returns `"0"` when the endpoint is called by main account
	ParentUid string `json:"parentUid,omitempty" url:"parentUid,omitempty"`
	// Personal account kyc level. `LEVEL_DEFAULT`, `LEVEL_1`, `LEVEL_2`
	KycLevel string `json:"kycLevel,omitempty" url:"kycLevel,omitempty"`
	// Personal account kyc region
	KycRegion string `json:"kycRegion,omitempty" url:"kycRegion,omitempty"`
}

type UserQueryApiPermissions

type UserQueryApiPermissions struct {
	// Permission of contract trade `Order`, `Position`
	ContractTrade []string `json:"ContractTrade,omitempty" url:"ContractTrade,omitempty"`
	// Permission of spot `SpotTrade`
	Spot []string `json:"Spot,omitempty" url:"Spot,omitempty"`
	// Permission of wallet `AccountTransfer`, `SubMemberTransfer`(master account), `SubMemberTransferList`(sub account), `Withdraw`(master account)
	Wallet []string `json:"Wallet,omitempty" url:"Wallet,omitempty"`
	// Permission of USDC Contract. It supports trade option and USDC perpetual. `OptionsTrade`
	Options []string `json:"Options,omitempty" url:"Options,omitempty"`
	// `DerivativesTrade`
	Derivatives []string `json:"Derivatives,omitempty" url:"Derivatives,omitempty"`
	// Permission of convert `ExchangeHistory`
	Exchange []string `json:"Exchange,omitempty" url:"Exchange,omitempty"`
	// Permission of earn product `Earn`
	Earn []string `json:"Earn,omitempty" url:"Earn,omitempty"`
	// Permission of P2P `FiatP2POrder`, `Advertising`. Not applicable to subaccount, always `[]`
	FiatP2P []string `json:"FiatP2P,omitempty" url:"FiatP2P,omitempty"`
	// Permission of Bybit Pay `FaitPayOrder`. Not applicable to subaccount, always `[]`
	FiatBybitPay []string `json:"FiatBybitPay,omitempty" url:"FiatBybitPay,omitempty"`
	// Permission of fiat convert `FiatConvertBrokerOrder`. Not applicable to subaccount, always `[]`
	FiatConvertBroker []string `json:"FiatConvertBroker,omitempty" url:"FiatConvertBroker,omitempty"`
	// Permission of blocktrade. Not applicable to subaccount, always `[]`
	BlockTrade []string `json:"BlockTrade,omitempty" url:"BlockTrade,omitempty"`
	// Permission of Affiliate. Only affiliate can have this permission, otherwise always `[]`
	Affiliate []string `json:"Affiliate,omitempty" url:"Affiliate,omitempty"`
	// **Deprecated**, always `[]`
	Nft []string `json:"NFT,omitempty" url:"NFT,omitempty"`
	// **Deprecated**, always `[]`
	CopyTrading []string `json:"CopyTrading,omitempty" url:"CopyTrading,omitempty"`
}

type UserQuerySubMembers

type UserQuerySubMembers struct {
	// Object
	SubMembers []UserQuerySubMembersSubMembersItem `json:"subMembers,omitempty" url:"subMembers,omitempty"`
}

type UserQuerySubMembersSubMembersItem

type UserQuerySubMembersSubMembersItem struct {
	// Sub user Id
	Uid string `json:"uid,omitempty" url:"uid,omitempty"`
	// Username
	Username string `json:"username,omitempty" url:"username,omitempty"`
	// `1`: normal subaccount, `6`: custodial sub account
	MemberType int64 `json:"memberType,omitempty" url:"memberType,omitempty"`
	// The status of the user account
	//
	// 	- `1`: normal
	// 	- `2`: login banned
	// 	- `4`: frozen
	Status int64 `json:"status,omitempty" url:"status,omitempty"`
	// The account mode of the user account
	//
	// 	- `1`: Classic Account
	// 	- `3`: UTA1.0
	// 	- `4`: UTA1.0 Pro
	// 	- `5`: UTA2.0
	// 	- `6`: UTA2.0 Pro
	AccountMode int64 `json:"accountMode,omitempty" url:"accountMode,omitempty"`
	// The remark
	Remark string `json:"remark,omitempty" url:"remark,omitempty"`
}

type UserSubApikeys

type UserSubApikeys struct {
	// Unique ID. Internal use
	Id string `json:"id,omitempty" url:"id,omitempty"`
	// IP bound
	Ips []string `json:"ips,omitempty" url:"ips,omitempty"`
	// Api key
	ApiKey string `json:"apiKey,omitempty" url:"apiKey,omitempty"`
	// The remark
	Note string `json:"note,omitempty" url:"note,omitempty"`
	// `1`: permanent, `2`: expired, `3`: within the validity period, `4`: expires soon (less than 7 days)
	Status int64 `json:"status,omitempty" url:"status,omitempty"`
	// The expiry day of the api key. Only for those api key with no IP bound or the password has been changed
	ExpiredAt time.Time `json:"expiredAt" url:"expiredAt"`
	// The create day of the api key
	CreatedAt time.Time `json:"createdAt" url:"createdAt"`
	// The type of api key. `1`: personal, `2`: connected to the third-party app
	Type int64 `json:"type,omitempty" url:"type,omitempty"`
	// The types of permission
	Permissions UserSubApikeysPermissions `json:"permissions" url:"permissions"`
	// Always `"******"`
	Secret string `json:"secret,omitempty" url:"secret,omitempty"`
	// `true`, `false`
	ReadOnly bool `json:"readOnly,omitempty" url:"readOnly,omitempty"`
	// The remaining valid days of api key. Only for those api key with no IP bound or the password has been changed
	DeadlineDay int64 `json:"deadlineDay,omitempty" url:"deadlineDay,omitempty"`
	// Api key type
	Flag string `json:"flag,omitempty" url:"flag,omitempty"`
	// Refer to the `cursor` request parameter
	NextPageCursor string `json:"nextPageCursor,omitempty" url:"nextPageCursor,omitempty"`
}

type UserSubApikeysPermissions

type UserSubApikeysPermissions struct {
	// Permission of contract trade `Order`, `Position`
	ContractTrade []string `json:"ContractTrade,omitempty" url:"ContractTrade,omitempty"`
	// Permission of spot `SpotTrade`
	Spot []string `json:"Spot,omitempty" url:"Spot,omitempty"`
	// Permission of wallet `AccountTransfer`, `SubMemberTransferList`
	Wallet []string `json:"Wallet,omitempty" url:"Wallet,omitempty"`
	// Permission of USDC Contract. It supports trade option and USDC perpetual. `OptionsTrade`
	Options []string `json:"Options,omitempty" url:"Options,omitempty"`
	// `DerivativesTrade`
	Derivatives []string `json:"Derivatives,omitempty" url:"Derivatives,omitempty"`
	// Permission of convert `ExchangeHistory`
	Exchange []string `json:"Exchange,omitempty" url:"Exchange,omitempty"`
	// Permission of earn product `Earn`
	Earn []string `json:"Earn,omitempty" url:"Earn,omitempty"`
	// Not applicable to sub account, always `[]`
	Affiliate []string `json:"Affiliate,omitempty" url:"Affiliate,omitempty"`
	// Not applicable to subaccount, always `[]`
	BlockTrade []string `json:"BlockTrade,omitempty" url:"BlockTrade,omitempty"`
	// **Deprecated**, always `[]`
	Nft []string `json:"NFT,omitempty" url:"NFT,omitempty"`
	// **Deprecated**, always `[]`
	CopyTrading []string `json:"CopyTrading,omitempty" url:"CopyTrading,omitempty"`
}

type UserSubApikeysQuery

type UserSubApikeysQuery struct {
	// Sub UID
	SubMemberId string `json:"subMemberId,omitempty" url:"subMemberId,omitempty"`
	// Limit for data size per page. \[`1`, `20`\]. Default: `20`
	Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
	// Cursor. Use the `nextPageCursor` token from the response to retrieve the next page of the result set
	Cursor string `json:"cursor,omitempty" url:"cursor,omitempty"`
}

type UserSubmembers

type UserSubmembers struct {
	// Object
	SubMembers []UserSubmembersSubMembersItem `json:"subMembers,omitempty" url:"subMembers,omitempty"`
	// The next page cursor value. "0" means no more pages
	NextCursor string `json:"nextCursor,omitempty" url:"nextCursor,omitempty"`
}

type UserSubmembersQuery

type UserSubmembersQuery struct {
	// Data size per page. Return up to 100 records per request
	PageSize string `json:"pageSize,omitempty" url:"pageSize,omitempty"`
	// Cursor. Use the `nextCursor` token from the response to retrieve the next page of the result set
	NextCursor string `json:"nextCursor,omitempty" url:"nextCursor,omitempty"`
}

type UserSubmembersSubMembersItem

type UserSubmembersSubMembersItem struct {
	// Sub user Id
	Uid string `json:"uid,omitempty" url:"uid,omitempty"`
	// Username
	Username string `json:"username,omitempty" url:"username,omitempty"`
	// `1`: standard subaccount, `6`: [custodial subaccount](https://www.bybit.com/en/help-center/article?id=000001683)
	MemberType int64 `json:"memberType,omitempty" url:"memberType,omitempty"`
	// The status of the user account
	//
	// 	- `1`: normal
	// 	- `2`: login banned
	// 	- `4`: frozen
	Status int64 `json:"status,omitempty" url:"status,omitempty"`
	// The account mode of the user account
	//
	// 	- `1`: Classic Account
	// 	- `3`: UTA1.0
	// 	- `4`: UTA1.0 Pro
	// 	- `5`: UTA2.0
	// 	- `6`: UTA2.0 Pro
	AccountMode int64 `json:"accountMode,omitempty" url:"accountMode,omitempty"`
	// The remark
	Remark string `json:"remark,omitempty" url:"remark,omitempty"`
}

type UserUpdateApiParams

type UserUpdateApiParams struct {
	// `0` (default): Read and Write. `1`: Read only
	ReadOnly int64 `json:"readOnly,omitempty" url:"readOnly,omitempty"`
	// Tick the types of permission. Don't send this param if you don't want to change the permission
	Permissions UserUpdateApiParamsPermissions `json:"permissions" url:"permissions"`
}

type UserUpdateApiParamsPermissions

type UserUpdateApiParamsPermissions struct {
	// Contract Trade. `["Order","Position"]`
	ContractTrade []string `json:"ContractTrade,omitempty" url:"ContractTrade,omitempty"`
	// Spot Trade. `["SpotTrade"]`
	Spot []string `json:"Spot,omitempty" url:"Spot,omitempty"`
	// Wallet. `["AccountTransfer","SubMemberTransfer"]`
	Wallet []string `json:"Wallet,omitempty" url:"Wallet,omitempty"`
	// USDC Contract. `["OptionsTrade"]`
	Options []string `json:"Options,omitempty" url:"Options,omitempty"`
	// Convert. `["ExchangeHistory"]`
	Exchange []string `json:"Exchange,omitempty" url:"Exchange,omitempty"`
	// Earn product. `["Earn"]`
	Earn []string `json:"Earn,omitempty" url:"Earn,omitempty"`
	// P2P `FiatP2POrder`, `Advertising`
	FiatP2P []string `json:"FiatP2P,omitempty" url:"FiatP2P,omitempty"`
	// Bybit Pay `FaitPayOrder`
	FiatBybitPay []string `json:"FiatBybitPay,omitempty" url:"FiatBybitPay,omitempty"`
	// Fiat convert `FiatConvertBrokerOrder`
	FiatConvertBroker []string `json:"FiatConvertBroker,omitempty" url:"FiatConvertBroker,omitempty"`
	// Affiliate. `["Affiliate"]`
	//
	// 	- This permission is only useful for affiliate
	// 	- If you need this permission, make sure you remove all other permissions
	Affiliate []string `json:"Affiliate,omitempty" url:"Affiliate,omitempty"`
	// `["DerivativesTrade"]`
	Derivatives []string `json:"Derivatives,omitempty" url:"Derivatives,omitempty"`
	// Blocktrade. `["BlockTrade"]`
	BlockTrade []string `json:"BlockTrade,omitempty" url:"BlockTrade,omitempty"`
}

type UserUpdateApiResult

type UserUpdateApiResult struct {
	// Unique id. Internal used
	Id string `json:"id,omitempty" url:"id,omitempty"`
	// The remark
	Note string `json:"note,omitempty" url:"note,omitempty"`
	// Api key
	ApiKey string `json:"apiKey,omitempty" url:"apiKey,omitempty"`
	// `0`: Read and Write. `1`: Read only
	ReadOnly int64 `json:"readOnly,omitempty" url:"readOnly,omitempty"`
	// Always `""`
	Secret string `json:"secret,omitempty" url:"secret,omitempty"`
	// The types of permission
	Permissions UserUpdateApiResultPermissions `json:"permissions" url:"permissions"`
	// IP bound
	Ips []string `json:"ips,omitempty" url:"ips,omitempty"`
}

type UserUpdateApiResultPermissions

type UserUpdateApiResultPermissions struct {
	// Permisson of contract trade
	ContractTrade []string `json:"ContractTrade,omitempty" url:"ContractTrade,omitempty"`
	// Permisson of spot
	Spot []string `json:"Spot,omitempty" url:"Spot,omitempty"`
	// Permisson of wallet
	Wallet []string `json:"Wallet,omitempty" url:"Wallet,omitempty"`
	// Permission of USDC Contract. It supports trade option and usdc perpetual.
	Options []string `json:"Options,omitempty" url:"Options,omitempty"`
	// Permission of Unified account
	Derivatives []string `json:"Derivatives,omitempty" url:"Derivatives,omitempty"`
	// Permission of blocktrade
	BlockTrade []string `json:"BlockTrade,omitempty" url:"BlockTrade,omitempty"`
	// Permission of convert
	Exchange []string `json:"Exchange,omitempty" url:"Exchange,omitempty"`
	// Permission of earn
	Earn []string `json:"Earn,omitempty" url:"Earn,omitempty"`
	// Affiliate permission
	Affiliate []string `json:"Affiliate,omitempty" url:"Affiliate,omitempty"`
	// Permission of P2P
	FiatP2P []string `json:"FiatP2P,omitempty" url:"FiatP2P,omitempty"`
	// Permission of Bybit pay
	FiatBybitPay []string `json:"FiatBybitPay,omitempty" url:"FiatBybitPay,omitempty"`
	// Permission of fiat convert
	FiatConvertBroker []string `json:"FiatConvertBroker,omitempty" url:"FiatConvertBroker,omitempty"`
	// **Deprecated**, always `[]`
	Nft []string `json:"NFT,omitempty" url:"NFT,omitempty"`
	// **Deprecated**, always `[]`
	CopyTrading []string `json:"CopyTrading,omitempty" url:"CopyTrading,omitempty"`
}

type UserUpdateSubApiParams

type UserUpdateSubApiParams struct {
	// Sub account api key
	//
	// 	- You must pass this param when you use master account manage sub account api key settings
	// 	- If you use corresponding sub uid api key call this endpoint, `apikey` param cannot be passed, otherwise throwing an error
	Apikey string `json:"apikey,omitempty" url:"apikey,omitempty"`
	// `0` (default): Read and Write. `1`: Read only
	ReadOnly int64 `json:"readOnly,omitempty" url:"readOnly,omitempty"`
	// Set the IP bind. example: `"192.168.0.1,192.168.0.2"`**note:**
	//
	// 	- don't pass ips or pass with `"*"` means no bind
	// 	- No ip bound api key will be **invalid after 90 days**
	// 	- api key will be invalid after **7 days** once the account password is changed
	Ips []string `json:"ips,omitempty" url:"ips,omitempty"`
	// Tick the types of permission. Don't send this param if you don't want to change the permission
	Permissions UserUpdateSubApiParamsPermissions `json:"permissions" url:"permissions"`
}

type UserUpdateSubApiParamsPermissions

type UserUpdateSubApiParamsPermissions struct {
	// Contract Trade. `["Order","Position"]`
	ContractTrade []string `json:"ContractTrade,omitempty" url:"ContractTrade,omitempty"`
	// Spot Trade. `["SpotTrade"]`
	Spot []string `json:"Spot,omitempty" url:"Spot,omitempty"`
	// Wallet. `["AccountTransfer", "SubMemberTransferList"]`
	// _Note: fund custodial account is not supported_
	Wallet []string `json:"Wallet,omitempty" url:"Wallet,omitempty"`
	// USDC Contract. `["OptionsTrade"]`
	Options []string `json:"Options,omitempty" url:"Options,omitempty"`
	// `["DerivativesTrade"]`
	Derivatives []string `json:"Derivatives,omitempty" url:"Derivatives,omitempty"`
	// Convert. `["ExchangeHistory"]`
	Exchange []string `json:"Exchange,omitempty" url:"Exchange,omitempty"`
	// Earn product. `["Earn"]`
	Earn []string `json:"Earn,omitempty" url:"Earn,omitempty"`
}

type UserUpdateSubApiResult

type UserUpdateSubApiResult struct {
	// Unique id. Internal used
	Id string `json:"id,omitempty" url:"id,omitempty"`
	// The remark
	Note string `json:"note,omitempty" url:"note,omitempty"`
	// Api key
	ApiKey string `json:"apiKey,omitempty" url:"apiKey,omitempty"`
	// `0`: Read and Write. `1`: Read only
	ReadOnly int64 `json:"readOnly,omitempty" url:"readOnly,omitempty"`
	// Always `""`
	Secret string `json:"secret,omitempty" url:"secret,omitempty"`
	// The types of permission
	Permissions UserUpdateSubApiResultPermissions `json:"permissions" url:"permissions"`
	// IP bound
	Ips []string `json:"ips,omitempty" url:"ips,omitempty"`
}

type UserUpdateSubApiResultPermissions

type UserUpdateSubApiResultPermissions struct {
	// Permisson of contract trade
	ContractTrade []string `json:"ContractTrade,omitempty" url:"ContractTrade,omitempty"`
	// Permisson of spot
	Spot []string `json:"Spot,omitempty" url:"Spot,omitempty"`
	// Permisson of wallet
	Wallet []string `json:"Wallet,omitempty" url:"Wallet,omitempty"`
	// Permission of USDC Contract. It supports trade option and usdc perpetual.
	Options []string `json:"Options,omitempty" url:"Options,omitempty"`
	// Permission of Unified account
	Derivatives []string `json:"Derivatives,omitempty" url:"Derivatives,omitempty"`
	// Permission of convert
	Exchange []string `json:"Exchange,omitempty" url:"Exchange,omitempty"`
	// Permission of Earn
	Earn []string `json:"Earn,omitempty" url:"Earn,omitempty"`
	// Not applicable to sub account, always `[]`
	BlockTrade []string `json:"BlockTrade,omitempty" url:"BlockTrade,omitempty"`
	// Not applicable to sub account, always `[]`
	Affiliate []string `json:"Affiliate,omitempty" url:"Affiliate,omitempty"`
	// Not applicable to sub account, always `[]`
	FiatP2P []string `json:"FiatP2P,omitempty" url:"FiatP2P,omitempty"`
	// Not applicable to sub account, always `[]`
	FiatBybitPay []string `json:"FiatBybitPay,omitempty" url:"FiatBybitPay,omitempty"`
	// Not applicable to sub account, always `[]`
	FiatConvertBroker []string `json:"FiatConvertBroker,omitempty" url:"FiatConvertBroker,omitempty"`
	// **Deprecated**, always `[]`
	Nft []string `json:"NFT,omitempty" url:"NFT,omitempty"`
	// **Deprecated**, always `[]`
	CopyTrading []string `json:"CopyTrading,omitempty" url:"CopyTrading,omitempty"`
}

type VipLevel

type VipLevel string

type WithdrawStatus

type WithdrawStatus string
const (
	WithdrawStatusSecurityCheck           WithdrawStatus = "SecurityCheck"
	WithdrawStatusPending                 WithdrawStatus = "Pending"
	WithdrawStatusSuccess                 WithdrawStatus = "success"
	WithdrawStatusCancelByUser            WithdrawStatus = "CancelByUser"
	WithdrawStatusReject                  WithdrawStatus = "Reject"
	WithdrawStatusFail                    WithdrawStatus = "Fail"
	WithdrawStatusBlockchainConfirmed     WithdrawStatus = "BlockchainConfirmed"
	WithdrawStatusMoreInformationRequired WithdrawStatus = "MoreInformationRequired"
	WithdrawStatusUnknown                 WithdrawStatus = "Unknown"
)

Jump to

Keyboard shortcuts

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