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

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