diff options
Diffstat (limited to 'packages/asset-buyer/src/utils')
-rw-r--r-- | packages/asset-buyer/src/utils/assert.ts | 8 | ||||
-rw-r--r-- | packages/asset-buyer/src/utils/asset_data_utils.ts | 4 | ||||
-rw-r--r-- | packages/asset-buyer/src/utils/order_fetcher_response_processor.ts | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/packages/asset-buyer/src/utils/assert.ts b/packages/asset-buyer/src/utils/assert.ts index 745ba726f..1d57ae9b8 100644 --- a/packages/asset-buyer/src/utils/assert.ts +++ b/packages/asset-buyer/src/utils/assert.ts @@ -3,7 +3,7 @@ import { schemas } from '@0xproject/json-schemas'; import { SignedOrder } from '@0xproject/types'; import * as _ from 'lodash'; -import { BuyQuote, OrderFetcher, OrderFetcherRequest } from '../types'; +import { BuyQuote, OrderProvider, OrderProviderRequest } from '../types'; export const assert = { ...sharedAssert, @@ -18,10 +18,10 @@ export const assert = { sharedAssert.isNumber(`${variableName}.feePercentage`, buyQuote.feePercentage); } }, - isValidOrderFetcher(variableName: string, orderFetcher: OrderFetcher): void { - sharedAssert.isFunction(`${variableName}.fetchOrdersAsync`, orderFetcher.fetchOrdersAsync); + isValidOrderFetcher(variableName: string, orderFetcher: OrderProvider): void { + sharedAssert.isFunction(`${variableName}.fetchOrdersAsync`, orderFetcher.getOrdersAsync); }, - isValidOrderFetcherRequest(variableName: string, orderFetcherRequest: OrderFetcherRequest): void { + isValidOrderFetcherRequest(variableName: string, orderFetcherRequest: OrderProviderRequest): void { sharedAssert.isHexString(`${variableName}.makerAssetData`, orderFetcherRequest.makerAssetData); sharedAssert.isHexString(`${variableName}.takerAssetData`, orderFetcherRequest.takerAssetData); sharedAssert.isNumber(`${variableName}.networkId`, orderFetcherRequest.networkId); diff --git a/packages/asset-buyer/src/utils/asset_data_utils.ts b/packages/asset-buyer/src/utils/asset_data_utils.ts index 10ff31057..d05ff2504 100644 --- a/packages/asset-buyer/src/utils/asset_data_utils.ts +++ b/packages/asset-buyer/src/utils/asset_data_utils.ts @@ -6,7 +6,7 @@ import { AssetBuyerError } from '../types'; export const assetDataUtils = { ...sharedAssetDataUtils, - getEtherTokenAssetData(contractWrappers: ContractWrappers): string { + getEtherTokenAssetDataOrThrow(contractWrappers: ContractWrappers): string { const etherTokenAddressIfExists = contractWrappers.etherToken.getContractAddressIfExists(); if (_.isUndefined(etherTokenAddressIfExists)) { throw new Error(AssetBuyerError.NoEtherTokenContractFound); @@ -14,7 +14,7 @@ export const assetDataUtils = { const etherTokenAssetData = sharedAssetDataUtils.encodeERC20AssetData(etherTokenAddressIfExists); return etherTokenAssetData; }, - getZrxTokenAssetData(contractWrappers: ContractWrappers): string { + getZrxTokenAssetDataOrThrow(contractWrappers: ContractWrappers): string { let zrxTokenAssetData: string; try { zrxTokenAssetData = contractWrappers.exchange.getZRXAssetData(); diff --git a/packages/asset-buyer/src/utils/order_fetcher_response_processor.ts b/packages/asset-buyer/src/utils/order_fetcher_response_processor.ts index f700cadf9..98ab6b9d1 100644 --- a/packages/asset-buyer/src/utils/order_fetcher_response_processor.ts +++ b/packages/asset-buyer/src/utils/order_fetcher_response_processor.ts @@ -8,7 +8,7 @@ import * as _ from 'lodash'; import { constants } from '../constants'; import { AssetBuyerOrdersAndFillableAmounts, - OrderFetcherResponse, + OrderProviderResponse, SignedOrderWithRemainingFillableMakerAssetAmount, } from '../types'; @@ -28,8 +28,8 @@ export const orderFetcherResponseProcessor = { * - Sort by rate */ async processAsync( - targetOrderFetcherResponse: OrderFetcherResponse, - feeOrderFetcherResponse: OrderFetcherResponse, + targetOrderFetcherResponse: OrderProviderResponse, + feeOrderFetcherResponse: OrderProviderResponse, zrxTokenAssetData: string, orderValidator?: OrderValidatorWrapper, ): Promise<AssetBuyerOrdersAndFillableAmounts> { |