@solana/rpc-graphql 2.0.0-experimental.b419cd0 → 2.0.0-experimental.b5bbd3a

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