useContractType

Hook for determining the type of contract for a contract address.

This is useful if you want to determine if a contract is a prebuilt contract .

Example

import { useContractType } from "@thirdweb-dev/react";
function App() {
const { data, isLoading, error } = useContractType(contractAddress);
}
function useContractType(
contractAddress: RequiredParam<string>,
): UseQueryResult<
| null
| "split"
| "edition-drop"
| "edition"
| "marketplace"
| "marketplace-v3"
| "multiwrap"
| "nft-collection"
| "nft-drop"
| "pack"
| "signature-drop"
| "token-drop"
| "token"
| "vote"
| "custom",
unknown
>;

Parameters

The address of the contract

Type

let contractAddress: RequiredParam<string>;

Returns

let returnType: UseQueryResult<
| null
| "split"
| "edition-drop"
| "edition"
| "marketplace"
| "marketplace-v3"
| "multiwrap"
| "nft-collection"
| "nft-drop"
| "pack"
| "signature-drop"
| "token-drop"
| "token"
| "vote"
| "custom",
unknown
>;

Query result containing the type of the contract in the data property