@solana/rpc-graphql 2.0.0-experimental.ee4214c → 2.0.0-experimental.f46b34c

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