aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-10-23 04:50:08 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-10-23 04:50:08 +0800
commit15ed3b35df1103ac9b0b4104551ecff9559ddb9b (patch)
tree46f54eb03514544ccb179df037f3458b17ed8901 /packages/instant/src
parenta017f5e38561a152e8a757b340c1b0c6b3a3e21f (diff)
downloaddexon-sol-tools-15ed3b35df1103ac9b0b4104551ecff9559ddb9b.tar
dexon-sol-tools-15ed3b35df1103ac9b0b4104551ecff9559ddb9b.tar.gz
dexon-sol-tools-15ed3b35df1103ac9b0b4104551ecff9559ddb9b.tar.bz2
dexon-sol-tools-15ed3b35df1103ac9b0b4104551ecff9559ddb9b.tar.lz
dexon-sol-tools-15ed3b35df1103ac9b0b4104551ecff9559ddb9b.tar.xz
dexon-sol-tools-15ed3b35df1103ac9b0b4104551ecff9559ddb9b.tar.zst
dexon-sol-tools-15ed3b35df1103ac9b0b4104551ecff9559ddb9b.zip
chore: change order of code to be clearer
Diffstat (limited to 'packages/instant/src')
-rw-r--r--packages/instant/src/types.ts1
-rw-r--r--packages/instant/src/util/asset.ts3
2 files changed, 3 insertions, 1 deletions
diff --git a/packages/instant/src/types.ts b/packages/instant/src/types.ts
index 7323123c3..c340623ad 100644
--- a/packages/instant/src/types.ts
+++ b/packages/instant/src/types.ts
@@ -41,6 +41,7 @@ export interface ERC721Asset {
assetData: string;
metaData: ERC721AssetMetaData;
}
+
export interface Asset {
assetData: string;
metaData: AssetMetaData;
diff --git a/packages/instant/src/util/asset.ts b/packages/instant/src/util/asset.ts
index 4e3b2b946..bf6cd663d 100644
--- a/packages/instant/src/util/asset.ts
+++ b/packages/instant/src/util/asset.ts
@@ -16,10 +16,11 @@ export const assetUtils = {
};
},
getMetaDataOrThrow: (assetData: string, metaDataMap: ObjectMap<AssetMetaData>, network: Network): AssetMetaData => {
- let mainnetAssetData: string | undefined = assetData;
+ let mainnetAssetData: string | undefined;
if (network !== Network.Mainnet) {
mainnetAssetData = assetUtils.getAssociatedAssetDataIfExists(assetData, network);
}
+ mainnetAssetData = assetData;
if (_.isUndefined(mainnetAssetData)) {
throw new Error(ZeroExInstantError.AssetMetaDataNotAvailable);
}