aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/utils
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-06-29 17:34:38 +0800
committerFabio Berger <me@fabioberger.com>2018-06-29 17:34:38 +0800
commitaa2616b307d3384791f1dbafc76999e7c4cf801f (patch)
tree0d8f11f66dcd595fefb184dd0dabc2d69183b782 /packages/website/ts/utils
parent3062c18ebda8e55831038f140313000fd6d2cf71 (diff)
parent518a2da0275632a5dd61f99a105163ff5a074927 (diff)
downloaddexon-sol-tools-aa2616b307d3384791f1dbafc76999e7c4cf801f.tar
dexon-sol-tools-aa2616b307d3384791f1dbafc76999e7c4cf801f.tar.gz
dexon-sol-tools-aa2616b307d3384791f1dbafc76999e7c4cf801f.tar.bz2
dexon-sol-tools-aa2616b307d3384791f1dbafc76999e7c4cf801f.tar.lz
dexon-sol-tools-aa2616b307d3384791f1dbafc76999e7c4cf801f.tar.xz
dexon-sol-tools-aa2616b307d3384791f1dbafc76999e7c4cf801f.tar.zst
dexon-sol-tools-aa2616b307d3384791f1dbafc76999e7c4cf801f.zip
Merge v2-prototype
Diffstat (limited to 'packages/website/ts/utils')
-rw-r--r--packages/website/ts/utils/configs.ts3
-rw-r--r--packages/website/ts/utils/utils.ts8
2 files changed, 9 insertions, 2 deletions
diff --git a/packages/website/ts/utils/configs.ts b/packages/website/ts/utils/configs.ts
index ace8a5ba0..2f89f8ccb 100644
--- a/packages/website/ts/utils/configs.ts
+++ b/packages/website/ts/utils/configs.ts
@@ -63,10 +63,9 @@ export const configs = {
TKN: '/images/token_icons/tokencard.png',
TRST: '/images/token_icons/trust.png',
} as { [symbol: string]: string },
- IS_MAINNET_ENABLED: true,
GOOGLE_ANALYTICS_ID: 'UA-98720122-1',
LAST_LOCAL_STORAGE_FILL_CLEARANCE_DATE: '2017-11-22',
- LAST_LOCAL_STORAGE_TRACKED_TOKEN_CLEARANCE_DATE: '2017-12-19',
+ LAST_LOCAL_STORAGE_TRACKED_TOKEN_CLEARANCE_DATE: '2018-6-25',
OUTDATED_WRAPPED_ETHERS: [
{
42: {
diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts
index ff06d923d..d12ae6a98 100644
--- a/packages/website/ts/utils/utils.ts
+++ b/packages/website/ts/utils/utils.ts
@@ -355,6 +355,11 @@ export const utils = {
const token = _.find(tokens, { symbol });
return token;
},
+ getTrackedTokens(tokenByAddress: TokenByAddress): Token[] {
+ const allTokens = _.values(tokenByAddress);
+ const trackedTokens = _.filter(allTokens, t => this.isTokenTracked(t));
+ return trackedTokens;
+ },
getFormattedAmountFromToken(token: Token, tokenState: TokenState): string {
return utils.getFormattedAmount(tokenState.balance, token.decimals, token.symbol);
},
@@ -381,4 +386,7 @@ export const utils = {
return BrowserType.Other;
}
},
+ isTokenTracked(token: Token): boolean {
+ return !_.isUndefined(token.trackedTimestamp);
+ },
};