Documentation ¶
Overview ¶
Enums Definitions (https://bybit-exchange.github.io/docs/v5/enum)
Index ¶
- Constants
- type AccountInfo
- type AccountType
- type AmendOrder
- type AssetInfo
- type CancelAllOrders
- type CancelOrder
- type CancelType
- type Category
- type Client
- func (o *Client) AmendOrder(v AmendOrder) Response[OrderId]
- func (o *Client) CancelAllOrders(v CancelAllOrders) Response[OrderId]
- func (o *Client) CancelAllOrdersSpot(v CancelAllOrders) Response[bool]
- func (o *Client) CancelOrder(v CancelOrder) Response[OrderId]
- func (o *Client) Copy() *Client
- func (o *Client) CreateInternalTransfer(v CreateInternalTransfer) Response[uuid.UUID]
- func (o *Client) GetAccountCoinsBalance(accountType AccountType) Response[CoinsBalance]
- func (o *Client) GetAccountInfo() Response[AccountInfo]
- func (o *Client) GetAccountWallatBalance(accountType AccountType) Response[[]WalletBalance]
- func (o *Client) GetAssetInfo(v GetAssetInfo) Response[SpotAssetInfo]
- func (o *Client) GetCoinBalance(v GetCoinBalance) Response[SingleCoinBalance]
- func (o *Client) GetCoinRecords(v GetCoinRecords) Response[[]CoinRecord]
- func (o *Client) GetCoinsBalance(v GetCoinsBalance) Response[CoinsBalance]
- func (o *Client) GetDeliveryPrice(v GetDeliveryPrice) Response[[]DeliveryPrice]
- func (o *Client) GetDeliveryRecords(v GetDeliveryRecords) Response[[]DeliveryRecord]
- func (o *Client) GetFundingRateHistory(v GetFundingRateHistory) Response[[]FundingRateHistory]
- func (o *Client) GetHistoricalVolatility(v GetHistoricalVolatility) Response[[]HistoricalVolatility]
- func (o *Client) GetIndexPriceKline(v GetKline) Response[[]Kline]
- func (o *Client) GetInstruments(v GetInstruments) Response[[]Instrument]
- func (o *Client) GetInstrumentsOption(v GetInstruments) Response[[]InstrumentOption]
- func (o *Client) GetInstrumentsSpot(v GetInstruments) Response[[]InstrumentSpot]
- func (o *Client) GetInsurance(v GetInsurance) Response[[]Insurance]
- func (o *Client) GetKeyInfo() Response[KeyInfo]
- func (o *Client) GetKline(v GetKline) Response[[]KlineExt]
- func (o *Client) GetMarkPriceKline(v GetKline) Response[[]Kline]
- func (o *Client) GetOpenInterest(v GetOpenInterest) Response[[]OpenInterest]
- func (o *Client) GetOpenOrders(v GetOpenOrders) Response[[]Order]
- func (o *Client) GetOrderHistory(v GetOrderHistory) Response[[]Order]
- func (o *Client) GetOrderbook(v GetOrderbook) Response[Orderbook]
- func (o *Client) GetPositions(v GetPositions) Response[[]Position]
- func (o *Client) GetPremiumIndexPriceKline(v GetKline) Response[[]Kline]
- func (o *Client) GetPublicTradingHistory(v GetPublicTradingHistory) Response[[]PublicTradingHistory]
- func (o *Client) GetRiskLimit(v GetRiskLimit) Response[[]RiskLimit]
- func (o *Client) GetServerTime() Response[ServerTime]
- func (o *Client) GetSettlement(v GetSettlement) Response[[]Settlement]
- func (o *Client) GetTickers(v GetTickers) Response[[]Ticker]
- func (o *Client) GetTickersOption(v GetTickersOption) Response[[]TickerOption]
- func (o *Client) GetTickersSpot(v GetTickers) Response[[]TickerSpot]
- func (o *Client) GetTransactionLog(v GetTransactionLog) Response[[]TransactionLog]
- func (o *Client) GetTransferableCoin(v GetTransferableCoin) Response[[]string]
- func (o *Client) GetWallatBalance(v GetWallatBalance) Response[[]WalletBalance]
- func (o *Client) PlaceOrder(v PlaceOrder) Response[OrderId]
- func (o *Client) WithAppendPath(path string) *Client
- func (o *Client) WithAuth(key, secret string) *Client
- func (o *Client) WithBaseUrl(url string) *Client
- func (o *Client) WithByTickUrl() *Client
- func (o *Client) WithOnReadBodyError(f uhttp.OnError) *Client
- func (o *Client) WithOnTransportError(f OnTransportError) *Client
- func (o *Client) WithPath(path string) *Client
- func (o *Client) WithProxy(proxy string) *Client
- func (o *Client) WithReferer(referer string) *Client
- func (o *Client) WithTimeout(timeout time.Duration) *Client
- func (o *Client) WithTrace(trace func(uhttp.Responce)) *Client
- func (o *Client) WithTransport(transport *http.Transport) *Client
- type CoinBalance
- type CoinBalanceExt
- type CoinRecord
- type CoinsBalance
- type ContractType
- type CreateInternalTransfer
- type DeliveryPrice
- type DeliveryRecord
- type Error
- func (o *Error) ApiKeyExpired() bool
- func (o *Error) ApiKeyInvalid() bool
- func (o *Error) Empty() bool
- func (o *Error) Error() string
- func (o *Error) InsufficientBalance() bool
- func (o *Error) KycNeeded() bool
- func (o *Error) OrderLinkedIdIsDuplicate() bool
- func (o *Error) RequestParameterError() bool
- func (o *Error) Std() error
- func (o *Error) SymbolIsNotWhitelisted() bool
- func (o *Error) Timeout() bool
- func (o *Error) TooManyVisits() bool
- func (o *Error) UnmatchedIp() bool
- type ExecType
- type ExecutionShot
- type Executor
- type FundingRateHistory
- type GetAccountInfo
- type GetAssetInfo
- type GetCoinBalance
- type GetCoinRecords
- type GetCoinsBalance
- type GetDeliveryPrice
- type GetDeliveryRecords
- type GetFundingRateHistory
- type GetHistoricalVolatility
- type GetInstruments
- type GetInsurance
- type GetKeyInfo
- type GetKline
- type GetOpenInterest
- type GetOpenOrders
- type GetOrderHistory
- type GetOrderbook
- type GetPositions
- type GetPublicTradingHistory
- type GetRiskLimit
- type GetServerTime
- type GetSettlement
- type GetTickers
- type GetTickersOption
- type GetTransactionLog
- type GetTransferableCoin
- type GetWallatBalance
- type GreekShot
- type HistoricalVolatility
- type Instrument
- type InstrumentOption
- type InstrumentSpot
- type Insurance
- type Interval
- type IntervalTime
- type KeyInfo
- type Kline
- type KlineExt
- type KlineShot
- type LeverageFilter
- type LiquidationShot
- type LotSizeFilter
- type LotSizeFilterSpot
- type LtNavShot
- type LtTickerShot
- type MarginTrading
- type OnTransportError
- type OpenInterest
- type Order
- type OrderId
- type OrderShot
- type OrderStatus
- type OrderType
- type Orderbook
- type Period
- type Permissions
- type PlaceOrder
- type Position
- type PositionIdx
- type PositionShot
- type PositionStatus
- type PriceFilter
- type PriceFilterSpot
- type PrivateHeader
- type PublicHeader
- type PublicTradingHistory
- type RateLimit
- type RawTopic
- type RejectReason
- type Response
- type RiskLimit
- type ServerTime
- type Settlement
- type Side
- type Sign
- type SingleCoinBalance
- type SmpType
- type SpotAssetInfo
- type Status
- type StopOrderType
- type SubscriptionClient
- type SubscriptionFunc
- type SubscriptionFuncs
- type Subscriptions
- type TickDirection
- type Ticker
- type TickerOption
- type TickerOptionShot
- type TickerShot
- type TickerSpot
- type TickerSpotShot
- type TimeInForce
- type Timestamp
- type Topic
- type TpSlMode
- type TradeMode
- type TradeShot
- type TransactionLog
- type TriggerBy
- type Type
- type WalletBalance
- type WalletCoin
- type WalletCoinBalance
- type WalletShot
- type WsAuthClient
- func (o *WsAuthClient[T]) Close()
- func (o *WsAuthClient[T]) Connected() bool
- func (o *WsAuthClient[T]) Ready() bool
- func (o *WsAuthClient[T]) Run()
- func (o *WsAuthClient[T]) SendOrder(r WsRequest[WsPlaceOrder])
- func (o *WsAuthClient[T]) SetOnOperation(f func(T) (bool, error))
- func (o *WsAuthClient[T]) SetOnTopic(f func([]byte) error)
- func (o *WsAuthClient[T]) Subscribe(topic string)
- func (o *WsAuthClient[T]) Transport() *uws.Options
- func (o *WsAuthClient[T]) Unsubscribe(topic string)
- func (o *WsAuthClient[T]) WithBaseUrl(url string) *WsAuthClient[T]
- func (o *WsAuthClient[T]) WithByTickUrl() *WsAuthClient[T]
- func (o *WsAuthClient[T]) WithLog(log *ulog.Log) *WsAuthClient[T]
- func (o *WsAuthClient[T]) WithLogRequest(enable bool) *WsAuthClient[T]
- func (o *WsAuthClient[T]) WithLogResponse(enable bool) *WsAuthClient[T]
- func (o *WsAuthClient[T]) WithOnConnected(f func()) *WsAuthClient[T]
- func (o *WsAuthClient[T]) WithOnDialError(f func(error) bool) *WsAuthClient[T]
- func (o *WsAuthClient[T]) WithOnDisconnected(f func()) *WsAuthClient[T]
- func (o *WsAuthClient[T]) WithOnReady(f func()) *WsAuthClient[T]
- func (o *WsAuthClient[T]) WithProxy(proxy string) *WsAuthClient[T]
- type WsBaseResponse
- type WsClient
- func (o *WsClient[T]) Close()
- func (o *WsClient[T]) Connected() bool
- func (o *WsClient[T]) Log() *ulog.Log
- func (o *WsClient[T]) Run()
- func (o *WsClient[T]) Send(r WsRequest[string])
- func (o *WsClient[T]) SendOrder(r WsRequest[WsPlaceOrder])
- func (o *WsClient[T]) Subscribe(s string)
- func (o *WsClient[T]) SubscribeBatch(l []string)
- func (o *WsClient[T]) Transport() *uws.Options
- func (o *WsClient[T]) Unsubscribe(s string)
- func (o *WsClient[T]) UnsubscribeBatch(l []string)
- func (o *WsClient[T]) WithBaseUrl(url string) *WsClient[T]
- func (o *WsClient[T]) WithByTickUrl() *WsClient[T]
- func (o *WsClient[T]) WithLog(log *ulog.Log) *WsClient[T]
- func (o *WsClient[T]) WithLogRequest(enable bool) *WsClient[T]
- func (o *WsClient[T]) WithLogResponse(enable bool) *WsClient[T]
- func (o *WsClient[T]) WithOnConnected(f func()) *WsClient[T]
- func (o *WsClient[T]) WithOnDialError(f func(error) bool) *WsClient[T]
- func (o *WsClient[T]) WithOnDisconnected(f func()) *WsClient[T]
- func (o *WsClient[T]) WithOnResponse(f func(T) error) *WsClient[T]
- func (o *WsClient[T]) WithOnTopic(f func([]byte) error) *WsClient[T]
- func (o *WsClient[T]) WithPath(path string) *WsClient[T]
- func (o *WsClient[T]) WithProxy(proxy string) *WsClient[T]
- type WsHeader
- type WsOrderData
- type WsPlaceOrder
- type WsPrivate
- func (o *WsPrivate) Close()
- func (o *WsPrivate) Connected() bool
- func (o *WsPrivate) Execution() *Executor[[]ExecutionShot]
- func (o *WsPrivate) Greek() *Executor[[]GreekShot]
- func (o *WsPrivate) Order() *Executor[[]OrderShot]
- func (o *WsPrivate) Position() *Executor[[]PositionShot]
- func (o *WsPrivate) Ready() bool
- func (o *WsPrivate) Run()
- func (o *WsPrivate) Transport() *uws.Options
- func (o *WsPrivate) Wallet() *Executor[[]WalletShot]
- func (o *WsPrivate) WithBaseUrl(url string) *WsPrivate
- func (o *WsPrivate) WithByTickUrl() *WsPrivate
- func (o *WsPrivate) WithLog(log *ulog.Log) *WsPrivate
- func (o *WsPrivate) WithLogRequest(enable bool) *WsPrivate
- func (o *WsPrivate) WithLogResponse(enable bool) *WsPrivate
- func (o *WsPrivate) WithOnConnected(f func()) *WsPrivate
- func (o *WsPrivate) WithOnDialError(f func(error) bool) *WsPrivate
- func (o *WsPrivate) WithOnDisconnected(f func()) *WsPrivate
- func (o *WsPrivate) WithOnReady(f func()) *WsPrivate
- func (o *WsPrivate) WithProxy(proxy string) *WsPrivate
- type WsPublic
- func (o *WsPublic) Close()
- func (o *WsPublic) Connected() bool
- func (o *WsPublic) Inverse() *WsPublic
- func (o *WsPublic) Kline(symbol string, interval Interval) *Executor[[]KlineShot]
- func (o *WsPublic) Linear() *WsPublic
- func (o *WsPublic) Liquidation(symbol string) *Executor[LiquidationShot]
- func (o *WsPublic) LtKline(symbol string, interval Interval) *Executor[[]KlineShot]
- func (o *WsPublic) LtNav(symbol string) *Executor[LtNavShot]
- func (o *WsPublic) LtTicker(symbol string) *Executor[LtTickerShot]
- func (o *WsPublic) Option() *WsPublic
- func (o *WsPublic) OrderBook(symbol string, depth int) *Executor[Orderbook]
- func (o *WsPublic) Ready() bool
- func (o *WsPublic) Run()
- func (o *WsPublic) Spot() *WsPublic
- func (o *WsPublic) Ticker(symbol string) *Executor[TickerShot]
- func (o *WsPublic) TickerOption(symbol string) *Executor[TickerOptionShot]
- func (o *WsPublic) TickerSpot(symbol string) *Executor[TickerSpotShot]
- func (o *WsPublic) Trade(symbol string) *Executor[[]TradeShot]
- func (o *WsPublic) Transport() *uws.Options
- func (o *WsPublic) WithBaseUrl(url string) *WsPublic
- func (o *WsPublic) WithByTickUrl() *WsPublic
- func (o *WsPublic) WithCategory(category Category) *WsPublic
- func (o *WsPublic) WithLog(log *ulog.Log) *WsPublic
- func (o *WsPublic) WithLogRequest(enable bool) *WsPublic
- func (o *WsPublic) WithLogResponse(enable bool) *WsPublic
- func (o *WsPublic) WithOnConnected(f func()) *WsPublic
- func (o *WsPublic) WithOnDialError(f func(error) bool) *WsPublic
- func (o *WsPublic) WithOnDisconnected(f func()) *WsPublic
- func (o *WsPublic) WithProxy(proxy string) *WsPublic
- type WsRequest
- type WsResponse
- type WsResponseHeader
- type WsTrade
- func (o *WsTrade) Close()
- func (o *WsTrade) Connected() bool
- func (o *WsTrade) PlaceOrder(v WsPlaceOrder)
- func (o *WsTrade) Ready() bool
- func (o *WsTrade) Run()
- func (o *WsTrade) Transport() *uws.Options
- func (o *WsTrade) WithBaseUrl(url string) *WsTrade
- func (o *WsTrade) WithByTickUrl() *WsTrade
- func (o *WsTrade) WithLog(log *ulog.Log) *WsTrade
- func (o *WsTrade) WithLogRequest(enable bool) *WsTrade
- func (o *WsTrade) WithLogResponse(enable bool) *WsTrade
- func (o *WsTrade) WithOnConnected(f func()) *WsTrade
- func (o *WsTrade) WithOnDialError(f func(error) bool) *WsTrade
- func (o *WsTrade) WithOnDisconnected(f func()) *WsTrade
- func (o *WsTrade) WithOnReady(f func()) *WsTrade
- func (o *WsTrade) WithOnResponse(f func(WsTradeResponse)) *WsTrade
- func (o *WsTrade) WithProxy(proxy string) *WsTrade
- type WsTradeResponse
Constants ¶
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 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
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
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
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)
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
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) 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 (*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 (*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 (*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 (*Client) WithBaseUrl ¶
func (*Client) WithByTickUrl ¶
func (*Client) WithOnReadBodyError ¶ added in v0.3.13
func (*Client) WithOnTransportError ¶ added in v0.3.1
func (o *Client) WithOnTransportError(f OnTransportError) *Client
func (*Client) WithReferer ¶ added in v0.3.7
type CoinBalance ¶
type CoinBalanceExt ¶
type CoinBalanceExt struct { CoinBalance TransferSafeAmount string }
type CoinRecord ¶
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
type DeliveryPrice ¶
type DeliveryRecord ¶
type Error ¶
Error (https://bybit-exchange.github.io/docs/v5/error)
func (*Error) ApiKeyExpired ¶
func (*Error) ApiKeyInvalid ¶
func (*Error) InsufficientBalance ¶
func (*Error) OrderLinkedIdIsDuplicate ¶ added in v0.3.18
func (*Error) RequestParameterError ¶ added in v0.2.23
func (*Error) SymbolIsNotWhitelisted ¶ added in v0.2.23
func (*Error) TooManyVisits ¶
func (*Error) UnmatchedIp ¶
type ExecType ¶ added in v0.2.1
type ExecType string
execType https://bybit-exchange.github.io/docs/v5/enum#exectype
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]) Unsubscribe ¶ added in v0.2.1
func (o *Executor[T]) Unsubscribe()
type FundingRateHistory ¶
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
func (o GetAccountInfo) Do(c *Client) Response[AccountInfo]
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 ¶
func (o GetAssetInfo) Do(c *Client) Response[SpotAssetInfo]
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 ¶
func (o GetCoinBalance) Do(c *Client) Response[SingleCoinBalance]
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 ¶
func (o GetCoinRecords) Do(c *Client) Response[[]CoinRecord]
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 ¶
func (o GetCoinsBalance) Do(c *Client) Response[CoinsBalance]
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 ¶
func (o GetDeliveryPrice) Do(c *Client) Response[[]DeliveryPrice]
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 ¶
func (o GetDeliveryRecords) Do(c *Client) Response[[]DeliveryRecord]
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 ¶
func (o GetFundingRateHistory) Do(c *Client) Response[[]FundingRateHistory]
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 ¶
func (o GetHistoricalVolatility) Do(c *Client) Response[[]HistoricalVolatility]
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 (o GetInstruments) Do(c *Client) Response[[]Instrument]
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
type GetKeyInfo ¶
type GetKeyInfo struct { }
Get API Key Information https://bybit-exchange.github.io/docs/v5/user/apikey-info
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) DoIndexPrice ¶
Get Index Price Kline https://bybit-exchange.github.io/docs/v5/market/index-kline
func (GetKline) DoMarkPrice ¶
Get Mark Price Kline https://bybit-exchange.github.io/docs/v5/market/mark-kline
func (GetKline) DoPremiumIndexPrice ¶
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 ¶
func (o GetOpenInterest) Do(c *Client) Response[[]OpenInterest]
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
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
type GetOrderbook ¶
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.
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
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 ¶
func (o GetPublicTradingHistory) Do(c *Client) Response[[]PublicTradingHistory]
type GetRiskLimit ¶
Get Risk Limit https://bybit-exchange.github.io/docs/v5/market/risk-limit
category Required string Product type. linear,inverse symbol string Symbol name
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
func (o GetServerTime) Do(c *Client) Response[ServerTime]
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 ¶
func (o GetSettlement) Do(c *Client) Response[[]Settlement]
type GetTickers ¶
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) 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
func (o GetTickersOption) Do(c *Client) Response[[]TickerOption]
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
func (o GetTransactionLog) Do(c *Client) Response[[]TransactionLog]
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
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
func (o GetWallatBalance) Do(c *Client) Response[[]WalletBalance]
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 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 InstrumentSpot ¶ added in v0.2.4
type InstrumentSpot struct { Symbol string Status Status BaseCoin string QuoteCoin string MarginTrading MarginTrading PriceFilter PriceFilterSpot LotSizeFilter LotSizeFilterSpot }
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 ¶
type KlineExt ¶
func UnmarshalKlineExt ¶
type LeverageFilter ¶
type LiquidationShot ¶ added in v0.2.1
type LotSizeFilter ¶
type LotSizeFilterSpot ¶ added in v0.2.4
type LtTickerShot ¶ added in v0.2.1
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 OpenInterest ¶
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
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 Permissions ¶
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
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 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 PriceFilterSpot ¶ added in v0.2.4
type PrivateHeader ¶ added in v0.2.1
type PublicHeader ¶ added in v0.2.1
func (PublicHeader) IsDelta ¶ added in v0.2.1
func (o PublicHeader) IsDelta() bool
type PublicTradingHistory ¶
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 ServerTime ¶ added in v0.2.22
type Settlement ¶
type SingleCoinBalance ¶
type SingleCoinBalance struct { AccountType AccountType MemberId string BizType int AccountId string Balance CoinBalanceExt }
type SpotAssetInfo ¶
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 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.StringFloat64 BidSize ujson.StringFloat64 BidIv ujson.StringFloat64 AskPrice ujson.StringFloat64 AskSize ujson.StringFloat64 AskIv ujson.StringFloat64 LastPrice ujson.StringFloat64 HighPrice24H ujson.StringFloat64 LowPrice24H ujson.StringFloat64 MarkPrice ujson.StringFloat64 IndexPrice ujson.StringFloat64 MarkPriceIv ujson.StringFloat64 UnderlyingPrice ujson.StringFloat64 OpenInterest ujson.StringFloat64 Turnover24H ujson.StringFloat64 Volume24H ujson.StringFloat64 TotalVolume ujson.StringFloat64 TotalTurnover ujson.StringFloat64 Delta ujson.StringFloat64 Gamma ujson.StringFloat64 Vega ujson.StringFloat64 Theta ujson.StringFloat64 PredictedDeliveryPrice ujson.StringFloat64 Change24H ujson.StringFloat64 }
type TickerShot ¶ added in v0.2.11
type TickerShot struct { Symbol string TickDirection TickDirection Price24HPcnt ujson.StringFloat64 LastPrice ujson.StringFloat64 PrevPrice24H ujson.StringFloat64 HighPrice24H ujson.StringFloat64 LowPrice24H ujson.StringFloat64 PrevPrice1H ujson.StringFloat64 MarkPrice ujson.StringFloat64 IndexPrice ujson.StringFloat64 OpenInterest ujson.StringFloat64 OpenInterestValue ujson.StringFloat64 Turnover24H ujson.StringFloat64 Volume24H ujson.StringFloat64 NextFundingTime ujson.StringFloat64 FundingRate ujson.StringFloat64 Bid1Price ujson.StringFloat64 Bid1Size ujson.StringFloat64 Ask1Price ujson.StringFloat64 Ask1Size ujson.StringFloat64 }
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.StringFloat64 HighPrice24H ujson.StringFloat64 LowPrice24H ujson.StringFloat64 PrevPrice24H ujson.StringFloat64 Volume24H ujson.StringFloat64 Turnover24H ujson.StringFloat64 Price24HPcnt ujson.StringFloat64 UsdIndexPrice ujson.StringFloat64 }
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 Timestamp ¶ added in v0.4.0
type Timestamp struct {
// contains filtered or unexported fields
}
func NewTimestamp ¶ added in v0.4.0
func NewTimestamp() *Timestamp
type Topic ¶ added in v0.2.1
type Topic[T any] struct { Topic string PublicHeader PrivateHeader Data T }
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)
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 WsAuthClient ¶ added in v0.4.0
type WsAuthClient[T WsResponse] struct { // contains filtered or unexported fields }
func NewWsAuthClient ¶ added in v0.4.0
func NewWsAuthClient[T WsResponse](path, key, secret string) *WsAuthClient[T]
func (*WsAuthClient[T]) Close ¶ added in v0.4.0
func (o *WsAuthClient[T]) Close()
func (*WsAuthClient[T]) Connected ¶ added in v0.4.0
func (o *WsAuthClient[T]) Connected() bool
func (*WsAuthClient[T]) Ready ¶ added in v0.4.0
func (o *WsAuthClient[T]) Ready() bool
func (*WsAuthClient[T]) Run ¶ added in v0.4.0
func (o *WsAuthClient[T]) Run()
func (*WsAuthClient[T]) SendOrder ¶ added in v0.4.0
func (o *WsAuthClient[T]) SendOrder(r WsRequest[WsPlaceOrder])
func (*WsAuthClient[T]) SetOnOperation ¶ added in v0.4.0
func (o *WsAuthClient[T]) SetOnOperation(f func(T) (bool, error))
func (*WsAuthClient[T]) SetOnTopic ¶ added in v0.4.0
func (o *WsAuthClient[T]) SetOnTopic(f func([]byte) error)
func (*WsAuthClient[T]) Subscribe ¶ added in v0.4.0
func (o *WsAuthClient[T]) Subscribe(topic string)
func (*WsAuthClient[T]) Transport ¶ added in v0.4.0
func (o *WsAuthClient[T]) Transport() *uws.Options
func (*WsAuthClient[T]) Unsubscribe ¶ added in v0.4.0
func (o *WsAuthClient[T]) Unsubscribe(topic string)
func (*WsAuthClient[T]) WithBaseUrl ¶ added in v0.4.0
func (o *WsAuthClient[T]) WithBaseUrl(url string) *WsAuthClient[T]
func (*WsAuthClient[T]) WithByTickUrl ¶ added in v0.4.0
func (o *WsAuthClient[T]) WithByTickUrl() *WsAuthClient[T]
func (*WsAuthClient[T]) WithLog ¶ added in v0.4.0
func (o *WsAuthClient[T]) WithLog(log *ulog.Log) *WsAuthClient[T]
func (*WsAuthClient[T]) WithLogRequest ¶ added in v0.4.0
func (o *WsAuthClient[T]) WithLogRequest(enable bool) *WsAuthClient[T]
func (*WsAuthClient[T]) WithLogResponse ¶ added in v0.4.0
func (o *WsAuthClient[T]) WithLogResponse(enable bool) *WsAuthClient[T]
func (*WsAuthClient[T]) WithOnConnected ¶ added in v0.4.0
func (o *WsAuthClient[T]) WithOnConnected(f func()) *WsAuthClient[T]
func (*WsAuthClient[T]) WithOnDialError ¶ added in v0.4.0
func (o *WsAuthClient[T]) WithOnDialError(f func(error) bool) *WsAuthClient[T]
func (*WsAuthClient[T]) WithOnDisconnected ¶ added in v0.4.0
func (o *WsAuthClient[T]) WithOnDisconnected(f func()) *WsAuthClient[T]
func (*WsAuthClient[T]) WithOnReady ¶ added in v0.4.0
func (o *WsAuthClient[T]) WithOnReady(f func()) *WsAuthClient[T]
func (*WsAuthClient[T]) WithProxy ¶ added in v0.4.0
func (o *WsAuthClient[T]) WithProxy(proxy string) *WsAuthClient[T]
type WsBaseResponse ¶ added in v0.4.0
type WsBaseResponse struct { Operation string `json:"op"` ConnectionId string `json:"conn_id"` Success bool Message string `json:"ret_msg"` Args []string }
func (WsBaseResponse) IsOperateion ¶ added in v0.4.0
func (o WsBaseResponse) IsOperateion() bool
func (WsBaseResponse) Log ¶ added in v0.4.0
func (o WsBaseResponse) Log(log *ulog.Log)
func (WsBaseResponse) Ok ¶ added in v0.4.0
func (o WsBaseResponse) Ok() bool
func (WsBaseResponse) OperationIs ¶ added in v0.4.0
func (o WsBaseResponse) OperationIs(v string) bool
type WsClient ¶ added in v0.2.1
type WsClient[T WsResponse] struct { // contains filtered or unexported fields }
func NewWsClient ¶ added in v0.2.1
func NewWsClient[T WsResponse]() *WsClient[T]
func (*WsClient[T]) SendOrder ¶ added in v0.4.0
func (o *WsClient[T]) SendOrder(r WsRequest[WsPlaceOrder])
func (*WsClient[T]) SubscribeBatch ¶ added in v0.2.1
func (*WsClient[T]) Unsubscribe ¶ added in v0.2.1
func (*WsClient[T]) UnsubscribeBatch ¶ added in v0.2.1
func (*WsClient[T]) WithBaseUrl ¶ added in v0.2.1
func (*WsClient[T]) WithByTickUrl ¶ added in v0.2.1
func (*WsClient[T]) WithLogRequest ¶ added in v0.2.1
func (*WsClient[T]) WithLogResponse ¶ added in v0.2.1
func (*WsClient[T]) WithOnConnected ¶ added in v0.2.1
func (*WsClient[T]) WithOnDialError ¶ added in v0.2.8
func (*WsClient[T]) WithOnDisconnected ¶ added in v0.2.1
func (*WsClient[T]) WithOnResponse ¶ added in v0.2.1
func (*WsClient[T]) WithOnTopic ¶ added in v0.2.1
type WsOrderData ¶ added in v0.4.0
type WsPlaceOrder ¶ added in v0.4.0
type WsPrivate ¶ added in v0.2.1
type WsPrivate struct {
// contains filtered or unexported fields
}
func NewWsPrivate ¶ added in v0.2.1
func (*WsPrivate) Execution ¶ added in v0.2.1
func (o *WsPrivate) Execution() *Executor[[]ExecutionShot]
func (*WsPrivate) Position ¶ added in v0.2.1
func (o *WsPrivate) Position() *Executor[[]PositionShot]
func (*WsPrivate) Wallet ¶ added in v0.2.1
func (o *WsPrivate) Wallet() *Executor[[]WalletShot]
func (*WsPrivate) WithBaseUrl ¶ added in v0.2.1
func (*WsPrivate) WithByTickUrl ¶ added in v0.2.1
func (*WsPrivate) WithLogRequest ¶ added in v0.2.1
func (*WsPrivate) WithLogResponse ¶ added in v0.2.1
func (*WsPrivate) WithOnConnected ¶ added in v0.2.1
func (*WsPrivate) WithOnDialError ¶ added in v0.2.8
func (*WsPrivate) WithOnDisconnected ¶ added in v0.2.1
func (*WsPrivate) WithOnReady ¶ added in v0.2.1
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) Liquidation ¶ added in v0.2.1
func (o *WsPublic) Liquidation(symbol string) *Executor[LiquidationShot]
func (*WsPublic) LtTicker ¶ added in v0.2.1
func (o *WsPublic) LtTicker(symbol string) *Executor[LtTickerShot]
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) WithBaseUrl ¶ added in v0.2.1
func (*WsPublic) WithByTickUrl ¶ added in v0.2.1
func (*WsPublic) WithCategory ¶ added in v0.2.1
func (*WsPublic) WithLogRequest ¶ added in v0.2.1
func (*WsPublic) WithLogResponse ¶ added in v0.2.1
func (*WsPublic) WithOnConnected ¶ added in v0.2.1
func (*WsPublic) WithOnDialError ¶ added in v0.2.8
func (*WsPublic) WithOnDisconnected ¶ added in v0.2.1
type WsResponse ¶ added in v0.2.1
type WsResponseHeader ¶ added in v0.4.0
type WsTrade ¶ added in v0.4.0
type WsTrade struct {
// contains filtered or unexported fields
}
func NewWsTrade ¶ added in v0.4.0
func (*WsTrade) PlaceOrder ¶ added in v0.4.0
func (o *WsTrade) PlaceOrder(v WsPlaceOrder)
func (*WsTrade) WithBaseUrl ¶ added in v0.4.0
func (*WsTrade) WithByTickUrl ¶ added in v0.4.0
func (*WsTrade) WithLogRequest ¶ added in v0.4.0
func (*WsTrade) WithLogResponse ¶ added in v0.4.0
func (*WsTrade) WithOnConnected ¶ added in v0.4.0
func (*WsTrade) WithOnDialError ¶ added in v0.4.0
func (*WsTrade) WithOnDisconnected ¶ added in v0.4.0
func (*WsTrade) WithOnReady ¶ added in v0.4.0
func (*WsTrade) WithOnResponse ¶ added in v0.4.0
func (o *WsTrade) WithOnResponse(f func(WsTradeResponse)) *WsTrade
type WsTradeResponse ¶ added in v0.4.0
type WsTradeResponse struct { Operation string `json:"op"` ConnectionId string `json:"connId"` Code int `json:"retCode"` Message string `json:"retMsg"` Data json.RawMessage Header WsResponseHeader }
func (WsTradeResponse) IsOperateion ¶ added in v0.4.0
func (o WsTradeResponse) IsOperateion() bool
func (WsTradeResponse) Log ¶ added in v0.4.0
func (o WsTradeResponse) Log(log *ulog.Log)
func (WsTradeResponse) Ok ¶ added in v0.4.0
func (o WsTradeResponse) Ok() bool
func (WsTradeResponse) OperationIs ¶ added in v0.4.0
func (o WsTradeResponse) OperationIs(v string) bool
func (WsTradeResponse) OrderData ¶ added in v0.4.0
func (o WsTradeResponse) OrderData() (v WsOrderData, err error)
Source Files ¶
- account.go
- asset.go
- client.go
- enum.go
- error.go
- market.go
- position.go
- rate_limit.go
- request.go
- responce.go
- sign.go
- trade.go
- transform.go
- ts.go
- url.go
- user.go
- ws_auth_client.go
- ws_client.go
- ws_executor.go
- ws_header.go
- ws_place_order.go
- ws_private.go
- ws_public.go
- ws_request.go
- ws_responce.go
- ws_subscription.go
- ws_topic.go
- ws_trade.go