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

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