1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.schemas = {
|
4 | hex: {
|
5 | $id: "hex",
|
6 | type: "string",
|
7 | pattern: "^[0123456789A-Fa-f]+$",
|
8 | },
|
9 | base58: {
|
10 | $id: "base58",
|
11 | type: "string",
|
12 | pattern: "^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$",
|
13 | },
|
14 | alphanumeric: {
|
15 | $id: "alphanumeric",
|
16 | type: "string",
|
17 | pattern: "^[a-zA-Z0-9]+$",
|
18 | },
|
19 | transactionId: {
|
20 | $id: "transactionId",
|
21 | allOf: [{ minLength: 64, maxLength: 64 }, { $ref: "alphanumeric" }],
|
22 | },
|
23 | networkByte: {
|
24 | $id: "networkByte",
|
25 | network: true,
|
26 | },
|
27 | address: {
|
28 | $id: "address",
|
29 | allOf: [{ minLength: 34, maxLength: 34 }, { $ref: "base58" }, { addressOnNetwork: true }],
|
30 | },
|
31 | publicKey: {
|
32 | $id: "publicKey",
|
33 | allOf: [{ minLength: 66, maxLength: 66 }, { $ref: "hex" }, { transform: ["toLowerCase"] }],
|
34 | },
|
35 | walletVote: {
|
36 | $id: "walletVote",
|
37 | allOf: [{ type: "string", pattern: "^[+|-][a-zA-Z0-9]{66}$" }, { transform: ["toLowerCase"] }],
|
38 | },
|
39 | username: {
|
40 | $id: "delegateUsername",
|
41 | allOf: [
|
42 | { type: "string", pattern: "^[a-z0-9!@$&_.]+$" },
|
43 | { minLength: 1, maxLength: 20 },
|
44 | { transform: ["toLowerCase"] },
|
45 | ],
|
46 | },
|
47 | block: {
|
48 | $id: "block",
|
49 | type: "object",
|
50 | required: [
|
51 | "id",
|
52 | "timestamp",
|
53 | "previousBlock",
|
54 | "height",
|
55 | "totalAmount",
|
56 | "totalFee",
|
57 | "reward",
|
58 | "generatorPublicKey",
|
59 | "blockSignature",
|
60 | ],
|
61 | additionalProperties: false,
|
62 | properties: {
|
63 | id: { blockId: {} },
|
64 | idHex: { blockId: {} },
|
65 | version: { type: "integer", minimum: 0 },
|
66 | timestamp: { type: "integer", minimum: 0 },
|
67 | previousBlock: { blockId: { allowNullWhenGenesis: true, isPreviousBlock: true } },
|
68 | previousBlockHex: { blockId: { allowNullWhenGenesis: true, isPreviousBlock: true } },
|
69 | height: { type: "integer", minimum: 1 },
|
70 | numberOfTransactions: { type: "integer" },
|
71 | totalAmount: { bignumber: { minimum: 0, bypassGenesis: true, block: true } },
|
72 | totalFee: { bignumber: { minimum: 0, bypassGenesis: true, block: true } },
|
73 | reward: { bignumber: { minimum: 0 } },
|
74 | payloadLength: { type: "integer", minimum: 0 },
|
75 | payloadHash: { $ref: "hex" },
|
76 | generatorPublicKey: { $ref: "publicKey" },
|
77 | blockSignature: { $ref: "hex" },
|
78 | transactions: {
|
79 | $ref: "transactions",
|
80 | minItems: { $data: "1/numberOfTransactions" },
|
81 | maxItems: { $data: "1/numberOfTransactions" },
|
82 | },
|
83 | },
|
84 | },
|
85 | };
|
86 |
|
\ | No newline at end of file |