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