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