Documentation ¶
Index ¶
- Constants
- type Cmd
- type Configuration
- type GateWS
- func (b *GateWS) Emit(event interface{}, arguments ...interface{}) *emission.Emitter
- func (b *GateWS) GetPair(args ...string) string
- func (b *GateWS) Off(event interface{}, listener interface{}) *emission.Emitter
- func (b *GateWS) On(event interface{}, listener interface{}) *emission.Emitter
- func (b *GateWS) Send(msg string) (err error)
- func (b *GateWS) SendCmd(cmd Cmd)
- func (b *GateWS) Start() error
- func (b *GateWS) Subscribe(channel string, coins []string)
- func (b *GateWS) Subscribe1(channel string)
- func (b *GateWS) Subscribe2(channel string, coins []string)
- type Tickers
- type WalletBalance
Constants ¶
View Source
const ( //https://www.gate.io/docs/developers/apiv4/ws/en/#tickers-channel ChannelTicker = "spot.tickers" // https://www.gate.io/docs/developers/apiv4/ws/en/#spot-balance-channel ChannelBalances = "spot.balances" )
View Source
const (
HostWebsocketURL = "wss://api.gateio.ws/ws/v4/"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
type Cmd struct { Time int64 `json:"time"` ID int64 `json:"id"` Channel string `json:"channel"` Event string `json:"event"` Payload []string `json:"payload"` Auth authCmd `json:"auth"` }
Необходим для удобного создания подписок
type Configuration ¶
type GateWS ¶
type GateWS struct {
// contains filtered or unexported fields
}
func New ¶
func New(config *Configuration) *GateWS
func (*GateWS) SendCmd ¶
отправка команды на сервер в отдельной функции для того, чтобы при переподключении быстро подписаться на все предыдущие каналы
func (*GateWS) Subscribe1 ¶
func (*GateWS) Subscribe2 ¶
type Tickers ¶
type Tickers struct { Time int `json:"time"` Channel string `json:"channel"` Event string `json:"event"` Result resultTickers `json:"result"` }
https://www.gate.io/docs/developers/apiv4/#retrieve-ticker-information
type WalletBalance ¶
type WalletBalance struct { Time int `json:"time"` Channel string `json:"channel"` Event string `json:"event"` Result []resultWalletBalance `json:"result"` }
https://www.gate.io/docs/developers/apiv4/ws/en/#client-subscription-9
Click to show internal directories.
Click to hide internal directories.