add Infura endpoints

This commit is contained in:
Barry Gitarts 2019-12-20 12:29:29 -05:00 committed by Barry G
parent 751b4f2a97
commit 2c898763b2
2 changed files with 6 additions and 1 deletions

View File

@ -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()

4
src/remote/infura.js Normal file
View File

@ -0,0 +1,4 @@
export default {
mainnet: 'https://mainnet.infura.io/v3/a2687d7078ff46d3b5f3f58cb97d3e44',
ropsten: 'https://ropsten.infura.io/v3/a2687d7078ff46d3b5f3f58cb97d3e44'
}