diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2019-01-10 00:54:55 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2019-01-10 00:54:55 +0800 |
commit | fb3605026ef63ef6897010a52bf3f4c116cdf271 (patch) | |
tree | af3887e5f785e049daeaf795e0f3e4a9ad370d93 /packages/pipeline/src/utils/transformers/asset_proxy_id_types.ts | |
parent | 76dde294f10bb3d5c1074cd6599668bcb1cdd8ec (diff) | |
parent | 5b8c9122a292f6558c45440b053ceae52d36d495 (diff) | |
download | dexon-0x-contracts-fb3605026ef63ef6897010a52bf3f4c116cdf271.tar dexon-0x-contracts-fb3605026ef63ef6897010a52bf3f4c116cdf271.tar.gz dexon-0x-contracts-fb3605026ef63ef6897010a52bf3f4c116cdf271.tar.bz2 dexon-0x-contracts-fb3605026ef63ef6897010a52bf3f4c116cdf271.tar.lz dexon-0x-contracts-fb3605026ef63ef6897010a52bf3f4c116cdf271.tar.xz dexon-0x-contracts-fb3605026ef63ef6897010a52bf3f4c116cdf271.tar.zst dexon-0x-contracts-fb3605026ef63ef6897010a52bf3f4c116cdf271.zip |
Merge branch 'development' into feature/instant/tell-amount-available
Diffstat (limited to 'packages/pipeline/src/utils/transformers/asset_proxy_id_types.ts')
-rw-r--r-- | packages/pipeline/src/utils/transformers/asset_proxy_id_types.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/packages/pipeline/src/utils/transformers/asset_proxy_id_types.ts b/packages/pipeline/src/utils/transformers/asset_proxy_id_types.ts new file mode 100644 index 000000000..2cd05a616 --- /dev/null +++ b/packages/pipeline/src/utils/transformers/asset_proxy_id_types.ts @@ -0,0 +1,20 @@ +import { AssetProxyId } from '@0x/types'; + +import { AssetType } from '../../types'; + +/** + * Converts an assetProxyId to its string equivalent + * @param assetProxyId Id of AssetProxy + */ +export function convertAssetProxyIdToType(assetProxyId: AssetProxyId): AssetType { + switch (assetProxyId) { + case AssetProxyId.ERC20: + return AssetType.ERC20; + case AssetProxyId.ERC721: + return AssetType.ERC721; + case AssetProxyId.MultiAsset: + return AssetType.MultiAsset; + default: + throw new Error(`${assetProxyId} not a supported assetProxyId`); + } +} |