aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/utils
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2018-12-23 10:11:40 +0800
committerAmir Bandeali <abandeali1@gmail.com>2019-01-08 02:31:11 +0800
commitb797a45d4a67ffd3fa21678e9bcce93e774bfd66 (patch)
tree500667845e71d5b274260ee9c2f21b7389fa50e8 /packages/pipeline/src/utils
parenteeb07d76fc81b786d83c4ab848cc538e5896e240 (diff)
downloaddexon-sol-tools-b797a45d4a67ffd3fa21678e9bcce93e774bfd66.tar.gz
dexon-sol-tools-b797a45d4a67ffd3fa21678e9bcce93e774bfd66.tar.zst
dexon-sol-tools-b797a45d4a67ffd3fa21678e9bcce93e774bfd66.zip
Do not attempt to parse tokenAddress if decoding data from multiAssetProxy
Diffstat (limited to 'packages/pipeline/src/utils')
-rw-r--r--packages/pipeline/src/utils/transformers/asset_proxy_id_types.ts16
-rw-r--r--packages/pipeline/src/utils/transformers/index.ts1
2 files changed, 17 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..bc83ad283
--- /dev/null
+++ b/packages/pipeline/src/utils/transformers/asset_proxy_id_types.ts
@@ -0,0 +1,16 @@
+import { AssetProxyId } from '@0x/types';
+
+import { AssetType } from '../../types';
+
+export function convertAssetProxyIdToType(assetProxyId: AssetProxyId): AssetType {
+ switch (assetProxyId) {
+ case AssetProxyId.ERC20:
+ return 'erc20';
+ case AssetProxyId.ERC721:
+ return 'erc721';
+ case AssetProxyId.MultiAsset:
+ return 'multiAsset';
+ default:
+ throw new Error(`${assetProxyId} not a supported assetProxyId`);
+ }
+}
diff --git a/packages/pipeline/src/utils/transformers/index.ts b/packages/pipeline/src/utils/transformers/index.ts
index 232c1c5de..31a4c9223 100644
--- a/packages/pipeline/src/utils/transformers/index.ts
+++ b/packages/pipeline/src/utils/transformers/index.ts
@@ -1,2 +1,3 @@
export * from './big_number';
export * from './number_to_bigint';
+export * from './asset_proxy_id_types';