From 6313d9a8f41750cec5ffa71bdaf78f9afc4ec341 Mon Sep 17 00:00:00 2001 From: neithanmo Date: Tue, 5 Dec 2023 15:30:18 -0600 Subject: [PATCH 1/2] feature(avalanche): Add schema to support eip712 --- avalanche/eip712.schema.json | 71 ++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 avalanche/eip712.schema.json diff --git a/avalanche/eip712.schema.json b/avalanche/eip712.schema.json new file mode 100644 index 00000000..419cdd5f --- /dev/null +++ b/avalanche/eip712.schema.json @@ -0,0 +1,71 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "properties": { + "blockchainName": { + "enum": ["avalanche"] + }, + "chainId": { + "enum": [43114] + }, + "contracts": { + "items": { + "properties": { + "address": { + "pattern": "^0x[a-f0-9]{40}$", + "type": "string" + }, + "contractName": { + "type": "string" + }, + "messages": { + "items": { + "additionalProperties": false, + "properties": { + "mapper": { + "additionalProperties": false, + "properties": { + "fields": { + "items": { + "additionalProperties": false, + "properties": { + "label": { + "type": "string" + }, + "path": { + "type": "string" + } + }, + "required": ["path", "label"], + "type": "object" + }, + "type": "array" + }, + "label": { + "type": "string" + } + }, + "required": ["label", "fields"], + "type": "object" + }, + "schema": { + "type": "object" + } + }, + "required": ["schema", "mapper"], + "type": "object" + }, + "type": "array" + } + }, + "required": ["address", "contractName", "messages"], + "type": "object" + }, + "type": "array" + }, + "name": { + "type": "string" + } + }, + "required": ["blockchainName", "contracts", "name", "chainId"], + "type": "object" +} From 05010dea9dc9e1e3d6e17cfb5792f9756c4a0073 Mon Sep 17 00:00:00 2001 From: neithanmo Date: Tue, 26 Dec 2023 14:57:19 -0600 Subject: [PATCH 2/2] fix: Run validate script --- avalanche/eip712.schema.json | 146 ++++++++++++++++++++--------------- 1 file changed, 84 insertions(+), 62 deletions(-) diff --git a/avalanche/eip712.schema.json b/avalanche/eip712.schema.json index 419cdd5f..2b57696e 100644 --- a/avalanche/eip712.schema.json +++ b/avalanche/eip712.schema.json @@ -1,71 +1,93 @@ { - "$schema": "http://json-schema.org/draft-04/schema#", - "properties": { - "blockchainName": { - "enum": ["avalanche"] - }, - "chainId": { - "enum": [43114] - }, - "contracts": { - "items": { - "properties": { - "address": { - "pattern": "^0x[a-f0-9]{40}$", - "type": "string" - }, - "contractName": { - "type": "string" - }, - "messages": { + "$schema": "http://json-schema.org/draft-04/schema#", + "properties": { + "blockchainName": { + "enum": [ + "avalanche" + ] + }, + "chainId": { + "enum": [ + 43114 + ] + }, + "contracts": { "items": { - "additionalProperties": false, - "properties": { - "mapper": { - "additionalProperties": false, - "properties": { - "fields": { - "items": { - "additionalProperties": false, - "properties": { - "label": { - "type": "string" - }, - "path": { - "type": "string" - } - }, - "required": ["path", "label"], - "type": "object" - }, - "type": "array" + "properties": { + "address": { + "pattern": "^0x[a-f0-9]{40}$", + "type": "string" + }, + "contractName": { + "type": "string" }, - "label": { - "type": "string" + "messages": { + "items": { + "additionalProperties": false, + "properties": { + "mapper": { + "additionalProperties": false, + "properties": { + "fields": { + "items": { + "additionalProperties": false, + "properties": { + "label": { + "type": "string" + }, + "path": { + "type": "string" + } + }, + "required": [ + "path", + "label" + ], + "type": "object" + }, + "type": "array" + }, + "label": { + "type": "string" + } + }, + "required": [ + "label", + "fields" + ], + "type": "object" + }, + "schema": { + "type": "object" + } + }, + "required": [ + "schema", + "mapper" + ], + "type": "object" + }, + "type": "array" } - }, - "required": ["label", "fields"], - "type": "object" }, - "schema": { - "type": "object" - } - }, - "required": ["schema", "mapper"], - "type": "object" + "required": [ + "address", + "contractName", + "messages" + ], + "type": "object" }, "type": "array" - } }, - "required": ["address", "contractName", "messages"], - "type": "object" - }, - "type": "array" + "name": { + "type": "string" + } }, - "name": { - "type": "string" - } - }, - "required": ["blockchainName", "contracts", "name", "chainId"], - "type": "object" -} + "required": [ + "blockchainName", + "contracts", + "name", + "chainId" + ], + "type": "object" +} \ No newline at end of file