parent
7793b0ab1a
commit
5d3e0e5cbd
|
@ -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"
|
||||
},
|
||||
|
|
|
@ -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'
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue