Add eip712DomainSchema
to json-schemas
.
Add required field `domain` to `order` and `zeroExTransaction` schemas.
This commit is contained in:
parent
3688956ee5
commit
376f068719
14
packages/json-schemas/schemas/eip712_domain_schema.json
Normal file
14
packages/json-schemas/schemas/eip712_domain_schema.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"id": "/eip712DomainSchema",
|
||||
"properties": {
|
||||
"name": { "type": "string" },
|
||||
"version": { "type": "version" },
|
||||
"chainId": { "type": "number" },
|
||||
"verifyingContractAddress": { "$ref": "/addressSchema" }
|
||||
},
|
||||
"required": [
|
||||
"chainId",
|
||||
"verifyingContractAddress"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
@ -21,7 +21,7 @@
|
||||
"required": ["EIP712Domain"]
|
||||
},
|
||||
"primaryType": { "type": "string" },
|
||||
"domain": { "type": "object" },
|
||||
"domain": { "$ref": "/eip712DomainSchema" },
|
||||
"message": { "type": "object" }
|
||||
},
|
||||
"required": ["types", "primaryType", "domain", "message"]
|
||||
|
@ -11,10 +11,9 @@
|
||||
"makerAssetData": { "$ref": "/hexSchema" },
|
||||
"takerAssetData": { "$ref": "/hexSchema" },
|
||||
"salt": { "$ref": "/wholeNumberSchema" },
|
||||
"exchangeAddress": { "$ref": "/addressSchema" },
|
||||
"chainId": { "type": "number" },
|
||||
"feeRecipientAddress": { "$ref": "/addressSchema" },
|
||||
"expirationTimeSeconds": { "$ref": "/wholeNumberSchema" }
|
||||
"expirationTimeSeconds": { "$ref": "/wholeNumberSchema" },
|
||||
"domain": { "$ref": "/eip712DomainSchema" }
|
||||
},
|
||||
"required": [
|
||||
"makerAddress",
|
||||
@ -27,10 +26,9 @@
|
||||
"makerAssetData",
|
||||
"takerAssetData",
|
||||
"salt",
|
||||
"exchangeAddress",
|
||||
"chainId",
|
||||
"feeRecipientAddress",
|
||||
"expirationTimeSeconds"
|
||||
"expirationTimeSeconds",
|
||||
"domain"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
{
|
||||
"id": "/zeroExTransactionSchema",
|
||||
"properties": {
|
||||
"verifyingContractAddress": { "$ref": "/addressSchema" },
|
||||
"data": { "$ref": "/hexSchema" },
|
||||
"signerAddress": { "$ref": "/addressSchema" },
|
||||
"salt": { "$ref": "/wholeNumberSchema" }
|
||||
"salt": { "$ref": "/wholeNumberSchema" },
|
||||
"domain": { "$ref": "/eip712DomainSchema" }
|
||||
},
|
||||
"required": ["verifyingContractAddress", "data", "salt", "signerAddress"],
|
||||
"required": ["data", "salt", "signerAddress", "domain"],
|
||||
"type": "object"
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import * as blockRangeSchema from '../schemas/block_range_schema.json';
|
||||
import * as callDataSchema from '../schemas/call_data_schema.json';
|
||||
import * as ecSignatureParameterSchema from '../schemas/ec_signature_parameter_schema.json';
|
||||
import * as ecSignatureSchema from '../schemas/ec_signature_schema.json';
|
||||
import * as eip712DomainSchema from '../schemas/eip712_domain_schema.json';
|
||||
import * as eip712TypedDataSchema from '../schemas/eip712_typed_data_schema.json';
|
||||
import * as hexSchema from '../schemas/hex_schema.json';
|
||||
import * as indexFilterValuesSchema from '../schemas/index_filter_values_schema.json';
|
||||
@ -52,6 +53,7 @@ export const schemas = {
|
||||
hexSchema,
|
||||
ecSignatureParameterSchema,
|
||||
ecSignatureSchema,
|
||||
eip712DomainSchema,
|
||||
eip712TypedDataSchema,
|
||||
indexFilterValuesSchema,
|
||||
orderCancellationRequestsSchema,
|
||||
|
@ -216,9 +216,11 @@ describe('Schema', () => {
|
||||
takerAssetData: NULL_ADDRESS,
|
||||
salt: '67006738228878699843088602623665307406148487219438534730168799356281242528500',
|
||||
feeRecipientAddress: NULL_ADDRESS,
|
||||
exchangeAddress: NULL_ADDRESS,
|
||||
chainId: CHAIN_ID,
|
||||
expirationTimeSeconds: '42',
|
||||
domain: {
|
||||
verifyingContractAddress: NULL_ADDRESS,
|
||||
chainId: CHAIN_ID,
|
||||
},
|
||||
};
|
||||
const relayerApiOrder = {
|
||||
order,
|
||||
|
@ -15,6 +15,7 @@
|
||||
"./schemas/call_data_schema.json",
|
||||
"./schemas/ec_signature_parameter_schema.json",
|
||||
"./schemas/ec_signature_schema.json",
|
||||
"./schemas/eip712_domain_schema.json",
|
||||
"./schemas/eip712_typed_data_schema.json",
|
||||
"./schemas/order_cancel_schema.json",
|
||||
"./schemas/order_fill_or_kill_requests_schema.json",
|
||||
|
Loading…
x
Reference in New Issue
Block a user