Skip to main content

useContractMetadata() function

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

Use this to get the contract metadata for a (built-in or custom) contract.

Example

const {
data: contractMetadata,
isLoading,
error,
} = useContractMetadata("{{contract_address}}");

Signature:

export declare function useContractMetadata(
contractAddress: RequiredParam<ContractAddress>,
): 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
contractAddressRequiredParam<ContractAddress>the address of the deployed contract

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 response object that includes the contract metadata of the deployed contract