aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js/src/schemas
diff options
context:
space:
mode:
authorJacob Evans <dekz@dekz.net>2018-02-27 10:12:11 +0800
committerJacob Evans <jacob@dekz.net>2018-02-27 10:47:09 +0800
commit6961169f89c4cd8480aca9c720cd8299aec9bbc0 (patch)
tree51b9a6a2f0dbaee50a9758a7983fe201d5898354 /packages/0x.js/src/schemas
parent3d66feb89f8e4cfcb0b5251a96d02ef31f3ae34b (diff)
parent709fa9e02ec21cee9fc145b4a578742c8dd190aa (diff)
downloaddexon-sol-tools-6961169f89c4cd8480aca9c720cd8299aec9bbc0.tar
dexon-sol-tools-6961169f89c4cd8480aca9c720cd8299aec9bbc0.tar.gz
dexon-sol-tools-6961169f89c4cd8480aca9c720cd8299aec9bbc0.tar.bz2
dexon-sol-tools-6961169f89c4cd8480aca9c720cd8299aec9bbc0.tar.lz
dexon-sol-tools-6961169f89c4cd8480aca9c720cd8299aec9bbc0.tar.xz
dexon-sol-tools-6961169f89c4cd8480aca9c720cd8299aec9bbc0.tar.zst
dexon-sol-tools-6961169f89c4cd8480aca9c720cd8299aec9bbc0.zip
Merge branch 'development' into feature/0x.js/lowercase-addresses
Diffstat (limited to 'packages/0x.js/src/schemas')
-rw-r--r--packages/0x.js/src/schemas/zero_ex_config_schema.ts24
-rw-r--r--packages/0x.js/src/schemas/zero_ex_private_network_config_schema.ts35
-rw-r--r--packages/0x.js/src/schemas/zero_ex_public_network_config_schema.ts29
3 files changed, 65 insertions, 23 deletions
diff --git a/packages/0x.js/src/schemas/zero_ex_config_schema.ts b/packages/0x.js/src/schemas/zero_ex_config_schema.ts
index 546b1c2d0..a9c3c64fc 100644
--- a/packages/0x.js/src/schemas/zero_ex_config_schema.ts
+++ b/packages/0x.js/src/schemas/zero_ex_config_schema.ts
@@ -1,27 +1,5 @@
export const zeroExConfigSchema = {
id: '/ZeroExConfig',
- properties: {
- networkId: {
- type: 'number',
- minimum: 0,
- },
- gasPrice: { $ref: '/Number' },
- exchangeContractAddress: { $ref: '/Address' },
- tokenRegistryContractAddress: { $ref: '/Address' },
- orderWatcherConfig: {
- type: 'object',
- properties: {
- pollingIntervalMs: {
- type: 'number',
- minimum: 0,
- },
- numConfirmations: {
- type: 'number',
- minimum: 0,
- },
- },
- },
- },
+ oneOf: [{ $ref: '/ZeroExPrivateNetworkConfig' }, { $ref: '/ZeroExPublicNetworkConfig' }],
type: 'object',
- required: ['networkId'],
};
diff --git a/packages/0x.js/src/schemas/zero_ex_private_network_config_schema.ts b/packages/0x.js/src/schemas/zero_ex_private_network_config_schema.ts
new file mode 100644
index 000000000..f7f649a6d
--- /dev/null
+++ b/packages/0x.js/src/schemas/zero_ex_private_network_config_schema.ts
@@ -0,0 +1,35 @@
+export const zeroExPrivateNetworkConfigSchema = {
+ id: '/ZeroExPrivateNetworkConfig',
+ properties: {
+ networkId: {
+ type: 'number',
+ minimum: 1,
+ },
+ gasPrice: { $ref: '/Number' },
+ zrxContractAddress: { $ref: '/Address' },
+ exchangeContractAddress: { $ref: '/Address' },
+ tokenRegistryContractAddress: { $ref: '/Address' },
+ tokenTransferProxyContractAddress: { $ref: '/Address' },
+ orderWatcherConfig: {
+ type: 'object',
+ properties: {
+ pollingIntervalMs: {
+ type: 'number',
+ minimum: 0,
+ },
+ numConfirmations: {
+ type: 'number',
+ minimum: 0,
+ },
+ },
+ },
+ },
+ type: 'object',
+ required: [
+ 'networkId',
+ 'zrxContractAddress',
+ 'exchangeContractAddress',
+ 'tokenRegistryContractAddress',
+ 'tokenTransferProxyContractAddress',
+ ],
+};
diff --git a/packages/0x.js/src/schemas/zero_ex_public_network_config_schema.ts b/packages/0x.js/src/schemas/zero_ex_public_network_config_schema.ts
new file mode 100644
index 000000000..9da31481a
--- /dev/null
+++ b/packages/0x.js/src/schemas/zero_ex_public_network_config_schema.ts
@@ -0,0 +1,29 @@
+export const zeroExPublicNetworkConfigSchema = {
+ id: '/ZeroExPublicNetworkConfig',
+ properties: {
+ networkId: {
+ type: 'number',
+ enum: [1, 3, 4, 42, 50],
+ },
+ gasPrice: { $ref: '/Number' },
+ zrxContractAddress: { $ref: '/Address' },
+ exchangeContractAddress: { $ref: '/Address' },
+ tokenRegistryContractAddress: { $ref: '/Address' },
+ tokenTransferProxyContractAddress: { $ref: '/Address' },
+ orderWatcherConfig: {
+ type: 'object',
+ properties: {
+ pollingIntervalMs: {
+ type: 'number',
+ minimum: 0,
+ },
+ numConfirmations: {
+ type: 'number',
+ minimum: 0,
+ },
+ },
+ },
+ },
+ type: 'object',
+ required: ['networkId'],
+};