We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
c, _ := NewClient("https://rpc.testnet.near.org") var resp AccessKeyView _, _ = c.doRPC(context.Background(), &resp, "query", block.FinalityFinal(), map[string]interface{}{ "request_type": "view_access_key", "account_id": "yuhainan.testnet", "public_key": "ed25519:AWRz5BzmJUbjKgr6Ln2VcwkuEh8QipRjxGt9YdjNeJn", }) fmt.Println(resp)
Result:
{{91568545000006 {true {<nil> []}}} {0 11111111111111111111111111111111}}
when i use postman everything is ok
how to fix it?
The text was updated successfully, but these errors were encountered:
Do not use internal doRPC method for this, because it is not guaranteed to handle more complex structures.
doRPC
You rather want to do something like this:
func main() { c := config.Networks["testnet"] rpc, err := client.NewClient(c.NodeURL) if err != nil { panic(err) } publicKey, err := key.NewBase58PublicKey("ed25519:AWRz5BzmJUbjKgr6Ln2VcwkuEh8QipRjxGt9YdjNeJn") if err != nil { panic(err) } ctx := context.Background() res, err := rpc.AccessKeyView(ctx, "yuhainan.testnet", publicKey, block.FinalityFinal()) if err != nil { panic(err) } // TODO: use res _ = res }
Sorry, something went wrong.
Fix AccessKeyView unmarshal
33b2b6b
Reported in #19, didn't actually realize the issue at first glance.
No branches or pull requests
Result:
when i use postman everything is ok
how to fix it?
The text was updated successfully, but these errors were encountered: