aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/index.umd.ts
diff options
context:
space:
mode:
authorFrancesco Agosti <francesco.agosti93@gmail.com>2018-11-03 07:26:16 +0800
committerGitHub <noreply@github.com>2018-11-03 07:26:16 +0800
commit66261102de57e3bc86714577c021aa5c7e17c150 (patch)
tree2a146790ba3d0a632a23c7335a3dcbd9d5a8c881 /packages/instant/src/index.umd.ts
parentd0f20a4fd5d1ab563d4b1c941b55018da129334e (diff)
parent6748c36b033798de4eb56e5d4e49d1c4b4e7be1e (diff)
downloaddexon-sol-tools-66261102de57e3bc86714577c021aa5c7e17c150.tar
dexon-sol-tools-66261102de57e3bc86714577c021aa5c7e17c150.tar.gz
dexon-sol-tools-66261102de57e3bc86714577c021aa5c7e17c150.tar.bz2
dexon-sol-tools-66261102de57e3bc86714577c021aa5c7e17c150.tar.lz
dexon-sol-tools-66261102de57e3bc86714577c021aa5c7e17c150.tar.xz
dexon-sol-tools-66261102de57e3bc86714577c021aa5c7e17c150.tar.zst
dexon-sol-tools-66261102de57e3bc86714577c021aa5c7e17c150.zip
Merge pull request #1204 from 0xProject/feature/instant/maker-asset-datas-interface
[instant] Add `availableAssetDatas` to render method, fetch from asset-buyer if not specified, implement basic token selection
Diffstat (limited to 'packages/instant/src/index.umd.ts')
-rw-r--r--packages/instant/src/index.umd.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/instant/src/index.umd.ts b/packages/instant/src/index.umd.ts
index b269ad741..59d1e646f 100644
--- a/packages/instant/src/index.umd.ts
+++ b/packages/instant/src/index.umd.ts
@@ -7,8 +7,10 @@ import { ZeroExInstantOverlay, ZeroExInstantOverlayProps } from './index';
import { assert } from './util/assert';
export const render = (props: ZeroExInstantOverlayProps, selector: string = DEFAULT_ZERO_EX_CONTAINER_SELECTOR) => {
- assert.isHexString('props.assetData', props.assetData);
- assert.isValidLiquiditySource('props.liquiditySource', props.liquiditySource);
+ assert.isValidOrderSource('orderSource', props.orderSource);
+ if (!_.isUndefined(props.defaultSelectedAssetData)) {
+ assert.isHexString('defaultSelectedAssetData', props.defaultSelectedAssetData);
+ }
if (!_.isUndefined(props.additionalAssetMetaDataMap)) {
assert.isValidAssetMetaDataMap('props.additionalAssetMetaDataMap', props.additionalAssetMetaDataMap);
}
@@ -18,6 +20,9 @@ export const render = (props: ZeroExInstantOverlayProps, selector: string = DEFA
if (!_.isUndefined(props.networkId)) {
assert.isNumber('props.networkId', props.networkId);
}
+ if (!_.isUndefined(props.availableAssetDatas)) {
+ assert.areValidAssetDatas('availableAssetDatas', props.availableAssetDatas);
+ }
if (!_.isUndefined(props.onClose)) {
assert.isFunction('props.onClose', props.onClose);
}