@solana/rpc-graphql 2.0.0-experimental.c7ef49c → 2.0.0-experimental.cc94aa3

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