Closed hiendv closed 5 months ago
Thanks for a great suggestion @hiendv. I'm not 100% sure re: default providers (e.g., it might be better to error in this case as well so that your calls aren't leaked unintentionally), but the rest is doable. We might postpone this to when we will move to esm, since using provider types creates known compatibility issues due to the way ethers is built.
Do you mind if I make some improvements for docs/examples for now?
Yes, of course. Please go ahead 💪
for those using hardhat scripts, you can move forward with:
const [deployer, signer] = await ethers.getSigners();
const easSdk = new EAS(EASContractAddress, {signer} )
const offchain = await easSdk.getOffchain();
I understand that we need to inject a provider for legacy version detection when calling
eas.getOffchain
but the documentation is not made clear for this which causes the "provider wasn't set" error when people try to replicate the example.https://github.com/ethereum-attestation-service/eas-sdk/blob/939a12ab08cbb8687517484aa3c9678c58879309/README.md?plain=1#L157-L159
From my opinion, there should be a better resolution for the provider. How about splitting signer and provider?