diff options
author | Fabio Berger <me@fabioberger.com> | 2018-06-15 06:03:47 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-06-15 06:03:47 +0800 |
commit | 0d0c1af7f741834f076a604b776d4542c4dbb6ec (patch) | |
tree | 2730beb85bef7b64db11911cbd727b29afe4946c /packages/website/ts/utils/utils.ts | |
parent | fb55def54f44413a8b0a7f001fb18d6eac89e422 (diff) | |
parent | e7eb220c503118631a6b23071c71b4b55df5b5cf (diff) | |
download | dexon-sol-tools-0d0c1af7f741834f076a604b776d4542c4dbb6ec.tar dexon-sol-tools-0d0c1af7f741834f076a604b776d4542c4dbb6ec.tar.gz dexon-sol-tools-0d0c1af7f741834f076a604b776d4542c4dbb6ec.tar.bz2 dexon-sol-tools-0d0c1af7f741834f076a604b776d4542c4dbb6ec.tar.lz dexon-sol-tools-0d0c1af7f741834f076a604b776d4542c4dbb6ec.tar.xz dexon-sol-tools-0d0c1af7f741834f076a604b776d4542c4dbb6ec.tar.zst dexon-sol-tools-0d0c1af7f741834f076a604b776d4542c4dbb6ec.zip |
Merge branch 'v2-prototype' into feature/combinatorial-testing
* v2-prototype:
Run prettify
Implement allowance and final flow step
Render TokenAllowance
Add utilities for getting tokens from tokensByAddress
Wrap AllowanceToggle in redux container
Diffstat (limited to 'packages/website/ts/utils/utils.ts')
-rw-r--r-- | packages/website/ts/utils/utils.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts index eb384fbb4..fdee264b2 100644 --- a/packages/website/ts/utils/utils.ts +++ b/packages/website/ts/utils/utils.ts @@ -322,8 +322,14 @@ export const utils = { return this.isDevelopment() || this.isStaging() || this.isDogfood(); }, getEthToken(tokenByAddress: TokenByAddress): Token { + return utils.getTokenBySymbol(constants.ETHER_TOKEN_SYMBOL, tokenByAddress); + }, + getZrxToken(tokenByAddress: TokenByAddress): Token { + return utils.getTokenBySymbol(constants.ZRX_TOKEN_SYMBOL, tokenByAddress); + }, + getTokenBySymbol(symbol: string, tokenByAddress: TokenByAddress): Token { const tokens = _.values(tokenByAddress); - const etherToken = _.find(tokens, { symbol: constants.ETHER_TOKEN_SYMBOL }); - return etherToken; + const token = _.find(tokens, { symbol }); + return token; }, }; |