This package helps execute trade/orders against DVChains websocket API in golang!
go get -u github.com/dv-chain/dvotc-websocket-go
More examples can be found in /examples
folder
package main
import (
"fmt"
dvotcWS "github.com/dv-chain/dvotc-websocket-go"
)
func main() {
// DVOTC_WS_URL = "wss://sandbox.trade.dvchain.co" || "wss://trade.dvchain.co"
// YOUR_API_KEY = "4f8f48ff-3135-422c-9ce7-1cc5a31a72d8"
// YOUR_API_SECRET = "n43n2423423nm4b4b34n32423"
dvotcClient := dvotcWS.NewDVOTCClient("DVOTC_WS_URL", "YOUR_API_KEY", "YOUR_API_SECRET")
err := dvotcClient.Ping()
if err != nil {
fmt.Printf("%s\n", err)
return
}
symbols, err := dvotcClient.ListAvailableSymbols()
if err != nil {
fmt.Printf("%s\n", err)
return
}
for i, symbols := range symbols {
fmt.Printf("%d) %s", i, symbols)
}
}