diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 0bb3512..794d0b9 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -19,6 +19,8 @@ jobs: run: yarn install --immutable && yarn build --noStats - name: Build website/ + env: + VITE_INFURA_KEY: ${{ secrets.INFURA_KEY }} run: cd website && yarn install --immutable && yarn build - name: Deploy diff --git a/examples/ethers/src/App.tsx b/examples/ethers/src/App.tsx index 9da8a1d..c7c2b4a 100644 --- a/examples/ethers/src/App.tsx +++ b/examples/ethers/src/App.tsx @@ -8,9 +8,7 @@ import nfts from "../../nfts" const ethersConfig = { ethers: { Contract }, - provider: getDefaultProvider("homestead", { - infura: import.meta.env.VITE_INFURA_KEY, - }), + provider: getDefaultProvider("homestead"), } function App() { diff --git a/website/src/App.tsx b/website/src/App.tsx index c4a1123..1d85f1a 100644 --- a/website/src/App.tsx +++ b/website/src/App.tsx @@ -1,5 +1,5 @@ import React from "react" -import { getDefaultProvider, Contract } from "ethers" +import { providers, Contract } from "ethers" import { NftProvider, FetcherDeclarationEthers } from "use-nft" import Base from "./Base" import Footer from "./Footer" @@ -11,9 +11,10 @@ const fetcher = [ "ethers", { ethers: { Contract }, - provider: getDefaultProvider("homestead", { - infura: import.meta.env.VITE_INFURA_KEY, - }), + provider: new providers.InfuraProvider( + "homestead", + import.meta.env.VITE_INFURA_KEY + ), }, ]