aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contract-wrappers/src/schemas
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-05-10 02:36:28 +0800
committerFabio Berger <me@fabioberger.com>2018-05-10 02:36:28 +0800
commit209266dbed9d7d038c90c2da8d9b99acab77c80c (patch)
treecfefd5ab15bc237716b15687629e0f41362a8e86 /packages/contract-wrappers/src/schemas
parent69a6166b6a1d39afc24b8dd950ec5d8539a03420 (diff)
downloaddexon-sol-tools-209266dbed9d7d038c90c2da8d9b99acab77c80c.tar
dexon-sol-tools-209266dbed9d7d038c90c2da8d9b99acab77c80c.tar.gz
dexon-sol-tools-209266dbed9d7d038c90c2da8d9b99acab77c80c.tar.bz2
dexon-sol-tools-209266dbed9d7d038c90c2da8d9b99acab77c80c.tar.lz
dexon-sol-tools-209266dbed9d7d038c90c2da8d9b99acab77c80c.tar.xz
dexon-sol-tools-209266dbed9d7d038c90c2da8d9b99acab77c80c.tar.zst
dexon-sol-tools-209266dbed9d7d038c90c2da8d9b99acab77c80c.zip
Split 0x.js into contract-wrappers, order-watcher but keep 0x.js as a unifying library with the same interface
Diffstat (limited to 'packages/contract-wrappers/src/schemas')
-rw-r--r--packages/contract-wrappers/src/schemas/zero_ex_contract_config_schema.ts5
-rw-r--r--packages/contract-wrappers/src/schemas/zero_ex_contract_private_network_config_schema.ts35
-rw-r--r--packages/contract-wrappers/src/schemas/zero_ex_contract_public_network_config_schema.ts29
3 files changed, 69 insertions, 0 deletions
diff --git a/packages/contract-wrappers/src/schemas/zero_ex_contract_config_schema.ts b/packages/contract-wrappers/src/schemas/zero_ex_contract_config_schema.ts
new file mode 100644
index 000000000..eec386643
--- /dev/null
+++ b/packages/contract-wrappers/src/schemas/zero_ex_contract_config_schema.ts
@@ -0,0 +1,5 @@
+export const zeroExContractConfigSchema = {
+ id: '/ZeroExContractConfig',
+ oneOf: [{ $ref: '/ZeroExContractPrivateNetworkConfig' }, { $ref: '/ZeroExContractPublicNetworkConfig' }],
+ type: 'object',
+};
diff --git a/packages/contract-wrappers/src/schemas/zero_ex_contract_private_network_config_schema.ts b/packages/contract-wrappers/src/schemas/zero_ex_contract_private_network_config_schema.ts
new file mode 100644
index 000000000..6d93d4e60
--- /dev/null
+++ b/packages/contract-wrappers/src/schemas/zero_ex_contract_private_network_config_schema.ts
@@ -0,0 +1,35 @@
+export const zeroExContractPrivateNetworkConfigSchema = {
+ id: '/ZeroExContractPrivateNetworkConfig',
+ 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/contract-wrappers/src/schemas/zero_ex_contract_public_network_config_schema.ts b/packages/contract-wrappers/src/schemas/zero_ex_contract_public_network_config_schema.ts
new file mode 100644
index 000000000..79a241cd2
--- /dev/null
+++ b/packages/contract-wrappers/src/schemas/zero_ex_contract_public_network_config_schema.ts
@@ -0,0 +1,29 @@
+export const zeroExContractPublicNetworkConfigSchema = {
+ id: '/ZeroExContractPublicNetworkConfig',
+ 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'],
+};