JSON Schemas describing various ILP related protocols and formats.
npm install --save ilp-schemas
This module does not contain a schema validator. We recommend using an open-source validator like ajv.
const schemas = require('ilp-schemas')
const Ajv = require('ajv')
// create validator
const ajv = new Ajv()
// add all schemas
Object.keys(schemas).forEach(name => ajv.addSchema(schemas[name], name))
// validate something
const isValid = ajv.validate('Transfer.json', myTransfer)
if (isValid) {
console.info('all good!')
} else {
console.error('not a valid transfer!')
console.error(ajv.errors)
}