Skip to main content

useContractMetadata

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(>);

Signature:

export declare function useContractMetadata<TContract extends ValidContractInstance>(contract: RequiredParam<TContract>): UseQueryResult<RequiredParam<TContract> extends undefined ? undefined : Awaited<ReturnType<TContract["metadata"]["get"]>>, unknown>;

Parameters

ParameterTypeDescription
contractRequiredParam<TContract>the instance of the contract to get the metadata for

Returns:

UseQueryResult<RequiredParam<TContract> extends undefined ? undefined : Awaited<ReturnType<TContract["metadata"]["get"]>>, unknown>

a response object that includes the contract metadata of the deployed contract