diff --git a/.env.template b/.env.template index 83078a9..6822f63 100644 --- a/.env.template +++ b/.env.template @@ -1,8 +1,8 @@ # Configure CRA PORT=3033 -# Infura is used as ENS provider to resolve domains and reverse addresses -REACT_APP_INFURA_API_KEY= +# POAP Node is used as ENS provider to resolve domains and reverse addresses +REACT_APP_POAP_NODE_API_KEY= # Request API access and include POAP API key # https://documentation.poap.tech/docs/api-access diff --git a/package.json b/package.json index 6703ee4..d9a24f7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@poap-xyz/poap-family", - "version": "1.6.8", + "version": "1.6.9", "author": { "name": "POAP", "url": "https://poap.xyz" diff --git a/src/loaders/ethereum.js b/src/loaders/ethereum.js index 09e67c3..4a87995 100644 --- a/src/loaders/ethereum.js +++ b/src/loaders/ethereum.js @@ -1,13 +1,13 @@ -import { InfuraProvider } from '@ethersproject/providers' +import { StaticJsonRpcProvider } from '@ethersproject/providers' import { Contract } from '@ethersproject/contracts' import { - INFURA_API_KEY, + MAINNET_PROVIDER_URL, MAINNET_ENS_REVERSE_RECORDS, ENS_REVERSE_RECORDS_BATCH_SIZE, ENS_RESOLVE_MAX_ERRORS, } from '../models/ethereum' -const ensProvider = new InfuraProvider('mainnet', INFURA_API_KEY) +const ensProvider = new StaticJsonRpcProvider(MAINNET_PROVIDER_URL, 'mainnet') const ensReverseRecordsContract = new Contract( MAINNET_ENS_REVERSE_RECORDS, [ diff --git a/src/models/ethereum.js b/src/models/ethereum.js index 5191845..e02e825 100644 --- a/src/models/ethereum.js +++ b/src/models/ethereum.js @@ -1,11 +1,11 @@ -const INFURA_API_KEY = process.env.REACT_APP_INFURA_API_KEY +const MAINNET_PROVIDER_URL = `https://public-eth-node.poap.tech/${process.env.REACT_APP_POAP_NODE_API_KEY}` const MAINNET_ENS_REVERSE_RECORDS = '0x3671aE578E63FdF66ad4F3E12CC0c0d71Ac7510C' const ENS_REVERSE_RECORDS_BATCH_SIZE = 300 const ENS_RESOLVE_BATCH_SIZE = 6 const ENS_RESOLVE_MAX_ERRORS = 100 export { - INFURA_API_KEY, + MAINNET_PROVIDER_URL, MAINNET_ENS_REVERSE_RECORDS, ENS_REVERSE_RECORDS_BATCH_SIZE, ENS_RESOLVE_BATCH_SIZE,