Skip to main content

useMetadata() function

This feature is currently in beta and may change based on feedback that we receive.

Use this to get the metadata of your

Example

const { data: metadata, isLoading, error } = useMetadata(SmartContract);

Signature:

export declare function useMetadata(
contract: RequiredParam<SmartContract | ValidContractInstance>,
): import("@tanstack/react-query").UseQueryResult<
{
[x: string]: import("@thirdweb-dev/sdk/dist/browser").Json;
description?: string | undefined;
image?: any;
external_link?: string | undefined;
name: string;
},
unknown
>;

Parameters

ParameterTypeDescription
contractRequiredParam<SmartContract | ValidContractInstance>an instance of a

Returns:

import("@tanstack/react-query").UseQueryResult<{ [x: string]: import("@thirdweb-dev/sdk/dist/browser").Json; description?: string | undefined; image?: any; external_link?: string | undefined; name: string; }, unknown>

a object containing the metadata