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