bybitv5

package
v0.3.21 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Enums Definitions (https://bybit-exchange.github.io/docs/v5/enum)

Index

Constants

View Source
const (
	// Mainnet base url:
	MainBaseUrl = "https://api.bybit.com"

	// Mainnet base bytick url:
	MainBaseByTickUrl = "https://api.bytick.com"

	// Mainnet base websocket url:
	MainBaseWsUrl = "wss://stream.bybit.com"

	// Mainnet base bytick websocket url:
	MainBaseByTickWsUrl = "wss://stream.bytick.com"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountInfo added in v0.3.19

type AccountInfo struct {
	MarginMode        string
	DcpStatus         string
	TimeWindow        int
	SmpGroup          int
	IsMasterTrader    bool
	SpotHedgingStatus string
	UpdatedTime       string
}

type AccountType

type AccountType string

accountType (https://bybit-exchange.github.io/docs/v5/enum#accounttype)

const (
	AccountContract   AccountType = "CONTRACT"
	AccountSpot       AccountType = "SPOT"
	AccountInvestment AccountType = "INVESTMENT"
	AccountOption     AccountType = "OPTION"
	AccountUnified    AccountType = "UNIFIED"
	AccountFund       AccountType = "FUND"
)

type AmendOrder added in v0.2.1

type AmendOrder struct {
	Category     Category
	Symbol       string
	OrderId      string        `json:",omitempty"`
	OrderLinkId  string        `json:",omitempty"`
	OrderIv      ujson.Float64 `json:",omitempty"`
	TriggerPrice ujson.Float64 `json:",omitempty"`
	Qty          ujson.Float64 `json:",omitempty"`
	Price        ujson.Float64 `json:",omitempty"`
	TakeProfit   ujson.Float64 `json:",omitempty"`
	StopLoss     ujson.Float64 `json:",omitempty"`
	TpTriggerBy  TriggerBy     `json:",omitempty"`
	SlTriggerBy  TriggerBy     `json:",omitempty"`
	TriggerBy    TriggerBy     `json:",omitempty"`
	TpLimitPrice ujson.Float64 `json:",omitempty"`
	SlLimitPrice ujson.Float64 `json:",omitempty"`
}

Amend Order https://bybit-exchange.github.io/docs/v5/order/amend-order

func (AmendOrder) Do added in v0.2.1

func (o AmendOrder) Do(c *Client) Response[OrderId]

type AssetInfo

type AssetInfo struct {
	Coin     string
	Frozen   string
	Free     string
	Withdraw string
}

type CancelAllOrders added in v0.2.1

type CancelAllOrders struct {
	Category    Category
	Symbol      string `json:",omitempty"`
	BaseCoin    string `json:",omitempty"`
	SettleCoin  string `json:",omitempty"`
	OrderFilter string `json:",omitempty"`
}

Cancel All Orders https://bybit-exchange.github.io/docs/v5/order/cancel-all

func (CancelAllOrders) Do added in v0.2.1

func (CancelAllOrders) DoSpot added in v0.2.4

func (o CancelAllOrders) DoSpot(c *Client) Response[bool]

type CancelOrder added in v0.2.1

type CancelOrder struct {
	Category    Category
	Symbol      string
	OrderId     string `json:",omitempty"`
	OrderLinkId string `json:",omitempty"`
	OrderFilter string `json:",omitempty"`
}

Cancel Order https://bybit-exchange.github.io/docs/v5/order/cancel-order

func (CancelOrder) Do added in v0.2.1

func (o CancelOrder) Do(c *Client) Response[OrderId]

type CancelType added in v0.2.1

type CancelType string

cancelType https://bybit-exchange.github.io/docs/v5/enum#canceltype

const (
	CancelByUser                  CancelType = "CancelByUser"
	CancelByReduceOnly            CancelType = "CancelByReduceOnly"
	CancelByPrepareLiq            CancelType = "CancelByPrepareLiq"
	CancelByPrepareAdl            CancelType = "CancelByPrepareAdl"
	CancelByAdmin                 CancelType = "CancelByAdmin"
	CancelByTpSlTsClear           CancelType = "CancelByTpSlTsClear"
	CancelByPzSideCh              CancelType = "CancelByPzSideCh"
	CancelBySmp                   CancelType = "CancelBySmp"
	CancelAllBeforeLiq            CancelType = "CancelAllBeforeLiq"
	CancelAllBeforeAdl            CancelType = "CancelAllBeforeAdl"
	CancelBySettle                CancelType = "CancelBySettle"
	CancelByCannotAffordOrderCost CancelType = "CancelByCannotAffordOrderCost"
	CancelByPmTrialMmOverEquity   CancelType = "CancelByPmTrialMmOverEquity"
	CancelByAccountBlocking       CancelType = "CancelByAccountBlocking"
	CancelByDelivery              CancelType = "CancelByDelivery"
	CancelByMmpTriggered          CancelType = "CancelByMmpTriggered"
	CancelByCrossSelfMuch         CancelType = "CancelByCrossSelfMuch"
	CancelByCrossReachMaxTradeNum CancelType = "CancelByCrossReachMaxTradeNum"
	CancelByDCP                   CancelType = "CancelByDCP"
)

type Category

type Category string

category (https://bybit-exchange.github.io/docs/v5/enum#category)

const (
	Spot    Category = "spot"
	Linear  Category = "linear"
	Inverse Category = "inverse"
	Option  Category = "option"
)

type Client

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

func NewClient

func NewClient() *Client

func (*Client) AmendOrder added in v0.2.1

func (o *Client) AmendOrder(v AmendOrder) Response[OrderId]

func (*Client) CancelAllOrders added in v0.2.1

func (o *Client) CancelAllOrders(v CancelAllOrders) Response[OrderId]

func (*Client) CancelAllOrdersSpot added in v0.2.4

func (o *Client) CancelAllOrdersSpot(v CancelAllOrders) Response[bool]

func (*Client) CancelOrder added in v0.2.1

func (o *Client) CancelOrder(v CancelOrder) Response[OrderId]

func (*Client) Copy added in v0.3.9

func (o *Client) Copy() *Client

func (*Client) CreateInternalTransfer

func (o *Client) CreateInternalTransfer(v CreateInternalTransfer) Response[uuid.UUID]

func (*Client) GetAccountCoinsBalance

func (o *Client) GetAccountCoinsBalance(accountType AccountType) Response[CoinsBalance]

func (*Client) GetAccountInfo added in v0.3.19

func (o *Client) GetAccountInfo() Response[AccountInfo]

func (*Client) GetAccountWallatBalance added in v0.2.12

func (o *Client) GetAccountWallatBalance(accountType AccountType) Response[[]WalletBalance]

func (*Client) GetAssetInfo

func (o *Client) GetAssetInfo(v GetAssetInfo) Response[SpotAssetInfo]

func (*Client) GetCoinBalance

func (o *Client) GetCoinBalance(v GetCoinBalance) Response[SingleCoinBalance]

func (*Client) GetCoinRecords

func (o *Client) GetCoinRecords(v GetCoinRecords) Response[[]CoinRecord]

func (*Client) GetCoinsBalance

func (o *Client) GetCoinsBalance(v GetCoinsBalance) Response[CoinsBalance]

func (*Client) GetDeliveryPrice

func (o *Client) GetDeliveryPrice(v GetDeliveryPrice) Response[[]DeliveryPrice]

func (*Client) GetDeliveryRecords

func (o *Client) GetDeliveryRecords(v GetDeliveryRecords) Response[[]DeliveryRecord]

func (*Client) GetFundingRateHistory

func (o *Client) GetFundingRateHistory(v GetFundingRateHistory) Response[[]FundingRateHistory]

func (*Client) GetHistoricalVolatility

func (o *Client) GetHistoricalVolatility(v GetHistoricalVolatility) Response[[]HistoricalVolatility]

func (*Client) GetIndexPriceKline

func (o *Client) GetIndexPriceKline(v GetKline) Response[[]Kline]

func (*Client) GetInstruments

func (o *Client) GetInstruments(v GetInstruments) Response[[]Instrument]

func (*Client) GetInstrumentsOption added in v0.2.4

func (o *Client) GetInstrumentsOption(v GetInstruments) Response[[]InstrumentOption]

func (*Client) GetInstrumentsSpot added in v0.2.4

func (o *Client) GetInstrumentsSpot(v GetInstruments) Response[[]InstrumentSpot]

func (*Client) GetInsurance

func (o *Client) GetInsurance(v GetInsurance) Response[[]Insurance]

func (*Client) GetKeyInfo

func (o *Client) GetKeyInfo() Response[KeyInfo]

func (*Client) GetKline

func (o *Client) GetKline(v GetKline) Response[[]KlineExt]

func (*Client) GetMarkPriceKline

func (o *Client) GetMarkPriceKline(v GetKline) Response[[]Kline]

func (*Client) GetOpenInterest

func (o *Client) GetOpenInterest(v GetOpenInterest) Response[[]OpenInterest]

func (*Client) GetOpenOrders added in v0.2.1

func (o *Client) GetOpenOrders(v GetOpenOrders) Response[[]Order]

func (*Client) GetOrderHistory added in v0.2.1

func (o *Client) GetOrderHistory(v GetOrderHistory) Response[[]Order]

func (*Client) GetOrderbook

func (o *Client) GetOrderbook(v GetOrderbook) Response[Orderbook]

func (*Client) GetPositions added in v0.2.1

func (o *Client) GetPositions(v GetPositions) Response[[]Position]

func (*Client) GetPremiumIndexPriceKline

func (o *Client) GetPremiumIndexPriceKline(v GetKline) Response[[]Kline]

func (*Client) GetPublicTradingHistory

func (o *Client) GetPublicTradingHistory(v GetPublicTradingHistory) Response[[]PublicTradingHistory]

func (*Client) GetRiskLimit

func (o *Client) GetRiskLimit(v GetRiskLimit) Response[[]RiskLimit]

func (*Client) GetServerTime added in v0.2.22

func (o *Client) GetServerTime() Response[ServerTime]

func (*Client) GetSettlement

func (o *Client) GetSettlement(v GetSettlement) Response[[]Settlement]

func (*Client) GetTickers

func (o *Client) GetTickers(v GetTickers) Response[[]Ticker]

func (*Client) GetTickersOption added in v0.2.7

func (o *Client) GetTickersOption(v GetTickersOption) Response[[]TickerOption]

func (*Client) GetTickersSpot added in v0.2.7

func (o *Client) GetTickersSpot(v GetTickers) Response[[]TickerSpot]

func (*Client) GetTransactionLog added in v0.3.5

func (o *Client) GetTransactionLog(v GetTransactionLog) Response[[]TransactionLog]

func (*Client) GetTransferableCoin

func (o *Client) GetTransferableCoin(v GetTransferableCoin) Response[[]string]

func (*Client) GetWallatBalance added in v0.2.12

func (o *Client) GetWallatBalance(v GetWallatBalance) Response[[]WalletBalance]

func (*Client) PlaceOrder added in v0.2.1

func (o *Client) PlaceOrder(v PlaceOrder) Response[OrderId]

func (*Client) WithAppendPath

func (o *Client) WithAppendPath(path string) *Client

func (*Client) WithAuth

func (o *Client) WithAuth(key, secret string) *Client

func (*Client) WithBaseUrl

func (o *Client) WithBaseUrl(url string) *Client

func (*Client) WithByTickUrl

func (o *Client) WithByTickUrl() *Client

func (*Client) WithOnReadBodyError added in v0.3.13

func (o *Client) WithOnReadBodyError(f uhttp.OnError) *Client

func (*Client) WithOnTransportError added in v0.3.1

func (o *Client) WithOnTransportError(f OnTransportError) *Client

func (*Client) WithPath

func (o *Client) WithPath(path string) *Client

func (*Client) WithProxy

func (o *Client) WithProxy(proxy string) *Client

func (*Client) WithReferer added in v0.3.7

func (o *Client) WithReferer(referer string) *Client

func (*Client) WithTimeout

func (o *Client) WithTimeout(timeout time.Duration) *Client

func (*Client) WithTrace added in v0.3.9

func (o *Client) WithTrace(trace func(uhttp.Responce)) *Client

func (*Client) WithTransport added in v0.3.9

func (o *Client) WithTransport(transport *http.Transport) *Client

type CoinBalance

type CoinBalance struct {
	Coin            string
	TransferBalance ujson.Float64
	WalletBalance   ujson.Float64
	Bonus           string
}

type CoinBalanceExt

type CoinBalanceExt struct {
	CoinBalance
	TransferSafeAmount string
}

type CoinRecord

type CoinRecord struct {
	Fromcoin     string
	Fromamount   string
	Tocoin       string
	Toamount     string
	Exchangerate string
	Createdtime  string
	Exchangetxid string
}

type CoinsBalance

type CoinsBalance struct {
	AccountType AccountType
	MemberId    string
	Balance     []CoinBalance
}

type ContractType

type ContractType string

contractType (https://bybit-exchange.github.io/docs/v5/enum#contracttype)

const (
	InversePerpetual ContractType = "InversePerpetual"
	LinearPerpetual  ContractType = "LinearPerpetual"
	LinearFutures    ContractType = "LinearFutures"
	InverseFutures   ContractType = "InverseFutures"
)

type CreateInternalTransfer

type CreateInternalTransfer struct {
	TransferId      uuid.UUID
	Coin            string
	Amount          ujson.Float64
	FromAccountType AccountType
	ToAccountType   AccountType
}

Create Internal Transfer https://bybit-exchange.github.io/docs/v5/asset/create-inter-transfer

transferId      Required string UUID. Please manually generate a UUID
coin            Required string Coin
amount          Required string Amount
fromAccountType Required string From account type
toAccountType   Required string To account type

func (CreateInternalTransfer) Do

type DeliveryPrice

type DeliveryPrice struct {
	Symbol        string
	DeliveryPrice string
	DeliveryTime  string
}

type DeliveryRecord

type DeliveryRecord struct {
	Symbol        string
	Side          Side
	DeliveryTime  int64
	Strike        string
	Fee           string
	Position      string
	DeliveryPrice string
	DeliveryRpl   string
}

type Error

type Error struct {
	Code int
	Text string
}

Error (https://bybit-exchange.github.io/docs/v5/error)

func (*Error) ApiKeyExpired

func (o *Error) ApiKeyExpired() bool

func (*Error) ApiKeyInvalid

func (o *Error) ApiKeyInvalid() bool

func (*Error) Empty

func (o *Error) Empty() bool

func (*Error) Error

func (o *Error) Error() string

func (*Error) InsufficientBalance

func (o *Error) InsufficientBalance() bool

func (*Error) KycNeeded

func (o *Error) KycNeeded() bool

func (*Error) OrderLinkedIdIsDuplicate added in v0.3.18

func (o *Error) OrderLinkedIdIsDuplicate() bool

func (*Error) RequestParameterError added in v0.2.23

func (o *Error) RequestParameterError() bool

func (*Error) Std

func (o *Error) Std() error

func (*Error) SymbolIsNotWhitelisted added in v0.2.23

func (o *Error) SymbolIsNotWhitelisted() bool

func (*Error) Timeout added in v0.2.16

func (o *Error) Timeout() bool

func (*Error) TooManyVisits

func (o *Error) TooManyVisits() bool

func (*Error) UnmatchedIp

func (o *Error) UnmatchedIp() bool

type ExecType added in v0.2.1

type ExecType string

execType https://bybit-exchange.github.io/docs/v5/enum#exectype

const (
	ExecTrade      ExecType = "Trade"
	ExecAdlTrade   ExecType = "AdlTrade"
	ExecFunding    ExecType = "Funding"
	ExecBustTrade  ExecType = "BustTrade"
	ExecDelivery   ExecType = "Delivery"
	ExecBlockTrade ExecType = "BlockTrade"
)

type ExecutionShot added in v0.2.1

type ExecutionShot struct {
	Category        Category
	Symbol          ujson.StringFloat64
	ExecFee         ujson.StringFloat64
	ExecId          ujson.StringFloat64
	ExecPrice       ujson.StringFloat64
	ExecQty         ujson.StringFloat64
	ExecType        ExecType
	ExecValue       string
	IsMaker         bool
	FeeRate         ujson.StringFloat64
	TradeIv         ujson.StringFloat64
	MarkIv          string
	BlockTradeId    string
	MarkPrice       ujson.StringFloat64
	IndexPrice      ujson.StringFloat64
	UnderlyingPrice ujson.StringFloat64
	LeavesQty       ujson.StringFloat64
	OrderId         string
	OrderLinkId     string
	OrderPrice      ujson.StringFloat64
	OrderQty        ujson.StringFloat64
	OrderType       OrderType
	StopOrderType   StopOrderType
	Side            Side
	ExecTime        string
	IsLeverage      string
	ClosedSize      string
}

type Executor added in v0.2.1

type Executor[T any] struct {
	// contains filtered or unexported fields
}

func NewExecutor added in v0.2.1

func NewExecutor[T any](topic string, subscriptions *Subscriptions) *Executor[T]

func (*Executor[T]) Subscribe added in v0.2.1

func (o *Executor[T]) Subscribe(onShot func(Topic[T]))

func (*Executor[T]) Unsubscribe added in v0.2.1

func (o *Executor[T]) Unsubscribe()

type FundingRateHistory

type FundingRateHistory struct {
	Symbol               string
	FundingRate          string
	FundingRateTimestamp string
}

type GetAccountInfo added in v0.3.19

type GetAccountInfo struct {
}

Get Account Info https://bybit-exchange.github.io/docs/v5/account/account-info

func (GetAccountInfo) Do added in v0.3.19

type GetAssetInfo

type GetAssetInfo struct {
	AccountType AccountType
	Coin        string `url:",omitempty"`
}

Get Asset Info https://bybit-exchange.github.io/docs/v5/asset/asset-info

accountType Required string Account type. SPOT
coin                 string Coin name

func (GetAssetInfo) Do

type GetCoinBalance

type GetCoinBalance struct {
	AccountType            AccountType
	Coin                   string
	MemberId               string `url:",omitempty"`
	WithBonus              int    `url:",omitempty"`
	WithTransferSafeAmount int    `url:",omitempty"`
}

Get Single Coin Balance https://bybit-exchange.github.io/docs/v5/asset/account-coin-balance

accountType            Required string  Account type
coin                   Required string  Coin name
memberId                        string  User Id. It is required when you use master api key to check sub account coin balance
withBonus                       integer Whether query bonus or not. 0(default):false; 1:true
withTransferSafeAmount          integer Whether query delay withdraw/transfer safe amount

func (GetCoinBalance) Do

type GetCoinRecords

type GetCoinRecords struct {
	FromCoin string `url:",omitempty"`
	ToCoin   string `url:",omitempty"`
	Limit    int    `url:",omitempty"`
	Cursor   string `url:",omitempty"`
}

Get Coin Exchange Records https://bybit-exchange.github.io/docs/v5/asset/exchange

fromCoin string  The currency to convert from. e.g,BTC
toCoin   string  The currency to convert to. e.g,USDT
limit    integer Limit for data size per page. [1, 50]. Default: 10
cursor   string  Cursor. Used for pagination

func (GetCoinRecords) Do

type GetCoinsBalance

type GetCoinsBalance struct {
	AccountType AccountType
	MemberId    string `url:",omitempty"`
	Coin        string `url:",omitempty"`
	WithBonus   string `url:",omitempty"`
}

Get All Coins Balance https://bybit-exchange.github.io/docs/v5/asset/all-balance

accountType Required string Account type
memberId             string User Id. It is required when you use master api key to check sub account coin balance
coin                 string Coin name
withBonus            string Whether query bonus or not. 0(default):false; 1:true

func (GetCoinsBalance) Do

type GetDeliveryPrice

type GetDeliveryPrice struct {
	Category Category
	Symbol   string `url:",omitempty"`
	BaseCoin string `url:",omitempty"`
	Limit    int    `url:",omitempty"`
	Cursor   string `url:",omitempty"`
}

Get Delivery Price https://bybit-exchange.github.io/docs/v5/market/delivery-price

category Required string  Product type. spot,linear,inverse
symbol            string  Symbol name
baseCoin          string  Base coin. Default: BTC. valid for option only
limit             integer Limit for data size per page. [1, 200]. Default: 50
cursor            string  Cursor. Used for pagination

func (GetDeliveryPrice) Do

type GetDeliveryRecords

type GetDeliveryRecords struct {
	Category Category
	Symbol   string `url:",omitempty"`
	Expdate  string `url:",omitempty"`
	Limit    int    `url:",omitempty"`
	Cursor   string `url:",omitempty"`
}

Get Delivery Record https://bybit-exchange.github.io/docs/v5/asset/delivery

category Required string Product type. option, linear symbol string Symbol name expDate string Expiry date. 25MAR22. Default: return all limit integer Limit for data size per page. [1, 50]. Default: 20 cursor string Cursor. Used for pagination

func (GetDeliveryRecords) Do

type GetFundingRateHistory

type GetFundingRateHistory struct {
	Category  Category
	Symbol    string
	StartTime int `url:",omitempty"`
	EndTime   int `url:",omitempty"`
	Limit     int `url:",omitempty"`
}

Get Funding Rate History https://bybit-exchange.github.io/docs/v5/market/history-fund-rate

category  Required string  Product type. linear,inverse
symbol    Required string  Symbol name
startTime          integer The start timestamp (ms)
endTime            integer The end timestamp (ms)
limit              integer Limit for data size per page. [1, 200]. Default: 200

func (GetFundingRateHistory) Do

type GetHistoricalVolatility

type GetHistoricalVolatility struct {
	Category  Category
	BaseCoin  string `url:",omitempty"`
	Period    Period `url:",omitempty"`
	StartTime int    `url:",omitempty"`
	EndTime   int    `url:",omitempty"`
}

Get Historical Volatility https://bybit-exchange.github.io/docs/v5/market/iv

category  Required string  Product type. option
baseCoin           string  Base coin. Default: return BTC data
period             integer Period
startTime          integer The start timestamp (ms)
endTime            integer The end timestamp (ms)

func (GetHistoricalVolatility) Do

type GetInstruments

type GetInstruments struct {
	Category Category
	Symbol   string `url:",omitempty"`
	Status   Status `url:",omitempty"`
	BaseCoin string `url:",omitempty"`
	Limit    int    `url:",omitempty"`
	Cursor   string `url:",omitempty"`
}

Get Instruments Info https://bybit-exchange.github.io/docs/v5/market/instrument

category Required string  Product type. spot,linear,inverse
symbol            string  Symbol name
status            string  Symbol status filter, spot/linear/inverse has Trading only
baseCoin          string  Base coin. linear,inverse,option only
limit             integer Limit for data size per page. [1, 1000]. Default: 500
cursor            string  Cursor. Used for pagination

func (GetInstruments) Do

func (GetInstruments) DoOption added in v0.2.4

func (o GetInstruments) DoOption(c *Client) Response[[]InstrumentOption]

func (GetInstruments) DoSpot added in v0.2.4

func (o GetInstruments) DoSpot(c *Client) Response[[]InstrumentSpot]

type GetInsurance

type GetInsurance struct {
	Coin string `url:",omitempty"`
}

Get Insurance https://bybit-exchange.github.io/docs/v5/market/insurance

coin string coin. Default: return all insurance coins

func (GetInsurance) Do

func (o GetInsurance) Do(c *Client) Response[[]Insurance]

type GetKeyInfo

type GetKeyInfo struct {
}

Get API Key Information https://bybit-exchange.github.io/docs/v5/user/apikey-info

func (GetKeyInfo) Do

func (o GetKeyInfo) Do(c *Client) Response[KeyInfo]

type GetKline

type GetKline struct {
	Category Category
	Symbol   string
	Interval Interval
	Start    int `url:",omitempty"`
	End      int `url:",omitempty"`
	Limit    int `url:",omitempty"`
}

Get Kline https://bybit-exchange.github.io/docs/v5/market/kline

category Required string  Product type. spot,linear,inverse
symbol   Required string  Symbol name
interval Required string  Kline interval. 1,3,5,15,30,60,120,240,360,720,D,M,W
start             integer The start timestamp (ms)
end               integer The end timestamp (ms)
limit             integer Limit for data size per page. [1, 200]. Default: 200

func (GetKline) Do

func (o GetKline) Do(c *Client) Response[[]KlineExt]

func (GetKline) DoIndexPrice

func (o GetKline) DoIndexPrice(c *Client) Response[[]Kline]

Get Index Price Kline https://bybit-exchange.github.io/docs/v5/market/index-kline

func (GetKline) DoMarkPrice

func (o GetKline) DoMarkPrice(c *Client) Response[[]Kline]

Get Mark Price Kline https://bybit-exchange.github.io/docs/v5/market/mark-kline

func (GetKline) DoPremiumIndexPrice

func (o GetKline) DoPremiumIndexPrice(c *Client) Response[[]Kline]

Get Premium Index Price Kline https://bybit-exchange.github.io/docs/v5/market/preimum-index-kline

type GetOpenInterest

type GetOpenInterest struct {
	Category     Category
	Symbol       string
	IntervalTime IntervalTime
	StartTime    int    `url:",omitempty"`
	EndTime      int    `url:",omitempty"`
	Limit        int    `url:",omitempty"`
	Cursor       string `url:",omitempty"`
}

Get Open Interest https://bybit-exchange.github.io/docs/v5/market/open-interest

category     Required string  Product type. linear,inverse
symbol       Required string  Symbol name
intervalTime Required string  Interval. 5min,15min,30min,1h,4h,1d
startTime             integer The start timestamp (ms)
endTime               integer The end timestamp (ms)
limit                 integer Limit for data size per page. [1, 200]. Default: 50
cursor                string  Cursor. Used for pagination

func (GetOpenInterest) Do

type GetOpenOrders added in v0.2.1

type GetOpenOrders struct {
	Category    Category
	Symbol      string `url:",omitempty"`
	BaseCoin    string `url:",omitempty"`
	SettleCoin  string `url:",omitempty"`
	OrderId     string `url:",omitempty"`
	OrderLinkId string `url:",omitempty"`
	OpenOnly    *int   `url:",omitempty"`
	OrderFilter string `url:",omitempty"`
	Limit       int    `url:",omitempty"`
	Cursor      string `url:",omitempty"`
}

Get Open Orders (real-time) https://bybit-exchange.github.io/docs/v5/order/open-order

func (GetOpenOrders) Do added in v0.2.1

func (o GetOpenOrders) Do(c *Client) Response[[]Order]

type GetOrderHistory added in v0.2.1

type GetOrderHistory struct {
	Category    Category
	Symbol      string      `url:",omitempty"`
	BaseCoin    string      `url:",omitempty"`
	OrderId     string      `url:",omitempty"`
	OrderLinkId string      `url:",omitempty"`
	OrderFilter string      `url:",omitempty"`
	OrderStatus OrderStatus `url:",omitempty"`
	StartTime   int         `url:",omitempty"`
	EndTime     int         `url:",omitempty"`
	Limit       int         `url:",omitempty"`
	Cursor      string      `url:",omitempty"`
}

Get Order History https://bybit-exchange.github.io/docs/v5/order/order-list

func (GetOrderHistory) Do added in v0.2.1

func (o GetOrderHistory) Do(c *Client) Response[[]Order]

type GetOrderbook

type GetOrderbook struct {
	Category Category
	Symbol   string
	Limit    int `url:",omitempty"`
}

Get Orderbook https://bybit-exchange.github.io/docs/v5/market/orderbook

category Required string  Product type. spot,linear,inverse,option
symbol   Required string  Symbol name
limit             integer Limit size for each bid and ask
                  spot: [1, 50]. Default: 1.
                  linear&inverse: [1, 200]. Default: 25.
                  option: [1, 25]. Default: 1.

func (GetOrderbook) Do

type GetPositions added in v0.2.1

type GetPositions struct {
	Category   Category
	Symbol     string `url:",omitempty"`
	BaseCoin   string `url:",omitempty"`
	SettleCoin string `url:",omitempty"`
	Limit      int    `url:",omitempty"`
	Cursor     string `url:",omitempty"`
}

Get Position Info https://bybit-exchange.github.io/docs/v5/position

func (GetPositions) Do added in v0.2.1

func (o GetPositions) Do(c *Client) Response[[]Position]

type GetPublicTradingHistory

type GetPublicTradingHistory struct {
	Category   Category
	Symbol     string `url:",omitempty"`
	BaseCoin   string `url:",omitempty"`
	OptionType string `url:",omitempty"`
	Limit      int    `url:",omitempty"`
}

Get Public Trading History https://bybit-exchange.github.io/docs/v5/market/recent-trade

category   Required string  Product type. spot,linear,inverse,option
symbol              string  Symbol name
baseCoin            string  Base coin. For option only. If not passed, return BTC data by default
optionType          string  Option type. Call or Put. For option only
limit               integer

func (GetPublicTradingHistory) Do

type GetRiskLimit

type GetRiskLimit struct {
	Category Category
	Symbol   string `url:",omitempty"`
}

Get Risk Limit https://bybit-exchange.github.io/docs/v5/market/risk-limit

category Required string Product type. linear,inverse
symbol            string Symbol name

func (GetRiskLimit) Do

func (o GetRiskLimit) Do(c *Client) Response[[]RiskLimit]

type GetServerTime added in v0.2.22

type GetServerTime struct {
}

Get Server Time https://bybit-exchange.github.io/docs/v5/market/time

func (GetServerTime) Do added in v0.2.22

type GetSettlement

type GetSettlement struct {
	Category Category
	Symbol   string `url:",omitempty"`
	Limit    int    `url:",omitempty"`
	Cursor   string `url:",omitempty"`
}

Get USDC Session Settlement https://bybit-exchange.github.io/docs/v5/asset/settlement category Required string Product type. linear symbol string Symbol name limit integer Limit for data size per page. [1, 50]. Default: 20 cursor string Cursor. Used for pagination

func (GetSettlement) Do

type GetTickers

type GetTickers struct {
	Category Category
	Symbol   string `url:",omitempty"`
}

Get Tickers https://bybit-exchange.github.io/docs/v5/market/tickers

category Required string Product type. spot,linear,inverse,option
symbol            string Symbol name
baseCoin          string Base coin. For option only
expDate           string Expiry date. e.g., 25DEC22. For option only

func (GetTickers) Do

func (o GetTickers) Do(c *Client) Response[[]Ticker]

func (GetTickers) DoSpot added in v0.2.7

func (o GetTickers) DoSpot(c *Client) Response[[]TickerSpot]

type GetTickersOption added in v0.2.7

type GetTickersOption struct {
	Category Category
	Symbol   string `url:",omitempty"`
	BaseCoin string `url:",omitempty"`
	ExpDate  string `url:",omitempty"`
}

func (GetTickersOption) Do added in v0.2.7

type GetTransactionLog added in v0.3.5

type GetTransactionLog struct {
	AccountType AccountType `url:",omitempty"`
	Category    Category    `url:",omitempty"`
	Currency    string      `url:",omitempty"`
	BaseCoin    string      `url:",omitempty"`
	Type        Type        `url:",omitempty"`
	StartTime   int         `url:",omitempty"`
	EndTime     int         `url:",omitempty"`
	Limit       int         `url:",omitempty"`
	Cursor      string      `url:",omitempty"`
}

Get Transaction Log https://bybit-exchange.github.io/docs/v5/account/transaction-log

accountType string  Account Type. UNIFIED
category    string  Product type. spot,linear,option
currency    string  Currency
baseCoin    string  BaseCoin. e.g., BTC of BTCPERP
type        string  Types of transaction logs
startTime   integer The start timestamp (ms)
endTime     integer The end timestamp (ms)
limit       integer Limit for data size per page. [1, 50]. Default: 20
cursor      string  Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set

func (GetTransactionLog) Do added in v0.3.5

type GetTransferableCoin

type GetTransferableCoin struct {
	FromAccountType AccountType
	ToAccountType   AccountType
}

Get Transferable Coin https://bybit-exchange.github.io/docs/v5/asset/transferable-coin

fromAccountType Required string From account type
toAccountType   Required string To account type

func (GetTransferableCoin) Do

type GetWallatBalance added in v0.2.12

type GetWallatBalance struct {
	AccountType AccountType
	Coin        string `url:",omitempty"`
}

Get Wallet Balance https://bybit-exchange.github.io/docs/v5/account/wallet-balance

accountType Required string Account type
coin                 string Coin name

func (GetWallatBalance) Do added in v0.2.12

type GreekShot added in v0.2.1

type GreekShot struct {
	BaseCoin   string
	TotalDelta ujson.StringFloat64
	TotalGamma ujson.StringFloat64
	TotalVega  ujson.StringFloat64
	TotalTheta ujson.StringFloat64
}

type HistoricalVolatility

type HistoricalVolatility struct {
	Period int
	Value  string
	Time   string
}

type Instrument

type Instrument struct {
	Symbol             string
	ContractType       ContractType
	Status             Status
	BaseCoin           string
	QuoteCoin          string
	LaunchTime         string
	DeliveryTime       string
	DeliveryFeeRate    string
	PriceScale         string
	LeverageFilter     LeverageFilter
	PriceFilter        PriceFilter
	LotSizeFilter      LotSizeFilter
	UnifiedMarginTrade bool
	FundingInterval    int
	SettleCoin         string
}

type InstrumentOption added in v0.2.4

type InstrumentOption struct {
	Symbol          string
	Status          Status
	BaseCoin        string
	QuoteCoin       string
	OptionsType     string
	LaunchTime      string
	DeliveryTime    string
	DeliveryFeeRate string
	PriceFilter     PriceFilter
	LotSizeFilter   LotSizeFilter
	SettleCoin      string
}

type InstrumentSpot added in v0.2.4

type InstrumentSpot struct {
	Symbol        string
	Status        Status
	BaseCoin      string
	QuoteCoin     string
	MarginTrading MarginTrading
	PriceFilter   PriceFilterSpot
	LotSizeFilter LotSizeFilterSpot
}

type Insurance

type Insurance struct {
	Coin    string
	Balance string
	Value   string
}

type Interval

type Interval string

interval (https://bybit-exchange.github.io/docs/v5/enum#interval)

1   - 1 minute
3   - 3 minutes
5   - 5 minutes
15  - 15 minutes
30  - 30 minutes
60  - 1 hour
120 - 2 hours
240 - 4 hours
360 - 6 hours
720 - 12 hours
D   - 1 day
W   - 1 week
M   - 1 month
const (
	Interval1m  Interval = "1"
	Interval3m  Interval = "3"
	Interval5m  Interval = "5"
	Interval15m Interval = "15"
	Interval30m Interval = "30"
	Interval1h  Interval = "60"
	Interval2h  Interval = "120"
	Interval4h  Interval = "240"
	Interval6h  Interval = "360"
	Interval12h Interval = "720"
	Interval1d  Interval = "D"
	Interval1w  Interval = "W"
	Interval1M  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 KeyInfo

type KeyInfo struct {
	Id            ujson.Float64
	Note          string
	ApiKey        string
	ReadOnly      ujson.Bool
	Secret        string
	Permissions   Permissions
	Ips           []string
	Type          int
	DeadlineDay   int
	CreatedAt     time.Time
	ExpiredAt     time.Time
	Unified       int
	Uta           int
	UserID        int
	InviterID     int
	VipLevel      string
	MktMakerLevel string
	AffiliateID   int
	RsaPublicKey  string
	IsMaster      bool
	ParentUid     string
	KycLevel      string
	KycRegion     string
}

type Kline

type Kline struct {
	StartTime  string
	OpenPrice  string
	HighPrice  string
	LowPrice   string
	ClosePrice string
}

func UnmarshalKline

func UnmarshalKline(s []string) (r Kline, err error)

type KlineExt

type KlineExt struct {
	Kline
	Volume   string
	Turnover string
}

func UnmarshalKlineExt

func UnmarshalKlineExt(s []string) (r KlineExt, err error)

type KlineShot added in v0.2.1

type KlineShot struct {
	Start     int64
	End       int64
	Interval  Interval
	Open      ujson.Float64
	Close     ujson.Float64
	High      ujson.Float64
	Low       ujson.Float64
	Volume    ujson.Float64
	Turnover  ujson.Float64
	Confirm   bool
	Timestamp int64
}

type LeverageFilter

type LeverageFilter struct {
	MinLeverage  ujson.Float64
	MaxLeverage  ujson.Float64
	LeverageStep ujson.Float64
}

type LiquidationShot added in v0.2.1

type LiquidationShot struct {
	Price       ujson.Float64
	Side        Side
	Size        ujson.Float64
	Symbol      string
	UpdatedTime int64
}

type LotSizeFilter

type LotSizeFilter struct {
	MaxOrderQty         ujson.Float64
	MaxMktOrderQty      ujson.Float64
	MinOrderQty         ujson.Float64
	QtyStep             ujson.Float64
	PostOnlyMaxOrderQty string
}

type LotSizeFilterSpot added in v0.2.4

type LotSizeFilterSpot struct {
	BasePrecision  ujson.Float64
	QuotePrecision ujson.Float64
	MaxOrderQty    ujson.Float64
	MinOrderQty    ujson.Float64
	MaxOrderAmt    ujson.Float64
	MinOrderAmt    ujson.Float64
}

type LtNavShot added in v0.2.1

type LtNavShot struct {
	Symbol         string
	Time           int64
	Nav            ujson.Float64
	BasketPosition ujson.Float64
	Leverage       ujson.Float64
	BasketLoan     ujson.Float64
	Circulation    ujson.Float64
	Basket         ujson.Float64
}

type LtTickerShot added in v0.2.1

type LtTickerShot struct {
	Symbol       string
	LastPrice    ujson.Float64
	HighPrice24h ujson.Float64
	LowPrice24h  ujson.Float64
	PrevPrice24h ujson.Float64
	Price24hPcnt ujson.Float64
}

type MarginTrading added in v0.2.4

type MarginTrading string

marginTrading https://bybit-exchange.github.io/docs/v5/enum#margintrading

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

type OnTransportError added in v0.3.1

type OnTransportError func(err error, statusCode int, attempt int) bool

type OpenInterest

type OpenInterest struct {
	OpenInterest string
	Timestamp    string
}

type Order added in v0.2.1

type Order struct {
	OrderId            string
	OrderLinkId        string
	BlockTradeId       string
	Symbol             string
	Price              ujson.Float64
	Qty                ujson.Float64
	Side               Side
	IsLeverage         string
	PositionIdx        PositionIdx
	OrderStatus        OrderStatus
	CancelType         CancelType
	RejectReason       RejectReason
	AvgPrice           ujson.Float64
	LeavesQty          ujson.Float64
	LeavesValue        string
	CumExecQty         ujson.Float64
	CumExecValue       ujson.Float64
	CumExecFee         ujson.Float64
	FeeCurrency        string
	TimeInForce        TimeInForce
	OrderType          OrderType
	StopOrderType      StopOrderType
	OrderIv            string
	TriggerPrice       ujson.StringFloat64
	TakeProfit         ujson.StringFloat64
	StopLoss           ujson.StringFloat64
	TpTriggerBy        TriggerBy
	SlTriggerBy        TriggerBy
	TriggerDirection   int
	TriggerBy          TriggerBy
	LastPriceOnCreated ujson.StringFloat64
	ReduceOnly         bool
	CloseOnTrigger     bool
	SmpType            SmpType
	SmpGroup           int
	SmpOrderId         string
	TpslMode           TpSlMode
	TpLimitPrice       ujson.StringFloat64
	SlLimitPrice       ujson.StringFloat64
	PlaceType          string
	CreatedTime        ujson.TimeMs
	UpdatedTime        ujson.TimeMs
}

func (Order) GetCumExecValue added in v0.2.14

func (o Order) GetCumExecValue() float64

type OrderId added in v0.2.1

type OrderId struct {
	OrderId     string
	OrderLinkId string
}

type OrderShot added in v0.2.1

type OrderShot struct {
	Category Category
	Order
}

type OrderStatus added in v0.2.1

type OrderStatus string

orderStatus https://bybit-exchange.github.io/docs/v5/enum#orderstatus

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

type OrderType

type OrderType string
const (
	Limit  OrderType = "Limit"
	Market OrderType = "Market"
)

type Orderbook

type Orderbook struct {
	Symbol    string            `json:"s"`
	Bid       [][]ujson.Float64 `json:"b"`
	Ask       [][]ujson.Float64 `json:"a"`
	Timestamp int               `json:"ts"`
	UpdateId  int               `json:"u"`
}

type Period

type Period int

period (https://bybit-exchange.github.io/docs/v5/enum#period)

const (
	Period7days   Period = 7
	Period14days  Period = 14
	Period21days  Period = 21
	Period30days  Period = 30
	Period60days  Period = 60
	Period90days  Period = 90
	Period180days Period = 180
	Period270days Period = 270
)

type Permissions

type Permissions struct {
	ContractTrade []string
	Spot          []string
	Wallet        []string
	Options       []string
	Derivatives   []string
	CopyTrading   []string
	BlockTrade    []string
	Exchange      []string
	NFT           []string
}

type PlaceOrder added in v0.2.1

type PlaceOrder struct {
	Category         Category
	Symbol           string
	Side             Side
	OrderType        OrderType
	Qty              ujson.StringFloat64 `json:",omitempty"`
	Price            ujson.Float64       `json:",omitempty"`
	IsLeverage       *int                `json:",omitempty"`
	TriggerDirection *int                `json:",omitempty"`
	OrderFilter      string              `json:",omitempty"`
	TriggerPrice     ujson.Float64       `json:",omitempty"`
	TriggerBy        TriggerBy           `json:",omitempty"`
	OrderIv          ujson.Float64       `json:",omitempty"`
	TimeInForce      TimeInForce         `json:",omitempty"`
	PositionIdx      *PositionIdx        `json:",omitempty"`
	OrderLinkId      string              `json:",omitempty"`
	TakeProfit       ujson.Float64       `json:",omitempty"`
	StopLoss         ujson.Float64       `json:",omitempty"`
	TpTriggerBy      TriggerBy           `json:",omitempty"`
	SlTriggerBy      TriggerBy           `json:",omitempty"`
	ReduceOnly       *bool               `json:",omitempty"`
	CloseOnTrigger   *bool               `json:",omitempty"`
	SmpType          SmpType             `json:",omitempty"`
	Mmp              *bool               `json:",omitempty"`
	TpslMode         TpSlMode            `json:",omitempty"`
	TpLimitPrice     ujson.Float64       `json:",omitempty"`
	SlLimitPrice     ujson.Float64       `json:",omitempty"`
	TpOrderType      OrderType           `json:",omitempty"`
	SlOrderType      OrderType           `json:",omitempty"`
}

Place Order https://bybit-exchange.github.io/docs/v5/order/create-order

func (PlaceOrder) Do added in v0.2.1

func (o PlaceOrder) Do(c *Client) Response[OrderId]

type Position added in v0.2.1

type Position struct {
	PositionIdx      PositionIdx
	RiskId           int
	RiskLimitValue   ujson.Int64
	Symbol           string
	Side             Side
	Size             ujson.Float64
	AvgPrice         ujson.Float64
	PositionValue    ujson.Float64
	TradeMode        TradeMode
	PositionStatus   PositionStatus
	AutoAddMargin    ujson.Bool
	AdlRankIndicator int
	Leverage         ujson.Float64
	PositionBalance  ujson.Float64
	MarkPrice        ujson.Float64
	LiqPrice         ujson.Float64
	BustPrice        ujson.Float64
	PositionMm       ujson.Float64
	PositionIm       ujson.Float64
	TpslMode         TpSlMode
	TakeProfit       ujson.Float64
	StopLoss         ujson.Float64
	TrailingStop     ujson.Float64
	UnrealisedPnl    ujson.Float64
	CumRealisedPnl   ujson.Float64
	CreatedTime      ujson.TimeMs
	UpdatedTime      ujson.TimeMs
}

type PositionIdx

type PositionIdx int

positionIdx (https://bybit-exchange.github.io/docs/v5/enum#positionidx)

const (
	OneWayMode          PositionIdx = 0
	BuySideOfHedgeMode  PositionIdx = 1
	SellSideOfHedgeMode PositionIdx = 2
)

type PositionShot added in v0.2.1

type PositionShot struct {
	Position
	Category   Category
	EntryPrice ujson.Float64
}

type PositionStatus added in v0.2.1

type PositionStatus string

positionStatus https://bybit-exchange.github.io/docs/v5/enum#positionstatus

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

type PriceFilter

type PriceFilter struct {
	MaxPrice ujson.Float64
	MinPrice ujson.Float64
	TickSize ujson.Float64
}

type PriceFilterSpot added in v0.2.4

type PriceFilterSpot struct {
	TickSize ujson.Float64
}

type PrivateHeader added in v0.2.1

type PrivateHeader struct {
	CreationTime int64
	Id           string
}

type PublicHeader added in v0.2.1

type PublicHeader struct {
	Ts   int64
	Type string
}

func (PublicHeader) IsDelta added in v0.2.1

func (o PublicHeader) IsDelta() bool

type PublicTradingHistory

type PublicTradingHistory struct {
	ExecId       string
	Symbol       string
	Price        string
	Size         string
	Side         string
	Time         string
	IsBlockTrade bool
}

type RateLimit

type RateLimit struct {
	Limit          int   `http:"X-Bapi-Limit"`
	Status         int   `http:"X-Bapi-Limit-Status"`
	ResetTimestamp int64 `http:"X-Bapi-Limit-Reset-Timestamp"`
}

type RawTopic added in v0.2.1

type RawTopic Topic[json.RawMessage]

type RejectReason added in v0.2.1

type RejectReason string

rejectReason https://bybit-exchange.github.io/docs/v5/enum#rejectreason

const (
	RejectNoError                      RejectReason = "EC_NoError"
	RejectOthers                       RejectReason = "EC_Others"
	RejectUnknownMessageType           RejectReason = "EC_UnknownMessageType"
	RejectMissingClOrdID               RejectReason = "EC_MissingClOrdID"
	RejectMissingOrigClOrdID           RejectReason = "EC_MissingOrigClOrdID"
	RejectClOrdIDOrigClOrdIDAreTheSame RejectReason = "EC_ClOrdIDOrigClOrdIDAreTheSame"
	RejectDuplicatedClOrdID            RejectReason = "EC_DuplicatedClOrdID"
	RejectOrigClOrdIDDoesNotExist      RejectReason = "EC_OrigClOrdIDDoesNotExist"
	RejectTooLateToCancel              RejectReason = "EC_TooLateToCancel"
	RejectUnknownOrderType             RejectReason = "EC_UnknownOrderType"
	RejectUnknownSide                  RejectReason = "EC_UnknownSide"
	RejectUnknownTimeInForce           RejectReason = "EC_UnknownTimeInForce"
	RejectWronglyRouted                RejectReason = "EC_WronglyRouted"
	RejectMarketOrderPriceIsNotZero    RejectReason = "EC_MarketOrderPriceIsNotZero"
	RejectLimitOrderInvalidPrice       RejectReason = "EC_LimitOrderInvalidPrice"
	RejectNoEnoughQtyToFill            RejectReason = "EC_NoEnoughQtyToFill"
	RejectNoImmediateQtyToFill         RejectReason = "EC_NoImmediateQtyToFill"
	RejectPerCancelRequest             RejectReason = "EC_PerCancelRequest"
	RejectMarketOrderCannotBePostOnly  RejectReason = "EC_MarketOrderCannotBePostOnly"
	RejectPostOnlyWillTakeLiquidity    RejectReason = "EC_PostOnlyWillTakeLiquidity"
	RejectCancelReplaceOrder           RejectReason = "EC_CancelReplaceOrder"
	RejectInvalidSymbolStatus          RejectReason = "EC_InvalidSymbolStatus"
)

type Response

type Response[T any] struct {
	Time       uint64
	Data       T
	Limit      RateLimit
	Error      error
	StatusCode int
}

func Get

func Get[R, T any](c *Client, path string, req any, transform func(R) (T, error)) Response[T]

func GetPub

func GetPub[R, T any](c *Client, path string, req any, transform func(R) (T, error)) Response[T]

func Post

func Post[R, T any](c *Client, path string, req any, transform func(R) (T, error)) Response[T]

func (*Response[T]) Ok

func (o *Response[T]) Ok() bool

func (*Response[T]) SetErrorIfNil

func (o *Response[T]) SetErrorIfNil(err error)

type RiskLimit

type RiskLimit struct {
	Id                int
	Symbol            string
	RiskLimitValue    string
	MaintenanceMargin string
	InitialMargin     string
	IsLowestRisk      int
	MaxLeverage       string
}

type ServerTime added in v0.2.22

type ServerTime struct {
	TimeSecond string
	TimeNano   string
}

type Settlement

type Settlement struct {
	RealisedPnl     string
	Symbol          string
	Side            string
	MarkPrice       string
	Size            string
	CreatedTime     string
	SessionAvgPrice string
}

type Side

type Side string
const (
	Buy  Side = "Buy"
	Sell Side = "Sell"
)

type Sign

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

func NewSign

func NewSign(key, secret string) *Sign

func (*Sign) HeaderGet

func (o *Sign) HeaderGet(h http.Header, v url.Values)

func (*Sign) HeaderPost

func (o *Sign) HeaderPost(h http.Header, body []byte)

func (*Sign) Params

func (o *Sign) Params(v url.Values)

func (*Sign) WebSocket added in v0.2.1

func (o *Sign) WebSocket() []string

type SingleCoinBalance

type SingleCoinBalance struct {
	AccountType AccountType
	MemberId    string
	BizType     int
	AccountId   string
	Balance     CoinBalanceExt
}

type SmpType

type SmpType string

smpType (https://bybit-exchange.github.io/docs/v5/enum#smptype)

const (
	SmpTypeNone SmpType = "None"
	CancelMaker SmpType = "CancelMaker"
	CancelTaker SmpType = "CancelTaker"
	CancelBoth  SmpType = "CancelBoth"
)

type SpotAssetInfo

type SpotAssetInfo struct {
	Status string
	Assets []AssetInfo
}

type Status

type Status string

status (https://bybit-exchange.github.io/docs/v5/enum#status)

const (
	StatusPreLaunch  Status = "PreLaunch"
	StatusTrading    Status = "Trading"
	StatusSettling   Status = "Settling"
	StatusDelivering Status = "Delivering"
	StatusClosed     Status = "Closed"
)

type StopOrderType added in v0.2.1

type StopOrderType string

stopOrderType https://bybit-exchange.github.io/docs/v5/enum#stopordertype

const (
	StopOrderTakeProfit        StopOrderType = "TakeProfit"
	StopOrderStopLoss          StopOrderType = "StopLoss"
	StopOrderTrailingStop      StopOrderType = "TrailingStop"
	StopOrderStop              StopOrderType = "Stop"
	StopOrderPartialTakeProfit StopOrderType = "PartialTakeProfit"
	StopOrderPartialStopLoss   StopOrderType = "PartialStopLoss"
	StopOrderTpslOrder         StopOrderType = "TpslOrder"
)

type SubscriptionClient added in v0.2.1

type SubscriptionClient interface {
	Ready() bool
	// contains filtered or unexported methods
}

type SubscriptionFunc added in v0.2.1

type SubscriptionFunc func(RawTopic) error

type SubscriptionFuncs added in v0.2.1

type SubscriptionFuncs map[string]SubscriptionFunc

type Subscriptions added in v0.2.1

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

func NewSubscriptions added in v0.2.1

func NewSubscriptions(c SubscriptionClient) *Subscriptions

type TickDirection added in v0.2.1

type TickDirection string

tickDirection https://bybit-exchange.github.io/docs/v5/enum#tickdirection

const (
	TickPlus      TickDirection = "PlusTick"
	TickZeroPlus  TickDirection = "ZeroPlusTick"
	TickMinus     TickDirection = "MinusTick"
	TickZeroMinus TickDirection = "ZeroMinusTick"
)

type Ticker

type Ticker struct {
	Symbol                 string
	LastPrice              ujson.Float64
	IndexPrice             ujson.Float64
	MarkPrice              ujson.Float64
	PrevPrice24h           ujson.Float64
	Price24hPcnt           ujson.Float64
	HighPrice24h           ujson.Float64
	LowPrice24h            ujson.Float64
	PrevPrice1h            ujson.Float64
	OpenInterest           ujson.Float64
	OpenInterestValue      ujson.Float64
	Turnover24h            ujson.Float64
	Volume24h              ujson.Float64
	FundingRate            ujson.Float64
	NextFundingTime        string
	PredictedDeliveryPrice ujson.StringFloat64
	BasisRate              ujson.StringFloat64
	DeliveryFeeRate        ujson.StringFloat64
	DeliveryTime           string
	Ask1Size               ujson.Float64
	Bid1Price              ujson.Float64
	Ask1Price              ujson.Float64
	Bid1Size               ujson.Float64
	Basis                  string
}

type TickerOption added in v0.2.7

type TickerOption struct {
	Symbol                 string
	Bid1Price              ujson.Float64
	Bid1Size               ujson.Float64
	Bid1Iv                 ujson.Float64
	Ask1Price              ujson.Float64
	Ask1Size               ujson.Float64
	Ask1Iv                 ujson.Float64
	LastPrice              ujson.Float64
	HighPrice24H           ujson.Float64
	LowPrice24H            ujson.Float64
	MarkPrice              ujson.Float64
	IndexPrice             ujson.Float64
	MarkIv                 ujson.Float64
	UnderlyingPrice        ujson.Float64
	OpenInterest           ujson.Float64
	Turnover24H            ujson.Float64
	Volume24H              ujson.Float64
	TotalVolume            ujson.Float64
	TotalTurnover          ujson.Float64
	Delta                  ujson.Float64
	Gamma                  ujson.Float64
	Vega                   ujson.Float64
	Theta                  ujson.Float64
	PredictedDeliveryPrice ujson.Float64
	Change24H              ujson.Float64
}

type TickerOptionShot added in v0.2.11

type TickerOptionShot struct {
	Symbol                 string
	BidPrice               ujson.Float64
	BidSize                ujson.Float64
	BidIv                  ujson.Float64
	AskPrice               ujson.Float64
	AskSize                ujson.Float64
	AskIv                  ujson.Float64
	LastPrice              ujson.Float64
	HighPrice24H           ujson.Float64
	LowPrice24H            ujson.Float64
	MarkPrice              ujson.Float64
	IndexPrice             ujson.Float64
	MarkPriceIv            ujson.Float64
	UnderlyingPrice        ujson.Float64
	OpenInterest           ujson.Float64
	Turnover24H            ujson.Float64
	Volume24H              ujson.Float64
	TotalVolume            ujson.Float64
	TotalTurnover          ujson.Float64
	Delta                  ujson.Float64
	Gamma                  ujson.Float64
	Vega                   ujson.Float64
	Theta                  ujson.Float64
	PredictedDeliveryPrice ujson.Float64
	Change24H              ujson.Float64
}

type TickerShot added in v0.2.11

type TickerShot struct {
	Symbol            string
	TickDirection     TickDirection
	Price24HPcnt      ujson.Float64
	LastPrice         ujson.Float64
	PrevPrice24H      ujson.Float64
	HighPrice24H      ujson.Float64
	LowPrice24H       ujson.Float64
	PrevPrice1H       ujson.Float64
	MarkPrice         ujson.Float64
	IndexPrice        ujson.Float64
	OpenInterest      ujson.Float64
	OpenInterestValue ujson.Float64
	Turnover24H       ujson.Float64
	Volume24H         ujson.Float64
	NextFundingTime   ujson.Float64
	FundingRate       ujson.Float64
	Bid1Price         ujson.Float64
	Bid1Size          ujson.Float64
	Ask1Price         ujson.Float64
	Ask1Size          ujson.Float64
}

type TickerSpot added in v0.2.7

type TickerSpot struct {
	Symbol        string
	Bid1Price     ujson.Float64
	Bid1Size      ujson.Float64
	Ask1Price     ujson.Float64
	Ask1Size      ujson.Float64
	LastPrice     ujson.Float64
	PrevPrice24H  ujson.Float64
	Price24HPcnt  ujson.Float64
	HighPrice24H  ujson.Float64
	LowPrice24H   ujson.Float64
	Turnover24H   ujson.Float64
	Volume24H     ujson.Float64
	UsdIndexPrice ujson.Float64
}

type TickerSpotShot added in v0.2.11

type TickerSpotShot struct {
	Symbol        string
	LastPrice     ujson.Float64
	HighPrice24H  ujson.Float64
	LowPrice24H   ujson.Float64
	PrevPrice24H  ujson.Float64
	Volume24H     ujson.Float64
	Turnover24H   ujson.Float64
	Price24HPcnt  ujson.Float64
	UsdIndexPrice ujson.Float64
}

type TimeInForce

type TimeInForce string

timeInForce (https://bybit-exchange.github.io/docs/v5/enum#timeinforce)

const (
	GoodTillCancel    TimeInForce = "GTC"
	ImmediateOrCancel TimeInForce = "IOC"
	FillOrKill        TimeInForce = "FOK"
)

type Topic added in v0.2.1

type Topic[T any] struct {
	Topic string
	PublicHeader
	PrivateHeader
	Data T
}

func UnmarshalRawTopic added in v0.2.1

func UnmarshalRawTopic[T any](raw RawTopic) (ret Topic[T], err error)

type TpSlMode added in v0.2.1

type TpSlMode string
const (
	TpSlModeFull    TpSlMode = "Full"
	TpSlModePartial TpSlMode = "Partial"
)

type TradeMode added in v0.2.1

type TradeMode int
const (
	TradeCrossMargin    TradeMode = 0
	TradeIsolatedMargin TradeMode = 1
)

type TradeShot added in v0.2.1

type TradeShot struct {
	Timestamp     int64         `json:"ts"`
	Symbol        string        `json:"s"`
	Side          Side          `json:"S"`
	Size          ujson.Float64 `json:"v"`
	Price         ujson.Float64 `json:"p"`
	TickDirection TickDirection `json:"L"` // Unique field for future
	Id            string        `json:"i"`
	Block         bool          `json:"BT"`
}

type TransactionLog added in v0.3.5

type TransactionLog struct {
	Symbol          string
	Side            Side
	Funding         ujson.Float64
	OrderLinkId     string
	OrderId         string
	Fee             ujson.Float64
	Change          ujson.Float64
	CashFlow        ujson.Float64
	TransactionTime string
	Type            Type
	FeeRate         ujson.Float64
	BonusChange     ujson.Float64
	Size            ujson.Float64
	Qty             ujson.Float64
	CashBalance     ujson.Float64
	Currency        string
	Category        Category
	TradePrice      ujson.Float64
	TradeId         string
}

type TriggerBy

type TriggerBy string

triggerBy (https://bybit-exchange.github.io/docs/v5/enum#triggerby)

const (
	TriggerByLastPrice  TriggerBy = "LastPrice"
	TriggerByIndexPrice TriggerBy = "IndexPrice"
	TriggerByMarkPrice  TriggerBy = "MarkPrice"
)

type Type added in v0.3.5

type Type string
const (
	TypeTransferIn                    Type = "TRANSFER_IN"
	TypeTransferOut                   Type = "TRANSFER_OUT"
	TypeTrade                         Type = "TRADE"
	TypeSettlement                    Type = "SETTLEMENT"
	TypeDelivery                      Type = "DELIVERY"
	TypeLiquidation                   Type = "LIQUIDATION"
	TypeBonus                         Type = "BONUS"
	TypeFeeRefund                     Type = "FEE_REFUND"
	TypeInterest                      Type = "INTEREST"
	TypeCurrencyBuy                   Type = "CURRENCY_BUY"
	TypeCurrencySell                  Type = "CURRENCY_SELL"
	TypeBorrowedAmountInsLoan         Type = "BORROWED_AMOUNT_INS_LOAN"
	TypePrincipleRepaymentInsLoan     Type = "PRINCIPLE_REPAYMENT_INS_LOAN"
	TypeInterestRepaymentInsLoan      Type = "INTEREST_REPAYMENT_INS_LOAN"
	TypeAutoSoldCollateralInsLoan     Type = "AUTO_SOLD_COLLATERAL_INS_LOAN"
	TypeAutoBuyLiabilityInsLoan       Type = "AUTO_BUY_LIABILITY_INS_LOAN"
	TypeAutoPrincipleRepaymentInsLoan Type = "AUTO_PRINCIPLE_REPAYMENT_INS_LOAN"
	TypeAutoInterestRepaymentInsLoan  Type = "AUTO_INTEREST_REPAYMENT_INS_LOAN"
)

type WalletBalance added in v0.2.12

type WalletBalance struct {
	AccountType            AccountType
	TotalEquity            ujson.Float64
	AccountImRate          ujson.Float64
	TotalMarginBalance     ujson.Float64
	TotalInitialMargin     ujson.Float64
	TotalAvailableBalance  ujson.Float64
	AccountMmRate          ujson.Float64
	TotalPerpUpl           ujson.Float64
	TotalWalletBalance     ujson.Float64
	AccountLtv             ujson.Float64
	TotalMaintenanceMargin ujson.Float64
	Coin                   []WalletCoinBalance
}

type WalletCoin added in v0.2.1

type WalletCoin struct {
	Coin                string
	Equity              ujson.StringFloat64
	UsdValue            ujson.StringFloat64
	WalletBalance       ujson.StringFloat64
	Free                ujson.StringFloat64
	Locked              ujson.StringFloat64
	AvailableToWithdraw ujson.StringFloat64
	AvailableToBorrow   ujson.StringFloat64
	BorrowAmount        ujson.StringFloat64
	AccruedInterest     ujson.StringFloat64
	TotalOrderIm        ujson.StringFloat64
	TotalPositionIm     ujson.StringFloat64
	TotalPositionMm     ujson.StringFloat64
	UnrealisedPnl       ujson.StringFloat64
	CumRealisedPnl      ujson.StringFloat64
	Bonus               ujson.StringFloat64
}

type WalletCoinBalance added in v0.2.12

type WalletCoinBalance struct {
	Coin                string
	AvailableToBorrow   ujson.Float64
	Bonus               ujson.Float64
	AccruedInterest     ujson.Float64
	AvailableToWithdraw ujson.Float64
	TotalOrderIm        ujson.Float64
	Equity              ujson.Float64
	TotalPositionMm     ujson.Float64
	UsdValue            ujson.Float64
	UnrealisedPnl       ujson.Float64
	BorrowAmount        ujson.Float64
	TotalPositionIm     ujson.Float64
	WalletBalance       ujson.Float64
	CumRealisedPnl      ujson.Float64
	Free                ujson.Float64
	Locked              ujson.Float64
}

type WalletShot added in v0.2.1

type WalletShot struct {
	AccountType            AccountType
	AccountLTV             ujson.StringFloat64
	AccountIMRate          ujson.StringFloat64
	AccountMMRate          ujson.StringFloat64
	TotalEquity            ujson.StringFloat64
	TotalWalletBalance     ujson.StringFloat64
	TotalMarginBalance     ujson.StringFloat64
	TotalAvailableBalance  ujson.StringFloat64
	TotalPerpUPL           ujson.StringFloat64
	TotalInitialMargin     ujson.StringFloat64
	TotalMaintenanceMargin ujson.StringFloat64
	Coin                   []WalletCoin
}

type WsClient added in v0.2.1

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

func NewWsClient added in v0.2.1

func NewWsClient() *WsClient

func (*WsClient) Close added in v0.2.1

func (o *WsClient) Close()

func (*WsClient) Connected added in v0.2.1

func (o *WsClient) Connected() bool

func (*WsClient) Log added in v0.2.1

func (o *WsClient) Log() *ulog.Log

func (*WsClient) Run added in v0.2.1

func (o *WsClient) Run()

func (*WsClient) Send added in v0.2.1

func (o *WsClient) Send(r WsRequest)

func (*WsClient) Subscribe added in v0.2.1

func (o *WsClient) Subscribe(s string)

func (*WsClient) SubscribeBatch added in v0.2.1

func (o *WsClient) SubscribeBatch(l []string)

func (*WsClient) Transport added in v0.2.1

func (o *WsClient) Transport() *uws.Options

func (*WsClient) Unsubscribe added in v0.2.1

func (o *WsClient) Unsubscribe(s string)

func (*WsClient) UnsubscribeBatch added in v0.2.1

func (o *WsClient) UnsubscribeBatch(l []string)

func (*WsClient) WithBaseUrl added in v0.2.1

func (o *WsClient) WithBaseUrl(url string) *WsClient

func (*WsClient) WithByTickUrl added in v0.2.1

func (o *WsClient) WithByTickUrl() *WsClient

func (*WsClient) WithLog added in v0.2.1

func (o *WsClient) WithLog(log *ulog.Log) *WsClient

func (*WsClient) WithLogRequest added in v0.2.1

func (o *WsClient) WithLogRequest(enable bool) *WsClient

func (*WsClient) WithLogResponse added in v0.2.1

func (o *WsClient) WithLogResponse(enable bool) *WsClient

func (*WsClient) WithOnConnected added in v0.2.1

func (o *WsClient) WithOnConnected(f func()) *WsClient

func (*WsClient) WithOnDialError added in v0.2.8

func (o *WsClient) WithOnDialError(f func(error) bool) *WsClient

func (*WsClient) WithOnDisconnected added in v0.2.1

func (o *WsClient) WithOnDisconnected(f func()) *WsClient

func (*WsClient) WithOnResponse added in v0.2.1

func (o *WsClient) WithOnResponse(f func(WsResponse) error) *WsClient

func (*WsClient) WithOnTopic added in v0.2.1

func (o *WsClient) WithOnTopic(f func([]byte) error) *WsClient

func (*WsClient) WithPath added in v0.2.1

func (o *WsClient) WithPath(path string) *WsClient

func (*WsClient) WithProxy added in v0.2.1

func (o *WsClient) WithProxy(proxy string) *WsClient

type WsPrivate added in v0.2.1

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

func NewWsPrivate added in v0.2.1

func NewWsPrivate(key, secret string) *WsPrivate

func (*WsPrivate) Close added in v0.2.1

func (o *WsPrivate) Close()

func (*WsPrivate) Connected added in v0.2.1

func (o *WsPrivate) Connected() bool

func (*WsPrivate) Execution added in v0.2.1

func (o *WsPrivate) Execution() *Executor[[]ExecutionShot]

func (*WsPrivate) Greek added in v0.2.1

func (o *WsPrivate) Greek() *Executor[[]GreekShot]

func (*WsPrivate) Order added in v0.2.1

func (o *WsPrivate) Order() *Executor[[]OrderShot]

func (*WsPrivate) Position added in v0.2.1

func (o *WsPrivate) Position() *Executor[[]PositionShot]

func (*WsPrivate) Ready added in v0.2.1

func (o *WsPrivate) Ready() bool

func (*WsPrivate) Run added in v0.2.1

func (o *WsPrivate) Run()

func (*WsPrivate) Transport added in v0.2.1

func (o *WsPrivate) Transport() *uws.Options

func (*WsPrivate) Wallet added in v0.2.1

func (o *WsPrivate) Wallet() *Executor[[]WalletShot]

func (*WsPrivate) WithBaseUrl added in v0.2.1

func (o *WsPrivate) WithBaseUrl(url string) *WsPrivate

func (*WsPrivate) WithByTickUrl added in v0.2.1

func (o *WsPrivate) WithByTickUrl() *WsPrivate

func (*WsPrivate) WithLog added in v0.2.1

func (o *WsPrivate) WithLog(log *ulog.Log) *WsPrivate

func (*WsPrivate) WithLogRequest added in v0.2.1

func (o *WsPrivate) WithLogRequest(enable bool) *WsPrivate

func (*WsPrivate) WithLogResponse added in v0.2.1

func (o *WsPrivate) WithLogResponse(enable bool) *WsPrivate

func (*WsPrivate) WithOnConnected added in v0.2.1

func (o *WsPrivate) WithOnConnected(f func()) *WsPrivate

func (*WsPrivate) WithOnDialError added in v0.2.8

func (o *WsPrivate) WithOnDialError(f func(error) bool) *WsPrivate

func (*WsPrivate) WithOnDisconnected added in v0.2.1

func (o *WsPrivate) WithOnDisconnected(f func()) *WsPrivate

func (*WsPrivate) WithOnReady added in v0.2.1

func (o *WsPrivate) WithOnReady(f func()) *WsPrivate

func (*WsPrivate) WithProxy added in v0.2.1

func (o *WsPrivate) WithProxy(proxy string) *WsPrivate

type WsPublic added in v0.2.1

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

func NewWsPublic added in v0.2.1

func NewWsPublic() *WsPublic

func (*WsPublic) Close added in v0.2.1

func (o *WsPublic) Close()

func (*WsPublic) Connected added in v0.2.1

func (o *WsPublic) Connected() bool

func (*WsPublic) Inverse added in v0.2.1

func (o *WsPublic) Inverse() *WsPublic

func (*WsPublic) Kline added in v0.2.1

func (o *WsPublic) Kline(symbol string, interval Interval) *Executor[[]KlineShot]

func (*WsPublic) Linear added in v0.2.1

func (o *WsPublic) Linear() *WsPublic

func (*WsPublic) Liquidation added in v0.2.1

func (o *WsPublic) Liquidation(symbol string) *Executor[LiquidationShot]

func (*WsPublic) LtKline added in v0.2.1

func (o *WsPublic) LtKline(symbol string, interval Interval) *Executor[[]KlineShot]

func (*WsPublic) LtNav added in v0.2.1

func (o *WsPublic) LtNav(symbol string) *Executor[LtNavShot]

func (*WsPublic) LtTicker added in v0.2.1

func (o *WsPublic) LtTicker(symbol string) *Executor[LtTickerShot]

func (*WsPublic) Option added in v0.2.1

func (o *WsPublic) Option() *WsPublic

func (*WsPublic) OrderBook added in v0.2.1

func (o *WsPublic) OrderBook(symbol string, depth int) *Executor[Orderbook]

func (*WsPublic) Ready added in v0.2.1

func (o *WsPublic) Ready() bool

func (*WsPublic) Run added in v0.2.1

func (o *WsPublic) Run()

func (*WsPublic) Spot added in v0.2.1

func (o *WsPublic) Spot() *WsPublic

func (*WsPublic) Ticker added in v0.2.1

func (o *WsPublic) Ticker(symbol string) *Executor[TickerShot]

func (*WsPublic) TickerOption added in v0.2.11

func (o *WsPublic) TickerOption(symbol string) *Executor[TickerOptionShot]

func (*WsPublic) TickerSpot added in v0.2.11

func (o *WsPublic) TickerSpot(symbol string) *Executor[TickerSpotShot]

func (*WsPublic) Trade added in v0.2.1

func (o *WsPublic) Trade(symbol string) *Executor[[]TradeShot]

func (*WsPublic) Transport added in v0.2.1

func (o *WsPublic) Transport() *uws.Options

func (*WsPublic) WithBaseUrl added in v0.2.1

func (o *WsPublic) WithBaseUrl(url string) *WsPublic

func (*WsPublic) WithByTickUrl added in v0.2.1

func (o *WsPublic) WithByTickUrl() *WsPublic

func (*WsPublic) WithCategory added in v0.2.1

func (o *WsPublic) WithCategory(category Category) *WsPublic

func (*WsPublic) WithLog added in v0.2.1

func (o *WsPublic) WithLog(log *ulog.Log) *WsPublic

func (*WsPublic) WithLogRequest added in v0.2.1

func (o *WsPublic) WithLogRequest(enable bool) *WsPublic

func (*WsPublic) WithLogResponse added in v0.2.1

func (o *WsPublic) WithLogResponse(enable bool) *WsPublic

func (*WsPublic) WithOnConnected added in v0.2.1

func (o *WsPublic) WithOnConnected(f func()) *WsPublic

func (*WsPublic) WithOnDialError added in v0.2.8

func (o *WsPublic) WithOnDialError(f func(error) bool) *WsPublic

func (*WsPublic) WithOnDisconnected added in v0.2.1

func (o *WsPublic) WithOnDisconnected(f func()) *WsPublic

func (*WsPublic) WithProxy added in v0.2.1

func (o *WsPublic) WithProxy(proxy string) *WsPublic

type WsRequest added in v0.2.1

type WsRequest struct {
	RequestId string   `json:"req_id,omitempty"`
	Operation string   `json:"op"`
	Args      []string `json:",omitempty"`
}

type WsResponse added in v0.2.1

type WsResponse struct {
	Operation    string `json:"op"`
	ConnectionId string `json:"conn_id"`
	Success      bool
	Message      string `json:"ret_msg"`
	Args         []string
}

func (WsResponse) Log added in v0.2.1

func (o WsResponse) Log(log *ulog.Log)

func (WsResponse) Valid added in v0.2.1

func (o WsResponse) Valid() bool

Jump to

Keyboard shortcuts

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