Get a fund account from Global State


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:

"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.

Could someone help me?

Welcome to Algorand!

See the discussion on the following topic: Interpreting encoded variables in application info - #5 by fabrice

Concretely, with a Python one-liner:

$ 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=

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:

algosdk.encodeAddress(Buffer.from('v5/jLdor/Yq+aXzb71Id+Dhzrx/L0WywU5hidqeE2Ic=', 'base64'))