Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@0x/json-schemas

0xProject32.1kApache-2.06.4.6TypeScript support: included

0x-related json schemas

readme

@0x/json-schemas

Contains 0x-related json schemas

Read the Documentation.

Installation

yarn add @0x/json-schemas

Import

import { SchemaValidator, ValidatorResult, schemas } from '@0x/json-schemas';

or

var schemas = require('@0x/json-schemas').schemas;

If your project is in TypeScript, add the following to your tsconfig.json:

"compilerOptions": {
    "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
}

Contributing

We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.

Please read our contribution guidelines before getting started.

Install dependencies

If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:

yarn config set workspaces-experimental true

Then install dependencies

yarn install

Build

To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:

PKG=@0x/json-schemas yarn build

Or continuously rebuild on change:

PKG=@0x/json-schemas yarn watch

Clean

yarn clean

Lint

yarn lint

Run Tests

yarn test

changelog

CHANGELOG

v6.4.6 - April 7, 2023

* Dependencies updated

v6.4.5 - August 18, 2022

* Dependencies updated

v6.4.4 - March 16, 2022

* Dependencies updated

v6.4.3 - March 16, 2022

* Dependencies updated

v6.4.2 - February 26, 2022

* Dependencies updated

v6.4.1 - January 19, 2022

* Dependencies updated

v6.4.0 - September 22, 2021

* Add v4 OtcOrder Schema (#47)

v6.3.0 - August 25, 2021

* Update call data and tx data schemas for 1559 fields (#45)

v6.2.0 - June 28, 2021

* Return all schema validation errors and expose Ajv types, remove outdated relayer api schemas (#38)

v6.1.3 - April 28, 2021

* Dependencies updated

v6.1.2 - April 26, 2021

* Dependencies updated

v6.1.1 - April 26, 2021

* Dependencies updated

v6.1.0 - April 26, 2021

* Add `accessList` to `callDataSchema` and `txDataSchema` (#33)

v6.0.1 - April 6, 2021

* Swallow duplicate schema definition errors (#31)

v6.0.0 - March 24, 2021

* Use ajv instead of jsonschema to improve performance (#28)

v5.4.1 - January 7, 2021

* Dependencies updated

v5.4.0 - January 5, 2021

* Add v4 RFQ order schema (#17)

v5.3.5 - January 5, 2021

* Dependencies updated

v5.3.4 - December 2, 2020

* Dependencies updated

v5.3.3 - October 29, 2020

* Dependencies updated

v5.3.2 - October 29, 2020

* Dependencies updated

v5.3.1 - October 29, 2020

* Fix boolean type in Orders Request Opts Schema (#1)

v5.3.0 - October 28, 2020

* Add `unfillable` query param to Orders Request Opts Schema. (#1)

v5.2.3 - October 21, 2020

* Dependencies updated

v5.2.2 - October 21, 2020

* Dependencies updated

v5.2.1 - October 20, 2020

* Dependencies updated

v5.2.0 - October 20, 2020

* Add `exchangeProxyMetaTransactionSchema` (#2657)

v5.1.0 - July 15, 2020

* Add geth eth_call properties to `CallData` (#2620)

v5.0.8 - June 24, 2020

* Dependencies updated

v5.0.7 - February 25, 2020

* Dependencies updated

v5.0.6 - February 8, 2020

* Dependencies updated

v5.0.5 - February 6, 2020

* Dependencies updated

v5.0.4 - January 22, 2020

* Dependencies updated

v5.0.3 - January 6, 2020

* Dependencies updated

v5.0.2 - December 17, 2019

* Dependencies updated

v5.0.1 - December 9, 2019

* Dependencies updated

v5.0.0 - December 2, 2019

* All references to network ID have been removed, and references to chain ID have been introduced instead (#2313)
* Add `eip712DomainSchema` schema (#1742)
* Add required field `domain` to `order` and `zeroExTransaction` schemas (#1742)
* Add `makerAssetData` and `takerAssetData` to `Order` schemas (#1819)
* Add `expirationTimeSeconds` to `ZeroExTransaction` schema (#1832)

v4.1.0-beta.3 - December 2, 2019

* Dependencies updated

v4.1.0-beta.2 - November 17, 2019

* Dependencies updated

v4.1.0-beta.1 - November 7, 2019

* All references to network ID have been removed, and references to chain ID have been introduced instead (#2313)

v4.1.0-beta.0 - October 3, 2019

* Add `eip712DomainSchema` schema (#1742)
* Add required field `domain` to `order` and `zeroExTransaction` schemas (#1742)
* Add `makerAssetData` and `takerAssetData` to `Order` schemas (#1819)
* Add `expirationTimeSeconds` to `ZeroExTransaction` schema (#1832)

v4.0.2 - September 17, 2019

* Dependencies updated

v4.0.1 - September 3, 2019

* Dependencies updated

v4.0.0 - August 22, 2019

* Removed @0x/order-watcher

v3.1.13 - August 8, 2019

* Dependencies updated

v3.1.12 - July 31, 2019

* Dependencies updated

v3.1.11 - July 24, 2019

* permit mixed-case addresses

v3.0.11 - July 13, 2019

* Dependencies updated

v3.0.10 - May 10, 2019

* Dependencies updated

v3.0.9 - April 11, 2019

* Dependencies updated

v3.0.8 - March 21, 2019

* Dependencies updated

v3.0.7 - March 20, 2019

* Dependencies updated

v3.0.6 - March 1, 2019

* Dependencies updated

v3.0.5 - February 26, 2019

* Dependencies updated

v3.0.4 - February 25, 2019

* Dependencies updated

v3.0.3 - February 9, 2019

* Dependencies updated

v3.0.2 - February 7, 2019

* Dependencies updated

v3.0.1 - February 6, 2019

* Dependencies updated

v3.0.0 - February 5, 2019

* Upgrade the bignumber.js to v8.0.2 (#1517)
* Add `verifyingContractAddress` to `zeroExTransactionSchema` (#1576)

v2.1.7 - January 15, 2019

* Dependencies updated

v2.1.6 - January 11, 2019

* Dependencies updated

v2.1.5 - January 9, 2019

* Dependencies updated

v2.1.4 - December 13, 2018

* Dependencies updated

v2.1.3 - December 11, 2018

* Dependencies updated

v2.1.2 - November 21, 2018

* Dependencies updated

v2.1.1 - November 14, 2018

* Dependencies updated

v2.1.0 - November 12, 2018

* Improve schemas by enforcing that amounts that must be whole numbers (e.g Order asset amounts) no longer allow decimal amounts (#1173)
* Add schemas from @0x/connect (#1250)

v2.0.0 - October 18, 2018

* Convert all schemas to JSON files so that they can be used with `json-schema` implemenations in other programming languages. (#1145)

v1.0.7 - October 4, 2018

* Dependencies updated

v1.0.6 - October 2, 2018

* Dependencies updated

v1.0.5 - September 28, 2018

* Dependencies updated

v1.0.4 - September 25, 2018

* Dependencies updated

v1.0.3 - September 25, 2018

* Dependencies updated

v1.0.2 - September 21, 2018

* Dependencies updated

v1.0.1 - September 5, 2018

* Dependencies updated

v1.0.1-rc.6 - August 27, 2018

* Dependencies updated

v1.0.1-rc.5 - August 24, 2018

* Update incorrect relayer api fee recipients response schema (#974)

v1.0.1-rc.4 - August 14, 2018

* Allow for additional properties in txData schema (#938)
* Change hexSchema to match `0x` (#937)
* Upgrade Relayer API schemas for relayer API V2 (#916)

v1.0.1-rc.3 - July 26, 2018

* Dependencies updated

v1.0.1-rc.2 - July 26, 2018

* Dependencies updated

v1.0.1-rc.1 - July 26, 2018

* Dependencies updated

v1.0.0 - July 23, 2018

* Dependencies updated

v1.0.0-rc.1 - July 19, 2018

* Update schemas for V2 or 0x Protocol (#615)
* Added CallData schema (#821)
* Update CallData schema id to CallData (#894)

v0.8.3 - July 18, 2018

* Dependencies updated

v0.8.2 - July 9, 2018

* Dependencies updated

v0.8.1 - June 19, 2018

* Dependencies updated

v0.8.0 - May 22, 2018

* Update Order & SignedOrder schemas, remove ECSignature schema and add Hex schema as part of V2 upgrades (#615)

v0.7.24 - May 22, 2018

* Dependencies updated

v0.7.23 - May 4, 2018

* Dependencies updated

v0.7.22 - May 4, 2018

* Dependencies updated

v0.7.21 - April 18, 2018

* Dependencies updated

v0.7.20 - April 11, 2018

* Dependencies updated

v0.7.19 - April 2, 2018

* Dependencies updated

v0.7.18 - April 2, 2018

* Dependencies updated

v0.7.13 - February 8, 2018

*   Fix publishing issue where .npmignore was not properly excluding undesired content (#389)

v0.7.0 - December 19, 2017

* Rename `subscriptionOptsSchema` to `blockRangeSchema` (#272)

v0.6.7 - November 13, 2017

* Re-publish JSON-schema previously published under NPM package 0x-json-schemas