Allow using Provider instead of Signer when creating SDK.
Pzixel opened this issue · 2 comments
Pzixel commented
Consider following code:
import { getMainnetSdk } from '@dethcrypto/eth-sdk-client' // yay, our SDK! It's tailored especially for our needs
const sdk = getMainnetSdk(ethers.getDefaultProvider() as any);
console.log(`DAI supply is`, (await sdk.dai.totalSupply()).toString());
It works just fine but we need to disable typecheck here to make it happen, otherwise it complains that Provider != Signer.
Consider using signerOrProvider: Signer | Provider
as an argument here similarly to how typechain
handles this.