aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/utils/transformers/asset_proxy_id_types.ts
blob: bc83ad2835c81c7496c424c5b3ac16a2210e2522 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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`);
    }
}