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