Closed Pat-rice closed 5 months ago
ok just after I posted this, I found the ready to use type AccountInfo
and it works 😅
var sa types.AccountInfo
_, err = api.RPC.State.GetStorageLatest(systemAccountKey, &sa)
if err != nil {
log.Fatalf("Failed to get account info: %v", err)
}
fmt.Printf("frozen uint64: %v\n", sa.Data.MiscFrozen.Uint64())
I'm trying to retrieve the staking balance of a nominator such as shown in subscan It works fine when using polkadotjs with
api.query.system.account
orapi.query.staking.ledger
I need to do the same in go, however I do not get the same value at all.What am I doing wrong ?