diff options
author | Leonid <logvinov.leon@gmail.com> | 2017-11-21 04:46:53 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-21 04:46:53 +0800 |
commit | d39c0bee39a7bc9cbab6810e8b1b42dfe2e6cf09 (patch) | |
tree | a02081e61b11bfb6bb643fcb4e8981541bb8d2bd /packages/json-schemas/README.md | |
parent | 5788b90c522b63b53f5e8480f2b357ee24bb08a3 (diff) | |
parent | 037f466e1f80f635b48f3235258402e2ce75fb7b (diff) | |
download | dexon-sol-tools-d39c0bee39a7bc9cbab6810e8b1b42dfe2e6cf09.tar dexon-sol-tools-d39c0bee39a7bc9cbab6810e8b1b42dfe2e6cf09.tar.gz dexon-sol-tools-d39c0bee39a7bc9cbab6810e8b1b42dfe2e6cf09.tar.bz2 dexon-sol-tools-d39c0bee39a7bc9cbab6810e8b1b42dfe2e6cf09.tar.lz dexon-sol-tools-d39c0bee39a7bc9cbab6810e8b1b42dfe2e6cf09.tar.xz dexon-sol-tools-d39c0bee39a7bc9cbab6810e8b1b42dfe2e6cf09.tar.zst dexon-sol-tools-d39c0bee39a7bc9cbab6810e8b1b42dfe2e6cf09.zip |
Merge branch 'development' into feature/orderExpired
Diffstat (limited to 'packages/json-schemas/README.md')
-rw-r--r-- | packages/json-schemas/README.md | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/packages/json-schemas/README.md b/packages/json-schemas/README.md new file mode 100644 index 000000000..d89f57a5e --- /dev/null +++ b/packages/json-schemas/README.md @@ -0,0 +1,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 +``` |