Functions
getCredentialNFTFromLocator
getCredentialNFTFromLocator(
locator
):Promise
<object
>
Retrieves a Verifiable Credential NFT from a locator.
This function performs the following steps:
- Parses the locator string to extract NFT details.
- Verifies that the NFT belongs to a supported Verifiable Credentials chain.
- Fetches the NFT’s metadata and verifies it belongs to a Verifiable Credentials collection.
- Returns the NFT and the corresponding credentials collection.
Parameters
Parameter | Type | Description |
---|---|---|
locator | string | The locator string of the credential, formatted as “chain:contractAddress:tokenId” (e.g., “polygon:0x1B887669437644aA348c518844660ef8d63bd643:1”). |
Returns
Promise
<object
>
An object containing:
collection
: The collection that the NFT belongs to, including the credential metadata.nft
: The NFT with its metadata.
collection
collection:
CredentialsCollection
nft
nft:
NftWithMetadata
=vcNft
Throws
Will throw an error if the NFT is not on a supported Verifiable Credentials chain or if the NFT is not associated with a Verifiable Credentials collection.