0

I have a script to fetch asset name, address from a policy id with blockfrost API, now I need to see if the asset is in a smart contract script. I have no coding skills but followed a tutorial to get this far. Thanks!

1 Answer 1

2

PyCardano can help you to find the address type.

For example, addr1wyzynye0nksztrfzpsulsq7whr3vgh7uvp0gm4p0x42ckkqqq6kxq is the script address of Spacebudz. You can decode it into an Address object using pycardano, and the address_type field will tell you the information about this address.

>>> from pycardano import Address
>>> addr = Address.from_primitive("addr1wyzynye0nksztrfzpsulsq7whr3vgh7uvp0gm4p0x42ckkqqq6kxq")
>>> addr.address_type
<AddressType.SCRIPT_NONE: 7>

The output SCRIPT_NONE tells us that this address's payment part is a script (first half is SCRIPT), and the address doesn't have staking part (second half is NONE). All possible address types could be found in this doc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.