diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-09-21 01:00:23 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-09-21 01:00:23 +0800 |
commit | 35c324f67c8022f3a71bc723bf69763bf651cb05 (patch) | |
tree | c5424e46887fc3852dca45e32ae80a04f085d5ab /packages/asset-buyer/src | |
parent | 03e18ff7c60749fd33228b25077891da26e81d41 (diff) | |
download | dexon-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/asset-buyer/src')
-rw-r--r-- | packages/asset-buyer/src/standard_relayer_api_asset_buyer_manager.ts | 9 |
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); + } } |