@solana/rpc-graphql 2.0.0-experimental.aa4a701 → 2.0.0-experimental.acab173

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