diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-11-01 10:50:37 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-11-01 10:50:37 +0800 |
commit | 3f918622bcce21ba104e0f13e71247796345ab0f (patch) | |
tree | fe0e6dd540871a17abe1274fa2c7e4a1ad40d90b /packages/instant/src/util | |
parent | 6091ee732d208eaf9889087b8308dfd0427b9be5 (diff) | |
download | dexon-sol-tools-3f918622bcce21ba104e0f13e71247796345ab0f.tar dexon-sol-tools-3f918622bcce21ba104e0f13e71247796345ab0f.tar.gz dexon-sol-tools-3f918622bcce21ba104e0f13e71247796345ab0f.tar.bz2 dexon-sol-tools-3f918622bcce21ba104e0f13e71247796345ab0f.tar.lz dexon-sol-tools-3f918622bcce21ba104e0f13e71247796345ab0f.tar.xz dexon-sol-tools-3f918622bcce21ba104e0f13e71247796345ab0f.tar.zst dexon-sol-tools-3f918622bcce21ba104e0f13e71247796345ab0f.zip |
feat: implement basic erc20 token selector
Diffstat (limited to 'packages/instant/src/util')
-rw-r--r-- | packages/instant/src/util/asset.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/instant/src/util/asset.ts b/packages/instant/src/util/asset.ts index 0576a7b60..2efaadbd2 100644 --- a/packages/instant/src/util/asset.ts +++ b/packages/instant/src/util/asset.ts @@ -98,4 +98,11 @@ export const assetUtils = { } return assetDataGroupIfExists[Network.Mainnet]; }, + getERC20AssetsFromAssets: (assets: Asset[]): ERC20Asset[] => { + const erc20sOrUndefined = _.map( + assets, + asset => (asset.metaData.assetProxyId === AssetProxyId.ERC20 ? (asset as ERC20Asset) : undefined), + ); + return _.compact(erc20sOrUndefined); + }, }; |