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 | blockHeader: {
|
48 | $id: "blockHeader",
|
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 | properties: {
|
62 | id: { blockId: {} },
|
63 | idHex: { blockId: {} },
|
64 | version: { type: "integer", minimum: 0 },
|
65 | timestamp: { type: "integer", minimum: 0 },
|
66 | previousBlock: { blockId: { allowNullWhenGenesis: true, isPreviousBlock: true } },
|
67 | previousBlockHex: { blockId: { allowNullWhenGenesis: true, isPreviousBlock: true } },
|
68 | height: { type: "integer", minimum: 1 },
|
69 | numberOfTransactions: { type: "integer" },
|
70 | totalAmount: { bignumber: { minimum: 0, bypassGenesis: true, block: true } },
|
71 | totalFee: { bignumber: { minimum: 0, bypassGenesis: true, block: true } },
|
72 | reward: { bignumber: { minimum: 0 } },
|
73 | payloadLength: { type: "integer", minimum: 0 },
|
74 | payloadHash: { $ref: "hex" },
|
75 | generatorPublicKey: { $ref: "publicKey" },
|
76 | blockSignature: { $ref: "hex" },
|
77 | },
|
78 | },
|
79 | block: {
|
80 | $id: "block",
|
81 | $ref: "blockHeader",
|
82 | properties: {
|
83 | transactions: {
|
84 | $ref: "transactions",
|
85 | minItems: { $data: "1/numberOfTransactions" },
|
86 | maxItems: { $data: "1/numberOfTransactions" },
|
87 | },
|
88 | },
|
89 | },
|
90 | };
|
91 |
|
\ | No newline at end of file |