I’m trying to get my head around converting an account info in the global state into the public key.
I read many answers here but couldn’t get it.
I assume that the “bytes” is the base64 of the public address of the funding account based on the value I read from the global state:
{
"key": "RlVOREFDQ09VTlQ=", //FUNDACCOUNT
"value": {
"bytes": "/sj/9sN19Vz0gYPW8r14ok7IyVFlHrqj7dPpf1wqtwA=", // <-- is this a Encoded64 public key?
"type": 1,
"uint": 0
}
}
I tried a few things using the Algo JS SDK. I’m trying to get something similar to what Algo Explorer does by displaying the right human-readable public key.
$ python3 -c "import base64, sys, algosdk; [print(algosdk.encoding.encode_address(base64.b64decode(line.strip()))) for line in sys.stdin if line.strip()]" <<< /sj/9sN19Vz0gYPW8r14ok7IyVFlHrqj7dPpf1wqtwA=
73EP75WDOX2VZ5EBQPLPFPLYUJHMRSKRMUPLVI7N2PUX6XBKW4AOFKMFRI
Thanks for your reply.
We managed to get this line translated into JS SDK and produced the same result.
For anyone who is looking for a JS solution, here is the code: