This hook is the foundation for many other hooks in useink. It returns a ChainContract<T> type and will automatically set the RPC url for the chain you specify.
import { useContract } from'useink'constCONTRACT_ADDRESS='..'constALEPH_CONTRACT_ADDRESS='..'exportconstMyContractView:React.FC= () => {// The default chain will be used if you omit chainId as the third argument// The default chain is the first item in the chain config for UseInkProviderconstcontract=useContract(CONTRACT_ADDRESS, metadata)constalephContract=useContract(ALEPH_CONTRACT_ADDRESS, metadata,'aleph')// use with other hooks...// e.g. useCall, useCallSubscription, useTx, etcreturnnull}
{// A contract object that contains metadata, and an api client set with a specific RPC url contract: ChainContract<T>,// A strongly typed chain name found in `useink/chains` chainId: ChainId,} |undefined