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