Skip to content

Commit

Permalink
fix: use StaticJsonRpcProvider in ethersAdapter
Browse files Browse the repository at this point in the history
  • Loading branch information
micwallace committed Nov 10, 2023
1 parent 997eb73 commit ebfb8e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions javascript/engine-js/src/wallet/EthersAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class EthersAdapter implements IWalletAdapter {

// TODO: add all chain URLs into some configuration.
const provider = stateMutability === "view" ?
new ethers.providers.JsonRpcProvider(this.getRpcUrl(chain), chain) :
new ethers.providers.StaticJsonRpcProvider(this.getRpcUrl(chain), chain) :
(await this.getEthersProvider()).getSigner();

return new Contract(contractAddr, [abiData], provider);
Expand Down Expand Up @@ -174,7 +174,7 @@ export class EthersAdapter implements IWalletAdapter {
console.log("Get ethereum events. chain " + chain + "; contract " + contractAddr + "; event " + event + ";");
console.log(inputs);

const provider = new ethers.providers.JsonRpcProvider(this.getRpcUrl(chain));
const provider = new ethers.providers.StaticJsonRpcProvider(this.getRpcUrl(chain), chain);

const contract = new Contract(contractAddr, [{
name: event,
Expand Down

0 comments on commit ebfb8e7

Please sign in to comment.