diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-10-09 08:05:57 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-10-09 08:05:57 +0800 |
commit | 37322f9f4ed903ad2556ebb8a278f1a7050eebbd (patch) | |
tree | 9de50a08c6199328230d34c2ba480c9955626189 /ui/app/token-util.js | |
parent | bf92d2ffec3f827adf1d269c4638f1673c38b4ac (diff) | |
download | tangerine-wallet-browser-37322f9f4ed903ad2556ebb8a278f1a7050eebbd.tar tangerine-wallet-browser-37322f9f4ed903ad2556ebb8a278f1a7050eebbd.tar.gz tangerine-wallet-browser-37322f9f4ed903ad2556ebb8a278f1a7050eebbd.tar.bz2 tangerine-wallet-browser-37322f9f4ed903ad2556ebb8a278f1a7050eebbd.tar.lz tangerine-wallet-browser-37322f9f4ed903ad2556ebb8a278f1a7050eebbd.tar.xz tangerine-wallet-browser-37322f9f4ed903ad2556ebb8a278f1a7050eebbd.tar.zst tangerine-wallet-browser-37322f9f4ed903ad2556ebb8a278f1a7050eebbd.zip |
Fix token values being undefined
Diffstat (limited to 'ui/app/token-util.js')
-rw-r--r-- | ui/app/token-util.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/app/token-util.js b/ui/app/token-util.js index 3d61ad1ca..6e4992763 100644 --- a/ui/app/token-util.js +++ b/ui/app/token-util.js @@ -111,3 +111,8 @@ export function calcTokenAmount (value, decimals) { const multiplier = Math.pow(10, Number(decimals || 0)) return new BigNumber(String(value)).div(multiplier).toNumber() } + +export function getTokenValue (tokenParams = []) { + const valueData = tokenParams.find(param => param.name === '_value') + return valueData && valueData.value +} |