From 5d3e0e5cbddbd1d3ab9e63c5916ecb614e2ea58f Mon Sep 17 00:00:00 2001 From: Barry Gitarts Date: Thu, 12 Dec 2019 09:23:19 -0500 Subject: [PATCH] add mainnet build commands add mainnet token urls --- package.json | 2 ++ src/remote/graph.js | 3 ++- src/remote/kyber.js | 10 +++++++--- src/utils/currencies.js | 1 + 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 48b0557..5ef54d4 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,8 @@ "start": "node scripts/start.js", "ropsten": "REACT_APP_NETWORK=ropsten node scripts/start.js", "ropsten:build": "REACT_APP_NETWORK=ropsten node --max-old-space-size=4000 scripts/build.js", + "mainnet": "REACT_APP_NETWORK=mainnet node scripts/start.js", + "mainnet:build": "REACT_APP_NETWORK=mainnet node --max-old-space-size=4000 scripts/build.js", "build": "node scripts/build.js", "postbuild": "PUBLIC_URL=/ react-snap" }, diff --git a/src/remote/graph.js b/src/remote/graph.js index 2e6b070..bef5671 100644 --- a/src/remote/graph.js +++ b/src/remote/graph.js @@ -1,3 +1,4 @@ export const uris = { - ropsten: 'https://api.thegraph.com/subgraphs/name/bgits/liquid-funding-rinkeby' + ropsten: 'https://api.thegraph.com/subgraphs/name/bgits/liquid-funding-rinkeby', + mainnet: 'https://api.thegraph.com/subgraphs/name/bgits/assemble' } diff --git a/src/remote/kyber.js b/src/remote/kyber.js index 9310a7d..08b8d57 100644 --- a/src/remote/kyber.js +++ b/src/remote/kyber.js @@ -13,13 +13,17 @@ function createERC20Instance(address) { return new web3.eth.Contract(ERC20._jsonInterface, address) } +const imageUrls = { + DAI: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png' +} + function mapToCurrencyFormat(currency) { const { id, address, symbol, decimals } = currency const contract = createERC20Instance(address) return { value: address, label: symbol, - img: `${TOKEN_API}/${id}.png`, + img: imageUrls[symbol] || `${TOKEN_API}/${id}.png`, width: '2rem', contract, humanReadibleFn: generateHumanReadibleFn(decimals), @@ -37,7 +41,7 @@ function currencyFilter(currency) { export const kyberCurrencies = { ropsten: 'https://ropsten-api.kyber.network/currencies', - livenet: 'https://api.kyber.network/currencies' + mainnet: 'https://api.kyber.network/currencies' } export const getKyberCurrencies = async network => { @@ -45,7 +49,7 @@ export const getKyberCurrencies = async network => { const res = await fetch(uri) let currencies = await res.json() currencies = currencies.data - if (network !== 'livenet') { + if (network !== 'mainnet') { const res = await fetch(kyberCurrencies['livenet']) let livenetCurrencies = await res.json() livenetCurrencies = livenetCurrencies.data diff --git a/src/utils/currencies.js b/src/utils/currencies.js index 64f9d89..9b78267 100644 --- a/src/utils/currencies.js +++ b/src/utils/currencies.js @@ -8,6 +8,7 @@ import { toEther, toWei, compoundWhole, compoundToChain } from './conversions' export const TOKEN_ICON_API = 'https://raw.githubusercontent.com/TrustWallet/tokens/master/images' export const TOKEN_COIN_API = 'https://raw.githubusercontent.com/TrustWallet/tokens/master/coins' export const TOKEN_API = 'https://raw.githubusercontent.com/TrustWallet/tokens/master/tokens' +export const NEW_TOKEN_ICON_API = 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/' export const currencies = [ { value: 'ETH',