diff --git a/examples/with-ethers/src/index.ts b/examples/with-ethers/src/index.ts index a73a4aaec..17f095ba2 100644 --- a/examples/with-ethers/src/index.ts +++ b/examples/with-ethers/src/index.ts @@ -29,7 +29,10 @@ async function main() { // Bring your own provider (such as Alchemy or Infura: https://docs.ethers.org/v5/api/providers/) const network = "goerli"; - const provider = new ethers.providers.InfuraProvider(network); + const provider = new ethers.providers.JsonRpcProvider( + "https://goerli.infura.io/v3/84842078b09946638c03157f83405213", // using the default community project + network + ); const connectedSigner = turnkeySigner.connect(provider); const chainId = await connectedSigner.getChainId(); diff --git a/packages/ethers/src/__tests__/index-test.ts b/packages/ethers/src/__tests__/index-test.ts index 5962d24d5..f2cd09f3d 100644 --- a/packages/ethers/src/__tests__/index-test.ts +++ b/packages/ethers/src/__tests__/index-test.ts @@ -60,8 +60,10 @@ describe("TurnkeySigner", () => { `process.env.BANNED_TO_ADDRESS` ); - // @ts-ignore - const provider = hre.ethers.provider; + const provider = new ethers.providers.JsonRpcProvider( + hre.config.networks.localhost.url, + hre.config.networks.localhost.chainId + ); connectedSigner = new TurnkeySigner({ apiPublicKey, @@ -75,7 +77,10 @@ describe("TurnkeySigner", () => { eip1193 = new Eip1193Bridge(connectedSigner, provider); - setBalance(expectedEthAddress, ethers.utils.parseEther("999999")); + await provider.send("hardhat_setBalance", [ + expectedEthAddress, + "0xffffffffffffffffffffffff", + ]); }); testCase("basics", async () => {