liquid-funding/app/utils/currencies.js

37 lines
1.1 KiB
JavaScript
Raw Normal View History

import SNT from 'Embark/contracts/SNT'
2019-01-04 15:52:01 -05:00
import sntIco from 'cryptocurrency-icons/svg/color/snt.svg'
2018-12-01 17:16:58 -05:00
2018-11-30 13:36:09 -05:00
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'
2019-02-06 14:33:08 -05:00
export const TOKEN_API = 'https://raw.githubusercontent.com/TrustWallet/tokens/master/tokens'
2018-11-30 13:36:09 -05:00
export const currencies = [
{
2019-02-07 15:15:31 -05:00
value: 'WETH',
label: 'Wrapped Ether',
2018-11-30 13:36:09 -05:00
img: `${TOKEN_COIN_API}/60.png`,
2019-02-07 15:15:31 -05:00
width: '5%'
2018-11-30 13:36:09 -05:00
},
{
value: SNT._address,
2019-02-13 16:02:43 -05:00
label: 'SNT',
img: sntIco,
contract: SNT
2018-11-30 13:36:09 -05:00
},
{
value: '0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359',
label: 'DAI',
2019-02-06 14:33:08 -05:00
img: `${TOKEN_API}/0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359.png`,
2019-02-07 15:15:31 -05:00
width: '5%'
2018-11-30 16:19:46 -05:00
}
2018-11-30 13:36:09 -05:00
]
2018-11-30 16:19:46 -05:00
export const getTokenLabel = value => {
const token = currencies.find(currency => currency.value === value)
return token ? token.label : null
}
2019-01-11 15:55:42 -05:00
export const getTokenAddress = label => {
const token = currencies.find(currency => currency.label == label)
return token ? token.value : null
}