aboutsummaryrefslogtreecommitdiffstats
path: root/packages/json-schemas/README.md
blob: d89f57a5e002f7a34fec88859f5beb695ead18ea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
json-schemas
------------

Contains 0x-related json schemas

## Install:

```bash
npm install @0xproject/json-schemas --save
```

## Usage:
```
import {SchemaValidator, ValidatorResult, schemas} from '@0xproject/json-schemas';

const {orderSchema} = schemas;
const validator = new SchemaValidator();

const order = {
    ...
};
const validatorResult: ValidatorResult = validator.validate(order, orderSchema); // Contains all errors
const isValid: boolean = validator.isValid(order, orderSchema); // Only returns boolean
```