@codama/spec 1.6.0-rc.4 → 1.6.0-rc.5
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/README.md +84 -0
- package/dist/api.browser.cjs +18 -1
- package/dist/api.browser.cjs.map +1 -1
- package/dist/api.browser.mjs +18 -2
- package/dist/api.browser.mjs.map +1 -1
- package/dist/api.node.cjs +18 -1
- package/dist/api.node.cjs.map +1 -1
- package/dist/api.node.mjs +18 -2
- package/dist/api.node.mjs.map +1 -1
- package/dist/api.react-native.mjs +18 -2
- package/dist/api.react-native.mjs.map +1 -1
- package/dist/index.browser.cjs +161 -145
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.mjs +161 -145
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.cjs +161 -145
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.mjs +161 -145
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.react-native.mjs +161 -145
- package/dist/index.react-native.mjs.map +1 -1
- package/dist/types/api/defineNestedUnion.d.ts +1 -1
- package/dist/types/api/defineUnion.d.ts +1 -1
- package/dist/types/api/index.d.ts +1 -1
- package/dist/types/api/primitives.d.ts +7 -1
- package/dist/types/api/primitives.d.ts.map +1 -1
- package/dist/types/api/types.d.ts +15 -6
- package/dist/types/api/types.d.ts.map +1 -1
- package/dist/types/api/validate.d.ts.map +1 -1
- package/dist/types/v1/nestedUnions.d.ts +1 -1
- package/dist/types/v1/nodes/contextualValueNodes/ContextualValueNode.d.ts +2 -2
- package/dist/types/v1/nodes/pdaSeedNodes/PdaSeedNode.d.ts +1 -1
- package/dist/types/v1/nodes/typeNodes/TypeNode.d.ts +4 -4
- package/dist/types/v1/nodes/valueNodes/ValueNode.d.ts +4 -4
- package/dist/v1.browser.cjs +161 -145
- package/dist/v1.browser.cjs.map +1 -1
- package/dist/v1.browser.mjs +161 -145
- package/dist/v1.browser.mjs.map +1 -1
- package/dist/v1.node.cjs +161 -145
- package/dist/v1.node.cjs.map +1 -1
- package/dist/v1.node.mjs +161 -145
- package/dist/v1.node.mjs.map +1 -1
- package/dist/v1.react-native.mjs +161 -145
- package/dist/v1.react-native.mjs.map +1 -1
- package/package.json +45 -31
package/dist/v1.node.mjs
CHANGED
|
@@ -94,6 +94,9 @@ function normaliseMember(input) {
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
// src/api/primitives.ts
|
|
97
|
+
function address() {
|
|
98
|
+
return Object.freeze({ kind: "address" });
|
|
99
|
+
}
|
|
97
100
|
function string() {
|
|
98
101
|
return Object.freeze({ kind: "string" });
|
|
99
102
|
}
|
|
@@ -153,6 +156,8 @@ function docs() {
|
|
|
153
156
|
}
|
|
154
157
|
|
|
155
158
|
// src/api/validate.ts
|
|
159
|
+
var CAMEL_CASE_REGEX = /^[a-z][A-Za-z0-9]*$/;
|
|
160
|
+
var NODE_KIND_REGEX = /^[a-z][A-Za-z0-9]*Node$/;
|
|
156
161
|
function validate(spec) {
|
|
157
162
|
const errors = [];
|
|
158
163
|
const allNodes = [];
|
|
@@ -190,7 +195,7 @@ function validate(spec) {
|
|
|
190
195
|
seenCategories.add(c.name);
|
|
191
196
|
}
|
|
192
197
|
for (const n of allNodes) {
|
|
193
|
-
if (
|
|
198
|
+
if (!NODE_KIND_REGEX.test(n.kind)) {
|
|
194
199
|
errors.push(`Node kind "${n.kind}" does not match the camelCase ...Node naming convention.`);
|
|
195
200
|
}
|
|
196
201
|
const seenAttrs = /* @__PURE__ */ new Set();
|
|
@@ -206,6 +211,9 @@ function validate(spec) {
|
|
|
206
211
|
}
|
|
207
212
|
}
|
|
208
213
|
for (const u of allUnions) {
|
|
214
|
+
if (!CAMEL_CASE_REGEX.test(u.name)) {
|
|
215
|
+
errors.push(`Union "${u.name}" does not match the camelCase naming convention.`);
|
|
216
|
+
}
|
|
209
217
|
if (u.members.length === 0) {
|
|
210
218
|
errors.push(`Union "${u.name}" has no members.`);
|
|
211
219
|
}
|
|
@@ -224,7 +232,15 @@ function validate(spec) {
|
|
|
224
232
|
}
|
|
225
233
|
}
|
|
226
234
|
}
|
|
235
|
+
for (const e of allEnumerations) {
|
|
236
|
+
if (!CAMEL_CASE_REGEX.test(e.name)) {
|
|
237
|
+
errors.push(`Enumeration "${e.name}" does not match the camelCase naming convention.`);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
227
240
|
for (const nu of allNestedUnions) {
|
|
241
|
+
if (!CAMEL_CASE_REGEX.test(nu.name)) {
|
|
242
|
+
errors.push(`Nested union "${nu.name}" does not match the camelCase naming convention.`);
|
|
243
|
+
}
|
|
228
244
|
if (nu.wrappers.length === 0) {
|
|
229
245
|
errors.push(`Nested union "${nu.name}" has no wrappers.`);
|
|
230
246
|
}
|
|
@@ -294,14 +310,14 @@ function isChildAttribute(type) {
|
|
|
294
310
|
}
|
|
295
311
|
|
|
296
312
|
// src/v1/enumerations.ts
|
|
297
|
-
var endianness = defineEnumeration("
|
|
313
|
+
var endianness = defineEnumeration("endianness", {
|
|
298
314
|
docs: ["The byte order of a numeric serialization."],
|
|
299
315
|
variants: [
|
|
300
316
|
variant("be", { docs: ["Big-endian: the most significant byte is written first."] }),
|
|
301
317
|
variant("le", { docs: ["Little-endian: the least significant byte is written first."] })
|
|
302
318
|
]
|
|
303
319
|
});
|
|
304
|
-
var numberFormat = defineEnumeration("
|
|
320
|
+
var numberFormat = defineEnumeration("numberFormat", {
|
|
305
321
|
docs: ["The wire format of a numeric serialization."],
|
|
306
322
|
variants: [
|
|
307
323
|
variant("f32", { docs: ["IEEE-754 32-bit floating point."] }),
|
|
@@ -321,7 +337,7 @@ var numberFormat = defineEnumeration("NumberFormat", {
|
|
|
321
337
|
variant("u128", { docs: ["Unsigned 128-bit integer."] })
|
|
322
338
|
]
|
|
323
339
|
});
|
|
324
|
-
var bytesEncoding = defineEnumeration("
|
|
340
|
+
var bytesEncoding = defineEnumeration("bytesEncoding", {
|
|
325
341
|
docs: ["How a string of bytes is encoded for transport."],
|
|
326
342
|
variants: [
|
|
327
343
|
variant("base16", { docs: ["Hexadecimal encoding (two characters per byte)."] }),
|
|
@@ -330,7 +346,7 @@ var bytesEncoding = defineEnumeration("BytesEncoding", {
|
|
|
330
346
|
variant("utf8", { docs: ["UTF-8 text encoding."] })
|
|
331
347
|
]
|
|
332
348
|
});
|
|
333
|
-
var instructionLifecycle = defineEnumeration("
|
|
349
|
+
var instructionLifecycle = defineEnumeration("instructionLifecycle", {
|
|
334
350
|
docs: ["The lifecycle stage of an instruction."],
|
|
335
351
|
variants: [
|
|
336
352
|
variant("archived", {
|
|
@@ -345,7 +361,7 @@ var instructionLifecycle = defineEnumeration("InstructionLifecycle", {
|
|
|
345
361
|
variant("live", { docs: ["Stable and supported for production use."] })
|
|
346
362
|
]
|
|
347
363
|
});
|
|
348
|
-
var defaultValueStrategy = defineEnumeration("
|
|
364
|
+
var defaultValueStrategy = defineEnumeration("defaultValueStrategy", {
|
|
349
365
|
docs: ["How an attribute that carries a default value is exposed in generated APIs."],
|
|
350
366
|
variants: [
|
|
351
367
|
variant("omitted", {
|
|
@@ -358,7 +374,7 @@ var defaultValueStrategy = defineEnumeration("DefaultValueStrategy", {
|
|
|
358
374
|
})
|
|
359
375
|
]
|
|
360
376
|
});
|
|
361
|
-
var optionalAccountStrategy = defineEnumeration("
|
|
377
|
+
var optionalAccountStrategy = defineEnumeration("optionalAccountStrategy", {
|
|
362
378
|
docs: ["How an absent optional account is represented when serialising an instruction."],
|
|
363
379
|
variants: [
|
|
364
380
|
variant("omitted", {
|
|
@@ -369,7 +385,7 @@ var optionalAccountStrategy = defineEnumeration("OptionalAccountStrategy", {
|
|
|
369
385
|
})
|
|
370
386
|
]
|
|
371
387
|
});
|
|
372
|
-
var preOffsetStrategy = defineEnumeration("
|
|
388
|
+
var preOffsetStrategy = defineEnumeration("preOffsetStrategy", {
|
|
373
389
|
docs: ["How a pre-offset modifier interprets its offset value before serialising the wrapped type."],
|
|
374
390
|
variants: [
|
|
375
391
|
variant("absolute", {
|
|
@@ -383,7 +399,7 @@ var preOffsetStrategy = defineEnumeration("PreOffsetStrategy", {
|
|
|
383
399
|
})
|
|
384
400
|
]
|
|
385
401
|
});
|
|
386
|
-
var postOffsetStrategy = defineEnumeration("
|
|
402
|
+
var postOffsetStrategy = defineEnumeration("postOffsetStrategy", {
|
|
387
403
|
docs: ["How a post-offset modifier interprets its offset value after serialising the wrapped type."],
|
|
388
404
|
variants: [
|
|
389
405
|
variant("absolute", {
|
|
@@ -400,7 +416,7 @@ var postOffsetStrategy = defineEnumeration("PostOffsetStrategy", {
|
|
|
400
416
|
})
|
|
401
417
|
]
|
|
402
418
|
});
|
|
403
|
-
var programOrigin = defineEnumeration("
|
|
419
|
+
var programOrigin = defineEnumeration("programOrigin", {
|
|
404
420
|
docs: ["The toolchain that originally generated a program description."],
|
|
405
421
|
variants: [
|
|
406
422
|
variant("anchor", { docs: ["The program was originally described by an Anchor IDL."] }),
|
|
@@ -420,12 +436,12 @@ var ALL_ENUMERATIONS = [
|
|
|
420
436
|
];
|
|
421
437
|
|
|
422
438
|
// src/v1/nestedUnions.ts
|
|
423
|
-
var nestedTypeNode = defineNestedUnion("
|
|
439
|
+
var nestedTypeNode = defineNestedUnion("nestedTypeNode", {
|
|
424
440
|
docs: [
|
|
425
441
|
"A type, possibly wrapped in zero-or-more size, offset, sentinel, or hidden prefix/suffix modifiers.",
|
|
426
|
-
"The wrapping is recursive: each modifier wraps another `
|
|
442
|
+
"The wrapping is recursive: each modifier wraps another `nestedTypeNode<T>` until the inner `T` is reached."
|
|
427
443
|
],
|
|
428
|
-
base: union("
|
|
444
|
+
base: union("typeNode"),
|
|
429
445
|
wrappers: [
|
|
430
446
|
"fixedSizeTypeNode",
|
|
431
447
|
"sizePrefixTypeNode",
|
|
@@ -452,13 +468,13 @@ var accountNode = defineNode("accountNode", {
|
|
|
452
468
|
optionalAttribute("docs", docs(), {
|
|
453
469
|
docs: ["Markdown documentation for the account."]
|
|
454
470
|
}),
|
|
455
|
-
attribute("data", nestedUnion("
|
|
471
|
+
attribute("data", nestedUnion("nestedTypeNode", "structTypeNode"), {
|
|
456
472
|
docs: ["The struct describing the account data."]
|
|
457
473
|
}),
|
|
458
474
|
optionalAttribute("pda", node("pdaLinkNode"), {
|
|
459
475
|
docs: ["A link to the PDA the account is derived from, if applicable."]
|
|
460
476
|
}),
|
|
461
|
-
optionalAttribute("discriminators", array(union("
|
|
477
|
+
optionalAttribute("discriminators", array(union("discriminatorNode")), {
|
|
462
478
|
docs: [
|
|
463
479
|
"Discriminators that distinguish this account from others in the program.",
|
|
464
480
|
"When multiple are listed, they are combined with a logical AND."
|
|
@@ -477,10 +493,10 @@ var constantNode = defineNode("constantNode", {
|
|
|
477
493
|
optionalAttribute("docs", docs(), {
|
|
478
494
|
docs: ["Markdown documentation for the constant."]
|
|
479
495
|
}),
|
|
480
|
-
attribute("type", union("
|
|
496
|
+
attribute("type", union("typeNode"), {
|
|
481
497
|
docs: ["The type of the constant."]
|
|
482
498
|
}),
|
|
483
|
-
attribute("value", union("
|
|
499
|
+
attribute("value", union("valueNode"), {
|
|
484
500
|
docs: ["The concrete value of the constant."]
|
|
485
501
|
})
|
|
486
502
|
]
|
|
@@ -523,19 +539,19 @@ var conditionalValueNode = defineNode("conditionalValueNode", {
|
|
|
523
539
|
"The condition resolves to a value at instruction time; that result selects between `ifTrue` and `ifFalse`."
|
|
524
540
|
],
|
|
525
541
|
attributes: [
|
|
526
|
-
attribute("condition", union("
|
|
542
|
+
attribute("condition", union("conditionalValueCondition"), {
|
|
527
543
|
docs: ["The value whose evaluation drives the branch."]
|
|
528
544
|
}),
|
|
529
|
-
optionalAttribute("value", union("
|
|
545
|
+
optionalAttribute("value", union("valueNode"), {
|
|
530
546
|
docs: [
|
|
531
547
|
"When present, the condition result is compared for equality against this value.",
|
|
532
548
|
"Otherwise the result is treated as a boolean."
|
|
533
549
|
]
|
|
534
550
|
}),
|
|
535
|
-
optionalAttribute("ifTrue", union("
|
|
551
|
+
optionalAttribute("ifTrue", union("instructionInputValueNode"), {
|
|
536
552
|
docs: ["The value used when the condition resolves truthy (or matches `value`)."]
|
|
537
553
|
}),
|
|
538
|
-
optionalAttribute("ifFalse", union("
|
|
554
|
+
optionalAttribute("ifFalse", union("instructionInputValueNode"), {
|
|
539
555
|
docs: ["The value used when the condition resolves falsy (or does not match `value`)."]
|
|
540
556
|
})
|
|
541
557
|
]
|
|
@@ -553,42 +569,42 @@ var STANDALONE_CONTEXTUAL_VALUE_NODE_KINDS = [
|
|
|
553
569
|
"programIdValueNode",
|
|
554
570
|
"resolverValueNode"
|
|
555
571
|
];
|
|
556
|
-
var standaloneContextualValueNodeUnion = defineUnion("
|
|
572
|
+
var standaloneContextualValueNodeUnion = defineUnion("standaloneContextualValueNode", {
|
|
557
573
|
docs: ["Every contextual-value node usable as a top-level value."],
|
|
558
574
|
members: [...STANDALONE_CONTEXTUAL_VALUE_NODE_KINDS]
|
|
559
575
|
});
|
|
560
|
-
var contextualValueNodeUnion = defineUnion("
|
|
576
|
+
var contextualValueNodeUnion = defineUnion("contextualValueNode", {
|
|
561
577
|
docs: ["The composable form: any standalone contextual-value node."],
|
|
562
|
-
members: [union("
|
|
578
|
+
members: [union("standaloneContextualValueNode")]
|
|
563
579
|
});
|
|
564
|
-
var registeredContextualValueNodeUnion = defineUnion("
|
|
580
|
+
var registeredContextualValueNodeUnion = defineUnion("registeredContextualValueNode", {
|
|
565
581
|
docs: ["Every node tagged as a contextual-value node, including helper variants."],
|
|
566
|
-
members: [union("
|
|
582
|
+
members: [union("standaloneContextualValueNode"), "pdaSeedValueNode"]
|
|
567
583
|
});
|
|
568
|
-
var instructionInputValueNodeUnion = defineUnion("
|
|
584
|
+
var instructionInputValueNodeUnion = defineUnion("instructionInputValueNode", {
|
|
569
585
|
docs: [
|
|
570
586
|
"Anything that can be used as the input value for an instruction account or argument default.",
|
|
571
587
|
"Covers concrete values, contextual references, and program links."
|
|
572
588
|
],
|
|
573
|
-
members: [union("
|
|
589
|
+
members: [union("contextualValueNode"), "programLinkNode", union("valueNode")]
|
|
574
590
|
});
|
|
575
|
-
var conditionalValueConditionUnion = defineUnion("
|
|
591
|
+
var conditionalValueConditionUnion = defineUnion("conditionalValueCondition", {
|
|
576
592
|
docs: ["The condition forms accepted by a `conditionalValueNode`."],
|
|
577
593
|
members: ["accountValueNode", "argumentValueNode", "resolverValueNode"]
|
|
578
594
|
});
|
|
579
|
-
var resolverDependencyUnion = defineUnion("
|
|
595
|
+
var resolverDependencyUnion = defineUnion("resolverDependency", {
|
|
580
596
|
docs: ["The dependency forms accepted by a `resolverValueNode`."],
|
|
581
597
|
members: ["accountValueNode", "argumentValueNode"]
|
|
582
598
|
});
|
|
583
|
-
var pdaSeedValueValueUnion = defineUnion("
|
|
599
|
+
var pdaSeedValueValueUnion = defineUnion("pdaSeedValueValue", {
|
|
584
600
|
docs: ["The value forms accepted by a `pdaSeedValueNode`."],
|
|
585
|
-
members: ["accountValueNode", "argumentValueNode", union("
|
|
601
|
+
members: ["accountValueNode", "argumentValueNode", union("valueNode")]
|
|
586
602
|
});
|
|
587
|
-
var pdaValuePdaUnion = defineUnion("
|
|
603
|
+
var pdaValuePdaUnion = defineUnion("pdaValuePda", {
|
|
588
604
|
docs: ["A `pdaValueNode` may reference a PDA either by link or inline."],
|
|
589
605
|
members: ["pdaLinkNode", "pdaNode"]
|
|
590
606
|
});
|
|
591
|
-
var pdaValueProgramIdUnion = defineUnion("
|
|
607
|
+
var pdaValueProgramIdUnion = defineUnion("pdaValueProgramId", {
|
|
592
608
|
docs: ["The program-id forms accepted by a `pdaValueNode`."],
|
|
593
609
|
members: ["accountValueNode", "argumentValueNode"]
|
|
594
610
|
});
|
|
@@ -612,7 +628,7 @@ var pdaSeedValueNode = defineNode("pdaSeedValueNode", {
|
|
|
612
628
|
attribute("name", stringIdentifier(), {
|
|
613
629
|
docs: ["The name of the seed being filled in."]
|
|
614
630
|
}),
|
|
615
|
-
attribute("value", union("
|
|
631
|
+
attribute("value", union("pdaSeedValueValue"), {
|
|
616
632
|
docs: ["The value to substitute for the seed."]
|
|
617
633
|
})
|
|
618
634
|
]
|
|
@@ -622,13 +638,13 @@ var pdaSeedValueNode = defineNode("pdaSeedValueNode", {
|
|
|
622
638
|
var pdaValueNode = defineNode("pdaValueNode", {
|
|
623
639
|
docs: ["Resolves to a PDA derived from a list of seed values."],
|
|
624
640
|
attributes: [
|
|
625
|
-
attribute("pda", union("
|
|
641
|
+
attribute("pda", union("pdaValuePda"), {
|
|
626
642
|
docs: ["The PDA being derived \u2014 either a link to a defined PDA or an inline `pdaNode`."]
|
|
627
643
|
}),
|
|
628
|
-
|
|
644
|
+
optionalAttribute("seeds", array(node("pdaSeedValueNode")), {
|
|
629
645
|
docs: ["The seed values used to derive the PDA, paired with their seed names."]
|
|
630
646
|
}),
|
|
631
|
-
optionalAttribute("programId", union("
|
|
647
|
+
optionalAttribute("programId", union("pdaValueProgramId"), {
|
|
632
648
|
docs: ["The program ID used to derive the PDA. When omitted, the PDA\u2019s declared program is used."]
|
|
633
649
|
})
|
|
634
650
|
]
|
|
@@ -653,7 +669,7 @@ var resolverValueNode = defineNode("resolverValueNode", {
|
|
|
653
669
|
optionalAttribute("docs", docs(), {
|
|
654
670
|
docs: ["Markdown documentation for the resolver."]
|
|
655
671
|
}),
|
|
656
|
-
optionalAttribute("dependsOn", array(union("
|
|
672
|
+
optionalAttribute("dependsOn", array(union("resolverDependency")), {
|
|
657
673
|
docs: [
|
|
658
674
|
"The accounts and arguments the resolver depends on. Used by clients to ensure the dependencies are resolved first."
|
|
659
675
|
]
|
|
@@ -687,13 +703,13 @@ var ALL_CONTEXTUAL_VALUE_NODE_UNIONS = [
|
|
|
687
703
|
];
|
|
688
704
|
|
|
689
705
|
// src/v1/nodes/countNodes/CountNode.ts
|
|
690
|
-
var registeredCountNodeUnion = defineUnion("
|
|
706
|
+
var registeredCountNodeUnion = defineUnion("registeredCountNode", {
|
|
691
707
|
docs: ["Every node tagged as a count strategy."],
|
|
692
708
|
members: ["fixedCountNode", "prefixedCountNode", "remainderCountNode"]
|
|
693
709
|
});
|
|
694
|
-
var countNodeUnion = defineUnion("
|
|
710
|
+
var countNodeUnion = defineUnion("countNode", {
|
|
695
711
|
docs: ["The composable form: any registered count node."],
|
|
696
|
-
members: [union("
|
|
712
|
+
members: [union("registeredCountNode")]
|
|
697
713
|
});
|
|
698
714
|
|
|
699
715
|
// src/v1/nodes/countNodes/FixedCountNode.ts
|
|
@@ -710,7 +726,7 @@ var fixedCountNode = defineNode("fixedCountNode", {
|
|
|
710
726
|
var prefixedCountNode = defineNode("prefixedCountNode", {
|
|
711
727
|
docs: ["A count strategy where the number of items is read from a numeric prefix."],
|
|
712
728
|
attributes: [
|
|
713
|
-
attribute("prefix", nestedUnion("
|
|
729
|
+
attribute("prefix", nestedUnion("nestedTypeNode", "numberTypeNode"), {
|
|
714
730
|
docs: ["The numeric type used as the count prefix."]
|
|
715
731
|
})
|
|
716
732
|
]
|
|
@@ -736,7 +752,7 @@ var definedTypeNode = defineNode("definedTypeNode", {
|
|
|
736
752
|
optionalAttribute("docs", docs(), {
|
|
737
753
|
docs: ["Markdown documentation for the type."]
|
|
738
754
|
}),
|
|
739
|
-
attribute("type", union("
|
|
755
|
+
attribute("type", union("typeNode"), {
|
|
740
756
|
docs: ["The type definition."]
|
|
741
757
|
})
|
|
742
758
|
]
|
|
@@ -756,13 +772,13 @@ var constantDiscriminatorNode = defineNode("constantDiscriminatorNode", {
|
|
|
756
772
|
});
|
|
757
773
|
|
|
758
774
|
// src/v1/nodes/discriminatorNodes/DiscriminatorNode.ts
|
|
759
|
-
var registeredDiscriminatorNodeUnion = defineUnion("
|
|
775
|
+
var registeredDiscriminatorNodeUnion = defineUnion("registeredDiscriminatorNode", {
|
|
760
776
|
docs: ["Every node tagged as a discriminator strategy."],
|
|
761
777
|
members: ["constantDiscriminatorNode", "fieldDiscriminatorNode", "sizeDiscriminatorNode"]
|
|
762
778
|
});
|
|
763
|
-
var discriminatorNodeUnion = defineUnion("
|
|
779
|
+
var discriminatorNodeUnion = defineUnion("discriminatorNode", {
|
|
764
780
|
docs: ["The composable form: any registered discriminator node."],
|
|
765
|
-
members: [union("
|
|
781
|
+
members: [union("registeredDiscriminatorNode")]
|
|
766
782
|
});
|
|
767
783
|
|
|
768
784
|
// src/v1/nodes/discriminatorNodes/FieldDiscriminatorNode.ts
|
|
@@ -825,10 +841,10 @@ var eventNode = defineNode("eventNode", {
|
|
|
825
841
|
optionalAttribute("docs", docs(), {
|
|
826
842
|
docs: ["Markdown documentation for the event."]
|
|
827
843
|
}),
|
|
828
|
-
attribute("data", union("
|
|
844
|
+
attribute("data", union("typeNode"), {
|
|
829
845
|
docs: ["The type describing the event payload."]
|
|
830
846
|
}),
|
|
831
|
-
optionalAttribute("discriminators", array(union("
|
|
847
|
+
optionalAttribute("discriminators", array(union("discriminatorNode")), {
|
|
832
848
|
docs: [
|
|
833
849
|
"Discriminators that distinguish this event from others. When multiple are listed, they are combined with a logical AND."
|
|
834
850
|
]
|
|
@@ -860,7 +876,7 @@ var instructionAccountNode = defineNode("instructionAccountNode", {
|
|
|
860
876
|
optionalAttribute("docs", docs(), {
|
|
861
877
|
docs: ["Markdown documentation for the account slot."]
|
|
862
878
|
}),
|
|
863
|
-
optionalAttribute("defaultValue", union("
|
|
879
|
+
optionalAttribute("defaultValue", union("instructionInputValueNode"), {
|
|
864
880
|
docs: ["A default value used to fill the slot when the caller does not provide one."]
|
|
865
881
|
})
|
|
866
882
|
]
|
|
@@ -873,16 +889,16 @@ var instructionArgumentNode = defineNode("instructionArgumentNode", {
|
|
|
873
889
|
attribute("name", stringIdentifier(), {
|
|
874
890
|
docs: ["The name of the argument."]
|
|
875
891
|
}),
|
|
876
|
-
optionalAttribute("defaultValueStrategy", enumeration("
|
|
892
|
+
optionalAttribute("defaultValueStrategy", enumeration("defaultValueStrategy"), {
|
|
877
893
|
docs: ["How a configured default value is exposed in generated APIs. Required when `defaultValue` is set."]
|
|
878
894
|
}),
|
|
879
895
|
optionalAttribute("docs", docs(), {
|
|
880
896
|
docs: ["Markdown documentation for the argument."]
|
|
881
897
|
}),
|
|
882
|
-
attribute("type", union("
|
|
898
|
+
attribute("type", union("typeNode"), {
|
|
883
899
|
docs: ["The type of the argument."]
|
|
884
900
|
}),
|
|
885
|
-
optionalAttribute("defaultValue", union("
|
|
901
|
+
optionalAttribute("defaultValue", union("instructionInputValueNode"), {
|
|
886
902
|
docs: ["A default value used when the argument is omitted by callers."]
|
|
887
903
|
})
|
|
888
904
|
]
|
|
@@ -900,7 +916,7 @@ var instructionByteDeltaNode = defineNode("instructionByteDeltaNode", {
|
|
|
900
916
|
optionalAttribute("subtract", boolean(), {
|
|
901
917
|
docs: ["When `true`, the delta is subtracted from the running size instead of added. Defaults to `false`."]
|
|
902
918
|
}),
|
|
903
|
-
attribute("value", union("
|
|
919
|
+
attribute("value", union("instructionByteDeltaValue"), {
|
|
904
920
|
docs: [
|
|
905
921
|
"The source of the delta value \u2014 a literal number, a referenced account or argument, or a resolver."
|
|
906
922
|
]
|
|
@@ -920,13 +936,13 @@ var instructionNode = defineNode("instructionNode", {
|
|
|
920
936
|
optionalAttribute("docs", docs(), {
|
|
921
937
|
docs: ["Markdown documentation for the instruction."]
|
|
922
938
|
}),
|
|
923
|
-
optionalAttribute("optionalAccountStrategy", enumeration("
|
|
939
|
+
optionalAttribute("optionalAccountStrategy", enumeration("optionalAccountStrategy"), {
|
|
924
940
|
docs: ["How absent optional accounts are represented when serialising the instruction."]
|
|
925
941
|
}),
|
|
926
|
-
|
|
942
|
+
optionalAttribute("accounts", array(node("instructionAccountNode")), {
|
|
927
943
|
docs: ["The accounts the instruction operates on, in order."]
|
|
928
944
|
}),
|
|
929
|
-
|
|
945
|
+
optionalAttribute("arguments", array(node("instructionArgumentNode")), {
|
|
930
946
|
docs: ["The serialised arguments of the instruction, in order."]
|
|
931
947
|
}),
|
|
932
948
|
optionalAttribute("extraArguments", array(node("instructionArgumentNode")), {
|
|
@@ -940,7 +956,7 @@ var instructionNode = defineNode("instructionNode", {
|
|
|
940
956
|
"Byte-size adjustments applied when computing rent or buffer size \u2014 for instructions that resize accounts."
|
|
941
957
|
]
|
|
942
958
|
}),
|
|
943
|
-
optionalAttribute("discriminators", array(union("
|
|
959
|
+
optionalAttribute("discriminators", array(union("discriminatorNode")), {
|
|
944
960
|
docs: [
|
|
945
961
|
"Discriminators that distinguish this instruction from others.",
|
|
946
962
|
"When multiple are listed, they are combined with a logical AND."
|
|
@@ -956,11 +972,11 @@ var instructionNode = defineNode("instructionNode", {
|
|
|
956
972
|
});
|
|
957
973
|
|
|
958
974
|
// src/v1/nodes/InstructionNodeUnions.ts
|
|
959
|
-
var instructionByteDeltaValueUnion = defineUnion("
|
|
975
|
+
var instructionByteDeltaValueUnion = defineUnion("instructionByteDeltaValue", {
|
|
960
976
|
docs: ["The value forms accepted by an `instructionByteDeltaNode`."],
|
|
961
977
|
members: ["accountLinkNode", "argumentValueNode", "numberValueNode", "resolverValueNode"]
|
|
962
978
|
});
|
|
963
|
-
var instructionRemainingAccountsValueUnion = defineUnion("
|
|
979
|
+
var instructionRemainingAccountsValueUnion = defineUnion("instructionRemainingAccountsValue", {
|
|
964
980
|
docs: ["The value forms accepted by an `instructionRemainingAccountsNode`."],
|
|
965
981
|
members: ["argumentValueNode", "resolverValueNode"]
|
|
966
982
|
});
|
|
@@ -984,7 +1000,7 @@ var instructionRemainingAccountsNode = defineNode("instructionRemainingAccountsN
|
|
|
984
1000
|
optionalAttribute("docs", docs(), {
|
|
985
1001
|
docs: ["Markdown documentation for the remaining-accounts slot."]
|
|
986
1002
|
}),
|
|
987
|
-
attribute("value", union("
|
|
1003
|
+
attribute("value", union("instructionRemainingAccountsValue"), {
|
|
988
1004
|
docs: ["The source of the remaining-accounts list \u2014 a referenced argument or a resolver."]
|
|
989
1005
|
})
|
|
990
1006
|
]
|
|
@@ -996,7 +1012,7 @@ var instructionStatusNode = defineNode("instructionStatusNode", {
|
|
|
996
1012
|
"The lifecycle stage of an instruction (draft, live, deprecated, archived) with an optional accompanying message."
|
|
997
1013
|
],
|
|
998
1014
|
attributes: [
|
|
999
|
-
attribute("lifecycle", enumeration("
|
|
1015
|
+
attribute("lifecycle", enumeration("instructionLifecycle"), {
|
|
1000
1016
|
docs: ["The lifecycle stage."]
|
|
1001
1017
|
}),
|
|
1002
1018
|
optionalAttribute("message", string(), {
|
|
@@ -1077,7 +1093,7 @@ var instructionLinkNode = defineNode("instructionLinkNode", {
|
|
|
1077
1093
|
});
|
|
1078
1094
|
|
|
1079
1095
|
// src/v1/nodes/linkNodes/LinkNode.ts
|
|
1080
|
-
var registeredLinkNodeUnion = defineUnion("
|
|
1096
|
+
var registeredLinkNodeUnion = defineUnion("registeredLinkNode", {
|
|
1081
1097
|
docs: ["Every node tagged as a link to another part of the IDL."],
|
|
1082
1098
|
members: [
|
|
1083
1099
|
"accountLinkNode",
|
|
@@ -1089,9 +1105,9 @@ var registeredLinkNodeUnion = defineUnion("RegisteredLinkNode", {
|
|
|
1089
1105
|
"programLinkNode"
|
|
1090
1106
|
]
|
|
1091
1107
|
});
|
|
1092
|
-
var linkNodeUnion = defineUnion("
|
|
1108
|
+
var linkNodeUnion = defineUnion("linkNode", {
|
|
1093
1109
|
docs: ["The composable form: any registered link node."],
|
|
1094
|
-
members: [union("
|
|
1110
|
+
members: [union("registeredLinkNode")]
|
|
1095
1111
|
});
|
|
1096
1112
|
|
|
1097
1113
|
// src/v1/nodes/linkNodes/PdaLinkNode.ts
|
|
@@ -1139,12 +1155,12 @@ var pdaNode = defineNode("pdaNode", {
|
|
|
1139
1155
|
optionalAttribute("docs", docs(), {
|
|
1140
1156
|
docs: ["Markdown documentation for the PDA."]
|
|
1141
1157
|
}),
|
|
1142
|
-
optionalAttribute("programId",
|
|
1158
|
+
optionalAttribute("programId", address(), {
|
|
1143
1159
|
docs: [
|
|
1144
1160
|
"The base58-encoded program ID used to derive the PDA. When omitted, the surrounding program is assumed."
|
|
1145
1161
|
]
|
|
1146
1162
|
}),
|
|
1147
|
-
|
|
1163
|
+
optionalAttribute("seeds", array(union("pdaSeedNode")), {
|
|
1148
1164
|
docs: ["The seeds used to derive the PDA, in order."]
|
|
1149
1165
|
})
|
|
1150
1166
|
]
|
|
@@ -1154,27 +1170,27 @@ var pdaNode = defineNode("pdaNode", {
|
|
|
1154
1170
|
var constantPdaSeedNode = defineNode("constantPdaSeedNode", {
|
|
1155
1171
|
docs: ["A PDA seed with a constant value (e.g. a UTF-8 string or a fixed byte sequence)."],
|
|
1156
1172
|
attributes: [
|
|
1157
|
-
attribute("type", union("
|
|
1173
|
+
attribute("type", union("typeNode"), {
|
|
1158
1174
|
docs: ["The type of the seed value."]
|
|
1159
1175
|
}),
|
|
1160
|
-
attribute("value", union("
|
|
1176
|
+
attribute("value", union("constantPdaSeedValue"), {
|
|
1161
1177
|
docs: ["The constant value to use as the seed \u2014 either a literal value or the program ID placeholder."]
|
|
1162
1178
|
})
|
|
1163
1179
|
]
|
|
1164
1180
|
});
|
|
1165
1181
|
|
|
1166
1182
|
// src/v1/nodes/pdaSeedNodes/PdaSeedNode.ts
|
|
1167
|
-
var registeredPdaSeedNodeUnion = defineUnion("
|
|
1183
|
+
var registeredPdaSeedNodeUnion = defineUnion("registeredPdaSeedNode", {
|
|
1168
1184
|
docs: ["Every node tagged as a PDA seed."],
|
|
1169
1185
|
members: ["constantPdaSeedNode", "variablePdaSeedNode"]
|
|
1170
1186
|
});
|
|
1171
|
-
var pdaSeedNodeUnion = defineUnion("
|
|
1187
|
+
var pdaSeedNodeUnion = defineUnion("pdaSeedNode", {
|
|
1172
1188
|
docs: ["The composable form: any registered PDA seed node."],
|
|
1173
|
-
members: [union("
|
|
1189
|
+
members: [union("registeredPdaSeedNode")]
|
|
1174
1190
|
});
|
|
1175
|
-
var constantPdaSeedValueUnion = defineUnion("
|
|
1191
|
+
var constantPdaSeedValueUnion = defineUnion("constantPdaSeedValue", {
|
|
1176
1192
|
docs: ["The value forms a `constantPdaSeedNode` may carry \u2014 either a literal value or the program ID placeholder."],
|
|
1177
|
-
members: ["programIdValueNode", union("
|
|
1193
|
+
members: ["programIdValueNode", union("valueNode")]
|
|
1178
1194
|
});
|
|
1179
1195
|
|
|
1180
1196
|
// src/v1/nodes/pdaSeedNodes/VariablePdaSeedNode.ts
|
|
@@ -1187,7 +1203,7 @@ var variablePdaSeedNode = defineNode("variablePdaSeedNode", {
|
|
|
1187
1203
|
optionalAttribute("docs", docs(), {
|
|
1188
1204
|
docs: ["Markdown documentation for the seed variable."]
|
|
1189
1205
|
}),
|
|
1190
|
-
attribute("type", union("
|
|
1206
|
+
attribute("type", union("typeNode"), {
|
|
1191
1207
|
docs: ["The expected type of the seed value."]
|
|
1192
1208
|
})
|
|
1193
1209
|
]
|
|
@@ -1210,37 +1226,37 @@ var programNode = defineNode("programNode", {
|
|
|
1210
1226
|
attribute("name", stringIdentifier(), {
|
|
1211
1227
|
docs: ["The name of the program."]
|
|
1212
1228
|
}),
|
|
1213
|
-
attribute("publicKey",
|
|
1229
|
+
attribute("publicKey", address(), {
|
|
1214
1230
|
docs: ["The base58-encoded program ID."]
|
|
1215
1231
|
}),
|
|
1216
1232
|
attribute("version", stringVersion(), {
|
|
1217
1233
|
docs: ["The version of the program, in semver form."]
|
|
1218
1234
|
}),
|
|
1219
|
-
optionalAttribute("origin", enumeration("
|
|
1235
|
+
optionalAttribute("origin", enumeration("programOrigin"), {
|
|
1220
1236
|
docs: ["The toolchain that originally generated the program description, if known."]
|
|
1221
1237
|
}),
|
|
1222
1238
|
optionalAttribute("docs", docs(), {
|
|
1223
1239
|
docs: ["Markdown documentation for the program."]
|
|
1224
1240
|
}),
|
|
1225
|
-
|
|
1241
|
+
optionalAttribute("accounts", array(node("accountNode")), {
|
|
1226
1242
|
docs: ["The accounts owned by the program."]
|
|
1227
1243
|
}),
|
|
1228
|
-
|
|
1244
|
+
optionalAttribute("instructions", array(node("instructionNode")), {
|
|
1229
1245
|
docs: ["The instructions exposed by the program."]
|
|
1230
1246
|
}),
|
|
1231
|
-
|
|
1247
|
+
optionalAttribute("definedTypes", array(node("definedTypeNode")), {
|
|
1232
1248
|
docs: ["The reusable types defined by the program."]
|
|
1233
1249
|
}),
|
|
1234
|
-
|
|
1250
|
+
optionalAttribute("pdas", array(node("pdaNode")), {
|
|
1235
1251
|
docs: ["The PDAs derived by the program."]
|
|
1236
1252
|
}),
|
|
1237
|
-
|
|
1253
|
+
optionalAttribute("events", array(node("eventNode")), {
|
|
1238
1254
|
docs: ["The events emitted by the program."]
|
|
1239
1255
|
}),
|
|
1240
|
-
|
|
1256
|
+
optionalAttribute("errors", array(node("errorNode")), {
|
|
1241
1257
|
docs: ["The errors returned by the program."]
|
|
1242
1258
|
}),
|
|
1243
|
-
|
|
1259
|
+
optionalAttribute("constants", array(node("constantNode")), {
|
|
1244
1260
|
docs: ["The constants exposed by the program."]
|
|
1245
1261
|
})
|
|
1246
1262
|
]
|
|
@@ -1262,7 +1278,7 @@ var rootNode = defineNode("rootNode", {
|
|
|
1262
1278
|
attribute("program", node("programNode"), {
|
|
1263
1279
|
docs: ["The primary program described by the document."]
|
|
1264
1280
|
}),
|
|
1265
|
-
|
|
1281
|
+
optionalAttribute("additionalPrograms", array(node("programNode")), {
|
|
1266
1282
|
docs: ["Additional programs referenced by the primary program."]
|
|
1267
1283
|
})
|
|
1268
1284
|
]
|
|
@@ -1284,7 +1300,7 @@ var amountTypeNode = defineNode("amountTypeNode", {
|
|
|
1284
1300
|
optionalAttribute("unit", string(), {
|
|
1285
1301
|
docs: ['The unit of the amount \u2014 e.g. "USD" or "%".']
|
|
1286
1302
|
}),
|
|
1287
|
-
attribute("number", nestedUnion("
|
|
1303
|
+
attribute("number", nestedUnion("nestedTypeNode", "numberTypeNode"), {
|
|
1288
1304
|
docs: ["The number type the amount wraps."]
|
|
1289
1305
|
})
|
|
1290
1306
|
]
|
|
@@ -1296,10 +1312,10 @@ var arrayTypeNode = defineNode("arrayTypeNode", {
|
|
|
1296
1312
|
"A homogeneous list of items. The item type is defined by `item`; the length is determined by the `count` strategy."
|
|
1297
1313
|
],
|
|
1298
1314
|
attributes: [
|
|
1299
|
-
attribute("item", union("
|
|
1315
|
+
attribute("item", union("typeNode"), {
|
|
1300
1316
|
docs: ["The type of each item in the array."]
|
|
1301
1317
|
}),
|
|
1302
|
-
attribute("count", union("
|
|
1318
|
+
attribute("count", union("countNode"), {
|
|
1303
1319
|
docs: ["The strategy used to determine the number of items."]
|
|
1304
1320
|
})
|
|
1305
1321
|
]
|
|
@@ -1309,7 +1325,7 @@ var arrayTypeNode = defineNode("arrayTypeNode", {
|
|
|
1309
1325
|
var booleanTypeNode = defineNode("booleanTypeNode", {
|
|
1310
1326
|
docs: ["A boolean serialised as a numeric value. The wrapped number type determines the byte width."],
|
|
1311
1327
|
attributes: [
|
|
1312
|
-
attribute("size", nestedUnion("
|
|
1328
|
+
attribute("size", nestedUnion("nestedTypeNode", "numberTypeNode"), {
|
|
1313
1329
|
docs: ["The numeric type used to serialise the boolean."]
|
|
1314
1330
|
})
|
|
1315
1331
|
]
|
|
@@ -1329,7 +1345,7 @@ var dateTimeTypeNode = defineNode("dateTimeTypeNode", {
|
|
|
1329
1345
|
"A timestamp encoded as a number, typically seconds since the Unix epoch. The wrapped number type determines the byte width."
|
|
1330
1346
|
],
|
|
1331
1347
|
attributes: [
|
|
1332
|
-
attribute("number", nestedUnion("
|
|
1348
|
+
attribute("number", nestedUnion("nestedTypeNode", "numberTypeNode"), {
|
|
1333
1349
|
docs: ["The numeric type used to serialise the timestamp."]
|
|
1334
1350
|
})
|
|
1335
1351
|
]
|
|
@@ -1362,7 +1378,7 @@ var enumStructVariantTypeNode = defineNode("enumStructVariantTypeNode", {
|
|
|
1362
1378
|
"Explicit discriminator value. When omitted, the discriminator is inferred from the variant position."
|
|
1363
1379
|
]
|
|
1364
1380
|
}),
|
|
1365
|
-
attribute("struct", nestedUnion("
|
|
1381
|
+
attribute("struct", nestedUnion("nestedTypeNode", "structTypeNode"), {
|
|
1366
1382
|
docs: ["The struct of named fields carried by the variant."]
|
|
1367
1383
|
})
|
|
1368
1384
|
]
|
|
@@ -1380,7 +1396,7 @@ var enumTupleVariantTypeNode = defineNode("enumTupleVariantTypeNode", {
|
|
|
1380
1396
|
"Explicit discriminator value. When omitted, the discriminator is inferred from the variant position."
|
|
1381
1397
|
]
|
|
1382
1398
|
}),
|
|
1383
|
-
attribute("tuple", nestedUnion("
|
|
1399
|
+
attribute("tuple", nestedUnion("nestedTypeNode", "tupleTypeNode"), {
|
|
1384
1400
|
docs: ["The tuple of positional fields carried by the variant."]
|
|
1385
1401
|
})
|
|
1386
1402
|
]
|
|
@@ -1390,10 +1406,10 @@ var enumTupleVariantTypeNode = defineNode("enumTupleVariantTypeNode", {
|
|
|
1390
1406
|
var enumTypeNode = defineNode("enumTypeNode", {
|
|
1391
1407
|
docs: ["A tagged union: a numeric discriminator followed by one of several variant payloads."],
|
|
1392
1408
|
attributes: [
|
|
1393
|
-
attribute("variants", array(union("
|
|
1409
|
+
attribute("variants", array(union("enumVariantTypeNode")), {
|
|
1394
1410
|
docs: ["The variants of the enum, in declaration order."]
|
|
1395
1411
|
}),
|
|
1396
|
-
attribute("size", nestedUnion("
|
|
1412
|
+
attribute("size", nestedUnion("nestedTypeNode", "numberTypeNode"), {
|
|
1397
1413
|
docs: ["The numeric type used to serialise the discriminator."]
|
|
1398
1414
|
})
|
|
1399
1415
|
]
|
|
@@ -1406,7 +1422,7 @@ var fixedSizeTypeNode = defineNode("fixedSizeTypeNode", {
|
|
|
1406
1422
|
attribute("size", u64(), {
|
|
1407
1423
|
docs: ["The total byte size the wrapped type must occupy."]
|
|
1408
1424
|
}),
|
|
1409
|
-
attribute("type", union("
|
|
1425
|
+
attribute("type", union("typeNode"), {
|
|
1410
1426
|
docs: ["The wrapped type whose serialisation is constrained."]
|
|
1411
1427
|
})
|
|
1412
1428
|
]
|
|
@@ -1418,7 +1434,7 @@ var hiddenPrefixTypeNode = defineNode("hiddenPrefixTypeNode", {
|
|
|
1418
1434
|
"Prefixes another type with a list of constant values that are written and read but not surfaced as fields to consumers."
|
|
1419
1435
|
],
|
|
1420
1436
|
attributes: [
|
|
1421
|
-
attribute("type", union("
|
|
1437
|
+
attribute("type", union("typeNode"), {
|
|
1422
1438
|
docs: ["The wrapped type whose serialisation is preceded by the hidden prefix."]
|
|
1423
1439
|
}),
|
|
1424
1440
|
attribute("prefix", array(node("constantValueNode")), {
|
|
@@ -1433,7 +1449,7 @@ var hiddenSuffixTypeNode = defineNode("hiddenSuffixTypeNode", {
|
|
|
1433
1449
|
"Suffixes another type with a list of constant values that are written and read but not surfaced as fields to consumers."
|
|
1434
1450
|
],
|
|
1435
1451
|
attributes: [
|
|
1436
|
-
attribute("type", union("
|
|
1452
|
+
attribute("type", union("typeNode"), {
|
|
1437
1453
|
docs: ["The wrapped type whose serialisation is followed by the hidden suffix."]
|
|
1438
1454
|
}),
|
|
1439
1455
|
attribute("suffix", array(node("constantValueNode")), {
|
|
@@ -1449,13 +1465,13 @@ var mapTypeNode = defineNode("mapTypeNode", {
|
|
|
1449
1465
|
"The key and value types are described by their respective type nodes; the entry count is determined by a count strategy."
|
|
1450
1466
|
],
|
|
1451
1467
|
attributes: [
|
|
1452
|
-
attribute("key", union("
|
|
1468
|
+
attribute("key", union("typeNode"), {
|
|
1453
1469
|
docs: ["The type of each entry key."]
|
|
1454
1470
|
}),
|
|
1455
|
-
attribute("value", union("
|
|
1471
|
+
attribute("value", union("typeNode"), {
|
|
1456
1472
|
docs: ["The type of each entry value."]
|
|
1457
1473
|
}),
|
|
1458
|
-
attribute("count", union("
|
|
1474
|
+
attribute("count", union("countNode"), {
|
|
1459
1475
|
docs: ["The strategy used to determine the number of entries."]
|
|
1460
1476
|
})
|
|
1461
1477
|
]
|
|
@@ -1465,10 +1481,10 @@ var mapTypeNode = defineNode("mapTypeNode", {
|
|
|
1465
1481
|
var numberTypeNode = defineNode("numberTypeNode", {
|
|
1466
1482
|
docs: ["A numeric type with a fixed wire format and byte order."],
|
|
1467
1483
|
attributes: [
|
|
1468
|
-
attribute("format", enumeration("
|
|
1484
|
+
attribute("format", enumeration("numberFormat"), {
|
|
1469
1485
|
docs: ["The wire format used to serialise the number."]
|
|
1470
1486
|
}),
|
|
1471
|
-
attribute("endian", enumeration("
|
|
1487
|
+
attribute("endian", enumeration("endianness"), {
|
|
1472
1488
|
docs: ["The byte order used to serialise the number."]
|
|
1473
1489
|
})
|
|
1474
1490
|
]
|
|
@@ -1483,10 +1499,10 @@ var optionTypeNode = defineNode("optionTypeNode", {
|
|
|
1483
1499
|
"When `true`, the absent variant still occupies the byte size of the present variant (zero-padded). Defaults to `false`."
|
|
1484
1500
|
]
|
|
1485
1501
|
}),
|
|
1486
|
-
attribute("item", union("
|
|
1502
|
+
attribute("item", union("typeNode"), {
|
|
1487
1503
|
docs: ["The type carried by the option when present."]
|
|
1488
1504
|
}),
|
|
1489
|
-
attribute("prefix", nestedUnion("
|
|
1505
|
+
attribute("prefix", nestedUnion("nestedTypeNode", "numberTypeNode"), {
|
|
1490
1506
|
docs: ["The numeric type used as the presence flag."]
|
|
1491
1507
|
})
|
|
1492
1508
|
]
|
|
@@ -1501,10 +1517,10 @@ var postOffsetTypeNode = defineNode("postOffsetTypeNode", {
|
|
|
1501
1517
|
attribute("offset", i64(), {
|
|
1502
1518
|
docs: ["The signed byte offset to apply after the wrapped type runs."]
|
|
1503
1519
|
}),
|
|
1504
|
-
attribute("strategy", enumeration("
|
|
1520
|
+
attribute("strategy", enumeration("postOffsetStrategy"), {
|
|
1505
1521
|
docs: ["How the `offset` value is interpreted."]
|
|
1506
1522
|
}),
|
|
1507
|
-
attribute("type", union("
|
|
1523
|
+
attribute("type", union("typeNode"), {
|
|
1508
1524
|
docs: ["The wrapped type whose serialisation is followed by the offset."]
|
|
1509
1525
|
})
|
|
1510
1526
|
]
|
|
@@ -1519,10 +1535,10 @@ var preOffsetTypeNode = defineNode("preOffsetTypeNode", {
|
|
|
1519
1535
|
attribute("offset", i64(), {
|
|
1520
1536
|
docs: ["The signed byte offset to apply before the wrapped type runs."]
|
|
1521
1537
|
}),
|
|
1522
|
-
attribute("strategy", enumeration("
|
|
1538
|
+
attribute("strategy", enumeration("preOffsetStrategy"), {
|
|
1523
1539
|
docs: ["How the `offset` value is interpreted."]
|
|
1524
1540
|
}),
|
|
1525
|
-
attribute("type", union("
|
|
1541
|
+
attribute("type", union("typeNode"), {
|
|
1526
1542
|
docs: ["The wrapped type whose serialisation is preceded by the offset."]
|
|
1527
1543
|
})
|
|
1528
1544
|
]
|
|
@@ -1540,7 +1556,7 @@ var remainderOptionTypeNode = defineNode("remainderOptionTypeNode", {
|
|
|
1540
1556
|
"A value that may be present or absent. Presence is signalled by whether any bytes remain to be read, with no explicit prefix."
|
|
1541
1557
|
],
|
|
1542
1558
|
attributes: [
|
|
1543
|
-
attribute("item", union("
|
|
1559
|
+
attribute("item", union("typeNode"), {
|
|
1544
1560
|
docs: ["The type carried by the option when present."]
|
|
1545
1561
|
})
|
|
1546
1562
|
]
|
|
@@ -1552,7 +1568,7 @@ var sentinelTypeNode = defineNode("sentinelTypeNode", {
|
|
|
1552
1568
|
"Wraps another type and delimits it with a constant sentinel value written immediately after the wrapped type."
|
|
1553
1569
|
],
|
|
1554
1570
|
attributes: [
|
|
1555
|
-
attribute("type", union("
|
|
1571
|
+
attribute("type", union("typeNode"), {
|
|
1556
1572
|
docs: ["The wrapped type whose extent is delimited by the sentinel."]
|
|
1557
1573
|
}),
|
|
1558
1574
|
attribute("sentinel", node("constantValueNode"), {
|
|
@@ -1567,10 +1583,10 @@ var setTypeNode = defineNode("setTypeNode", {
|
|
|
1567
1583
|
"A unique-valued collection. The item type is defined by `item`; the size is determined by the `count` strategy."
|
|
1568
1584
|
],
|
|
1569
1585
|
attributes: [
|
|
1570
|
-
attribute("item", union("
|
|
1586
|
+
attribute("item", union("typeNode"), {
|
|
1571
1587
|
docs: ["The type of each item in the set."]
|
|
1572
1588
|
}),
|
|
1573
|
-
attribute("count", union("
|
|
1589
|
+
attribute("count", union("countNode"), {
|
|
1574
1590
|
docs: ["The strategy used to determine the number of items."]
|
|
1575
1591
|
})
|
|
1576
1592
|
]
|
|
@@ -1580,10 +1596,10 @@ var setTypeNode = defineNode("setTypeNode", {
|
|
|
1580
1596
|
var sizePrefixTypeNode = defineNode("sizePrefixTypeNode", {
|
|
1581
1597
|
docs: ["Wraps another type with a numeric prefix indicating the byte length of the wrapped type."],
|
|
1582
1598
|
attributes: [
|
|
1583
|
-
attribute("type", union("
|
|
1599
|
+
attribute("type", union("typeNode"), {
|
|
1584
1600
|
docs: ["The wrapped type whose serialisation is preceded by its size."]
|
|
1585
1601
|
}),
|
|
1586
|
-
attribute("prefix", nestedUnion("
|
|
1602
|
+
attribute("prefix", nestedUnion("nestedTypeNode", "numberTypeNode"), {
|
|
1587
1603
|
docs: ["The numeric type used as the size prefix."]
|
|
1588
1604
|
})
|
|
1589
1605
|
]
|
|
@@ -1593,7 +1609,7 @@ var sizePrefixTypeNode = defineNode("sizePrefixTypeNode", {
|
|
|
1593
1609
|
var solAmountTypeNode = defineNode("solAmountTypeNode", {
|
|
1594
1610
|
docs: ["A SOL amount expressed in lamports under the wrapped numeric type."],
|
|
1595
1611
|
attributes: [
|
|
1596
|
-
attribute("number", nestedUnion("
|
|
1612
|
+
attribute("number", nestedUnion("nestedTypeNode", "numberTypeNode"), {
|
|
1597
1613
|
docs: ["The numeric type used to serialise the lamport amount."]
|
|
1598
1614
|
})
|
|
1599
1615
|
]
|
|
@@ -1607,7 +1623,7 @@ var stringTypeNode = defineNode("stringTypeNode", {
|
|
|
1607
1623
|
"The byte length is determined by an enclosing wrapper such as `sizePrefixTypeNode` or `fixedSizeTypeNode`."
|
|
1608
1624
|
],
|
|
1609
1625
|
attributes: [
|
|
1610
|
-
attribute("encoding", enumeration("
|
|
1626
|
+
attribute("encoding", enumeration("bytesEncoding"), {
|
|
1611
1627
|
docs: ["The byte encoding used to serialise the string."]
|
|
1612
1628
|
})
|
|
1613
1629
|
]
|
|
@@ -1620,16 +1636,16 @@ var structFieldTypeNode = defineNode("structFieldTypeNode", {
|
|
|
1620
1636
|
attribute("name", stringIdentifier(), {
|
|
1621
1637
|
docs: ["The name of the field."]
|
|
1622
1638
|
}),
|
|
1623
|
-
optionalAttribute("defaultValueStrategy", enumeration("
|
|
1639
|
+
optionalAttribute("defaultValueStrategy", enumeration("defaultValueStrategy"), {
|
|
1624
1640
|
docs: ["How a configured default value is exposed in generated APIs. Required when `defaultValue` is set."]
|
|
1625
1641
|
}),
|
|
1626
1642
|
optionalAttribute("docs", docs(), {
|
|
1627
1643
|
docs: ["Markdown documentation for the field."]
|
|
1628
1644
|
}),
|
|
1629
|
-
attribute("type", union("
|
|
1645
|
+
attribute("type", union("typeNode"), {
|
|
1630
1646
|
docs: ["The type of the field."]
|
|
1631
1647
|
}),
|
|
1632
|
-
optionalAttribute("defaultValue", union("
|
|
1648
|
+
optionalAttribute("defaultValue", union("valueNode"), {
|
|
1633
1649
|
docs: ["A default value used when the field is omitted by callers."]
|
|
1634
1650
|
})
|
|
1635
1651
|
]
|
|
@@ -1651,7 +1667,7 @@ var structTypeNode = defineNode("structTypeNode", {
|
|
|
1651
1667
|
var tupleTypeNode = defineNode("tupleTypeNode", {
|
|
1652
1668
|
docs: ["A heterogeneous fixed-length sequence in which each positional slot has its own type."],
|
|
1653
1669
|
attributes: [
|
|
1654
|
-
attribute("items", array(union("
|
|
1670
|
+
attribute("items", array(union("typeNode")), {
|
|
1655
1671
|
docs: ["The type of each positional slot, in order."]
|
|
1656
1672
|
})
|
|
1657
1673
|
]
|
|
@@ -1684,28 +1700,28 @@ var STANDALONE_TYPE_NODE_KINDS = [
|
|
|
1684
1700
|
"tupleTypeNode",
|
|
1685
1701
|
"zeroableOptionTypeNode"
|
|
1686
1702
|
];
|
|
1687
|
-
var standaloneTypeNodeUnion = defineUnion("
|
|
1703
|
+
var standaloneTypeNodeUnion = defineUnion("standaloneTypeNode", {
|
|
1688
1704
|
docs: ["Every type node that can be used as a top-level type."],
|
|
1689
1705
|
members: [...STANDALONE_TYPE_NODE_KINDS]
|
|
1690
1706
|
});
|
|
1691
|
-
var enumVariantTypeNodeUnion = defineUnion("
|
|
1707
|
+
var enumVariantTypeNodeUnion = defineUnion("enumVariantTypeNode", {
|
|
1692
1708
|
docs: ["The variant flavours of an `enumTypeNode`."],
|
|
1693
1709
|
members: ["enumEmptyVariantTypeNode", "enumStructVariantTypeNode", "enumTupleVariantTypeNode"]
|
|
1694
1710
|
});
|
|
1695
|
-
var typeNodeUnion = defineUnion("
|
|
1711
|
+
var typeNodeUnion = defineUnion("typeNode", {
|
|
1696
1712
|
docs: ["The composable form: any standalone type, or a reference to a defined type via `definedTypeLinkNode`."],
|
|
1697
|
-
members: [union("
|
|
1713
|
+
members: [union("standaloneTypeNode"), "definedTypeLinkNode"]
|
|
1698
1714
|
});
|
|
1699
|
-
var registeredTypeNodeUnion = defineUnion("
|
|
1715
|
+
var registeredTypeNodeUnion = defineUnion("registeredTypeNode", {
|
|
1700
1716
|
docs: ["Every node tagged as a type-shaped node, including variants and struct fields."],
|
|
1701
|
-
members: [union("
|
|
1717
|
+
members: [union("standaloneTypeNode"), union("enumVariantTypeNode"), "structFieldTypeNode"]
|
|
1702
1718
|
});
|
|
1703
1719
|
|
|
1704
1720
|
// src/v1/nodes/typeNodes/ZeroableOptionTypeNode.ts
|
|
1705
1721
|
var zeroableOptionTypeNode = defineNode("zeroableOptionTypeNode", {
|
|
1706
1722
|
docs: ["An optional value whose absence is signalled by a designated zero value rather than a presence flag."],
|
|
1707
1723
|
attributes: [
|
|
1708
|
-
attribute("item", union("
|
|
1724
|
+
attribute("item", union("typeNode"), {
|
|
1709
1725
|
docs: ["The type carried by the option when present."]
|
|
1710
1726
|
}),
|
|
1711
1727
|
optionalAttribute("zeroValue", node("constantValueNode"), {
|
|
@@ -1758,7 +1774,7 @@ var ALL_TYPE_NODE_UNIONS = [
|
|
|
1758
1774
|
var arrayValueNode = defineNode("arrayValueNode", {
|
|
1759
1775
|
docs: ["A concrete array value: a list of value nodes."],
|
|
1760
1776
|
attributes: [
|
|
1761
|
-
attribute("items", array(union("
|
|
1777
|
+
attribute("items", array(union("valueNode")), {
|
|
1762
1778
|
docs: ["The items of the array, in order."]
|
|
1763
1779
|
})
|
|
1764
1780
|
]
|
|
@@ -1781,7 +1797,7 @@ var bytesValueNode = defineNode("bytesValueNode", {
|
|
|
1781
1797
|
attribute("data", string(), {
|
|
1782
1798
|
docs: ["The bytes encoded as a text string per the `encoding` attribute."]
|
|
1783
1799
|
}),
|
|
1784
|
-
attribute("encoding", enumeration("
|
|
1800
|
+
attribute("encoding", enumeration("bytesEncoding"), {
|
|
1785
1801
|
docs: ["The encoding used to represent the bytes as text."]
|
|
1786
1802
|
})
|
|
1787
1803
|
]
|
|
@@ -1791,10 +1807,10 @@ var bytesValueNode = defineNode("bytesValueNode", {
|
|
|
1791
1807
|
var constantValueNode = defineNode("constantValueNode", {
|
|
1792
1808
|
docs: ["A typed constant: a type node paired with a concrete value node."],
|
|
1793
1809
|
attributes: [
|
|
1794
|
-
attribute("type", union("
|
|
1810
|
+
attribute("type", union("typeNode"), {
|
|
1795
1811
|
docs: ["The type of the constant."]
|
|
1796
1812
|
}),
|
|
1797
|
-
attribute("value", union("
|
|
1813
|
+
attribute("value", union("valueNode"), {
|
|
1798
1814
|
docs: ["The concrete value of the constant."]
|
|
1799
1815
|
})
|
|
1800
1816
|
]
|
|
@@ -1810,7 +1826,7 @@ var enumValueNode = defineNode("enumValueNode", {
|
|
|
1810
1826
|
attribute("enum", node("definedTypeLinkNode"), {
|
|
1811
1827
|
docs: ["A link to the defined enum type the value belongs to."]
|
|
1812
1828
|
}),
|
|
1813
|
-
optionalAttribute("value", union("
|
|
1829
|
+
optionalAttribute("value", union("enumValuePayload"), {
|
|
1814
1830
|
docs: [
|
|
1815
1831
|
"The variant payload \u2014 a struct value for struct variants or a tuple value for tuple variants.",
|
|
1816
1832
|
"Omitted for unit variants."
|
|
@@ -1823,10 +1839,10 @@ var enumValueNode = defineNode("enumValueNode", {
|
|
|
1823
1839
|
var mapEntryValueNode = defineNode("mapEntryValueNode", {
|
|
1824
1840
|
docs: ["A single (key, value) pair inside a `mapValueNode`."],
|
|
1825
1841
|
attributes: [
|
|
1826
|
-
attribute("key", union("
|
|
1842
|
+
attribute("key", union("valueNode"), {
|
|
1827
1843
|
docs: ["The entry key."]
|
|
1828
1844
|
}),
|
|
1829
|
-
attribute("value", union("
|
|
1845
|
+
attribute("value", union("valueNode"), {
|
|
1830
1846
|
docs: ["The entry value."]
|
|
1831
1847
|
})
|
|
1832
1848
|
]
|
|
@@ -1865,7 +1881,7 @@ var numberValueNode = defineNode("numberValueNode", {
|
|
|
1865
1881
|
var publicKeyValueNode = defineNode("publicKeyValueNode", {
|
|
1866
1882
|
docs: ["A concrete public key, with an optional symbolic identifier for the address."],
|
|
1867
1883
|
attributes: [
|
|
1868
|
-
attribute("publicKey",
|
|
1884
|
+
attribute("publicKey", address(), {
|
|
1869
1885
|
docs: ["The base58-encoded public key."]
|
|
1870
1886
|
}),
|
|
1871
1887
|
optionalAttribute("identifier", stringIdentifier(), {
|
|
@@ -1878,7 +1894,7 @@ var publicKeyValueNode = defineNode("publicKeyValueNode", {
|
|
|
1878
1894
|
var setValueNode = defineNode("setValueNode", {
|
|
1879
1895
|
docs: ["A concrete set value: a list of unique value nodes."],
|
|
1880
1896
|
attributes: [
|
|
1881
|
-
attribute("items", array(union("
|
|
1897
|
+
attribute("items", array(union("valueNode")), {
|
|
1882
1898
|
docs: ["The items of the set."]
|
|
1883
1899
|
})
|
|
1884
1900
|
]
|
|
@@ -1888,7 +1904,7 @@ var setValueNode = defineNode("setValueNode", {
|
|
|
1888
1904
|
var someValueNode = defineNode("someValueNode", {
|
|
1889
1905
|
docs: ['The "present" value for an optional type, wrapping a concrete value node.'],
|
|
1890
1906
|
attributes: [
|
|
1891
|
-
attribute("value", union("
|
|
1907
|
+
attribute("value", union("valueNode"), {
|
|
1892
1908
|
docs: ["The wrapped value."]
|
|
1893
1909
|
})
|
|
1894
1910
|
]
|
|
@@ -1911,7 +1927,7 @@ var structFieldValueNode = defineNode("structFieldValueNode", {
|
|
|
1911
1927
|
attribute("name", stringIdentifier(), {
|
|
1912
1928
|
docs: ["The name of the field."]
|
|
1913
1929
|
}),
|
|
1914
|
-
attribute("value", union("
|
|
1930
|
+
attribute("value", union("valueNode"), {
|
|
1915
1931
|
docs: ["The concrete value of the field."]
|
|
1916
1932
|
})
|
|
1917
1933
|
]
|
|
@@ -1931,7 +1947,7 @@ var structValueNode = defineNode("structValueNode", {
|
|
|
1931
1947
|
var tupleValueNode = defineNode("tupleValueNode", {
|
|
1932
1948
|
docs: ["A concrete tuple value: a fixed-length sequence of positional value nodes."],
|
|
1933
1949
|
attributes: [
|
|
1934
|
-
attribute("items", array(union("
|
|
1950
|
+
attribute("items", array(union("valueNode")), {
|
|
1935
1951
|
docs: ["The positional items of the tuple, in order."]
|
|
1936
1952
|
})
|
|
1937
1953
|
]
|
|
@@ -1954,19 +1970,19 @@ var STANDALONE_VALUE_NODE_KINDS = [
|
|
|
1954
1970
|
"structValueNode",
|
|
1955
1971
|
"tupleValueNode"
|
|
1956
1972
|
];
|
|
1957
|
-
var standaloneValueNodeUnion = defineUnion("
|
|
1973
|
+
var standaloneValueNodeUnion = defineUnion("standaloneValueNode", {
|
|
1958
1974
|
docs: ["Every value node that can be used as a top-level value."],
|
|
1959
1975
|
members: [...STANDALONE_VALUE_NODE_KINDS]
|
|
1960
1976
|
});
|
|
1961
|
-
var valueNodeUnion = defineUnion("
|
|
1977
|
+
var valueNodeUnion = defineUnion("valueNode", {
|
|
1962
1978
|
docs: ["The composable form: any standalone value node."],
|
|
1963
|
-
members: [union("
|
|
1979
|
+
members: [union("standaloneValueNode")]
|
|
1964
1980
|
});
|
|
1965
|
-
var registeredValueNodeUnion = defineUnion("
|
|
1981
|
+
var registeredValueNodeUnion = defineUnion("registeredValueNode", {
|
|
1966
1982
|
docs: ["Every node tagged as a value-shaped node, including container variants."],
|
|
1967
|
-
members: [union("
|
|
1983
|
+
members: [union("standaloneValueNode"), "mapEntryValueNode", "structFieldValueNode"]
|
|
1968
1984
|
});
|
|
1969
|
-
var enumValuePayloadUnion = defineUnion("
|
|
1985
|
+
var enumValuePayloadUnion = defineUnion("enumValuePayload", {
|
|
1970
1986
|
docs: ["The payload kinds an `enumValueNode` may carry \u2014 struct fields or positional tuple slots."],
|
|
1971
1987
|
members: ["structValueNode", "tupleValueNode"]
|
|
1972
1988
|
});
|