@solana/rpc-graphql 2.0.0-experimental.f46b34c → 2.0.0-experimental.fb88a79

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