useContract() function
Use this resolve a contract address to a smart contract instance.
Example
const { contract, isLoading, error } = useContract("{{contract_address}}");
Signature:
export declare function useContract(
contractAddress: RequiredParam<ContractAddress>,
): UseContractResult<SmartContract>;
Parameters
Parameter | Type | Description |
---|---|---|
contractAddress | RequiredParam<ContractAddress> | the address of the deployed contract |
Returns:
UseContractResult<SmartContract>
a response object that includes the contract once it is resolved