Migrating to 0.12.*
useContractCall
is getting replaced by useCall
It is being replaced with useCall
that supports typed contracts from type-chain.
Before:
const [tokenBalance] =
useContractCall({
abi: ERC20Interface,
address: tokenAddress,
method: 'balanceOf',
args: [address],
}) ?? []
After:
const { value: tokenBalance } =
useCall({
contract: new Contract(tokenAddress, ERC20Interface),
method: 'balanceOf',
args: [address],
}) ?? {}
useChainCall
is getting replaced by useRawCall
useRawCall
returns an object in the form of { value, error }
for each calls.
This allows to get individual errors for each failing call.