Service for retrieving and managing contract metadata.

Constructors

new ContractMetadataService()

new ContractMetadataService(chain): ContractMetadataService

Initializes a new instance of the ContractMetadataService.

Parameters

ParameterTypeDescription
chainVCChainThe blockchain to be used.

Returns

ContractMetadataService

Defined in

verifiableCredentialsSDK/presentation/contractMetadata.ts:20

Properties

PropertyTypeDescriptionDefined in
chainVCChainThe blockchain on which the contract is deployed.verifiableCredentialsSDK/presentation/contractMetadata.ts:14

Methods

getContractMetadata()

getContractMetadata(contractAddress): Promise<any>

Retrieves metadata for a given contract.

Parameters

ParameterTypeDescription
contractAddressstringThe address of the contract.

Returns

Promise<any>

The metadata object or null if the contractURI call returns null.

Throws

Will throw an error if the retrieval process fails.

Defined in

verifiableCredentialsSDK/presentation/contractMetadata.ts:31


getContractsWithCredentialMetadata()

getContractsWithCredentialMetadata(collections): Promise<CredentialsCollection[]>

Retrieves metadata for multiple contracts and filters those that are verifiable credentials collections.

Parameters

ParameterTypeDescription
collectionsCollection[]An array of collections containing contract addresses.

Returns

Promise<CredentialsCollection[]>

A promise that resolves to an array of collections with valid verifiable credential metadata.

Throws

Will continue to the next collection if an error occurs during metadata retrieval.

Defined in

verifiableCredentialsSDK/presentation/contractMetadata.ts:48