diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-06-22 15:37:40 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-06-29 01:38:07 +0800 |
commit | 366a9502dd8ffc62f03b728ed46c592762fe170e (patch) | |
tree | 59e5836bccfe851b989ced2c0577c57325b18ad2 /packages/website/ts/utils | |
parent | 988a3347582cd812aadeaa0cdaef67389c8d833d (diff) | |
download | dexon-sol-tools-366a9502dd8ffc62f03b728ed46c592762fe170e.tar dexon-sol-tools-366a9502dd8ffc62f03b728ed46c592762fe170e.tar.gz dexon-sol-tools-366a9502dd8ffc62f03b728ed46c592762fe170e.tar.bz2 dexon-sol-tools-366a9502dd8ffc62f03b728ed46c592762fe170e.tar.lz dexon-sol-tools-366a9502dd8ffc62f03b728ed46c592762fe170e.tar.xz dexon-sol-tools-366a9502dd8ffc62f03b728ed46c592762fe170e.tar.zst dexon-sol-tools-366a9502dd8ffc62f03b728ed46c592762fe170e.zip |
Sort wallet tokens by timestamp added and scroll to newly added token
Diffstat (limited to 'packages/website/ts/utils')
-rw-r--r-- | packages/website/ts/utils/utils.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts index ff06d923d..0ebcf737c 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 => t.isTracked); + return trackedTokens; + }, getFormattedAmountFromToken(token: Token, tokenState: TokenState): string { return utils.getFormattedAmount(tokenState.balance, token.decimals, token.symbol); }, |