is there any way to get contract address from Asset ID?
A SHA-256 hash is used to derive the AssetId
from the ContractId
and SubId
. though, directly retrieving the ContractId from an AssetId is difficult because it requires reversing a hash function, which is computationally impractical.
Instead, you can usually track the mapping between ContractId and AssetId during the contract deployment or asset creation process. If you have this mapping saved somewhere, you can use it to find the ContractId for a specific AssetId.
can we use something like graphql queries to get this data?
Hi @lokesh-lync and @div-lync could you speak a little more directly to your use case? As @Nazeeh21 explained, it’s a bit of a round about way to go about retrieving the Contract’s address and I suspect there is a far more direct way for it to be retrieved.
Hi @DevilAsap I note that you raised a similar question on the Sway forum. For triaging purposes I think that’s the best to place for such a question as @Nazeeh21 this is more fundamental to the way AssetID
s are constructed. As such it’s not directly related to the Typescript SDK.
This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.