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