package main
import (
"context"
"fmt"
cess "github.com/CESSProject/cess-go-sdk"
"github.com/CESSProject/cess-go-sdk/core/utils"
)
var RPC_ADDRS = []string{
"wss://testnet-rpc0.cess.cloud/ws/",
"wss://testnet-rpc1.cess.cloud/ws/",
"wss://testnet-rpc2.cess.cloud/ws/",
}
// User account to view
var account_user = "cXfyomKDABfehLkvARFE854wgDJFMbsxwAJEHezRb6mfcAi2y"
func main() {
sdk, err := cess.New(
context.Background(),
cess.ConnectRpcAddrs(RPC_ADDRS),
)
if err != nil {
panic(err)
}
// Resolve the public key of the account
publicKey, err := utils.ParsingPublickey(account_user)
if err != nil {
panic(err)
}
// Query account details
fmt.Println(sdk.QueryAccountInfo(publicKey))
}