@xyo-network/xl1-schema 1.7.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +165 -0
- package/README.md +230 -0
- package/dist/neutral/Executable.d.ts +4 -0
- package/dist/neutral/Executable.d.ts.map +1 -0
- package/dist/neutral/Executable.spec.d.ts +2 -0
- package/dist/neutral/Executable.spec.d.ts.map +1 -0
- package/dist/neutral/StorageMeta.d.ts +4 -0
- package/dist/neutral/StorageMeta.d.ts.map +1 -0
- package/dist/neutral/StorageMeta.spec.d.ts +2 -0
- package/dist/neutral/StorageMeta.spec.d.ts.map +1 -0
- package/dist/neutral/boundwitness/BlockBoundWitness.d.ts +6 -0
- package/dist/neutral/boundwitness/BlockBoundWitness.d.ts.map +1 -0
- package/dist/neutral/boundwitness/BlockBoundWitness.spec.d.ts +2 -0
- package/dist/neutral/boundwitness/BlockBoundWitness.spec.d.ts.map +1 -0
- package/dist/neutral/boundwitness/BlockBoundWitnessWithStorageMeta.d.ts +7 -0
- package/dist/neutral/boundwitness/BlockBoundWitnessWithStorageMeta.d.ts.map +1 -0
- package/dist/neutral/boundwitness/TransactionBoundWitness.d.ts +6 -0
- package/dist/neutral/boundwitness/TransactionBoundWitness.d.ts.map +1 -0
- package/dist/neutral/boundwitness/TransactionBoundWitnessWithStorageMeta.d.ts +6 -0
- package/dist/neutral/boundwitness/TransactionBoundWitnessWithStorageMeta.d.ts.map +1 -0
- package/dist/neutral/boundwitness/index.d.ts +5 -0
- package/dist/neutral/boundwitness/index.d.ts.map +1 -0
- package/dist/neutral/index.d.ts +5 -0
- package/dist/neutral/index.d.ts.map +1 -0
- package/dist/neutral/index.mjs +390 -0
- package/dist/neutral/index.mjs.map +1 -0
- package/dist/neutral/payload/ChainStakeIntent.d.ts +6 -0
- package/dist/neutral/payload/ChainStakeIntent.d.ts.map +1 -0
- package/dist/neutral/payload/ChainStakeIntent.spec.d.ts +2 -0
- package/dist/neutral/payload/ChainStakeIntent.spec.d.ts.map +1 -0
- package/dist/neutral/payload/HashPayload.d.ts +6 -0
- package/dist/neutral/payload/HashPayload.d.ts.map +1 -0
- package/dist/neutral/payload/HashPayload.spec.d.ts +2 -0
- package/dist/neutral/payload/HashPayload.spec.d.ts.map +1 -0
- package/dist/neutral/payload/TransferPayload.d.ts +6 -0
- package/dist/neutral/payload/TransferPayload.d.ts.map +1 -0
- package/dist/neutral/payload/TransferPayload.spec.d.ts +2 -0
- package/dist/neutral/payload/TransferPayload.spec.d.ts.map +1 -0
- package/dist/neutral/payload/index.d.ts +4 -0
- package/dist/neutral/payload/index.d.ts.map +1 -0
- package/package.json +64 -0
- package/src/Executable.spec.ts +43 -0
- package/src/Executable.ts +10 -0
- package/src/StorageMeta.spec.ts +64 -0
- package/src/StorageMeta.ts +14 -0
- package/src/boundwitness/BlockBoundWitness.spec.ts +229 -0
- package/src/boundwitness/BlockBoundWitness.ts +32 -0
- package/src/boundwitness/BlockBoundWitnessWithStorageMeta.ts +26 -0
- package/src/boundwitness/TransactionBoundWitness.ts +41 -0
- package/src/boundwitness/TransactionBoundWitnessWithStorageMeta.ts +30 -0
- package/src/boundwitness/index.ts +4 -0
- package/src/index.ts +4 -0
- package/src/payload/ChainStakeIntent.spec.ts +81 -0
- package/src/payload/ChainStakeIntent.ts +24 -0
- package/src/payload/HashPayload.spec.ts +74 -0
- package/src/payload/HashPayload.ts +23 -0
- package/src/payload/TransferPayload.spec.ts +84 -0
- package/src/payload/TransferPayload.ts +31 -0
- package/src/payload/index.ts +3 -0
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
// src/boundwitness/BlockBoundWitness.ts
|
|
2
|
+
import { BoundWitnessSchema } from "@xyo-network/boundwitness-model";
|
|
3
|
+
import { boundWitnessJsonSchema, boundWitnessProperties } from "@xyo-network/boundwitness-wrapper";
|
|
4
|
+
import { PayloadBuilder } from "@xyo-network/payload-builder";
|
|
5
|
+
import { AddressRegEx, HashRegEx } from "@xyo-network/payload-wrapper";
|
|
6
|
+
import { SchemaSchema } from "@xyo-network/schema-payload-plugin";
|
|
7
|
+
var BlockBoundWitnessJsonSchema = {
|
|
8
|
+
...boundWitnessJsonSchema,
|
|
9
|
+
$id: "https://schemas.xyo.network/2.0/block",
|
|
10
|
+
properties: {
|
|
11
|
+
...boundWitnessProperties,
|
|
12
|
+
block: {
|
|
13
|
+
type: "integer"
|
|
14
|
+
},
|
|
15
|
+
chain: {
|
|
16
|
+
type: "string",
|
|
17
|
+
pattern: AddressRegEx
|
|
18
|
+
},
|
|
19
|
+
previous: {
|
|
20
|
+
type: "string",
|
|
21
|
+
pattern: HashRegEx,
|
|
22
|
+
nullable: true
|
|
23
|
+
},
|
|
24
|
+
step_hashes: {
|
|
25
|
+
items: {
|
|
26
|
+
type: "string",
|
|
27
|
+
pattern: HashRegEx
|
|
28
|
+
},
|
|
29
|
+
type: "array"
|
|
30
|
+
},
|
|
31
|
+
$epoch: {
|
|
32
|
+
type: "integer"
|
|
33
|
+
},
|
|
34
|
+
schema: {
|
|
35
|
+
type: "string",
|
|
36
|
+
pattern: BoundWitnessSchema
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
required: [
|
|
40
|
+
...boundWitnessJsonSchema.required,
|
|
41
|
+
"block",
|
|
42
|
+
"chain",
|
|
43
|
+
"step_hashes",
|
|
44
|
+
"previous",
|
|
45
|
+
"$epoch"
|
|
46
|
+
],
|
|
47
|
+
type: "object"
|
|
48
|
+
};
|
|
49
|
+
var BlockBoundWitnessSchemaPayload = new PayloadBuilder({
|
|
50
|
+
schema: SchemaSchema
|
|
51
|
+
}).fields({
|
|
52
|
+
definition: BlockBoundWitnessJsonSchema
|
|
53
|
+
}).build();
|
|
54
|
+
|
|
55
|
+
// src/boundwitness/BlockBoundWitnessWithStorageMeta.ts
|
|
56
|
+
import { BoundWitnessSchema as BoundWitnessSchema2 } from "@xyo-network/boundwitness-model";
|
|
57
|
+
import { boundWitnessJsonSchema as boundWitnessJsonSchema2, boundWitnessProperties as boundWitnessProperties2 } from "@xyo-network/boundwitness-wrapper";
|
|
58
|
+
import { PayloadBuilder as PayloadBuilder2 } from "@xyo-network/payload-builder";
|
|
59
|
+
import { SchemaSchema as SchemaSchema2 } from "@xyo-network/schema-payload-plugin";
|
|
60
|
+
|
|
61
|
+
// src/StorageMeta.ts
|
|
62
|
+
import { HashRegEx as HashRegEx2, HexRegEx } from "@xyo-network/payload-wrapper";
|
|
63
|
+
var StorageMetaJsonSchema = {
|
|
64
|
+
$id: "https://schemas.xyo.network/2.0/storage-meta",
|
|
65
|
+
properties: {
|
|
66
|
+
_sequence: {
|
|
67
|
+
type: "string",
|
|
68
|
+
pattern: HexRegEx
|
|
69
|
+
},
|
|
70
|
+
_hash: {
|
|
71
|
+
type: "string",
|
|
72
|
+
pattern: HashRegEx2
|
|
73
|
+
},
|
|
74
|
+
_dataHash: {
|
|
75
|
+
type: "string",
|
|
76
|
+
pattern: HashRegEx2
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
required: [
|
|
80
|
+
"_sequence",
|
|
81
|
+
"_hash",
|
|
82
|
+
"_dataHash"
|
|
83
|
+
],
|
|
84
|
+
type: "object"
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
// src/boundwitness/BlockBoundWitnessWithStorageMeta.ts
|
|
88
|
+
var BlockBoundWitnessWithStorageMetaJsonSchema = {
|
|
89
|
+
$id: "https://schemas.xyo.network/2.0/block-with-storage-meta",
|
|
90
|
+
properties: {
|
|
91
|
+
...boundWitnessProperties2,
|
|
92
|
+
...BlockBoundWitnessJsonSchema.properties,
|
|
93
|
+
...StorageMetaJsonSchema.properties,
|
|
94
|
+
schema: {
|
|
95
|
+
type: "string",
|
|
96
|
+
pattern: BoundWitnessSchema2
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
required: [
|
|
100
|
+
.../* @__PURE__ */ new Set([
|
|
101
|
+
...boundWitnessJsonSchema2.required,
|
|
102
|
+
...BlockBoundWitnessJsonSchema.required,
|
|
103
|
+
...StorageMetaJsonSchema.required
|
|
104
|
+
])
|
|
105
|
+
],
|
|
106
|
+
type: "object"
|
|
107
|
+
};
|
|
108
|
+
var BlockBoundWitnessWithStorageMetaSchemaPayload = new PayloadBuilder2({
|
|
109
|
+
schema: SchemaSchema2
|
|
110
|
+
}).fields({
|
|
111
|
+
definition: BlockBoundWitnessWithStorageMetaJsonSchema
|
|
112
|
+
}).build();
|
|
113
|
+
|
|
114
|
+
// src/boundwitness/TransactionBoundWitness.ts
|
|
115
|
+
import { BoundWitnessSchema as BoundWitnessSchema3 } from "@xyo-network/boundwitness-model";
|
|
116
|
+
import { boundWitnessJsonSchema as boundWitnessJsonSchema3 } from "@xyo-network/boundwitness-wrapper";
|
|
117
|
+
import { PayloadBuilder as PayloadBuilder3 } from "@xyo-network/payload-builder";
|
|
118
|
+
import { AddressRegEx as AddressRegEx2, Uint256RegEx } from "@xyo-network/payload-wrapper";
|
|
119
|
+
import { SchemaSchema as SchemaSchema3 } from "@xyo-network/schema-payload-plugin";
|
|
120
|
+
|
|
121
|
+
// src/Executable.ts
|
|
122
|
+
var ExecutableJsonSchema = {
|
|
123
|
+
$id: "https://schemas.xyo.network/2.0/executable",
|
|
124
|
+
additionalProperties: true,
|
|
125
|
+
properties: {
|
|
126
|
+
script: {
|
|
127
|
+
items: {
|
|
128
|
+
type: "string",
|
|
129
|
+
pattern: String.raw`^elevate\|`
|
|
130
|
+
},
|
|
131
|
+
type: "array"
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
required: [
|
|
135
|
+
"script"
|
|
136
|
+
],
|
|
137
|
+
type: "object"
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
// src/boundwitness/TransactionBoundWitness.ts
|
|
141
|
+
var TransactionBoundWitnessJsonSchema = {
|
|
142
|
+
...boundWitnessJsonSchema3,
|
|
143
|
+
$id: "https://schemas.xyo.network/2.0/transaction",
|
|
144
|
+
additionalProperties: false,
|
|
145
|
+
properties: {
|
|
146
|
+
...boundWitnessJsonSchema3.properties,
|
|
147
|
+
...ExecutableJsonSchema.properties,
|
|
148
|
+
chain: {
|
|
149
|
+
type: "string",
|
|
150
|
+
pattern: AddressRegEx2
|
|
151
|
+
},
|
|
152
|
+
fees: {
|
|
153
|
+
type: "object",
|
|
154
|
+
properties: {
|
|
155
|
+
base: {
|
|
156
|
+
type: "string",
|
|
157
|
+
pattern: Uint256RegEx
|
|
158
|
+
},
|
|
159
|
+
gasLimit: {
|
|
160
|
+
type: "string",
|
|
161
|
+
pattern: Uint256RegEx
|
|
162
|
+
},
|
|
163
|
+
gasPrice: {
|
|
164
|
+
type: "string",
|
|
165
|
+
pattern: Uint256RegEx
|
|
166
|
+
},
|
|
167
|
+
priority: {
|
|
168
|
+
type: "string",
|
|
169
|
+
pattern: Uint256RegEx
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
required: [
|
|
173
|
+
"base"
|
|
174
|
+
],
|
|
175
|
+
additionalProperties: false
|
|
176
|
+
},
|
|
177
|
+
from: {
|
|
178
|
+
type: "string",
|
|
179
|
+
pattern: AddressRegEx2
|
|
180
|
+
},
|
|
181
|
+
nbf: {
|
|
182
|
+
type: "integer"
|
|
183
|
+
},
|
|
184
|
+
exp: {
|
|
185
|
+
type: "integer"
|
|
186
|
+
},
|
|
187
|
+
schema: {
|
|
188
|
+
type: "string",
|
|
189
|
+
pattern: BoundWitnessSchema3
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
required: [
|
|
193
|
+
...boundWitnessJsonSchema3.required,
|
|
194
|
+
"chain",
|
|
195
|
+
"fees",
|
|
196
|
+
"nbf",
|
|
197
|
+
"exp"
|
|
198
|
+
],
|
|
199
|
+
type: "object"
|
|
200
|
+
};
|
|
201
|
+
var TransactionBoundWitnessSchemaPayload = new PayloadBuilder3({
|
|
202
|
+
schema: SchemaSchema3
|
|
203
|
+
}).fields({
|
|
204
|
+
definition: TransactionBoundWitnessJsonSchema
|
|
205
|
+
}).build();
|
|
206
|
+
|
|
207
|
+
// src/boundwitness/TransactionBoundWitnessWithStorageMeta.ts
|
|
208
|
+
import { BoundWitnessSchema as BoundWitnessSchema4 } from "@xyo-network/boundwitness-model";
|
|
209
|
+
import { boundWitnessJsonSchema as boundWitnessJsonSchema4 } from "@xyo-network/boundwitness-wrapper";
|
|
210
|
+
import { PayloadBuilder as PayloadBuilder4 } from "@xyo-network/payload-builder";
|
|
211
|
+
import { AddressRegEx as AddressRegEx3, Uint256RegEx as Uint256RegEx2 } from "@xyo-network/payload-wrapper";
|
|
212
|
+
import { SchemaSchema as SchemaSchema4 } from "@xyo-network/schema-payload-plugin";
|
|
213
|
+
var TransactionBoundWitnessWithStorageMetaJsonSchema = {
|
|
214
|
+
...boundWitnessJsonSchema4,
|
|
215
|
+
$id: "https://schemas.xyo.network/2.0/transaction-with-storage-meta",
|
|
216
|
+
additionalProperties: false,
|
|
217
|
+
properties: {
|
|
218
|
+
...boundWitnessJsonSchema4.properties,
|
|
219
|
+
...StorageMetaJsonSchema.properties,
|
|
220
|
+
chain: {
|
|
221
|
+
type: "string",
|
|
222
|
+
pattern: AddressRegEx3
|
|
223
|
+
},
|
|
224
|
+
gas: {
|
|
225
|
+
type: "string",
|
|
226
|
+
pattern: Uint256RegEx2
|
|
227
|
+
},
|
|
228
|
+
nbf: {
|
|
229
|
+
type: "integer"
|
|
230
|
+
},
|
|
231
|
+
exp: {
|
|
232
|
+
type: "integer"
|
|
233
|
+
},
|
|
234
|
+
schema: {
|
|
235
|
+
type: "string",
|
|
236
|
+
pattern: BoundWitnessSchema4
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
required: [
|
|
240
|
+
...boundWitnessJsonSchema4.required,
|
|
241
|
+
...StorageMetaJsonSchema.required,
|
|
242
|
+
"chain",
|
|
243
|
+
"gas",
|
|
244
|
+
"nbf",
|
|
245
|
+
"exp"
|
|
246
|
+
],
|
|
247
|
+
type: "object"
|
|
248
|
+
};
|
|
249
|
+
var TransactionBoundWitnessWithStorageMetaSchemaPayload = new PayloadBuilder4({
|
|
250
|
+
schema: SchemaSchema4
|
|
251
|
+
}).fields({
|
|
252
|
+
definition: TransactionBoundWitnessWithStorageMetaJsonSchema
|
|
253
|
+
}).build();
|
|
254
|
+
|
|
255
|
+
// src/payload/ChainStakeIntent.ts
|
|
256
|
+
import { PayloadBuilder as PayloadBuilder5 } from "@xyo-network/payload-builder";
|
|
257
|
+
import { AddressRegEx as AddressRegEx4, payloadJsonSchema } from "@xyo-network/payload-wrapper";
|
|
258
|
+
import { SchemaSchema as SchemaSchema5 } from "@xyo-network/schema-payload-plugin";
|
|
259
|
+
import { ChainStakeIntentSchema } from "@xyo-network/xl1-protocol";
|
|
260
|
+
var ChainStakeIntentPayloadJsonSchema = {
|
|
261
|
+
...payloadJsonSchema,
|
|
262
|
+
$id: "https://schemas.xyo.network/2.0/payload/chain-stake-intent",
|
|
263
|
+
additionalProperties: false,
|
|
264
|
+
properties: {
|
|
265
|
+
...payloadJsonSchema.properties,
|
|
266
|
+
from: {
|
|
267
|
+
type: "string",
|
|
268
|
+
pattern: AddressRegEx4
|
|
269
|
+
},
|
|
270
|
+
intent: {
|
|
271
|
+
type: "string",
|
|
272
|
+
enum: [
|
|
273
|
+
"producer"
|
|
274
|
+
]
|
|
275
|
+
},
|
|
276
|
+
schema: {
|
|
277
|
+
type: "string",
|
|
278
|
+
pattern: ChainStakeIntentSchema
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
required: [
|
|
282
|
+
...payloadJsonSchema.required,
|
|
283
|
+
"intent"
|
|
284
|
+
],
|
|
285
|
+
type: "object"
|
|
286
|
+
};
|
|
287
|
+
var ChainStakeIntentPayloadJsonSchemaPayload = new PayloadBuilder5({
|
|
288
|
+
schema: SchemaSchema5
|
|
289
|
+
}).fields({
|
|
290
|
+
definition: ChainStakeIntentPayloadJsonSchema
|
|
291
|
+
}).build();
|
|
292
|
+
|
|
293
|
+
// src/payload/HashPayload.ts
|
|
294
|
+
import { PayloadBuilder as PayloadBuilder6 } from "@xyo-network/payload-builder";
|
|
295
|
+
import { HashRegEx as HashRegEx3, payloadJsonSchema as payloadJsonSchema2 } from "@xyo-network/payload-wrapper";
|
|
296
|
+
import { SchemaSchema as SchemaSchema6 } from "@xyo-network/schema-payload-plugin";
|
|
297
|
+
import { HashSchema } from "@xyo-network/xl1-protocol";
|
|
298
|
+
var HashPayloadJsonSchema = {
|
|
299
|
+
...payloadJsonSchema2,
|
|
300
|
+
$id: "https://schemas.xyo.network/2.0/payload/hash",
|
|
301
|
+
additionalProperties: false,
|
|
302
|
+
properties: {
|
|
303
|
+
...payloadJsonSchema2.properties,
|
|
304
|
+
hash: {
|
|
305
|
+
type: "string",
|
|
306
|
+
pattern: HashRegEx3
|
|
307
|
+
},
|
|
308
|
+
schema: {
|
|
309
|
+
type: "string",
|
|
310
|
+
pattern: HashSchema
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
required: [
|
|
314
|
+
...payloadJsonSchema2.required,
|
|
315
|
+
"hash"
|
|
316
|
+
],
|
|
317
|
+
type: "object"
|
|
318
|
+
};
|
|
319
|
+
var HashPayloadJsonSchemaPayload = new PayloadBuilder6({
|
|
320
|
+
schema: SchemaSchema6
|
|
321
|
+
}).fields({
|
|
322
|
+
definition: HashPayloadJsonSchema
|
|
323
|
+
}).build();
|
|
324
|
+
|
|
325
|
+
// src/payload/TransferPayload.ts
|
|
326
|
+
import { PayloadBuilder as PayloadBuilder7 } from "@xyo-network/payload-builder";
|
|
327
|
+
import { AddressRegEx as AddressRegEx5, payloadJsonSchema as payloadJsonSchema3, Uint256RegEx as Uint256RegEx3 } from "@xyo-network/payload-wrapper";
|
|
328
|
+
import { SchemaSchema as SchemaSchema7 } from "@xyo-network/schema-payload-plugin";
|
|
329
|
+
import { TransferSchema } from "@xyo-network/xl1-protocol";
|
|
330
|
+
var TransferPayloadJsonSchema = {
|
|
331
|
+
...payloadJsonSchema3,
|
|
332
|
+
$id: "https://schemas.xyo.network/2.0/payload/transfer",
|
|
333
|
+
additionalProperties: false,
|
|
334
|
+
properties: {
|
|
335
|
+
...payloadJsonSchema3.properties,
|
|
336
|
+
from: {
|
|
337
|
+
type: "string",
|
|
338
|
+
pattern: AddressRegEx5
|
|
339
|
+
},
|
|
340
|
+
epoch: {
|
|
341
|
+
type: "number"
|
|
342
|
+
},
|
|
343
|
+
transfers: {
|
|
344
|
+
type: "object",
|
|
345
|
+
propertyNames: {
|
|
346
|
+
pattern: AddressRegEx5
|
|
347
|
+
},
|
|
348
|
+
patternProperties: {
|
|
349
|
+
[AddressRegEx5]: {
|
|
350
|
+
type: "string",
|
|
351
|
+
pattern: Uint256RegEx3
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
schema: {
|
|
356
|
+
type: "string",
|
|
357
|
+
pattern: TransferSchema
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
required: [
|
|
361
|
+
...payloadJsonSchema3.required,
|
|
362
|
+
"transfers",
|
|
363
|
+
"epoch"
|
|
364
|
+
],
|
|
365
|
+
type: "object"
|
|
366
|
+
};
|
|
367
|
+
var TransferPayloadJsonSchemaPayload = new PayloadBuilder7({
|
|
368
|
+
schema: SchemaSchema7
|
|
369
|
+
}).fields({
|
|
370
|
+
definition: TransferPayloadJsonSchema
|
|
371
|
+
}).build();
|
|
372
|
+
export {
|
|
373
|
+
BlockBoundWitnessJsonSchema,
|
|
374
|
+
BlockBoundWitnessSchemaPayload,
|
|
375
|
+
BlockBoundWitnessWithStorageMetaJsonSchema,
|
|
376
|
+
BlockBoundWitnessWithStorageMetaSchemaPayload,
|
|
377
|
+
ChainStakeIntentPayloadJsonSchema,
|
|
378
|
+
ChainStakeIntentPayloadJsonSchemaPayload,
|
|
379
|
+
ExecutableJsonSchema,
|
|
380
|
+
HashPayloadJsonSchema,
|
|
381
|
+
HashPayloadJsonSchemaPayload,
|
|
382
|
+
StorageMetaJsonSchema,
|
|
383
|
+
TransactionBoundWitnessJsonSchema,
|
|
384
|
+
TransactionBoundWitnessSchemaPayload,
|
|
385
|
+
TransactionBoundWitnessWithStorageMetaJsonSchema,
|
|
386
|
+
TransactionBoundWitnessWithStorageMetaSchemaPayload,
|
|
387
|
+
TransferPayloadJsonSchema,
|
|
388
|
+
TransferPayloadJsonSchemaPayload
|
|
389
|
+
};
|
|
390
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/boundwitness/BlockBoundWitness.ts","../../src/boundwitness/BlockBoundWitnessWithStorageMeta.ts","../../src/StorageMeta.ts","../../src/boundwitness/TransactionBoundWitness.ts","../../src/Executable.ts","../../src/boundwitness/TransactionBoundWitnessWithStorageMeta.ts","../../src/payload/ChainStakeIntent.ts","../../src/payload/HashPayload.ts","../../src/payload/TransferPayload.ts"],"sourcesContent":["import { BoundWitnessSchema } from '@xyo-network/boundwitness-model'\nimport { boundWitnessJsonSchema, boundWitnessProperties } from '@xyo-network/boundwitness-wrapper'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { AddressRegEx, HashRegEx } from '@xyo-network/payload-wrapper'\nimport type { SchemaPayload } from '@xyo-network/schema-payload-plugin'\nimport { SchemaSchema } from '@xyo-network/schema-payload-plugin'\nimport type { BlockBoundWitness } from '@xyo-network/xl1-protocol'\nimport type { JSONSchemaType } from 'ajv'\n\nexport const BlockBoundWitnessJsonSchema: JSONSchemaType<BlockBoundWitness> = {\n ...boundWitnessJsonSchema,\n $id: 'https://schemas.xyo.network/2.0/block',\n properties: {\n ...boundWitnessProperties,\n block: { type: 'integer' },\n chain: { type: 'string', pattern: AddressRegEx },\n previous: {\n type: 'string', pattern: HashRegEx, nullable: true,\n },\n step_hashes: {\n items: { type: 'string', pattern: HashRegEx },\n type: 'array',\n },\n $epoch: { type: 'integer' },\n schema: { type: 'string', pattern: BoundWitnessSchema },\n },\n required: [...boundWitnessJsonSchema.required, 'block', 'chain', 'step_hashes', 'previous', '$epoch'],\n type: 'object',\n} as const\n\nexport const BlockBoundWitnessSchemaPayload = new PayloadBuilder<SchemaPayload>({ schema: SchemaSchema })\n .fields({ definition: BlockBoundWitnessJsonSchema }).build()\n","import { BoundWitnessSchema } from '@xyo-network/boundwitness-model'\nimport { boundWitnessJsonSchema, boundWitnessProperties } from '@xyo-network/boundwitness-wrapper'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport type { SchemaPayload } from '@xyo-network/schema-payload-plugin'\nimport { SchemaSchema } from '@xyo-network/schema-payload-plugin'\nimport type { BlockBoundWitness } from '@xyo-network/xl1-protocol'\nimport type { JSONSchemaType } from 'ajv'\n\nimport { StorageMetaJsonSchema } from '../StorageMeta.ts'\nimport { BlockBoundWitnessJsonSchema } from './BlockBoundWitness.ts'\n\nexport const BlockBoundWitnessWithStorageMetaJsonSchema: JSONSchemaType<WithStorageMeta<BlockBoundWitness>> = {\n $id: 'https://schemas.xyo.network/2.0/block-with-storage-meta',\n properties: {\n ...boundWitnessProperties,\n ...BlockBoundWitnessJsonSchema.properties,\n ...StorageMetaJsonSchema.properties,\n schema: { type: 'string', pattern: BoundWitnessSchema },\n },\n required: [...new Set([...boundWitnessJsonSchema.required, ...BlockBoundWitnessJsonSchema.required, ...StorageMetaJsonSchema.required])],\n type: 'object',\n} as const\n\nexport const BlockBoundWitnessWithStorageMetaSchemaPayload = new PayloadBuilder<SchemaPayload>({ schema: SchemaSchema })\n .fields({ definition: BlockBoundWitnessWithStorageMetaJsonSchema }).build()\n","import type { StorageMeta } from '@xyo-network/payload-model'\nimport { HashRegEx, HexRegEx } from '@xyo-network/payload-wrapper'\nimport type { JSONSchemaType } from 'ajv'\n\nexport const StorageMetaJsonSchema: JSONSchemaType<StorageMeta> = {\n $id: 'https://schemas.xyo.network/2.0/storage-meta',\n properties: {\n _sequence: { type: 'string', pattern: HexRegEx },\n _hash: { type: 'string', pattern: HashRegEx },\n _dataHash: { type: 'string', pattern: HashRegEx },\n },\n required: ['_sequence', '_hash', '_dataHash'],\n type: 'object',\n} as const\n","import { BoundWitnessSchema } from '@xyo-network/boundwitness-model'\nimport { boundWitnessJsonSchema } from '@xyo-network/boundwitness-wrapper'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { AddressRegEx, Uint256RegEx } from '@xyo-network/payload-wrapper'\nimport type { SchemaPayload } from '@xyo-network/schema-payload-plugin'\nimport { SchemaSchema } from '@xyo-network/schema-payload-plugin'\nimport type { TransactionBoundWitness } from '@xyo-network/xl1-protocol'\nimport type { JSONSchemaType } from 'ajv'\n\nimport { ExecutableJsonSchema } from '../Executable.ts'\n\nexport const TransactionBoundWitnessJsonSchema: JSONSchemaType<TransactionBoundWitness> = {\n ...boundWitnessJsonSchema,\n $id: 'https://schemas.xyo.network/2.0/transaction',\n additionalProperties: false,\n properties: {\n ...boundWitnessJsonSchema.properties,\n ...ExecutableJsonSchema.properties,\n chain: { type: 'string', pattern: AddressRegEx },\n fees: {\n type: 'object',\n properties: {\n base: { type: 'string', pattern: Uint256RegEx },\n gasLimit: { type: 'string', pattern: Uint256RegEx },\n gasPrice: { type: 'string', pattern: Uint256RegEx },\n priority: { type: 'string', pattern: Uint256RegEx },\n },\n required: ['base'],\n additionalProperties: false,\n },\n from: { type: 'string', pattern: AddressRegEx },\n nbf: { type: 'integer' },\n exp: { type: 'integer' },\n schema: { type: 'string', pattern: BoundWitnessSchema },\n },\n required: [...boundWitnessJsonSchema.required, 'chain', 'fees', 'nbf', 'exp'],\n type: 'object',\n} as const\n\nexport const TransactionBoundWitnessSchemaPayload = new PayloadBuilder<SchemaPayload>({ schema: SchemaSchema })\n .fields({ definition: TransactionBoundWitnessJsonSchema }).build()\n","import type { Executable } from '@xyo-network/xl1-protocol'\nimport type { JSONSchemaType } from 'ajv'\n\nexport const ExecutableJsonSchema: JSONSchemaType<Executable> = {\n $id: 'https://schemas.xyo.network/2.0/executable',\n additionalProperties: true,\n properties: { script: { items: { type: 'string', pattern: String.raw`^elevate\\|` }, type: 'array' } },\n required: ['script'],\n type: 'object',\n} as const\n","import { BoundWitnessSchema } from '@xyo-network/boundwitness-model'\nimport { boundWitnessJsonSchema } from '@xyo-network/boundwitness-wrapper'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { AddressRegEx, Uint256RegEx } from '@xyo-network/payload-wrapper'\nimport type { SchemaPayload } from '@xyo-network/schema-payload-plugin'\nimport { SchemaSchema } from '@xyo-network/schema-payload-plugin'\nimport type { TransactionBoundWitness } from '@xyo-network/xl1-protocol'\nimport type { JSONSchemaType } from 'ajv'\n\nimport { StorageMetaJsonSchema } from '../StorageMeta.ts'\n\nexport const TransactionBoundWitnessWithStorageMetaJsonSchema: JSONSchemaType<TransactionBoundWitness> = {\n ...boundWitnessJsonSchema,\n $id: 'https://schemas.xyo.network/2.0/transaction-with-storage-meta',\n additionalProperties: false,\n properties: {\n ...boundWitnessJsonSchema.properties,\n ...StorageMetaJsonSchema.properties,\n chain: { type: 'string', pattern: AddressRegEx },\n gas: { type: 'string', pattern: Uint256RegEx },\n nbf: { type: 'integer' },\n exp: { type: 'integer' },\n schema: { type: 'string', pattern: BoundWitnessSchema },\n },\n required: [...boundWitnessJsonSchema.required, ...StorageMetaJsonSchema.required, 'chain', 'gas', 'nbf', 'exp'],\n type: 'object',\n} as const\n\nexport const TransactionBoundWitnessWithStorageMetaSchemaPayload = new PayloadBuilder<SchemaPayload>({ schema: SchemaSchema })\n .fields({ definition: TransactionBoundWitnessWithStorageMetaJsonSchema }).build()\n","import { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { AddressRegEx, payloadJsonSchema } from '@xyo-network/payload-wrapper'\nimport type { SchemaPayload } from '@xyo-network/schema-payload-plugin'\nimport { SchemaSchema } from '@xyo-network/schema-payload-plugin'\nimport type { ChainStakeIntent } from '@xyo-network/xl1-protocol'\nimport { ChainStakeIntentSchema } from '@xyo-network/xl1-protocol'\nimport type { JSONSchemaType } from 'ajv'\n\nexport const ChainStakeIntentPayloadJsonSchema: JSONSchemaType<ChainStakeIntent> = {\n ...payloadJsonSchema,\n $id: 'https://schemas.xyo.network/2.0/payload/chain-stake-intent',\n additionalProperties: false,\n properties: {\n ...payloadJsonSchema.properties,\n from: { type: 'string', pattern: AddressRegEx },\n intent: { type: 'string', enum: ['producer'] },\n schema: { type: 'string', pattern: ChainStakeIntentSchema },\n },\n required: [...payloadJsonSchema.required, 'intent'],\n type: 'object',\n}\n\nexport const ChainStakeIntentPayloadJsonSchemaPayload = new PayloadBuilder<SchemaPayload>({ schema: SchemaSchema })\n .fields({ definition: ChainStakeIntentPayloadJsonSchema }).build()\n","import { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { HashRegEx, payloadJsonSchema } from '@xyo-network/payload-wrapper'\nimport type { SchemaPayload } from '@xyo-network/schema-payload-plugin'\nimport { SchemaSchema } from '@xyo-network/schema-payload-plugin'\nimport type { HashPayload } from '@xyo-network/xl1-protocol'\nimport { HashSchema } from '@xyo-network/xl1-protocol'\nimport type { JSONSchemaType } from 'ajv'\n\nexport const HashPayloadJsonSchema: JSONSchemaType<HashPayload> = {\n ...payloadJsonSchema,\n $id: 'https://schemas.xyo.network/2.0/payload/hash',\n additionalProperties: false,\n properties: {\n ...payloadJsonSchema.properties,\n hash: { type: 'string', pattern: HashRegEx },\n schema: { type: 'string', pattern: HashSchema },\n },\n required: [...payloadJsonSchema.required, 'hash'],\n type: 'object',\n}\n\nexport const HashPayloadJsonSchemaPayload = new PayloadBuilder<SchemaPayload>({ schema: SchemaSchema })\n .fields({ definition: HashPayloadJsonSchema }).build()\n","import { PayloadBuilder } from '@xyo-network/payload-builder'\nimport {\n AddressRegEx, payloadJsonSchema, Uint256RegEx,\n} from '@xyo-network/payload-wrapper'\nimport type { SchemaPayload } from '@xyo-network/schema-payload-plugin'\nimport { SchemaSchema } from '@xyo-network/schema-payload-plugin'\nimport type { Transfer } from '@xyo-network/xl1-protocol'\nimport { TransferSchema } from '@xyo-network/xl1-protocol'\nimport type { JSONSchemaType } from 'ajv'\n\nexport const TransferPayloadJsonSchema: JSONSchemaType<Transfer> = {\n ...payloadJsonSchema,\n $id: 'https://schemas.xyo.network/2.0/payload/transfer',\n additionalProperties: false,\n properties: {\n ...payloadJsonSchema.properties,\n from: { type: 'string', pattern: AddressRegEx },\n epoch: { type: 'number' },\n transfers: {\n type: 'object',\n propertyNames: { pattern: AddressRegEx },\n patternProperties: { [AddressRegEx]: { type: 'string', pattern: Uint256RegEx } },\n },\n schema: { type: 'string', pattern: TransferSchema },\n },\n required: [...payloadJsonSchema.required, 'transfers', 'epoch'],\n type: 'object',\n}\n\nexport const TransferPayloadJsonSchemaPayload = new PayloadBuilder<SchemaPayload>({ schema: SchemaSchema })\n .fields({ definition: TransferPayloadJsonSchema }).build()\n"],"mappings":";AAAA,SAASA,0BAA0B;AACnC,SAASC,wBAAwBC,8BAA8B;AAC/D,SAASC,sBAAsB;AAC/B,SAASC,cAAcC,iBAAiB;AAExC,SAASC,oBAAoB;AAItB,IAAMC,8BAAiE;EAC5E,GAAGN;EACHO,KAAK;EACLC,YAAY;IACV,GAAGP;IACHQ,OAAO;MAAEC,MAAM;IAAU;IACzBC,OAAO;MAAED,MAAM;MAAUE,SAAST;IAAa;IAC/CU,UAAU;MACRH,MAAM;MAAUE,SAASR;MAAWU,UAAU;IAChD;IACAC,aAAa;MACXC,OAAO;QAAEN,MAAM;QAAUE,SAASR;MAAU;MAC5CM,MAAM;IACR;IACAO,QAAQ;MAAEP,MAAM;IAAU;IAC1BQ,QAAQ;MAAER,MAAM;MAAUE,SAASb;IAAmB;EACxD;EACAoB,UAAU;OAAInB,uBAAuBmB;IAAU;IAAS;IAAS;IAAe;IAAY;;EAC5FT,MAAM;AACR;AAEO,IAAMU,iCAAiC,IAAIlB,eAA8B;EAAEgB,QAAQb;AAAa,CAAA,EACpGgB,OAAO;EAAEC,YAAYhB;AAA4B,CAAA,EAAGiB,MAAK;;;AC/B5D,SAASC,sBAAAA,2BAA0B;AACnC,SAASC,0BAAA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C,kBAAAA,uBAAsB;AAC/B,SACEC,gBAAAA,eAAcC,qBAAAA,oBAAmBC,gBAAAA,qBAC5B;AAEP,SAASC,gBAAAA,qBAAoB;AAE7B,SAASC,sBAAsB;AAGxB,IAAMC,4BAAsD;EACjE,GAAGJ;EACHK,KAAK;EACLC,sBAAsB;EACtBC,YAAY;IACV,GAAGP,mBAAkBO;IACrBC,MAAM;MAAEC,MAAM;MAAUC,SAASX;IAAa;IAC9CY,OAAO;MAAEF,MAAM;IAAS;IACxBG,WAAW;MACTH,MAAM;MACNI,eAAe;QAAEH,SAASX;MAAa;MACvCe,mBAAmB;QAAE,CAACf,aAAAA,GAAe;UAAEU,MAAM;UAAUC,SAAST;QAAa;MAAE;IACjF;IACAc,QAAQ;MAAEN,MAAM;MAAUC,SAASP;IAAe;EACpD;EACAa,UAAU;OAAIhB,mBAAkBgB;IAAU;IAAa;;EACvDP,MAAM;AACR;AAEO,IAAMQ,mCAAmC,IAAInB,gBAA8B;EAAEiB,QAAQb;AAAa,CAAA,EACtGgB,OAAO;EAAEC,YAAYf;AAA0B,CAAA,EAAGgB,MAAK;","names":["BoundWitnessSchema","boundWitnessJsonSchema","boundWitnessProperties","PayloadBuilder","AddressRegEx","HashRegEx","SchemaSchema","BlockBoundWitnessJsonSchema","$id","properties","block","type","chain","pattern","previous","nullable","step_hashes","items","$epoch","schema","required","BlockBoundWitnessSchemaPayload","fields","definition","build","BoundWitnessSchema","boundWitnessJsonSchema","boundWitnessProperties","PayloadBuilder","SchemaSchema","HashRegEx","HexRegEx","StorageMetaJsonSchema","$id","properties","_sequence","type","pattern","_hash","_dataHash","required","BlockBoundWitnessWithStorageMetaJsonSchema","$id","properties","boundWitnessProperties","BlockBoundWitnessJsonSchema","StorageMetaJsonSchema","schema","type","pattern","BoundWitnessSchema","required","Set","boundWitnessJsonSchema","BlockBoundWitnessWithStorageMetaSchemaPayload","PayloadBuilder","SchemaSchema","fields","definition","build","BoundWitnessSchema","boundWitnessJsonSchema","PayloadBuilder","AddressRegEx","Uint256RegEx","SchemaSchema","ExecutableJsonSchema","$id","additionalProperties","properties","script","items","type","pattern","String","raw","required","TransactionBoundWitnessJsonSchema","boundWitnessJsonSchema","$id","additionalProperties","properties","ExecutableJsonSchema","chain","type","pattern","AddressRegEx","fees","base","Uint256RegEx","gasLimit","gasPrice","priority","required","from","nbf","exp","schema","BoundWitnessSchema","TransactionBoundWitnessSchemaPayload","PayloadBuilder","SchemaSchema","fields","definition","build","BoundWitnessSchema","boundWitnessJsonSchema","PayloadBuilder","AddressRegEx","Uint256RegEx","SchemaSchema","TransactionBoundWitnessWithStorageMetaJsonSchema","boundWitnessJsonSchema","$id","additionalProperties","properties","StorageMetaJsonSchema","chain","type","pattern","AddressRegEx","gas","Uint256RegEx","nbf","exp","schema","BoundWitnessSchema","required","TransactionBoundWitnessWithStorageMetaSchemaPayload","PayloadBuilder","SchemaSchema","fields","definition","build","PayloadBuilder","AddressRegEx","payloadJsonSchema","SchemaSchema","ChainStakeIntentSchema","ChainStakeIntentPayloadJsonSchema","$id","additionalProperties","properties","from","type","pattern","intent","enum","schema","required","ChainStakeIntentPayloadJsonSchemaPayload","fields","definition","build","PayloadBuilder","HashRegEx","payloadJsonSchema","SchemaSchema","HashSchema","HashPayloadJsonSchema","$id","additionalProperties","properties","hash","type","pattern","schema","required","HashPayloadJsonSchemaPayload","fields","definition","build","PayloadBuilder","AddressRegEx","payloadJsonSchema","Uint256RegEx","SchemaSchema","TransferSchema","TransferPayloadJsonSchema","$id","additionalProperties","properties","from","type","pattern","epoch","transfers","propertyNames","patternProperties","schema","required","TransferPayloadJsonSchemaPayload","fields","definition","build"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SchemaPayload } from '@xyo-network/schema-payload-plugin';
|
|
2
|
+
import type { ChainStakeIntent } from '@xyo-network/xl1-protocol';
|
|
3
|
+
import type { JSONSchemaType } from 'ajv';
|
|
4
|
+
export declare const ChainStakeIntentPayloadJsonSchema: JSONSchemaType<ChainStakeIntent>;
|
|
5
|
+
export declare const ChainStakeIntentPayloadJsonSchemaPayload: SchemaPayload;
|
|
6
|
+
//# sourceMappingURL=ChainStakeIntent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChainStakeIntent.d.ts","sourceRoot":"","sources":["../../../src/payload/ChainStakeIntent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAA;AAEvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAEjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AAEzC,eAAO,MAAM,iCAAiC,EAAE,cAAc,CAAC,gBAAgB,CAY9E,CAAA;AAED,eAAO,MAAM,wCAAwC,eACe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChainStakeIntent.spec.d.ts","sourceRoot":"","sources":["../../../src/payload/ChainStakeIntent.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SchemaPayload } from '@xyo-network/schema-payload-plugin';
|
|
2
|
+
import type { HashPayload } from '@xyo-network/xl1-protocol';
|
|
3
|
+
import type { JSONSchemaType } from 'ajv';
|
|
4
|
+
export declare const HashPayloadJsonSchema: JSONSchemaType<HashPayload>;
|
|
5
|
+
export declare const HashPayloadJsonSchemaPayload: SchemaPayload;
|
|
6
|
+
//# sourceMappingURL=HashPayload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HashPayload.d.ts","sourceRoot":"","sources":["../../../src/payload/HashPayload.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAA;AAEvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAE5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AAEzC,eAAO,MAAM,qBAAqB,EAAE,cAAc,CAAC,WAAW,CAW7D,CAAA;AAED,eAAO,MAAM,4BAA4B,eACe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HashPayload.spec.d.ts","sourceRoot":"","sources":["../../../src/payload/HashPayload.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SchemaPayload } from '@xyo-network/schema-payload-plugin';
|
|
2
|
+
import type { Transfer } from '@xyo-network/xl1-protocol';
|
|
3
|
+
import type { JSONSchemaType } from 'ajv';
|
|
4
|
+
export declare const TransferPayloadJsonSchema: JSONSchemaType<Transfer>;
|
|
5
|
+
export declare const TransferPayloadJsonSchemaPayload: SchemaPayload;
|
|
6
|
+
//# sourceMappingURL=TransferPayload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransferPayload.d.ts","sourceRoot":"","sources":["../../../src/payload/TransferPayload.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAA;AAEvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AAEzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AAEzC,eAAO,MAAM,yBAAyB,EAAE,cAAc,CAAC,QAAQ,CAiB9D,CAAA;AAED,eAAO,MAAM,gCAAgC,eACe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransferPayload.spec.d.ts","sourceRoot":"","sources":["../../../src/payload/TransferPayload.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/payload/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json.schemastore.org/package.json",
|
|
3
|
+
"name": "@xyo-network/xl1-schema",
|
|
4
|
+
"version": "1.7.16",
|
|
5
|
+
"description": "XYO Layer One SDK Schema",
|
|
6
|
+
"homepage": "https://xylabs.com",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "git+https://github.com/xylabs/xyo-chain/issues",
|
|
9
|
+
"email": "support@xylabs.com"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/xylabs/xyo-chain.git"
|
|
14
|
+
},
|
|
15
|
+
"license": "LGPL-3.0-only",
|
|
16
|
+
"author": {
|
|
17
|
+
"name": "XY Labs Development Team",
|
|
18
|
+
"email": "support@xylabs.com",
|
|
19
|
+
"url": "https://xylabs.com"
|
|
20
|
+
},
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"type": "module",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/neutral/index.d.ts",
|
|
26
|
+
"source": "./src/index.ts",
|
|
27
|
+
"default": "./dist/neutral/index.mjs"
|
|
28
|
+
},
|
|
29
|
+
"./package.json": "./package.json"
|
|
30
|
+
},
|
|
31
|
+
"module": "./dist/neutral/index.mjs",
|
|
32
|
+
"source": "./src/index.ts",
|
|
33
|
+
"types": "./dist/neutral/index.d.ts",
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"src"
|
|
37
|
+
],
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@xyo-network/boundwitness-model": "^4.1.7",
|
|
40
|
+
"@xyo-network/boundwitness-wrapper": "^4.1.7",
|
|
41
|
+
"@xyo-network/payload-builder": "^4.1.7",
|
|
42
|
+
"@xyo-network/payload-model": "^4.1.7",
|
|
43
|
+
"@xyo-network/payload-wrapper": "^4.1.7",
|
|
44
|
+
"@xyo-network/schema-payload-plugin": "^4.1.7",
|
|
45
|
+
"@xyo-network/xl1-protocol": "^1.7.20",
|
|
46
|
+
"ajv": "^8.17.1"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/node": "^24.1.0",
|
|
50
|
+
"@xylabs/ts-scripts-yarn3": "^7.0.1",
|
|
51
|
+
"@xylabs/tsconfig": "^7.0.1",
|
|
52
|
+
"@xyo-network/account": "^4.1.7",
|
|
53
|
+
"knip": "^5.62.0",
|
|
54
|
+
"typescript": "^5.8.3",
|
|
55
|
+
"vitest": "^3.2.4"
|
|
56
|
+
},
|
|
57
|
+
"engines": {
|
|
58
|
+
"node": ">=22.3 <23"
|
|
59
|
+
},
|
|
60
|
+
"engineStrict": true,
|
|
61
|
+
"publishConfig": {
|
|
62
|
+
"access": "public"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Ajv } from 'ajv'
|
|
2
|
+
import {
|
|
3
|
+
describe, expect, test,
|
|
4
|
+
} from 'vitest'
|
|
5
|
+
|
|
6
|
+
import { ExecutableJsonSchema } from './Executable.ts'
|
|
7
|
+
|
|
8
|
+
const ajv = new Ajv()
|
|
9
|
+
|
|
10
|
+
describe('ExecutableJsonSchema', () => {
|
|
11
|
+
test('should have the correct $id', () => {
|
|
12
|
+
expect(ExecutableJsonSchema.$id).toBe('https://schemas.xyo.network/2.0/executable')
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
test('should validate a valid executable payload', () => {
|
|
16
|
+
const validate = ajv.compile(ExecutableJsonSchema)
|
|
17
|
+
const validPayload = { script: ['elevate|xxxxxx'] }
|
|
18
|
+
const result = validate(validPayload)
|
|
19
|
+
expect(result).toBe(true)
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
test('should invalidate a payload with missing script', () => {
|
|
23
|
+
const validate = ajv.compile(ExecutableJsonSchema)
|
|
24
|
+
const invalidPayload = {}
|
|
25
|
+
expect(validate(invalidPayload)).toBe(false)
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
test('should invalidate a payload with invalid script pattern', () => {
|
|
29
|
+
const validate = ajv.compile(ExecutableJsonSchema)
|
|
30
|
+
const invalidPayload = { script: ['invalid-opcode'] }
|
|
31
|
+
expect(validate(invalidPayload)).toBe(false)
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
test('should allow additional properties', () => {
|
|
35
|
+
const validate = ajv.compile(ExecutableJsonSchema)
|
|
36
|
+
const validPayload = {
|
|
37
|
+
script: ['elevate|'],
|
|
38
|
+
extraField: 'extra-value',
|
|
39
|
+
}
|
|
40
|
+
const result = validate(validPayload)
|
|
41
|
+
expect(result).toBe(true)
|
|
42
|
+
})
|
|
43
|
+
})
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Executable } from '@xyo-network/xl1-protocol'
|
|
2
|
+
import type { JSONSchemaType } from 'ajv'
|
|
3
|
+
|
|
4
|
+
export const ExecutableJsonSchema: JSONSchemaType<Executable> = {
|
|
5
|
+
$id: 'https://schemas.xyo.network/2.0/executable',
|
|
6
|
+
additionalProperties: true,
|
|
7
|
+
properties: { script: { items: { type: 'string', pattern: String.raw`^elevate\|` }, type: 'array' } },
|
|
8
|
+
required: ['script'],
|
|
9
|
+
type: 'object',
|
|
10
|
+
} as const
|