I am trying to get the PDA for a mint account in order to get NFT metadata. I am using solana-py library.
from solana import publickey
pda = publickey.PublicKey("AHZdk7qrX16vpw4oQgDcyhAR3SJtNS28epaznGrAvFxs").find_program_address(
seeds=[b"metadata"], program_id=publickey.PublicKey("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"))
But I am getting the following error:
...site-packages\solana\publickey.py", line 87, in find_program_address raise NotImplementedError("find_program_address not implemented") NotImplementedError: find_program_address not implemented
What is it wrong?
EDIT 1:
Watched some code and try this but still not working
from solana.publickey import PublicKey
METADATA_PROGRAM_ID = PublicKey('metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s')
mint_key = "8Rjxaxy8ZNAGTojzQSAMSPatNiop9C9PRPY5A29qhrCT"
PDA = PublicKey.find_program_address(
[b'metadata', bytes(METADATA_PROGRAM_ID), bytes(PublicKey(mint_key))],
METADATA_PROGRAM_ID
)[0]
print(PDA)
EDIT 2:
It was the version of solana-py It was using! Is working now