diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-09-21 22:03:47 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-09-21 22:03:47 +0800 |
commit | c48cf3ab3b74a9082eb30540115534c7432667ac (patch) | |
tree | 52c47bb1b55622f09aa560ffeb1af9d4f0a9c46e /packages/asset-buyer | |
parent | c64dcec772d8f5bfa7a32c5e60bfe808229d4d5e (diff) | |
download | dexon-0x-contracts-c48cf3ab3b74a9082eb30540115534c7432667ac.tar dexon-0x-contracts-c48cf3ab3b74a9082eb30540115534c7432667ac.tar.gz dexon-0x-contracts-c48cf3ab3b74a9082eb30540115534c7432667ac.tar.bz2 dexon-0x-contracts-c48cf3ab3b74a9082eb30540115534c7432667ac.tar.lz dexon-0x-contracts-c48cf3ab3b74a9082eb30540115534c7432667ac.tar.xz dexon-0x-contracts-c48cf3ab3b74a9082eb30540115534c7432667ac.tar.zst dexon-0x-contracts-c48cf3ab3b74a9082eb30540115534c7432667ac.zip |
Make asset buyer map private
Diffstat (limited to 'packages/asset-buyer')
-rw-r--r-- | packages/asset-buyer/src/standard_relayer_api_asset_buyer_manager.ts | 8 |
1 files changed, 4 insertions, 4 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 207713110..947c738a1 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 @@ -13,7 +13,7 @@ import { OrderProvider, StandardRelayerApiAssetBuyerManagerError } from './types export class StandardRelayerAPIAssetBuyerManager { // Map of assetData to AssetBuyer for that assetData - public readonly assetBuyerMap: ObjectMap<AssetBuyer>; + private readonly _assetBuyerMap: ObjectMap<AssetBuyer>; /** * Returns an array of all assetDatas available at the provided sraApiUrl * @param sraApiUrl The standard relayer API base HTTP url you would like to source orders from. @@ -82,7 +82,7 @@ export class StandardRelayerAPIAssetBuyerManager { orderRefreshIntervalMs?: number, ) { assert.assert(assetDatas.length > 0, `Expected 'assetDatas' to be a non-empty array.`); - this.assetBuyerMap = _.reduce( + this._assetBuyerMap = _.reduce( assetDatas, (accAssetBuyerMap: ObjectMap<AssetBuyer>, assetData: string) => { accAssetBuyerMap[assetData] = new AssetBuyer( @@ -104,7 +104,7 @@ export class StandardRelayerAPIAssetBuyerManager { * @return An instance of AssetBuyer */ public getAssetBuyerFromAssetData(assetData: string): AssetBuyer { - const assetBuyer = this.assetBuyerMap[assetData]; + const assetBuyer = this._assetBuyerMap[assetData]; if (_.isUndefined(assetBuyer)) { throw new Error( `${StandardRelayerApiAssetBuyerManagerError.AssetBuyerNotFound}: For assetData ${assetData}`, @@ -128,6 +128,6 @@ export class StandardRelayerAPIAssetBuyerManager { * @return An array of assetData strings */ public getAssetDatas(): string[] { - return _.keys(this.assetBuyerMap); + return _.keys(this._assetBuyerMap); } } |