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