Issue
I am querying data from raydium using their SDK, but i am trying to do it in Python instead. So, I am obtaining an address:
<BN: b870e12dd379891561d2e9fa8f26431834eb736f2f24fc2a2a4dff1fd5dca4df>
And I know it correspond to :
PublicKey(DQyrAcCrDXQ7NeoqGgDCZwBvWDcYmFCjSb9JtteuvPpz)]
But anyone know how one could decode the first into the second please, so i could implement this in Python.
Thanks
Solution
With Solana use base58
for encode address. In python, you can use module base58
to encode from hex string address.
import base58
hex_sting="b870e12dd379891561d2e9fa8f26431834eb736f2f24fc2a2a4dff1fd5dca4df"
byte_string = bytes.fromhex(hex_sting)
encoded_string = base58.b58encode(byte_string).decode() # DQyrAcCrDXQ7NeoqGgDCZwBvWDcYmFCjSb9JtteuvPpz
Answered By - TanThien
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.