SetProtocol / set.js

Javascript library for the Set Protocol V2
Apache License 2.0
33 stars 14 forks source link

Enable read operations without providing a signer. #122

Open Phips0812 opened 2 years ago

Phips0812 commented 2 years ago

Pure read operations like NavIssuanceAPI.getExpectedSetTokenIssueQuantity() should be able to be called with a default provider.

Currently it's required to set a provider gathered from a signer due to the following logic (ContractWrapper.ts:201):

const signer = (this.provider as JsonRpcProvider).getSigner(callerAddress);
const cacheKey = `NavIssuanceModule_${navIssuanceModuleAddress}_${await signer.getAddress()}`;

signer.getAddress() is not supported for a default provider.