-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdapp-schema.js
More file actions
42 lines (41 loc) · 1.03 KB
/
dapp-schema.js
File metadata and controls
42 lines (41 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const Joi = require("@hapi/joi");
module.exports = Joi.object({
from: [
Joi.object({
name: Joi.string(),
email: Joi.string().email()
}),
Joi.string().email()
],
templates: Joi.object({
subscribe: Joi.string(),
variables: Joi.object().optional(),
contracts: Joi.object().pattern(
Joi.string().pattern(/^0x[0-9A-Za-z]{40}$/),
Joi.object().pattern(
Joi.string(),
Joi.object({
ABI: Joi.object({
name: Joi.string(),
type: Joi.string().pattern(/^event$/),
inputs: Joi.array().items(
Joi.object({
indexed: Joi.bool(),
name: Joi.string(),
type: Joi.string()
})
)
}).unknown(),
index: [Joi.string(), Joi.func().arity(3)],
template: Joi.string(),
data: Joi.func()
.arity(2)
.optional(),
filter: Joi.func()
.arity(2)
.optional()
})
)
)
})
});