@0x/json-schemas
Advanced tools
Comparing version 5.4.1 to 6.0.0
[ | ||
{ | ||
"version": "6.0.0", | ||
"changes": [ | ||
{ | ||
"note": "Use ajv instead of jsonschema to improve performance", | ||
"pr": 28 | ||
} | ||
], | ||
"timestamp": 1616613438 | ||
}, | ||
{ | ||
"timestamp": 1610044030, | ||
@@ -4,0 +14,0 @@ "version": "5.4.1", |
@@ -8,2 +8,6 @@ <!-- | ||
## v6.0.0 - _March 24, 2021_ | ||
* Use ajv instead of jsonschema to improve performance (#28) | ||
## v5.4.1 - _January 7, 2021_ | ||
@@ -10,0 +14,0 @@ |
@@ -8,3 +8,3 @@ { | ||
"version": { | ||
"type": "version" | ||
"type": "string" | ||
}, | ||
@@ -11,0 +11,0 @@ "chainId": { |
@@ -1,4 +0,4 @@ | ||
export { ValidatorResult, Schema } from 'jsonschema'; | ||
export { SchemaValidator } from './schema_validator'; | ||
export { schemas } from './schemas'; | ||
export { Ajv } from 'ajv'; | ||
//# sourceMappingURL=index.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var jsonschema_1 = require("jsonschema"); | ||
exports.ValidatorResult = jsonschema_1.ValidatorResult; | ||
exports.schemas = exports.SchemaValidator = void 0; | ||
var schema_validator_1 = require("./schema_validator"); | ||
exports.SchemaValidator = schema_validator_1.SchemaValidator; | ||
Object.defineProperty(exports, "SchemaValidator", { enumerable: true, get: function () { return schema_validator_1.SchemaValidator; } }); | ||
var schemas_1 = require("./schemas"); | ||
exports.schemas = schemas_1.schemas; | ||
Object.defineProperty(exports, "schemas", { enumerable: true, get: function () { return schemas_1.schemas; } }); | ||
const AJV = require("ajv"); | ||
module.exports.AJV = AJV; | ||
//# sourceMappingURL=index.js.map |
@@ -1,12 +0,11 @@ | ||
import { Schema, ValidatorResult } from 'jsonschema'; | ||
import { Ajv } from 'ajv'; | ||
/** | ||
* A validator for [JSON-schemas](http://json-schema.org/) | ||
* A validator wrapping (AJV) [https://github.com/ajv-validator/ajv] | ||
*/ | ||
export declare class SchemaValidator { | ||
private readonly _validator; | ||
private static _assertSchemaDefined; | ||
/** | ||
* Instantiates a SchemaValidator instance | ||
*/ | ||
constructor(); | ||
constructor(newSchemas?: object[]); | ||
/** | ||
@@ -18,3 +17,3 @@ * Add a schema to the validator. All schemas and sub-schemas must be added to | ||
*/ | ||
addSchema(schema: Schema): void; | ||
addSchema(_schemas: object | object[]): void; | ||
/** | ||
@@ -26,3 +25,3 @@ * Validate the JS object conforms to a specific JSON schema | ||
*/ | ||
validate(instance: any, schema: Schema): ValidatorResult; | ||
validate(instance: any, schema: object): Ajv; | ||
/** | ||
@@ -34,4 +33,4 @@ * Check whether an instance properly adheres to a JSON schema | ||
*/ | ||
isValid(instance: any, schema: Schema): boolean; | ||
isValid(instance: any, schema: object): boolean; | ||
} | ||
//# sourceMappingURL=schema_validator.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const jsonschema_1 = require("jsonschema"); | ||
exports.SchemaValidator = void 0; | ||
const AJV = require("ajv"); // namespace and constructor | ||
const values = require("lodash.values"); | ||
const schemas_1 = require("./schemas"); | ||
/** | ||
* A validator for [JSON-schemas](http://json-schema.org/) | ||
* A validator wrapping (AJV) [https://github.com/ajv-validator/ajv] | ||
*/ | ||
class SchemaValidator { | ||
static _assertSchemaDefined(schema) { | ||
if (schema === undefined) { | ||
throw new Error(`Cannot add undefined schema`); | ||
} | ||
} | ||
/** | ||
* Instantiates a SchemaValidator instance | ||
*/ | ||
constructor() { | ||
this._validator = new jsonschema_1.Validator(); | ||
for (const schema of values(schemas_1.schemas)) { | ||
SchemaValidator._assertSchemaDefined(schema); | ||
this._validator.addSchema(schema, schema.id); | ||
} | ||
constructor(newSchemas = []) { | ||
this._validator = new AJV({ schemaId: 'auto' }); | ||
this._validator.addSchema(values(schemas_1.schemas).filter(s => s !== undefined && s.id !== undefined)); | ||
this._validator.addSchema(newSchemas.filter(s => s !== undefined)); | ||
} | ||
@@ -31,5 +25,4 @@ /** | ||
*/ | ||
addSchema(schema) { | ||
SchemaValidator._assertSchemaDefined(schema); | ||
this._validator.addSchema(schema, schema.id); | ||
addSchema(_schemas) { | ||
this._validator.addSchema(_schemas); // AJV validates upon adding | ||
} | ||
@@ -47,5 +40,4 @@ // In order to validate a complex JS object using jsonschema, we must replace any complex | ||
validate(instance, schema) { | ||
SchemaValidator._assertSchemaDefined(schema); | ||
const jsonSchemaCompatibleObject = JSON.parse(JSON.stringify(instance)); | ||
return this._validator.validate(jsonSchemaCompatibleObject, schema); | ||
this.isValid(instance, schema); | ||
return this._validator; // errors field is returned here. Will be overwritten on the next validation. | ||
} | ||
@@ -59,4 +51,3 @@ /** | ||
isValid(instance, schema) { | ||
const isValid = this.validate(instance, schema).errors.length === 0; | ||
return isValid; | ||
return this._validator.validate(schema, JSON.parse(JSON.stringify(instance))); | ||
} | ||
@@ -63,0 +54,0 @@ } |
export declare const schemas: { | ||
numberSchema: { | ||
"id": string; | ||
"type": string; | ||
"pattern": string; | ||
id: string; | ||
type: string; | ||
pattern: string; | ||
}; | ||
addressSchema: { | ||
"id": string; | ||
"type": string; | ||
"pattern": string; | ||
id: string; | ||
type: string; | ||
pattern: string; | ||
}; | ||
callDataSchema: { | ||
"id": string; | ||
"properties": { | ||
"from": { | ||
"$ref": string; | ||
id: string; | ||
properties: { | ||
from: { | ||
$ref: string; | ||
}; | ||
"to": { | ||
"$ref": string; | ||
to: { | ||
$ref: string; | ||
}; | ||
"value": { | ||
"oneOf": { | ||
"$ref": string; | ||
value: { | ||
oneOf: { | ||
$ref: string; | ||
}[]; | ||
}; | ||
"gas": { | ||
"oneOf": { | ||
"$ref": string; | ||
gas: { | ||
oneOf: { | ||
$ref: string; | ||
}[]; | ||
}; | ||
"gasPrice": { | ||
"oneOf": { | ||
"$ref": string; | ||
gasPrice: { | ||
oneOf: { | ||
$ref: string; | ||
}[]; | ||
}; | ||
"data": { | ||
"type": string; | ||
"pattern": string; | ||
data: { | ||
type: string; | ||
pattern: string; | ||
}; | ||
"nonce": { | ||
"type": string; | ||
"minimum": number; | ||
nonce: { | ||
type: string; | ||
minimum: number; | ||
}; | ||
"overrides": { | ||
"type": string; | ||
"additionalProperties": { | ||
"type": string; | ||
"properties": { | ||
"code": { | ||
"type": string; | ||
"pattern": string; | ||
overrides: { | ||
type: string; | ||
additionalProperties: { | ||
type: string; | ||
properties: { | ||
code: { | ||
type: string; | ||
pattern: string; | ||
}; | ||
"nonce": { | ||
"oneOf": { | ||
"$ref": string; | ||
nonce: { | ||
oneOf: { | ||
$ref: string; | ||
}[]; | ||
}; | ||
"balance": { | ||
"oneOf": { | ||
"$ref": string; | ||
balance: { | ||
oneOf: { | ||
$ref: string; | ||
}[]; | ||
@@ -67,295 +67,295 @@ }; | ||
}; | ||
"required": never[]; | ||
"type": string; | ||
"additionalProperties": boolean; | ||
required: never[]; | ||
type: string; | ||
additionalProperties: boolean; | ||
}; | ||
hexSchema: { | ||
"id": string; | ||
"type": string; | ||
"pattern": string; | ||
id: string; | ||
type: string; | ||
pattern: string; | ||
}; | ||
ecSignatureParameterSchema: { | ||
"id": string; | ||
"type": string; | ||
"pattern": string; | ||
id: string; | ||
type: string; | ||
pattern: string; | ||
}; | ||
ecSignatureSchema: { | ||
"id": string; | ||
"properties": { | ||
"v": { | ||
"type": string; | ||
"minimum": number; | ||
"maximum": number; | ||
id: string; | ||
properties: { | ||
v: { | ||
type: string; | ||
minimum: number; | ||
maximum: number; | ||
}; | ||
"r": { | ||
"$ref": string; | ||
r: { | ||
$ref: string; | ||
}; | ||
"s": { | ||
"$ref": string; | ||
s: { | ||
$ref: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
"type": string; | ||
required: string[]; | ||
type: string; | ||
}; | ||
eip712DomainSchema: { | ||
"id": string; | ||
"properties": { | ||
"name": { | ||
"type": string; | ||
id: string; | ||
properties: { | ||
name: { | ||
type: string; | ||
}; | ||
"version": { | ||
"type": string; | ||
version: { | ||
type: string; | ||
}; | ||
"chainId": { | ||
"type": string; | ||
chainId: { | ||
type: string; | ||
}; | ||
"verifyingContract": { | ||
"$ref": string; | ||
verifyingContract: { | ||
$ref: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
"type": string; | ||
required: string[]; | ||
type: string; | ||
}; | ||
eip712TypedDataSchema: { | ||
"id": string; | ||
"type": string; | ||
"properties": { | ||
"types": { | ||
"type": string; | ||
"properties": { | ||
"EIP712Domain": { | ||
"type": string; | ||
id: string; | ||
type: string; | ||
properties: { | ||
types: { | ||
type: string; | ||
properties: { | ||
EIP712Domain: { | ||
type: string; | ||
}; | ||
}; | ||
"additionalProperties": { | ||
"type": string; | ||
"items": { | ||
"type": string; | ||
"properties": { | ||
"name": { | ||
"type": string; | ||
additionalProperties: { | ||
type: string; | ||
items: { | ||
type: string; | ||
properties: { | ||
name: { | ||
type: string; | ||
}; | ||
"type": { | ||
"type": string; | ||
type: { | ||
type: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
required: string[]; | ||
}; | ||
}; | ||
"required": string[]; | ||
required: string[]; | ||
}; | ||
"primaryType": { | ||
"type": string; | ||
primaryType: { | ||
type: string; | ||
}; | ||
"domain": { | ||
"$ref": string; | ||
domain: { | ||
$ref: string; | ||
}; | ||
"message": { | ||
"type": string; | ||
message: { | ||
type: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
required: string[]; | ||
}; | ||
indexFilterValuesSchema: { | ||
"id": string; | ||
"additionalProperties": { | ||
"oneOf": { | ||
"$ref": string; | ||
id: string; | ||
additionalProperties: { | ||
oneOf: { | ||
$ref: string; | ||
}[]; | ||
}; | ||
"type": string; | ||
type: string; | ||
}; | ||
orderCancellationRequestsSchema: { | ||
"id": string; | ||
"type": string; | ||
"items": { | ||
"properties": { | ||
"order": { | ||
"$ref": string; | ||
id: string; | ||
type: string; | ||
items: { | ||
properties: { | ||
order: { | ||
$ref: string; | ||
}; | ||
"takerTokenCancelAmount": { | ||
"$ref": string; | ||
takerTokenCancelAmount: { | ||
$ref: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
"type": string; | ||
required: string[]; | ||
type: string; | ||
}; | ||
}; | ||
orderFillOrKillRequestsSchema: { | ||
"id": string; | ||
"type": string; | ||
"items": { | ||
"properties": { | ||
"signedOrder": { | ||
"$ref": string; | ||
id: string; | ||
type: string; | ||
items: { | ||
properties: { | ||
signedOrder: { | ||
$ref: string; | ||
}; | ||
"fillTakerAmount": { | ||
"$ref": string; | ||
fillTakerAmount: { | ||
$ref: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
"type": string; | ||
required: string[]; | ||
type: string; | ||
}; | ||
}; | ||
orderFillRequestsSchema: { | ||
"id": string; | ||
"type": string; | ||
"items": { | ||
"properties": { | ||
"signedOrder": { | ||
"$ref": string; | ||
id: string; | ||
type: string; | ||
items: { | ||
properties: { | ||
signedOrder: { | ||
$ref: string; | ||
}; | ||
"takerTokenFillAmount": { | ||
"$ref": string; | ||
takerTokenFillAmount: { | ||
$ref: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
"type": string; | ||
required: string[]; | ||
type: string; | ||
}; | ||
}; | ||
orderHashSchema: { | ||
"id": string; | ||
"type": string; | ||
"pattern": string; | ||
id: string; | ||
type: string; | ||
pattern: string; | ||
}; | ||
orderSchema: { | ||
"id": string; | ||
"properties": { | ||
"makerAddress": { | ||
"$ref": string; | ||
id: string; | ||
properties: { | ||
makerAddress: { | ||
$ref: string; | ||
}; | ||
"takerAddress": { | ||
"$ref": string; | ||
takerAddress: { | ||
$ref: string; | ||
}; | ||
"makerFee": { | ||
"$ref": string; | ||
makerFee: { | ||
$ref: string; | ||
}; | ||
"takerFee": { | ||
"$ref": string; | ||
takerFee: { | ||
$ref: string; | ||
}; | ||
"senderAddress": { | ||
"$ref": string; | ||
senderAddress: { | ||
$ref: string; | ||
}; | ||
"makerAssetAmount": { | ||
"$ref": string; | ||
makerAssetAmount: { | ||
$ref: string; | ||
}; | ||
"takerAssetAmount": { | ||
"$ref": string; | ||
takerAssetAmount: { | ||
$ref: string; | ||
}; | ||
"makerAssetData": { | ||
"$ref": string; | ||
makerAssetData: { | ||
$ref: string; | ||
}; | ||
"takerAssetData": { | ||
"$ref": string; | ||
takerAssetData: { | ||
$ref: string; | ||
}; | ||
"makerFeeAssetData": { | ||
"$ref": string; | ||
makerFeeAssetData: { | ||
$ref: string; | ||
}; | ||
"takerFeeAssetData": { | ||
"$ref": string; | ||
takerFeeAssetData: { | ||
$ref: string; | ||
}; | ||
"salt": { | ||
"$ref": string; | ||
salt: { | ||
$ref: string; | ||
}; | ||
"feeRecipientAddress": { | ||
"$ref": string; | ||
feeRecipientAddress: { | ||
$ref: string; | ||
}; | ||
"expirationTimeSeconds": { | ||
"$ref": string; | ||
expirationTimeSeconds: { | ||
$ref: string; | ||
}; | ||
"chainId": { | ||
"type": string; | ||
chainId: { | ||
type: string; | ||
}; | ||
"exchangeAddress": { | ||
"$ref": string; | ||
exchangeAddress: { | ||
$ref: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
"type": string; | ||
required: string[]; | ||
type: string; | ||
}; | ||
signedOrderSchema: { | ||
"id": string; | ||
"allOf": ({ | ||
"$ref": string; | ||
"properties"?: undefined; | ||
"required"?: undefined; | ||
id: string; | ||
allOf: ({ | ||
$ref: string; | ||
properties?: undefined; | ||
required?: undefined; | ||
} | { | ||
"properties": { | ||
"signature": { | ||
"$ref": string; | ||
properties: { | ||
signature: { | ||
$ref: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
"$ref"?: undefined; | ||
required: string[]; | ||
$ref?: undefined; | ||
})[]; | ||
}; | ||
signedOrdersSchema: { | ||
"id": string; | ||
"type": string; | ||
"items": { | ||
"$ref": string; | ||
id: string; | ||
type: string; | ||
items: { | ||
$ref: string; | ||
}; | ||
}; | ||
ordersSchema: { | ||
"id": string; | ||
"type": string; | ||
"items": { | ||
"$ref": string; | ||
id: string; | ||
type: string; | ||
items: { | ||
$ref: string; | ||
}; | ||
}; | ||
blockParamSchema: { | ||
"id": string; | ||
"oneOf": ({ | ||
"type": string; | ||
"enum"?: undefined; | ||
id: string; | ||
oneOf: ({ | ||
type: string; | ||
enum?: undefined; | ||
} | { | ||
"enum": string[]; | ||
"type"?: undefined; | ||
enum: string[]; | ||
type?: undefined; | ||
})[]; | ||
}; | ||
blockRangeSchema: { | ||
"id": string; | ||
"properties": { | ||
"fromBlock": { | ||
"$ref": string; | ||
id: string; | ||
properties: { | ||
fromBlock: { | ||
$ref: string; | ||
}; | ||
"toBlock": { | ||
"$ref": string; | ||
toBlock: { | ||
$ref: string; | ||
}; | ||
}; | ||
"type": string; | ||
type: string; | ||
}; | ||
tokenSchema: { | ||
"id": string; | ||
"properties": { | ||
"name": { | ||
"type": string; | ||
id: string; | ||
properties: { | ||
name: { | ||
type: string; | ||
}; | ||
"symbol": { | ||
"type": string; | ||
symbol: { | ||
type: string; | ||
}; | ||
"decimals": { | ||
"type": string; | ||
decimals: { | ||
type: string; | ||
}; | ||
"address": { | ||
"$ref": string; | ||
address: { | ||
$ref: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
"type": string; | ||
required: string[]; | ||
type: string; | ||
}; | ||
jsNumber: { | ||
"id": string; | ||
"type": string; | ||
"minimum": number; | ||
id: string; | ||
type: string; | ||
minimum: number; | ||
}; | ||
pagedRequestOptsSchema: { | ||
"id": string; | ||
"type": string; | ||
"properties": { | ||
"page": { | ||
"type": string; | ||
id: string; | ||
type: string; | ||
properties: { | ||
page: { | ||
type: string; | ||
}; | ||
"perPage": { | ||
"type": string; | ||
perPage: { | ||
type: string; | ||
}; | ||
@@ -365,52 +365,52 @@ }; | ||
ordersRequestOptsSchema: { | ||
"id": string; | ||
"type": string; | ||
"properties": { | ||
"makerAssetProxyId": { | ||
"$ref": string; | ||
id: string; | ||
type: string; | ||
properties: { | ||
makerAssetProxyId: { | ||
$ref: string; | ||
}; | ||
"takerAssetProxyId": { | ||
"$ref": string; | ||
takerAssetProxyId: { | ||
$ref: string; | ||
}; | ||
"makerAssetAddress": { | ||
"$ref": string; | ||
makerAssetAddress: { | ||
$ref: string; | ||
}; | ||
"takerAssetAddress": { | ||
"$ref": string; | ||
takerAssetAddress: { | ||
$ref: string; | ||
}; | ||
"exchangeAddress": { | ||
"$ref": string; | ||
exchangeAddress: { | ||
$ref: string; | ||
}; | ||
"senderAddress": { | ||
"$ref": string; | ||
senderAddress: { | ||
$ref: string; | ||
}; | ||
"makerAssetData": { | ||
"$ref": string; | ||
makerAssetData: { | ||
$ref: string; | ||
}; | ||
"takerAssetData": { | ||
"$ref": string; | ||
takerAssetData: { | ||
$ref: string; | ||
}; | ||
"traderAssetData": { | ||
"$ref": string; | ||
traderAssetData: { | ||
$ref: string; | ||
}; | ||
"makerFeeAssetData": { | ||
"$ref": string; | ||
makerFeeAssetData: { | ||
$ref: string; | ||
}; | ||
"takerFeeAssetData": { | ||
"$ref": string; | ||
takerFeeAssetData: { | ||
$ref: string; | ||
}; | ||
"makerAddress": { | ||
"$ref": string; | ||
makerAddress: { | ||
$ref: string; | ||
}; | ||
"takerAddress": { | ||
"$ref": string; | ||
takerAddress: { | ||
$ref: string; | ||
}; | ||
"traderAddress": { | ||
"$ref": string; | ||
traderAddress: { | ||
$ref: string; | ||
}; | ||
"feeRecipientAddress": { | ||
"$ref": string; | ||
feeRecipientAddress: { | ||
$ref: string; | ||
}; | ||
"unfillable": { | ||
"type": string; | ||
unfillable: { | ||
type: string; | ||
}; | ||
@@ -420,54 +420,54 @@ }; | ||
orderBookRequestSchema: { | ||
"id": string; | ||
"type": string; | ||
"properties": { | ||
"baseAssetData": { | ||
"$ref": string; | ||
id: string; | ||
type: string; | ||
properties: { | ||
baseAssetData: { | ||
$ref: string; | ||
}; | ||
"quoteAssetData": { | ||
"$ref": string; | ||
quoteAssetData: { | ||
$ref: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
required: string[]; | ||
}; | ||
orderConfigRequestSchema: { | ||
"id": string; | ||
"type": string; | ||
"properties": { | ||
"makerAddress": { | ||
"$ref": string; | ||
id: string; | ||
type: string; | ||
properties: { | ||
makerAddress: { | ||
$ref: string; | ||
}; | ||
"takerAddress": { | ||
"$ref": string; | ||
takerAddress: { | ||
$ref: string; | ||
}; | ||
"makerAssetAmount": { | ||
"$ref": string; | ||
makerAssetAmount: { | ||
$ref: string; | ||
}; | ||
"takerAssetAmount": { | ||
"$ref": string; | ||
takerAssetAmount: { | ||
$ref: string; | ||
}; | ||
"makerAssetData": { | ||
"$ref": string; | ||
makerAssetData: { | ||
$ref: string; | ||
}; | ||
"takerAssetData": { | ||
"$ref": string; | ||
takerAssetData: { | ||
$ref: string; | ||
}; | ||
"exchangeAddress": { | ||
"$ref": string; | ||
exchangeAddress: { | ||
$ref: string; | ||
}; | ||
"expirationTimeSeconds": { | ||
"$ref": string; | ||
expirationTimeSeconds: { | ||
$ref: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
required: string[]; | ||
}; | ||
assetPairsRequestOptsSchema: { | ||
"id": string; | ||
"type": string; | ||
"properties": { | ||
"assetDataA": { | ||
"$ref": string; | ||
id: string; | ||
type: string; | ||
properties: { | ||
assetDataA: { | ||
$ref: string; | ||
}; | ||
"assetDataB": { | ||
"$ref": string; | ||
assetDataB: { | ||
$ref: string; | ||
}; | ||
@@ -477,276 +477,276 @@ }; | ||
txDataSchema: { | ||
"id": string; | ||
"properties": { | ||
"from": { | ||
"$ref": string; | ||
id: string; | ||
properties: { | ||
from: { | ||
$ref: string; | ||
}; | ||
"to": { | ||
"$ref": string; | ||
to: { | ||
$ref: string; | ||
}; | ||
"value": { | ||
"oneOf": { | ||
"$ref": string; | ||
value: { | ||
oneOf: { | ||
$ref: string; | ||
}[]; | ||
}; | ||
"gas": { | ||
"oneOf": { | ||
"$ref": string; | ||
gas: { | ||
oneOf: { | ||
$ref: string; | ||
}[]; | ||
}; | ||
"gasPrice": { | ||
"oneOf": { | ||
"$ref": string; | ||
gasPrice: { | ||
oneOf: { | ||
$ref: string; | ||
}[]; | ||
}; | ||
"data": { | ||
"type": string; | ||
"pattern": string; | ||
data: { | ||
type: string; | ||
pattern: string; | ||
}; | ||
"nonce": { | ||
"type": string; | ||
"minimum": number; | ||
nonce: { | ||
type: string; | ||
minimum: number; | ||
}; | ||
}; | ||
"required": string[]; | ||
"type": string; | ||
required: string[]; | ||
type: string; | ||
}; | ||
paginatedCollectionSchema: { | ||
"id": string; | ||
"type": string; | ||
"properties": { | ||
"total": { | ||
"type": string; | ||
id: string; | ||
type: string; | ||
properties: { | ||
total: { | ||
type: string; | ||
}; | ||
"perPage": { | ||
"type": string; | ||
perPage: { | ||
type: string; | ||
}; | ||
"page": { | ||
"type": string; | ||
page: { | ||
type: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
required: string[]; | ||
}; | ||
relayerApiErrorResponseSchema: { | ||
"id": string; | ||
"type": string; | ||
"properties": { | ||
"code": { | ||
"type": string; | ||
"minimum": number; | ||
"maximum": number; | ||
id: string; | ||
type: string; | ||
properties: { | ||
code: { | ||
type: string; | ||
minimum: number; | ||
maximum: number; | ||
}; | ||
"reason": { | ||
"type": string; | ||
reason: { | ||
type: string; | ||
}; | ||
"validationErrors": { | ||
"type": string; | ||
"items": { | ||
"type": string; | ||
"properties": { | ||
"field": { | ||
"type": string; | ||
validationErrors: { | ||
type: string; | ||
items: { | ||
type: string; | ||
properties: { | ||
field: { | ||
type: string; | ||
}; | ||
"code": { | ||
"type": string; | ||
"minimum": number; | ||
"maximum": number; | ||
code: { | ||
type: string; | ||
minimum: number; | ||
maximum: number; | ||
}; | ||
"reason": { | ||
"type": string; | ||
reason: { | ||
type: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
required: string[]; | ||
}; | ||
}; | ||
}; | ||
"required": string[]; | ||
required: string[]; | ||
}; | ||
relayerApiFeeRecipientsResponseSchema: { | ||
"id": string; | ||
"type": string; | ||
"allOf": ({ | ||
"$ref": string; | ||
"properties"?: undefined; | ||
"required"?: undefined; | ||
id: string; | ||
type: string; | ||
allOf: ({ | ||
$ref: string; | ||
properties?: undefined; | ||
required?: undefined; | ||
} | { | ||
"properties": { | ||
"records": { | ||
"type": string; | ||
"items": { | ||
"$ref": string; | ||
properties: { | ||
records: { | ||
type: string; | ||
items: { | ||
$ref: string; | ||
}; | ||
}; | ||
}; | ||
"required": string[]; | ||
"$ref"?: undefined; | ||
required: string[]; | ||
$ref?: undefined; | ||
})[]; | ||
}; | ||
relayerApiOrderSchema: { | ||
"id": string; | ||
"type": string; | ||
"properties": { | ||
"order": { | ||
"$ref": string; | ||
id: string; | ||
type: string; | ||
properties: { | ||
order: { | ||
$ref: string; | ||
}; | ||
"metaData": { | ||
"type": string; | ||
metaData: { | ||
type: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
required: string[]; | ||
}; | ||
relayerApiOrdersSchema: { | ||
"id": string; | ||
"type": string; | ||
"items": { | ||
"$ref": string; | ||
id: string; | ||
type: string; | ||
items: { | ||
$ref: string; | ||
}; | ||
}; | ||
relayerApiOrderConfigPayloadSchema: { | ||
"id": string; | ||
"type": string; | ||
"properties": { | ||
"makerAddress": { | ||
"$ref": string; | ||
id: string; | ||
type: string; | ||
properties: { | ||
makerAddress: { | ||
$ref: string; | ||
}; | ||
"takerAddress": { | ||
"$ref": string; | ||
takerAddress: { | ||
$ref: string; | ||
}; | ||
"makerAssetAmount": { | ||
"$ref": string; | ||
makerAssetAmount: { | ||
$ref: string; | ||
}; | ||
"takerAssetAmount": { | ||
"$ref": string; | ||
takerAssetAmount: { | ||
$ref: string; | ||
}; | ||
"makerAssetData": { | ||
"$ref": string; | ||
makerAssetData: { | ||
$ref: string; | ||
}; | ||
"takerAssetData": { | ||
"$ref": string; | ||
takerAssetData: { | ||
$ref: string; | ||
}; | ||
"exchangeAddress": { | ||
"$ref": string; | ||
exchangeAddress: { | ||
$ref: string; | ||
}; | ||
"expirationTimeSeconds": { | ||
"$ref": string; | ||
expirationTimeSeconds: { | ||
$ref: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
required: string[]; | ||
}; | ||
relayerApiOrderConfigResponseSchema: { | ||
"id": string; | ||
"type": string; | ||
"properties": { | ||
"makerFee": { | ||
"$ref": string; | ||
id: string; | ||
type: string; | ||
properties: { | ||
makerFee: { | ||
$ref: string; | ||
}; | ||
"takerFee": { | ||
"$ref": string; | ||
takerFee: { | ||
$ref: string; | ||
}; | ||
"feeRecipientAddress": { | ||
"$ref": string; | ||
feeRecipientAddress: { | ||
$ref: string; | ||
}; | ||
"senderAddress": { | ||
"$ref": string; | ||
senderAddress: { | ||
$ref: string; | ||
}; | ||
"makerFeeAssetData": { | ||
"$ref": string; | ||
makerFeeAssetData: { | ||
$ref: string; | ||
}; | ||
"takerFeeAssetData": { | ||
"$ref": string; | ||
takerFeeAssetData: { | ||
$ref: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
required: string[]; | ||
}; | ||
relayerApiOrderbookResponseSchema: { | ||
"id": string; | ||
"type": string; | ||
"properties": { | ||
"bids": { | ||
"$ref": string; | ||
id: string; | ||
type: string; | ||
properties: { | ||
bids: { | ||
$ref: string; | ||
}; | ||
"asks": { | ||
"$ref": string; | ||
asks: { | ||
$ref: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
required: string[]; | ||
}; | ||
relayerApiAssetDataPairsResponseSchema: { | ||
"id": string; | ||
"type": string; | ||
"allOf": ({ | ||
"$ref": string; | ||
"properties"?: undefined; | ||
"required"?: undefined; | ||
id: string; | ||
type: string; | ||
allOf: ({ | ||
$ref: string; | ||
properties?: undefined; | ||
required?: undefined; | ||
} | { | ||
"properties": { | ||
"records": { | ||
"$ref": string; | ||
properties: { | ||
records: { | ||
$ref: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
"$ref"?: undefined; | ||
required: string[]; | ||
$ref?: undefined; | ||
})[]; | ||
}; | ||
relayerApiAssetDataTradeInfoSchema: { | ||
"id": string; | ||
"type": string; | ||
"properties": { | ||
"assetData": { | ||
"$ref": string; | ||
id: string; | ||
type: string; | ||
properties: { | ||
assetData: { | ||
$ref: string; | ||
}; | ||
"minAmount": { | ||
"$ref": string; | ||
minAmount: { | ||
$ref: string; | ||
}; | ||
"maxAmount": { | ||
"$ref": string; | ||
maxAmount: { | ||
$ref: string; | ||
}; | ||
"precision": { | ||
"type": string; | ||
precision: { | ||
type: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
required: string[]; | ||
}; | ||
relayerApiOrdersChannelSubscribeSchema: { | ||
"id": string; | ||
"type": string; | ||
"properties": { | ||
"type": { | ||
"enum": string[]; | ||
id: string; | ||
type: string; | ||
properties: { | ||
type: { | ||
enum: string[]; | ||
}; | ||
"channel": { | ||
"enum": string[]; | ||
channel: { | ||
enum: string[]; | ||
}; | ||
"requestId": { | ||
"type": string; | ||
requestId: { | ||
type: string; | ||
}; | ||
"payload": { | ||
"$ref": string; | ||
payload: { | ||
$ref: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
required: string[]; | ||
}; | ||
relayerApiOrdersChannelSubscribePayloadSchema: { | ||
"id": string; | ||
"type": string; | ||
"properties": { | ||
"makerAssetProxyId": { | ||
"$ref": string; | ||
id: string; | ||
type: string; | ||
properties: { | ||
makerAssetProxyId: { | ||
$ref: string; | ||
}; | ||
"takerAssetProxyId": { | ||
"$ref": string; | ||
takerAssetProxyId: { | ||
$ref: string; | ||
}; | ||
"makerAssetAddress": { | ||
"$ref": string; | ||
makerAssetAddress: { | ||
$ref: string; | ||
}; | ||
"takerAssetAddress": { | ||
"$ref": string; | ||
takerAssetAddress: { | ||
$ref: string; | ||
}; | ||
"makerAssetData": { | ||
"$ref": string; | ||
makerAssetData: { | ||
$ref: string; | ||
}; | ||
"takerAssetData": { | ||
"$ref": string; | ||
takerAssetData: { | ||
$ref: string; | ||
}; | ||
"traderAssetData": { | ||
"$ref": string; | ||
traderAssetData: { | ||
$ref: string; | ||
}; | ||
@@ -756,204 +756,204 @@ }; | ||
relayerApiOrdersChannelUpdateSchema: { | ||
"id": string; | ||
"type": string; | ||
"properties": { | ||
"type": { | ||
"enum": string[]; | ||
id: string; | ||
type: string; | ||
properties: { | ||
type: { | ||
enum: string[]; | ||
}; | ||
"channel": { | ||
"enum": string[]; | ||
channel: { | ||
enum: string[]; | ||
}; | ||
"requestId": { | ||
"type": string; | ||
requestId: { | ||
type: string; | ||
}; | ||
"payload": { | ||
"$ref": string; | ||
payload: { | ||
$ref: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
required: string[]; | ||
}; | ||
relayerApiOrdersResponseSchema: { | ||
"id": string; | ||
"type": string; | ||
"allOf": ({ | ||
"$ref": string; | ||
"properties"?: undefined; | ||
"required"?: undefined; | ||
id: string; | ||
type: string; | ||
allOf: ({ | ||
$ref: string; | ||
properties?: undefined; | ||
required?: undefined; | ||
} | { | ||
"properties": { | ||
"records": { | ||
"$ref": string; | ||
properties: { | ||
records: { | ||
$ref: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
"$ref"?: undefined; | ||
required: string[]; | ||
$ref?: undefined; | ||
})[]; | ||
}; | ||
relayerApiAssetDataPairsSchema: { | ||
"id": string; | ||
"type": string; | ||
"items": { | ||
"properties": { | ||
"assetDataA": { | ||
"$ref": string; | ||
id: string; | ||
type: string; | ||
items: { | ||
properties: { | ||
assetDataA: { | ||
$ref: string; | ||
}; | ||
"assetDataB": { | ||
"$ref": string; | ||
assetDataB: { | ||
$ref: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
"type": string; | ||
required: string[]; | ||
type: string; | ||
}; | ||
}; | ||
zeroExTransactionSchema: { | ||
"id": string; | ||
"properties": { | ||
"data": { | ||
"$ref": string; | ||
id: string; | ||
properties: { | ||
data: { | ||
$ref: string; | ||
}; | ||
"signerAddress": { | ||
"$ref": string; | ||
signerAddress: { | ||
$ref: string; | ||
}; | ||
"salt": { | ||
"$ref": string; | ||
salt: { | ||
$ref: string; | ||
}; | ||
"expirationTimeSeconds": { | ||
"$ref": string; | ||
expirationTimeSeconds: { | ||
$ref: string; | ||
}; | ||
"gasPrice": { | ||
"$ref": string; | ||
gasPrice: { | ||
$ref: string; | ||
}; | ||
"domain": { | ||
"$ref": string; | ||
domain: { | ||
$ref: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
"type": string; | ||
required: string[]; | ||
type: string; | ||
}; | ||
exchangeProxyMetaTransactionSchema: { | ||
"id": string; | ||
"properties": { | ||
"signer": { | ||
"$ref": string; | ||
id: string; | ||
properties: { | ||
signer: { | ||
$ref: string; | ||
}; | ||
"sender": { | ||
"$ref": string; | ||
sender: { | ||
$ref: string; | ||
}; | ||
"minGasPrice": { | ||
"$ref": string; | ||
minGasPrice: { | ||
$ref: string; | ||
}; | ||
"maxGasPrice": { | ||
"$ref": string; | ||
maxGasPrice: { | ||
$ref: string; | ||
}; | ||
"expirationTimeSeconds": { | ||
"$ref": string; | ||
expirationTimeSeconds: { | ||
$ref: string; | ||
}; | ||
"salt": { | ||
"$ref": string; | ||
salt: { | ||
$ref: string; | ||
}; | ||
"callData": { | ||
"$ref": string; | ||
callData: { | ||
$ref: string; | ||
}; | ||
"value": { | ||
"$ref": string; | ||
value: { | ||
$ref: string; | ||
}; | ||
"feeToken": { | ||
"$ref": string; | ||
feeToken: { | ||
$ref: string; | ||
}; | ||
"feeAmount": { | ||
"$ref": string; | ||
feeAmount: { | ||
$ref: string; | ||
}; | ||
"domain": { | ||
"$ref": string; | ||
domain: { | ||
$ref: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
"type": string; | ||
required: string[]; | ||
type: string; | ||
}; | ||
wholeNumberSchema: { | ||
"id": string; | ||
"anyOf": ({ | ||
"type": string; | ||
"pattern": string; | ||
id: string; | ||
anyOf: ({ | ||
type: string; | ||
pattern: string; | ||
} | { | ||
"type": string; | ||
"pattern"?: undefined; | ||
type: string; | ||
pattern?: undefined; | ||
})[]; | ||
}; | ||
v4SignatureSchema: { | ||
"id": string; | ||
"properties": { | ||
"signatureType": { | ||
"enum": number[]; | ||
id: string; | ||
properties: { | ||
signatureType: { | ||
enum: number[]; | ||
}; | ||
"v": { | ||
"enum": number[]; | ||
v: { | ||
enum: number[]; | ||
}; | ||
"r": { | ||
"$ref": string; | ||
r: { | ||
$ref: string; | ||
}; | ||
"s": { | ||
"$ref": string; | ||
s: { | ||
$ref: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
"type": string; | ||
required: string[]; | ||
type: string; | ||
}; | ||
v4RfqOrderSchema: { | ||
"id": string; | ||
"properties": { | ||
"maker": { | ||
"$ref": string; | ||
id: string; | ||
properties: { | ||
maker: { | ||
$ref: string; | ||
}; | ||
"taker": { | ||
"$ref": string; | ||
taker: { | ||
$ref: string; | ||
}; | ||
"txOrigin": { | ||
"$ref": string; | ||
txOrigin: { | ||
$ref: string; | ||
}; | ||
"makerAmount": { | ||
"$ref": string; | ||
makerAmount: { | ||
$ref: string; | ||
}; | ||
"takerAmount": { | ||
"$ref": string; | ||
takerAmount: { | ||
$ref: string; | ||
}; | ||
"makerToken": { | ||
"$ref": string; | ||
makerToken: { | ||
$ref: string; | ||
}; | ||
"takerToken": { | ||
"$ref": string; | ||
takerToken: { | ||
$ref: string; | ||
}; | ||
"salt": { | ||
"$ref": string; | ||
salt: { | ||
$ref: string; | ||
}; | ||
"expiry": { | ||
"$ref": string; | ||
expiry: { | ||
$ref: string; | ||
}; | ||
"chainId": { | ||
"type": string; | ||
chainId: { | ||
type: string; | ||
}; | ||
"verifyingContract": { | ||
"$ref": string; | ||
verifyingContract: { | ||
$ref: string; | ||
}; | ||
"pool": { | ||
"$ref": string; | ||
pool: { | ||
$ref: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
"type": string; | ||
required: string[]; | ||
type: string; | ||
}; | ||
v4RfqSignedOrderSchema: { | ||
"id": string; | ||
"allOf": ({ | ||
"$ref": string; | ||
"properties"?: undefined; | ||
"required"?: undefined; | ||
id: string; | ||
allOf: ({ | ||
$ref: string; | ||
properties?: undefined; | ||
required?: undefined; | ||
} | { | ||
"properties": { | ||
"signature": { | ||
"$ref": string; | ||
properties: { | ||
signature: { | ||
$ref: string; | ||
}; | ||
}; | ||
"required": string[]; | ||
"$ref"?: undefined; | ||
required: string[]; | ||
$ref?: undefined; | ||
})[]; | ||
@@ -960,0 +960,0 @@ }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.schemas = void 0; | ||
const addressSchema = require("../schemas/address_schema.json"); | ||
@@ -4,0 +5,0 @@ const assetPairsRequestOptsSchema = require("../schemas/asset_pairs_request_opts_schema.json"); |
{ | ||
"name": "@0x/json-schemas", | ||
"version": "5.4.1", | ||
"version": "6.0.0", | ||
"engines": { | ||
@@ -46,5 +46,5 @@ "node": ">=6.12" | ||
"dependencies": { | ||
"@0x/typescript-typings": "^5.1.6", | ||
"@0x/typescript-typings": "^5.1.7", | ||
"@types/node": "12.12.54", | ||
"jsonschema": "^1.2.0", | ||
"ajv": "^6.12.5", | ||
"lodash.values": "^4.3.0" | ||
@@ -54,4 +54,4 @@ }, | ||
"@0x/ts-doc-gen": "^0.0.28", | ||
"@0x/tslint-config": "^4.1.3", | ||
"@0x/utils": "^6.2.0", | ||
"@0x/tslint-config": "^4.1.4", | ||
"@0x/utils": "^6.2.1", | ||
"@types/lodash.foreach": "^4.5.3", | ||
@@ -70,3 +70,3 @@ "@types/lodash.values": "^4.3.3", | ||
"typedoc": "~0.16.11", | ||
"typescript": "3.0.1" | ||
"typescript": "4.2.2" | ||
}, | ||
@@ -76,3 +76,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "5f584320f05ed45e0d8e69e12c1265934184cbed" | ||
"gitHead": "1eec1e081f73258aa42a96f530df76292d6d586d" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2780
87340
+ Addedajv@^6.12.5
+ Addedajv@6.12.6(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addeduri-js@4.4.1(transitive)
- Removedjsonschema@^1.2.0
- Removedjsonschema@1.5.0(transitive)