blob: ffeaaca52381eccb0fdf25bae4f81c927f13e111 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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 'erc20';
case AssetProxyId.ERC721:
return 'erc721';
case AssetProxyId.MultiAsset:
return 'multiAsset';
default:
throw new Error(`${assetProxyId} not a supported assetProxyId`);
}
}
|