aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/util
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-10-19 08:42:32 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-10-19 08:42:32 +0800
commit7bc2df56023641c27de62bc7e9a8953767cbc076 (patch)
treea1d2fad7ebe06d126474d25cf21647849456b42f /packages/instant/src/util
parent7a8adf9db5a83c3f44d6fe9e84e00ff1ec1e88e0 (diff)
downloaddexon-sol-tools-7bc2df56023641c27de62bc7e9a8953767cbc076.tar
dexon-sol-tools-7bc2df56023641c27de62bc7e9a8953767cbc076.tar.gz
dexon-sol-tools-7bc2df56023641c27de62bc7e9a8953767cbc076.tar.bz2
dexon-sol-tools-7bc2df56023641c27de62bc7e9a8953767cbc076.tar.lz
dexon-sol-tools-7bc2df56023641c27de62bc7e9a8953767cbc076.tar.xz
dexon-sol-tools-7bc2df56023641c27de62bc7e9a8953767cbc076.tar.zst
dexon-sol-tools-7bc2df56023641c27de62bc7e9a8953767cbc076.zip
feat: add network to state and use it where relevant
Diffstat (limited to 'packages/instant/src/util')
-rw-r--r--packages/instant/src/util/asset.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/instant/src/util/asset.ts b/packages/instant/src/util/asset.ts
index a105a7c2b..d50efb5d1 100644
--- a/packages/instant/src/util/asset.ts
+++ b/packages/instant/src/util/asset.ts
@@ -6,17 +6,17 @@ import { assetDataNetworkMapping } from '../data/asset_data_network_mapping';
import { Asset, AssetMetaData, Network, ZeroExInstantError } from '../types';
export const assetUtils = {
- createAssetFromAssetData: (assetData: string, assetMetaDataMap: ObjectMap<AssetMetaData>): Asset => {
+ createAssetFromAssetData: (
+ assetData: string,
+ assetMetaDataMap: ObjectMap<AssetMetaData>,
+ network: Network,
+ ): Asset => {
return {
assetData,
- metaData: assetUtils.getMetaDataOrThrow(assetData, assetMetaDataMap),
+ metaData: assetUtils.getMetaDataOrThrow(assetData, assetMetaDataMap, network),
};
},
- getMetaDataOrThrow: (
- assetData: string,
- metaDataMap: ObjectMap<AssetMetaData>,
- network: Network = Network.Mainnet,
- ): AssetMetaData => {
+ getMetaDataOrThrow: (assetData: string, metaDataMap: ObjectMap<AssetMetaData>, network: Network): AssetMetaData => {
let mainnetAssetData: string | undefined = assetData;
if (network !== Network.Mainnet) {
mainnetAssetData = assetUtils.getAssociatedAssetDataIfExists(assetData, network);