aboutsummaryrefslogtreecommitdiffstats
path: root/packages/asset-buyer/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'packages/asset-buyer/src/utils')
-rw-r--r--packages/asset-buyer/src/utils/assert.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/asset-buyer/src/utils/assert.ts b/packages/asset-buyer/src/utils/assert.ts
index c4d611477..0085ca41e 100644
--- a/packages/asset-buyer/src/utils/assert.ts
+++ b/packages/asset-buyer/src/utils/assert.ts
@@ -2,7 +2,7 @@ import { assert as sharedAssert } from '@0xproject/assert';
import { schemas } from '@0xproject/json-schemas';
import * as _ from 'lodash';
-import { BuyQuote, OrderFetcher } from '../types';
+import { BuyQuote, OrderFetcher, OrderFetcherRequest } from '../types';
export const assert = {
...sharedAssert,
@@ -20,4 +20,9 @@ export const assert = {
isValidOrderFetcher(variableName: string, orderFetcher: OrderFetcher): void {
sharedAssert.isFunction(`${variableName}.fetchOrdersAsync`, orderFetcher.fetchOrdersAsync);
},
+ isValidOrderFetcherRequest(variableName: string, orderFetcherRequest: OrderFetcherRequest): void {
+ sharedAssert.isHexString(`${variableName}.makerAssetData`, orderFetcherRequest.makerAssetData);
+ sharedAssert.isHexString(`${variableName}.takerAssetData`, orderFetcherRequest.takerAssetData);
+ sharedAssert.isNumber(`${variableName}.networkId`, orderFetcherRequest.networkId);
+ },
};