Skip to main content

useTypedContract

Callable

  • useTypedContract<TContract>(address: string, typechainFactory: ContractFactory<TContract>, options?: { staticProvider?: { chainId: string; enable: boolean } }): { contract: null | TContract; error: null | Error }

  • Returns an ethers contract instance which can be used with other hooks as well as directly calling functions on the contract.


    Type parameters

    Parameters

    • address: string
    • typechainFactory: ContractFactory<TContract>
    • optionaloptions: { staticProvider?: { chainId: string; enable: boolean } }

    Returns { contract: null | TContract; error: null | Error }

    • contract: null | TContract
    • error: null | Error