> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crossmint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ContractMetadataService

Service for retrieving and managing contract metadata.

## Constructors

### new ContractMetadataService()

> **new ContractMetadataService**(`chain`): [`ContractMetadataService`](./ContractMetadataService)

Initializes a new instance of the ContractMetadataService.

#### Parameters

| Parameter | Type                                 | Description                |
| --------- | ------------------------------------ | -------------------------- |
| `chain`   | [`VCChain`](../type-aliases/VCChain) | The blockchain to be used. |

#### Returns

[`ContractMetadataService`](./ContractMetadataService)

#### Defined in

[verifiableCredentialsSDK/presentation/contractMetadata.ts:20](https://github.com/Crossmint/crossmint-sdk/blob/main/packages/client/verifiable-credentials/src/verifiableCredentialsSDK/presentation/contractMetadata.ts#L20)

## Properties

| Property | Type                                 | Description                                       | Defined in                                                                                                                                                                                                                    |
| -------- | ------------------------------------ | ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `chain`  | [`VCChain`](../type-aliases/VCChain) | The blockchain on which the contract is deployed. | [verifiableCredentialsSDK/presentation/contractMetadata.ts:14](https://github.com/Crossmint/crossmint-sdk/blob/main/packages/client/verifiable-credentials/src/verifiableCredentialsSDK/presentation/contractMetadata.ts#L14) |

## Methods

### getContractMetadata()

> **getContractMetadata**(`contractAddress`): `Promise`\<`any`>

Retrieves metadata for a given contract.

#### Parameters

| Parameter         | Type     | Description                  |
| ----------------- | -------- | ---------------------------- |
| `contractAddress` | `string` | The 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](https://github.com/Crossmint/crossmint-sdk/blob/main/packages/client/verifiable-credentials/src/verifiableCredentialsSDK/presentation/contractMetadata.ts#L31)

***

### getContractsWithCredentialMetadata()

> **getContractsWithCredentialMetadata**(`collections`): `Promise`\<[`CredentialsCollection`](../interfaces/CredentialsCollection)\[]>

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

#### Parameters

| Parameter     | Type                                        | Description                                            |
| ------------- | ------------------------------------------- | ------------------------------------------------------ |
| `collections` | [`Collection`](../interfaces/Collection)\[] | An array of collections containing contract addresses. |

#### Returns

`Promise`\<[`CredentialsCollection`](../interfaces/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](https://github.com/Crossmint/crossmint-sdk/blob/main/packages/client/verifiable-credentials/src/verifiableCredentialsSDK/presentation/contractMetadata.ts#L48)
