@solana/rpc-graphql 2.0.0-experimental.b153bb7 → 2.0.0-experimental.b315352

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