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