@0xproject/json-schemas
Advanced tools
Comparing version 0.8.3 to 1.0.0-rc.1
[ | ||
{ | ||
"version": "1.0.0-rc.1", | ||
"changes": [ | ||
{ | ||
"note": "Update schemas for V2 or 0x Protocol", | ||
"pr": 615 | ||
}, | ||
{ | ||
"note": "Added CallData schema", | ||
"pr": 821 | ||
}, | ||
{ | ||
"note": "Update CallData schema id to CallData", | ||
"pr": 894 | ||
} | ||
] | ||
}, | ||
{ | ||
"timestamp": 1531919263, | ||
@@ -33,6 +50,7 @@ "version": "0.8.3", | ||
{ | ||
"note": "Incorrect publish that was unpublished" | ||
"note": | ||
"Update Order & SignedOrder schemas, remove ECSignature schema and add Hex schema as part of V2 upgrades", | ||
"pr": 615 | ||
} | ||
], | ||
"timestamp": 1527810075 | ||
] | ||
}, | ||
@@ -39,0 +57,0 @@ { |
@@ -6,2 +6,7 @@ export declare const addressSchema: { | ||
}; | ||
export declare const hexSchema: { | ||
id: string; | ||
type: string; | ||
pattern: string; | ||
}; | ||
export declare const numberSchema: { | ||
@@ -8,0 +13,0 @@ id: string; |
@@ -8,2 +8,7 @@ "use strict"; | ||
}; | ||
exports.hexSchema = { | ||
id: '/Hex', | ||
type: 'string', | ||
pattern: '^0x([0-9a-f][0-9a-f])+$', | ||
}; | ||
exports.numberSchema = { | ||
@@ -10,0 +15,0 @@ id: '/Number', |
export declare const orderSchema: { | ||
id: string; | ||
properties: { | ||
maker: { | ||
makerAddress: { | ||
$ref: string; | ||
}; | ||
taker: { | ||
takerAddress: { | ||
$ref: string; | ||
@@ -16,24 +16,27 @@ }; | ||
}; | ||
makerTokenAmount: { | ||
senderAddress: { | ||
$ref: string; | ||
}; | ||
takerTokenAmount: { | ||
makerAssetAmount: { | ||
$ref: string; | ||
}; | ||
makerTokenAddress: { | ||
takerAssetAmount: { | ||
$ref: string; | ||
}; | ||
takerTokenAddress: { | ||
makerAssetData: { | ||
$ref: string; | ||
}; | ||
takerAssetData: { | ||
$ref: string; | ||
}; | ||
salt: { | ||
$ref: string; | ||
}; | ||
feeRecipient: { | ||
exchangeAddress: { | ||
$ref: string; | ||
}; | ||
expirationUnixTimestampSec: { | ||
feeRecipientAddress: { | ||
$ref: string; | ||
}; | ||
exchangeContractAddress: { | ||
expirationTimeSeconds: { | ||
$ref: string; | ||
@@ -53,3 +56,3 @@ }; | ||
properties: { | ||
ecSignature: { | ||
signature: { | ||
$ref: string; | ||
@@ -56,0 +59,0 @@ }; |
@@ -6,26 +6,30 @@ "use strict"; | ||
properties: { | ||
maker: { $ref: '/Address' }, | ||
taker: { $ref: '/Address' }, | ||
makerAddress: { $ref: '/Address' }, | ||
takerAddress: { $ref: '/Address' }, | ||
makerFee: { $ref: '/Number' }, | ||
takerFee: { $ref: '/Number' }, | ||
makerTokenAmount: { $ref: '/Number' }, | ||
takerTokenAmount: { $ref: '/Number' }, | ||
makerTokenAddress: { $ref: '/Address' }, | ||
takerTokenAddress: { $ref: '/Address' }, | ||
senderAddress: { $ref: '/Address' }, | ||
makerAssetAmount: { $ref: '/Number' }, | ||
takerAssetAmount: { $ref: '/Number' }, | ||
makerAssetData: { $ref: '/Hex' }, | ||
takerAssetData: { $ref: '/Hex' }, | ||
salt: { $ref: '/Number' }, | ||
feeRecipient: { $ref: '/Address' }, | ||
expirationUnixTimestampSec: { $ref: '/Number' }, | ||
exchangeContractAddress: { $ref: '/Address' }, | ||
exchangeAddress: { $ref: '/Address' }, | ||
feeRecipientAddress: { $ref: '/Address' }, | ||
expirationTimeSeconds: { $ref: '/Number' }, | ||
}, | ||
required: [ | ||
'maker', | ||
'taker', | ||
'makerAddress', | ||
'takerAddress', | ||
'makerFee', | ||
'takerFee', | ||
'makerTokenAmount', | ||
'takerTokenAmount', | ||
'senderAddress', | ||
'makerAssetAmount', | ||
'takerAssetAmount', | ||
'makerAssetData', | ||
'takerAssetData', | ||
'salt', | ||
'feeRecipient', | ||
'expirationUnixTimestampSec', | ||
'exchangeContractAddress', | ||
'exchangeAddress', | ||
'feeRecipientAddress', | ||
'expirationTimeSeconds', | ||
], | ||
@@ -40,5 +44,5 @@ type: 'object', | ||
properties: { | ||
ecSignature: { $ref: '/ECSignature' }, | ||
signature: { $ref: '/Hex' }, | ||
}, | ||
required: ['ecSignature'], | ||
required: ['signature'], | ||
}, | ||
@@ -45,0 +49,0 @@ ], |
@@ -6,3 +6,3 @@ import { Schema, ValidatorResult } from 'jsonschema'; | ||
export declare class SchemaValidator { | ||
private _validator; | ||
private readonly _validator; | ||
/** | ||
@@ -9,0 +9,0 @@ * Instantiates a SchemaValidator instance |
"use strict"; | ||
var __values = (this && this.__values) || function (o) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; | ||
if (m) return m.call(o); | ||
return { | ||
next: function () { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -15,6 +25,16 @@ var jsonschema_1 = require("jsonschema"); | ||
this._validator = new jsonschema_1.Validator(); | ||
for (var _i = 0, _a = values(schemas_1.schemas); _i < _a.length; _i++) { | ||
var schema = _a[_i]; | ||
this._validator.addSchema(schema, schema.id); | ||
try { | ||
for (var _a = __values(values(schemas_1.schemas)), _b = _a.next(); !_b.done; _b = _a.next()) { | ||
var schema = _b.value; | ||
this._validator.addSchema(schema, schema.id); | ||
} | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (_b && !_b.done && (_c = _a.return)) _c.call(_a); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
var e_1, _c; | ||
} | ||
@@ -21,0 +41,0 @@ /** |
@@ -12,2 +12,49 @@ export declare const schemas: { | ||
}; | ||
callDataSchema: { | ||
id: string; | ||
properties: { | ||
from: { | ||
$ref: string; | ||
}; | ||
to: { | ||
$ref: string; | ||
}; | ||
value: { | ||
oneOf: { | ||
$ref: string; | ||
}[]; | ||
}; | ||
gas: { | ||
oneOf: { | ||
$ref: string; | ||
}[]; | ||
}; | ||
gasPrice: { | ||
oneOf: { | ||
$ref: string; | ||
}[]; | ||
}; | ||
data: { | ||
type: string; | ||
pattern: string; | ||
}; | ||
nonce: { | ||
type: string; | ||
minimum: number; | ||
}; | ||
}; | ||
required: never[]; | ||
type: string; | ||
additionalProperties: boolean; | ||
}; | ||
hexSchema: { | ||
id: string; | ||
type: string; | ||
pattern: string; | ||
}; | ||
ecSignatureParameterSchema: { | ||
id: string; | ||
type: string; | ||
pattern: string; | ||
}; | ||
ecSignatureSchema: { | ||
@@ -31,7 +78,2 @@ id: string; | ||
}; | ||
ecSignatureParameterSchema: { | ||
id: string; | ||
type: string; | ||
pattern: string; | ||
}; | ||
indexFilterValuesSchema: { | ||
@@ -102,6 +144,6 @@ id: string; | ||
properties: { | ||
maker: { | ||
makerAddress: { | ||
$ref: string; | ||
}; | ||
taker: { | ||
takerAddress: { | ||
$ref: string; | ||
@@ -115,24 +157,27 @@ }; | ||
}; | ||
makerTokenAmount: { | ||
senderAddress: { | ||
$ref: string; | ||
}; | ||
takerTokenAmount: { | ||
makerAssetAmount: { | ||
$ref: string; | ||
}; | ||
makerTokenAddress: { | ||
takerAssetAmount: { | ||
$ref: string; | ||
}; | ||
takerTokenAddress: { | ||
makerAssetData: { | ||
$ref: string; | ||
}; | ||
takerAssetData: { | ||
$ref: string; | ||
}; | ||
salt: { | ||
$ref: string; | ||
}; | ||
feeRecipient: { | ||
exchangeAddress: { | ||
$ref: string; | ||
}; | ||
expirationUnixTimestampSec: { | ||
feeRecipientAddress: { | ||
$ref: string; | ||
}; | ||
exchangeContractAddress: { | ||
expirationTimeSeconds: { | ||
$ref: string; | ||
@@ -152,3 +197,3 @@ }; | ||
properties: { | ||
ecSignature: { | ||
signature: { | ||
$ref: string; | ||
@@ -168,2 +213,9 @@ }; | ||
}; | ||
ordersSchema: { | ||
id: string; | ||
type: string; | ||
items: { | ||
$ref: string; | ||
}; | ||
}; | ||
blockParamSchema: { | ||
@@ -170,0 +222,0 @@ id: string; |
@@ -5,2 +5,3 @@ "use strict"; | ||
var block_range_schema_1 = require("../schemas/block_range_schema"); | ||
var call_data_schema_1 = require("../schemas/call_data_schema"); | ||
var ec_signature_schema_1 = require("../schemas/ec_signature_schema"); | ||
@@ -13,2 +14,3 @@ var index_filter_values_schema_1 = require("../schemas/index_filter_values_schema"); | ||
var order_schemas_1 = require("../schemas/order_schemas"); | ||
var orders_schema_1 = require("../schemas/orders_schema"); | ||
var relayer_api_error_response_schema_1 = require("../schemas/relayer_api_error_response_schema"); | ||
@@ -28,4 +30,6 @@ var relayer_api_fees_payload_schema_1 = require("../schemas/relayer_api_fees_payload_schema"); | ||
addressSchema: basic_type_schemas_1.addressSchema, | ||
callDataSchema: call_data_schema_1.callDataSchema, | ||
hexSchema: basic_type_schemas_1.hexSchema, | ||
ecSignatureParameterSchema: ec_signature_schema_1.ecSignatureParameterSchema, | ||
ecSignatureSchema: ec_signature_schema_1.ecSignatureSchema, | ||
ecSignatureParameterSchema: ec_signature_schema_1.ecSignatureParameterSchema, | ||
indexFilterValuesSchema: index_filter_values_schema_1.indexFilterValuesSchema, | ||
@@ -39,2 +43,3 @@ orderCancellationRequestsSchema: order_cancel_schema_1.orderCancellationRequestsSchema, | ||
signedOrdersSchema: signed_orders_schema_1.signedOrdersSchema, | ||
ordersSchema: orders_schema_1.ordersSchema, | ||
blockParamSchema: block_range_schema_1.blockParamSchema, | ||
@@ -41,0 +46,0 @@ blockRangeSchema: block_range_schema_1.blockRangeSchema, |
{ | ||
"name": "@0xproject/json-schemas", | ||
"version": "0.8.3", | ||
"version": "1.0.0-rc.1", | ||
"engines": { | ||
@@ -11,9 +11,10 @@ "node": ">=6.12" | ||
"scripts": { | ||
"watch": "tsc -w", | ||
"watch_without_deps": "tsc -w", | ||
"lint": "tslint --project .", | ||
"test": "run-s clean build run_mocha", | ||
"test": "yarn run_mocha", | ||
"rebuild_and_test": "run-s clean build test", | ||
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov", | ||
"coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info", | ||
"test:circleci": "yarn test:coverage", | ||
"run_mocha": "mocha lib/test/**/*_test.js --exit", | ||
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js --exit", | ||
"clean": "shx rm -rf lib test_temp scripts", | ||
@@ -31,3 +32,4 @@ "build": "tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", | ||
"extraFileIncludes": [ | ||
"../types/src/index.ts" | ||
"../types/src/index.ts", | ||
"../ethereum-types/src/index.ts" | ||
], | ||
@@ -50,24 +52,24 @@ "s3BucketPath": "s3://doc-jsons/json-schemas/", | ||
"dependencies": { | ||
"@0xproject/typescript-typings": "^0.4.3", | ||
"@types/node": "9.6.0", | ||
"jsonschema": "1.2.2", | ||
"lodash.values": "4.3.0" | ||
"@0xproject/typescript-typings": "^1.0.0", | ||
"@types/node": "^8.0.53", | ||
"jsonschema": "^1.2.0", | ||
"lodash.values": "^4.3.0" | ||
}, | ||
"devDependencies": { | ||
"@0xproject/monorepo-scripts": "^0.2.2", | ||
"@0xproject/tslint-config": "^0.4.21", | ||
"@0xproject/utils": "^0.7.3", | ||
"@types/lodash.foreach": "4.5.3", | ||
"@types/lodash.values": "4.3.3", | ||
"@types/mocha": "2.2.48", | ||
"chai": "4.1.2", | ||
"copyfiles": "1.2.0", | ||
"dirty-chai": "2.0.1", | ||
"lodash.foreach": "4.5.0", | ||
"make-promises-safe": "1.1.0", | ||
"mocha": "4.1.0", | ||
"npm-run-all": "4.1.2", | ||
"nyc": "11.6.0", | ||
"shx": "0.2.2", | ||
"tslint": "5.8.0", | ||
"@0xproject/monorepo-script": "^1.0.0", | ||
"@0xproject/tslint-config": "^1.0.0", | ||
"@0xproject/utils": "^1.0.0", | ||
"@types/lodash.foreach": "^4.5.3", | ||
"@types/lodash.values": "^4.3.3", | ||
"@types/mocha": "^2.2.42", | ||
"chai": "^4.0.1", | ||
"copyfiles": "^1.2.0", | ||
"dirty-chai": "^2.0.1", | ||
"lodash.foreach": "^4.5.0", | ||
"make-promises-safe": "^1.1.0", | ||
"mocha": "^4.0.1", | ||
"npm-run-all": "^4.1.2", | ||
"nyc": "^11.0.1", | ||
"shx": "^0.2.2", | ||
"tslint": "5.11.0", | ||
"typedoc": "0xProject/typedoc", | ||
@@ -74,0 +76,0 @@ "typescript": "2.7.1" |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
124169
83
2614
+ Added@0xproject/typescript-typings@1.0.5(transitive)
+ Added@types/bn.js@4.11.6(transitive)
+ Added@types/prop-types@15.7.13(transitive)
+ Added@types/react@18.3.12(transitive)
+ Addedcsstype@3.1.3(transitive)
+ Addedethereum-types@1.1.6(transitive)
+ Addedjsonschema@1.4.1(transitive)
+ Addedpopper.js@1.14.3(transitive)
- Removed@0xproject/types@0.8.2(transitive)
- Removed@0xproject/typescript-typings@0.4.3(transitive)
- Removed@types/node@9.6.0(transitive)
- Removedethereum-types@0.0.2(transitive)
- Removedjsonschema@1.2.2(transitive)
Updated@types/node@^8.0.53
Updatedjsonschema@^1.2.0
Updatedlodash.values@^4.3.0