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