@solana/rpc-graphql 2.0.0-experimental.228d375 → 2.0.0-experimental.26136d9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +1088 -30
  2. package/dist/index.browser.cjs +2760 -1925
  3. package/dist/index.browser.cjs.map +1 -1
  4. package/dist/index.browser.js +2756 -1926
  5. package/dist/index.browser.js.map +1 -1
  6. package/dist/index.native.js +2756 -1922
  7. package/dist/index.native.js.map +1 -1
  8. package/dist/index.node.cjs +2760 -1921
  9. package/dist/index.node.cjs.map +1 -1
  10. package/dist/index.node.js +2756 -1922
  11. package/dist/index.node.js.map +1 -1
  12. package/dist/types/context.d.ts +18 -16
  13. package/dist/types/loaders/account.d.ts +28 -0
  14. package/dist/types/loaders/block.d.ts +16 -0
  15. package/dist/types/loaders/common/resolve-info.d.ts +3 -0
  16. package/dist/types/loaders/program-accounts.d.ts +28 -0
  17. package/dist/types/loaders/transaction.d.ts +39 -0
  18. package/dist/types/resolvers/account.d.ts +8 -0
  19. package/dist/types/rpc.d.ts +7 -2
  20. package/dist/types/schema/account.d.ts +124 -0
  21. package/dist/types/schema/block.d.ts +17 -0
  22. package/dist/types/schema/common/inputs.d.ts +10 -0
  23. package/dist/types/schema/common/scalars.d.ts +13 -0
  24. package/dist/types/schema/common/types.d.ts +12 -0
  25. package/dist/types/schema/index.d.ts +2 -0
  26. package/dist/types/schema/instruction.d.ts +954 -0
  27. package/dist/types/schema/program-accounts.d.ts +12 -0
  28. package/dist/types/schema/transaction.d.ts +16 -0
  29. package/package.json +16 -11
  30. package/dist/types/cache.d.ts +0 -7
  31. package/dist/types/schema/account/index.d.ts +0 -3
  32. package/dist/types/schema/account/query.d.ts +0 -38
  33. package/dist/types/schema/account/types.d.ts +0 -5
  34. package/dist/types/schema/block/index.d.ts +0 -3
  35. package/dist/types/schema/block/query.d.ts +0 -42
  36. package/dist/types/schema/block/types.d.ts +0 -7
  37. package/dist/types/schema/inputs.d.ts +0 -9
  38. package/dist/types/schema/picks.d.ts +0 -36
  39. package/dist/types/schema/program-accounts/index.d.ts +0 -2
  40. package/dist/types/schema/program-accounts/query.d.ts +0 -47
  41. package/dist/types/schema/program-accounts/types.d.ts +0 -3
  42. package/dist/types/schema/scalars.d.ts +0 -3
  43. package/dist/types/schema/transaction/index.d.ts +0 -3
  44. package/dist/types/schema/transaction/query.d.ts +0 -33
  45. package/dist/types/schema/transaction/types.d.ts +0 -12
@@ -1,2198 +1,3033 @@
1
1
  'use strict';
2
2
 
3
3
  var graphql = require('graphql');
4
+ var DataLoader = require('dataloader');
5
+ var fastStableStringify = require('fast-stable-stringify');
6
+ var schema = require('@graphql-tools/schema');
7
+
8
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
9
+
10
+ var DataLoader__default = /*#__PURE__*/_interopDefault(DataLoader);
11
+ var fastStableStringify__default = /*#__PURE__*/_interopDefault(fastStableStringify);
4
12
 
5
13
  // src/rpc.ts
6
14
 
7
- // src/cache.ts
8
- var stringifyValue = (value) => JSON.stringify(value, (_, value2) => {
9
- if (typeof value2 === "bigint") {
10
- return value2.toString() + "n";
11
- }
12
- return value2;
13
- });
14
- var parseValue = (value) => JSON.parse(value, (_, value2) => {
15
- if (typeof value2 === "string" && /\d+n$/.test(value2)) {
16
- return BigInt(value2.slice(0, -1));
17
- }
18
- return value2;
19
- });
20
- var cacheKey = (key, variables) => `GraphQLCache:${stringifyValue(key)}:${stringifyValue(variables)}`;
21
- function createGraphQLCache() {
22
- return {
23
- // Browser
24
- flush: () => {
25
- for (let i = localStorage.length - 1; i >= 0; i--) {
26
- const storageKey = localStorage.key(i);
27
- if (storageKey && storageKey.startsWith("GraphQLCache:")) {
28
- localStorage.removeItem(storageKey);
29
- }
15
+ // src/loaders/common/resolve-info.ts
16
+ function onlyPresentFieldRequested(fieldName, info) {
17
+ if (info && info.fieldNodes[0].selectionSet) {
18
+ const selectionSet = info.fieldNodes[0].selectionSet;
19
+ const requestedFields = selectionSet.selections.map((field) => {
20
+ if (field.kind === "Field") {
21
+ return field.name.value;
30
22
  }
31
- },
32
- get: (key, variables) => {
33
- const value = localStorage.getItem(cacheKey(key, variables));
34
- return value === null ? null : parseValue(value);
35
- },
36
- insert: (key, variables, value) => {
37
- localStorage.setItem(cacheKey(key, variables), stringifyValue(value));
23
+ return null;
24
+ });
25
+ if (requestedFields && requestedFields.length === 1 && requestedFields[0] === fieldName) {
26
+ return true;
38
27
  }
39
- } ;
28
+ }
29
+ return false;
40
30
  }
41
31
 
42
- // src/context.ts
43
- async function resolveAccount({ address, encoding = "jsonParsed", ...config }, cache, rpc) {
44
- const requestConfig = { encoding, ...config };
45
- const cached = cache.get(address, requestConfig);
46
- if (cached !== null) {
47
- return cached;
48
- }
49
- const account = await rpc.getAccountInfo(address, requestConfig).send().then((res) => res.value).catch((e) => {
32
+ // src/loaders/account.ts
33
+ function normalizeArgs(args) {
34
+ const { address, commitment, dataSlice, encoding, minContextSlot } = args;
35
+ return {
36
+ address,
37
+ commitment: commitment ?? "confirmed",
38
+ dataSlice,
39
+ encoding: encoding ?? "jsonParsed",
40
+ minContextSlot
41
+ };
42
+ }
43
+ function refineJsonParsedAccountData(jsonParsedAccountData) {
44
+ const meta = {
45
+ program: jsonParsedAccountData.program,
46
+ space: jsonParsedAccountData.space,
47
+ type: jsonParsedAccountData.parsed.type
48
+ };
49
+ const data = jsonParsedAccountData.parsed.info;
50
+ return { data, meta };
51
+ }
52
+ function processQueryResponse({ address, account, encoding }) {
53
+ const [refinedData, responseEncoding] = Array.isArray(account.data) ? encoding === "jsonParsed" ? [account.data[0], "base64"] : [account.data[0], encoding] : [refineJsonParsedAccountData(account.data), "jsonParsed"];
54
+ const responseBase = {
55
+ ...account,
56
+ address,
57
+ encoding: responseEncoding
58
+ };
59
+ return typeof refinedData === "object" && "meta" in refinedData ? {
60
+ ...responseBase,
61
+ data: refinedData.data,
62
+ meta: refinedData.meta
63
+ } : {
64
+ ...responseBase,
65
+ data: refinedData
66
+ };
67
+ }
68
+ async function loadAccount(rpc, { address, ...config }) {
69
+ const { encoding } = config;
70
+ const account = await rpc.getAccountInfo(address, config).send().then((res) => res.value).catch((e) => {
50
71
  throw e;
51
72
  });
52
73
  if (account === null) {
53
- return null;
74
+ return { address };
54
75
  }
55
- const [data, responseEncoding] = Array.isArray(account.data) ? encoding === "jsonParsed" ? [account.data[0], "base64"] : [account.data[0], encoding] : [account.data, "jsonParsed"];
56
- const queryResponse = {
57
- ...account,
58
- data,
59
- encoding: responseEncoding
76
+ return processQueryResponse({ account, address, encoding });
77
+ }
78
+ function createAccountBatchLoadFn(rpc) {
79
+ const resolveAccountUsingRpc = loadAccount.bind(null, rpc);
80
+ return async (accountQueryArgs) => {
81
+ return await Promise.all(accountQueryArgs.map(async (args) => await resolveAccountUsingRpc(args)));
60
82
  };
61
- cache.insert(address, requestConfig, queryResponse);
62
- return queryResponse;
63
83
  }
64
- async function resolveBlock({ slot, encoding = "jsonParsed", ...config }, cache, rpc) {
65
- const requestConfig = { encoding, ...config };
66
- const cached = cache.get(slot, config);
67
- if (cached !== null) {
68
- return cached;
69
- }
70
- const block = await rpc.getBlock(slot, requestConfig).send();
71
- if (block === null) {
72
- return null;
73
- }
74
- cache.insert(slot, config, block);
75
- return block;
84
+ function createAccountLoader(rpc) {
85
+ const loader = new DataLoader__default.default(createAccountBatchLoadFn(rpc), { cacheKeyFn: fastStableStringify__default.default });
86
+ return {
87
+ load: async (args, info) => {
88
+ if (onlyPresentFieldRequested("address", info)) {
89
+ return { address: args.address };
90
+ }
91
+ return loader.load(normalizeArgs(args));
92
+ }
93
+ };
94
+ }
95
+ function normalizeArgs2(args) {
96
+ const { commitment, encoding, signature } = args;
97
+ return {
98
+ commitment: commitment ?? "confirmed",
99
+ encoding: encoding ?? "jsonParsed",
100
+ // Always use 0 to avoid silly errors
101
+ maxSupportedTransactionVersion: 0,
102
+ signature
103
+ };
76
104
  }
77
- async function resolveProgramAccounts({ programAddress, encoding = "jsonParsed", ...config }, cache, rpc) {
78
- const requestConfig = { encoding, ...config };
79
- const cached = cache.get(programAddress, requestConfig);
80
- if (cached !== null) {
81
- return cached;
105
+ function refineJsonParsedInstructionData(jsonParsedInstructionData) {
106
+ if ("parsed" in jsonParsedInstructionData) {
107
+ const meta = {
108
+ program: jsonParsedInstructionData.program,
109
+ type: jsonParsedInstructionData.parsed.type
110
+ };
111
+ const programId = jsonParsedInstructionData.programId;
112
+ const data = jsonParsedInstructionData.parsed.info;
113
+ return { data, meta, programId };
114
+ } else {
115
+ return jsonParsedInstructionData;
82
116
  }
83
- const programAccounts = await rpc.getProgramAccounts(programAddress, requestConfig).send().then((res) => {
84
- if ("value" in res) {
85
- return res.value;
117
+ }
118
+ function refineJsonParsedTransactionData(jsonParsedTransactionData) {
119
+ const refinedInstructions = jsonParsedTransactionData.message.instructions.map(
120
+ (instruction) => refineJsonParsedInstructionData(instruction)
121
+ );
122
+ const message = {
123
+ ...jsonParsedTransactionData.message,
124
+ instructions: refinedInstructions
125
+ };
126
+ return { message, signatures: jsonParsedTransactionData.signatures };
127
+ }
128
+ function refineJsonParsedTransactionMeta(jsonParsedTransactionMeta) {
129
+ const refinedInnerInstructions = jsonParsedTransactionMeta.innerInstructions.map(
130
+ ({ index, instructions }) => {
131
+ return {
132
+ index,
133
+ instructions: instructions.map((instruction) => refineJsonParsedInstructionData(instruction))
134
+ };
86
135
  }
87
- return res;
88
- }).catch((e) => {
136
+ );
137
+ return {
138
+ ...jsonParsedTransactionMeta,
139
+ innerInstructions: refinedInnerInstructions
140
+ };
141
+ }
142
+ function refineJsonParsedTransaction({ encoding, transaction }) {
143
+ const [transactionData, transactionMeta] = Array.isArray(transaction.transaction) ? [transaction.transaction[0], transaction.meta] : [refineJsonParsedTransactionData(transaction.transaction), refineJsonParsedTransactionMeta(transaction.meta)];
144
+ return {
145
+ data: transactionData,
146
+ encoding,
147
+ meta: transactionMeta,
148
+ slot: transaction.slot,
149
+ version: transaction.version
150
+ };
151
+ }
152
+ function processQueryResponse2({ encoding, transaction }) {
153
+ return refineJsonParsedTransaction({ encoding, transaction });
154
+ }
155
+ async function loadTransaction(rpc, { signature, ...config }) {
156
+ const { encoding } = config;
157
+ let transaction = await rpc.getTransaction(signature, config).send().catch((e) => {
89
158
  throw e;
90
159
  });
91
- const queryResponse = programAccounts.map((programAccount2) => {
92
- const [data, responseEncoding] = Array.isArray(programAccount2.account.data) ? encoding === "jsonParsed" ? [programAccount2.account.data[0], "base64"] : [programAccount2.account.data[0], encoding] : [programAccount2.account.data, "jsonParsed"];
93
- const pubkey = programAccount2.pubkey;
94
- const account = { ...programAccount2.account, data, encoding: responseEncoding };
95
- return {
96
- account,
97
- pubkey
98
- };
99
- });
100
- cache.insert(programAddress, requestConfig, queryResponse);
101
- return queryResponse;
102
- }
103
- async function resolveTransaction({ signature, encoding = "jsonParsed", ...config }, cache, rpc) {
104
- const requestConfig = { encoding, ...config };
105
- const cached = cache.get(signature, requestConfig);
106
- if (cached !== null) {
107
- return cached;
108
- }
109
- const transaction = await rpc.getTransaction(signature, requestConfig).send();
110
160
  if (transaction === null) {
111
161
  return null;
112
162
  }
113
- const [transactionData, responseEncoding, responseFormat] = Array.isArray(transaction.transaction) ? encoding === "jsonParsed" ? [transaction.transaction[0], "base64", "unparsed"] : [transaction.transaction[0], encoding, "unparsed"] : encoding === "jsonParsed" ? [transaction.transaction, encoding, "parsed"] : [transaction.transaction, encoding, "unparsed"];
114
- if (transaction.meta) {
115
- transaction.meta["format"] = responseFormat;
116
- }
117
- if (transactionData.message) {
118
- transactionData.message["format"] = responseFormat;
163
+ if (encoding !== "jsonParsed") {
164
+ const transactionJsonParsed = await rpc.getTransaction(signature, config).send().catch((e) => {
165
+ throw e;
166
+ });
167
+ if (transactionJsonParsed === null) {
168
+ return null;
169
+ }
170
+ transaction = {
171
+ ...transaction,
172
+ meta: transactionJsonParsed.meta
173
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
174
+ };
119
175
  }
120
- const queryResponse = {
121
- ...transaction,
122
- encoding: responseEncoding,
123
- transaction: transactionData
124
- };
125
- cache.insert(signature, requestConfig, queryResponse);
176
+ const queryResponse = processQueryResponse2({ encoding, transaction });
126
177
  return queryResponse;
127
178
  }
128
- function createSolanaGraphQLContext(rpc) {
129
- const cache = createGraphQLCache();
130
- return {
131
- cache,
132
- resolveAccount(args) {
133
- return resolveAccount(args, this.cache, this.rpc);
134
- },
135
- resolveBlock(args) {
136
- return resolveBlock(args, this.cache, this.rpc);
137
- },
138
- resolveProgramAccounts(args) {
139
- return resolveProgramAccounts(args, this.cache, this.rpc);
140
- },
141
- resolveTransaction(args) {
142
- return resolveTransaction(args, this.cache, this.rpc);
143
- },
144
- rpc
179
+ function createTransactionBatchLoadFn(rpc) {
180
+ const resolveTransactionUsingRpc = loadTransaction.bind(null, rpc);
181
+ return async (transactionQueryArgs) => {
182
+ return await Promise.all(transactionQueryArgs.map(async (args) => await resolveTransactionUsingRpc(args)));
145
183
  };
146
184
  }
147
- var BigIntScalar = () => new graphql.GraphQLScalarType({
148
- name: "BigInt",
149
- parseLiteral(ast) {
150
- if (ast.kind === graphql.Kind.STRING) {
151
- return BigInt(ast.value);
185
+ function createTransactionLoader(rpc) {
186
+ const loader = new DataLoader__default.default(createTransactionBatchLoadFn(rpc), { cacheKeyFn: fastStableStringify__default.default });
187
+ return {
188
+ load: async (args, info) => {
189
+ if (onlyPresentFieldRequested("signature", info)) {
190
+ return { signature: args.signature };
191
+ }
192
+ return loader.load(normalizeArgs2(args));
152
193
  }
153
- return null;
154
- },
155
- parseValue(value) {
156
- return BigInt(value);
157
- },
158
- serialize(value) {
159
- return BigInt(value);
160
- }
161
- });
194
+ };
195
+ }
162
196
 
163
- // src/schema/picks.ts
164
- function boolean() {
165
- return { type: graphql.GraphQLBoolean };
197
+ // src/loaders/block.ts
198
+ function normalizeArgs3(args) {
199
+ const { commitment, encoding, slot, transactionDetails } = args;
200
+ return {
201
+ commitment: commitment ?? "confirmed",
202
+ encoding: encoding ?? "jsonParsed",
203
+ // Always use 0 to avoid silly errors
204
+ maxSupportedTransactionVersion: 0,
205
+ slot,
206
+ transactionDetails: transactionDetails ?? "full"
207
+ };
166
208
  }
167
- var memoisedBigint;
168
- function bigint() {
169
- if (!memoisedBigint)
170
- memoisedBigint = { type: BigIntScalar() };
171
- return memoisedBigint;
209
+ function refineJsonParsedTransactionForAccounts({ transaction }) {
210
+ return {
211
+ data: transaction.transaction,
212
+ meta: transaction.meta,
213
+ version: transaction.version
214
+ };
215
+ }
216
+ function processQueryResponse3({
217
+ encoding,
218
+ block,
219
+ transactionDetails
220
+ }) {
221
+ if (typeof block === "object" && "transactions" in block) {
222
+ const refinedBlock = {
223
+ ...block,
224
+ transactions: block.transactions.map((transaction) => {
225
+ if (transactionDetails === "accounts") {
226
+ return refineJsonParsedTransactionForAccounts({ transaction });
227
+ } else {
228
+ return refineJsonParsedTransaction({ encoding, transaction });
229
+ }
230
+ })
231
+ };
232
+ block = refinedBlock;
233
+ }
234
+ return {
235
+ ...block,
236
+ encoding,
237
+ transactionDetails
238
+ };
172
239
  }
173
- function number() {
174
- return { type: graphql.GraphQLInt };
240
+ async function loadBlock(rpc, { slot, ...config }) {
241
+ const { encoding, transactionDetails } = config;
242
+ const block = await rpc.getBlock(slot, config).send().catch((e) => {
243
+ throw e;
244
+ });
245
+ if (block === null) {
246
+ return { slot };
247
+ }
248
+ const queryResponse = processQueryResponse3({ block, encoding, transactionDetails });
249
+ return queryResponse;
175
250
  }
176
- function string() {
177
- return { type: graphql.GraphQLString };
251
+ function createBlockBatchLoadFn(rpc) {
252
+ const resolveBlockUsingRpc = loadBlock.bind(null, rpc);
253
+ return async (blockQueryArgs) => {
254
+ return await Promise.all(blockQueryArgs.map(async (args) => await resolveBlockUsingRpc(args)));
255
+ };
178
256
  }
179
- function type(fieldType) {
257
+ function createBlockLoader(rpc) {
258
+ const loader = new DataLoader__default.default(createBlockBatchLoadFn(rpc), { cacheKeyFn: fastStableStringify__default.default });
180
259
  return {
181
- type: fieldType
260
+ load: async (args, info) => {
261
+ if (onlyPresentFieldRequested("slot", info)) {
262
+ return { slot: args.slot };
263
+ }
264
+ return loader.load(normalizeArgs3(args));
265
+ }
182
266
  };
183
267
  }
184
- function nonNull(fieldType) {
268
+ function normalizeArgs4(args) {
269
+ const { commitment, dataSlice, encoding, filters, minContextSlot, programAddress } = args;
185
270
  return {
186
- type: new graphql.GraphQLNonNull(fieldType.type)
271
+ commitment: commitment ?? "confirmed",
272
+ dataSlice,
273
+ encoding: encoding ?? "jsonParsed",
274
+ filters,
275
+ minContextSlot,
276
+ programAddress
277
+ };
278
+ }
279
+ function processQueryResponse4({ encoding, programAccounts }) {
280
+ return programAccounts.map((programAccount) => {
281
+ const [refinedData, responseEncoding] = Array.isArray(programAccount.account.data) ? encoding === "jsonParsed" ? [programAccount.account.data[0], "base64"] : [programAccount.account.data[0], encoding] : [refineJsonParsedAccountData(programAccount.account.data), "jsonParsed"];
282
+ const pubkey = programAccount.pubkey;
283
+ const responseBase = {
284
+ ...programAccount.account,
285
+ address: pubkey,
286
+ encoding: responseEncoding
287
+ };
288
+ return typeof refinedData === "object" && "meta" in refinedData ? {
289
+ ...responseBase,
290
+ data: refinedData.data,
291
+ meta: refinedData.meta
292
+ } : {
293
+ ...responseBase,
294
+ data: refinedData
295
+ };
296
+ });
297
+ }
298
+ async function loadProgramAccounts(rpc, { programAddress, ...config }) {
299
+ const { encoding } = config;
300
+ const programAccounts = await rpc.getProgramAccounts(programAddress, config).send().then((res) => {
301
+ if ("value" in res) {
302
+ return res.value;
303
+ }
304
+ return res;
305
+ }).catch((e) => {
306
+ throw e;
307
+ });
308
+ const queryResponse = processQueryResponse4({ encoding, programAccounts });
309
+ return queryResponse;
310
+ }
311
+ function createProgramAccountsBatchLoadFn(rpc) {
312
+ const resolveProgramAccountsUsingRpc = loadProgramAccounts.bind(null, rpc);
313
+ return async (programAccountsQueryArgs) => {
314
+ return await Promise.all(
315
+ programAccountsQueryArgs.map(async (args) => await resolveProgramAccountsUsingRpc(args))
316
+ );
187
317
  };
188
318
  }
189
- function list(elementType) {
319
+ function createProgramAccountsLoader(rpc) {
320
+ const loader = new DataLoader__default.default(createProgramAccountsBatchLoadFn(rpc), { cacheKeyFn: fastStableStringify__default.default });
190
321
  return {
191
- type: new graphql.GraphQLList(elementType.type)
322
+ load: async (args, info) => {
323
+ if (onlyPresentFieldRequested("programAddress", info)) {
324
+ return { programAddress: args.programAddress };
325
+ }
326
+ return loader.load(normalizeArgs4(args));
327
+ }
192
328
  };
193
329
  }
194
- function object(name, fields) {
330
+
331
+ // src/context.ts
332
+ function createSolanaGraphQLContext(rpc) {
195
333
  return {
196
- type: new graphql.GraphQLObjectType({
197
- fields,
198
- name
199
- })
334
+ loaders: {
335
+ account: createAccountLoader(rpc),
336
+ block: createBlockLoader(rpc),
337
+ programAccounts: createProgramAccountsLoader(rpc),
338
+ transaction: createTransactionLoader(rpc)
339
+ },
340
+ rpc
200
341
  };
201
342
  }
202
343
 
203
- // src/schema/inputs.ts
204
- var memoisedAccountEncodingInputType;
205
- var accountEncodingInputType = () => {
206
- if (!memoisedAccountEncodingInputType)
207
- memoisedAccountEncodingInputType = new graphql.GraphQLEnumType({
208
- name: "AccountEncoding",
209
- values: {
210
- base58: {
211
- value: "base58"
212
- },
213
- base64: {
214
- value: "base64"
215
- },
216
- base64Zstd: {
217
- value: "base64+zstd"
218
- },
219
- jsonParsed: {
220
- value: "jsonParsed"
221
- }
222
- }
223
- });
224
- return memoisedAccountEncodingInputType;
344
+ // src/resolvers/account.ts
345
+ var resolveAccount = (fieldName) => {
346
+ return (parent, args, context, info) => parent[fieldName] === null ? null : context.loaders.account.load({ ...args, address: parent[fieldName] }, info);
225
347
  };
226
- var memoisedBlockTransactionDetailsInputType;
227
- var blockTransactionDetailsInputType = () => {
228
- if (!memoisedBlockTransactionDetailsInputType)
229
- memoisedBlockTransactionDetailsInputType = new graphql.GraphQLEnumType({
230
- name: "BlockTransactionDetails",
231
- values: {
232
- accounts: {
233
- value: "accounts"
234
- },
235
- full: {
236
- value: "full"
237
- },
238
- none: {
239
- value: "none"
240
- },
241
- signatures: {
242
- value: "signatures"
243
- }
348
+
349
+ // src/schema/account.ts
350
+ var accountTypeDefs = (
351
+ /* GraphQL */
352
+ `
353
+ # Account interface
354
+ interface Account {
355
+ address: String
356
+ encoding: String
357
+ executable: Boolean
358
+ lamports: BigInt
359
+ owner: Account
360
+ rentEpoch: BigInt
361
+ }
362
+
363
+ # An account with base58 encoded data
364
+ type AccountBase58 implements Account {
365
+ address: String
366
+ data: String
367
+ encoding: String
368
+ executable: Boolean
369
+ lamports: BigInt
370
+ owner: Account
371
+ rentEpoch: BigInt
372
+ }
373
+
374
+ # An account with base64 encoded data
375
+ type AccountBase64 implements Account {
376
+ address: String
377
+ data: String
378
+ encoding: String
379
+ executable: Boolean
380
+ lamports: BigInt
381
+ owner: Account
382
+ rentEpoch: BigInt
383
+ }
384
+
385
+ # An account with base64+zstd encoded data
386
+ type AccountBase64Zstd implements Account {
387
+ address: String
388
+ data: String
389
+ encoding: String
390
+ executable: Boolean
391
+ lamports: BigInt
392
+ owner: Account
393
+ rentEpoch: BigInt
394
+ }
395
+
396
+ # Interface for JSON-parsed meta
397
+ type JsonParsedAccountMeta {
398
+ program: String
399
+ space: BigInt
400
+ type: String
401
+ }
402
+ interface AccountJsonParsed {
403
+ meta: JsonParsedAccountMeta
404
+ }
405
+
406
+ # A nonce account
407
+ type NonceAccountFeeCalculator {
408
+ lamportsPerSignature: String
409
+ }
410
+ type NonceAccountData {
411
+ authority: Account
412
+ blockhash: String
413
+ feeCalculator: NonceAccountFeeCalculator
414
+ }
415
+ type NonceAccount implements Account & AccountJsonParsed {
416
+ address: String
417
+ data: NonceAccountData
418
+ encoding: String
419
+ executable: Boolean
420
+ lamports: BigInt
421
+ meta: JsonParsedAccountMeta
422
+ owner: Account
423
+ rentEpoch: BigInt
424
+ }
425
+
426
+ # A lookup table account
427
+ type LookupTableAccountData {
428
+ addresses: [String]
429
+ authority: Account
430
+ deactivationSlot: String
431
+ lastExtendedSlot: String
432
+ lastExtendedSlotStartIndex: Int
433
+ }
434
+ type LookupTableAccount implements Account & AccountJsonParsed {
435
+ address: String
436
+ data: LookupTableAccountData
437
+ encoding: String
438
+ executable: Boolean
439
+ lamports: BigInt
440
+ meta: JsonParsedAccountMeta
441
+ owner: Account
442
+ rentEpoch: BigInt
443
+ }
444
+
445
+ # A mint account
446
+ type MintAccountData {
447
+ decimals: Int
448
+ freezeAuthority: Account
449
+ isInitialized: Boolean
450
+ mintAuthority: Account
451
+ supply: String
452
+ }
453
+ type MintAccount implements Account & AccountJsonParsed {
454
+ address: String
455
+ data: MintAccountData
456
+ encoding: String
457
+ executable: Boolean
458
+ lamports: BigInt
459
+ meta: JsonParsedAccountMeta
460
+ owner: Account
461
+ rentEpoch: BigInt
462
+ }
463
+
464
+ # A token account
465
+ type TokenAccountData {
466
+ isNative: Boolean
467
+ mint: Account
468
+ owner: Account
469
+ state: String
470
+ tokenAmount: TokenAmount
471
+ }
472
+ type TokenAccount implements Account & AccountJsonParsed {
473
+ address: String
474
+ data: TokenAccountData
475
+ encoding: String
476
+ executable: Boolean
477
+ lamports: BigInt
478
+ meta: JsonParsedAccountMeta
479
+ owner: Account
480
+ rentEpoch: BigInt
481
+ }
482
+
483
+ # A stake account
484
+ type StakeAccountDataMetaAuthorized {
485
+ staker: Account
486
+ withdrawer: Account
487
+ }
488
+ type StakeAccountDataMetaLockup {
489
+ custodian: Account
490
+ epoch: BigInt
491
+ unixTimestamp: BigInt
492
+ }
493
+ type StakeAccountDataMeta {
494
+ authorized: StakeAccountDataMetaAuthorized
495
+ lockup: StakeAccountDataMetaLockup
496
+ rentExemptReserve: String
497
+ }
498
+ type StakeAccountDataStakeDelegation {
499
+ activationEpoch: BigInt
500
+ deactivationEpoch: BigInt
501
+ stake: String
502
+ voter: Account
503
+ warmupCooldownRate: Int
504
+ }
505
+ type StakeAccountDataStake {
506
+ creditsObserved: BigInt
507
+ delegation: StakeAccountDataStakeDelegation
508
+ }
509
+ type StakeAccountData {
510
+ meta: StakeAccountDataMeta
511
+ stake: StakeAccountDataStake
512
+ }
513
+ type StakeAccount implements Account & AccountJsonParsed {
514
+ address: String
515
+ data: StakeAccountData
516
+ encoding: String
517
+ executable: Boolean
518
+ lamports: BigInt
519
+ meta: JsonParsedAccountMeta
520
+ owner: Account
521
+ rentEpoch: BigInt
522
+ }
523
+
524
+ # A vote account
525
+ type VoteAccountDataAuthorizedVoter {
526
+ authorizedVoter: Account
527
+ epoch: BigInt
528
+ }
529
+ type VoteAccountDataEpochCredit {
530
+ credits: String
531
+ epoch: BigInt
532
+ previousCredits: String
533
+ }
534
+ type VoteAccountDataLastTimestamp {
535
+ slot: BigInt
536
+ timestamp: BigInt
537
+ }
538
+ type VoteAccountDataVote {
539
+ confirmationCount: Int
540
+ slot: BigInt
541
+ }
542
+ type VoteAccountData {
543
+ authorizedVoters: [VoteAccountDataAuthorizedVoter]
544
+ authorizedWithdrawer: Account
545
+ commission: Int
546
+ epochCredits: [VoteAccountDataEpochCredit]
547
+ lastTimestamp: VoteAccountDataLastTimestamp
548
+ node: Account
549
+ priorVoters: [String]
550
+ rootSlot: BigInt
551
+ votes: [VoteAccountDataVote]
552
+ }
553
+ type VoteAccount implements Account & AccountJsonParsed {
554
+ address: String
555
+ data: VoteAccountData
556
+ encoding: String
557
+ executable: Boolean
558
+ lamports: BigInt
559
+ meta: JsonParsedAccountMeta
560
+ owner: Account
561
+ rentEpoch: BigInt
562
+ }
563
+ `
564
+ );
565
+ var accountResolvers = {
566
+ Account: {
567
+ __resolveType(account) {
568
+ if (account.encoding === "base58") {
569
+ return "AccountBase58";
244
570
  }
245
- });
246
- return memoisedBlockTransactionDetailsInputType;
247
- };
248
- var memoisedCommitmentInputType;
249
- var commitmentInputType = () => {
250
- if (!memoisedCommitmentInputType)
251
- memoisedCommitmentInputType = new graphql.GraphQLEnumType({
252
- name: "Commitment",
253
- values: {
254
- confirmed: {
255
- value: "confirmed"
256
- },
257
- finalized: {
258
- value: "finalized"
259
- },
260
- processed: {
261
- value: "processed"
262
- }
571
+ if (account.encoding === "base64") {
572
+ return "AccountBase64";
263
573
  }
264
- });
265
- return memoisedCommitmentInputType;
266
- };
267
- var memoisedDataSliceInputType;
268
- var dataSliceInputType = () => {
269
- if (!memoisedDataSliceInputType)
270
- memoisedDataSliceInputType = new graphql.GraphQLInputObjectType({
271
- fields: {
272
- length: number(),
273
- offset: number()
274
- },
275
- name: "DataSliceConfig"
276
- });
277
- return memoisedDataSliceInputType;
278
- };
279
- var memoisedMaxSupportedTransactionVersionInputType;
280
- var maxSupportedTransactionVersionInputType = () => {
281
- if (!memoisedMaxSupportedTransactionVersionInputType)
282
- memoisedMaxSupportedTransactionVersionInputType = new graphql.GraphQLEnumType({
283
- name: "MaxSupportedTransactionVersion",
284
- values: {
285
- legacy: {
286
- value: "legacy"
287
- },
288
- zero: {
289
- value: "0"
290
- }
574
+ if (account.encoding === "base64+zstd") {
575
+ return "AccountBase64Zstd";
291
576
  }
292
- });
293
- return memoisedMaxSupportedTransactionVersionInputType;
294
- };
295
- var memoisedProgramAccountFilterInputType;
296
- var programAccountFilterInputType = () => {
297
- if (!memoisedProgramAccountFilterInputType)
298
- memoisedProgramAccountFilterInputType = new graphql.GraphQLInputObjectType({
299
- fields: {
300
- bytes: bigint(),
301
- dataSize: bigint(),
302
- encoding: string(),
303
- offset: bigint()
304
- },
305
- name: "ProgramAccountFilter"
306
- });
307
- return memoisedProgramAccountFilterInputType;
308
- };
309
- var memoisedTransactionEncodingInputType;
310
- var transactionEncodingInputType = () => {
311
- if (!memoisedTransactionEncodingInputType)
312
- memoisedTransactionEncodingInputType = new graphql.GraphQLEnumType({
313
- name: "TransactionEncoding",
314
- values: {
315
- base58: {
316
- value: "base58"
317
- },
318
- base64: {
319
- value: "base64"
320
- },
321
- json: {
322
- value: "json"
323
- },
324
- jsonParsed: {
325
- value: "jsonParsed"
577
+ if (account.encoding === "jsonParsed") {
578
+ if (account.meta.program === "nonce") {
579
+ return "NonceAccount";
326
580
  }
327
- }
328
- });
329
- return memoisedTransactionEncodingInputType;
330
- };
331
- var memoisedTokenAmountType;
332
- var tokenAmountType = () => {
333
- if (!memoisedTokenAmountType) {
334
- memoisedTokenAmountType = new graphql.GraphQLObjectType({
335
- fields: {
336
- amount: string(),
337
- decimals: number(),
338
- uiAmount: bigint(),
339
- uiAmountString: string()
340
- },
341
- name: "TokenAmount"
342
- });
343
- }
344
- return memoisedTokenAmountType;
345
- };
346
- var memoisedAccountInterfaceFields;
347
- var accountInterfaceFields = () => {
348
- if (!memoisedAccountInterfaceFields) {
349
- memoisedAccountInterfaceFields = {
350
- encoding: string(),
351
- executable: boolean(),
352
- lamports: bigint(),
353
- rentEpoch: bigint()
354
- };
355
- }
356
- return memoisedAccountInterfaceFields;
357
- };
358
- var memoisedAccountInterface;
359
- var accountInterface = () => {
360
- if (!memoisedAccountInterface) {
361
- memoisedAccountInterface = new graphql.GraphQLInterfaceType({
362
- description: "A Solana account",
363
- fields: () => ({
364
- ...accountInterfaceFields(),
365
- owner: type(accountInterface())
366
- }),
367
- name: "Account",
368
- resolveType(account) {
369
- if (account.encoding === "base58") {
370
- return "AccountBase58";
581
+ if (account.meta.type === "mint" && account.meta.program === "spl-token") {
582
+ return "MintAccount";
371
583
  }
372
- if (account.encoding === "base64") {
373
- return "AccountBase64";
584
+ if (account.meta.type === "account" && account.meta.program === "spl-token") {
585
+ return "TokenAccount";
374
586
  }
375
- if (account.encoding === "base64+zstd") {
376
- return "AccountBase64Zstd";
587
+ if (account.meta.program === "stake") {
588
+ return "StakeAccount";
377
589
  }
378
- if (account.encoding === "jsonParsed") {
379
- if (account.data.parsed.type === "mint" && account.data.program === "spl-token") {
380
- return "MintAccount";
381
- }
382
- if (account.data.parsed.type === "account" && account.data.program === "spl-token") {
383
- return "TokenAccount";
384
- }
385
- if (account.data.program === "nonce") {
386
- return "NonceAccount";
387
- }
388
- if (account.data.program === "stake") {
389
- return "StakeAccount";
390
- }
391
- if (account.data.parsed.type === "vote" && account.data.program === "vote") {
392
- return "VoteAccount";
393
- }
394
- if (account.data.parsed.type === "lookupTable" && account.data.program === "address-lookup-table") {
395
- return "LookupTableAccount";
396
- }
590
+ if (account.meta.type === "vote" && account.meta.program === "vote") {
591
+ return "VoteAccount";
592
+ }
593
+ if (account.meta.type === "lookupTable" && account.meta.program === "address-lookup-table") {
594
+ return "LookupTableAccount";
397
595
  }
398
- return "AccountBase64";
399
596
  }
400
- });
597
+ return "AccountBase64";
598
+ }
599
+ },
600
+ AccountBase58: {
601
+ owner: resolveAccount("owner")
602
+ },
603
+ AccountBase64: {
604
+ owner: resolveAccount("owner")
605
+ },
606
+ AccountBase64Zstd: {
607
+ owner: resolveAccount("owner")
608
+ },
609
+ NonceAccountData: {
610
+ authority: resolveAccount("authority")
611
+ },
612
+ NonceAccount: {
613
+ owner: resolveAccount("owner")
614
+ },
615
+ LookupTableAccountData: {
616
+ authority: resolveAccount("authority")
617
+ },
618
+ LookupTableAccount: {
619
+ owner: resolveAccount("owner")
620
+ },
621
+ MintAccountData: {
622
+ freezeAuthority: resolveAccount("freezeAuthority"),
623
+ mintAuthority: resolveAccount("mintAuthority")
624
+ },
625
+ MintAccount: {
626
+ owner: resolveAccount("owner")
627
+ },
628
+ TokenAccountData: {
629
+ mint: resolveAccount("mint"),
630
+ owner: resolveAccount("owner")
631
+ },
632
+ TokenAccount: {
633
+ owner: resolveAccount("owner")
634
+ },
635
+ StakeAccountDataMetaAuthorized: {
636
+ staker: resolveAccount("staker"),
637
+ withdrawer: resolveAccount("withdrawer")
638
+ },
639
+ StakeAccountDataMetaLockup: {
640
+ custodian: resolveAccount("custodian")
641
+ },
642
+ StakeAccountDataStakeDelegation: {
643
+ voter: resolveAccount("voter")
644
+ },
645
+ StakeAccount: {
646
+ owner: resolveAccount("owner")
647
+ },
648
+ VoteAccountDataAuthorizedVoter: {
649
+ authorizedVoter: resolveAccount("authorizedVoter")
650
+ },
651
+ VoteAccountData: {
652
+ authorizedWithdrawer: resolveAccount("authorizedWithdrawer"),
653
+ node: resolveAccount("nodePubkey")
654
+ },
655
+ VoteAccount: {
656
+ owner: resolveAccount("owner")
401
657
  }
402
- return memoisedAccountInterface;
403
658
  };
404
- var accountType = (name, description, data) => new graphql.GraphQLObjectType({
405
- description,
406
- fields: {
407
- ...accountInterfaceFields(),
408
- data,
409
- owner: {
410
- args: {
411
- commitment: type(commitmentInputType()),
412
- dataSlice: type(dataSliceInputType()),
413
- encoding: type(accountEncodingInputType()),
414
- minContextSlot: bigint()
415
- },
416
- resolve: (parent, args, context) => context.resolveAccount({ ...args, address: parent.owner }),
417
- type: accountInterface()
418
- }
419
- },
420
- interfaces: [accountInterface()],
421
- name
422
- });
423
- var accountDataJsonParsed = (name, parsedInfoFields) => object(name + "Data", {
424
- parsed: object(name + "DataParsed", {
425
- info: object(name + "DataParsedInfo", parsedInfoFields),
426
- type: string()
427
- }),
428
- program: string(),
429
- space: bigint()
430
- });
431
- var memoisedAccountBase58;
432
- var accountBase58 = () => {
433
- if (!memoisedAccountBase58)
434
- memoisedAccountBase58 = accountType("AccountBase58", "A Solana account with base58 encoded data", string());
435
- return memoisedAccountBase58;
659
+
660
+ // src/schema/block.ts
661
+ var blockTypeDefs = (
662
+ /* GraphQL */
663
+ `
664
+ type TransactionMetaForAccounts {
665
+ err: String
666
+ fee: BigInt
667
+ postBalances: [BigInt]
668
+ postTokenBalances: [TokenBalance]
669
+ preBalances: [BigInt]
670
+ preTokenBalances: [TokenBalance]
671
+ status: TransactionStatus
672
+ }
673
+
674
+ type TransactionDataForAccounts {
675
+ accountKeys: [String]
676
+ signatures: [String]
677
+ }
678
+
679
+ type BlockTransactionAccounts {
680
+ meta: TransactionMetaForAccounts
681
+ data: TransactionDataForAccounts
682
+ version: String
683
+ }
684
+
685
+ # Block interface
686
+ interface Block {
687
+ blockhash: String
688
+ blockHeight: BigInt
689
+ blockTime: Int
690
+ parentSlot: BigInt
691
+ previousBlockhash: String
692
+ rewards: [Reward]
693
+ transactionDetails: String
694
+ }
695
+
696
+ # A block with account transaction details
697
+ type BlockWithAccounts implements Block {
698
+ blockhash: String
699
+ blockHeight: BigInt
700
+ blockTime: Int
701
+ parentSlot: BigInt
702
+ previousBlockhash: String
703
+ rewards: [Reward]
704
+ transactions: [BlockTransactionAccounts]
705
+ transactionDetails: String
706
+ }
707
+
708
+ # A block with full transaction details
709
+ type BlockWithFull implements Block {
710
+ blockhash: String
711
+ blockHeight: BigInt
712
+ blockTime: Int
713
+ parentSlot: BigInt
714
+ previousBlockhash: String
715
+ rewards: [Reward]
716
+ transactions: [Transaction]
717
+ transactionDetails: String
718
+ }
719
+
720
+ # A block with none transaction details
721
+ type BlockWithNone implements Block {
722
+ blockhash: String
723
+ blockHeight: BigInt
724
+ blockTime: Int
725
+ parentSlot: BigInt
726
+ previousBlockhash: String
727
+ rewards: [Reward]
728
+ transactionDetails: String
729
+ }
730
+
731
+ # A block with signature transaction details
732
+ type BlockWithSignatures implements Block {
733
+ blockhash: String
734
+ blockHeight: BigInt
735
+ blockTime: Int
736
+ parentSlot: BigInt
737
+ previousBlockhash: String
738
+ rewards: [Reward]
739
+ signatures: [String]
740
+ transactionDetails: String
741
+ }
742
+ `
743
+ );
744
+ var blockResolvers = {
745
+ Block: {
746
+ __resolveType(block) {
747
+ switch (block.transactionDetails) {
748
+ case "accounts":
749
+ return "BlockWithAccounts";
750
+ case "none":
751
+ return "BlockWithNone";
752
+ case "signatures":
753
+ return "BlockWithSignatures";
754
+ default:
755
+ return "BlockWithFull";
756
+ }
757
+ }
758
+ }
436
759
  };
437
- var memoisedAccountBase64;
438
- var accountBase64 = () => {
439
- if (!memoisedAccountBase64)
440
- memoisedAccountBase64 = accountType("AccountBase64", "A Solana account with base64 encoded data", string());
441
- return memoisedAccountBase64;
760
+
761
+ // src/schema/common/inputs.ts
762
+ var inputTypeDefs = (
763
+ /* GraphQL */
764
+ `
765
+ enum AccountEncoding {
766
+ base58
767
+ base64
768
+ base64Zstd
769
+ jsonParsed
770
+ }
771
+
772
+ enum BlockTransactionDetails {
773
+ accounts
774
+ full
775
+ none
776
+ signatures
777
+ }
778
+
779
+ enum Commitment {
780
+ confirmed
781
+ finalized
782
+ processed
783
+ }
784
+
785
+ input DataSlice {
786
+ offset: Int
787
+ length: Int
788
+ }
789
+
790
+ input ProgramAccountsFilter {
791
+ bytes: BigInt
792
+ dataSize: BigInt
793
+ encoding: String
794
+ offset: BigInt
795
+ }
796
+
797
+ enum TransactionEncoding {
798
+ base58
799
+ base64
800
+ jsonParsed
801
+ }
802
+
803
+ enum TransactionVersion {
804
+ legacy
805
+ zero
806
+ }
807
+ `
808
+ );
809
+ var inputResolvers = {
810
+ AccountEncoding: {
811
+ base64Zstd: "base64+zstd"
812
+ },
813
+ TransactionVersion: {
814
+ zero: 0
815
+ }
442
816
  };
443
- var memoisedAccountBase64Zstd;
444
- var accountBase64Zstd = () => {
445
- if (!memoisedAccountBase64Zstd)
446
- memoisedAccountBase64Zstd = accountType(
447
- "AccountBase64Zstd",
448
- "A Solana account with base64 encoded data compressed with zstd",
449
- string()
450
- );
451
- return memoisedAccountBase64Zstd;
817
+ var scalarTypeDefs = (
818
+ /* GraphQL */
819
+ `
820
+ scalar BigInt
821
+ `
822
+ );
823
+ var scalarResolvers = {
824
+ BigInt: {
825
+ __parseLiteral(ast) {
826
+ if (ast.kind === graphql.Kind.STRING) {
827
+ return BigInt(ast.value);
828
+ }
829
+ return null;
830
+ },
831
+ __parseValue(value) {
832
+ return BigInt(value);
833
+ },
834
+ __serialize(value) {
835
+ return BigInt(value);
836
+ }
837
+ }
452
838
  };
453
- var memoisedAccountNonceAccount;
454
- var accountNonceAccount = () => {
455
- if (!memoisedAccountNonceAccount)
456
- memoisedAccountNonceAccount = accountType(
457
- "NonceAccount",
458
- "A nonce account",
459
- accountDataJsonParsed("Nonce", {
460
- authority: string(),
461
- blockhash: string(),
462
- feeCalculator: object("NonceFeeCalculator", {
463
- lamportsPerSignature: string()
464
- })
465
- })
466
- );
467
- return memoisedAccountNonceAccount;
468
- };
469
- var memoisedAccountLookupTable;
470
- var accountLookupTable = () => {
471
- if (!memoisedAccountLookupTable)
472
- memoisedAccountLookupTable = accountType(
473
- "LookupTableAccount",
474
- "An address lookup table account",
475
- accountDataJsonParsed("LookupTable", {
476
- addresses: list(string()),
477
- authority: string(),
478
- deactivationSlot: string(),
479
- lastExtendedSlot: string(),
480
- lastExtendedSlotStartIndex: number()
481
- })
482
- );
483
- return memoisedAccountLookupTable;
484
- };
485
- var memoisedAccountMint;
486
- var accountMint = () => {
487
- if (!memoisedAccountMint)
488
- memoisedAccountMint = accountType(
489
- "MintAccount",
490
- "An SPL mint",
491
- accountDataJsonParsed("Mint", {
492
- decimals: number(),
493
- freezeAuthority: string(),
494
- isInitialized: boolean(),
495
- mintAuthority: string(),
496
- supply: string()
497
- })
498
- );
499
- return memoisedAccountMint;
500
- };
501
- var memoisedAccountTokenAccount;
502
- var accountTokenAccount = () => {
503
- if (!memoisedAccountTokenAccount)
504
- memoisedAccountTokenAccount = accountType(
505
- "TokenAccount",
506
- "An SPL token account",
507
- accountDataJsonParsed("TokenAccount", {
508
- isNative: boolean(),
509
- mint: string(),
510
- owner: string(),
511
- state: string(),
512
- tokenAmount: type(tokenAmountType())
513
- })
514
- );
515
- return memoisedAccountTokenAccount;
516
- };
517
- var memoisedAccountStakeAccount;
518
- var accountStakeAccount = () => {
519
- if (!memoisedAccountStakeAccount)
520
- memoisedAccountStakeAccount = accountType(
521
- "StakeAccount",
522
- "A stake account",
523
- accountDataJsonParsed("Stake", {
524
- meta: object("StakeMeta", {
525
- authorized: object("StakeMetaAuthorized", {
526
- staker: string(),
527
- withdrawer: string()
528
- }),
529
- lockup: object("StakeMetaLockup", {
530
- custodian: string(),
531
- epoch: bigint(),
532
- unixTimestamp: bigint()
533
- }),
534
- rentExemptReserve: string()
535
- }),
536
- stake: object("StakeStake", {
537
- creditsObserved: bigint(),
538
- delegation: object("StakeStakeDelegation", {
539
- activationEpoch: bigint(),
540
- deactivationEpoch: bigint(),
541
- stake: string(),
542
- voter: string(),
543
- warmupCooldownRate: number()
544
- })
545
- })
546
- })
547
- );
548
- return memoisedAccountStakeAccount;
549
- };
550
- var memoisedAccountVoteAccount;
551
- var accountVoteAccount = () => {
552
- if (!memoisedAccountVoteAccount)
553
- memoisedAccountVoteAccount = accountType(
554
- "VoteAccount",
555
- "A vote account",
556
- accountDataJsonParsed("Vote", {
557
- authorizedVoters: list(
558
- object("VoteAuthorizedVoter", {
559
- authorizedVoter: string(),
560
- epoch: bigint()
561
- })
562
- ),
563
- authorizedWithdrawer: string(),
564
- commission: number(),
565
- epochCredits: list(
566
- object("VoteEpochCredits", {
567
- credits: string(),
568
- epoch: bigint(),
569
- previousCredits: string()
570
- })
571
- ),
572
- lastTimestamp: object("VoteLastTimestamp", {
573
- slot: bigint(),
574
- timestamp: bigint()
575
- }),
576
- nodePubkey: string(),
577
- priorVoters: list(string()),
578
- rootSlot: bigint(),
579
- votes: list(
580
- object("VoteVote", {
581
- confirmationCount: number(),
582
- slot: bigint()
583
- })
584
- )
585
- })
586
- );
587
- return memoisedAccountVoteAccount;
588
- };
589
- var memoisedAccountTypes;
590
- var accountTypes = () => {
591
- if (!memoisedAccountTypes)
592
- memoisedAccountTypes = [
593
- accountBase58(),
594
- accountBase64(),
595
- accountBase64Zstd(),
596
- accountNonceAccount(),
597
- accountLookupTable(),
598
- accountMint(),
599
- accountTokenAccount(),
600
- accountStakeAccount(),
601
- accountVoteAccount()
602
- ];
603
- return memoisedAccountTypes;
839
+
840
+ // src/schema/common/types.ts
841
+ var commonTypeDefs = (
842
+ /* GraphQL */
843
+ `
844
+ type ReturnData {
845
+ data: String
846
+ programId: String
847
+ }
848
+
849
+ type Reward {
850
+ commission: Int
851
+ lamports: BigInt
852
+ postBalance: BigInt
853
+ pubkey: String
854
+ rewardType: String
855
+ }
856
+
857
+ type TokenAmount {
858
+ amount: String
859
+ decimals: Int
860
+ uiAmount: BigInt
861
+ uiAmountString: String
862
+ }
863
+
864
+ type TokenBalance {
865
+ accountIndex: Int
866
+ mint: Account
867
+ owner: Account
868
+ programId: String
869
+ uiTokenAmount: TokenAmount
870
+ }
871
+ `
872
+ );
873
+ var commonResolvers = {
874
+ TokenBalance: {
875
+ mint: resolveAccount("mint"),
876
+ owner: resolveAccount("owner")
877
+ }
604
878
  };
605
879
 
606
- // src/schema/account/query.ts
607
- var accountQuery = () => ({
608
- account: {
609
- args: {
610
- address: nonNull(string()),
611
- commitment: type(commitmentInputType()),
612
- dataSlice: type(dataSliceInputType()),
613
- encoding: type(accountEncodingInputType()),
614
- minContextSlot: bigint()
615
- },
616
- resolve: (_parent, args, context) => context.resolveAccount(args),
617
- type: accountInterface()
618
- }
619
- });
620
- var memoisedTokenBalance;
621
- var tokenBalance = () => {
622
- if (!memoisedTokenBalance)
623
- memoisedTokenBalance = new graphql.GraphQLObjectType({
624
- fields: {
625
- accountIndex: number(),
626
- mint: string(),
627
- owner: string(),
628
- programId: string(),
629
- uiAmountString: string()
630
- },
631
- name: "TokenBalance"
632
- });
633
- return memoisedTokenBalance;
634
- };
635
- var memoisedTransactionStatus;
636
- var transactionStatus = () => {
637
- if (!memoisedTransactionStatus)
638
- memoisedTransactionStatus = new graphql.GraphQLUnionType({
639
- name: "TransactionStatus",
640
- types: [
641
- new graphql.GraphQLObjectType({
642
- fields: {
643
- Err: string()
644
- },
645
- name: "TransactionStatusError"
646
- }),
647
- new graphql.GraphQLObjectType({
648
- fields: {
649
- Ok: string()
650
- },
651
- name: "TransactionStatusOk"
652
- })
653
- ]
654
- });
655
- return memoisedTransactionStatus;
656
- };
657
- var memoisedReward;
658
- var reward = () => {
659
- if (!memoisedReward)
660
- memoisedReward = new graphql.GraphQLObjectType({
661
- fields: {
662
- commission: number(),
663
- lamports: bigint(),
664
- postBalance: bigint(),
665
- pubkey: string(),
666
- rewardType: string()
667
- },
668
- name: "Reward"
669
- });
670
- return memoisedReward;
671
- };
672
- var memoisedAddressTableLookup;
673
- var addressTableLookup = () => {
674
- if (!memoisedAddressTableLookup)
675
- memoisedAddressTableLookup = new graphql.GraphQLObjectType({
676
- fields: {
677
- accountKey: string(),
678
- readableIndexes: list(number()),
679
- writableIndexes: list(number())
680
- },
681
- name: "AddressTableLookup"
682
- });
683
- return memoisedAddressTableLookup;
684
- };
685
- var memoisedReturnData;
686
- var returnData = () => {
687
- if (!memoisedReturnData)
688
- memoisedReturnData = new graphql.GraphQLObjectType({
689
- fields: {
690
- data: string(),
691
- programId: string()
692
- },
693
- name: "ReturnData"
694
- });
695
- return memoisedReturnData;
696
- };
697
- var memoisedTransactionInstruction;
698
- var transactionInstruction = () => {
699
- if (!memoisedTransactionInstruction)
700
- memoisedTransactionInstruction = new graphql.GraphQLObjectType({
701
- fields: {
702
- accounts: list(number()),
703
- data: string(),
704
- programIdIndex: number()
705
- },
706
- name: "TransactionInstruction"
707
- });
708
- return memoisedTransactionInstruction;
709
- };
710
- var memoisedTransactionMetaLoadedAddresses;
711
- var transactionMetaLoadedAddresses = () => {
712
- if (!memoisedTransactionMetaLoadedAddresses)
713
- memoisedTransactionMetaLoadedAddresses = new graphql.GraphQLObjectType({
714
- fields: {
715
- readonly: list(string()),
716
- // Base58 encoded addresses
717
- writable: list(string())
718
- // Base58 encoded addresses
719
- },
720
- name: "TransactionMetaLoadedAddresses"
721
- });
722
- return memoisedTransactionMetaLoadedAddresses;
723
- };
724
- var memoisedParsedTransactionInstructionInterface;
725
- var parsedTransactionInstructionInterface = () => {
726
- if (!memoisedParsedTransactionInstructionInterface)
727
- memoisedParsedTransactionInstructionInterface = new graphql.GraphQLInterfaceType({
728
- fields: {
729
- programId: string()
730
- },
731
- name: "ParsedTransactionInstruction",
732
- resolveType(instruction) {
733
- if (instruction.program === "address-lookup-table") {
734
- if (instruction.info.type === "createLookupTable") {
880
+ // src/schema/instruction.ts
881
+ var instructionTypeDefs = (
882
+ /* GraphQL */
883
+ `
884
+ type JsonParsedInstructionMeta {
885
+ program: String
886
+ type: String
887
+ }
888
+
889
+ # Transaction instruction interface
890
+ interface TransactionInstruction {
891
+ programId: String
892
+ }
893
+
894
+ # Generic transaction instruction
895
+ type GenericInstruction implements TransactionInstruction {
896
+ accounts: [String]
897
+ data: String
898
+ programId: String
899
+ }
900
+
901
+ # AddressLookupTable: CreateLookupTable
902
+ type CreateLookupTableInstructionData {
903
+ bumpSeed: BigInt # FIXME:*
904
+ lookupTableAccount: Account
905
+ lookupTableAuthority: Account
906
+ payerAccount: Account
907
+ recentSlot: BigInt
908
+ systemProgram: Account
909
+ }
910
+ type CreateLookupTableInstruction implements TransactionInstruction {
911
+ data: CreateLookupTableInstructionData
912
+ meta: JsonParsedInstructionMeta
913
+ programId: String
914
+ }
915
+
916
+ # AddressLookupTable: ExtendLookupTable
917
+ type ExtendLookupTableInstructionData {
918
+ lookupTableAccount: Account
919
+ lookupTableAuthority: Account
920
+ newAddresses: [String]
921
+ payerAccount: Account
922
+ systemProgram: Account
923
+ }
924
+ type ExtendLookupTableInstruction implements TransactionInstruction {
925
+ data: ExtendLookupTableInstructionData
926
+ meta: JsonParsedInstructionMeta
927
+ programId: String
928
+ }
929
+
930
+ # AddressLookupTable: FreezeLookupTable
931
+ type FreezeLookupTableInstructionData {
932
+ lookupTableAccount: Account
933
+ lookupTableAuthority: Account
934
+ }
935
+ type FreezeLookupTableInstruction implements TransactionInstruction {
936
+ data: FreezeLookupTableInstructionData
937
+ meta: JsonParsedInstructionMeta
938
+ programId: String
939
+ }
940
+
941
+ # AddressLookupTable: DeactivateLookupTable
942
+ type DeactivateLookupTableInstructionData {
943
+ lookupTableAccount: Account
944
+ lookupTableAuthority: Account
945
+ }
946
+ type DeactivateLookupTableInstruction implements TransactionInstruction {
947
+ data: DeactivateLookupTableInstructionData
948
+ meta: JsonParsedInstructionMeta
949
+ programId: String
950
+ }
951
+
952
+ # AddressLookupTable: CloseLookupTable
953
+ type CloseLookupTableInstructionData {
954
+ lookupTableAccount: Account
955
+ lookupTableAuthority: Account
956
+ recipient: Account
957
+ }
958
+ type CloseLookupTableInstruction implements TransactionInstruction {
959
+ data: CloseLookupTableInstructionData
960
+ meta: JsonParsedInstructionMeta
961
+ programId: String
962
+ }
963
+
964
+ # BpfLoader: Write
965
+ type BpfLoaderWriteInstructionData {
966
+ account: Account
967
+ bytes: String
968
+ offset: BigInt # FIXME:*
969
+ }
970
+ type BpfLoaderWriteInstruction implements TransactionInstruction {
971
+ data: BpfLoaderWriteInstructionData
972
+ meta: JsonParsedInstructionMeta
973
+ programId: String
974
+ }
975
+
976
+ # BpfLoader: Finalize
977
+ type BpfLoaderFinalizeInstructionData {
978
+ account: Account
979
+ }
980
+ type BpfLoaderFinalizeInstruction implements TransactionInstruction {
981
+ data: BpfLoaderFinalizeInstructionData
982
+ meta: JsonParsedInstructionMeta
983
+ programId: String
984
+ }
985
+
986
+ # BpfUpgradeableLoader: InitializeBuffer
987
+ type BpfUpgradeableLoaderInitializeBufferInstructionData {
988
+ account: Account
989
+ }
990
+ type BpfUpgradeableLoaderInitializeBufferInstruction implements TransactionInstruction {
991
+ data: BpfUpgradeableLoaderInitializeBufferInstructionData
992
+ meta: JsonParsedInstructionMeta
993
+ programId: String
994
+ }
995
+
996
+ # BpfUpgradeableLoader: Write
997
+ type BpfUpgradeableLoaderWriteInstructionData {
998
+ account: Account
999
+ authority: Account
1000
+ bytes: String
1001
+ offset: BigInt # FIXME:*
1002
+ }
1003
+ type BpfUpgradeableLoaderWriteInstruction implements TransactionInstruction {
1004
+ data: BpfUpgradeableLoaderWriteInstructionData
1005
+ meta: JsonParsedInstructionMeta
1006
+ programId: String
1007
+ }
1008
+
1009
+ # BpfUpgradeableLoader: DeployWithMaxDataLen
1010
+ type BpfUpgradeableLoaderDeployWithMaxDataLenInstructionData {
1011
+ authority: Account
1012
+ bufferAccount: Account
1013
+ clockSysvar: String
1014
+ maxDataLen: BigInt
1015
+ payerAccount: Account
1016
+ programAccount: Account
1017
+ programDataAccount: Account
1018
+ rentSysvar: String
1019
+ }
1020
+ type BpfUpgradeableLoaderDeployWithMaxDataLenInstruction implements TransactionInstruction {
1021
+ data: BpfUpgradeableLoaderDeployWithMaxDataLenInstructionData
1022
+ meta: JsonParsedInstructionMeta
1023
+ programId: String
1024
+ }
1025
+
1026
+ # BpfUpgradeableLoader: Upgrade
1027
+ type BpfUpgradeableLoaderUpgradeInstructionData {
1028
+ authority: Account
1029
+ bufferAccount: Account
1030
+ clockSysvar: String
1031
+ programAccount: Account
1032
+ programDataAccount: Account
1033
+ rentSysvar: String
1034
+ spillAccount: Account
1035
+ }
1036
+ type BpfUpgradeableLoaderUpgradeInstruction implements TransactionInstruction {
1037
+ data: BpfUpgradeableLoaderUpgradeInstructionData
1038
+ meta: JsonParsedInstructionMeta
1039
+ programId: String
1040
+ }
1041
+
1042
+ # BpfUpgradeableLoader: SetAuthority
1043
+ type BpfUpgradeableLoaderSetAuthorityInstructionData {
1044
+ account: Account
1045
+ authority: Account
1046
+ newAuthority: Account
1047
+ }
1048
+ type BpfUpgradeableLoaderSetAuthorityInstruction implements TransactionInstruction {
1049
+ data: BpfUpgradeableLoaderSetAuthorityInstructionData
1050
+ meta: JsonParsedInstructionMeta
1051
+ programId: String
1052
+ }
1053
+
1054
+ # BpfUpgradeableLoader: SetAuthorityChecked
1055
+ type BpfUpgradeableLoaderSetAuthorityCheckedInstructionData {
1056
+ account: Account
1057
+ authority: Account
1058
+ newAuthority: Account
1059
+ }
1060
+ type BpfUpgradeableLoaderSetAuthorityCheckedInstruction implements TransactionInstruction {
1061
+ data: BpfUpgradeableLoaderSetAuthorityCheckedInstructionData
1062
+ meta: JsonParsedInstructionMeta
1063
+ programId: String
1064
+ }
1065
+
1066
+ # BpfUpgradeableLoader: Close
1067
+ type BpfUpgradeableLoaderCloseInstructionData {
1068
+ account: Account
1069
+ authority: Account
1070
+ programAccount: Account
1071
+ recipient: Account
1072
+ }
1073
+ type BpfUpgradeableLoaderCloseInstruction implements TransactionInstruction {
1074
+ data: BpfUpgradeableLoaderCloseInstructionData
1075
+ meta: JsonParsedInstructionMeta
1076
+ programId: String
1077
+ }
1078
+
1079
+ # BpfUpgradeableLoader: ExtendProgram
1080
+ type BpfUpgradeableLoaderExtendProgramInstructionData {
1081
+ additionalBytes: BigInt
1082
+ payerAccount: Account
1083
+ programAccount: Account
1084
+ programDataAccount: Account
1085
+ systemProgram: Account
1086
+ }
1087
+ type BpfUpgradeableLoaderExtendProgramInstruction implements TransactionInstruction {
1088
+ data: BpfUpgradeableLoaderExtendProgramInstructionData
1089
+ meta: JsonParsedInstructionMeta
1090
+ programId: String
1091
+ }
1092
+
1093
+ # SplAssociatedTokenAccount: Create
1094
+ type SplAssociatedTokenCreateInstructionData {
1095
+ account: Account
1096
+ mint: String
1097
+ source: Account
1098
+ systemProgram: Account
1099
+ tokenProgram: Account
1100
+ wallet: Account
1101
+ }
1102
+ type SplAssociatedTokenCreateInstruction implements TransactionInstruction {
1103
+ data: SplAssociatedTokenCreateInstructionData
1104
+ meta: JsonParsedInstructionMeta
1105
+ programId: String
1106
+ }
1107
+
1108
+ # SplAssociatedTokenAccount: CreateIdempotent
1109
+ type SplAssociatedTokenCreateIdempotentInstructionData {
1110
+ account: Account
1111
+ mint: String
1112
+ source: Account
1113
+ systemProgram: Account
1114
+ tokenProgram: Account
1115
+ wallet: Account
1116
+ }
1117
+ type SplAssociatedTokenCreateIdempotentInstruction implements TransactionInstruction {
1118
+ data: SplAssociatedTokenCreateIdempotentInstructionData
1119
+ meta: JsonParsedInstructionMeta
1120
+ programId: String
1121
+ }
1122
+
1123
+ # SplAssociatedTokenAccount: RecoverNested
1124
+ type SplAssociatedTokenRecoverNestedInstructionData {
1125
+ destination: Account
1126
+ nestedMint: Account
1127
+ nestedOwner: Account
1128
+ nestedSource: Account
1129
+ ownerMint: Account
1130
+ tokenProgram: Account
1131
+ wallet: Account
1132
+ }
1133
+ type SplAssociatedTokenRecoverNestedInstruction implements TransactionInstruction {
1134
+ data: SplAssociatedTokenRecoverNestedInstructionData
1135
+ meta: JsonParsedInstructionMeta
1136
+ programId: String
1137
+ }
1138
+
1139
+ # SplMemo
1140
+ type SplMemoInstructionData {
1141
+ data: String
1142
+ }
1143
+ type SplMemoInstruction implements TransactionInstruction {
1144
+ data: SplMemoInstructionData
1145
+ meta: JsonParsedInstructionMeta
1146
+ programId: String
1147
+ }
1148
+
1149
+ # SplToken: InitializeMint
1150
+ type SplTokenInitializeMintInstructionData {
1151
+ decimals: BigInt # FIXME:*
1152
+ freezeAuthority: Account
1153
+ mint: Account
1154
+ mintAuthority: Account
1155
+ rentSysvar: String
1156
+ }
1157
+ type SplTokenInitializeMintInstruction implements TransactionInstruction {
1158
+ data: SplTokenInitializeMintInstructionData
1159
+ meta: JsonParsedInstructionMeta
1160
+ programId: String
1161
+ }
1162
+
1163
+ # SplToken: InitializeMint2
1164
+ type SplTokenInitializeMint2InstructionData {
1165
+ decimals: BigInt # FIXME:*
1166
+ freezeAuthority: Account
1167
+ mint: Account
1168
+ mintAuthority: Account
1169
+ }
1170
+ type SplTokenInitializeMint2Instruction implements TransactionInstruction {
1171
+ data: SplTokenInitializeMint2InstructionData
1172
+ meta: JsonParsedInstructionMeta
1173
+ programId: String
1174
+ }
1175
+
1176
+ # SplToken: InitializeAccount
1177
+ type SplTokenInitializeAccountInstructionData {
1178
+ account: Account
1179
+ mint: Account
1180
+ owner: Account
1181
+ rentSysvar: String
1182
+ }
1183
+ type SplTokenInitializeAccountInstruction implements TransactionInstruction {
1184
+ data: SplTokenInitializeAccountInstructionData
1185
+ meta: JsonParsedInstructionMeta
1186
+ programId: String
1187
+ }
1188
+
1189
+ # SplToken: InitializeAccount2
1190
+ type SplTokenInitializeAccount2InstructionData {
1191
+ account: Account
1192
+ mint: Account
1193
+ owner: Account
1194
+ rentSysvar: String
1195
+ }
1196
+ type SplTokenInitializeAccount2Instruction implements TransactionInstruction {
1197
+ data: SplTokenInitializeAccount2InstructionData
1198
+ meta: JsonParsedInstructionMeta
1199
+ programId: String
1200
+ }
1201
+
1202
+ # SplToken: InitializeAccount3
1203
+ type SplTokenInitializeAccount3InstructionData {
1204
+ account: Account
1205
+ mint: Account
1206
+ owner: Account
1207
+ }
1208
+ type SplTokenInitializeAccount3Instruction implements TransactionInstruction {
1209
+ data: SplTokenInitializeAccount3InstructionData
1210
+ meta: JsonParsedInstructionMeta
1211
+ programId: String
1212
+ }
1213
+
1214
+ # SplToken: InitializeMultisig
1215
+ type SplTokenInitializeMultisigInstructionData {
1216
+ m: BigInt # FIXME:*
1217
+ multisig: Account
1218
+ rentSysvar: String
1219
+ signers: [String]
1220
+ }
1221
+ type SplTokenInitializeMultisigInstruction implements TransactionInstruction {
1222
+ data: SplTokenInitializeMultisigInstructionData
1223
+ meta: JsonParsedInstructionMeta
1224
+ programId: String
1225
+ }
1226
+
1227
+ # SplToken: InitializeMultisig2
1228
+ type SplTokenInitializeMultisig2InstructionData {
1229
+ m: BigInt # FIXME:*
1230
+ multisig: Account
1231
+ signers: [String]
1232
+ }
1233
+ type SplTokenInitializeMultisig2Instruction implements TransactionInstruction {
1234
+ data: SplTokenInitializeMultisig2InstructionData
1235
+ meta: JsonParsedInstructionMeta
1236
+ programId: String
1237
+ }
1238
+
1239
+ # SplToken: Transfer
1240
+ type SplTokenTransferInstructionData {
1241
+ amount: String
1242
+ authority: Account
1243
+ destination: Account
1244
+ multisigAuthority: Account
1245
+ source: Account
1246
+ }
1247
+ type SplTokenTransferInstruction implements TransactionInstruction {
1248
+ data: SplTokenTransferInstructionData
1249
+ meta: JsonParsedInstructionMeta
1250
+ programId: String
1251
+ }
1252
+
1253
+ # SplToken: Approve
1254
+ type SplTokenApproveInstructionData {
1255
+ amount: String
1256
+ delegate: Account
1257
+ multisigOwner: Account
1258
+ owner: Account
1259
+ source: Account
1260
+ }
1261
+ type SplTokenApproveInstruction implements TransactionInstruction {
1262
+ data: SplTokenApproveInstructionData
1263
+ meta: JsonParsedInstructionMeta
1264
+ programId: String
1265
+ }
1266
+
1267
+ # SplToken: Revoke
1268
+ type SplTokenRevokeInstructionData {
1269
+ multisigOwner: Account
1270
+ owner: Account
1271
+ source: Account
1272
+ }
1273
+ type SplTokenRevokeInstruction implements TransactionInstruction {
1274
+ data: SplTokenRevokeInstructionData
1275
+ meta: JsonParsedInstructionMeta
1276
+ programId: String
1277
+ }
1278
+
1279
+ # SplToken: SetAuthority
1280
+ type SplTokenSetAuthorityInstructionData {
1281
+ authority: Account
1282
+ authorityType: String
1283
+ multisigAuthority: Account
1284
+ newAuthority: Account
1285
+ }
1286
+ type SplTokenSetAuthorityInstruction implements TransactionInstruction {
1287
+ data: SplTokenSetAuthorityInstructionData
1288
+ meta: JsonParsedInstructionMeta
1289
+ programId: String
1290
+ }
1291
+
1292
+ # SplToken: MintTo
1293
+ type SplTokenMintToInstructionData {
1294
+ account: Account
1295
+ amount: String
1296
+ authority: Account
1297
+ mint: Account
1298
+ mintAuthority: Account
1299
+ multisigMintAuthority: Account
1300
+ }
1301
+ type SplTokenMintToInstruction implements TransactionInstruction {
1302
+ data: SplTokenMintToInstructionData
1303
+ meta: JsonParsedInstructionMeta
1304
+ programId: String
1305
+ }
1306
+
1307
+ # SplToken: Burn
1308
+ type SplTokenBurnInstructionData {
1309
+ account: Account
1310
+ amount: String
1311
+ authority: Account
1312
+ mint: Account
1313
+ multisigAuthority: Account
1314
+ }
1315
+ type SplTokenBurnInstruction implements TransactionInstruction {
1316
+ data: SplTokenBurnInstructionData
1317
+ meta: JsonParsedInstructionMeta
1318
+ programId: String
1319
+ }
1320
+
1321
+ # SplToken: CloseAccount
1322
+ type SplTokenCloseAccountInstructionData {
1323
+ account: Account
1324
+ destination: Account
1325
+ multisigOwner: Account
1326
+ owner: Account
1327
+ }
1328
+ type SplTokenCloseAccountInstruction implements TransactionInstruction {
1329
+ data: SplTokenCloseAccountInstructionData
1330
+ meta: JsonParsedInstructionMeta
1331
+ programId: String
1332
+ }
1333
+
1334
+ # SplToken: FreezeAccount
1335
+ type SplTokenFreezeAccountInstructionData {
1336
+ account: Account
1337
+ freezeAuthority: Account
1338
+ mint: Account
1339
+ multisigFreezeAuthority: Account
1340
+ }
1341
+ type SplTokenFreezeAccountInstruction implements TransactionInstruction {
1342
+ data: SplTokenFreezeAccountInstructionData
1343
+ meta: JsonParsedInstructionMeta
1344
+ programId: String
1345
+ }
1346
+
1347
+ # SplToken: ThawAccount
1348
+ type SplTokenThawAccountInstructionData {
1349
+ account: Account
1350
+ freezeAuthority: Account
1351
+ mint: Account
1352
+ multisigFreezeAuthority: Account
1353
+ }
1354
+ type SplTokenThawAccountInstruction implements TransactionInstruction {
1355
+ data: SplTokenThawAccountInstructionData
1356
+ meta: JsonParsedInstructionMeta
1357
+ programId: String
1358
+ }
1359
+
1360
+ # SplToken: TransferChecked
1361
+ type SplTokenTransferCheckedInstructionData {
1362
+ amount: String
1363
+ authority: Account
1364
+ decimals: BigInt # FIXME:*
1365
+ destination: Account
1366
+ mint: Account
1367
+ multisigAuthority: Account
1368
+ source: Account
1369
+ tokenAmount: String
1370
+ }
1371
+ type SplTokenTransferCheckedInstruction implements TransactionInstruction {
1372
+ data: SplTokenTransferCheckedInstructionData
1373
+ meta: JsonParsedInstructionMeta
1374
+ programId: String
1375
+ }
1376
+
1377
+ # SplToken: ApproveChecked
1378
+ type SplTokenApproveCheckedInstructionData {
1379
+ delegate: Account
1380
+ mint: Account
1381
+ multisigOwner: Account
1382
+ owner: Account
1383
+ source: Account
1384
+ tokenAmount: String
1385
+ }
1386
+ type SplTokenApproveCheckedInstruction implements TransactionInstruction {
1387
+ data: SplTokenApproveCheckedInstructionData
1388
+ meta: JsonParsedInstructionMeta
1389
+ programId: String
1390
+ }
1391
+
1392
+ # SplToken: MintToChecked
1393
+ type SplTokenMintToCheckedInstructionData {
1394
+ account: Account
1395
+ authority: Account
1396
+ mint: Account
1397
+ mintAuthority: Account
1398
+ multisigMintAuthority: Account
1399
+ tokenAmount: String
1400
+ }
1401
+ type SplTokenMintToCheckedInstruction implements TransactionInstruction {
1402
+ data: SplTokenMintToCheckedInstructionData
1403
+ meta: JsonParsedInstructionMeta
1404
+ programId: String
1405
+ }
1406
+
1407
+ # SplToken: BurnChecked
1408
+ type SplTokenBurnCheckedInstructionData {
1409
+ account: Account
1410
+ authority: Account
1411
+ mint: Account
1412
+ multisigAuthority: Account
1413
+ tokenAmount: String
1414
+ }
1415
+ type SplTokenBurnCheckedInstruction implements TransactionInstruction {
1416
+ data: SplTokenBurnCheckedInstructionData
1417
+ meta: JsonParsedInstructionMeta
1418
+ programId: String
1419
+ }
1420
+
1421
+ # SplToken: SyncNative
1422
+ type SplTokenSyncNativeInstructionData {
1423
+ account: Account
1424
+ }
1425
+ type SplTokenSyncNativeInstruction implements TransactionInstruction {
1426
+ data: SplTokenSyncNativeInstructionData
1427
+ meta: JsonParsedInstructionMeta
1428
+ programId: String
1429
+ }
1430
+
1431
+ # SplToken: GetAccountDataSize
1432
+ type SplTokenGetAccountDataSizeInstructionData {
1433
+ extensionTypes: [String]
1434
+ mint: Account
1435
+ }
1436
+ type SplTokenGetAccountDataSizeInstruction implements TransactionInstruction {
1437
+ data: SplTokenGetAccountDataSizeInstructionData
1438
+ meta: JsonParsedInstructionMeta
1439
+ programId: String
1440
+ }
1441
+
1442
+ # SplToken: InitializeImmutableOwner
1443
+ type SplTokenInitializeImmutableOwnerInstructionData {
1444
+ account: Account
1445
+ }
1446
+ type SplTokenInitializeImmutableOwnerInstruction implements TransactionInstruction {
1447
+ data: SplTokenInitializeImmutableOwnerInstructionData
1448
+ meta: JsonParsedInstructionMeta
1449
+ programId: String
1450
+ }
1451
+
1452
+ # SplToken: AmountToUiAmount
1453
+ type SplTokenAmountToUiAmountInstructionData {
1454
+ amount: String
1455
+ mint: Account
1456
+ }
1457
+ type SplTokenAmountToUiAmountInstruction implements TransactionInstruction {
1458
+ data: SplTokenAmountToUiAmountInstructionData
1459
+ meta: JsonParsedInstructionMeta
1460
+ programId: String
1461
+ }
1462
+
1463
+ # SplToken: UiAmountToAmount
1464
+ type SplTokenUiAmountToAmountInstructionData {
1465
+ mint: Account
1466
+ uiAmount: String
1467
+ }
1468
+ type SplTokenUiAmountToAmountInstruction implements TransactionInstruction {
1469
+ data: SplTokenUiAmountToAmountInstructionData
1470
+ meta: JsonParsedInstructionMeta
1471
+ programId: String
1472
+ }
1473
+
1474
+ # SplToken: InitializeMintCloseAuthority
1475
+ type SplTokenInitializeMintCloseAuthorityInstructionData {
1476
+ mint: Account
1477
+ newAuthority: Account
1478
+ }
1479
+ type SplTokenInitializeMintCloseAuthorityInstruction implements TransactionInstruction {
1480
+ data: SplTokenInitializeMintCloseAuthorityInstructionData
1481
+ meta: JsonParsedInstructionMeta
1482
+ programId: String
1483
+ }
1484
+
1485
+ # TODO: Extensions!
1486
+ # - TransferFeeExtension
1487
+ # - ConfidentialTransferFeeExtension
1488
+ # - DefaultAccountStateExtension
1489
+ # - Reallocate
1490
+ # - MemoTransferExtension
1491
+ # - CreateNativeMint
1492
+ # - InitializeNonTransferableMint
1493
+ # - InterestBearingMintExtension
1494
+ # - CpiGuardExtension
1495
+ # - InitializePermanentDelegate
1496
+ # - TransferHookExtension
1497
+ # - ConfidentialTransferFeeExtension
1498
+ # - WithdrawExcessLamports
1499
+ # - MetadataPointerExtension
1500
+
1501
+ type Lockup {
1502
+ custodian: Account
1503
+ epoch: BigInt
1504
+ unixTimestamp: BigInt
1505
+ }
1506
+
1507
+ # Stake: Initialize
1508
+ type StakeInitializeInstructionDataAuthorized {
1509
+ staker: Account
1510
+ withdrawer: Account
1511
+ }
1512
+ type StakeInitializeInstructionData {
1513
+ authorized: StakeInitializeInstructionDataAuthorized
1514
+ lockup: Lockup
1515
+ rentSysvar: String
1516
+ stakeAccount: Account
1517
+ }
1518
+ type StakeInitializeInstruction implements TransactionInstruction {
1519
+ data: StakeInitializeInstructionData
1520
+ meta: JsonParsedInstructionMeta
1521
+ programId: String
1522
+ }
1523
+
1524
+ # Stake: Authorize
1525
+ type StakeAuthorizeInstructionData {
1526
+ authority: Account
1527
+ authorityType: String
1528
+ clockSysvar: String
1529
+ custodian: Account
1530
+ newAuthority: Account
1531
+ stakeAccount: Account
1532
+ }
1533
+ type StakeAuthorizeInstruction implements TransactionInstruction {
1534
+ data: StakeAuthorizeInstructionData
1535
+ meta: JsonParsedInstructionMeta
1536
+ programId: String
1537
+ }
1538
+
1539
+ # Stake: DelegateStake
1540
+ type StakeDelegateStakeInstructionData {
1541
+ clockSysvar: String
1542
+ stakeAccount: Account
1543
+ stakeAuthority: Account
1544
+ stakeConfigAccount: Account
1545
+ stakeHistorySysvar: String
1546
+ voteAccount: Account
1547
+ }
1548
+ type StakeDelegateStakeInstruction implements TransactionInstruction {
1549
+ data: StakeDelegateStakeInstructionData
1550
+ meta: JsonParsedInstructionMeta
1551
+ programId: String
1552
+ }
1553
+
1554
+ # Stake: Split
1555
+ type StakeSplitInstructionData {
1556
+ lamports: BigInt
1557
+ newSplitAccount: Account
1558
+ stakeAccount: Account
1559
+ stakeAuthority: Account
1560
+ }
1561
+ type StakeSplitInstruction implements TransactionInstruction {
1562
+ data: StakeSplitInstructionData
1563
+ meta: JsonParsedInstructionMeta
1564
+ programId: String
1565
+ }
1566
+
1567
+ # Stake: Withdraw
1568
+ type StakeWithdrawInstructionData {
1569
+ clockSysvar: String
1570
+ destination: Account
1571
+ lamports: BigInt
1572
+ stakeAccount: Account
1573
+ withdrawAuthority: Account
1574
+ }
1575
+ type StakeWithdrawInstruction implements TransactionInstruction {
1576
+ data: StakeWithdrawInstructionData
1577
+ meta: JsonParsedInstructionMeta
1578
+ programId: String
1579
+ }
1580
+
1581
+ # Stake: Deactivate
1582
+ type StakeDeactivateInstructionData {
1583
+ clockSysvar: String
1584
+ stakeAccount: Account
1585
+ stakeAuthority: Account
1586
+ }
1587
+ type StakeDeactivateInstruction implements TransactionInstruction {
1588
+ data: StakeDeactivateInstructionData
1589
+ meta: JsonParsedInstructionMeta
1590
+ programId: String
1591
+ }
1592
+
1593
+ # Stake: SetLockup
1594
+ type StakeSetLockupInstructionData {
1595
+ custodian: Account
1596
+ lockup: Lockup
1597
+ stakeAccount: Account
1598
+ }
1599
+ type StakeSetLockupInstruction implements TransactionInstruction {
1600
+ data: StakeSetLockupInstructionData
1601
+ meta: JsonParsedInstructionMeta
1602
+ programId: String
1603
+ }
1604
+
1605
+ # Stake: Merge
1606
+ type StakeMergeInstructionData {
1607
+ clockSysvar: String
1608
+ destination: Account
1609
+ source: Account
1610
+ stakeAuthority: Account
1611
+ stakeHistorySysvar: String
1612
+ }
1613
+ type StakeMergeInstruction implements TransactionInstruction {
1614
+ data: StakeMergeInstructionData
1615
+ meta: JsonParsedInstructionMeta
1616
+ programId: String
1617
+ }
1618
+
1619
+ # Stake: AuthorizeWithSeed
1620
+ type StakeAuthorizeWithSeedInstructionData {
1621
+ authorityBase: Account
1622
+ authorityOwner: Account
1623
+ authoritySeed: String
1624
+ authorityType: String
1625
+ clockSysvar: String
1626
+ custodian: Account
1627
+ newAuthorized: Account
1628
+ stakeAccount: Account
1629
+ }
1630
+ type StakeAuthorizeWithSeedInstruction implements TransactionInstruction {
1631
+ data: StakeAuthorizeWithSeedInstructionData
1632
+ meta: JsonParsedInstructionMeta
1633
+ programId: String
1634
+ }
1635
+
1636
+ # Stake: InitializeChecked
1637
+ type StakeInitializeCheckedInstructionDataAuthorized {
1638
+ rentSysvar: String
1639
+ stakeAccount: Account
1640
+ staker: Account
1641
+ withdrawer: Account
1642
+ }
1643
+ type StakeInitializeCheckedInstruction implements TransactionInstruction {
1644
+ data: StakeInitializeCheckedInstructionDataAuthorized
1645
+ meta: JsonParsedInstructionMeta
1646
+ programId: String
1647
+ }
1648
+
1649
+ # Stake: AuthorizeChecked
1650
+ type StakeAuthorizeCheckedInstructionData {
1651
+ authority: Account
1652
+ authorityType: String
1653
+ clockSysvar: String
1654
+ custodian: Account
1655
+ newAuthority: Account
1656
+ stakeAccount: Account
1657
+ }
1658
+ type StakeAuthorizeCheckedInstruction implements TransactionInstruction {
1659
+ data: StakeAuthorizeCheckedInstructionData
1660
+ meta: JsonParsedInstructionMeta
1661
+ programId: String
1662
+ }
1663
+
1664
+ # Stake: AuthorizeCheckedWithSeed
1665
+ type StakeAuthorizeCheckedWithSeedInstructionData {
1666
+ authorityBase: Account
1667
+ authorityOwner: Account
1668
+ authoritySeed: String
1669
+ authorityType: String
1670
+ clockSysvar: String
1671
+ custodian: Account
1672
+ newAuthorized: Account
1673
+ stakeAccount: Account
1674
+ }
1675
+ type StakeAuthorizeCheckedWithSeedInstruction implements TransactionInstruction {
1676
+ data: StakeAuthorizeCheckedWithSeedInstructionData
1677
+ meta: JsonParsedInstructionMeta
1678
+ programId: String
1679
+ }
1680
+
1681
+ # Stake: SetLockupChecked
1682
+ type StakeSetLockupCheckedInstructionData {
1683
+ custodian: Account
1684
+ lockup: Lockup
1685
+ stakeAccount: Account
1686
+ }
1687
+ type StakeSetLockupCheckedInstruction implements TransactionInstruction {
1688
+ data: StakeSetLockupCheckedInstructionData
1689
+ meta: JsonParsedInstructionMeta
1690
+ programId: String
1691
+ }
1692
+
1693
+ # Stake: DeactivateDelinquent
1694
+ type StakeDeactivateDelinquentInstructionData {
1695
+ referenceVoteAccount: Account
1696
+ stakeAccount: Account
1697
+ voteAccount: Account
1698
+ }
1699
+ type StakeDeactivateDelinquentInstruction implements TransactionInstruction {
1700
+ data: StakeDeactivateDelinquentInstructionData
1701
+ meta: JsonParsedInstructionMeta
1702
+ programId: String
1703
+ }
1704
+
1705
+ # Stake: Redelegate
1706
+ type StakeRedelegateInstructionData {
1707
+ newStakeAccount: Account
1708
+ stakeAccount: Account
1709
+ stakeAuthority: Account
1710
+ stakeConfigAccount: Account
1711
+ voteAccount: Account
1712
+ }
1713
+ type StakeRedelegateInstruction implements TransactionInstruction {
1714
+ data: StakeRedelegateInstructionData
1715
+ meta: JsonParsedInstructionMeta
1716
+ programId: String
1717
+ }
1718
+
1719
+ # System: CreateAccount
1720
+ type CreateAccountInstructionData {
1721
+ lamports: BigInt
1722
+ newAccount: Account
1723
+ owner: Account
1724
+ source: Account
1725
+ space: BigInt
1726
+ }
1727
+ type CreateAccountInstruction implements TransactionInstruction {
1728
+ data: CreateAccountInstructionData
1729
+ meta: JsonParsedInstructionMeta
1730
+ programId: String
1731
+ }
1732
+
1733
+ # System: Assign
1734
+ type AssignInstructionData {
1735
+ account: Account
1736
+ owner: Account
1737
+ }
1738
+ type AssignInstruction implements TransactionInstruction {
1739
+ data: AssignInstructionData
1740
+ meta: JsonParsedInstructionMeta
1741
+ programId: String
1742
+ }
1743
+
1744
+ # System: Transfer
1745
+ type TransferInstructionData {
1746
+ destination: Account
1747
+ lamports: BigInt
1748
+ source: Account
1749
+ }
1750
+ type TransferInstruction implements TransactionInstruction {
1751
+ data: TransferInstructionData
1752
+ meta: JsonParsedInstructionMeta
1753
+ programId: String
1754
+ }
1755
+
1756
+ # System: CreateAccountWithSeed
1757
+ type CreateAccountWithSeedInstructionData {
1758
+ base: Account
1759
+ lamports: BigInt
1760
+ owner: Account
1761
+ seed: String
1762
+ space: BigInt
1763
+ }
1764
+ type CreateAccountWithSeedInstruction implements TransactionInstruction {
1765
+ data: CreateAccountWithSeedInstructionData
1766
+ meta: JsonParsedInstructionMeta
1767
+ programId: String
1768
+ }
1769
+
1770
+ # System: AdvanceNonceAccount
1771
+ type AdvanceNonceAccountInstructionData {
1772
+ nonceAccount: Account
1773
+ nonceAuthority: Account
1774
+ recentBlockhashesSysvar: String
1775
+ }
1776
+ type AdvanceNonceAccountInstruction implements TransactionInstruction {
1777
+ data: AdvanceNonceAccountInstructionData
1778
+ meta: JsonParsedInstructionMeta
1779
+ programId: String
1780
+ }
1781
+
1782
+ # System: WithdrawNonceAccount
1783
+ type WithdrawNonceAccountInstructionData {
1784
+ destination: Account
1785
+ lamports: BigInt
1786
+ nonceAccount: Account
1787
+ nonceAuthority: Account
1788
+ recentBlockhashesSysvar: String
1789
+ rentSysvar: String
1790
+ }
1791
+ type WithdrawNonceAccountInstruction implements TransactionInstruction {
1792
+ data: WithdrawNonceAccountInstructionData
1793
+ meta: JsonParsedInstructionMeta
1794
+ programId: String
1795
+ }
1796
+
1797
+ # System: InitializeNonceAccount
1798
+ type InitializeNonceAccountInstructionData {
1799
+ nonceAccount: Account
1800
+ nonceAuthority: Account
1801
+ recentBlockhashesSysvar: String
1802
+ rentSysvar: String
1803
+ }
1804
+ type InitializeNonceAccountInstruction implements TransactionInstruction {
1805
+ data: InitializeNonceAccountInstructionData
1806
+ meta: JsonParsedInstructionMeta
1807
+ programId: String
1808
+ }
1809
+
1810
+ # System: AuthorizeNonceAccount
1811
+ type AuthorizeNonceAccountInstructionData {
1812
+ newAuthorized: Account
1813
+ nonceAccount: Account
1814
+ nonceAuthority: Account
1815
+ }
1816
+ type AuthorizeNonceAccountInstruction implements TransactionInstruction {
1817
+ data: AuthorizeNonceAccountInstructionData
1818
+ meta: JsonParsedInstructionMeta
1819
+ programId: String
1820
+ }
1821
+
1822
+ # System: UpgradeNonceAccount
1823
+ type UpgradeNonceAccountInstructionData {
1824
+ nonceAccount: Account
1825
+ nonceAuthority: Account
1826
+ }
1827
+ type UpgradeNonceAccountInstruction implements TransactionInstruction {
1828
+ data: UpgradeNonceAccountInstructionData
1829
+ meta: JsonParsedInstructionMeta
1830
+ programId: String
1831
+ }
1832
+
1833
+ # System: Allocate
1834
+ type AllocateInstructionData {
1835
+ account: Account
1836
+ space: BigInt
1837
+ }
1838
+ type AllocateInstruction implements TransactionInstruction {
1839
+ data: AllocateInstructionData
1840
+ meta: JsonParsedInstructionMeta
1841
+ programId: String
1842
+ }
1843
+
1844
+ # System: AllocateWithSeed
1845
+ type AllocateWithSeedInstructionData {
1846
+ account: Account
1847
+ base: String
1848
+ owner: Account
1849
+ seed: String
1850
+ space: BigInt
1851
+ }
1852
+ type AllocateWithSeedInstruction implements TransactionInstruction {
1853
+ data: AllocateWithSeedInstructionData
1854
+ meta: JsonParsedInstructionMeta
1855
+ programId: String
1856
+ }
1857
+
1858
+ # System: AssignWithSeed
1859
+ type AssignWithSeedInstructionData {
1860
+ account: Account
1861
+ base: String
1862
+ owner: Account
1863
+ seed: String
1864
+ }
1865
+ type AssignWithSeedInstruction implements TransactionInstruction {
1866
+ data: AssignWithSeedInstructionData
1867
+ meta: JsonParsedInstructionMeta
1868
+ programId: String
1869
+ }
1870
+
1871
+ # System: TransferWithSeed
1872
+ type TransferWithSeedInstructionData {
1873
+ destination: Account
1874
+ lamports: BigInt
1875
+ source: Account
1876
+ sourceBase: String
1877
+ sourceOwner: Account
1878
+ sourceSeed: String
1879
+ }
1880
+ type TransferWithSeedInstruction implements TransactionInstruction {
1881
+ data: TransferWithSeedInstructionData
1882
+ meta: JsonParsedInstructionMeta
1883
+ programId: String
1884
+ }
1885
+
1886
+ # Vote: InitializeAccount
1887
+ type VoteInitializeAccountInstructionData {
1888
+ authorizedVoter: Account
1889
+ authorizedWithdrawer: Account
1890
+ clockSysvar: String
1891
+ commission: BigInt # FIXME:*
1892
+ node: Account
1893
+ rentSysvar: String
1894
+ voteAccount: Account
1895
+ }
1896
+ type VoteInitializeAccountInstruction implements TransactionInstruction {
1897
+ data: VoteInitializeAccountInstructionData
1898
+ meta: JsonParsedInstructionMeta
1899
+ programId: String
1900
+ }
1901
+
1902
+ # Vote: Authorize
1903
+ type VoteAuthorizeInstructionData {
1904
+ authority: Account
1905
+ authorityType: String
1906
+ clockSysvar: String
1907
+ newAuthority: Account
1908
+ voteAccount: Account
1909
+ }
1910
+ type VoteAuthorizeInstruction implements TransactionInstruction {
1911
+ data: VoteAuthorizeInstructionData
1912
+ meta: JsonParsedInstructionMeta
1913
+ programId: String
1914
+ }
1915
+
1916
+ # Vote: AuthorizeWithSeed
1917
+ type VoteAuthorizeWithSeedInstructionData {
1918
+ authorityBaseKey: String
1919
+ authorityOwner: Account
1920
+ authoritySeed: String
1921
+ authorityType: String
1922
+ clockSysvar: String
1923
+ newAuthority: Account
1924
+ voteAccount: Account
1925
+ }
1926
+ type VoteAuthorizeWithSeedInstruction implements TransactionInstruction {
1927
+ data: VoteAuthorizeWithSeedInstructionData
1928
+ meta: JsonParsedInstructionMeta
1929
+ programId: String
1930
+ }
1931
+
1932
+ # Vote: AuthorizeCheckedWithSeed
1933
+ type VoteAuthorizeCheckedWithSeedInstructionData {
1934
+ authorityBaseKey: String
1935
+ authorityOwner: Account
1936
+ authoritySeed: String
1937
+ authorityType: String
1938
+ clockSysvar: String
1939
+ newAuthority: Account
1940
+ voteAccount: Account
1941
+ }
1942
+ type VoteAuthorizeCheckedWithSeedInstruction implements TransactionInstruction {
1943
+ data: VoteAuthorizeCheckedWithSeedInstructionData
1944
+ meta: JsonParsedInstructionMeta
1945
+ programId: String
1946
+ }
1947
+
1948
+ type Vote {
1949
+ hash: String
1950
+ slots: [BigInt]
1951
+ timestamp: BigInt
1952
+ }
1953
+
1954
+ # Vote: Vote
1955
+ type VoteVoteInstructionData {
1956
+ clockSysvar: String
1957
+ slotHashesSysvar: String
1958
+ vote: Vote
1959
+ voteAccount: Account
1960
+ voteAuthority: Account
1961
+ }
1962
+ type VoteVoteInstruction implements TransactionInstruction {
1963
+ data: VoteVoteInstructionData
1964
+ meta: JsonParsedInstructionMeta
1965
+ programId: String
1966
+ }
1967
+
1968
+ type VoteStateUpdateLockout {
1969
+ confirmationCount: BigInt # FIXME:*
1970
+ slot: BigInt
1971
+ }
1972
+ type VoteStateUpdate {
1973
+ hash: String
1974
+ lockouts: [VoteStateUpdateLockout]
1975
+ root: BigInt
1976
+ timestamp: BigInt
1977
+ }
1978
+
1979
+ # Vote: UpdateVoteState
1980
+ type VoteUpdateVoteStateInstructionData {
1981
+ hash: String
1982
+ voteAccount: Account
1983
+ voteAuthority: Account
1984
+ voteStateUpdate: VoteStateUpdate
1985
+ }
1986
+ type VoteUpdateVoteStateInstruction implements TransactionInstruction {
1987
+ data: VoteUpdateVoteStateInstructionData
1988
+ meta: JsonParsedInstructionMeta
1989
+ programId: String
1990
+ }
1991
+
1992
+ # Vote: UpdateVoteStateSwitch
1993
+ type VoteUpdateVoteStateSwitchInstructionData {
1994
+ hash: String
1995
+ voteAccount: Account
1996
+ voteAuthority: Account
1997
+ voteStateUpdate: VoteStateUpdate
1998
+ }
1999
+ type VoteUpdateVoteStateSwitchInstruction implements TransactionInstruction {
2000
+ data: VoteUpdateVoteStateSwitchInstructionData
2001
+ meta: JsonParsedInstructionMeta
2002
+ programId: String
2003
+ }
2004
+
2005
+ # Vote: CompactUpdateVoteState
2006
+ type VoteCompactUpdateVoteStateInstructionData {
2007
+ hash: String
2008
+ voteAccount: Account
2009
+ voteAuthority: Account
2010
+ voteStateUpdate: VoteStateUpdate
2011
+ }
2012
+ type VoteCompactUpdateVoteStateInstruction implements TransactionInstruction {
2013
+ data: VoteCompactUpdateVoteStateInstructionData
2014
+ meta: JsonParsedInstructionMeta
2015
+ programId: String
2016
+ }
2017
+
2018
+ # Vote: CompactUpdateVoteStateSwitch
2019
+ type VoteCompactUpdateVoteStateSwitchInstructionData {
2020
+ hash: String
2021
+ voteAccount: Account
2022
+ voteAuthority: Account
2023
+ voteStateUpdate: VoteStateUpdate
2024
+ }
2025
+ type VoteCompactUpdateVoteStateSwitchInstruction implements TransactionInstruction {
2026
+ data: VoteCompactUpdateVoteStateSwitchInstructionData
2027
+ meta: JsonParsedInstructionMeta
2028
+ programId: String
2029
+ }
2030
+
2031
+ # Vote: Withdraw
2032
+ type VoteWithdrawInstructionData {
2033
+ destination: Account
2034
+ lamports: BigInt
2035
+ voteAccount: Account
2036
+ withdrawAuthority: Account
2037
+ }
2038
+ type VoteWithdrawInstruction implements TransactionInstruction {
2039
+ data: VoteWithdrawInstructionData
2040
+ meta: JsonParsedInstructionMeta
2041
+ programId: String
2042
+ }
2043
+
2044
+ # Vote: UpdateValidatorIdentity
2045
+ type VoteUpdateValidatorIdentityInstructionData {
2046
+ newValidatorIdentity: Account
2047
+ voteAccount: Account
2048
+ withdrawAuthority: Account
2049
+ }
2050
+ type VoteUpdateValidatorIdentityInstruction implements TransactionInstruction {
2051
+ data: VoteUpdateValidatorIdentityInstructionData
2052
+ meta: JsonParsedInstructionMeta
2053
+ programId: String
2054
+ }
2055
+
2056
+ # Vote: UpdateCommission
2057
+ type VoteUpdateCommissionInstructionData {
2058
+ commission: BigInt # FIXME:*
2059
+ voteAccount: Account
2060
+ withdrawAuthority: Account
2061
+ }
2062
+ type VoteUpdateCommissionInstruction implements TransactionInstruction {
2063
+ data: VoteUpdateCommissionInstructionData
2064
+ meta: JsonParsedInstructionMeta
2065
+ programId: String
2066
+ }
2067
+
2068
+ # Vote: VoteSwitch
2069
+ type VoteVoteSwitchInstructionData {
2070
+ clockSysvar: String
2071
+ hash: String
2072
+ slotHashesSysvar: String
2073
+ vote: Vote
2074
+ voteAccount: Account
2075
+ voteAuthority: Account
2076
+ }
2077
+ type VoteVoteSwitchInstruction implements TransactionInstruction {
2078
+ data: VoteVoteSwitchInstructionData
2079
+ meta: JsonParsedInstructionMeta
2080
+ programId: String
2081
+ }
2082
+
2083
+ # Vote: AuthorizeChecked
2084
+ type VoteAuthorizeCheckedInstructionData {
2085
+ authority: Account
2086
+ authorityType: String
2087
+ clockSysvar: String
2088
+ newAuthority: Account
2089
+ voteAccount: Account
2090
+ }
2091
+ type VoteAuthorizeCheckedInstruction implements TransactionInstruction {
2092
+ data: VoteAuthorizeCheckedInstructionData
2093
+ meta: JsonParsedInstructionMeta
2094
+ programId: String
2095
+ }
2096
+ `
2097
+ );
2098
+ var instructionResolvers = {
2099
+ TransactionInstruction: {
2100
+ __resolveType(instruction) {
2101
+ if (instruction.meta) {
2102
+ if (instruction.meta.program === "address-lookup-table") {
2103
+ if (instruction.meta.type === "createLookupTable") {
735
2104
  return "CreateLookupTableInstruction";
736
2105
  }
737
- if (instruction.info.type === "freezeLookupTable") {
2106
+ if (instruction.meta.type === "freezeLookupTable") {
738
2107
  return "FreezeLookupTableInstruction";
739
2108
  }
740
- if (instruction.info.type === "extendLookupTable") {
2109
+ if (instruction.meta.type === "extendLookupTable") {
741
2110
  return "ExtendLookupTableInstruction";
742
2111
  }
743
- if (instruction.info.type === "deactivateLookupTable") {
2112
+ if (instruction.meta.type === "deactivateLookupTable") {
744
2113
  return "DeactivateLookupTableInstruction";
745
2114
  }
746
- if (instruction.info.type === "closeLookupTable") {
2115
+ if (instruction.meta.type === "closeLookupTable") {
747
2116
  return "CloseLookupTableInstruction";
748
2117
  }
749
2118
  }
750
- if (instruction.program === "bpf-loader") {
751
- if (instruction.info.type === "write") {
2119
+ if (instruction.meta.program === "bpf-loader") {
2120
+ if (instruction.meta.type === "write") {
752
2121
  return "BpfLoaderWriteInstruction";
753
2122
  }
754
- if (instruction.info.type === "finalize") {
2123
+ if (instruction.meta.type === "finalize") {
755
2124
  return "BpfLoaderFinalizeInstruction";
756
2125
  }
757
2126
  }
758
- if (instruction.program === "bpf-upgradeable-loader") {
759
- if (instruction.info.type === "initializeBuffer") {
2127
+ if (instruction.meta.program === "bpf-upgradeable-loader") {
2128
+ if (instruction.meta.type === "initializeBuffer") {
760
2129
  return "BpfUpgradeableLoaderInitializeBufferInstruction";
761
2130
  }
762
- if (instruction.info.type === "write") {
2131
+ if (instruction.meta.type === "write") {
763
2132
  return "BpfUpgradeableLoaderWriteInstruction";
764
2133
  }
765
- if (instruction.info.type === "deployWithMaxDataLen") {
2134
+ if (instruction.meta.type === "deployWithMaxDataLen") {
766
2135
  return "BpfUpgradeableLoaderDeployWithMaxDataLenInstruction";
767
2136
  }
768
- if (instruction.info.type === "upgrade") {
2137
+ if (instruction.meta.type === "upgrade") {
769
2138
  return "BpfUpgradeableLoaderUpgradeInstruction";
770
2139
  }
771
- if (instruction.info.type === "setAuthority") {
2140
+ if (instruction.meta.type === "setAuthority") {
772
2141
  return "BpfUpgradeableLoaderSetAuthorityInstruction";
773
2142
  }
774
- if (instruction.info.type === "setAuthorityChecked") {
2143
+ if (instruction.meta.type === "setAuthorityChecked") {
775
2144
  return "BpfUpgradeableLoaderSetAuthorityCheckedInstruction";
776
2145
  }
777
- if (instruction.info.type === "close") {
2146
+ if (instruction.meta.type === "close") {
778
2147
  return "BpfUpgradeableLoaderCloseInstruction";
779
2148
  }
780
- if (instruction.info.type === "extendProgram") {
2149
+ if (instruction.meta.type === "extendProgram") {
781
2150
  return "BpfUpgradeableLoaderExtendProgramInstruction";
782
2151
  }
783
2152
  }
784
- if (instruction.program === "spl-associated-token-account") {
785
- if (instruction.info.type === "create") {
2153
+ if (instruction.meta.program === "spl-associated-token-account") {
2154
+ if (instruction.meta.type === "create") {
786
2155
  return "SplAssociatedTokenCreateInstruction";
787
2156
  }
788
- if (instruction.info.type === "createIdempotent") {
2157
+ if (instruction.meta.type === "createIdempotent") {
789
2158
  return "SplAssociatedTokenCreateIdempotentInstruction";
790
2159
  }
791
- if (instruction.info.type === "recoverNested") {
2160
+ if (instruction.meta.type === "recoverNested") {
792
2161
  return "SplAssociatedTokenRecoverNestedInstruction";
793
2162
  }
794
2163
  }
795
- if (instruction.program === "spl-memo") {
2164
+ if (instruction.meta.program === "spl-memo") {
796
2165
  return "SplMemoInstruction";
797
2166
  }
798
- if (instruction.program === "spl-token") {
799
- if (instruction.info.type === "initializeMint") {
2167
+ if (instruction.meta.program === "spl-token") {
2168
+ if (instruction.meta.type === "initializeMint") {
800
2169
  return "SplTokenInitializeMintInstruction";
801
2170
  }
802
- if (instruction.info.type === "initializeMint2") {
2171
+ if (instruction.meta.type === "initializeMint2") {
803
2172
  return "SplTokenInitializeMint2Instruction";
804
2173
  }
805
- if (instruction.info.type === "initializeAccount") {
2174
+ if (instruction.meta.type === "initializeAccount") {
806
2175
  return "SplTokenInitializeAccountInstruction";
807
2176
  }
808
- if (instruction.info.type === "initializeAccount2") {
2177
+ if (instruction.meta.type === "initializeAccount2") {
809
2178
  return "SplTokenInitializeAccount2Instruction";
810
2179
  }
811
- if (instruction.info.type === "initializeAccount3") {
2180
+ if (instruction.meta.type === "initializeAccount3") {
812
2181
  return "SplTokenInitializeAccount3Instruction";
813
2182
  }
814
- if (instruction.info.type === "initializeMultisig") {
2183
+ if (instruction.meta.type === "initializeMultisig") {
815
2184
  return "SplTokenInitializeMultisigInstruction";
816
2185
  }
817
- if (instruction.info.type === "initializeMultisig2") {
2186
+ if (instruction.meta.type === "initializeMultisig2") {
818
2187
  return "SplTokenInitializeMultisig2Instruction";
819
2188
  }
820
- if (instruction.info.type === "transfer") {
2189
+ if (instruction.meta.type === "transfer") {
821
2190
  return "SplTokenTransferInstruction";
822
2191
  }
823
- if (instruction.info.type === "approve") {
2192
+ if (instruction.meta.type === "approve") {
824
2193
  return "SplTokenApproveInstruction";
825
2194
  }
826
- if (instruction.info.type === "revoke") {
2195
+ if (instruction.meta.type === "revoke") {
827
2196
  return "SplTokenRevokeInstruction";
828
2197
  }
829
- if (instruction.info.type === "setAuthority") {
2198
+ if (instruction.meta.type === "setAuthority") {
830
2199
  return "SplTokenSetAuthorityInstruction";
831
2200
  }
832
- if (instruction.info.type === "mintTo") {
2201
+ if (instruction.meta.type === "mintTo") {
833
2202
  return "SplTokenMintToInstruction";
834
2203
  }
835
- if (instruction.info.type === "burn") {
2204
+ if (instruction.meta.type === "burn") {
836
2205
  return "SplTokenBurnInstruction";
837
2206
  }
838
- if (instruction.info.type === "closeAccount") {
2207
+ if (instruction.meta.type === "closeAccount") {
839
2208
  return "SplTokenCloseAccountInstruction";
840
2209
  }
841
- if (instruction.info.type === "freezeAccount") {
2210
+ if (instruction.meta.type === "freezeAccount") {
842
2211
  return "SplTokenFreezeAccountInstruction";
843
2212
  }
844
- if (instruction.info.type === "thawAccount") {
2213
+ if (instruction.meta.type === "thawAccount") {
845
2214
  return "SplTokenThawAccountInstruction";
846
2215
  }
847
- if (instruction.info.type === "transferChecked") {
2216
+ if (instruction.meta.type === "transferChecked") {
848
2217
  return "SplTokenTransferCheckedInstruction";
849
2218
  }
850
- if (instruction.info.type === "approveChecked") {
2219
+ if (instruction.meta.type === "approveChecked") {
851
2220
  return "SplTokenApproveCheckedInstruction";
852
2221
  }
853
- if (instruction.info.type === "mintToChecked") {
2222
+ if (instruction.meta.type === "mintToChecked") {
854
2223
  return "SplTokenMintToCheckedInstruction";
855
2224
  }
856
- if (instruction.info.type === "burnChecked") {
2225
+ if (instruction.meta.type === "burnChecked") {
857
2226
  return "SplTokenBurnCheckedInstruction";
858
2227
  }
859
- if (instruction.info.type === "syncNative") {
2228
+ if (instruction.meta.type === "syncNative") {
860
2229
  return "SplTokenSyncNativeInstruction";
861
2230
  }
862
- if (instruction.info.type === "getAccountDataSize") {
2231
+ if (instruction.meta.type === "getAccountDataSize") {
863
2232
  return "SplTokenGetAccountDataSizeInstruction";
864
2233
  }
865
- if (instruction.info.type === "initializeImmutableOwner") {
2234
+ if (instruction.meta.type === "initializeImmutableOwner") {
866
2235
  return "SplTokenInitializeImmutableOwnerInstruction";
867
2236
  }
868
- if (instruction.info.type === "amountToUiAmount") {
2237
+ if (instruction.meta.type === "amountToUiAmount") {
869
2238
  return "SplTokenAmountToUiAmountInstruction";
870
2239
  }
871
- if (instruction.info.type === "uiAmountToAmount") {
2240
+ if (instruction.meta.type === "uiAmountToAmount") {
872
2241
  return "SplTokenUiAmountToAmountInstruction";
873
2242
  }
874
- if (instruction.info.type === "initializeMintCloseAuthority") {
2243
+ if (instruction.meta.type === "initializeMintCloseAuthority") {
875
2244
  return "SplTokenInitializeMintCloseAuthorityInstruction";
876
2245
  }
877
2246
  }
878
- if (instruction.program === "stake") {
879
- if (instruction.info.type === "initialize") {
2247
+ if (instruction.meta.program === "stake") {
2248
+ if (instruction.meta.type === "initialize") {
880
2249
  return "StakeInitializeInstruction";
881
2250
  }
882
- if (instruction.info.type === "authorize") {
2251
+ if (instruction.meta.type === "authorize") {
883
2252
  return "StakeAuthorizeInstruction";
884
2253
  }
885
- if (instruction.info.type === "delegate") {
2254
+ if (instruction.meta.type === "delegate") {
886
2255
  return "StakeDelegateStakeInstruction";
887
2256
  }
888
- if (instruction.info.type === "split") {
2257
+ if (instruction.meta.type === "split") {
889
2258
  return "StakeSplitInstruction";
890
2259
  }
891
- if (instruction.info.type === "withdraw") {
2260
+ if (instruction.meta.type === "withdraw") {
892
2261
  return "StakeWithdrawInstruction";
893
2262
  }
894
- if (instruction.info.type === "deactivate") {
2263
+ if (instruction.meta.type === "deactivate") {
895
2264
  return "StakeDeactivateInstruction";
896
2265
  }
897
- if (instruction.info.type === "setLockup") {
2266
+ if (instruction.meta.type === "setLockup") {
898
2267
  return "StakeSetLockupInstruction";
899
2268
  }
900
- if (instruction.info.type === "merge") {
2269
+ if (instruction.meta.type === "merge") {
901
2270
  return "StakeMergeInstruction";
902
2271
  }
903
- if (instruction.info.type === "authorizeWithSeed") {
2272
+ if (instruction.meta.type === "authorizeWithSeed") {
904
2273
  return "StakeAuthorizeWithSeedInstruction";
905
2274
  }
906
- if (instruction.info.type === "initializeChecked") {
2275
+ if (instruction.meta.type === "initializeChecked") {
907
2276
  return "StakeInitializeCheckedInstruction";
908
2277
  }
909
- if (instruction.info.type === "authorizeChecked") {
2278
+ if (instruction.meta.type === "authorizeChecked") {
910
2279
  return "StakeAuthorizeCheckedInstruction";
911
2280
  }
912
- if (instruction.info.type === "authorizeCheckedWithSeed") {
2281
+ if (instruction.meta.type === "authorizeCheckedWithSeed") {
913
2282
  return "StakeAuthorizeCheckedWithSeedInstruction";
914
2283
  }
915
- if (instruction.info.type === "setLockupChecked") {
2284
+ if (instruction.meta.type === "setLockupChecked") {
916
2285
  return "StakeSetLockupCheckedInstruction";
917
2286
  }
918
- if (instruction.info.type === "deactivateDelinquent") {
2287
+ if (instruction.meta.type === "deactivateDelinquent") {
919
2288
  return "StakeDeactivateDelinquentInstruction";
920
2289
  }
921
- if (instruction.info.type === "redelegate") {
2290
+ if (instruction.meta.type === "redelegate") {
922
2291
  return "StakeRedelegateInstruction";
923
2292
  }
924
2293
  }
925
- if (instruction.program === "system") {
926
- if (instruction.info.type === "createAccount") {
2294
+ if (instruction.meta.program === "system") {
2295
+ if (instruction.meta.type === "createAccount") {
927
2296
  return "CreateAccountInstruction";
928
2297
  }
929
- if (instruction.info.type === "assign") {
2298
+ if (instruction.meta.type === "assign") {
930
2299
  return "AssignInstruction";
931
2300
  }
932
- if (instruction.info.type === "transfer") {
2301
+ if (instruction.meta.type === "transfer") {
933
2302
  return "TransferInstruction";
934
2303
  }
935
- if (instruction.info.type === "createAccountWithSeed") {
2304
+ if (instruction.meta.type === "createAccountWithSeed") {
936
2305
  return "CreateAccountWithSeedInstruction";
937
2306
  }
938
- if (instruction.info.type === "advanceNonceAccount") {
2307
+ if (instruction.meta.type === "advanceNonceAccount") {
939
2308
  return "AdvanceNonceAccountInstruction";
940
2309
  }
941
- if (instruction.info.type === "withdrawNonceAccount") {
2310
+ if (instruction.meta.type === "withdrawNonceAccount") {
942
2311
  return "WithdrawNonceAccountInstruction";
943
2312
  }
944
- if (instruction.info.type === "initializeNonceAccount") {
2313
+ if (instruction.meta.type === "initializeNonceAccount") {
945
2314
  return "InitializeNonceAccountInstruction";
946
2315
  }
947
- if (instruction.info.type === "authorizeNonceAccount") {
2316
+ if (instruction.meta.type === "authorizeNonceAccount") {
948
2317
  return "AuthorizeNonceAccountInstruction";
949
2318
  }
950
- if (instruction.info.type === "upgradeNonceAccount") {
2319
+ if (instruction.meta.type === "upgradeNonceAccount") {
951
2320
  return "UpgradeNonceAccountInstruction";
952
2321
  }
953
- if (instruction.info.type === "allocate") {
2322
+ if (instruction.meta.type === "allocate") {
954
2323
  return "AllocateInstruction";
955
2324
  }
956
- if (instruction.info.type === "allocateWithSeed") {
2325
+ if (instruction.meta.type === "allocateWithSeed") {
957
2326
  return "AllocateWithSeedInstruction";
958
2327
  }
959
- if (instruction.info.type === "assignWithSeed") {
2328
+ if (instruction.meta.type === "assignWithSeed") {
960
2329
  return "AssignWithSeedInstruction";
961
2330
  }
962
- if (instruction.info.type === "transferWithSeed") {
2331
+ if (instruction.meta.type === "transferWithSeed") {
963
2332
  return "TransferWithSeedInstruction";
964
2333
  }
965
2334
  }
966
- if (instruction.program === "vote") {
967
- if (instruction.info.type === "initialize") {
2335
+ if (instruction.meta.program === "vote") {
2336
+ if (instruction.meta.type === "initialize") {
968
2337
  return "VoteInitializeAccountInstruction";
969
2338
  }
970
- if (instruction.info.type === "authorize") {
2339
+ if (instruction.meta.type === "authorize") {
971
2340
  return "VoteAuthorizeInstruction";
972
2341
  }
973
- if (instruction.info.type === "authorizeWithSeed") {
2342
+ if (instruction.meta.type === "authorizeWithSeed") {
974
2343
  return "VoteAuthorizeWithSeedInstruction";
975
2344
  }
976
- if (instruction.info.type === "authorizeCheckedWithSeed") {
2345
+ if (instruction.meta.type === "authorizeCheckedWithSeed") {
977
2346
  return "VoteAuthorizeCheckedWithSeedInstruction";
978
2347
  }
979
- if (instruction.info.type === "vote") {
2348
+ if (instruction.meta.type === "vote") {
980
2349
  return "VoteVoteInstruction";
981
2350
  }
982
- if (instruction.info.type === "updatevotestate") {
2351
+ if (instruction.meta.type === "updatevotestate") {
983
2352
  return "VoteUpdateVoteStateInstruction";
984
2353
  }
985
- if (instruction.info.type === "updatevotestateswitch") {
2354
+ if (instruction.meta.type === "updatevotestateswitch") {
986
2355
  return "VoteUpdateVoteStateSwitchInstruction";
987
2356
  }
988
- if (instruction.info.type === "compactupdatevotestate") {
2357
+ if (instruction.meta.type === "compactupdatevotestate") {
989
2358
  return "VoteCompactUpdateVoteStateInstruction";
990
2359
  }
991
- if (instruction.info.type === "compactupdatevotestateswitch") {
2360
+ if (instruction.meta.type === "compactupdatevotestateswitch") {
992
2361
  return "VoteCompactUpdateVoteStateSwitchInstruction";
993
2362
  }
994
- if (instruction.info.type === "withdraw") {
2363
+ if (instruction.meta.type === "withdraw") {
995
2364
  return "VoteWithdrawInstruction";
996
2365
  }
997
- if (instruction.info.type === "updateValidatorIdentity") {
2366
+ if (instruction.meta.type === "updateValidatorIdentity") {
998
2367
  return "VoteUpdateValidatorIdentityInstruction";
999
2368
  }
1000
- if (instruction.info.type === "updateCommission") {
2369
+ if (instruction.meta.type === "updateCommission") {
1001
2370
  return "VoteUpdateCommissionInstruction";
1002
2371
  }
1003
- if (instruction.info.type === "voteSwitch") {
2372
+ if (instruction.meta.type === "voteSwitch") {
1004
2373
  return "VoteVoteSwitchInstruction";
1005
2374
  }
1006
- if (instruction.info.type === "authorizeChecked") {
2375
+ if (instruction.meta.type === "authorizeChecked") {
1007
2376
  return "VoteAuthorizeCheckedInstruction";
1008
2377
  }
1009
2378
  }
1010
- return "PartiallyDecodedInstruction";
1011
- }
1012
- });
1013
- return memoisedParsedTransactionInstructionInterface;
1014
- };
1015
- var parsedTransactionInstructionType = (name, parsedInfoFields) => new graphql.GraphQLObjectType({
1016
- fields: {
1017
- parsed: object(name + "Parsed", {
1018
- info: object(name + "ParsedInfo", parsedInfoFields),
1019
- type: string()
1020
- }),
1021
- program: string(),
1022
- programId: string()
1023
- },
1024
- interfaces: [parsedTransactionInstructionInterface()],
1025
- name
1026
- });
1027
- var memoisedPartiallyDecodedTransactionInstruction;
1028
- var partiallyDecodedTransactionInstruction = () => {
1029
- if (!memoisedPartiallyDecodedTransactionInstruction)
1030
- memoisedPartiallyDecodedTransactionInstruction = new graphql.GraphQLObjectType({
1031
- fields: {
1032
- accounts: list(string()),
1033
- data: string(),
1034
- programId: string()
1035
- },
1036
- interfaces: [parsedTransactionInstructionInterface()],
1037
- name: "PartiallyDecodedInstruction"
1038
- });
1039
- return memoisedPartiallyDecodedTransactionInstruction;
1040
- };
1041
- var memoisedParsedInstructionsAddressLookupTable;
1042
- var parsedInstructionsAddressLookupTable = () => {
1043
- if (!memoisedParsedInstructionsAddressLookupTable)
1044
- memoisedParsedInstructionsAddressLookupTable = [
1045
- parsedTransactionInstructionType("CreateLookupTableInstruction", {
1046
- bumpSeed: number(),
1047
- lookupTableAccount: string(),
1048
- lookupTableAuthority: string(),
1049
- payerAccount: string(),
1050
- recentSlot: bigint(),
1051
- systemProgram: string()
1052
- }),
1053
- parsedTransactionInstructionType("FreezeLookupTableInstruction", {
1054
- lookupTableAccount: string(),
1055
- lookupTableAuthority: string()
1056
- }),
1057
- parsedTransactionInstructionType("ExtendLookupTableInstruction", {
1058
- lookupTableAccount: string(),
1059
- lookupTableAuthority: string(),
1060
- newAddresses: list(string()),
1061
- payerAccount: string(),
1062
- systemProgram: string()
1063
- }),
1064
- parsedTransactionInstructionType("DeactivateLookupTableInstruction", {
1065
- lookupTableAccount: string(),
1066
- lookupTableAuthority: string()
1067
- }),
1068
- parsedTransactionInstructionType("CloseLookupTableInstruction", {
1069
- lookupTableAccount: string(),
1070
- lookupTableAuthority: string(),
1071
- recipient: string()
1072
- })
1073
- ];
1074
- return memoisedParsedInstructionsAddressLookupTable;
1075
- };
1076
- var memoisedParsedInstructionsBpfLoader;
1077
- var parsedInstructionsBpfLoader = () => {
1078
- if (!memoisedParsedInstructionsBpfLoader)
1079
- memoisedParsedInstructionsBpfLoader = [
1080
- parsedTransactionInstructionType("BpfLoaderWriteInstruction", {
1081
- account: string(),
1082
- bytes: string(),
1083
- offset: number()
1084
- }),
1085
- parsedTransactionInstructionType("BpfLoaderFinalizeInstruction", {
1086
- account: string()
1087
- })
1088
- ];
1089
- return memoisedParsedInstructionsBpfLoader;
1090
- };
1091
- var memoisedParsedInstructionsBpfUpgradeableLoader;
1092
- var parsedInstructionsBpfUpgradeableLoader = () => {
1093
- if (!memoisedParsedInstructionsBpfUpgradeableLoader)
1094
- memoisedParsedInstructionsBpfUpgradeableLoader = [
1095
- parsedTransactionInstructionType("BpfUpgradeableLoaderInitializeBufferInstruction", {
1096
- account: string()
1097
- }),
1098
- parsedTransactionInstructionType("BpfUpgradeableLoaderWriteInstruction", {
1099
- account: string(),
1100
- authority: string(),
1101
- bytes: string(),
1102
- offset: number()
1103
- }),
1104
- parsedTransactionInstructionType("BpfUpgradeableLoaderDeployWithMaxDataLenInstruction", {
1105
- authority: string(),
1106
- bufferAccount: string(),
1107
- clockSysvar: string(),
1108
- maxDataLen: bigint(),
1109
- payerAccount: string(),
1110
- programAccount: string(),
1111
- programDataAccount: string(),
1112
- rentSysvar: string()
1113
- }),
1114
- parsedTransactionInstructionType("BpfUpgradeableLoaderUpgradeInstruction", {
1115
- authority: string(),
1116
- bufferAccount: string(),
1117
- clockSysvar: string(),
1118
- programAccount: string(),
1119
- programDataAccount: string(),
1120
- rentSysvar: string(),
1121
- spillAccount: string()
1122
- }),
1123
- parsedTransactionInstructionType("BpfUpgradeableLoaderSetAuthorityInstruction", {
1124
- account: string(),
1125
- authority: string(),
1126
- newAuthority: string()
1127
- }),
1128
- parsedTransactionInstructionType("BpfUpgradeableLoaderSetAuthorityCheckedInstruction", {
1129
- account: string(),
1130
- authority: string(),
1131
- newAuthority: string()
1132
- }),
1133
- parsedTransactionInstructionType("BpfUpgradeableLoaderCloseInstruction", {
1134
- account: string(),
1135
- authority: string(),
1136
- programAccount: string(),
1137
- recipient: string()
1138
- }),
1139
- parsedTransactionInstructionType("BpfUpgradeableLoaderExtendProgramInstruction", {
1140
- additionalBytes: bigint(),
1141
- payerAccount: string(),
1142
- programAccount: string(),
1143
- programDataAccount: string(),
1144
- systemProgram: string()
1145
- })
1146
- ];
1147
- return memoisedParsedInstructionsBpfUpgradeableLoader;
1148
- };
1149
- var memoisedParsedInstructionsSplAssociatedToken;
1150
- var parsedInstructionsSplAssociatedToken = () => {
1151
- if (!memoisedParsedInstructionsSplAssociatedToken)
1152
- memoisedParsedInstructionsSplAssociatedToken = [
1153
- parsedTransactionInstructionType("SplAssociatedTokenCreateInstruction", {
1154
- account: string(),
1155
- mint: string(),
1156
- source: string(),
1157
- systemProgram: string(),
1158
- tokenProgram: string(),
1159
- wallet: string()
1160
- }),
1161
- parsedTransactionInstructionType("SplAssociatedTokenCreateIdempotentInstruction", {
1162
- account: string(),
1163
- mint: string(),
1164
- source: string(),
1165
- systemProgram: string(),
1166
- tokenProgram: string(),
1167
- wallet: string()
1168
- }),
1169
- parsedTransactionInstructionType("SplAssociatedTokenRecoverNestedInstruction", {
1170
- destination: string(),
1171
- nestedMint: string(),
1172
- nestedOwner: string(),
1173
- nestedSource: string(),
1174
- ownerMint: string(),
1175
- tokenProgram: string(),
1176
- wallet: string()
1177
- })
1178
- ];
1179
- return memoisedParsedInstructionsSplAssociatedToken;
1180
- };
1181
- var memoisedParsedInstructionSplMemo;
1182
- var parsedInstructionSplMemo = () => {
1183
- if (!memoisedParsedInstructionSplMemo)
1184
- memoisedParsedInstructionSplMemo = new graphql.GraphQLObjectType({
1185
- fields: {
1186
- parsed: string(),
1187
- program: string(),
1188
- programId: string()
1189
- },
1190
- interfaces: [parsedTransactionInstructionInterface()],
1191
- name: "SplMemoInstruction"
1192
- });
1193
- return memoisedParsedInstructionSplMemo;
1194
- };
1195
- var memoisedParsedInstructionsSplToken;
1196
- var parsedInstructionsSplToken = () => {
1197
- if (!memoisedParsedInstructionsSplToken)
1198
- memoisedParsedInstructionsSplToken = [
1199
- parsedTransactionInstructionType("SplTokenInitializeMintInstruction", {
1200
- decimals: number(),
1201
- freezeAuthority: string(),
1202
- mint: string(),
1203
- mintAuthority: string(),
1204
- rentSysvar: string()
1205
- }),
1206
- parsedTransactionInstructionType("SplTokenInitializeMint2Instruction", {
1207
- decimals: number(),
1208
- freezeAuthority: string(),
1209
- mint: string(),
1210
- mintAuthority: string()
1211
- }),
1212
- parsedTransactionInstructionType("SplTokenInitializeAccountInstruction", {
1213
- account: string(),
1214
- mint: string(),
1215
- owner: string(),
1216
- rentSysvar: string()
1217
- }),
1218
- parsedTransactionInstructionType("SplTokenInitializeAccount2Instruction", {
1219
- account: string(),
1220
- mint: string(),
1221
- owner: string(),
1222
- rentSysvar: string()
1223
- }),
1224
- parsedTransactionInstructionType("SplTokenInitializeAccount3Instruction", {
1225
- account: string(),
1226
- mint: string(),
1227
- owner: string()
1228
- }),
1229
- parsedTransactionInstructionType("SplTokenInitializeMultisigInstruction", {
1230
- m: number(),
1231
- multisig: string(),
1232
- rentSysvar: string(),
1233
- signers: list(string())
1234
- }),
1235
- parsedTransactionInstructionType("SplTokenInitializeMultisig2Instruction", {
1236
- m: number(),
1237
- multisig: string(),
1238
- signers: list(string())
1239
- }),
1240
- parsedTransactionInstructionType("SplTokenTransferInstruction", {
1241
- amount: string(),
1242
- authority: string(),
1243
- destination: string(),
1244
- multisigAuthority: string(),
1245
- source: string()
1246
- }),
1247
- parsedTransactionInstructionType("SplTokenApproveInstruction", {
1248
- amount: string(),
1249
- delegate: string(),
1250
- multisigOwner: string(),
1251
- owner: string(),
1252
- source: string()
1253
- }),
1254
- parsedTransactionInstructionType("SplTokenRevokeInstruction", {
1255
- multisigOwner: string(),
1256
- owner: string(),
1257
- source: string()
1258
- }),
1259
- parsedTransactionInstructionType("SplTokenSetAuthorityInstruction", {
1260
- authority: string(),
1261
- authorityType: string(),
1262
- multisigAuthority: string(),
1263
- newAuthority: string()
1264
- }),
1265
- parsedTransactionInstructionType("SplTokenMintToInstruction", {
1266
- account: string(),
1267
- amount: string(),
1268
- authority: string(),
1269
- mint: string(),
1270
- mintAuthority: string(),
1271
- multisigMintAuthority: string()
1272
- }),
1273
- parsedTransactionInstructionType("SplTokenBurnInstruction", {
1274
- account: string(),
1275
- amount: string(),
1276
- authority: string(),
1277
- mint: string(),
1278
- multisigAuthority: string()
1279
- }),
1280
- parsedTransactionInstructionType("SplTokenCloseAccountInstruction", {
1281
- account: string(),
1282
- destination: string(),
1283
- multisigOwner: string(),
1284
- owner: string()
1285
- }),
1286
- parsedTransactionInstructionType("SplTokenFreezeAccountInstruction", {
1287
- account: string(),
1288
- freezeAuthority: string(),
1289
- mint: string(),
1290
- multisigFreezeAuthority: string()
1291
- }),
1292
- parsedTransactionInstructionType("SplTokenThawAccountInstruction", {
1293
- account: string(),
1294
- freezeAuthority: string(),
1295
- mint: string(),
1296
- multisigFreezeAuthority: string()
1297
- }),
1298
- parsedTransactionInstructionType("SplTokenTransferCheckedInstruction", {
1299
- authority: string(),
1300
- destination: string(),
1301
- mint: string(),
1302
- multisigAuthority: string(),
1303
- source: string(),
1304
- tokenAmount: string()
1305
- }),
1306
- parsedTransactionInstructionType("SplTokenApproveCheckedInstruction", {
1307
- delegate: string(),
1308
- mint: string(),
1309
- multisigOwner: string(),
1310
- owner: string(),
1311
- source: string(),
1312
- tokenAmount: string()
1313
- }),
1314
- parsedTransactionInstructionType("SplTokenMintToCheckedInstruction", {
1315
- account: string(),
1316
- authority: string(),
1317
- mint: string(),
1318
- mintAuthority: string(),
1319
- multisigMintAuthority: string(),
1320
- tokenAmount: string()
1321
- }),
1322
- parsedTransactionInstructionType("SplTokenBurnCheckedInstruction", {
1323
- account: string(),
1324
- authority: string(),
1325
- mint: string(),
1326
- multisigAuthority: string(),
1327
- tokenAmount: string()
1328
- }),
1329
- parsedTransactionInstructionType("SplTokenSyncNativeInstruction", {
1330
- account: string()
1331
- }),
1332
- parsedTransactionInstructionType("SplTokenGetAccountDataSizeInstruction", {
1333
- extensionTypes: list(string()),
1334
- mint: string()
1335
- }),
1336
- parsedTransactionInstructionType("SplTokenInitializeImmutableOwnerInstruction", {
1337
- account: string()
1338
- }),
1339
- parsedTransactionInstructionType("SplTokenAmountToUiAmountInstruction", {
1340
- amount: string(),
1341
- mint: string()
1342
- }),
1343
- parsedTransactionInstructionType("SplTokenUiAmountToAmountInstruction", {
1344
- mint: string(),
1345
- uiAmount: string()
1346
- }),
1347
- parsedTransactionInstructionType("SplTokenInitializeMintCloseAuthorityInstruction", {
1348
- mint: string(),
1349
- newAuthority: string()
1350
- })
1351
- // TODO: Extensions!
1352
- // - TransferFeeExtension
1353
- // - ConfidentialTransferFeeExtension
1354
- // - DefaultAccountStateExtension
1355
- // - Reallocate
1356
- // - MemoTransferExtension
1357
- // - CreateNativeMint
1358
- // - InitializeNonTransferableMint
1359
- // - InterestBearingMintExtension
1360
- // - CpiGuardExtension
1361
- // - InitializePermanentDelegate
1362
- // - TransferHookExtension
1363
- // - ConfidentialTransferFeeExtension
1364
- // - WithdrawExcessLamports
1365
- // - MetadataPointerExtension
1366
- ];
1367
- return memoisedParsedInstructionsSplToken;
1368
- };
1369
- var memoisedLockup;
1370
- var lockup = () => {
1371
- if (!memoisedLockup)
1372
- memoisedLockup = new graphql.GraphQLObjectType({
1373
- fields: {
1374
- custodian: string(),
1375
- epoch: bigint(),
1376
- unixTimestamp: bigint()
1377
- },
1378
- name: "Lockup"
1379
- });
1380
- return memoisedLockup;
1381
- };
1382
- var memoisedParsedInstructionsStake;
1383
- var parsedInstructionsStake = () => {
1384
- if (!memoisedParsedInstructionsStake)
1385
- memoisedParsedInstructionsStake = [
1386
- parsedTransactionInstructionType("StakeInitializeInstruction", {
1387
- authorized: object("StakeInitializeInstructionAuthorized", {
1388
- staker: string(),
1389
- withdrawer: string()
1390
- }),
1391
- lockup: object("StakeInitializeInstructionLockup", {
1392
- custodian: string(),
1393
- epoch: bigint(),
1394
- unixTimestamp: bigint()
1395
- }),
1396
- rentSysvar: string(),
1397
- stakeAccount: string()
1398
- }),
1399
- parsedTransactionInstructionType("StakeAuthorizeInstruction", {
1400
- authority: string(),
1401
- authorityType: string(),
1402
- clockSysvar: string(),
1403
- custodian: string(),
1404
- newAuthority: string(),
1405
- stakeAccount: string()
1406
- }),
1407
- parsedTransactionInstructionType("StakeDelegateStakeInstruction", {
1408
- clockSysvar: string(),
1409
- stakeAccount: string(),
1410
- stakeAuthority: string(),
1411
- stakeConfigAccount: string(),
1412
- stakeHistorySysvar: string(),
1413
- voteAccount: string()
1414
- }),
1415
- parsedTransactionInstructionType("StakeSplitInstruction", {
1416
- lamports: bigint(),
1417
- newSplitAccount: string(),
1418
- stakeAccount: string(),
1419
- stakeAuthority: string()
1420
- }),
1421
- parsedTransactionInstructionType("StakeWithdrawInstruction", {
1422
- clockSysvar: string(),
1423
- destination: string(),
1424
- lamports: bigint(),
1425
- stakeAccount: string(),
1426
- withdrawAuthority: string()
1427
- }),
1428
- parsedTransactionInstructionType("StakeDeactivateInstruction", {
1429
- clockSysvar: string(),
1430
- stakeAccount: string(),
1431
- stakeAuthority: string()
1432
- }),
1433
- parsedTransactionInstructionType("StakeSetLockupInstruction", {
1434
- custodian: string(),
1435
- lockup: type(lockup()),
1436
- stakeAccount: string()
1437
- }),
1438
- parsedTransactionInstructionType("StakeMergeInstruction", {
1439
- clockSysvar: string(),
1440
- destination: string(),
1441
- source: string(),
1442
- stakeAuthority: string(),
1443
- stakeHistorySysvar: string()
1444
- }),
1445
- parsedTransactionInstructionType("StakeAuthorizeWithSeedInstruction", {
1446
- authorityBase: string(),
1447
- authorityOwner: string(),
1448
- authoritySeed: string(),
1449
- authorityType: string(),
1450
- clockSysvar: string(),
1451
- custodian: string(),
1452
- newAuthorized: string(),
1453
- stakeAccount: string()
1454
- }),
1455
- parsedTransactionInstructionType("StakeInitializeCheckedInstruction", {
1456
- rentSysvar: string(),
1457
- stakeAccount: string(),
1458
- staker: string(),
1459
- withdrawer: string()
1460
- }),
1461
- parsedTransactionInstructionType("StakeAuthorizeCheckedInstruction", {
1462
- authority: string(),
1463
- authorityType: string(),
1464
- clockSysvar: string(),
1465
- custodian: string(),
1466
- newAuthority: string(),
1467
- stakeAccount: string()
1468
- }),
1469
- parsedTransactionInstructionType("StakeAuthorizeCheckedWithSeedInstruction", {
1470
- authorityBase: string(),
1471
- authorityOwner: string(),
1472
- authoritySeed: string(),
1473
- authorityType: string(),
1474
- clockSysvar: string(),
1475
- custodian: string(),
1476
- newAuthorized: string(),
1477
- stakeAccount: string()
1478
- }),
1479
- parsedTransactionInstructionType("StakeSetLockupCheckedInstruction", {
1480
- custodian: string(),
1481
- lockup: type(lockup()),
1482
- stakeAccount: string()
1483
- }),
1484
- parsedTransactionInstructionType("StakeDeactivateDelinquentInstruction", {
1485
- referenceVoteAccount: string(),
1486
- stakeAccount: string(),
1487
- voteAccount: string()
1488
- }),
1489
- parsedTransactionInstructionType("StakeRedelegateInstruction", {
1490
- newStakeAccount: string(),
1491
- stakeAccount: string(),
1492
- stakeAuthority: string(),
1493
- stakeConfigAccount: string(),
1494
- voteAccount: string()
1495
- })
1496
- ];
1497
- return memoisedParsedInstructionsStake;
1498
- };
1499
- var memoisedParsedInstructionsSystem;
1500
- var parsedInstructionsSystem = () => {
1501
- if (!memoisedParsedInstructionsSystem)
1502
- memoisedParsedInstructionsSystem = [
1503
- parsedTransactionInstructionType("CreateAccountInstruction", {
1504
- lamports: bigint(),
1505
- newAccount: string(),
1506
- owner: string(),
1507
- source: string(),
1508
- space: bigint()
1509
- }),
1510
- parsedTransactionInstructionType("AssignInstruction", {
1511
- owner: string()
1512
- }),
1513
- parsedTransactionInstructionType("TransferInstruction", {
1514
- amount: string(),
1515
- lamports: number(),
1516
- source: string()
1517
- }),
1518
- parsedTransactionInstructionType("CreateAccountWithSeedInstruction", {
1519
- base: string(),
1520
- lamports: bigint(),
1521
- owner: string(),
1522
- seed: string(),
1523
- space: bigint()
1524
- }),
1525
- parsedTransactionInstructionType("AdvanceNonceAccountInstruction", {
1526
- nonceAccount: string(),
1527
- nonceAuthority: string(),
1528
- recentBlockhashesSysvar: string()
1529
- }),
1530
- parsedTransactionInstructionType("WithdrawNonceAccountInstruction", {
1531
- destination: string(),
1532
- lamports: bigint(),
1533
- nonceAccount: string(),
1534
- nonceAuthority: string(),
1535
- recentBlockhashesSysvar: string(),
1536
- rentSysvar: string()
1537
- }),
1538
- parsedTransactionInstructionType("InitializeNonceAccountInstruction", {
1539
- nonceAccount: string(),
1540
- nonceAuthority: string(),
1541
- recentBlockhashesSysvar: string(),
1542
- rentSysvar: string()
1543
- }),
1544
- parsedTransactionInstructionType("AuthorizeNonceAccountInstruction", {
1545
- newAuthorized: string(),
1546
- nonceAccount: string(),
1547
- nonceAuthority: string()
1548
- }),
1549
- parsedTransactionInstructionType("UpgradeNonceAccountInstruction", {
1550
- nonceAccount: string()
1551
- }),
1552
- parsedTransactionInstructionType("AllocateInstruction", {
1553
- account: string(),
1554
- space: bigint()
1555
- }),
1556
- parsedTransactionInstructionType("AllocateWithSeedInstruction", {
1557
- account: string(),
1558
- base: string(),
1559
- owner: string(),
1560
- seed: string(),
1561
- space: bigint()
1562
- }),
1563
- parsedTransactionInstructionType("AssignWithSeedInstruction", {
1564
- account: string(),
1565
- base: string(),
1566
- owner: string(),
1567
- seed: string()
1568
- }),
1569
- parsedTransactionInstructionType("TransferWithSeedInstruction", {
1570
- destination: string(),
1571
- lamports: bigint(),
1572
- source: string(),
1573
- sourceBase: string(),
1574
- sourceOwner: string(),
1575
- sourceSeed: string()
1576
- })
1577
- ];
1578
- return memoisedParsedInstructionsSystem;
1579
- };
1580
- var memoisedVote;
1581
- var vote = () => {
1582
- if (!memoisedVote)
1583
- memoisedVote = new graphql.GraphQLObjectType({
1584
- fields: {
1585
- hash: string(),
1586
- slots: list(bigint()),
1587
- timestamp: bigint()
1588
- },
1589
- name: "Vote"
1590
- });
1591
- return memoisedVote;
1592
- };
1593
- var memoisedVoteStateUpdate;
1594
- var voteStateUpdate = () => {
1595
- if (!memoisedVoteStateUpdate)
1596
- memoisedVoteStateUpdate = new graphql.GraphQLObjectType({
1597
- fields: {
1598
- hash: string(),
1599
- lockouts: list(
1600
- object("VoteStateUpdateLockout", {
1601
- confirmationCount: number(),
1602
- slot: bigint()
1603
- })
1604
- ),
1605
- root: bigint(),
1606
- timestamp: bigint()
1607
- },
1608
- name: "VoteStateUpdate"
1609
- });
1610
- return memoisedVoteStateUpdate;
1611
- };
1612
- var memoisedParsedInstructionsVote;
1613
- var parsedInstructionsVote = () => {
1614
- if (!memoisedParsedInstructionsVote)
1615
- memoisedParsedInstructionsVote = [
1616
- parsedTransactionInstructionType("VoteInitializeAccountInstruction", {
1617
- authorizedVoter: string(),
1618
- authorizedWithdrawer: string(),
1619
- clockSysvar: string(),
1620
- commission: number(),
1621
- node: string(),
1622
- rentSysvar: string(),
1623
- voteAccount: string()
1624
- }),
1625
- parsedTransactionInstructionType("VoteAuthorizeInstruction", {
1626
- authority: string(),
1627
- authorityType: string(),
1628
- clockSysvar: string(),
1629
- newAuthority: string(),
1630
- voteAccount: string()
1631
- }),
1632
- parsedTransactionInstructionType("VoteAuthorizeWithSeedInstruction", {
1633
- authorityBaseKey: string(),
1634
- authorityOwner: string(),
1635
- authoritySeed: string(),
1636
- authorityType: string(),
1637
- clockSysvar: string(),
1638
- newAuthority: string(),
1639
- voteAccount: string()
1640
- }),
1641
- parsedTransactionInstructionType("VoteAuthorizeCheckedWithSeedInstruction", {
1642
- authorityBaseKey: string(),
1643
- authorityOwner: string(),
1644
- authoritySeed: string(),
1645
- authorityType: string(),
1646
- clockSysvar: string(),
1647
- newAuthority: string(),
1648
- voteAccount: string()
1649
- }),
1650
- parsedTransactionInstructionType("VoteVoteInstruction", {
1651
- clockSysvar: string(),
1652
- slotHashedSysvar: string(),
1653
- vote: type(vote()),
1654
- voteAccount: string(),
1655
- voteAuthority: string()
1656
- }),
1657
- parsedTransactionInstructionType("VoteUpdateVoteStateInstruction", {
1658
- hash: string(),
1659
- voteAccount: string(),
1660
- voteAuthority: string(),
1661
- voteStateUpdate: type(voteStateUpdate())
1662
- }),
1663
- parsedTransactionInstructionType("VoteUpdateVoteStateSwitchInstruction", {
1664
- hash: string(),
1665
- voteAccount: string(),
1666
- voteAuthority: string(),
1667
- voteStateUpdate: type(voteStateUpdate())
1668
- }),
1669
- parsedTransactionInstructionType("VoteCompactUpdateVoteStateInstruction", {
1670
- hash: string(),
1671
- voteAccount: string(),
1672
- voteAuthority: string(),
1673
- voteStateUpdate: type(voteStateUpdate())
1674
- }),
1675
- parsedTransactionInstructionType("VoteCompactUpdateVoteStateSwitchInstruction", {
1676
- hash: string(),
1677
- voteAccount: string(),
1678
- voteAuthority: string(),
1679
- voteStateUpdate: type(voteStateUpdate())
1680
- }),
1681
- parsedTransactionInstructionType("VoteWithdrawInstruction", {
1682
- destination: string(),
1683
- lamports: bigint(),
1684
- voteAccount: string(),
1685
- withdrawAuthority: string()
1686
- }),
1687
- parsedTransactionInstructionType("VoteUpdateValidatorIdentityInstruction", {
1688
- newValidatorIdentity: string(),
1689
- voteAccount: string(),
1690
- withdrawAuthority: string()
1691
- }),
1692
- parsedTransactionInstructionType("VoteUpdateCommissionInstruction", {
1693
- commission: string(),
1694
- voteAccount: string(),
1695
- withdrawAuthority: string()
1696
- }),
1697
- parsedTransactionInstructionType("VoteVoteSwitchInstruction", {
1698
- clockSysvar: string(),
1699
- hash: string(),
1700
- slotHashesSysvar: string(),
1701
- vote: type(vote()),
1702
- voteAccount: string(),
1703
- voteAuthority: string()
1704
- }),
1705
- parsedTransactionInstructionType("VoteAuthorizeCheckedInstruction", {
1706
- authority: string(),
1707
- authorityType: string(),
1708
- clockSysvar: string(),
1709
- newAuthority: string(),
1710
- voteAccount: string()
1711
- })
1712
- ];
1713
- return memoisedParsedInstructionsVote;
1714
- };
1715
- var memoisedTransactionMetaInterfaceFields;
1716
- var transactionMetaInterfaceFields = () => {
1717
- if (!memoisedTransactionMetaInterfaceFields)
1718
- memoisedTransactionMetaInterfaceFields = {
1719
- computeUnitsConsumed: bigint(),
1720
- err: string(),
1721
- fee: bigint(),
1722
- format: string(),
1723
- loadedAddresses: type(transactionMetaLoadedAddresses()),
1724
- logMessages: list(string()),
1725
- postBalances: list(bigint()),
1726
- postTokenBalances: list(type(tokenBalance())),
1727
- preBalances: list(bigint()),
1728
- preTokenBalances: list(type(tokenBalance())),
1729
- returnData: type(returnData()),
1730
- rewards: list(type(reward())),
1731
- status: type(transactionStatus())
1732
- };
1733
- return memoisedTransactionMetaInterfaceFields;
1734
- };
1735
- var memoisedTransactionMetaInterface;
1736
- var transactionMetaInterface = () => {
1737
- if (!memoisedTransactionMetaInterface)
1738
- memoisedTransactionMetaInterface = new graphql.GraphQLInterfaceType({
1739
- fields: {
1740
- ...transactionMetaInterfaceFields()
1741
- },
1742
- name: "TransactionMeta",
1743
- resolveType(meta) {
1744
- if (meta.format === "parsed") {
1745
- return "TransactionMetaParsed";
1746
- }
1747
- return "TransactionMetaUnparsed";
1748
- }
1749
- });
1750
- return memoisedTransactionMetaInterface;
1751
- };
1752
- var transactionMetaType = (name, description, innerInstructions) => new graphql.GraphQLObjectType({
1753
- description,
1754
- fields: {
1755
- ...transactionMetaInterfaceFields(),
1756
- innerInstructions
1757
- },
1758
- interfaces: [transactionMetaInterface()],
1759
- name
1760
- });
1761
- var memoisedTransactionMetaUnparsed;
1762
- var transactionMetaUnparsed = () => {
1763
- if (!memoisedTransactionMetaUnparsed)
1764
- memoisedTransactionMetaUnparsed = transactionMetaType(
1765
- "TransactionMetaUnparsed",
1766
- "Non-parsed transaction meta",
1767
- list(
1768
- object("TransactionMetaInnerInstructionsUnparsed", {
1769
- index: number(),
1770
- instructions: list(
1771
- object("TransactionMetaInnerInstructionsUnparsedInstruction", {
1772
- index: number(),
1773
- instructions: list(type(transactionInstruction()))
1774
- })
1775
- )
1776
- })
1777
- )
1778
- );
1779
- return memoisedTransactionMetaUnparsed;
1780
- };
1781
- var memoisedTransactionMetaParsed;
1782
- var transactionMetaParsed = () => {
1783
- if (!memoisedTransactionMetaParsed)
1784
- memoisedTransactionMetaParsed = transactionMetaType(
1785
- "TransactionMetaParsed",
1786
- "Parsed transaction meta",
1787
- list(
1788
- object("TransactionMetaInnerInstructionsParsed", {
1789
- index: number(),
1790
- instructions: list(type(parsedTransactionInstructionInterface()))
1791
- })
1792
- )
1793
- );
1794
- return memoisedTransactionMetaParsed;
1795
- };
1796
- var memoisedTransactionMessageInterfaceFields;
1797
- var transactionMessageInterfaceFields = () => {
1798
- if (!memoisedTransactionMessageInterfaceFields)
1799
- memoisedTransactionMessageInterfaceFields = {
1800
- addressTableLookups: list(type(addressTableLookup())),
1801
- format: string(),
1802
- header: object("TransactionJsonTransactionHeader", {
1803
- numReadonlySignedAccounts: number(),
1804
- numReadonlyUnsignedAccounts: number(),
1805
- numRequiredSignatures: number()
1806
- }),
1807
- recentBlockhash: string()
1808
- };
1809
- return memoisedTransactionMessageInterfaceFields;
1810
- };
1811
- var memoisedTransactionMessageInterface;
1812
- var transactionMessageInterface = () => {
1813
- if (!memoisedTransactionMessageInterface)
1814
- memoisedTransactionMessageInterface = new graphql.GraphQLInterfaceType({
1815
- fields: {
1816
- ...transactionMessageInterfaceFields()
1817
- },
1818
- name: "TransactionMessage",
1819
- resolveType(message) {
1820
- if (message.format === "parsed") {
1821
- return "TransactionMessageParsed";
1822
- }
1823
- return "TransactionMessageUnparsed";
1824
2379
  }
1825
- });
1826
- return memoisedTransactionMessageInterface;
1827
- };
1828
- var transactionMessageType = (name, description, accountKeys, instructions) => new graphql.GraphQLObjectType({
1829
- description,
1830
- fields: {
1831
- ...transactionMessageInterfaceFields(),
1832
- accountKeys,
1833
- instructions
1834
- },
1835
- interfaces: [transactionMessageInterface()],
1836
- name
1837
- });
1838
- var memoisedTransactionMessageUnparsed;
1839
- var transactionMessageUnparsed = () => {
1840
- if (!memoisedTransactionMessageUnparsed)
1841
- memoisedTransactionMessageUnparsed = transactionMessageType(
1842
- "TransactionMessageUnparsed",
1843
- "Non-parsed transaction message",
1844
- list(string()),
1845
- list(type(transactionInstruction()))
1846
- );
1847
- return memoisedTransactionMessageUnparsed;
1848
- };
1849
- var memoisedTransactionMessageParsed;
1850
- var transactionMessageParsed = () => {
1851
- if (!memoisedTransactionMessageParsed)
1852
- memoisedTransactionMessageParsed = transactionMessageType(
1853
- "TransactionMessageParsed",
1854
- "Parsed transaction message",
1855
- list(
1856
- object("transactionMessageParsedAccountKey", {
1857
- pubkey: string(),
1858
- signer: boolean(),
1859
- source: string(),
1860
- writable: boolean()
1861
- })
1862
- ),
1863
- list(type(parsedTransactionInstructionInterface()))
1864
- );
1865
- return memoisedTransactionMessageParsed;
1866
- };
1867
- var memoisedTransactionTransaction;
1868
- var transactionTransaction = () => {
1869
- if (!memoisedTransactionTransaction)
1870
- memoisedTransactionTransaction = new graphql.GraphQLObjectType({
1871
- fields: {
1872
- message: type(transactionMessageInterface()),
1873
- signatures: list(string())
1874
- },
1875
- name: "TransactionTransaction"
1876
- });
1877
- return memoisedTransactionTransaction;
1878
- };
1879
- var memoisedTransactionInterfaceFields;
1880
- var transactionInterfaceFields = () => {
1881
- if (!memoisedTransactionInterfaceFields)
1882
- memoisedTransactionInterfaceFields = {
1883
- blockTime: bigint(),
1884
- encoding: string(),
1885
- meta: type(transactionMetaInterface()),
1886
- slot: bigint()
1887
- };
1888
- return memoisedTransactionInterfaceFields;
2380
+ return "GenericInstruction";
2381
+ }
2382
+ },
2383
+ CreateLookupTableInstructionData: {
2384
+ lookupTableAccount: resolveAccount("lookupTableAccount"),
2385
+ lookupTableAuthority: resolveAccount("lookupTableAuthority"),
2386
+ payerAccount: resolveAccount("payerAccount"),
2387
+ systemProgram: resolveAccount("systemProgram")
2388
+ },
2389
+ ExtendLookupTableInstructionData: {
2390
+ lookupTableAccount: resolveAccount("lookupTableAccount"),
2391
+ lookupTableAuthority: resolveAccount("lookupTableAuthority"),
2392
+ payerAccount: resolveAccount("payerAccount"),
2393
+ systemProgram: resolveAccount("systemProgram")
2394
+ },
2395
+ FreezeLookupTableInstructionData: {
2396
+ lookupTableAccount: resolveAccount("lookupTableAccount"),
2397
+ lookupTableAuthority: resolveAccount("lookupTableAuthority")
2398
+ },
2399
+ DeactivateLookupTableInstructionData: {
2400
+ lookupTableAccount: resolveAccount("lookupTableAccount"),
2401
+ lookupTableAuthority: resolveAccount("lookupTableAuthority")
2402
+ },
2403
+ CloseLookupTableInstructionData: {
2404
+ lookupTableAccount: resolveAccount("lookupTableAccount"),
2405
+ lookupTableAuthority: resolveAccount("lookupTableAuthority"),
2406
+ recipient: resolveAccount("recipient")
2407
+ },
2408
+ BpfLoaderWriteInstructionData: {
2409
+ account: resolveAccount("account")
2410
+ },
2411
+ BpfLoaderFinalizeInstructionData: {
2412
+ account: resolveAccount("account")
2413
+ },
2414
+ BpfUpgradeableLoaderInitializeBufferInstructionData: {
2415
+ account: resolveAccount("account")
2416
+ },
2417
+ BpfUpgradeableLoaderWriteInstructionData: {
2418
+ account: resolveAccount("account"),
2419
+ authority: resolveAccount("authority")
2420
+ },
2421
+ BpfUpgradeableLoaderDeployWithMaxDataLenInstructionData: {
2422
+ authority: resolveAccount("authority"),
2423
+ bufferAccount: resolveAccount("bufferAccount"),
2424
+ payerAccount: resolveAccount("payerAccount"),
2425
+ programAccount: resolveAccount("programAccount"),
2426
+ programDataAccount: resolveAccount("programDataAccount")
2427
+ },
2428
+ BpfUpgradeableLoaderUpgradeInstructionData: {
2429
+ authority: resolveAccount("authority"),
2430
+ bufferAccount: resolveAccount("bufferAccount"),
2431
+ programAccount: resolveAccount("programAccount"),
2432
+ programDataAccount: resolveAccount("programDataAccount")
2433
+ },
2434
+ BpfUpgradeableLoaderSetAuthorityInstructionData: {
2435
+ account: resolveAccount("account"),
2436
+ authority: resolveAccount("authority"),
2437
+ newAuthority: resolveAccount("newAuthority")
2438
+ },
2439
+ BpfUpgradeableLoaderSetAuthorityCheckedInstructionData: {
2440
+ account: resolveAccount("account"),
2441
+ authority: resolveAccount("authority"),
2442
+ newAuthority: resolveAccount("newAuthority")
2443
+ },
2444
+ BpfUpgradeableLoaderCloseInstructionData: {
2445
+ account: resolveAccount("account"),
2446
+ authority: resolveAccount("authority"),
2447
+ programAccount: resolveAccount("programAccount"),
2448
+ recipient: resolveAccount("recipient")
2449
+ },
2450
+ BpfUpgradeableLoaderExtendProgramInstructionData: {
2451
+ payerAccount: resolveAccount("payerAccount"),
2452
+ programAccount: resolveAccount("programAccount"),
2453
+ programDataAccount: resolveAccount("programDataAccount"),
2454
+ systemProgram: resolveAccount("systemProgram")
2455
+ },
2456
+ SplAssociatedTokenCreateInstructionData: {
2457
+ account: resolveAccount("account"),
2458
+ mint: resolveAccount("mint"),
2459
+ source: resolveAccount("source"),
2460
+ systemProgram: resolveAccount("systemProgram"),
2461
+ tokenProgram: resolveAccount("tokenProgram"),
2462
+ wallet: resolveAccount("wallet")
2463
+ },
2464
+ SplAssociatedTokenCreateIdempotentInstructionData: {
2465
+ account: resolveAccount("account"),
2466
+ mint: resolveAccount("mint"),
2467
+ source: resolveAccount("source"),
2468
+ systemProgram: resolveAccount("systemProgram"),
2469
+ tokenProgram: resolveAccount("tokenProgram"),
2470
+ wallet: resolveAccount("wallet")
2471
+ },
2472
+ SplAssociatedTokenRecoverNestedInstructionData: {
2473
+ destination: resolveAccount("destination"),
2474
+ nestedMint: resolveAccount("nestedMint"),
2475
+ nestedOwner: resolveAccount("nestedOwner"),
2476
+ nestedSource: resolveAccount("nestedSource"),
2477
+ ownerMint: resolveAccount("ownerMint"),
2478
+ tokenProgram: resolveAccount("tokenProgram"),
2479
+ wallet: resolveAccount("wallet")
2480
+ },
2481
+ SplTokenInitializeMintInstructionData: {
2482
+ freezeAuthority: resolveAccount("freezeAuthority"),
2483
+ mint: resolveAccount("mint"),
2484
+ mintAuthority: resolveAccount("mintAuthority")
2485
+ },
2486
+ SplTokenInitializeMint2InstructionData: {
2487
+ freezeAuthority: resolveAccount("freezeAuthority"),
2488
+ mint: resolveAccount("mint"),
2489
+ mintAuthority: resolveAccount("mintAuthority")
2490
+ },
2491
+ SplTokenInitializeAccountInstructionData: {
2492
+ account: resolveAccount("account"),
2493
+ mint: resolveAccount("mint"),
2494
+ owner: resolveAccount("owner")
2495
+ },
2496
+ SplTokenInitializeAccount2InstructionData: {
2497
+ account: resolveAccount("account"),
2498
+ mint: resolveAccount("mint"),
2499
+ owner: resolveAccount("owner")
2500
+ },
2501
+ SplTokenInitializeAccount3InstructionData: {
2502
+ account: resolveAccount("account"),
2503
+ mint: resolveAccount("mint"),
2504
+ owner: resolveAccount("owner")
2505
+ },
2506
+ SplTokenInitializeMultisigInstructionData: {
2507
+ multisig: resolveAccount("multisig")
2508
+ },
2509
+ SplTokenInitializeMultisig2InstructionData: {
2510
+ multisig: resolveAccount("multisig")
2511
+ },
2512
+ SplTokenTransferInstructionData: {
2513
+ authority: resolveAccount("authority"),
2514
+ destination: resolveAccount("destination"),
2515
+ multisigAuthority: resolveAccount("multisigAuthority"),
2516
+ source: resolveAccount("source")
2517
+ },
2518
+ SplTokenApproveInstructionData: {
2519
+ delegate: resolveAccount("delegate"),
2520
+ multisigOwner: resolveAccount("multisigOwner"),
2521
+ owner: resolveAccount("owner"),
2522
+ source: resolveAccount("source")
2523
+ },
2524
+ SplTokenRevokeInstructionData: {
2525
+ multisigOwner: resolveAccount("multisigOwner"),
2526
+ owner: resolveAccount("owner"),
2527
+ source: resolveAccount("source")
2528
+ },
2529
+ SplTokenSetAuthorityInstructionData: {
2530
+ authority: resolveAccount("authority"),
2531
+ multisigAuthority: resolveAccount("multisigAuthority"),
2532
+ newAuthority: resolveAccount("newAuthority")
2533
+ },
2534
+ SplTokenMintToInstructionData: {
2535
+ account: resolveAccount("account"),
2536
+ authority: resolveAccount("authority"),
2537
+ mint: resolveAccount("mint"),
2538
+ mintAuthority: resolveAccount("mintAuthority"),
2539
+ multisigMintAuthority: resolveAccount("multisigMintAuthority")
2540
+ },
2541
+ SplTokenBurnInstructionData: {
2542
+ account: resolveAccount("account"),
2543
+ authority: resolveAccount("authority"),
2544
+ mint: resolveAccount("mint"),
2545
+ multisigAuthority: resolveAccount("multisigAuthority")
2546
+ },
2547
+ SplTokenCloseAccountInstructionData: {
2548
+ account: resolveAccount("account"),
2549
+ destination: resolveAccount("destination"),
2550
+ multisigOwner: resolveAccount("multisigOwner"),
2551
+ owner: resolveAccount("owner")
2552
+ },
2553
+ SplTokenFreezeAccountInstructionData: {
2554
+ account: resolveAccount("account"),
2555
+ freezeAuthority: resolveAccount("freezeAuthority"),
2556
+ mint: resolveAccount("mint"),
2557
+ multisigFreezeAuthority: resolveAccount("multisigFreezeAuthority")
2558
+ },
2559
+ SplTokenThawAccountInstructionData: {
2560
+ account: resolveAccount("account"),
2561
+ freezeAuthority: resolveAccount("freezeAuthority"),
2562
+ mint: resolveAccount("mint"),
2563
+ multisigFreezeAuthority: resolveAccount("multisigFreezeAuthority")
2564
+ },
2565
+ SplTokenTransferCheckedInstructionData: {
2566
+ authority: resolveAccount("authority"),
2567
+ destination: resolveAccount("destination"),
2568
+ mint: resolveAccount("mint"),
2569
+ multisigAuthority: resolveAccount("multisigAuthority"),
2570
+ source: resolveAccount("source")
2571
+ },
2572
+ SplTokenApproveCheckedInstructionData: {
2573
+ delegate: resolveAccount("delegate"),
2574
+ mint: resolveAccount("mint"),
2575
+ multisigOwner: resolveAccount("multisigOwner"),
2576
+ owner: resolveAccount("owner"),
2577
+ source: resolveAccount("source")
2578
+ },
2579
+ SplTokenMintToCheckedInstructionData: {
2580
+ account: resolveAccount("account"),
2581
+ authority: resolveAccount("authority"),
2582
+ mint: resolveAccount("mint"),
2583
+ mintAuthority: resolveAccount("mintAuthority"),
2584
+ multisigMintAuthority: resolveAccount("multisigMintAuthority")
2585
+ },
2586
+ SplTokenBurnCheckedInstructionData: {
2587
+ account: resolveAccount("account"),
2588
+ authority: resolveAccount("authority"),
2589
+ mint: resolveAccount("mint"),
2590
+ multisigAuthority: resolveAccount("multisigAuthority")
2591
+ },
2592
+ SplTokenSyncNativeInstructionData: {
2593
+ account: resolveAccount("account")
2594
+ },
2595
+ SplTokenGetAccountDataSizeInstructionData: {
2596
+ mint: resolveAccount("mint")
2597
+ },
2598
+ SplTokenAmountToUiAmountInstructionData: {
2599
+ mint: resolveAccount("mint")
2600
+ },
2601
+ SplTokenUiAmountToAmountInstructionData: {
2602
+ mint: resolveAccount("mint")
2603
+ },
2604
+ SplTokenInitializeMintCloseAuthorityInstructionData: {
2605
+ mint: resolveAccount("mint"),
2606
+ newAuthority: resolveAccount("newAuthority")
2607
+ },
2608
+ Lockup: {
2609
+ custodian: resolveAccount("custodian")
2610
+ },
2611
+ StakeInitializeInstructionDataAuthorized: {
2612
+ staker: resolveAccount("staker"),
2613
+ withdrawer: resolveAccount("withdrawer")
2614
+ },
2615
+ StakeInitializeInstructionData: {
2616
+ stakeAccount: resolveAccount("stakeAccount")
2617
+ },
2618
+ StakeAuthorizeInstructionData: {
2619
+ authority: resolveAccount("authority"),
2620
+ custodian: resolveAccount("custodian"),
2621
+ newAuthority: resolveAccount("newAuthority"),
2622
+ stakeAccount: resolveAccount("stakeAccount")
2623
+ },
2624
+ StakeDelegateStakeInstructionData: {
2625
+ stakeAccount: resolveAccount("stakeAccount"),
2626
+ stakeAuthority: resolveAccount("stakeAuthority"),
2627
+ stakeConfigAccount: resolveAccount("stakeConfigAccount"),
2628
+ voteAccount: resolveAccount("voteAccount")
2629
+ },
2630
+ StakeSplitInstructionData: {
2631
+ newSplitAccount: resolveAccount("newSplitAccount"),
2632
+ stakeAccount: resolveAccount("stakeAccount"),
2633
+ stakeAuthority: resolveAccount("stakeAuthority")
2634
+ },
2635
+ StakeWithdrawInstructionData: {
2636
+ destination: resolveAccount("destination"),
2637
+ stakeAccount: resolveAccount("stakeAccount"),
2638
+ withdrawAuthority: resolveAccount("withdrawAuthority")
2639
+ },
2640
+ StakeDeactivateInstructionData: {
2641
+ stakeAccount: resolveAccount("stakeAccount"),
2642
+ stakeAuthority: resolveAccount("stakeAuthority")
2643
+ },
2644
+ StakeSetLockupInstructionData: {
2645
+ custodian: resolveAccount("custodian"),
2646
+ stakeAccount: resolveAccount("stakeAccount")
2647
+ },
2648
+ StakeMergeInstructionData: {
2649
+ destination: resolveAccount("destination"),
2650
+ source: resolveAccount("source"),
2651
+ stakeAuthority: resolveAccount("stakeAuthority")
2652
+ },
2653
+ StakeAuthorizeWithSeedInstructionData: {
2654
+ authorityBase: resolveAccount("authorityBase"),
2655
+ authorityOwner: resolveAccount("authorityOwner"),
2656
+ custodian: resolveAccount("custodian"),
2657
+ newAuthorized: resolveAccount("newAuthorized"),
2658
+ stakeAccount: resolveAccount("stakeAccount")
2659
+ },
2660
+ StakeInitializeCheckedInstructionDataAuthorized: {
2661
+ stakeAccount: resolveAccount("stakeAccount"),
2662
+ staker: resolveAccount("staker"),
2663
+ withdrawer: resolveAccount("withdrawer")
2664
+ },
2665
+ StakeAuthorizeCheckedInstructionData: {
2666
+ authority: resolveAccount("authority"),
2667
+ custodian: resolveAccount("custodian"),
2668
+ newAuthority: resolveAccount("newAuthority"),
2669
+ stakeAccount: resolveAccount("stakeAccount")
2670
+ },
2671
+ StakeAuthorizeCheckedWithSeedInstructionData: {
2672
+ authorityBase: resolveAccount("authorityBase"),
2673
+ authorityOwner: resolveAccount("authorityOwner"),
2674
+ custodian: resolveAccount("custodian"),
2675
+ newAuthorized: resolveAccount("newAuthorized"),
2676
+ stakeAccount: resolveAccount("stakeAccount")
2677
+ },
2678
+ StakeSetLockupCheckedInstructionData: {
2679
+ custodian: resolveAccount("custodian"),
2680
+ stakeAccount: resolveAccount("stakeAccount")
2681
+ },
2682
+ StakeDeactivateDelinquentInstructionData: {
2683
+ referenceVoteAccount: resolveAccount("referenceVoteAccount"),
2684
+ stakeAccount: resolveAccount("stakeAccount"),
2685
+ voteAccount: resolveAccount("voteAccount")
2686
+ },
2687
+ StakeRedelegateInstructionData: {
2688
+ newStakeAccount: resolveAccount("newStakeAccount"),
2689
+ stakeAccount: resolveAccount("stakeAccount"),
2690
+ stakeAuthority: resolveAccount("stakeAuthority"),
2691
+ stakeConfigAccount: resolveAccount("stakeConfigAccount"),
2692
+ voteAccount: resolveAccount("voteAccount")
2693
+ },
2694
+ CreateAccountInstructionData: {
2695
+ newAccount: resolveAccount("newAccount"),
2696
+ owner: resolveAccount("owner"),
2697
+ source: resolveAccount("source")
2698
+ },
2699
+ AssignInstructionData: {
2700
+ account: resolveAccount("account"),
2701
+ owner: resolveAccount("owner")
2702
+ },
2703
+ TransferInstructionData: {
2704
+ destination: resolveAccount("destination"),
2705
+ source: resolveAccount("source")
2706
+ },
2707
+ CreateAccountWithSeedInstructionData: {
2708
+ base: resolveAccount("base"),
2709
+ owner: resolveAccount("owner"),
2710
+ seed: resolveAccount("seed")
2711
+ },
2712
+ AdvanceNonceAccountInstructionData: {
2713
+ nonceAccount: resolveAccount("nonceAccount"),
2714
+ nonceAuthority: resolveAccount("nonceAuthority")
2715
+ },
2716
+ WithdrawNonceAccountInstructionData: {
2717
+ destination: resolveAccount("destination"),
2718
+ nonceAccount: resolveAccount("nonceAccount"),
2719
+ nonceAuthority: resolveAccount("nonceAuthority")
2720
+ },
2721
+ InitializeNonceAccountInstructionData: {
2722
+ nonceAccount: resolveAccount("nonceAccount"),
2723
+ nonceAuthority: resolveAccount("nonceAuthority")
2724
+ },
2725
+ AuthorizeNonceAccountInstructionData: {
2726
+ newAuthorized: resolveAccount("newAuthorized"),
2727
+ nonceAccount: resolveAccount("nonceAccount"),
2728
+ nonceAuthority: resolveAccount("nonceAuthority")
2729
+ },
2730
+ UpgradeNonceAccountInstructionData: {
2731
+ nonceAccount: resolveAccount("nonceAccount"),
2732
+ nonceAuthority: resolveAccount("nonceAuthority")
2733
+ },
2734
+ AllocateInstructionData: {
2735
+ account: resolveAccount("account")
2736
+ },
2737
+ AllocateWithSeedInstructionData: {
2738
+ account: resolveAccount("account"),
2739
+ owner: resolveAccount("owner")
2740
+ },
2741
+ AssignWithSeedInstructionData: {
2742
+ account: resolveAccount("account"),
2743
+ owner: resolveAccount("owner")
2744
+ },
2745
+ TransferWithSeedInstructionData: {
2746
+ destination: resolveAccount("destination"),
2747
+ source: resolveAccount("source"),
2748
+ sourceOwner: resolveAccount("sourceOwner")
2749
+ },
2750
+ VoteInitializeAccountInstructionData: {
2751
+ authorizedVoter: resolveAccount("authorizedVoter"),
2752
+ authorizedWithdrawer: resolveAccount("authorizedWithdrawer"),
2753
+ node: resolveAccount("node"),
2754
+ voteAccount: resolveAccount("voteAccount")
2755
+ },
2756
+ VoteAuthorizeInstructionData: {
2757
+ authority: resolveAccount("authority"),
2758
+ newAuthority: resolveAccount("newAuthority"),
2759
+ voteAccount: resolveAccount("voteAccount")
2760
+ },
2761
+ VoteAuthorizeWithSeedInstructionData: {
2762
+ authorityOwner: resolveAccount("authorityOwner"),
2763
+ newAuthority: resolveAccount("newAuthority"),
2764
+ voteAccount: resolveAccount("voteAccount")
2765
+ },
2766
+ VoteAuthorizeCheckedWithSeedInstructionData: {
2767
+ authorityOwner: resolveAccount("authorityOwner"),
2768
+ newAuthority: resolveAccount("newAuthority"),
2769
+ voteAccount: resolveAccount("voteAccount")
2770
+ },
2771
+ VoteVoteInstructionData: {
2772
+ voteAccount: resolveAccount("voteAccount"),
2773
+ voteAuthority: resolveAccount("voteAuthority")
2774
+ },
2775
+ VoteUpdateVoteStateInstructionData: {
2776
+ voteAccount: resolveAccount("voteAccount"),
2777
+ voteAuthority: resolveAccount("voteAuthority")
2778
+ },
2779
+ VoteUpdateVoteStateSwitchInstructionData: {
2780
+ voteAccount: resolveAccount("voteAccount"),
2781
+ voteAuthority: resolveAccount("voteAuthority")
2782
+ },
2783
+ VoteCompactUpdateVoteStateInstructionData: {
2784
+ voteAccount: resolveAccount("voteAccount"),
2785
+ voteAuthority: resolveAccount("voteAuthority")
2786
+ },
2787
+ VoteCompactUpdateVoteStateSwitchInstructionData: {
2788
+ voteAccount: resolveAccount("voteAccount"),
2789
+ voteAuthority: resolveAccount("voteAuthority")
2790
+ },
2791
+ VoteWithdrawInstructionData: {
2792
+ voteAccount: resolveAccount("voteAccount"),
2793
+ withdrawAuthority: resolveAccount("withdrawAuthority")
2794
+ },
2795
+ VoteUpdateValidatorIdentityInstructionData: {
2796
+ newValidatorIdentity: resolveAccount("newValidatorIdentity"),
2797
+ voteAccount: resolveAccount("voteAccount"),
2798
+ withdrawAuthority: resolveAccount("withdrawAuthority")
2799
+ },
2800
+ VoteUpdateCommissionInstructionData: {
2801
+ voteAccount: resolveAccount("voteAccount"),
2802
+ withdrawAuthority: resolveAccount("withdrawAuthority")
2803
+ },
2804
+ VoteVoteSwitchInstructionData: {
2805
+ voteAccount: resolveAccount("voteAccount"),
2806
+ voteAuthority: resolveAccount("voteAuthority")
2807
+ },
2808
+ VoteAuthorizeCheckedInstructionData: {
2809
+ authority: resolveAccount("authority"),
2810
+ newAuthority: resolveAccount("newAuthority"),
2811
+ voteAccount: resolveAccount("voteAccount")
2812
+ }
1889
2813
  };
1890
- var memoisedTransactionInterface;
1891
- var transactionInterface = () => {
1892
- if (!memoisedTransactionInterface)
1893
- memoisedTransactionInterface = new graphql.GraphQLInterfaceType({
1894
- fields: {
1895
- ...transactionInterfaceFields()
1896
- },
1897
- name: "Transaction",
1898
- resolveType(transaction) {
1899
- if (transaction.encoding === "base58") {
2814
+
2815
+ // src/schema/transaction.ts
2816
+ var transactionTypeDefs = (
2817
+ /* GraphQL */
2818
+ `
2819
+ type TransactionStatusOk {
2820
+ Ok: String
2821
+ }
2822
+ type TransactionStatusErr {
2823
+ Err: String
2824
+ }
2825
+ union TransactionStatus = TransactionStatusOk | TransactionStatusErr
2826
+
2827
+ type TransactionLoadedAddresses {
2828
+ readonly: [String]
2829
+ writable: [String]
2830
+ }
2831
+
2832
+ type TransactionInnerInstruction {
2833
+ index: Int
2834
+ instructions: [TransactionInstruction]
2835
+ }
2836
+
2837
+ type TransactionMeta {
2838
+ computeUnitsConsumed: BigInt
2839
+ err: String
2840
+ fee: BigInt
2841
+ innerInstructions: [TransactionInnerInstruction]
2842
+ loadedAddresses: TransactionLoadedAddresses
2843
+ logMessages: [String]
2844
+ postBalances: [BigInt]
2845
+ postTokenBalances: [TokenBalance]
2846
+ preBalances: [BigInt]
2847
+ preTokenBalances: [TokenBalance]
2848
+ returnData: ReturnData
2849
+ rewards: [Reward]
2850
+ status: TransactionStatus
2851
+ }
2852
+
2853
+ type TransactionMessageAccountKey {
2854
+ pubkey: String
2855
+ signer: Boolean
2856
+ source: String
2857
+ writable: Boolean
2858
+ }
2859
+
2860
+ type TransactionMessageAddressTableLookup {
2861
+ accountKey: String
2862
+ readableIndexes: [Int]
2863
+ writableIndexes: [Int]
2864
+ }
2865
+
2866
+ type TransactionMessageHeader {
2867
+ numReadonlySignedAccounts: Int
2868
+ numReadonlyUnsignedAccounts: Int
2869
+ numRequiredSignatures: Int
2870
+ }
2871
+
2872
+ type TransactionMessage {
2873
+ accountKeys: [TransactionMessageAccountKey]
2874
+ addressTableLookups: [TransactionMessageAddressTableLookup]
2875
+ header: TransactionMessageHeader
2876
+ instructions: [TransactionInstruction]
2877
+ recentBlockhash: String
2878
+ }
2879
+
2880
+ # Transaction interface
2881
+ interface Transaction {
2882
+ blockTime: String
2883
+ encoding: String
2884
+ meta: TransactionMeta
2885
+ slot: BigInt
2886
+ version: String
2887
+ }
2888
+
2889
+ # A transaction with base58 encoded data
2890
+ type TransactionBase58 implements Transaction {
2891
+ blockTime: String
2892
+ data: String
2893
+ encoding: String
2894
+ meta: TransactionMeta
2895
+ slot: BigInt
2896
+ version: String
2897
+ }
2898
+
2899
+ # A transaction with base64 encoded data
2900
+ type TransactionBase64 implements Transaction {
2901
+ blockTime: String
2902
+ data: String
2903
+ encoding: String
2904
+ meta: TransactionMeta
2905
+ slot: BigInt
2906
+ version: String
2907
+ }
2908
+
2909
+ # A transaction with JSON encoded data
2910
+ type TransactionDataParsed {
2911
+ message: TransactionMessage
2912
+ signatures: [String]
2913
+ }
2914
+ type TransactionParsed implements Transaction {
2915
+ blockTime: String
2916
+ data: TransactionDataParsed
2917
+ encoding: String
2918
+ meta: TransactionMeta
2919
+ slot: BigInt
2920
+ version: String
2921
+ }
2922
+ `
2923
+ );
2924
+ var transactionResolvers = {
2925
+ Transaction: {
2926
+ __resolveType(transaction) {
2927
+ switch (transaction.encoding) {
2928
+ case "base58":
1900
2929
  return "TransactionBase58";
1901
- }
1902
- if (transaction.encoding === "base64") {
2930
+ case "base64":
1903
2931
  return "TransactionBase64";
1904
- }
1905
- if (transaction.encoding === "json") {
1906
- return "TransactionJson";
1907
- }
1908
- return "TransactionJsonParsed";
2932
+ default:
2933
+ return "TransactionParsed";
1909
2934
  }
1910
- });
1911
- return memoisedTransactionInterface;
1912
- };
1913
- var transactionType = (name, description, transaction) => new graphql.GraphQLObjectType({
1914
- description,
1915
- fields: {
1916
- ...transactionInterfaceFields(),
1917
- transaction
1918
- },
1919
- interfaces: [transactionInterface()],
1920
- name
1921
- });
1922
- var memoisedTransactionBase58;
1923
- var transactionBase58 = () => {
1924
- if (!memoisedTransactionBase58)
1925
- memoisedTransactionBase58 = transactionType(
1926
- "TransactionBase58",
1927
- "A Solana transaction as base58 encoded data",
1928
- string()
1929
- );
1930
- return memoisedTransactionBase58;
1931
- };
1932
- var memoisedTransactionBase64;
1933
- var transactionBase64 = () => {
1934
- if (!memoisedTransactionBase64)
1935
- memoisedTransactionBase64 = transactionType(
1936
- "TransactionBase64",
1937
- "A Solana transaction as base64 encoded data",
1938
- string()
1939
- );
1940
- return memoisedTransactionBase64;
1941
- };
1942
- var memoisedTransactionJson;
1943
- var transactionJson = () => {
1944
- if (!memoisedTransactionJson)
1945
- memoisedTransactionJson = transactionType(
1946
- "TransactionJson",
1947
- "A Solana transaction as a JSON object",
1948
- type(transactionTransaction())
1949
- );
1950
- return memoisedTransactionJson;
1951
- };
1952
- var memoisedTransactionJsonParsed;
1953
- var transactionJsonParsed = () => {
1954
- if (!memoisedTransactionJsonParsed)
1955
- memoisedTransactionJsonParsed = transactionType(
1956
- "TransactionJsonParsed",
1957
- "A Solana transaction as a parsed JSON object",
1958
- type(transactionTransaction())
1959
- );
1960
- return memoisedTransactionJsonParsed;
1961
- };
1962
- var memoisedTransactionTypes;
1963
- var transactionTypes = () => {
1964
- if (!memoisedTransactionTypes)
1965
- memoisedTransactionTypes = [
1966
- partiallyDecodedTransactionInstruction(),
1967
- ...parsedInstructionsAddressLookupTable(),
1968
- ...parsedInstructionsBpfLoader(),
1969
- ...parsedInstructionsBpfUpgradeableLoader(),
1970
- ...parsedInstructionsStake(),
1971
- ...parsedInstructionsSplAssociatedToken(),
1972
- parsedInstructionSplMemo(),
1973
- ...parsedInstructionsSplToken(),
1974
- ...parsedInstructionsSystem(),
1975
- ...parsedInstructionsVote(),
1976
- transactionMetaUnparsed(),
1977
- transactionMetaParsed(),
1978
- transactionMessageUnparsed(),
1979
- transactionMessageParsed(),
1980
- transactionBase58(),
1981
- transactionBase64(),
1982
- transactionJson(),
1983
- transactionJsonParsed()
1984
- ];
1985
- return memoisedTransactionTypes;
1986
- };
1987
-
1988
- // src/schema/transaction/query.ts
1989
- var transactionQuery = () => ({
1990
- transaction: {
1991
- args: {
1992
- commitment: type(commitmentInputType()),
1993
- encoding: type(transactionEncodingInputType()),
1994
- maxSupportedTransactionVersion: type(maxSupportedTransactionVersionInputType()),
1995
- signature: nonNull(string())
1996
- },
1997
- resolve: (_parent, args, context) => context.resolveTransaction(args),
1998
- type: transactionInterface()
2935
+ }
1999
2936
  }
2000
- });
2001
-
2002
- // src/schema/block/types.ts
2003
- var memoisedTransactionForAccounts;
2004
- var transactionForAccounts = () => {
2005
- if (!memoisedTransactionForAccounts)
2006
- memoisedTransactionForAccounts = new graphql.GraphQLObjectType({
2007
- fields: {
2008
- meta: object("TransactionMetaForAccounts", {
2009
- computeUnitsUsed: bigint(),
2010
- err: string(),
2011
- fee: bigint(),
2012
- format: string(),
2013
- loadedAddresses: type(transactionMetaLoadedAddresses()),
2014
- logMessages: list(string()),
2015
- postBalances: list(bigint()),
2016
- postTokenBalances: list(type(tokenBalance())),
2017
- preBalances: list(bigint()),
2018
- preTokenBalances: list(type(tokenBalance())),
2019
- returnData: type(returnData()),
2020
- rewards: list(type(reward())),
2021
- status: type(transactionStatus())
2022
- }),
2023
- transaction: type(transactionInterface()),
2024
- // TODO
2025
- version: string()
2026
- },
2027
- name: "TransactionForAccounts"
2028
- });
2029
- return memoisedTransactionForAccounts;
2030
- };
2031
- var memoisedBlockInterfaceFields;
2032
- var blockInterfaceFields = () => {
2033
- if (!memoisedBlockInterfaceFields)
2034
- memoisedBlockInterfaceFields = {
2035
- blockHeight: bigint(),
2036
- blockTime: bigint(),
2037
- blockhash: string(),
2038
- parentSlot: bigint(),
2039
- previousBlockhash: string(),
2040
- rewards: list(type(reward()))
2041
- };
2042
- return memoisedBlockInterfaceFields;
2043
- };
2044
- var memoisedBlockInterface;
2045
- var blockInterface = () => {
2046
- if (!memoisedBlockInterface)
2047
- memoisedBlockInterface = new graphql.GraphQLInterfaceType({
2048
- fields: {
2049
- ...blockInterfaceFields()
2050
- },
2051
- name: "Block",
2052
- resolveType(block) {
2053
- if (block.transactionDetails === "signatures") {
2054
- return "BlockWithSignatures";
2055
- }
2056
- if (block.transactionDetails === "accounts") {
2057
- return "BlockWithAccounts";
2058
- }
2059
- if (block.transactionDetails === "none") {
2060
- return "BlockWithNoTransactions";
2061
- }
2062
- return "BlockWithTransactions";
2063
- }
2064
- });
2065
- return memoisedBlockInterface;
2066
- };
2067
- var memoisedBlockWithNoTransactions;
2068
- var blockWithNoTransactions = () => {
2069
- if (!memoisedBlockWithNoTransactions)
2070
- memoisedBlockWithNoTransactions = new graphql.GraphQLObjectType({
2071
- fields: {
2072
- ...blockInterfaceFields()
2073
- },
2074
- interfaces: [blockInterface()],
2075
- name: "BlockWithNoTransactions"
2076
- });
2077
- return memoisedBlockWithNoTransactions;
2078
- };
2079
- var memoisedBlockWithSignatures;
2080
- var blockWithSignatures = () => {
2081
- if (!memoisedBlockWithSignatures)
2082
- memoisedBlockWithSignatures = new graphql.GraphQLObjectType({
2083
- fields: {
2084
- ...blockInterfaceFields(),
2085
- signatures: list(string())
2086
- },
2087
- interfaces: [blockInterface()],
2088
- name: "BlockWithSignatures"
2089
- });
2090
- return memoisedBlockWithSignatures;
2091
- };
2092
- var memoisedBlockWithAccounts;
2093
- var blockWithAccounts = () => {
2094
- if (!memoisedBlockWithAccounts)
2095
- memoisedBlockWithAccounts = new graphql.GraphQLObjectType({
2096
- fields: {
2097
- ...blockInterfaceFields(),
2098
- transactions: list(type(transactionForAccounts()))
2099
- },
2100
- interfaces: [blockInterface()],
2101
- name: "BlockWithAccounts"
2102
- });
2103
- return memoisedBlockWithAccounts;
2104
- };
2105
- var memoisedBlockWithTransactions;
2106
- var blockWithTransactions = () => {
2107
- if (!memoisedBlockWithTransactions)
2108
- memoisedBlockWithTransactions = new graphql.GraphQLObjectType({
2109
- fields: {
2110
- ...blockInterfaceFields(),
2111
- transactions: list(type(transactionInterface()))
2112
- },
2113
- interfaces: [blockInterface()],
2114
- name: "BlockWithTransactions"
2115
- });
2116
- return memoisedBlockWithTransactions;
2117
- };
2118
- var memoisedBlockTypes;
2119
- var blockTypes = () => {
2120
- if (!memoisedBlockTypes)
2121
- memoisedBlockTypes = [
2122
- blockWithNoTransactions(),
2123
- blockWithSignatures(),
2124
- blockWithAccounts(),
2125
- blockWithTransactions()
2126
- ];
2127
- return memoisedBlockTypes;
2128
2937
  };
2129
2938
 
2130
- // src/schema/block/query.ts
2131
- var blockQuery = () => ({
2132
- block: {
2133
- args: {
2134
- commitment: type(commitmentInputType()),
2135
- encoding: type(transactionEncodingInputType()),
2136
- maxSupportedTransactionVersion: string(),
2137
- rewards: boolean(),
2138
- slot: nonNull(bigint()),
2139
- transactionDetails: type(blockTransactionDetailsInputType())
2939
+ // src/schema/index.ts
2940
+ var schemaTypeDefs = (
2941
+ /* GraphQL */
2942
+ `
2943
+ type Query {
2944
+ account(
2945
+ address: String!
2946
+ commitment: Commitment
2947
+ dataSlice: DataSlice
2948
+ encoding: AccountEncoding
2949
+ minContextSlot: BigInt
2950
+ ): Account
2951
+ block(
2952
+ slot: BigInt!
2953
+ commitment: Commitment
2954
+ encoding: TransactionEncoding
2955
+ transactionDetails: BlockTransactionDetails
2956
+ ): Block
2957
+ programAccounts(
2958
+ programAddress: String!
2959
+ commitment: Commitment
2960
+ dataSlice: DataSlice
2961
+ encoding: AccountEncoding
2962
+ filters: [ProgramAccountsFilter]
2963
+ minContextSlot: BigInt
2964
+ ): [Account]
2965
+ transaction(
2966
+ signature: String!
2967
+ commitment: Commitment
2968
+ encoding: TransactionEncoding
2969
+ ): Transaction
2970
+ }
2971
+
2972
+ schema {
2973
+ query: Query
2974
+ }
2975
+ `
2976
+ );
2977
+ var schemaResolvers = {
2978
+ Query: {
2979
+ account(_, args, context, info) {
2980
+ return context.loaders.account.load(args, info);
2140
2981
  },
2141
- resolve: (_parent, args, context) => context.resolveBlock(args),
2142
- type: blockInterface()
2143
- }
2144
- });
2145
- var programAccount = () => new graphql.GraphQLObjectType({
2146
- fields: {
2147
- account: type(accountInterface()),
2148
- pubkey: string()
2149
- },
2150
- name: "ProgramAccount"
2151
- });
2152
-
2153
- // src/schema/program-accounts/query.ts
2154
- var programAccountsQuery = () => ({
2155
- programAccounts: {
2156
- args: {
2157
- commitment: type(commitmentInputType()),
2158
- dataSlice: type(dataSliceInputType()),
2159
- encoding: type(accountEncodingInputType()),
2160
- filters: list(type(programAccountFilterInputType())),
2161
- minContextSlot: bigint(),
2162
- programAddress: nonNull(string()),
2163
- withContext: string()
2982
+ block(_, args, context, info) {
2983
+ return context.loaders.block.load(args, info);
2984
+ },
2985
+ programAccounts(_, args, context, info) {
2986
+ return context.loaders.programAccounts.load(args, info);
2164
2987
  },
2165
- resolve: (_parent, args, context) => context.resolveProgramAccounts(args),
2166
- type: new graphql.GraphQLList(programAccount())
2988
+ transaction(_, args, context, info) {
2989
+ return context.loaders.transaction.load(args, info);
2990
+ }
2167
2991
  }
2168
- });
2992
+ };
2993
+ function createSolanaGraphQLSchema() {
2994
+ return schema.makeExecutableSchema({
2995
+ resolvers: {
2996
+ ...accountResolvers,
2997
+ ...blockResolvers,
2998
+ ...commonResolvers,
2999
+ ...inputResolvers,
3000
+ ...instructionResolvers,
3001
+ ...scalarResolvers,
3002
+ ...schemaResolvers,
3003
+ ...transactionResolvers
3004
+ },
3005
+ typeDefs: [
3006
+ accountTypeDefs,
3007
+ blockTypeDefs,
3008
+ commonTypeDefs,
3009
+ inputTypeDefs,
3010
+ instructionTypeDefs,
3011
+ scalarTypeDefs,
3012
+ schemaTypeDefs,
3013
+ transactionTypeDefs
3014
+ ]
3015
+ });
3016
+ }
2169
3017
 
2170
3018
  // src/rpc.ts
2171
3019
  function createRpcGraphQL(rpc) {
2172
3020
  const context = createSolanaGraphQLContext(rpc);
2173
- const schema = new graphql.GraphQLSchema({
2174
- query: new graphql.GraphQLObjectType({
2175
- fields: {
2176
- ...accountQuery(),
2177
- ...blockQuery(),
2178
- ...programAccountsQuery(),
2179
- ...transactionQuery()
2180
- },
2181
- name: "RootQuery"
2182
- }),
2183
- types: [...accountTypes(), ...blockTypes(), ...transactionTypes()]
2184
- });
3021
+ const schema = createSolanaGraphQLSchema();
2185
3022
  return {
2186
3023
  context,
2187
3024
  async query(source, variableValues) {
2188
- const result = await graphql.graphql({
3025
+ return graphql.graphql({
2189
3026
  contextValue: this.context,
2190
3027
  schema: this.schema,
2191
3028
  source,
2192
3029
  variableValues
2193
3030
  });
2194
- this.context.cache.flush();
2195
- return result;
2196
3031
  },
2197
3032
  schema
2198
3033
  };