nova-ui/services/validate/relayer.ts

35 lines
730 B
TypeScript
Raw Permalink Normal View History

2022-12-04 09:02:30 +03:00
const addressType = { type: 'string', pattern: '^0x[a-fA-F0-9]{40}$' }
const statusSchema = {
type: 'object',
properties: {
rewardAddress: addressType,
chainId: { type: 'number' },
version: { type: 'string' },
serviceFee: {
type: 'object',
properties: {
transfer: {
type: 'string',
},
withdrawal: {
type: 'number',
maximum: 20,
minimum: 0,
},
},
},
health: {
type: 'object',
properties: {
status: { const: true },
error: { type: 'string' },
},
required: ['status'],
},
},
required: ['rewardAddress', 'chainId', 'serviceFee', 'health'],
}
export { statusSchema }