@codama/spec 1.6.0-rc.3 → 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 (101) hide show
  1. package/README.md +84 -0
  2. package/dist/api.browser.cjs +94 -27
  3. package/dist/api.browser.cjs.map +1 -1
  4. package/dist/api.browser.mjs +91 -27
  5. package/dist/api.browser.mjs.map +1 -1
  6. package/dist/api.node.cjs +94 -27
  7. package/dist/api.node.cjs.map +1 -1
  8. package/dist/api.node.mjs +91 -27
  9. package/dist/api.node.mjs.map +1 -1
  10. package/dist/api.react-native.mjs +91 -27
  11. package/dist/api.react-native.mjs.map +1 -1
  12. package/dist/index.browser.cjs +791 -568
  13. package/dist/index.browser.cjs.map +1 -1
  14. package/dist/index.browser.mjs +791 -568
  15. package/dist/index.browser.mjs.map +1 -1
  16. package/dist/index.node.cjs +791 -568
  17. package/dist/index.node.cjs.map +1 -1
  18. package/dist/index.node.mjs +791 -568
  19. package/dist/index.node.mjs.map +1 -1
  20. package/dist/index.react-native.mjs +791 -568
  21. package/dist/index.react-native.mjs.map +1 -1
  22. package/dist/types/api/attribute.d.ts +2 -2
  23. package/dist/types/api/attribute.d.ts.map +1 -1
  24. package/dist/types/api/defineCategory.d.ts +19 -0
  25. package/dist/types/api/defineCategory.d.ts.map +1 -0
  26. package/dist/types/api/defineEnumeration.d.ts +2 -2
  27. package/dist/types/api/defineEnumeration.d.ts.map +1 -1
  28. package/dist/types/api/defineNestedUnion.d.ts +29 -0
  29. package/dist/types/api/defineNestedUnion.d.ts.map +1 -0
  30. package/dist/types/api/defineNode.d.ts +2 -2
  31. package/dist/types/api/defineNode.d.ts.map +1 -1
  32. package/dist/types/api/defineUnion.d.ts +2 -2
  33. package/dist/types/api/defineUnion.d.ts.map +1 -1
  34. package/dist/types/api/index.d.ts +6 -4
  35. package/dist/types/api/index.d.ts.map +1 -1
  36. package/dist/types/api/primitives.d.ts +14 -4
  37. package/dist/types/api/primitives.d.ts.map +1 -1
  38. package/dist/types/api/public.d.ts +1 -1
  39. package/dist/types/api/public.d.ts.map +1 -1
  40. package/dist/types/api/types.d.ts +78 -24
  41. package/dist/types/api/types.d.ts.map +1 -1
  42. package/dist/types/api/validate.d.ts +4 -5
  43. package/dist/types/api/validate.d.ts.map +1 -1
  44. package/dist/types/v1/enumerations.d.ts.map +1 -1
  45. package/dist/types/v1/index.d.ts.map +1 -1
  46. package/dist/types/v1/nestedUnions.d.ts +9 -0
  47. package/dist/types/v1/nestedUnions.d.ts.map +1 -0
  48. package/dist/types/v1/nodes/AccountNode.d.ts.map +1 -1
  49. package/dist/types/v1/nodes/EventNode.d.ts.map +1 -1
  50. package/dist/types/v1/nodes/InstructionAccountNode.d.ts.map +1 -1
  51. package/dist/types/v1/nodes/InstructionByteDeltaNode.d.ts.map +1 -1
  52. package/dist/types/v1/nodes/InstructionNode.d.ts.map +1 -1
  53. package/dist/types/v1/nodes/InstructionRemainingAccountsNode.d.ts.map +1 -1
  54. package/dist/types/v1/nodes/InstructionStatusNode.d.ts.map +1 -1
  55. package/dist/types/v1/nodes/PdaNode.d.ts.map +1 -1
  56. package/dist/types/v1/nodes/ProgramNode.d.ts.map +1 -1
  57. package/dist/types/v1/nodes/RootNode.d.ts.map +1 -1
  58. package/dist/types/v1/nodes/contextualValueNodes/ConditionalValueNode.d.ts.map +1 -1
  59. package/dist/types/v1/nodes/contextualValueNodes/ContextualValueNode.d.ts +2 -2
  60. package/dist/types/v1/nodes/contextualValueNodes/ContextualValueNode.d.ts.map +1 -1
  61. package/dist/types/v1/nodes/contextualValueNodes/ResolverValueNode.d.ts.map +1 -1
  62. package/dist/types/v1/nodes/linkNodes/InstructionAccountLinkNode.d.ts.map +1 -1
  63. package/dist/types/v1/nodes/linkNodes/InstructionArgumentLinkNode.d.ts.map +1 -1
  64. package/dist/types/v1/nodes/linkNodes/InstructionLinkNode.d.ts.map +1 -1
  65. package/dist/types/v1/nodes/pdaSeedNodes/PdaSeedNode.d.ts +1 -1
  66. package/dist/types/v1/nodes/typeNodes/AmountTypeNode.d.ts.map +1 -1
  67. package/dist/types/v1/nodes/typeNodes/ArrayTypeNode.d.ts.map +1 -1
  68. package/dist/types/v1/nodes/typeNodes/BytesTypeNode.d.ts.map +1 -1
  69. package/dist/types/v1/nodes/typeNodes/DateTimeTypeNode.d.ts.map +1 -1
  70. package/dist/types/v1/nodes/typeNodes/EnumEmptyVariantTypeNode.d.ts.map +1 -1
  71. package/dist/types/v1/nodes/typeNodes/EnumStructVariantTypeNode.d.ts.map +1 -1
  72. package/dist/types/v1/nodes/typeNodes/EnumTupleVariantTypeNode.d.ts.map +1 -1
  73. package/dist/types/v1/nodes/typeNodes/HiddenPrefixTypeNode.d.ts.map +1 -1
  74. package/dist/types/v1/nodes/typeNodes/HiddenSuffixTypeNode.d.ts.map +1 -1
  75. package/dist/types/v1/nodes/typeNodes/MapTypeNode.d.ts.map +1 -1
  76. package/dist/types/v1/nodes/typeNodes/OptionTypeNode.d.ts.map +1 -1
  77. package/dist/types/v1/nodes/typeNodes/PostOffsetTypeNode.d.ts.map +1 -1
  78. package/dist/types/v1/nodes/typeNodes/PreOffsetTypeNode.d.ts.map +1 -1
  79. package/dist/types/v1/nodes/typeNodes/RemainderOptionTypeNode.d.ts.map +1 -1
  80. package/dist/types/v1/nodes/typeNodes/SentinelTypeNode.d.ts.map +1 -1
  81. package/dist/types/v1/nodes/typeNodes/SetTypeNode.d.ts.map +1 -1
  82. package/dist/types/v1/nodes/typeNodes/StringTypeNode.d.ts.map +1 -1
  83. package/dist/types/v1/nodes/typeNodes/StructTypeNode.d.ts.map +1 -1
  84. package/dist/types/v1/nodes/typeNodes/TypeNode.d.ts +4 -4
  85. package/dist/types/v1/nodes/typeNodes/ZeroableOptionTypeNode.d.ts.map +1 -1
  86. package/dist/types/v1/nodes/valueNodes/EnumValueNode.d.ts.map +1 -1
  87. package/dist/types/v1/nodes/valueNodes/NumberValueNode.d.ts.map +1 -1
  88. package/dist/types/v1/nodes/valueNodes/ValueNode.d.ts +4 -4
  89. package/dist/v1.browser.cjs +791 -568
  90. package/dist/v1.browser.cjs.map +1 -1
  91. package/dist/v1.browser.mjs +791 -568
  92. package/dist/v1.browser.mjs.map +1 -1
  93. package/dist/v1.node.cjs +791 -568
  94. package/dist/v1.node.cjs.map +1 -1
  95. package/dist/v1.node.mjs +791 -568
  96. package/dist/v1.node.mjs.map +1 -1
  97. package/dist/v1.react-native.mjs +791 -568
  98. package/dist/v1.react-native.mjs.map +1 -1
  99. package/package.json +45 -31
  100. package/dist/types/v1/nestedTypeNodeWrappers.d.ts +0 -10
  101. package/dist/types/v1/nestedTypeNodeWrappers.d.ts.map +0 -1
package/dist/v1.node.cjs CHANGED
@@ -6,7 +6,7 @@ function attribute(name, type, options = {}) {
6
6
  name,
7
7
  type,
8
8
  ...options.optional ? { optional: true } : {},
9
- ...options.docs !== void 0 ? { docs: options.docs } : {}
9
+ ...options.docs !== void 0 ? { docs: Object.freeze([...options.docs]) } : {}
10
10
  });
11
11
  }
12
12
  function optionalAttribute(name, type, options = {}) {
@@ -18,11 +18,23 @@ function array(inner) {
18
18
  return Object.freeze({ kind: "array", of: inner });
19
19
  }
20
20
 
21
+ // src/api/defineCategory.ts
22
+ function defineCategory(name, options = {}) {
23
+ return Object.freeze({
24
+ name,
25
+ ...options.docs !== void 0 ? { docs: Object.freeze([...options.docs]) } : {},
26
+ nodes: Object.freeze([...options.nodes ?? []]),
27
+ unions: Object.freeze([...options.unions ?? []]),
28
+ enumerations: Object.freeze([...options.enumerations ?? []]),
29
+ nestedUnions: Object.freeze([...options.nestedUnions ?? []])
30
+ });
31
+ }
32
+
21
33
  // src/api/defineEnumeration.ts
22
34
  function variant(name, options = {}) {
23
35
  return Object.freeze({
24
36
  name,
25
- ...options.docs !== void 0 ? { docs: options.docs } : {}
37
+ ...options.docs !== void 0 ? { docs: Object.freeze([...options.docs]) } : {}
26
38
  });
27
39
  }
28
40
  function defineEnumeration(name, options) {
@@ -39,7 +51,17 @@ function defineEnumeration(name, options) {
39
51
  return Object.freeze({
40
52
  name,
41
53
  variants: Object.freeze([...options.variants]),
42
- ...options.docs !== void 0 ? { docs: options.docs } : {}
54
+ ...options.docs !== void 0 ? { docs: Object.freeze([...options.docs]) } : {}
55
+ });
56
+ }
57
+
58
+ // src/api/defineNestedUnion.ts
59
+ function defineNestedUnion(name, options) {
60
+ return Object.freeze({
61
+ name,
62
+ ...options.docs !== void 0 ? { docs: Object.freeze([...options.docs]) } : {},
63
+ base: options.base,
64
+ wrappers: Object.freeze([...options.wrappers])
43
65
  });
44
66
  }
45
67
 
@@ -47,7 +69,7 @@ function defineEnumeration(name, options) {
47
69
  function defineNode(kind, options) {
48
70
  return Object.freeze({
49
71
  kind,
50
- ...options.docs !== void 0 ? { docs: options.docs } : {},
72
+ ...options.docs !== void 0 ? { docs: Object.freeze([...options.docs]) } : {},
51
73
  attributes: Object.freeze([...options.attributes]),
52
74
  examples: Object.freeze([...options.examples ?? []])
53
75
  });
@@ -59,7 +81,7 @@ function defineUnion(name, options) {
59
81
  return Object.freeze({
60
82
  name,
61
83
  members: Object.freeze(normalised),
62
- ...options.docs !== void 0 ? { docs: options.docs } : {}
84
+ ...options.docs !== void 0 ? { docs: Object.freeze([...options.docs]) } : {}
63
85
  });
64
86
  }
65
87
  function normaliseMember(input) {
@@ -74,6 +96,9 @@ function normaliseMember(input) {
74
96
  }
75
97
 
76
98
  // src/api/primitives.ts
99
+ function address() {
100
+ return Object.freeze({ kind: "address" });
101
+ }
77
102
  function string() {
78
103
  return Object.freeze({ kind: "string" });
79
104
  }
@@ -120,8 +145,8 @@ function node(name) {
120
145
  function union(name) {
121
146
  return Object.freeze({ kind: "union", name });
122
147
  }
123
- function nestedTypeNode(name) {
124
- return Object.freeze({ kind: "nestedTypeNode", name });
148
+ function nestedUnion(alias, name) {
149
+ return Object.freeze({ kind: "nestedUnion", alias, name });
125
150
  }
126
151
 
127
152
  // src/api/semanticAliases.ts
@@ -133,26 +158,46 @@ function docs() {
133
158
  }
134
159
 
135
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$/;
136
163
  function validate(spec) {
137
164
  const errors = [];
138
- const nodeKinds = new Set(spec.nodes.map((n) => n.kind));
139
- const unionNames = new Set(spec.unions.map((u) => u.name));
140
- const enumerationNames = new Set(spec.enumerations.map((e) => e.name));
141
- const wrappers = new Set(spec.nestedTypeNodeWrappers);
165
+ const allNodes = [];
166
+ const allUnions = [];
167
+ const allEnumerations = [];
168
+ const allNestedUnions = [];
169
+ for (const c of spec.categories) {
170
+ allNodes.push(...c.nodes);
171
+ allUnions.push(...c.unions);
172
+ allEnumerations.push(...c.enumerations);
173
+ allNestedUnions.push(...c.nestedUnions);
174
+ }
175
+ const nodeKinds = new Set(allNodes.map((n) => n.kind));
176
+ const unionNames = new Set(allUnions.map((u) => u.name));
177
+ const enumerationNames = new Set(allEnumerations.map((e) => e.name));
178
+ const nestedUnionNames = new Set(allNestedUnions.map((nu) => nu.name));
142
179
  const registrations = /* @__PURE__ */ new Map();
143
180
  const record = (name, kind) => {
144
181
  const list = registrations.get(name);
145
182
  if (list) list.push(kind);
146
183
  else registrations.set(name, [kind]);
147
184
  };
148
- for (const n of spec.nodes) record(n.kind, "node");
149
- for (const u of spec.unions) record(u.name, "union");
150
- for (const e of spec.enumerations) record(e.name, "enumeration");
185
+ for (const n of allNodes) record(n.kind, "node");
186
+ for (const u of allUnions) record(u.name, "union");
187
+ for (const e of allEnumerations) record(e.name, "enumeration");
188
+ for (const nu of allNestedUnions) record(nu.name, "nestedUnion");
151
189
  for (const [name, kinds] of registrations) {
152
190
  if (kinds.length > 1) errors.push(formatCollisionError(name, kinds));
153
191
  }
154
- for (const n of spec.nodes) {
155
- if (!/^[a-z][A-Za-z0-9]*Node$/.test(n.kind)) {
192
+ const seenCategories = /* @__PURE__ */ new Set();
193
+ for (const c of spec.categories) {
194
+ if (seenCategories.has(c.name)) {
195
+ errors.push(`Category "${c.name}" is declared more than once.`);
196
+ }
197
+ seenCategories.add(c.name);
198
+ }
199
+ for (const n of allNodes) {
200
+ if (!NODE_KIND_REGEX.test(n.kind)) {
156
201
  errors.push(`Node kind "${n.kind}" does not match the camelCase ...Node naming convention.`);
157
202
  }
158
203
  const seenAttrs = /* @__PURE__ */ new Set();
@@ -163,11 +208,14 @@ function validate(spec) {
163
208
  seenAttrs.add(a.name);
164
209
  walkTypeExpr(
165
210
  a.type,
166
- (expr) => checkRef(expr, n.kind, a.name, errors, nodeKinds, unionNames, enumerationNames)
211
+ (expr) => checkRef(expr, n.kind, a.name, errors, nodeKinds, unionNames, enumerationNames, nestedUnionNames)
167
212
  );
168
213
  }
169
214
  }
170
- for (const u of spec.unions) {
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
+ }
171
219
  if (u.members.length === 0) {
172
220
  errors.push(`Union "${u.name}" has no members.`);
173
221
  }
@@ -186,9 +234,22 @@ function validate(spec) {
186
234
  }
187
235
  }
188
236
  }
189
- for (const wrapper of wrappers) {
190
- if (!nodeKinds.has(wrapper)) {
191
- errors.push(`Nested-type-node wrapper "${wrapper}" is not a defined node.`);
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
+ }
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
+ }
246
+ if (nu.wrappers.length === 0) {
247
+ errors.push(`Nested union "${nu.name}" has no wrappers.`);
248
+ }
249
+ for (const w of nu.wrappers) {
250
+ if (!nodeKinds.has(w)) {
251
+ errors.push(`Nested union "${nu.name}" wrapper "${w}" is not a defined node.`);
252
+ }
192
253
  }
193
254
  }
194
255
  return errors;
@@ -197,7 +258,7 @@ function formatCollisionError(name, kinds) {
197
258
  const counts = /* @__PURE__ */ new Map();
198
259
  for (const k of kinds) counts.set(k, (counts.get(k) ?? 0) + 1);
199
260
  const breakdown = [...counts.entries()].sort((a, b) => a[0].localeCompare(b[0])).map(([k, n]) => `${n} ${k}${n > 1 ? "s" : ""}`).join(", ");
200
- return `Name "${name}" is registered ${kinds.length} times (${breakdown}); names must be unique across nodes, unions, and enumerations.`;
261
+ return `Name "${name}" is registered ${kinds.length} times (${breakdown}); names must be unique across nodes, unions, enumerations, and nested unions.`;
201
262
  }
202
263
  function walkTypeExpr(expr, visit) {
203
264
  visit(expr);
@@ -207,7 +268,7 @@ function walkTypeExpr(expr, visit) {
207
268
  for (const item of expr.items) walkTypeExpr(item, visit);
208
269
  }
209
270
  }
210
- function checkRef(expr, nodeKind, attrName, errors, nodeKinds, unionNames, enumerationNames) {
271
+ function checkRef(expr, nodeKind, attrName, errors, nodeKinds, unionNames, enumerationNames, nestedUnionNames) {
211
272
  const where = `Node "${nodeKind}", attribute "${attrName}":`;
212
273
  switch (expr.kind) {
213
274
  case "node":
@@ -225,9 +286,12 @@ function checkRef(expr, nodeKind, attrName, errors, nodeKinds, unionNames, enume
225
286
  errors.push(`${where} references undefined enumeration "${expr.name}".`);
226
287
  }
227
288
  break;
228
- case "nestedTypeNode":
289
+ case "nestedUnion":
229
290
  if (!nodeKinds.has(expr.name)) {
230
- errors.push(`${where} nestedTypeNode references undefined node "${expr.name}".`);
291
+ errors.push(`${where} nestedUnion references undefined node "${expr.name}".`);
292
+ }
293
+ if (!nestedUnionNames.has(expr.alias)) {
294
+ errors.push(`${where} nestedUnion references undefined alias "${expr.alias}".`);
231
295
  }
232
296
  break;
233
297
  }
@@ -235,7 +299,7 @@ function checkRef(expr, nodeKind, attrName, errors, nodeKinds, unionNames, enume
235
299
  function isChildAttribute(type) {
236
300
  switch (type.kind) {
237
301
  case "node":
238
- case "nestedTypeNode":
302
+ case "nestedUnion":
239
303
  case "union":
240
304
  return true;
241
305
  case "array":
@@ -248,115 +312,117 @@ function isChildAttribute(type) {
248
312
  }
249
313
 
250
314
  // src/v1/enumerations.ts
251
- var endianness = defineEnumeration("Endianness", {
252
- docs: "The byte order of a numeric serialization.",
315
+ var endianness = defineEnumeration("endianness", {
316
+ docs: ["The byte order of a numeric serialization."],
253
317
  variants: [
254
- variant("be", { docs: "Big-endian: the most significant byte is written first." }),
255
- variant("le", { docs: "Little-endian: the least significant byte is written first." })
318
+ variant("be", { docs: ["Big-endian: the most significant byte is written first."] }),
319
+ variant("le", { docs: ["Little-endian: the least significant byte is written first."] })
256
320
  ]
257
321
  });
258
- var numberFormat = defineEnumeration("NumberFormat", {
259
- docs: "The wire format of a numeric serialization.",
322
+ var numberFormat = defineEnumeration("numberFormat", {
323
+ docs: ["The wire format of a numeric serialization."],
260
324
  variants: [
261
- variant("f32", { docs: "IEEE-754 32-bit floating point." }),
262
- variant("f64", { docs: "IEEE-754 64-bit floating point." }),
263
- variant("i8", { docs: "Signed 8-bit integer." }),
264
- variant("i16", { docs: "Signed 16-bit integer." }),
265
- variant("i32", { docs: "Signed 32-bit integer." }),
266
- variant("i64", { docs: "Signed 64-bit integer." }),
267
- variant("i128", { docs: "Signed 128-bit integer." }),
325
+ variant("f32", { docs: ["IEEE-754 32-bit floating point."] }),
326
+ variant("f64", { docs: ["IEEE-754 64-bit floating point."] }),
327
+ variant("i8", { docs: ["Signed 8-bit integer."] }),
328
+ variant("i16", { docs: ["Signed 16-bit integer."] }),
329
+ variant("i32", { docs: ["Signed 32-bit integer."] }),
330
+ variant("i64", { docs: ["Signed 64-bit integer."] }),
331
+ variant("i128", { docs: ["Signed 128-bit integer."] }),
268
332
  variant("shortU16", {
269
- docs: "Solana compact-u16 encoding: a variable-length unsigned integer occupying 1 to 3 bytes."
333
+ docs: ["Solana compact-u16 encoding: a variable-length unsigned integer occupying 1 to 3 bytes."]
270
334
  }),
271
- variant("u8", { docs: "Unsigned 8-bit integer." }),
272
- variant("u16", { docs: "Unsigned 16-bit integer." }),
273
- variant("u32", { docs: "Unsigned 32-bit integer." }),
274
- variant("u64", { docs: "Unsigned 64-bit integer." }),
275
- variant("u128", { docs: "Unsigned 128-bit integer." })
335
+ variant("u8", { docs: ["Unsigned 8-bit integer."] }),
336
+ variant("u16", { docs: ["Unsigned 16-bit integer."] }),
337
+ variant("u32", { docs: ["Unsigned 32-bit integer."] }),
338
+ variant("u64", { docs: ["Unsigned 64-bit integer."] }),
339
+ variant("u128", { docs: ["Unsigned 128-bit integer."] })
276
340
  ]
277
341
  });
278
- var bytesEncoding = defineEnumeration("BytesEncoding", {
279
- docs: "How a string of bytes is encoded for transport.",
342
+ var bytesEncoding = defineEnumeration("bytesEncoding", {
343
+ docs: ["How a string of bytes is encoded for transport."],
280
344
  variants: [
281
- variant("base16", { docs: "Hexadecimal encoding (two characters per byte)." }),
282
- variant("base58", { docs: "Base58 encoding, the standard for Solana addresses." }),
283
- variant("base64", { docs: "Base64 encoding (RFC 4648)." }),
284
- variant("utf8", { docs: "UTF-8 text encoding." })
345
+ variant("base16", { docs: ["Hexadecimal encoding (two characters per byte)."] }),
346
+ variant("base58", { docs: ["Base58 encoding, the standard for Solana addresses."] }),
347
+ variant("base64", { docs: ["Base64 encoding (RFC 4648)."] }),
348
+ variant("utf8", { docs: ["UTF-8 text encoding."] })
285
349
  ]
286
350
  });
287
- var instructionLifecycle = defineEnumeration("InstructionLifecycle", {
288
- docs: "The lifecycle stage of an instruction.",
351
+ var instructionLifecycle = defineEnumeration("instructionLifecycle", {
352
+ docs: ["The lifecycle stage of an instruction."],
289
353
  variants: [
290
354
  variant("archived", {
291
- docs: "No longer included in client SDKs. Retained in the IDL for historical reference only."
355
+ docs: ["No longer included in client SDKs. Retained in the IDL for historical reference only."]
292
356
  }),
293
357
  variant("deprecated", {
294
- docs: "Still callable but discouraged. Clients should migrate to a replacement instruction."
358
+ docs: ["Still callable but discouraged. Clients should migrate to a replacement instruction."]
295
359
  }),
296
360
  variant("draft", {
297
- docs: "Work-in-progress. The instruction may change before it stabilises."
361
+ docs: ["Work-in-progress. The instruction may change before it stabilises."]
298
362
  }),
299
- variant("live", { docs: "Stable and supported for production use." })
363
+ variant("live", { docs: ["Stable and supported for production use."] })
300
364
  ]
301
365
  });
302
- var defaultValueStrategy = defineEnumeration("DefaultValueStrategy", {
303
- docs: "How an attribute that carries a default value is exposed in generated APIs.",
366
+ var defaultValueStrategy = defineEnumeration("defaultValueStrategy", {
367
+ docs: ["How an attribute that carries a default value is exposed in generated APIs."],
304
368
  variants: [
305
369
  variant("omitted", {
306
- docs: "The attribute is not exposed as a parameter in the generated API; the default value is always used."
370
+ docs: [
371
+ "The attribute is not exposed as a parameter in the generated API; the default value is always used."
372
+ ]
307
373
  }),
308
374
  variant("optional", {
309
- docs: "The attribute is exposed as an optional parameter; callers may override the default value."
375
+ docs: ["The attribute is exposed as an optional parameter; callers may override the default value."]
310
376
  })
311
377
  ]
312
378
  });
313
- var optionalAccountStrategy = defineEnumeration("OptionalAccountStrategy", {
314
- docs: "How an absent optional account is represented when serialising an instruction.",
379
+ var optionalAccountStrategy = defineEnumeration("optionalAccountStrategy", {
380
+ docs: ["How an absent optional account is represented when serialising an instruction."],
315
381
  variants: [
316
382
  variant("omitted", {
317
- docs: "The account slot is left out of the instruction entirely. Subsequent accounts shift up."
383
+ docs: ["The account slot is left out of the instruction entirely. Subsequent accounts shift up."]
318
384
  }),
319
385
  variant("programId", {
320
- docs: "The account slot is filled with the program ID as a placeholder, preserving positional indices."
386
+ docs: ["The account slot is filled with the program ID as a placeholder, preserving positional indices."]
321
387
  })
322
388
  ]
323
389
  });
324
- var preOffsetStrategy = defineEnumeration("PreOffsetStrategy", {
325
- docs: "How a pre-offset modifier interprets its offset value before serialising the wrapped type.",
390
+ var preOffsetStrategy = defineEnumeration("preOffsetStrategy", {
391
+ docs: ["How a pre-offset modifier interprets its offset value before serialising the wrapped type."],
326
392
  variants: [
327
393
  variant("absolute", {
328
- docs: "Move the cursor to the absolute byte position given by the offset."
394
+ docs: ["Move the cursor to the absolute byte position given by the offset."]
329
395
  }),
330
396
  variant("padded", {
331
- docs: "Pad with zero bytes from the current cursor up to the offset bytes ahead."
397
+ docs: ["Pad with zero bytes from the current cursor up to the offset bytes ahead."]
332
398
  }),
333
399
  variant("relative", {
334
- docs: "Advance the cursor by the offset bytes relative to its current position."
400
+ docs: ["Advance the cursor by the offset bytes relative to its current position."]
335
401
  })
336
402
  ]
337
403
  });
338
- var postOffsetStrategy = defineEnumeration("PostOffsetStrategy", {
339
- docs: "How a post-offset modifier interprets its offset value after serialising the wrapped type.",
404
+ var postOffsetStrategy = defineEnumeration("postOffsetStrategy", {
405
+ docs: ["How a post-offset modifier interprets its offset value after serialising the wrapped type."],
340
406
  variants: [
341
407
  variant("absolute", {
342
- docs: "Move the cursor to the absolute byte position given by the offset."
408
+ docs: ["Move the cursor to the absolute byte position given by the offset."]
343
409
  }),
344
410
  variant("padded", {
345
- docs: "Pad with zero bytes from the current cursor up to the offset bytes ahead."
411
+ docs: ["Pad with zero bytes from the current cursor up to the offset bytes ahead."]
346
412
  }),
347
413
  variant("preOffset", {
348
- docs: "Restore the cursor to where it was before the wrapped type ran (cancelling its pre-offset)."
414
+ docs: ["Restore the cursor to where it was before the wrapped type ran (cancelling its pre-offset)."]
349
415
  }),
350
416
  variant("relative", {
351
- docs: "Advance the cursor by the offset bytes relative to its current position."
417
+ docs: ["Advance the cursor by the offset bytes relative to its current position."]
352
418
  })
353
419
  ]
354
420
  });
355
- var programOrigin = defineEnumeration("ProgramOrigin", {
356
- docs: "The toolchain that originally generated a program description.",
421
+ var programOrigin = defineEnumeration("programOrigin", {
422
+ docs: ["The toolchain that originally generated a program description."],
357
423
  variants: [
358
- variant("anchor", { docs: "The program was originally described by an Anchor IDL." }),
359
- variant("shank", { docs: "The program was originally described by a Shank IDL." })
424
+ variant("anchor", { docs: ["The program was originally described by an Anchor IDL."] }),
425
+ variant("shank", { docs: ["The program was originally described by a Shank IDL."] })
360
426
  ]
361
427
  });
362
428
  var ALL_ENUMERATIONS = [
@@ -371,106 +437,124 @@ var ALL_ENUMERATIONS = [
371
437
  programOrigin
372
438
  ];
373
439
 
374
- // src/v1/nestedTypeNodeWrappers.ts
375
- var NESTED_TYPE_NODE_WRAPPERS = [
376
- "fixedSizeTypeNode",
377
- "sizePrefixTypeNode",
378
- "preOffsetTypeNode",
379
- "postOffsetTypeNode",
380
- "sentinelTypeNode",
381
- "hiddenPrefixTypeNode",
382
- "hiddenSuffixTypeNode"
383
- ];
440
+ // src/v1/nestedUnions.ts
441
+ var nestedTypeNode = defineNestedUnion("nestedTypeNode", {
442
+ docs: [
443
+ "A type, possibly wrapped in zero-or-more size, offset, sentinel, or hidden prefix/suffix modifiers.",
444
+ "The wrapping is recursive: each modifier wraps another `nestedTypeNode<T>` until the inner `T` is reached."
445
+ ],
446
+ base: union("typeNode"),
447
+ wrappers: [
448
+ "fixedSizeTypeNode",
449
+ "sizePrefixTypeNode",
450
+ "preOffsetTypeNode",
451
+ "postOffsetTypeNode",
452
+ "sentinelTypeNode",
453
+ "hiddenPrefixTypeNode",
454
+ "hiddenSuffixTypeNode"
455
+ ]
456
+ });
384
457
 
385
458
  // src/v1/nodes/AccountNode.ts
386
459
  var accountNode = defineNode("accountNode", {
387
- docs: "An on-chain account: its name, data structure, optional fixed size, optional PDA, and optional discriminators.",
460
+ docs: [
461
+ "An on-chain account: its name, data structure, optional fixed size, optional PDA, and optional discriminators."
462
+ ],
388
463
  attributes: [
389
464
  attribute("name", stringIdentifier(), {
390
- docs: "The name of the account."
465
+ docs: ["The name of the account."]
391
466
  }),
392
467
  optionalAttribute("size", byteSize(), {
393
- docs: "The size of the account in bytes, when the data length is fixed."
468
+ docs: ["The size of the account in bytes, when the data length is fixed."]
394
469
  }),
395
470
  optionalAttribute("docs", docs(), {
396
- docs: "Markdown documentation for the account."
471
+ docs: ["Markdown documentation for the account."]
397
472
  }),
398
- attribute("data", nestedTypeNode("structTypeNode"), {
399
- docs: "The struct describing the account data."
473
+ attribute("data", nestedUnion("nestedTypeNode", "structTypeNode"), {
474
+ docs: ["The struct describing the account data."]
400
475
  }),
401
476
  optionalAttribute("pda", node("pdaLinkNode"), {
402
- docs: "A link to the PDA the account is derived from, if applicable."
477
+ docs: ["A link to the PDA the account is derived from, if applicable."]
403
478
  }),
404
- optionalAttribute("discriminators", array(union("DiscriminatorNode")), {
405
- docs: "Discriminators that distinguish this account from others in the program. When multiple are listed, they are combined with a logical AND."
479
+ optionalAttribute("discriminators", array(union("discriminatorNode")), {
480
+ docs: [
481
+ "Discriminators that distinguish this account from others in the program.",
482
+ "When multiple are listed, they are combined with a logical AND."
483
+ ]
406
484
  })
407
485
  ]
408
486
  });
409
487
 
410
488
  // src/v1/nodes/ConstantNode.ts
411
489
  var constantNode = defineNode("constantNode", {
412
- docs: "A named constant exposed by the program: a typed value associated with a name.",
490
+ docs: ["A named constant exposed by the program: a typed value associated with a name."],
413
491
  attributes: [
414
492
  attribute("name", stringIdentifier(), {
415
- docs: "The name of the constant."
493
+ docs: ["The name of the constant."]
416
494
  }),
417
495
  optionalAttribute("docs", docs(), {
418
- docs: "Markdown documentation for the constant."
496
+ docs: ["Markdown documentation for the constant."]
419
497
  }),
420
- attribute("type", union("TypeNode"), {
421
- docs: "The type of the constant."
498
+ attribute("type", union("typeNode"), {
499
+ docs: ["The type of the constant."]
422
500
  }),
423
- attribute("value", union("ValueNode"), {
424
- docs: "The concrete value of the constant."
501
+ attribute("value", union("valueNode"), {
502
+ docs: ["The concrete value of the constant."]
425
503
  })
426
504
  ]
427
505
  });
428
506
 
429
507
  // src/v1/nodes/contextualValueNodes/AccountBumpValueNode.ts
430
508
  var accountBumpValueNode = defineNode("accountBumpValueNode", {
431
- docs: "Refers to the bump seed of a named PDA-derived account in the surrounding instruction.",
509
+ docs: ["Refers to the bump seed of a named PDA-derived account in the surrounding instruction."],
432
510
  attributes: [
433
511
  attribute("name", stringIdentifier(), {
434
- docs: "The name of the account whose bump seed is referenced."
512
+ docs: ["The name of the account whose bump seed is referenced."]
435
513
  })
436
514
  ]
437
515
  });
438
516
 
439
517
  // src/v1/nodes/contextualValueNodes/AccountValueNode.ts
440
518
  var accountValueNode = defineNode("accountValueNode", {
441
- docs: "Refers to a named account in the surrounding instruction.",
519
+ docs: ["Refers to a named account in the surrounding instruction."],
442
520
  attributes: [
443
521
  attribute("name", stringIdentifier(), {
444
- docs: "The name of the referenced account."
522
+ docs: ["The name of the referenced account."]
445
523
  })
446
524
  ]
447
525
  });
448
526
 
449
527
  // src/v1/nodes/contextualValueNodes/ArgumentValueNode.ts
450
528
  var argumentValueNode = defineNode("argumentValueNode", {
451
- docs: "Refers to a named argument of the surrounding instruction.",
529
+ docs: ["Refers to a named argument of the surrounding instruction."],
452
530
  attributes: [
453
531
  attribute("name", stringIdentifier(), {
454
- docs: "The name of the referenced argument."
532
+ docs: ["The name of the referenced argument."]
455
533
  })
456
534
  ]
457
535
  });
458
536
 
459
537
  // src/v1/nodes/contextualValueNodes/ConditionalValueNode.ts
460
538
  var conditionalValueNode = defineNode("conditionalValueNode", {
461
- docs: "A branching contextual value. The condition resolves to a value at instruction time; that result selects between `ifTrue` and `ifFalse`.",
539
+ docs: [
540
+ "A branching contextual value.",
541
+ "The condition resolves to a value at instruction time; that result selects between `ifTrue` and `ifFalse`."
542
+ ],
462
543
  attributes: [
463
- attribute("condition", union("ConditionalValueCondition"), {
464
- docs: "The value whose evaluation drives the branch."
544
+ attribute("condition", union("conditionalValueCondition"), {
545
+ docs: ["The value whose evaluation drives the branch."]
465
546
  }),
466
- optionalAttribute("value", union("ValueNode"), {
467
- docs: "When present, the condition result is compared for equality against this value; otherwise the result is treated as a boolean."
547
+ optionalAttribute("value", union("valueNode"), {
548
+ docs: [
549
+ "When present, the condition result is compared for equality against this value.",
550
+ "Otherwise the result is treated as a boolean."
551
+ ]
468
552
  }),
469
- optionalAttribute("ifTrue", union("InstructionInputValueNode"), {
470
- docs: "The value used when the condition resolves truthy (or matches `value`)."
553
+ optionalAttribute("ifTrue", union("instructionInputValueNode"), {
554
+ docs: ["The value used when the condition resolves truthy (or matches `value`)."]
471
555
  }),
472
- optionalAttribute("ifFalse", union("InstructionInputValueNode"), {
473
- docs: "The value used when the condition resolves falsy (or does not match `value`)."
556
+ optionalAttribute("ifFalse", union("instructionInputValueNode"), {
557
+ docs: ["The value used when the condition resolves falsy (or does not match `value`)."]
474
558
  })
475
559
  ]
476
560
  });
@@ -487,102 +571,110 @@ var STANDALONE_CONTEXTUAL_VALUE_NODE_KINDS = [
487
571
  "programIdValueNode",
488
572
  "resolverValueNode"
489
573
  ];
490
- var standaloneContextualValueNodeUnion = defineUnion("StandaloneContextualValueNode", {
491
- docs: "Every contextual-value node usable as a top-level value.",
574
+ var standaloneContextualValueNodeUnion = defineUnion("standaloneContextualValueNode", {
575
+ docs: ["Every contextual-value node usable as a top-level value."],
492
576
  members: [...STANDALONE_CONTEXTUAL_VALUE_NODE_KINDS]
493
577
  });
494
- var contextualValueNodeUnion = defineUnion("ContextualValueNode", {
495
- docs: "The composable form: any standalone contextual-value node.",
496
- members: [union("StandaloneContextualValueNode")]
578
+ var contextualValueNodeUnion = defineUnion("contextualValueNode", {
579
+ docs: ["The composable form: any standalone contextual-value node."],
580
+ members: [union("standaloneContextualValueNode")]
497
581
  });
498
- var registeredContextualValueNodeUnion = defineUnion("RegisteredContextualValueNode", {
499
- docs: "Every node tagged as a contextual-value node, including helper variants.",
500
- members: [union("StandaloneContextualValueNode"), "pdaSeedValueNode"]
582
+ var registeredContextualValueNodeUnion = defineUnion("registeredContextualValueNode", {
583
+ docs: ["Every node tagged as a contextual-value node, including helper variants."],
584
+ members: [union("standaloneContextualValueNode"), "pdaSeedValueNode"]
501
585
  });
502
- var instructionInputValueNodeUnion = defineUnion("InstructionInputValueNode", {
503
- docs: "Anything that can be used as the input value for an instruction account or argument default \u2014 a value, contextual reference, or program link.",
504
- members: [union("ContextualValueNode"), "programLinkNode", union("ValueNode")]
586
+ var instructionInputValueNodeUnion = defineUnion("instructionInputValueNode", {
587
+ docs: [
588
+ "Anything that can be used as the input value for an instruction account or argument default.",
589
+ "Covers concrete values, contextual references, and program links."
590
+ ],
591
+ members: [union("contextualValueNode"), "programLinkNode", union("valueNode")]
505
592
  });
506
- var conditionalValueConditionUnion = defineUnion("ConditionalValueCondition", {
507
- docs: "The condition forms accepted by a `conditionalValueNode`.",
593
+ var conditionalValueConditionUnion = defineUnion("conditionalValueCondition", {
594
+ docs: ["The condition forms accepted by a `conditionalValueNode`."],
508
595
  members: ["accountValueNode", "argumentValueNode", "resolverValueNode"]
509
596
  });
510
- var resolverDependencyUnion = defineUnion("ResolverDependency", {
511
- docs: "The dependency forms accepted by a `resolverValueNode`.",
597
+ var resolverDependencyUnion = defineUnion("resolverDependency", {
598
+ docs: ["The dependency forms accepted by a `resolverValueNode`."],
512
599
  members: ["accountValueNode", "argumentValueNode"]
513
600
  });
514
- var pdaSeedValueValueUnion = defineUnion("PdaSeedValueValue", {
515
- docs: "The value forms accepted by a `pdaSeedValueNode`.",
516
- members: ["accountValueNode", "argumentValueNode", union("ValueNode")]
601
+ var pdaSeedValueValueUnion = defineUnion("pdaSeedValueValue", {
602
+ docs: ["The value forms accepted by a `pdaSeedValueNode`."],
603
+ members: ["accountValueNode", "argumentValueNode", union("valueNode")]
517
604
  });
518
- var pdaValuePdaUnion = defineUnion("PdaValuePda", {
519
- docs: "A `pdaValueNode` may reference a PDA either by link or inline.",
605
+ var pdaValuePdaUnion = defineUnion("pdaValuePda", {
606
+ docs: ["A `pdaValueNode` may reference a PDA either by link or inline."],
520
607
  members: ["pdaLinkNode", "pdaNode"]
521
608
  });
522
- var pdaValueProgramIdUnion = defineUnion("PdaValueProgramId", {
523
- docs: "The program-id forms accepted by a `pdaValueNode`.",
609
+ var pdaValueProgramIdUnion = defineUnion("pdaValueProgramId", {
610
+ docs: ["The program-id forms accepted by a `pdaValueNode`."],
524
611
  members: ["accountValueNode", "argumentValueNode"]
525
612
  });
526
613
 
527
614
  // src/v1/nodes/contextualValueNodes/IdentityValueNode.ts
528
615
  var identityValueNode = defineNode("identityValueNode", {
529
- docs: "Refers to the wallet identity providing the instruction context.",
616
+ docs: ["Refers to the wallet identity providing the instruction context."],
530
617
  attributes: []
531
618
  });
532
619
 
533
620
  // src/v1/nodes/contextualValueNodes/PayerValueNode.ts
534
621
  var payerValueNode = defineNode("payerValueNode", {
535
- docs: "Refers to the wallet paying for the surrounding transaction.",
622
+ docs: ["Refers to the wallet paying for the surrounding transaction."],
536
623
  attributes: []
537
624
  });
538
625
 
539
626
  // src/v1/nodes/contextualValueNodes/PdaSeedValueNode.ts
540
627
  var pdaSeedValueNode = defineNode("pdaSeedValueNode", {
541
- docs: "Pairs a PDA seed name with the value to substitute when deriving the PDA.",
628
+ docs: ["Pairs a PDA seed name with the value to substitute when deriving the PDA."],
542
629
  attributes: [
543
630
  attribute("name", stringIdentifier(), {
544
- docs: "The name of the seed being filled in."
631
+ docs: ["The name of the seed being filled in."]
545
632
  }),
546
- attribute("value", union("PdaSeedValueValue"), {
547
- docs: "The value to substitute for the seed."
633
+ attribute("value", union("pdaSeedValueValue"), {
634
+ docs: ["The value to substitute for the seed."]
548
635
  })
549
636
  ]
550
637
  });
551
638
 
552
639
  // src/v1/nodes/contextualValueNodes/PdaValueNode.ts
553
640
  var pdaValueNode = defineNode("pdaValueNode", {
554
- docs: "Resolves to a PDA derived from a list of seed values.",
641
+ docs: ["Resolves to a PDA derived from a list of seed values."],
555
642
  attributes: [
556
- attribute("pda", union("PdaValuePda"), {
557
- docs: "The PDA being derived \u2014 either a link to a defined PDA or an inline `pdaNode`."
643
+ attribute("pda", union("pdaValuePda"), {
644
+ docs: ["The PDA being derived \u2014 either a link to a defined PDA or an inline `pdaNode`."]
558
645
  }),
559
- attribute("seeds", array(node("pdaSeedValueNode")), {
560
- docs: "The seed values used to derive the PDA, paired with their seed names."
646
+ optionalAttribute("seeds", array(node("pdaSeedValueNode")), {
647
+ docs: ["The seed values used to derive the PDA, paired with their seed names."]
561
648
  }),
562
- optionalAttribute("programId", union("PdaValueProgramId"), {
563
- docs: "The program ID used to derive the PDA. When omitted, the PDA\u2019s declared program is used."
649
+ optionalAttribute("programId", union("pdaValueProgramId"), {
650
+ docs: ["The program ID used to derive the PDA. When omitted, the PDA\u2019s declared program is used."]
564
651
  })
565
652
  ]
566
653
  });
567
654
 
568
655
  // src/v1/nodes/contextualValueNodes/ProgramIdValueNode.ts
569
656
  var programIdValueNode = defineNode("programIdValueNode", {
570
- docs: "Refers to the program ID of the surrounding instruction.",
657
+ docs: ["Refers to the program ID of the surrounding instruction."],
571
658
  attributes: []
572
659
  });
573
660
 
574
661
  // src/v1/nodes/contextualValueNodes/ResolverValueNode.ts
575
662
  var resolverValueNode = defineNode("resolverValueNode", {
576
- docs: "A custom resolver: a named function provided by the consumer that produces a value, optionally depending on other accounts and arguments.",
663
+ docs: [
664
+ "A custom resolver: a named function provided by the consumer that produces a value.",
665
+ "May optionally depend on other accounts and arguments resolved at instruction-build time."
666
+ ],
577
667
  attributes: [
578
668
  attribute("name", stringIdentifier(), {
579
- docs: "The name of the resolver function."
669
+ docs: ["The name of the resolver function."]
580
670
  }),
581
671
  optionalAttribute("docs", docs(), {
582
- docs: "Markdown documentation for the resolver."
672
+ docs: ["Markdown documentation for the resolver."]
583
673
  }),
584
- optionalAttribute("dependsOn", array(union("ResolverDependency")), {
585
- docs: "The accounts and arguments the resolver depends on. Used by clients to ensure the dependencies are resolved first."
674
+ optionalAttribute("dependsOn", array(union("resolverDependency")), {
675
+ docs: [
676
+ "The accounts and arguments the resolver depends on. Used by clients to ensure the dependencies are resolved first."
677
+ ]
586
678
  })
587
679
  ]
588
680
  });
@@ -613,38 +705,38 @@ var ALL_CONTEXTUAL_VALUE_NODE_UNIONS = [
613
705
  ];
614
706
 
615
707
  // src/v1/nodes/countNodes/CountNode.ts
616
- var registeredCountNodeUnion = defineUnion("RegisteredCountNode", {
617
- docs: "Every node tagged as a count strategy.",
708
+ var registeredCountNodeUnion = defineUnion("registeredCountNode", {
709
+ docs: ["Every node tagged as a count strategy."],
618
710
  members: ["fixedCountNode", "prefixedCountNode", "remainderCountNode"]
619
711
  });
620
- var countNodeUnion = defineUnion("CountNode", {
621
- docs: "The composable form: any registered count node.",
622
- members: [union("RegisteredCountNode")]
712
+ var countNodeUnion = defineUnion("countNode", {
713
+ docs: ["The composable form: any registered count node."],
714
+ members: [union("registeredCountNode")]
623
715
  });
624
716
 
625
717
  // src/v1/nodes/countNodes/FixedCountNode.ts
626
718
  var fixedCountNode = defineNode("fixedCountNode", {
627
- docs: "A count strategy that fixes the number of items at a constant value.",
719
+ docs: ["A count strategy that fixes the number of items at a constant value."],
628
720
  attributes: [
629
721
  attribute("value", u64(), {
630
- docs: "The fixed number of items."
722
+ docs: ["The fixed number of items."]
631
723
  })
632
724
  ]
633
725
  });
634
726
 
635
727
  // src/v1/nodes/countNodes/PrefixedCountNode.ts
636
728
  var prefixedCountNode = defineNode("prefixedCountNode", {
637
- docs: "A count strategy where the number of items is read from a numeric prefix.",
729
+ docs: ["A count strategy where the number of items is read from a numeric prefix."],
638
730
  attributes: [
639
- attribute("prefix", nestedTypeNode("numberTypeNode"), {
640
- docs: "The numeric type used as the count prefix."
731
+ attribute("prefix", nestedUnion("nestedTypeNode", "numberTypeNode"), {
732
+ docs: ["The numeric type used as the count prefix."]
641
733
  })
642
734
  ]
643
735
  });
644
736
 
645
737
  // src/v1/nodes/countNodes/RemainderCountNode.ts
646
738
  var remainderCountNode = defineNode("remainderCountNode", {
647
- docs: "A count strategy where items are read until the buffer is exhausted.",
739
+ docs: ["A count strategy where items are read until the buffer is exhausted."],
648
740
  attributes: []
649
741
  });
650
742
 
@@ -654,62 +746,62 @@ var ALL_COUNT_NODE_UNIONS = [registeredCountNodeUnion, countNodeUnion];
654
746
 
655
747
  // src/v1/nodes/DefinedTypeNode.ts
656
748
  var definedTypeNode = defineNode("definedTypeNode", {
657
- docs: "A reusable named type that can be referenced by `definedTypeLinkNode` from elsewhere in the IDL.",
749
+ docs: ["A reusable named type that can be referenced by `definedTypeLinkNode` from elsewhere in the IDL."],
658
750
  attributes: [
659
751
  attribute("name", stringIdentifier(), {
660
- docs: "The name of the defined type."
752
+ docs: ["The name of the defined type."]
661
753
  }),
662
754
  optionalAttribute("docs", docs(), {
663
- docs: "Markdown documentation for the type."
755
+ docs: ["Markdown documentation for the type."]
664
756
  }),
665
- attribute("type", union("TypeNode"), {
666
- docs: "The type definition."
757
+ attribute("type", union("typeNode"), {
758
+ docs: ["The type definition."]
667
759
  })
668
760
  ]
669
761
  });
670
762
 
671
763
  // src/v1/nodes/discriminatorNodes/ConstantDiscriminatorNode.ts
672
764
  var constantDiscriminatorNode = defineNode("constantDiscriminatorNode", {
673
- docs: "Identifies a node by a constant value at a known byte offset (e.g. a magic header).",
765
+ docs: ["Identifies a node by a constant value at a known byte offset (e.g. a magic header)."],
674
766
  attributes: [
675
767
  attribute("offset", u64(), {
676
- docs: "The byte offset at which the constant begins."
768
+ docs: ["The byte offset at which the constant begins."]
677
769
  }),
678
770
  attribute("constant", node("constantValueNode"), {
679
- docs: "The constant value expected at the offset."
771
+ docs: ["The constant value expected at the offset."]
680
772
  })
681
773
  ]
682
774
  });
683
775
 
684
776
  // src/v1/nodes/discriminatorNodes/DiscriminatorNode.ts
685
- var registeredDiscriminatorNodeUnion = defineUnion("RegisteredDiscriminatorNode", {
686
- docs: "Every node tagged as a discriminator strategy.",
777
+ var registeredDiscriminatorNodeUnion = defineUnion("registeredDiscriminatorNode", {
778
+ docs: ["Every node tagged as a discriminator strategy."],
687
779
  members: ["constantDiscriminatorNode", "fieldDiscriminatorNode", "sizeDiscriminatorNode"]
688
780
  });
689
- var discriminatorNodeUnion = defineUnion("DiscriminatorNode", {
690
- docs: "The composable form: any registered discriminator node.",
691
- members: [union("RegisteredDiscriminatorNode")]
781
+ var discriminatorNodeUnion = defineUnion("discriminatorNode", {
782
+ docs: ["The composable form: any registered discriminator node."],
783
+ members: [union("registeredDiscriminatorNode")]
692
784
  });
693
785
 
694
786
  // src/v1/nodes/discriminatorNodes/FieldDiscriminatorNode.ts
695
787
  var fieldDiscriminatorNode = defineNode("fieldDiscriminatorNode", {
696
- docs: "Identifies a node by the value of a named field at a known byte offset.",
788
+ docs: ["Identifies a node by the value of a named field at a known byte offset."],
697
789
  attributes: [
698
790
  attribute("name", stringIdentifier(), {
699
- docs: "The name of the discriminating field."
791
+ docs: ["The name of the discriminating field."]
700
792
  }),
701
793
  attribute("offset", u64(), {
702
- docs: "The byte offset of the field."
794
+ docs: ["The byte offset of the field."]
703
795
  })
704
796
  ]
705
797
  });
706
798
 
707
799
  // src/v1/nodes/discriminatorNodes/SizeDiscriminatorNode.ts
708
800
  var sizeDiscriminatorNode = defineNode("sizeDiscriminatorNode", {
709
- docs: "Identifies a node by its expected total byte size.",
801
+ docs: ["Identifies a node by its expected total byte size."],
710
802
  attributes: [
711
803
  attribute("size", u64(), {
712
- docs: "The expected byte size."
804
+ docs: ["The expected byte size."]
713
805
  })
714
806
  ]
715
807
  });
@@ -724,258 +816,287 @@ var ALL_DISCRIMINATOR_NODE_UNIONS = [registeredDiscriminatorNodeUnion, discrimin
724
816
 
725
817
  // src/v1/nodes/ErrorNode.ts
726
818
  var errorNode = defineNode("errorNode", {
727
- docs: "A program error \u2014 a numeric code paired with a name and human-readable message.",
819
+ docs: ["A program error \u2014 a numeric code paired with a name and human-readable message."],
728
820
  attributes: [
729
821
  attribute("name", stringIdentifier(), {
730
- docs: "The name of the error."
822
+ docs: ["The name of the error."]
731
823
  }),
732
824
  attribute("code", u32(), {
733
- docs: "The numeric error code returned by the program."
825
+ docs: ["The numeric error code returned by the program."]
734
826
  }),
735
827
  attribute("message", string(), {
736
- docs: "A human-readable description of the error."
828
+ docs: ["A human-readable description of the error."]
737
829
  }),
738
830
  optionalAttribute("docs", docs(), {
739
- docs: "Markdown documentation for the error."
831
+ docs: ["Markdown documentation for the error."]
740
832
  })
741
833
  ]
742
834
  });
743
835
 
744
836
  // src/v1/nodes/EventNode.ts
745
837
  var eventNode = defineNode("eventNode", {
746
- docs: "A program event: its data shape and optional discriminators used to identify it on the wire.",
838
+ docs: ["A program event: its data shape and optional discriminators used to identify it on the wire."],
747
839
  attributes: [
748
840
  attribute("name", stringIdentifier(), {
749
- docs: "The name of the event."
841
+ docs: ["The name of the event."]
750
842
  }),
751
843
  optionalAttribute("docs", docs(), {
752
- docs: "Markdown documentation for the event."
844
+ docs: ["Markdown documentation for the event."]
753
845
  }),
754
- attribute("data", union("TypeNode"), {
755
- docs: "The type describing the event payload."
846
+ attribute("data", union("typeNode"), {
847
+ docs: ["The type describing the event payload."]
756
848
  }),
757
- optionalAttribute("discriminators", array(union("DiscriminatorNode")), {
758
- docs: "Discriminators that distinguish this event from others. When multiple are listed, they are combined with a logical AND."
849
+ optionalAttribute("discriminators", array(union("discriminatorNode")), {
850
+ docs: [
851
+ "Discriminators that distinguish this event from others. When multiple are listed, they are combined with a logical AND."
852
+ ]
759
853
  })
760
854
  ]
761
855
  });
762
856
 
763
857
  // src/v1/nodes/InstructionAccountNode.ts
764
858
  var instructionAccountNode = defineNode("instructionAccountNode", {
765
- docs: "An account participating in an instruction, with its name, signing/writability flags, and an optional default value.",
859
+ docs: [
860
+ "An account participating in an instruction, with its name, signing/writability flags, and an optional default value."
861
+ ],
766
862
  attributes: [
767
863
  attribute("name", stringIdentifier(), {
768
- docs: "The name of the account."
864
+ docs: ["The name of the account."]
769
865
  }),
770
866
  attribute("isWritable", boolean(), {
771
- docs: "Whether the instruction may write to the account."
867
+ docs: ["Whether the instruction may write to the account."]
772
868
  }),
773
869
  attribute("isSigner", literalUnion(true, false, "either"), {
774
- docs: 'Whether the account must sign the transaction. The literal `"either"` indicates a slot that may or may not sign depending on context.'
870
+ docs: [
871
+ "Whether the account must sign the transaction.",
872
+ 'The literal `"either"` indicates a slot that may or may not sign depending on context.'
873
+ ]
775
874
  }),
776
875
  optionalAttribute("isOptional", boolean(), {
777
- docs: "Whether the account slot may be omitted by callers."
876
+ docs: ["Whether the account slot may be omitted by callers."]
778
877
  }),
779
878
  optionalAttribute("docs", docs(), {
780
- docs: "Markdown documentation for the account slot."
879
+ docs: ["Markdown documentation for the account slot."]
781
880
  }),
782
- optionalAttribute("defaultValue", union("InstructionInputValueNode"), {
783
- docs: "A default value used to fill the slot when the caller does not provide one."
881
+ optionalAttribute("defaultValue", union("instructionInputValueNode"), {
882
+ docs: ["A default value used to fill the slot when the caller does not provide one."]
784
883
  })
785
884
  ]
786
885
  });
787
886
 
788
887
  // src/v1/nodes/InstructionArgumentNode.ts
789
888
  var instructionArgumentNode = defineNode("instructionArgumentNode", {
790
- docs: "A named argument of an instruction, with its type and an optional default value.",
889
+ docs: ["A named argument of an instruction, with its type and an optional default value."],
791
890
  attributes: [
792
891
  attribute("name", stringIdentifier(), {
793
- docs: "The name of the argument."
892
+ docs: ["The name of the argument."]
794
893
  }),
795
- optionalAttribute("defaultValueStrategy", enumeration("DefaultValueStrategy"), {
796
- docs: "How a configured default value is exposed in generated APIs. Required when `defaultValue` is set."
894
+ optionalAttribute("defaultValueStrategy", enumeration("defaultValueStrategy"), {
895
+ docs: ["How a configured default value is exposed in generated APIs. Required when `defaultValue` is set."]
797
896
  }),
798
897
  optionalAttribute("docs", docs(), {
799
- docs: "Markdown documentation for the argument."
898
+ docs: ["Markdown documentation for the argument."]
800
899
  }),
801
- attribute("type", union("TypeNode"), {
802
- docs: "The type of the argument."
900
+ attribute("type", union("typeNode"), {
901
+ docs: ["The type of the argument."]
803
902
  }),
804
- optionalAttribute("defaultValue", union("InstructionInputValueNode"), {
805
- docs: "A default value used when the argument is omitted by callers."
903
+ optionalAttribute("defaultValue", union("instructionInputValueNode"), {
904
+ docs: ["A default value used when the argument is omitted by callers."]
806
905
  })
807
906
  ]
808
907
  });
809
908
 
810
909
  // src/v1/nodes/InstructionByteDeltaNode.ts
811
910
  var instructionByteDeltaNode = defineNode("instructionByteDeltaNode", {
812
- docs: "A byte-size delta applied when computing rent or buffer size \u2014 typically used by instructions that resize accounts.",
911
+ docs: [
912
+ "A byte-size delta applied when computing rent or buffer size \u2014 typically used by instructions that resize accounts."
913
+ ],
813
914
  attributes: [
814
915
  attribute("withHeader", boolean(), {
815
- docs: "Whether the delta includes the account header overhead."
916
+ docs: ["Whether the delta includes the account header overhead."]
816
917
  }),
817
918
  optionalAttribute("subtract", boolean(), {
818
- docs: "When `true`, the delta is subtracted from the running size instead of added. Defaults to `false`."
919
+ docs: ["When `true`, the delta is subtracted from the running size instead of added. Defaults to `false`."]
819
920
  }),
820
- attribute("value", union("InstructionByteDeltaValue"), {
821
- docs: "The source of the delta value \u2014 a literal number, a referenced account or argument, or a resolver."
921
+ attribute("value", union("instructionByteDeltaValue"), {
922
+ docs: [
923
+ "The source of the delta value \u2014 a literal number, a referenced account or argument, or a resolver."
924
+ ]
822
925
  })
823
926
  ]
824
927
  });
825
928
 
826
929
  // src/v1/nodes/InstructionNode.ts
827
930
  var instructionNode = defineNode("instructionNode", {
828
- docs: "A program instruction: its accounts, arguments, byte-delta hints, discriminators, optional status, and optional sub-instructions.",
931
+ docs: [
932
+ "A program instruction: its accounts, arguments, byte-delta hints, discriminators, optional status, and optional sub-instructions."
933
+ ],
829
934
  attributes: [
830
935
  attribute("name", stringIdentifier(), {
831
- docs: "The name of the instruction."
936
+ docs: ["The name of the instruction."]
832
937
  }),
833
938
  optionalAttribute("docs", docs(), {
834
- docs: "Markdown documentation for the instruction."
939
+ docs: ["Markdown documentation for the instruction."]
835
940
  }),
836
- optionalAttribute("optionalAccountStrategy", enumeration("OptionalAccountStrategy"), {
837
- docs: "How absent optional accounts are represented when serialising the instruction."
941
+ optionalAttribute("optionalAccountStrategy", enumeration("optionalAccountStrategy"), {
942
+ docs: ["How absent optional accounts are represented when serialising the instruction."]
838
943
  }),
839
- attribute("accounts", array(node("instructionAccountNode")), {
840
- docs: "The accounts the instruction operates on, in order."
944
+ optionalAttribute("accounts", array(node("instructionAccountNode")), {
945
+ docs: ["The accounts the instruction operates on, in order."]
841
946
  }),
842
- attribute("arguments", array(node("instructionArgumentNode")), {
843
- docs: "The serialised arguments of the instruction, in order."
947
+ optionalAttribute("arguments", array(node("instructionArgumentNode")), {
948
+ docs: ["The serialised arguments of the instruction, in order."]
844
949
  }),
845
950
  optionalAttribute("extraArguments", array(node("instructionArgumentNode")), {
846
- docs: "Additional arguments exposed in the generated client API but not serialised on the wire."
951
+ docs: ["Additional arguments exposed in the generated client API but not serialised on the wire."]
847
952
  }),
848
953
  optionalAttribute("remainingAccounts", array(node("instructionRemainingAccountsNode")), {
849
- docs: "Variable-length tails of accounts appended after the named account slots."
954
+ docs: ["Variable-length tails of accounts appended after the named account slots."]
850
955
  }),
851
956
  optionalAttribute("byteDeltas", array(node("instructionByteDeltaNode")), {
852
- docs: "Byte-size adjustments applied when computing rent or buffer size \u2014 for instructions that resize accounts."
957
+ docs: [
958
+ "Byte-size adjustments applied when computing rent or buffer size \u2014 for instructions that resize accounts."
959
+ ]
853
960
  }),
854
- optionalAttribute("discriminators", array(union("DiscriminatorNode")), {
855
- docs: "Discriminators that distinguish this instruction from others. When multiple are listed, they are combined with a logical AND."
961
+ optionalAttribute("discriminators", array(union("discriminatorNode")), {
962
+ docs: [
963
+ "Discriminators that distinguish this instruction from others.",
964
+ "When multiple are listed, they are combined with a logical AND."
965
+ ]
856
966
  }),
857
967
  optionalAttribute("status", node("instructionStatusNode"), {
858
- docs: "The lifecycle status of the instruction."
968
+ docs: ["The lifecycle status of the instruction."]
859
969
  }),
860
970
  optionalAttribute("subInstructions", array(node("instructionNode")), {
861
- docs: "Inner instructions invoked through CPI as part of executing this instruction."
971
+ docs: ["Inner instructions invoked through CPI as part of executing this instruction."]
862
972
  })
863
973
  ]
864
974
  });
865
975
 
866
976
  // src/v1/nodes/InstructionNodeUnions.ts
867
- var instructionByteDeltaValueUnion = defineUnion("InstructionByteDeltaValue", {
868
- docs: "The value forms accepted by an `instructionByteDeltaNode`.",
977
+ var instructionByteDeltaValueUnion = defineUnion("instructionByteDeltaValue", {
978
+ docs: ["The value forms accepted by an `instructionByteDeltaNode`."],
869
979
  members: ["accountLinkNode", "argumentValueNode", "numberValueNode", "resolverValueNode"]
870
980
  });
871
- var instructionRemainingAccountsValueUnion = defineUnion("InstructionRemainingAccountsValue", {
872
- docs: "The value forms accepted by an `instructionRemainingAccountsNode`.",
981
+ var instructionRemainingAccountsValueUnion = defineUnion("instructionRemainingAccountsValue", {
982
+ docs: ["The value forms accepted by an `instructionRemainingAccountsNode`."],
873
983
  members: ["argumentValueNode", "resolverValueNode"]
874
984
  });
875
985
 
876
986
  // src/v1/nodes/InstructionRemainingAccountsNode.ts
877
987
  var instructionRemainingAccountsNode = defineNode("instructionRemainingAccountsNode", {
878
- docs: 'A "remaining accounts" slot in an instruction \u2014 a variable-length tail of accounts derived from a value.',
988
+ docs: ['A "remaining accounts" slot in an instruction \u2014 a variable-length tail of accounts derived from a value.'],
879
989
  attributes: [
880
990
  optionalAttribute("isOptional", boolean(), {
881
- docs: "Whether the remaining-accounts tail may be empty."
991
+ docs: ["Whether the remaining-accounts tail may be empty."]
882
992
  }),
883
993
  optionalAttribute("isSigner", literalUnion(true, false, "either"), {
884
- docs: 'Whether each remaining account must sign the transaction. The literal `"either"` indicates a slot that may or may not sign depending on context.'
994
+ docs: [
995
+ "Whether each remaining account must sign the transaction.",
996
+ 'The literal `"either"` indicates a slot that may or may not sign depending on context.'
997
+ ]
885
998
  }),
886
999
  optionalAttribute("isWritable", boolean(), {
887
- docs: "Whether the instruction may write to each remaining account."
1000
+ docs: ["Whether the instruction may write to each remaining account."]
888
1001
  }),
889
1002
  optionalAttribute("docs", docs(), {
890
- docs: "Markdown documentation for the remaining-accounts slot."
1003
+ docs: ["Markdown documentation for the remaining-accounts slot."]
891
1004
  }),
892
- attribute("value", union("InstructionRemainingAccountsValue"), {
893
- docs: "The source of the remaining-accounts list \u2014 a referenced argument or a resolver."
1005
+ attribute("value", union("instructionRemainingAccountsValue"), {
1006
+ docs: ["The source of the remaining-accounts list \u2014 a referenced argument or a resolver."]
894
1007
  })
895
1008
  ]
896
1009
  });
897
1010
 
898
1011
  // src/v1/nodes/InstructionStatusNode.ts
899
1012
  var instructionStatusNode = defineNode("instructionStatusNode", {
900
- docs: "The lifecycle stage of an instruction (draft, live, deprecated, archived) with an optional accompanying message.",
1013
+ docs: [
1014
+ "The lifecycle stage of an instruction (draft, live, deprecated, archived) with an optional accompanying message."
1015
+ ],
901
1016
  attributes: [
902
- attribute("lifecycle", enumeration("InstructionLifecycle"), {
903
- docs: "The lifecycle stage."
1017
+ attribute("lifecycle", enumeration("instructionLifecycle"), {
1018
+ docs: ["The lifecycle stage."]
904
1019
  }),
905
1020
  optionalAttribute("message", string(), {
906
- docs: "Free-form prose accompanying the status \u2014 e.g. a deprecation notice with migration guidance."
1021
+ docs: ["Free-form prose accompanying the status \u2014 e.g. a deprecation notice with migration guidance."]
907
1022
  })
908
1023
  ]
909
1024
  });
910
1025
 
911
1026
  // src/v1/nodes/linkNodes/AccountLinkNode.ts
912
1027
  var accountLinkNode = defineNode("accountLinkNode", {
913
- docs: "A reference to an account defined elsewhere \u2014 possibly in a different program.",
1028
+ docs: ["A reference to an account defined elsewhere \u2014 possibly in a different program."],
914
1029
  attributes: [
915
1030
  optionalAttribute("program", node("programLinkNode"), {
916
- docs: "The program the referenced account belongs to. When omitted, the surrounding program is assumed."
1031
+ docs: ["The program the referenced account belongs to. When omitted, the surrounding program is assumed."]
917
1032
  }),
918
1033
  attribute("name", stringIdentifier(), {
919
- docs: "The name of the referenced account."
1034
+ docs: ["The name of the referenced account."]
920
1035
  })
921
1036
  ]
922
1037
  });
923
1038
 
924
1039
  // src/v1/nodes/linkNodes/DefinedTypeLinkNode.ts
925
1040
  var definedTypeLinkNode = defineNode("definedTypeLinkNode", {
926
- docs: "A reference to a defined type \u2014 possibly in a different program.",
1041
+ docs: ["A reference to a defined type \u2014 possibly in a different program."],
927
1042
  attributes: [
928
1043
  optionalAttribute("program", node("programLinkNode"), {
929
- docs: "The program the referenced type is defined in. When omitted, the surrounding program is assumed."
1044
+ docs: ["The program the referenced type is defined in. When omitted, the surrounding program is assumed."]
930
1045
  }),
931
1046
  attribute("name", stringIdentifier(), {
932
- docs: "The name of the referenced defined type."
1047
+ docs: ["The name of the referenced defined type."]
933
1048
  })
934
1049
  ]
935
1050
  });
936
1051
 
937
1052
  // src/v1/nodes/linkNodes/InstructionAccountLinkNode.ts
938
1053
  var instructionAccountLinkNode = defineNode("instructionAccountLinkNode", {
939
- docs: "A reference to an account of another instruction.",
1054
+ docs: ["A reference to an account of another instruction."],
940
1055
  attributes: [
941
1056
  optionalAttribute("instruction", node("instructionLinkNode"), {
942
- docs: "The instruction the referenced account belongs to. When omitted, the surrounding instruction is assumed."
1057
+ docs: [
1058
+ "The instruction the referenced account belongs to. When omitted, the surrounding instruction is assumed."
1059
+ ]
943
1060
  }),
944
1061
  attribute("name", stringIdentifier(), {
945
- docs: "The name of the referenced instruction account."
1062
+ docs: ["The name of the referenced instruction account."]
946
1063
  })
947
1064
  ]
948
1065
  });
949
1066
 
950
1067
  // src/v1/nodes/linkNodes/InstructionArgumentLinkNode.ts
951
1068
  var instructionArgumentLinkNode = defineNode("instructionArgumentLinkNode", {
952
- docs: "A reference to an argument of another instruction.",
1069
+ docs: ["A reference to an argument of another instruction."],
953
1070
  attributes: [
954
1071
  optionalAttribute("instruction", node("instructionLinkNode"), {
955
- docs: "The instruction the referenced argument belongs to. When omitted, the surrounding instruction is assumed."
1072
+ docs: [
1073
+ "The instruction the referenced argument belongs to. When omitted, the surrounding instruction is assumed."
1074
+ ]
956
1075
  }),
957
1076
  attribute("name", stringIdentifier(), {
958
- docs: "The name of the referenced instruction argument."
1077
+ docs: ["The name of the referenced instruction argument."]
959
1078
  })
960
1079
  ]
961
1080
  });
962
1081
 
963
1082
  // src/v1/nodes/linkNodes/InstructionLinkNode.ts
964
1083
  var instructionLinkNode = defineNode("instructionLinkNode", {
965
- docs: "A reference to an instruction defined elsewhere \u2014 possibly in a different program.",
1084
+ docs: ["A reference to an instruction defined elsewhere \u2014 possibly in a different program."],
966
1085
  attributes: [
967
1086
  optionalAttribute("program", node("programLinkNode"), {
968
- docs: "The program the referenced instruction belongs to. When omitted, the surrounding program is assumed."
1087
+ docs: [
1088
+ "The program the referenced instruction belongs to. When omitted, the surrounding program is assumed."
1089
+ ]
969
1090
  }),
970
1091
  attribute("name", stringIdentifier(), {
971
- docs: "The name of the referenced instruction."
1092
+ docs: ["The name of the referenced instruction."]
972
1093
  })
973
1094
  ]
974
1095
  });
975
1096
 
976
1097
  // src/v1/nodes/linkNodes/LinkNode.ts
977
- var registeredLinkNodeUnion = defineUnion("RegisteredLinkNode", {
978
- docs: "Every node tagged as a link to another part of the IDL.",
1098
+ var registeredLinkNodeUnion = defineUnion("registeredLinkNode", {
1099
+ docs: ["Every node tagged as a link to another part of the IDL."],
979
1100
  members: [
980
1101
  "accountLinkNode",
981
1102
  "definedTypeLinkNode",
@@ -986,30 +1107,30 @@ var registeredLinkNodeUnion = defineUnion("RegisteredLinkNode", {
986
1107
  "programLinkNode"
987
1108
  ]
988
1109
  });
989
- var linkNodeUnion = defineUnion("LinkNode", {
990
- docs: "The composable form: any registered link node.",
991
- members: [union("RegisteredLinkNode")]
1110
+ var linkNodeUnion = defineUnion("linkNode", {
1111
+ docs: ["The composable form: any registered link node."],
1112
+ members: [union("registeredLinkNode")]
992
1113
  });
993
1114
 
994
1115
  // src/v1/nodes/linkNodes/PdaLinkNode.ts
995
1116
  var pdaLinkNode = defineNode("pdaLinkNode", {
996
- docs: "A reference to a PDA defined elsewhere \u2014 possibly in a different program.",
1117
+ docs: ["A reference to a PDA defined elsewhere \u2014 possibly in a different program."],
997
1118
  attributes: [
998
1119
  optionalAttribute("program", node("programLinkNode"), {
999
- docs: "The program the referenced PDA belongs to. When omitted, the surrounding program is assumed."
1120
+ docs: ["The program the referenced PDA belongs to. When omitted, the surrounding program is assumed."]
1000
1121
  }),
1001
1122
  attribute("name", stringIdentifier(), {
1002
- docs: "The name of the referenced PDA."
1123
+ docs: ["The name of the referenced PDA."]
1003
1124
  })
1004
1125
  ]
1005
1126
  });
1006
1127
 
1007
1128
  // src/v1/nodes/linkNodes/ProgramLinkNode.ts
1008
1129
  var programLinkNode = defineNode("programLinkNode", {
1009
- docs: "A reference to a program by name.",
1130
+ docs: ["A reference to a program by name."],
1010
1131
  attributes: [
1011
1132
  attribute("name", stringIdentifier(), {
1012
- docs: "The name of the referenced program."
1133
+ docs: ["The name of the referenced program."]
1013
1134
  })
1014
1135
  ]
1015
1136
  });
@@ -1028,62 +1149,64 @@ var ALL_LINK_NODE_UNIONS = [registeredLinkNodeUnion, linkNodeUnion];
1028
1149
 
1029
1150
  // src/v1/nodes/PdaNode.ts
1030
1151
  var pdaNode = defineNode("pdaNode", {
1031
- docs: "A program-derived address: its name, optional program ID override, and the seeds used to derive it.",
1152
+ docs: ["A program-derived address: its name, optional program ID override, and the seeds used to derive it."],
1032
1153
  attributes: [
1033
1154
  attribute("name", stringIdentifier(), {
1034
- docs: "The name of the PDA."
1155
+ docs: ["The name of the PDA."]
1035
1156
  }),
1036
1157
  optionalAttribute("docs", docs(), {
1037
- docs: "Markdown documentation for the PDA."
1158
+ docs: ["Markdown documentation for the PDA."]
1038
1159
  }),
1039
- optionalAttribute("programId", string(), {
1040
- docs: "The base58-encoded program ID used to derive the PDA. When omitted, the surrounding program is assumed."
1160
+ optionalAttribute("programId", address(), {
1161
+ docs: [
1162
+ "The base58-encoded program ID used to derive the PDA. When omitted, the surrounding program is assumed."
1163
+ ]
1041
1164
  }),
1042
- attribute("seeds", array(union("PdaSeedNode")), {
1043
- docs: "The seeds used to derive the PDA, in order."
1165
+ optionalAttribute("seeds", array(union("pdaSeedNode")), {
1166
+ docs: ["The seeds used to derive the PDA, in order."]
1044
1167
  })
1045
1168
  ]
1046
1169
  });
1047
1170
 
1048
1171
  // src/v1/nodes/pdaSeedNodes/ConstantPdaSeedNode.ts
1049
1172
  var constantPdaSeedNode = defineNode("constantPdaSeedNode", {
1050
- docs: "A PDA seed with a constant value (e.g. a UTF-8 string or a fixed byte sequence).",
1173
+ docs: ["A PDA seed with a constant value (e.g. a UTF-8 string or a fixed byte sequence)."],
1051
1174
  attributes: [
1052
- attribute("type", union("TypeNode"), {
1053
- docs: "The type of the seed value."
1175
+ attribute("type", union("typeNode"), {
1176
+ docs: ["The type of the seed value."]
1054
1177
  }),
1055
- attribute("value", union("ConstantPdaSeedValue"), {
1056
- docs: "The constant value to use as the seed \u2014 either a literal value or the program ID placeholder."
1178
+ attribute("value", union("constantPdaSeedValue"), {
1179
+ docs: ["The constant value to use as the seed \u2014 either a literal value or the program ID placeholder."]
1057
1180
  })
1058
1181
  ]
1059
1182
  });
1060
1183
 
1061
1184
  // src/v1/nodes/pdaSeedNodes/PdaSeedNode.ts
1062
- var registeredPdaSeedNodeUnion = defineUnion("RegisteredPdaSeedNode", {
1063
- docs: "Every node tagged as a PDA seed.",
1185
+ var registeredPdaSeedNodeUnion = defineUnion("registeredPdaSeedNode", {
1186
+ docs: ["Every node tagged as a PDA seed."],
1064
1187
  members: ["constantPdaSeedNode", "variablePdaSeedNode"]
1065
1188
  });
1066
- var pdaSeedNodeUnion = defineUnion("PdaSeedNode", {
1067
- docs: "The composable form: any registered PDA seed node.",
1068
- members: [union("RegisteredPdaSeedNode")]
1189
+ var pdaSeedNodeUnion = defineUnion("pdaSeedNode", {
1190
+ docs: ["The composable form: any registered PDA seed node."],
1191
+ members: [union("registeredPdaSeedNode")]
1069
1192
  });
1070
- var constantPdaSeedValueUnion = defineUnion("ConstantPdaSeedValue", {
1071
- docs: "The value forms a `constantPdaSeedNode` may carry \u2014 either a literal value or the program ID placeholder.",
1072
- members: ["programIdValueNode", union("ValueNode")]
1193
+ var constantPdaSeedValueUnion = defineUnion("constantPdaSeedValue", {
1194
+ docs: ["The value forms a `constantPdaSeedNode` may carry \u2014 either a literal value or the program ID placeholder."],
1195
+ members: ["programIdValueNode", union("valueNode")]
1073
1196
  });
1074
1197
 
1075
1198
  // src/v1/nodes/pdaSeedNodes/VariablePdaSeedNode.ts
1076
1199
  var variablePdaSeedNode = defineNode("variablePdaSeedNode", {
1077
- docs: "A PDA seed whose value is provided at derivation time, identified by name.",
1200
+ docs: ["A PDA seed whose value is provided at derivation time, identified by name."],
1078
1201
  attributes: [
1079
1202
  attribute("name", stringIdentifier(), {
1080
- docs: "The name of the seed variable."
1203
+ docs: ["The name of the seed variable."]
1081
1204
  }),
1082
1205
  optionalAttribute("docs", docs(), {
1083
- docs: "Markdown documentation for the seed variable."
1206
+ docs: ["Markdown documentation for the seed variable."]
1084
1207
  }),
1085
- attribute("type", union("TypeNode"), {
1086
- docs: "The expected type of the seed value."
1208
+ attribute("type", union("typeNode"), {
1209
+ docs: ["The expected type of the seed value."]
1087
1210
  })
1088
1211
  ]
1089
1212
  });
@@ -1098,408 +1221,456 @@ var ALL_PDA_SEED_NODE_UNIONS = [
1098
1221
 
1099
1222
  // src/v1/nodes/ProgramNode.ts
1100
1223
  var programNode = defineNode("programNode", {
1101
- docs: "A Solana program: its identity, version, accounts, instructions, defined types, PDAs, events, errors, and constants.",
1224
+ docs: [
1225
+ "A Solana program: its identity, version, accounts, instructions, defined types, PDAs, events, errors, and constants."
1226
+ ],
1102
1227
  attributes: [
1103
1228
  attribute("name", stringIdentifier(), {
1104
- docs: "The name of the program."
1229
+ docs: ["The name of the program."]
1105
1230
  }),
1106
- attribute("publicKey", string(), {
1107
- docs: "The base58-encoded program ID."
1231
+ attribute("publicKey", address(), {
1232
+ docs: ["The base58-encoded program ID."]
1108
1233
  }),
1109
1234
  attribute("version", stringVersion(), {
1110
- docs: "The version of the program, in semver form."
1235
+ docs: ["The version of the program, in semver form."]
1111
1236
  }),
1112
- optionalAttribute("origin", enumeration("ProgramOrigin"), {
1113
- docs: "The toolchain that originally generated the program description, if known."
1237
+ optionalAttribute("origin", enumeration("programOrigin"), {
1238
+ docs: ["The toolchain that originally generated the program description, if known."]
1114
1239
  }),
1115
1240
  optionalAttribute("docs", docs(), {
1116
- docs: "Markdown documentation for the program."
1241
+ docs: ["Markdown documentation for the program."]
1117
1242
  }),
1118
- attribute("accounts", array(node("accountNode")), {
1119
- docs: "The accounts owned by the program."
1243
+ optionalAttribute("accounts", array(node("accountNode")), {
1244
+ docs: ["The accounts owned by the program."]
1120
1245
  }),
1121
- attribute("instructions", array(node("instructionNode")), {
1122
- docs: "The instructions exposed by the program."
1246
+ optionalAttribute("instructions", array(node("instructionNode")), {
1247
+ docs: ["The instructions exposed by the program."]
1123
1248
  }),
1124
- attribute("definedTypes", array(node("definedTypeNode")), {
1125
- docs: "The reusable types defined by the program."
1249
+ optionalAttribute("definedTypes", array(node("definedTypeNode")), {
1250
+ docs: ["The reusable types defined by the program."]
1126
1251
  }),
1127
- attribute("pdas", array(node("pdaNode")), {
1128
- docs: "The PDAs derived by the program."
1252
+ optionalAttribute("pdas", array(node("pdaNode")), {
1253
+ docs: ["The PDAs derived by the program."]
1129
1254
  }),
1130
- attribute("events", array(node("eventNode")), {
1131
- docs: "The events emitted by the program."
1255
+ optionalAttribute("events", array(node("eventNode")), {
1256
+ docs: ["The events emitted by the program."]
1132
1257
  }),
1133
- attribute("errors", array(node("errorNode")), {
1134
- docs: "The errors returned by the program."
1258
+ optionalAttribute("errors", array(node("errorNode")), {
1259
+ docs: ["The errors returned by the program."]
1135
1260
  }),
1136
- attribute("constants", array(node("constantNode")), {
1137
- docs: "The constants exposed by the program."
1261
+ optionalAttribute("constants", array(node("constantNode")), {
1262
+ docs: ["The constants exposed by the program."]
1138
1263
  })
1139
1264
  ]
1140
1265
  });
1141
1266
 
1142
1267
  // src/v1/nodes/RootNode.ts
1143
1268
  var rootNode = defineNode("rootNode", {
1144
- docs: "The root of a Codama IDL document. Pairs a primary program with any number of additional programs and tags the document with the spec version.",
1269
+ docs: [
1270
+ "The root of a Codama IDL document.",
1271
+ "Pairs a primary program with any number of additional programs and tags the document with the spec version."
1272
+ ],
1145
1273
  attributes: [
1146
1274
  attribute("standard", literal("codama"), {
1147
- docs: "A literal marker identifying the document as a Codama IDL."
1275
+ docs: ["A literal marker identifying the document as a Codama IDL."]
1148
1276
  }),
1149
1277
  attribute("version", codamaVersion(), {
1150
- docs: "The Codama spec version this document conforms to."
1278
+ docs: ["The Codama spec version this document conforms to."]
1151
1279
  }),
1152
1280
  attribute("program", node("programNode"), {
1153
- docs: "The primary program described by the document."
1281
+ docs: ["The primary program described by the document."]
1154
1282
  }),
1155
- attribute("additionalPrograms", array(node("programNode")), {
1156
- docs: "Additional programs referenced by the primary program."
1283
+ optionalAttribute("additionalPrograms", array(node("programNode")), {
1284
+ docs: ["Additional programs referenced by the primary program."]
1157
1285
  })
1158
1286
  ]
1159
1287
  });
1160
1288
 
1161
1289
  // src/v1/nodes/typeNodes/AmountTypeNode.ts
1162
1290
  var amountTypeNode = defineNode("amountTypeNode", {
1163
- docs: "Wraps a number type to provide additional context such as decimal places and a unit. Useful for amounts representing financial values.",
1291
+ docs: [
1292
+ "Wraps a number type to provide additional context such as decimal places and a unit.",
1293
+ "Useful for amounts representing financial values."
1294
+ ],
1164
1295
  attributes: [
1165
1296
  attribute("decimals", u32(), {
1166
- docs: "The number of decimal places the wrapped integer carries. For example, an integer value of 12345 with 2 decimal places represents 123.45."
1297
+ docs: [
1298
+ "The number of decimal places the wrapped integer carries.",
1299
+ "For example, an integer value of 12345 with 2 decimal places represents 123.45."
1300
+ ]
1167
1301
  }),
1168
1302
  optionalAttribute("unit", string(), {
1169
- docs: 'The unit of the amount \u2014 e.g. "USD" or "%".'
1303
+ docs: ['The unit of the amount \u2014 e.g. "USD" or "%".']
1170
1304
  }),
1171
- attribute("number", nestedTypeNode("numberTypeNode"), {
1172
- docs: "The number type the amount wraps."
1305
+ attribute("number", nestedUnion("nestedTypeNode", "numberTypeNode"), {
1306
+ docs: ["The number type the amount wraps."]
1173
1307
  })
1174
1308
  ]
1175
1309
  });
1176
1310
 
1177
1311
  // src/v1/nodes/typeNodes/ArrayTypeNode.ts
1178
1312
  var arrayTypeNode = defineNode("arrayTypeNode", {
1179
- docs: "A homogeneous list of items. The item type is defined by `item`; the length is determined by the `count` strategy.",
1313
+ docs: [
1314
+ "A homogeneous list of items. The item type is defined by `item`; the length is determined by the `count` strategy."
1315
+ ],
1180
1316
  attributes: [
1181
- attribute("item", union("TypeNode"), {
1182
- docs: "The type of each item in the array."
1317
+ attribute("item", union("typeNode"), {
1318
+ docs: ["The type of each item in the array."]
1183
1319
  }),
1184
- attribute("count", union("CountNode"), {
1185
- docs: "The strategy used to determine the number of items."
1320
+ attribute("count", union("countNode"), {
1321
+ docs: ["The strategy used to determine the number of items."]
1186
1322
  })
1187
1323
  ]
1188
1324
  });
1189
1325
 
1190
1326
  // src/v1/nodes/typeNodes/BooleanTypeNode.ts
1191
1327
  var booleanTypeNode = defineNode("booleanTypeNode", {
1192
- docs: "A boolean serialised as a numeric value. The wrapped number type determines the byte width.",
1328
+ docs: ["A boolean serialised as a numeric value. The wrapped number type determines the byte width."],
1193
1329
  attributes: [
1194
- attribute("size", nestedTypeNode("numberTypeNode"), {
1195
- docs: "The numeric type used to serialise the boolean."
1330
+ attribute("size", nestedUnion("nestedTypeNode", "numberTypeNode"), {
1331
+ docs: ["The numeric type used to serialise the boolean."]
1196
1332
  })
1197
1333
  ]
1198
1334
  });
1199
1335
 
1200
1336
  // src/v1/nodes/typeNodes/BytesTypeNode.ts
1201
1337
  var bytesTypeNode = defineNode("bytesTypeNode", {
1202
- docs: "A raw sequence of bytes. Typically used inside a fixed-size, size-prefixed, or sentinel-terminated wrapper.",
1338
+ docs: [
1339
+ "A raw sequence of bytes. Typically used inside a fixed-size, size-prefixed, or sentinel-terminated wrapper."
1340
+ ],
1203
1341
  attributes: []
1204
1342
  });
1205
1343
 
1206
1344
  // src/v1/nodes/typeNodes/DateTimeTypeNode.ts
1207
1345
  var dateTimeTypeNode = defineNode("dateTimeTypeNode", {
1208
- docs: "A timestamp encoded as a number, typically seconds since the Unix epoch. The wrapped number type determines the byte width.",
1346
+ docs: [
1347
+ "A timestamp encoded as a number, typically seconds since the Unix epoch. The wrapped number type determines the byte width."
1348
+ ],
1209
1349
  attributes: [
1210
- attribute("number", nestedTypeNode("numberTypeNode"), {
1211
- docs: "The numeric type used to serialise the timestamp."
1350
+ attribute("number", nestedUnion("nestedTypeNode", "numberTypeNode"), {
1351
+ docs: ["The numeric type used to serialise the timestamp."]
1212
1352
  })
1213
1353
  ]
1214
1354
  });
1215
1355
 
1216
1356
  // src/v1/nodes/typeNodes/EnumEmptyVariantTypeNode.ts
1217
1357
  var enumEmptyVariantTypeNode = defineNode("enumEmptyVariantTypeNode", {
1218
- docs: "A unit-style variant of an enum that carries no payload.",
1358
+ docs: ["A unit-style variant of an enum that carries no payload."],
1219
1359
  attributes: [
1220
1360
  attribute("name", stringIdentifier(), {
1221
- docs: "The name of the variant."
1361
+ docs: ["The name of the variant."]
1222
1362
  }),
1223
1363
  optionalAttribute("discriminator", u32(), {
1224
- docs: "Explicit discriminator value. When omitted, the discriminator is inferred from the variant position."
1364
+ docs: [
1365
+ "Explicit discriminator value. When omitted, the discriminator is inferred from the variant position."
1366
+ ]
1225
1367
  })
1226
1368
  ]
1227
1369
  });
1228
1370
 
1229
1371
  // src/v1/nodes/typeNodes/EnumStructVariantTypeNode.ts
1230
1372
  var enumStructVariantTypeNode = defineNode("enumStructVariantTypeNode", {
1231
- docs: "A variant of an enum that carries a struct payload (named fields).",
1373
+ docs: ["A variant of an enum that carries a struct payload (named fields)."],
1232
1374
  attributes: [
1233
1375
  attribute("name", stringIdentifier(), {
1234
- docs: "The name of the variant."
1376
+ docs: ["The name of the variant."]
1235
1377
  }),
1236
1378
  optionalAttribute("discriminator", u32(), {
1237
- docs: "Explicit discriminator value. When omitted, the discriminator is inferred from the variant position."
1379
+ docs: [
1380
+ "Explicit discriminator value. When omitted, the discriminator is inferred from the variant position."
1381
+ ]
1238
1382
  }),
1239
- attribute("struct", nestedTypeNode("structTypeNode"), {
1240
- docs: "The struct of named fields carried by the variant."
1383
+ attribute("struct", nestedUnion("nestedTypeNode", "structTypeNode"), {
1384
+ docs: ["The struct of named fields carried by the variant."]
1241
1385
  })
1242
1386
  ]
1243
1387
  });
1244
1388
 
1245
1389
  // src/v1/nodes/typeNodes/EnumTupleVariantTypeNode.ts
1246
1390
  var enumTupleVariantTypeNode = defineNode("enumTupleVariantTypeNode", {
1247
- docs: "A variant of an enum that carries a tuple payload (positional fields).",
1391
+ docs: ["A variant of an enum that carries a tuple payload (positional fields)."],
1248
1392
  attributes: [
1249
1393
  attribute("name", stringIdentifier(), {
1250
- docs: "The name of the variant."
1394
+ docs: ["The name of the variant."]
1251
1395
  }),
1252
1396
  optionalAttribute("discriminator", u32(), {
1253
- docs: "Explicit discriminator value. When omitted, the discriminator is inferred from the variant position."
1397
+ docs: [
1398
+ "Explicit discriminator value. When omitted, the discriminator is inferred from the variant position."
1399
+ ]
1254
1400
  }),
1255
- attribute("tuple", nestedTypeNode("tupleTypeNode"), {
1256
- docs: "The tuple of positional fields carried by the variant."
1401
+ attribute("tuple", nestedUnion("nestedTypeNode", "tupleTypeNode"), {
1402
+ docs: ["The tuple of positional fields carried by the variant."]
1257
1403
  })
1258
1404
  ]
1259
1405
  });
1260
1406
 
1261
1407
  // src/v1/nodes/typeNodes/EnumTypeNode.ts
1262
1408
  var enumTypeNode = defineNode("enumTypeNode", {
1263
- docs: "A tagged union: a numeric discriminator followed by one of several variant payloads.",
1409
+ docs: ["A tagged union: a numeric discriminator followed by one of several variant payloads."],
1264
1410
  attributes: [
1265
- attribute("variants", array(union("EnumVariantTypeNode")), {
1266
- docs: "The variants of the enum, in declaration order."
1411
+ attribute("variants", array(union("enumVariantTypeNode")), {
1412
+ docs: ["The variants of the enum, in declaration order."]
1267
1413
  }),
1268
- attribute("size", nestedTypeNode("numberTypeNode"), {
1269
- docs: "The numeric type used to serialise the discriminator."
1414
+ attribute("size", nestedUnion("nestedTypeNode", "numberTypeNode"), {
1415
+ docs: ["The numeric type used to serialise the discriminator."]
1270
1416
  })
1271
1417
  ]
1272
1418
  });
1273
1419
 
1274
1420
  // src/v1/nodes/typeNodes/FixedSizeTypeNode.ts
1275
1421
  var fixedSizeTypeNode = defineNode("fixedSizeTypeNode", {
1276
- docs: "Wraps another type and asserts a fixed total byte size. Padding or truncation is applied as needed.",
1422
+ docs: ["Wraps another type and asserts a fixed total byte size. Padding or truncation is applied as needed."],
1277
1423
  attributes: [
1278
1424
  attribute("size", u64(), {
1279
- docs: "The total byte size the wrapped type must occupy."
1425
+ docs: ["The total byte size the wrapped type must occupy."]
1280
1426
  }),
1281
- attribute("type", union("TypeNode"), {
1282
- docs: "The wrapped type whose serialisation is constrained."
1427
+ attribute("type", union("typeNode"), {
1428
+ docs: ["The wrapped type whose serialisation is constrained."]
1283
1429
  })
1284
1430
  ]
1285
1431
  });
1286
1432
 
1287
1433
  // src/v1/nodes/typeNodes/HiddenPrefixTypeNode.ts
1288
1434
  var hiddenPrefixTypeNode = defineNode("hiddenPrefixTypeNode", {
1289
- docs: "Prefixes another type with a list of constant values that are written and read but not surfaced as fields to consumers.",
1435
+ docs: [
1436
+ "Prefixes another type with a list of constant values that are written and read but not surfaced as fields to consumers."
1437
+ ],
1290
1438
  attributes: [
1291
- attribute("type", union("TypeNode"), {
1292
- docs: "The wrapped type whose serialisation is preceded by the hidden prefix."
1439
+ attribute("type", union("typeNode"), {
1440
+ docs: ["The wrapped type whose serialisation is preceded by the hidden prefix."]
1293
1441
  }),
1294
1442
  attribute("prefix", array(node("constantValueNode")), {
1295
- docs: "The constant values written before the wrapped type, in order."
1443
+ docs: ["The constant values written before the wrapped type, in order."]
1296
1444
  })
1297
1445
  ]
1298
1446
  });
1299
1447
 
1300
1448
  // src/v1/nodes/typeNodes/HiddenSuffixTypeNode.ts
1301
1449
  var hiddenSuffixTypeNode = defineNode("hiddenSuffixTypeNode", {
1302
- docs: "Suffixes another type with a list of constant values that are written and read but not surfaced as fields to consumers.",
1450
+ docs: [
1451
+ "Suffixes another type with a list of constant values that are written and read but not surfaced as fields to consumers."
1452
+ ],
1303
1453
  attributes: [
1304
- attribute("type", union("TypeNode"), {
1305
- docs: "The wrapped type whose serialisation is followed by the hidden suffix."
1454
+ attribute("type", union("typeNode"), {
1455
+ docs: ["The wrapped type whose serialisation is followed by the hidden suffix."]
1306
1456
  }),
1307
1457
  attribute("suffix", array(node("constantValueNode")), {
1308
- docs: "The constant values written after the wrapped type, in order."
1458
+ docs: ["The constant values written after the wrapped type, in order."]
1309
1459
  })
1310
1460
  ]
1311
1461
  });
1312
1462
 
1313
1463
  // src/v1/nodes/typeNodes/MapTypeNode.ts
1314
1464
  var mapTypeNode = defineNode("mapTypeNode", {
1315
- docs: "A keyed map. The key and value types are described by their respective type nodes; the entry count is determined by a count strategy.",
1465
+ docs: [
1466
+ "A keyed map.",
1467
+ "The key and value types are described by their respective type nodes; the entry count is determined by a count strategy."
1468
+ ],
1316
1469
  attributes: [
1317
- attribute("key", union("TypeNode"), {
1318
- docs: "The type of each entry key."
1470
+ attribute("key", union("typeNode"), {
1471
+ docs: ["The type of each entry key."]
1319
1472
  }),
1320
- attribute("value", union("TypeNode"), {
1321
- docs: "The type of each entry value."
1473
+ attribute("value", union("typeNode"), {
1474
+ docs: ["The type of each entry value."]
1322
1475
  }),
1323
- attribute("count", union("CountNode"), {
1324
- docs: "The strategy used to determine the number of entries."
1476
+ attribute("count", union("countNode"), {
1477
+ docs: ["The strategy used to determine the number of entries."]
1325
1478
  })
1326
1479
  ]
1327
1480
  });
1328
1481
 
1329
1482
  // src/v1/nodes/typeNodes/NumberTypeNode.ts
1330
1483
  var numberTypeNode = defineNode("numberTypeNode", {
1331
- docs: "A numeric type with a fixed wire format and byte order.",
1484
+ docs: ["A numeric type with a fixed wire format and byte order."],
1332
1485
  attributes: [
1333
- attribute("format", enumeration("NumberFormat"), {
1334
- docs: "The wire format used to serialise the number."
1486
+ attribute("format", enumeration("numberFormat"), {
1487
+ docs: ["The wire format used to serialise the number."]
1335
1488
  }),
1336
- attribute("endian", enumeration("Endianness"), {
1337
- docs: "The byte order used to serialise the number."
1489
+ attribute("endian", enumeration("endianness"), {
1490
+ docs: ["The byte order used to serialise the number."]
1338
1491
  })
1339
1492
  ]
1340
1493
  });
1341
1494
 
1342
1495
  // src/v1/nodes/typeNodes/OptionTypeNode.ts
1343
1496
  var optionTypeNode = defineNode("optionTypeNode", {
1344
- docs: "A value that may be present or absent (Some/None), with an explicit numeric prefix indicating presence.",
1497
+ docs: ["A value that may be present or absent (Some/None), with an explicit numeric prefix indicating presence."],
1345
1498
  attributes: [
1346
1499
  optionalAttribute("fixed", boolean(), {
1347
- docs: "When `true`, the absent variant still occupies the byte size of the present variant (zero-padded). Defaults to `false`."
1500
+ docs: [
1501
+ "When `true`, the absent variant still occupies the byte size of the present variant (zero-padded). Defaults to `false`."
1502
+ ]
1348
1503
  }),
1349
- attribute("item", union("TypeNode"), {
1350
- docs: "The type carried by the option when present."
1504
+ attribute("item", union("typeNode"), {
1505
+ docs: ["The type carried by the option when present."]
1351
1506
  }),
1352
- attribute("prefix", nestedTypeNode("numberTypeNode"), {
1353
- docs: "The numeric type used as the presence flag."
1507
+ attribute("prefix", nestedUnion("nestedTypeNode", "numberTypeNode"), {
1508
+ docs: ["The numeric type used as the presence flag."]
1354
1509
  })
1355
1510
  ]
1356
1511
  });
1357
1512
 
1358
1513
  // src/v1/nodes/typeNodes/PostOffsetTypeNode.ts
1359
1514
  var postOffsetTypeNode = defineNode("postOffsetTypeNode", {
1360
- docs: "After serialising the wrapped type, advance the cursor by `offset` bytes interpreted via the chosen strategy.",
1515
+ docs: [
1516
+ "After serialising the wrapped type, advance the cursor by `offset` bytes interpreted via the chosen strategy."
1517
+ ],
1361
1518
  attributes: [
1362
1519
  attribute("offset", i64(), {
1363
- docs: "The signed byte offset to apply after the wrapped type runs."
1520
+ docs: ["The signed byte offset to apply after the wrapped type runs."]
1364
1521
  }),
1365
- attribute("strategy", enumeration("PostOffsetStrategy"), {
1366
- docs: "How the `offset` value is interpreted."
1522
+ attribute("strategy", enumeration("postOffsetStrategy"), {
1523
+ docs: ["How the `offset` value is interpreted."]
1367
1524
  }),
1368
- attribute("type", union("TypeNode"), {
1369
- docs: "The wrapped type whose serialisation is followed by the offset."
1525
+ attribute("type", union("typeNode"), {
1526
+ docs: ["The wrapped type whose serialisation is followed by the offset."]
1370
1527
  })
1371
1528
  ]
1372
1529
  });
1373
1530
 
1374
1531
  // src/v1/nodes/typeNodes/PreOffsetTypeNode.ts
1375
1532
  var preOffsetTypeNode = defineNode("preOffsetTypeNode", {
1376
- docs: "Before serialising the wrapped type, advance the cursor by `offset` bytes interpreted via the chosen strategy.",
1533
+ docs: [
1534
+ "Before serialising the wrapped type, advance the cursor by `offset` bytes interpreted via the chosen strategy."
1535
+ ],
1377
1536
  attributes: [
1378
1537
  attribute("offset", i64(), {
1379
- docs: "The signed byte offset to apply before the wrapped type runs."
1538
+ docs: ["The signed byte offset to apply before the wrapped type runs."]
1380
1539
  }),
1381
- attribute("strategy", enumeration("PreOffsetStrategy"), {
1382
- docs: "How the `offset` value is interpreted."
1540
+ attribute("strategy", enumeration("preOffsetStrategy"), {
1541
+ docs: ["How the `offset` value is interpreted."]
1383
1542
  }),
1384
- attribute("type", union("TypeNode"), {
1385
- docs: "The wrapped type whose serialisation is preceded by the offset."
1543
+ attribute("type", union("typeNode"), {
1544
+ docs: ["The wrapped type whose serialisation is preceded by the offset."]
1386
1545
  })
1387
1546
  ]
1388
1547
  });
1389
1548
 
1390
1549
  // src/v1/nodes/typeNodes/PublicKeyTypeNode.ts
1391
1550
  var publicKeyTypeNode = defineNode("publicKeyTypeNode", {
1392
- docs: "A 32-byte Solana public key.",
1551
+ docs: ["A 32-byte Solana public key."],
1393
1552
  attributes: []
1394
1553
  });
1395
1554
 
1396
1555
  // src/v1/nodes/typeNodes/RemainderOptionTypeNode.ts
1397
1556
  var remainderOptionTypeNode = defineNode("remainderOptionTypeNode", {
1398
- docs: "A value that may be present or absent. Presence is signalled by whether any bytes remain to be read, with no explicit prefix.",
1557
+ docs: [
1558
+ "A value that may be present or absent. Presence is signalled by whether any bytes remain to be read, with no explicit prefix."
1559
+ ],
1399
1560
  attributes: [
1400
- attribute("item", union("TypeNode"), {
1401
- docs: "The type carried by the option when present."
1561
+ attribute("item", union("typeNode"), {
1562
+ docs: ["The type carried by the option when present."]
1402
1563
  })
1403
1564
  ]
1404
1565
  });
1405
1566
 
1406
1567
  // src/v1/nodes/typeNodes/SentinelTypeNode.ts
1407
1568
  var sentinelTypeNode = defineNode("sentinelTypeNode", {
1408
- docs: "Wraps another type and delimits it with a constant sentinel value written immediately after the wrapped type.",
1569
+ docs: [
1570
+ "Wraps another type and delimits it with a constant sentinel value written immediately after the wrapped type."
1571
+ ],
1409
1572
  attributes: [
1410
- attribute("type", union("TypeNode"), {
1411
- docs: "The wrapped type whose extent is delimited by the sentinel."
1573
+ attribute("type", union("typeNode"), {
1574
+ docs: ["The wrapped type whose extent is delimited by the sentinel."]
1412
1575
  }),
1413
1576
  attribute("sentinel", node("constantValueNode"), {
1414
- docs: "The constant value written immediately after the wrapped type to mark its end."
1577
+ docs: ["The constant value written immediately after the wrapped type to mark its end."]
1415
1578
  })
1416
1579
  ]
1417
1580
  });
1418
1581
 
1419
1582
  // src/v1/nodes/typeNodes/SetTypeNode.ts
1420
1583
  var setTypeNode = defineNode("setTypeNode", {
1421
- docs: "A unique-valued collection. The item type is defined by `item`; the size is determined by the `count` strategy.",
1584
+ docs: [
1585
+ "A unique-valued collection. The item type is defined by `item`; the size is determined by the `count` strategy."
1586
+ ],
1422
1587
  attributes: [
1423
- attribute("item", union("TypeNode"), {
1424
- docs: "The type of each item in the set."
1588
+ attribute("item", union("typeNode"), {
1589
+ docs: ["The type of each item in the set."]
1425
1590
  }),
1426
- attribute("count", union("CountNode"), {
1427
- docs: "The strategy used to determine the number of items."
1591
+ attribute("count", union("countNode"), {
1592
+ docs: ["The strategy used to determine the number of items."]
1428
1593
  })
1429
1594
  ]
1430
1595
  });
1431
1596
 
1432
1597
  // src/v1/nodes/typeNodes/SizePrefixTypeNode.ts
1433
1598
  var sizePrefixTypeNode = defineNode("sizePrefixTypeNode", {
1434
- docs: "Wraps another type with a numeric prefix indicating the byte length of the wrapped type.",
1599
+ docs: ["Wraps another type with a numeric prefix indicating the byte length of the wrapped type."],
1435
1600
  attributes: [
1436
- attribute("type", union("TypeNode"), {
1437
- docs: "The wrapped type whose serialisation is preceded by its size."
1601
+ attribute("type", union("typeNode"), {
1602
+ docs: ["The wrapped type whose serialisation is preceded by its size."]
1438
1603
  }),
1439
- attribute("prefix", nestedTypeNode("numberTypeNode"), {
1440
- docs: "The numeric type used as the size prefix."
1604
+ attribute("prefix", nestedUnion("nestedTypeNode", "numberTypeNode"), {
1605
+ docs: ["The numeric type used as the size prefix."]
1441
1606
  })
1442
1607
  ]
1443
1608
  });
1444
1609
 
1445
1610
  // src/v1/nodes/typeNodes/SolAmountTypeNode.ts
1446
1611
  var solAmountTypeNode = defineNode("solAmountTypeNode", {
1447
- docs: "A SOL amount expressed in lamports under the wrapped numeric type.",
1612
+ docs: ["A SOL amount expressed in lamports under the wrapped numeric type."],
1448
1613
  attributes: [
1449
- attribute("number", nestedTypeNode("numberTypeNode"), {
1450
- docs: "The numeric type used to serialise the lamport amount."
1614
+ attribute("number", nestedUnion("nestedTypeNode", "numberTypeNode"), {
1615
+ docs: ["The numeric type used to serialise the lamport amount."]
1451
1616
  })
1452
1617
  ]
1453
1618
  });
1454
1619
 
1455
1620
  // src/v1/nodes/typeNodes/StringTypeNode.ts
1456
1621
  var stringTypeNode = defineNode("stringTypeNode", {
1457
- docs: "A string value. The encoding describes how its bytes are written; the byte length is determined by an enclosing wrapper such as `sizePrefixTypeNode` or `fixedSizeTypeNode`.",
1622
+ docs: [
1623
+ "A string value.",
1624
+ "The encoding describes how its bytes are written.",
1625
+ "The byte length is determined by an enclosing wrapper such as `sizePrefixTypeNode` or `fixedSizeTypeNode`."
1626
+ ],
1458
1627
  attributes: [
1459
- attribute("encoding", enumeration("BytesEncoding"), {
1460
- docs: "The byte encoding used to serialise the string."
1628
+ attribute("encoding", enumeration("bytesEncoding"), {
1629
+ docs: ["The byte encoding used to serialise the string."]
1461
1630
  })
1462
1631
  ]
1463
1632
  });
1464
1633
 
1465
1634
  // src/v1/nodes/typeNodes/StructFieldTypeNode.ts
1466
1635
  var structFieldTypeNode = defineNode("structFieldTypeNode", {
1467
- docs: "A named field within a struct type.",
1636
+ docs: ["A named field within a struct type."],
1468
1637
  attributes: [
1469
1638
  attribute("name", stringIdentifier(), {
1470
- docs: "The name of the field."
1639
+ docs: ["The name of the field."]
1471
1640
  }),
1472
- optionalAttribute("defaultValueStrategy", enumeration("DefaultValueStrategy"), {
1473
- docs: "How a configured default value is exposed in generated APIs. Required when `defaultValue` is set."
1641
+ optionalAttribute("defaultValueStrategy", enumeration("defaultValueStrategy"), {
1642
+ docs: ["How a configured default value is exposed in generated APIs. Required when `defaultValue` is set."]
1474
1643
  }),
1475
1644
  optionalAttribute("docs", docs(), {
1476
- docs: "Markdown documentation for the field."
1645
+ docs: ["Markdown documentation for the field."]
1477
1646
  }),
1478
- attribute("type", union("TypeNode"), {
1479
- docs: "The type of the field."
1647
+ attribute("type", union("typeNode"), {
1648
+ docs: ["The type of the field."]
1480
1649
  }),
1481
- optionalAttribute("defaultValue", union("ValueNode"), {
1482
- docs: "A default value used when the field is omitted by callers."
1650
+ optionalAttribute("defaultValue", union("valueNode"), {
1651
+ docs: ["A default value used when the field is omitted by callers."]
1483
1652
  })
1484
1653
  ]
1485
1654
  });
1486
1655
 
1487
1656
  // src/v1/nodes/typeNodes/StructTypeNode.ts
1488
1657
  var structTypeNode = defineNode("structTypeNode", {
1489
- docs: "A composite type made of an ordered list of named fields. Fields are encoded and decoded in declaration order.",
1658
+ docs: [
1659
+ "A composite type made of an ordered list of named fields. Fields are encoded and decoded in declaration order."
1660
+ ],
1490
1661
  attributes: [
1491
1662
  attribute("fields", array(node("structFieldTypeNode")), {
1492
- docs: "The fields of the struct, in declaration order."
1663
+ docs: ["The fields of the struct, in declaration order."]
1493
1664
  })
1494
1665
  ]
1495
1666
  });
1496
1667
 
1497
1668
  // src/v1/nodes/typeNodes/TupleTypeNode.ts
1498
1669
  var tupleTypeNode = defineNode("tupleTypeNode", {
1499
- docs: "A heterogeneous fixed-length sequence in which each positional slot has its own type.",
1670
+ docs: ["A heterogeneous fixed-length sequence in which each positional slot has its own type."],
1500
1671
  attributes: [
1501
- attribute("items", array(union("TypeNode")), {
1502
- docs: "The type of each positional slot, in order."
1672
+ attribute("items", array(union("typeNode")), {
1673
+ docs: ["The type of each positional slot, in order."]
1503
1674
  })
1504
1675
  ]
1505
1676
  });
@@ -1531,32 +1702,34 @@ var STANDALONE_TYPE_NODE_KINDS = [
1531
1702
  "tupleTypeNode",
1532
1703
  "zeroableOptionTypeNode"
1533
1704
  ];
1534
- var standaloneTypeNodeUnion = defineUnion("StandaloneTypeNode", {
1535
- docs: "Every type node that can be used as a top-level type.",
1705
+ var standaloneTypeNodeUnion = defineUnion("standaloneTypeNode", {
1706
+ docs: ["Every type node that can be used as a top-level type."],
1536
1707
  members: [...STANDALONE_TYPE_NODE_KINDS]
1537
1708
  });
1538
- var enumVariantTypeNodeUnion = defineUnion("EnumVariantTypeNode", {
1539
- docs: "The variant flavours of an `enumTypeNode`.",
1709
+ var enumVariantTypeNodeUnion = defineUnion("enumVariantTypeNode", {
1710
+ docs: ["The variant flavours of an `enumTypeNode`."],
1540
1711
  members: ["enumEmptyVariantTypeNode", "enumStructVariantTypeNode", "enumTupleVariantTypeNode"]
1541
1712
  });
1542
- var typeNodeUnion = defineUnion("TypeNode", {
1543
- docs: "The composable form: any standalone type, or a reference to a defined type via `definedTypeLinkNode`.",
1544
- members: [union("StandaloneTypeNode"), "definedTypeLinkNode"]
1713
+ var typeNodeUnion = defineUnion("typeNode", {
1714
+ docs: ["The composable form: any standalone type, or a reference to a defined type via `definedTypeLinkNode`."],
1715
+ members: [union("standaloneTypeNode"), "definedTypeLinkNode"]
1545
1716
  });
1546
- var registeredTypeNodeUnion = defineUnion("RegisteredTypeNode", {
1547
- docs: "Every node tagged as a type-shaped node, including variants and struct fields.",
1548
- members: [union("StandaloneTypeNode"), union("EnumVariantTypeNode"), "structFieldTypeNode"]
1717
+ var registeredTypeNodeUnion = defineUnion("registeredTypeNode", {
1718
+ docs: ["Every node tagged as a type-shaped node, including variants and struct fields."],
1719
+ members: [union("standaloneTypeNode"), union("enumVariantTypeNode"), "structFieldTypeNode"]
1549
1720
  });
1550
1721
 
1551
1722
  // src/v1/nodes/typeNodes/ZeroableOptionTypeNode.ts
1552
1723
  var zeroableOptionTypeNode = defineNode("zeroableOptionTypeNode", {
1553
- docs: "An optional value whose absence is signalled by a designated zero value rather than a presence flag.",
1724
+ docs: ["An optional value whose absence is signalled by a designated zero value rather than a presence flag."],
1554
1725
  attributes: [
1555
- attribute("item", union("TypeNode"), {
1556
- docs: "The type carried by the option when present."
1726
+ attribute("item", union("typeNode"), {
1727
+ docs: ["The type carried by the option when present."]
1557
1728
  }),
1558
1729
  optionalAttribute("zeroValue", node("constantValueNode"), {
1559
- docs: "The constant value that signals absence. When omitted, the all-zero byte pattern of the item type is used."
1730
+ docs: [
1731
+ "The constant value that signals absence. When omitted, the all-zero byte pattern of the item type is used."
1732
+ ]
1560
1733
  })
1561
1734
  ]
1562
1735
  });
@@ -1601,177 +1774,183 @@ var ALL_TYPE_NODE_UNIONS = [
1601
1774
 
1602
1775
  // src/v1/nodes/valueNodes/ArrayValueNode.ts
1603
1776
  var arrayValueNode = defineNode("arrayValueNode", {
1604
- docs: "A concrete array value: a list of value nodes.",
1777
+ docs: ["A concrete array value: a list of value nodes."],
1605
1778
  attributes: [
1606
- attribute("items", array(union("ValueNode")), {
1607
- docs: "The items of the array, in order."
1779
+ attribute("items", array(union("valueNode")), {
1780
+ docs: ["The items of the array, in order."]
1608
1781
  })
1609
1782
  ]
1610
1783
  });
1611
1784
 
1612
1785
  // src/v1/nodes/valueNodes/BooleanValueNode.ts
1613
1786
  var booleanValueNode = defineNode("booleanValueNode", {
1614
- docs: "A concrete boolean value.",
1787
+ docs: ["A concrete boolean value."],
1615
1788
  attributes: [
1616
1789
  attribute("boolean", boolean(), {
1617
- docs: "The boolean value."
1790
+ docs: ["The boolean value."]
1618
1791
  })
1619
1792
  ]
1620
1793
  });
1621
1794
 
1622
1795
  // src/v1/nodes/valueNodes/BytesValueNode.ts
1623
1796
  var bytesValueNode = defineNode("bytesValueNode", {
1624
- docs: "A concrete bytes value, encoded as text in the chosen encoding.",
1797
+ docs: ["A concrete bytes value, encoded as text in the chosen encoding."],
1625
1798
  attributes: [
1626
1799
  attribute("data", string(), {
1627
- docs: "The bytes encoded as a text string per the `encoding` attribute."
1800
+ docs: ["The bytes encoded as a text string per the `encoding` attribute."]
1628
1801
  }),
1629
- attribute("encoding", enumeration("BytesEncoding"), {
1630
- docs: "The encoding used to represent the bytes as text."
1802
+ attribute("encoding", enumeration("bytesEncoding"), {
1803
+ docs: ["The encoding used to represent the bytes as text."]
1631
1804
  })
1632
1805
  ]
1633
1806
  });
1634
1807
 
1635
1808
  // src/v1/nodes/valueNodes/ConstantValueNode.ts
1636
1809
  var constantValueNode = defineNode("constantValueNode", {
1637
- docs: "A typed constant: a type node paired with a concrete value node.",
1810
+ docs: ["A typed constant: a type node paired with a concrete value node."],
1638
1811
  attributes: [
1639
- attribute("type", union("TypeNode"), {
1640
- docs: "The type of the constant."
1812
+ attribute("type", union("typeNode"), {
1813
+ docs: ["The type of the constant."]
1641
1814
  }),
1642
- attribute("value", union("ValueNode"), {
1643
- docs: "The concrete value of the constant."
1815
+ attribute("value", union("valueNode"), {
1816
+ docs: ["The concrete value of the constant."]
1644
1817
  })
1645
1818
  ]
1646
1819
  });
1647
1820
 
1648
1821
  // src/v1/nodes/valueNodes/EnumValueNode.ts
1649
1822
  var enumValueNode = defineNode("enumValueNode", {
1650
- docs: "A concrete value of a defined enum: a variant identifier plus an optional payload.",
1823
+ docs: ["A concrete value of a defined enum: a variant identifier plus an optional payload."],
1651
1824
  attributes: [
1652
1825
  attribute("variant", stringIdentifier(), {
1653
- docs: "The name of the selected variant."
1826
+ docs: ["The name of the selected variant."]
1654
1827
  }),
1655
1828
  attribute("enum", node("definedTypeLinkNode"), {
1656
- docs: "A link to the defined enum type the value belongs to."
1829
+ docs: ["A link to the defined enum type the value belongs to."]
1657
1830
  }),
1658
- optionalAttribute("value", union("EnumValuePayload"), {
1659
- docs: "The variant payload \u2014 a struct value for struct variants or a tuple value for tuple variants. Omitted for unit variants."
1831
+ optionalAttribute("value", union("enumValuePayload"), {
1832
+ docs: [
1833
+ "The variant payload \u2014 a struct value for struct variants or a tuple value for tuple variants.",
1834
+ "Omitted for unit variants."
1835
+ ]
1660
1836
  })
1661
1837
  ]
1662
1838
  });
1663
1839
 
1664
1840
  // src/v1/nodes/valueNodes/MapEntryValueNode.ts
1665
1841
  var mapEntryValueNode = defineNode("mapEntryValueNode", {
1666
- docs: "A single (key, value) pair inside a `mapValueNode`.",
1842
+ docs: ["A single (key, value) pair inside a `mapValueNode`."],
1667
1843
  attributes: [
1668
- attribute("key", union("ValueNode"), {
1669
- docs: "The entry key."
1844
+ attribute("key", union("valueNode"), {
1845
+ docs: ["The entry key."]
1670
1846
  }),
1671
- attribute("value", union("ValueNode"), {
1672
- docs: "The entry value."
1847
+ attribute("value", union("valueNode"), {
1848
+ docs: ["The entry value."]
1673
1849
  })
1674
1850
  ]
1675
1851
  });
1676
1852
 
1677
1853
  // src/v1/nodes/valueNodes/MapValueNode.ts
1678
1854
  var mapValueNode = defineNode("mapValueNode", {
1679
- docs: "A concrete map value: a list of (key, value) entries.",
1855
+ docs: ["A concrete map value: a list of (key, value) entries."],
1680
1856
  attributes: [
1681
1857
  attribute("entries", array(node("mapEntryValueNode")), {
1682
- docs: "The entries of the map, in order."
1858
+ docs: ["The entries of the map, in order."]
1683
1859
  })
1684
1860
  ]
1685
1861
  });
1686
1862
 
1687
1863
  // src/v1/nodes/valueNodes/NoneValueNode.ts
1688
1864
  var noneValueNode = defineNode("noneValueNode", {
1689
- docs: 'The "absent" value for an optional type.',
1865
+ docs: ['The "absent" value for an optional type.'],
1690
1866
  attributes: []
1691
1867
  });
1692
1868
 
1693
1869
  // src/v1/nodes/valueNodes/NumberValueNode.ts
1694
1870
  var numberValueNode = defineNode("numberValueNode", {
1695
- docs: "A concrete numeric value. Stored as a 64-bit float; consumers narrow to a specific integer or float width based on the surrounding type context.",
1871
+ docs: [
1872
+ "A concrete numeric value.",
1873
+ "Stored as a 64-bit float; consumers narrow to a specific integer or float width based on the surrounding type context."
1874
+ ],
1696
1875
  attributes: [
1697
1876
  attribute("number", f64(), {
1698
- docs: "The numeric value."
1877
+ docs: ["The numeric value."]
1699
1878
  })
1700
1879
  ]
1701
1880
  });
1702
1881
 
1703
1882
  // src/v1/nodes/valueNodes/PublicKeyValueNode.ts
1704
1883
  var publicKeyValueNode = defineNode("publicKeyValueNode", {
1705
- docs: "A concrete public key, with an optional symbolic identifier for the address.",
1884
+ docs: ["A concrete public key, with an optional symbolic identifier for the address."],
1706
1885
  attributes: [
1707
- attribute("publicKey", string(), {
1708
- docs: "The base58-encoded public key."
1886
+ attribute("publicKey", address(), {
1887
+ docs: ["The base58-encoded public key."]
1709
1888
  }),
1710
1889
  optionalAttribute("identifier", stringIdentifier(), {
1711
- docs: "A symbolic name for the address, useful in generated client code."
1890
+ docs: ["A symbolic name for the address, useful in generated client code."]
1712
1891
  })
1713
1892
  ]
1714
1893
  });
1715
1894
 
1716
1895
  // src/v1/nodes/valueNodes/SetValueNode.ts
1717
1896
  var setValueNode = defineNode("setValueNode", {
1718
- docs: "A concrete set value: a list of unique value nodes.",
1897
+ docs: ["A concrete set value: a list of unique value nodes."],
1719
1898
  attributes: [
1720
- attribute("items", array(union("ValueNode")), {
1721
- docs: "The items of the set."
1899
+ attribute("items", array(union("valueNode")), {
1900
+ docs: ["The items of the set."]
1722
1901
  })
1723
1902
  ]
1724
1903
  });
1725
1904
 
1726
1905
  // src/v1/nodes/valueNodes/SomeValueNode.ts
1727
1906
  var someValueNode = defineNode("someValueNode", {
1728
- docs: 'The "present" value for an optional type, wrapping a concrete value node.',
1907
+ docs: ['The "present" value for an optional type, wrapping a concrete value node.'],
1729
1908
  attributes: [
1730
- attribute("value", union("ValueNode"), {
1731
- docs: "The wrapped value."
1909
+ attribute("value", union("valueNode"), {
1910
+ docs: ["The wrapped value."]
1732
1911
  })
1733
1912
  ]
1734
1913
  });
1735
1914
 
1736
1915
  // src/v1/nodes/valueNodes/StringValueNode.ts
1737
1916
  var stringValueNode = defineNode("stringValueNode", {
1738
- docs: "A concrete string value.",
1917
+ docs: ["A concrete string value."],
1739
1918
  attributes: [
1740
1919
  attribute("string", string(), {
1741
- docs: "The string value."
1920
+ docs: ["The string value."]
1742
1921
  })
1743
1922
  ]
1744
1923
  });
1745
1924
 
1746
1925
  // src/v1/nodes/valueNodes/StructFieldValueNode.ts
1747
1926
  var structFieldValueNode = defineNode("structFieldValueNode", {
1748
- docs: "A named field of a `structValueNode`.",
1927
+ docs: ["A named field of a `structValueNode`."],
1749
1928
  attributes: [
1750
1929
  attribute("name", stringIdentifier(), {
1751
- docs: "The name of the field."
1930
+ docs: ["The name of the field."]
1752
1931
  }),
1753
- attribute("value", union("ValueNode"), {
1754
- docs: "The concrete value of the field."
1932
+ attribute("value", union("valueNode"), {
1933
+ docs: ["The concrete value of the field."]
1755
1934
  })
1756
1935
  ]
1757
1936
  });
1758
1937
 
1759
1938
  // src/v1/nodes/valueNodes/StructValueNode.ts
1760
1939
  var structValueNode = defineNode("structValueNode", {
1761
- docs: "A concrete struct value: a list of named field values.",
1940
+ docs: ["A concrete struct value: a list of named field values."],
1762
1941
  attributes: [
1763
1942
  attribute("fields", array(node("structFieldValueNode")), {
1764
- docs: "The named fields of the struct value."
1943
+ docs: ["The named fields of the struct value."]
1765
1944
  })
1766
1945
  ]
1767
1946
  });
1768
1947
 
1769
1948
  // src/v1/nodes/valueNodes/TupleValueNode.ts
1770
1949
  var tupleValueNode = defineNode("tupleValueNode", {
1771
- docs: "A concrete tuple value: a fixed-length sequence of positional value nodes.",
1950
+ docs: ["A concrete tuple value: a fixed-length sequence of positional value nodes."],
1772
1951
  attributes: [
1773
- attribute("items", array(union("ValueNode")), {
1774
- docs: "The positional items of the tuple, in order."
1952
+ attribute("items", array(union("valueNode")), {
1953
+ docs: ["The positional items of the tuple, in order."]
1775
1954
  })
1776
1955
  ]
1777
1956
  });
@@ -1793,20 +1972,20 @@ var STANDALONE_VALUE_NODE_KINDS = [
1793
1972
  "structValueNode",
1794
1973
  "tupleValueNode"
1795
1974
  ];
1796
- var standaloneValueNodeUnion = defineUnion("StandaloneValueNode", {
1797
- docs: "Every value node that can be used as a top-level value.",
1975
+ var standaloneValueNodeUnion = defineUnion("standaloneValueNode", {
1976
+ docs: ["Every value node that can be used as a top-level value."],
1798
1977
  members: [...STANDALONE_VALUE_NODE_KINDS]
1799
1978
  });
1800
- var valueNodeUnion = defineUnion("ValueNode", {
1801
- docs: "The composable form: any standalone value node.",
1802
- members: [union("StandaloneValueNode")]
1979
+ var valueNodeUnion = defineUnion("valueNode", {
1980
+ docs: ["The composable form: any standalone value node."],
1981
+ members: [union("standaloneValueNode")]
1803
1982
  });
1804
- var registeredValueNodeUnion = defineUnion("RegisteredValueNode", {
1805
- docs: "Every node tagged as a value-shaped node, including container variants.",
1806
- members: [union("StandaloneValueNode"), "mapEntryValueNode", "structFieldValueNode"]
1983
+ var registeredValueNodeUnion = defineUnion("registeredValueNode", {
1984
+ docs: ["Every node tagged as a value-shaped node, including container variants."],
1985
+ members: [union("standaloneValueNode"), "mapEntryValueNode", "structFieldValueNode"]
1807
1986
  });
1808
- var enumValuePayloadUnion = defineUnion("EnumValuePayload", {
1809
- docs: "The payload kinds an `enumValueNode` may carry \u2014 struct fields or positional tuple slots.",
1987
+ var enumValuePayloadUnion = defineUnion("enumValuePayload", {
1988
+ docs: ["The payload kinds an `enumValueNode` may carry \u2014 struct fields or positional tuple slots."],
1810
1989
  members: ["structValueNode", "tupleValueNode"]
1811
1990
  });
1812
1991
 
@@ -1836,55 +2015,87 @@ var ALL_VALUE_NODE_UNIONS = [
1836
2015
  enumValuePayloadUnion
1837
2016
  ];
1838
2017
 
1839
- // src/v1/nodes/index.ts
1840
- var ALL_NODES = [
1841
- ...ALL_TYPE_NODES,
1842
- ...ALL_VALUE_NODES,
1843
- ...ALL_LINK_NODES,
1844
- ...ALL_PDA_SEED_NODES,
1845
- ...ALL_COUNT_NODES,
1846
- ...ALL_DISCRIMINATOR_NODES,
1847
- ...ALL_CONTEXTUAL_VALUE_NODES,
1848
- // Top-level nodes — directly under `nodes/`, no subdirectory.
1849
- accountNode,
1850
- constantNode,
1851
- definedTypeNode,
1852
- errorNode,
1853
- eventNode,
1854
- instructionAccountNode,
1855
- instructionArgumentNode,
1856
- instructionByteDeltaNode,
1857
- instructionNode,
1858
- instructionRemainingAccountsNode,
1859
- instructionStatusNode,
1860
- pdaNode,
1861
- programNode,
1862
- rootNode
1863
- ];
1864
- var ALL_UNIONS = [
1865
- ...ALL_TYPE_NODE_UNIONS,
1866
- ...ALL_VALUE_NODE_UNIONS,
1867
- ...ALL_LINK_NODE_UNIONS,
1868
- ...ALL_PDA_SEED_NODE_UNIONS,
1869
- ...ALL_COUNT_NODE_UNIONS,
1870
- ...ALL_DISCRIMINATOR_NODE_UNIONS,
1871
- ...ALL_CONTEXTUAL_VALUE_NODE_UNIONS,
1872
- // Inline-helper unions used by instruction-shaped nodes.
1873
- instructionByteDeltaValueUnion,
1874
- instructionRemainingAccountsValueUnion
1875
- ];
1876
-
1877
2018
  // src/v1/index.ts
1878
2019
  var SPEC_VERSION = "1.6.0";
2020
+ var TYPE_CATEGORY = defineCategory("type", {
2021
+ docs: ["Type nodes \u2014 the building blocks of every value shape."],
2022
+ nestedUnions: [nestedTypeNode],
2023
+ nodes: [...ALL_TYPE_NODES],
2024
+ unions: [...ALL_TYPE_NODE_UNIONS]
2025
+ });
2026
+ var VALUE_CATEGORY = defineCategory("value", {
2027
+ docs: ["Value nodes \u2014 concrete values whose shape is described by a type node."],
2028
+ nodes: [...ALL_VALUE_NODES],
2029
+ unions: [...ALL_VALUE_NODE_UNIONS]
2030
+ });
2031
+ var LINK_CATEGORY = defineCategory("link", {
2032
+ docs: ["Link nodes \u2014 references to other named entities (programs, PDAs, accounts, \u2026)."],
2033
+ nodes: [...ALL_LINK_NODES],
2034
+ unions: [...ALL_LINK_NODE_UNIONS]
2035
+ });
2036
+ var PDA_SEED_CATEGORY = defineCategory("pdaSeed", {
2037
+ docs: ["PDA-seed nodes \u2014 the constants and variables a program uses to derive PDAs."],
2038
+ nodes: [...ALL_PDA_SEED_NODES],
2039
+ unions: [...ALL_PDA_SEED_NODE_UNIONS]
2040
+ });
2041
+ var COUNT_CATEGORY = defineCategory("count", {
2042
+ docs: ["Count nodes \u2014 strategies for sizing a homogeneous collection in serialized form."],
2043
+ nodes: [...ALL_COUNT_NODES],
2044
+ unions: [...ALL_COUNT_NODE_UNIONS]
2045
+ });
2046
+ var DISCRIMINATOR_CATEGORY = defineCategory("discriminator", {
2047
+ docs: ["Discriminator nodes \u2014 strategies for distinguishing one account or instruction from another."],
2048
+ nodes: [...ALL_DISCRIMINATOR_NODES],
2049
+ unions: [...ALL_DISCRIMINATOR_NODE_UNIONS]
2050
+ });
2051
+ var CONTEXTUAL_VALUE_CATEGORY = defineCategory("contextualValue", {
2052
+ docs: [
2053
+ "Contextual-value nodes \u2014 references resolved at instruction-build time (account values, argument values, \u2026)."
2054
+ ],
2055
+ nodes: [...ALL_CONTEXTUAL_VALUE_NODES],
2056
+ unions: [...ALL_CONTEXTUAL_VALUE_NODE_UNIONS]
2057
+ });
2058
+ var SHARED_CATEGORY = defineCategory("shared", {
2059
+ docs: ["Shared enumerations referenced from multiple node categories."],
2060
+ enumerations: [...ALL_ENUMERATIONS]
2061
+ });
2062
+ var TOP_LEVEL_CATEGORY = defineCategory("topLevel", {
2063
+ docs: ["Top-level nodes and helper unions \u2014 the entry points of any Codama IDL."],
2064
+ nodes: [
2065
+ accountNode,
2066
+ constantNode,
2067
+ definedTypeNode,
2068
+ errorNode,
2069
+ eventNode,
2070
+ instructionAccountNode,
2071
+ instructionArgumentNode,
2072
+ instructionByteDeltaNode,
2073
+ instructionNode,
2074
+ instructionRemainingAccountsNode,
2075
+ instructionStatusNode,
2076
+ pdaNode,
2077
+ programNode,
2078
+ rootNode
2079
+ ],
2080
+ unions: [instructionByteDeltaValueUnion, instructionRemainingAccountsValueUnion]
2081
+ });
2082
+ var ALL_CATEGORIES = [
2083
+ TYPE_CATEGORY,
2084
+ VALUE_CATEGORY,
2085
+ LINK_CATEGORY,
2086
+ PDA_SEED_CATEGORY,
2087
+ COUNT_CATEGORY,
2088
+ DISCRIMINATOR_CATEGORY,
2089
+ CONTEXTUAL_VALUE_CATEGORY,
2090
+ SHARED_CATEGORY,
2091
+ TOP_LEVEL_CATEGORY
2092
+ ];
1879
2093
  var cached;
1880
2094
  function getSpec() {
1881
2095
  if (cached) return cached;
1882
2096
  const built = {
1883
2097
  version: SPEC_VERSION,
1884
- enumerations: ALL_ENUMERATIONS,
1885
- nodes: ALL_NODES,
1886
- unions: ALL_UNIONS,
1887
- nestedTypeNodeWrappers: NESTED_TYPE_NODE_WRAPPERS
2098
+ categories: ALL_CATEGORIES
1888
2099
  };
1889
2100
  const errors = validate(built);
1890
2101
  if (errors.length > 0) {
@@ -1895,13 +2106,25 @@ ${errors.map((e) => ` - ${e}`).join("\n")}`);
1895
2106
  return cached;
1896
2107
  }
1897
2108
  function getNode(kind) {
1898
- return getSpec().nodes.find((n) => n.kind === kind);
2109
+ for (const c of getSpec().categories) {
2110
+ const found = c.nodes.find((n) => n.kind === kind);
2111
+ if (found) return found;
2112
+ }
2113
+ return void 0;
1899
2114
  }
1900
2115
  function getUnion(name) {
1901
- return getSpec().unions.find((u) => u.name === name);
2116
+ for (const c of getSpec().categories) {
2117
+ const found = c.unions.find((u) => u.name === name);
2118
+ if (found) return found;
2119
+ }
2120
+ return void 0;
1902
2121
  }
1903
2122
  function getEnumeration(name) {
1904
- return getSpec().enumerations.find((e) => e.name === name);
2123
+ for (const c of getSpec().categories) {
2124
+ const found = c.enumerations.find((e) => e.name === name);
2125
+ if (found) return found;
2126
+ }
2127
+ return void 0;
1905
2128
  }
1906
2129
 
1907
2130
  exports.SPEC_VERSION = SPEC_VERSION;