From 2c898763b2725e9f633b904b08190526250f31ac Mon Sep 17 00:00:00 2001 From: Barry Gitarts Date: Fri, 20 Dec 2019 12:29:29 -0500 Subject: [PATCH] add Infura endpoints --- src/dapp.js | 3 ++- src/remote/infura.js | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 src/remote/infura.js diff --git a/src/dapp.js b/src/dapp.js index f496fa0..5355d2d 100644 --- a/src/dapp.js +++ b/src/dapp.js @@ -20,6 +20,7 @@ import { getUsdPrice, getPrices, generatePairKey } from './utils/prices' import { currencies, currencyOrder } from './utils/currencies' import { uris } from './remote/graph' import { getKyberCurrencies } from './remote/kyber' +import Infura from './remote/infura' class App extends React.Component { state = { @@ -31,7 +32,7 @@ class App extends React.Component { componentDidMount(){ const network = process.env.REACT_APP_NETWORK || 'ropsten' - this.scanner = new EthScan(new HttpProvider('https://mainnet.infura.io/v3/a2687d7078ff46d3b5f3f58cb97d3e44')) + this.scanner = new EthScan(new HttpProvider(Infura[network])) this.setCurrencies(network) this.setGraphClient(network) this.grabAddress() diff --git a/src/remote/infura.js b/src/remote/infura.js new file mode 100644 index 0000000..7863614 --- /dev/null +++ b/src/remote/infura.js @@ -0,0 +1,4 @@ +export default { + mainnet: 'https://mainnet.infura.io/v3/a2687d7078ff46d3b5f3f58cb97d3e44', + ropsten: 'https://ropsten.infura.io/v3/a2687d7078ff46d3b5f3f58cb97d3e44' +}