aboutsummaryrefslogtreecommitdiffstats
path: root/packages/asset-buyer/src/asset_buyer.ts
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-03 00:43:11 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-03 00:43:11 +0800
commite7e9c2a2ebf32ed96e859c9c50a5c9614e372bc7 (patch)
tree6b59698cab57e55e2d67d3185c8a36496c0f7026 /packages/asset-buyer/src/asset_buyer.ts
parentf341626e290a5c8241400b8dd0d9cce2dcfeb405 (diff)
parent7c30fd4b2da83c9522f9137f4d18e6c308f2b66f (diff)
downloaddexon-0x-contracts-e7e9c2a2ebf32ed96e859c9c50a5c9614e372bc7.tar.gz
dexon-0x-contracts-e7e9c2a2ebf32ed96e859c9c50a5c9614e372bc7.tar.zst
dexon-0x-contracts-e7e9c2a2ebf32ed96e859c9c50a5c9614e372bc7.zip
Merge branch 'development' into feature/instant/simulated-progress-bar
Diffstat (limited to 'packages/asset-buyer/src/asset_buyer.ts')
-rw-r--r--packages/asset-buyer/src/asset_buyer.ts12
1 files changed, 11 insertions, 1 deletions
diff --git a/packages/asset-buyer/src/asset_buyer.ts b/packages/asset-buyer/src/asset_buyer.ts
index ed52f2d9d..49743404f 100644
--- a/packages/asset-buyer/src/asset_buyer.ts
+++ b/packages/asset-buyer/src/asset_buyer.ts
@@ -76,7 +76,8 @@ export class AssetBuyer {
): AssetBuyer {
assert.isWeb3Provider('provider', provider);
assert.isWebUri('sraApiUrl', sraApiUrl);
- const orderProvider = new StandardRelayerAPIOrderProvider(sraApiUrl);
+ const networkId = options.networkId || constants.DEFAULT_ASSET_BUYER_OPTS.networkId;
+ const orderProvider = new StandardRelayerAPIOrderProvider(sraApiUrl, networkId);
const assetBuyer = new AssetBuyer(provider, orderProvider, options);
return assetBuyer;
}
@@ -240,6 +241,15 @@ export class AssetBuyer {
}
}
/**
+ * Get the asset data of all assets that are purchaseable with ether token (wETH) in the order provider passed in at init.
+ *
+ * @return An array of asset data strings that can be purchased using wETH.
+ */
+ public async getAvailableAssetDatasAsync(): Promise<string[]> {
+ const etherTokenAssetData = this._getEtherTokenAssetDataOrThrow();
+ return this.orderProvider.getAvailableMakerAssetDatasAsync(etherTokenAssetData);
+ }
+ /**
* Grab orders from the map, if there is a miss or it is time to refresh, fetch and process the orders
*/
private async _getOrdersAndFillableAmountsAsync(