A Golang SDN client.
go get github.com/sending-network/sendingnetwork-bot
Provide server endpoint, wallet address and private key in config.yaml:
endpoint: ""
wallet_address: ""
private_key: ""
You can use an existing wallet account, or generate a new account by running:
go run tools/generate_wallet_account.go
After reading the configuration file, create an instance of Client
package main
import (
"os"
sdnclient "github.com/sending-network/sendingnetwork-bot"
"gopkg.in/yaml.v3"
)
func main() {
configData, _ := os.ReadFile("config.yaml")
config := sdnclient.Config{}
_ = yaml.Unmarshal(configData, &config)
cli, _ := sdnclient.NewClient(&config)
}
// create new room
respCreateRoom, _ := cli.CreateRoom(&sdnclient.ReqCreateRoom{
Name: "TestRoom",
})
// invite user to the room
respInviteUser, _ := cli.InviteUser(respCreateRoom.RoomID, &sdnclient.ReqInviteUser{
UserID: userID,
})
// logout to invalidate access token
respLogout, _ := cli.Logout()
See more use cases in examples
directory.
Apache 2.0