aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contract-wrappers/src/schemas
diff options
context:
space:
mode:
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'],
+};