aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-09-21 01:00:23 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-09-21 01:00:23 +0800
commit35c324f67c8022f3a71bc723bf69763bf651cb05 (patch)
treec5424e46887fc3852dca45e32ae80a04f085d5ab /packages
parent03e18ff7c60749fd33228b25077891da26e81d41 (diff)
downloaddexon-sol-tools-35c324f67c8022f3a71bc723bf69763bf651cb05.tar
dexon-sol-tools-35c324f67c8022f3a71bc723bf69763bf651cb05.tar.gz
dexon-sol-tools-35c324f67c8022f3a71bc723bf69763bf651cb05.tar.bz2
dexon-sol-tools-35c324f67c8022f3a71bc723bf69763bf651cb05.tar.lz
dexon-sol-tools-35c324f67c8022f3a71bc723bf69763bf651cb05.tar.xz
dexon-sol-tools-35c324f67c8022f3a71bc723bf69763bf651cb05.tar.zst
dexon-sol-tools-35c324f67c8022f3a71bc723bf69763bf651cb05.zip
Add utility to get assetDatas
Diffstat (limited to 'packages')
-rw-r--r--packages/asset-buyer/src/standard_relayer_api_asset_buyer_manager.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/packages/asset-buyer/src/standard_relayer_api_asset_buyer_manager.ts b/packages/asset-buyer/src/standard_relayer_api_asset_buyer_manager.ts
index 866bee46e..207713110 100644
--- a/packages/asset-buyer/src/standard_relayer_api_asset_buyer_manager.ts
+++ b/packages/asset-buyer/src/standard_relayer_api_asset_buyer_manager.ts
@@ -11,7 +11,6 @@ import { assetDataUtils } from './utils/asset_data_utils';
import { OrderProvider, StandardRelayerApiAssetBuyerManagerError } from './types';
-// TODO: Read-only list of available assetDatas
export class StandardRelayerAPIAssetBuyerManager {
// Map of assetData to AssetBuyer for that assetData
public readonly assetBuyerMap: ObjectMap<AssetBuyer>;
@@ -123,4 +122,12 @@ export class StandardRelayerAPIAssetBuyerManager {
const assetData = assetDataUtils.encodeERC20AssetData(tokenAddress);
return this.getAssetBuyerFromAssetData(assetData);
}
+ /**
+ * Get a list of all the assetDatas that the instance supports
+ *
+ * @return An array of assetData strings
+ */
+ public getAssetDatas(): string[] {
+ return _.keys(this.assetBuyerMap);
+ }
}