dethcrypto/eth-sdk

Allow using Provider instead of Signer when creating SDK.

Pzixel opened this issue · 2 comments

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.

Duplicate of #63

I can try creating a PR if you're into merging it

@Pzixel yes please consider creating a PR. I will close this issue - as you mentioned it's a duplicate.