bybit.go.api/examples/websocket/private_ws.go

17 lines
411 B
Go
Raw Normal View History

package main
import (
"fmt"
2023-11-05 23:35:56 +02:00
bybit "github.com/wuhewuhe/bybit.go.api"
)
func main() {
ws := bybit.NewBybitPrivateWebSocket("wss://stream-testnet.bybit.com/v5/private", "8wYkmpLsMg10eNQyPm", "Ouxc34myDnXvei54XsBZgoQzfGxO4bkr2Zsj", func(message string) error {
fmt.Println("Received:", message)
return nil
})
// Connect and subscribe to the desired topic
_ = ws.Connect([]string{"order"})
select {}
}