Hooks
useGetContractInfo
Hook for fetching token contract information including native tokens
Import
Usage
Return Type: UseQueryResult<ContractInfo>
The hook returns all properties from React Query’s UseQueryResult
with contract information data. Here’s the detailed structure:
Properties
data
ContractInfo | undefined
Object containing contract information:
chainId
: The numeric chain identifier (e.g. 1 for Ethereum mainnet)address
: The contract’s blockchain address in hex formatsource
: The source/origin of the contract metadata (e.g. “sequence”, “opensea”, etc)name
: The human-readable name of the contract or tokentype
: The contract’s interface type (“ERC20”, “ERC721”, “ERC1155”)symbol
: The token’s symbol/ticker (e.g. “ETH”, “USDC”)decimals
: The number of decimal places for token amounts (e.g. 18 for ETH)logoURI
: URL to the token/contract’s logo imagedeployed
: Boolean indicating if contract is deployed on-chainbytecodeHash
: Hash of the contract’s deployed bytecodeextensions
: Additional metadata fields specific to the contract typeupdatedAt
: ISO timestamp of when the metadata was last updatednotFound
: Boolean indicating if contract metadata could not be foundqueuedAt
: ISO timestamp of when metadata indexing was queuedstatus
: Current status of the metadata (“READY”, “PENDING”, “ERROR”)
For native tokens (when using ZERO_ADDRESS
), the response is enriched with network-specific information.
isLoading
boolean
Loading state for the data fetch.
isError
boolean
Error state indicating if the query failed.
error
Error | null
Any error that occurred during data fetching.
Parameters
The hook accepts two parameters:
args: GetContractInfoArgs
Parameter | Type | Description |
---|---|---|
chainID | string | Chain ID as string (e.g., “1” for Ethereum mainnet) |
contractAddress | string | Contract address or ZERO_ADDRESS for native token |
options: HooksOptions
Parameter | Type | Description |
---|---|---|
disabled | boolean | (Optional) Disable the query from automatically running |
retry | boolean | (Optional) Whether to retry failed queries |
Was this page helpful?