diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-09-19 20:13:06 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-09-19 20:13:06 +0800 |
commit | 903e2f4f8a1de54bae3863ecbfab1855a2edc55f (patch) | |
tree | 3035f198852bc2b1ba6c42f02058241b71ddab8d /src/0x.ts | |
parent | 4aeb6226d557ef924eb2182b383f5e77d7fc8199 (diff) | |
download | dexon-sol-tools-903e2f4f8a1de54bae3863ecbfab1855a2edc55f.tar dexon-sol-tools-903e2f4f8a1de54bae3863ecbfab1855a2edc55f.tar.gz dexon-sol-tools-903e2f4f8a1de54bae3863ecbfab1855a2edc55f.tar.bz2 dexon-sol-tools-903e2f4f8a1de54bae3863ecbfab1855a2edc55f.tar.lz dexon-sol-tools-903e2f4f8a1de54bae3863ecbfab1855a2edc55f.tar.xz dexon-sol-tools-903e2f4f8a1de54bae3863ecbfab1855a2edc55f.tar.zst dexon-sol-tools-903e2f4f8a1de54bae3863ecbfab1855a2edc55f.zip |
Verify ZeroExConfig
Diffstat (limited to 'src/0x.ts')
-rw-r--r-- | src/0x.ts | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -32,6 +32,7 @@ import { TransactionReceiptWithDecodedLogs, LogWithDecodedArgs, } from './types'; +import {zeroExConfigSchema} from './schemas/zero_ex_config_schema'; // Customize our BigNumber instances bigNumberConfigs.configure(); @@ -180,6 +181,9 @@ export class ZeroEx { */ constructor(provider: Web3Provider, config?: ZeroExConfig) { assert.isWeb3Provider('provider', provider); + if (!_.isUndefined(config)) { + assert.doesConformToSchema('config', config, zeroExConfigSchema); + } if (_.isUndefined((provider as any).sendAsync)) { // Web3@1.0 provider doesn't support synchronous http requests, // so it only has an async `send` method, instead of a `send` and `sendAsync` in web3@0.x.x` |