aboutsummaryrefslogtreecommitdiffstats
path: root/packages/asset-buyer/src/utils
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-09-15 20:08:19 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-09-15 20:14:55 +0800
commit4e59be9afce49fca8b396c305d5271c8299c85c1 (patch)
tree845ccbb9d0d68c59d45b7b05c32adae626757560 /packages/asset-buyer/src/utils
parent190bf2599c1327fffd03d8a9d50bc7568190cf33 (diff)
downloaddexon-sol-tools-4e59be9afce49fca8b396c305d5271c8299c85c1.tar
dexon-sol-tools-4e59be9afce49fca8b396c305d5271c8299c85c1.tar.gz
dexon-sol-tools-4e59be9afce49fca8b396c305d5271c8299c85c1.tar.bz2
dexon-sol-tools-4e59be9afce49fca8b396c305d5271c8299c85c1.tar.lz
dexon-sol-tools-4e59be9afce49fca8b396c305d5271c8299c85c1.tar.xz
dexon-sol-tools-4e59be9afce49fca8b396c305d5271c8299c85c1.tar.zst
dexon-sol-tools-4e59be9afce49fca8b396c305d5271c8299c85c1.zip
Implement ProvidedOrderFetcher
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);
+ },
};