Closed francesco-plt closed 1 year ago
This is likely coming from a difference in versions of some ethers
packages.
The current version of ethr-did depends on ethers@5.7.x
(or rather some @ethersproject/*
packages)
You are probably using some other version that is causing the difference in types.
The // @ts-ignore
you are already using should be enough as a workaround.
An alternative is to cast provider
to any
:
const provider = getDefaultProvider(process.env.INFURA_PROJECT_ID, "sepolia");
const ethrDID = new EthrDID({
privateKey,
provider as any, // casting to any should convince typescript that it's fine.
registry: '...'
});
Thanks, using version 5.7.2
and importing providers.Provider
fixed it.
Current Behavior
Expected Behavior
No compile errors, since the type of
provider
and the type expected by the constructor ofEthrDID
forprovider
should match.Failure Information
I have not find a way to cast
provider
as of typeProvider
as defined byethers
. If I do the following:Then I get the following error: