Documentation ¶
Index ¶
- Constants
- type ArgsAuth
- type ArgsCmd
- type Auth
- type Cmd
- type Configuration
- type OKXWS
- func (b *OKXWS) Auth()
- func (b *OKXWS) Emit(event interface{}, arguments ...interface{}) *emission.Emitter
- func (b *OKXWS) GetPair(args ...string) string
- func (b *OKXWS) Off(event interface{}, listener interface{}) *emission.Emitter
- func (b *OKXWS) On(event interface{}, listener interface{}) *emission.Emitter
- func (b *OKXWS) Send(msg string) (err error)
- func (b *OKXWS) SendCmd(cmd Cmd)
- func (b *OKXWS) Start() error
- func (b *OKXWS) Subscribe(channel string, args []string)
- func (b *OKXWS) Subscribe1(channel string)
- func (b *OKXWS) Subscribe2(channel string, secondArg string)
- func (b *OKXWS) Subscribe3(channel string, InstType string, arg2 string)
- func (b *OKXWS) Subscribe4(channel string, arg1 string, arg2 string, arg3 string)
- type Tickers
- type WalletBalance
Constants ¶
View Source
const ( HostPublicWebSocket = "wss://ws.okx.com:8443/ws/v5/public" HostPrivateWebSocket = "wss://ws.okx.com:8443/ws/v5/private" HostPublicWebSocketAWS = "wss://wsaws.okx.com:8443/ws/v5/public" HostPrivateWebSocketAWS = "wss://wsaws.okx.com:8443/ws/v5/private" )
View Source
const ( ChannelBalanceAndPosition = "balance_and_position" ChannelRfqs = "rfqs" ChannelQuotes = "quotes" ChannelTicker = "tickers" ChannelOptSummary = "opt-summary" ChannelAccount = "account" ChannelAccountGreeks = "account-greeks" ChannelGridPositions = "grid-positions" ChannelGridSubOrders = "grid-sub-orders" ChannelLiquidationWarning = "liquidation-warning" ChannelGridOrdersSpot = "grid-orders-spot" ChannelGridOrdersContract = "grid-orders-contract" ChannelGridOrdersMoon = "grid-orders-moon" ChannelAlgoAdvance = "algo-advance" ChannelEstimatedPrice = "estimated-price" ChannelPositions = "positions" ChannelOrders = "orders" ChannelOrdersAlgo = "orders-algo" )
View Source
const ( InstTypeSpot = "SPOT" InstTypeMargin = "MARGIN" InstTypeSwap = "SWAP" InstTypeFutures = "FUTURES" InstTypeOption = "OPTION" InstTypeAny = "ANY" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type OKXWS ¶
type OKXWS struct {
// contains filtered or unexported fields
}
func New ¶
func New(config *Configuration) *OKXWS
func (*OKXWS) SendCmd ¶
отправка команды на сервер в отдельной функции для того, чтобы при переподключении быстро подписаться на все предыдущие каналы
func (*OKXWS) Subscribe2 ¶
подписка c 2 аргументами
func (*OKXWS) Subscribe3 ¶
подписка с тремя аргументами
type Tickers ¶
type Tickers struct { Arg argTickers `json:"arg"` Data []dataTickers `json:"data"` }
https://www.okx.com/docs-v5/en/#websocket-api-public-channel-instruments-channel
type WalletBalance ¶
type WalletBalance struct { Arg argWalletBalance `json:"arg"` Data []dataWalletBalance `json:"data"` }
https://www.okx.com/docs-v5/en/#websocket-api-private-channel-balance-and-position-channel
Click to show internal directories.
Click to hide internal directories.