@solana/rpc-graphql 2.0.0-experimental.aa4a701 → 2.0.0-experimental.ab12c29

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 (41) hide show
  1. package/dist/index.browser.cjs +326 -305
  2. package/dist/index.browser.cjs.map +1 -1
  3. package/dist/index.browser.js +326 -305
  4. package/dist/index.browser.js.map +1 -1
  5. package/dist/index.native.js +326 -301
  6. package/dist/index.native.js.map +1 -1
  7. package/dist/index.node.cjs +326 -301
  8. package/dist/index.node.cjs.map +1 -1
  9. package/dist/index.node.js +326 -301
  10. package/dist/index.node.js.map +1 -1
  11. package/dist/types/context.d.ts +9 -10
  12. package/dist/types/context.d.ts.map +1 -0
  13. package/dist/types/index.d.ts.map +1 -0
  14. package/dist/types/loaders/account.d.ts.map +1 -0
  15. package/dist/types/loaders/block.d.ts +12 -2
  16. package/dist/types/loaders/block.d.ts.map +1 -0
  17. package/dist/types/loaders/common/resolve-info.d.ts.map +1 -0
  18. package/dist/types/loaders/program-accounts.d.ts +24 -2
  19. package/dist/types/loaders/program-accounts.d.ts.map +1 -0
  20. package/dist/types/loaders/transaction.d.ts +25 -2
  21. package/dist/types/loaders/transaction.d.ts.map +1 -0
  22. package/dist/types/resolvers/account.d.ts.map +1 -0
  23. package/dist/types/rpc.d.ts.map +1 -0
  24. package/dist/types/schema/account.d.ts +1 -1
  25. package/dist/types/schema/account.d.ts.map +1 -0
  26. package/dist/types/schema/block.d.ts +1 -1
  27. package/dist/types/schema/block.d.ts.map +1 -0
  28. package/dist/types/schema/common/inputs.d.ts +2 -9
  29. package/dist/types/schema/common/inputs.d.ts.map +1 -0
  30. package/dist/types/schema/common/scalars.d.ts +33 -1
  31. package/dist/types/schema/common/scalars.d.ts.map +1 -0
  32. package/dist/types/schema/common/types.d.ts +16 -1
  33. package/dist/types/schema/common/types.d.ts.map +1 -0
  34. package/dist/types/schema/index.d.ts.map +1 -0
  35. package/dist/types/schema/instruction.d.ts +1 -1
  36. package/dist/types/schema/instruction.d.ts.map +1 -0
  37. package/dist/types/schema/program-accounts.d.ts.map +1 -0
  38. package/dist/types/schema/transaction.d.ts +1 -1
  39. package/dist/types/schema/transaction.d.ts.map +1 -0
  40. package/package.json +8 -8
  41. package/dist/types/cache.d.ts +0 -7
@@ -12,41 +12,6 @@ var fastStableStringify__default = /*#__PURE__*/_interopDefault(fastStableString
12
12
 
13
13
  // src/rpc.ts
14
14
 
15
- // src/cache.ts
16
- var stringifyValue = (value) => JSON.stringify(value, (_, value2) => {
17
- if (typeof value2 === "bigint") {
18
- return value2.toString() + "n";
19
- }
20
- return value2;
21
- });
22
- var parseValue = (value) => JSON.parse(value, (_, value2) => {
23
- if (typeof value2 === "string" && /\d+n$/.test(value2)) {
24
- return BigInt(value2.slice(0, -1));
25
- }
26
- return value2;
27
- });
28
- var cacheKey = (key, variables) => `GraphQLCache:${stringifyValue(key)}:${stringifyValue(variables)}`;
29
- function createGraphQLCache() {
30
- return {
31
- // Browser
32
- flush: () => {
33
- for (let i = localStorage.length - 1; i >= 0; i--) {
34
- const storageKey = localStorage.key(i);
35
- if (storageKey && storageKey.startsWith("GraphQLCache:")) {
36
- localStorage.removeItem(storageKey);
37
- }
38
- }
39
- },
40
- get: (key, variables) => {
41
- const value = localStorage.getItem(cacheKey(key, variables));
42
- return value === null ? null : parseValue(value);
43
- },
44
- insert: (key, variables, value) => {
45
- localStorage.setItem(cacheKey(key, variables), stringifyValue(value));
46
- }
47
- } ;
48
- }
49
-
50
15
  // src/loaders/common/resolve-info.ts
51
16
  function onlyPresentFieldRequested(fieldName, info) {
52
17
  if (info && info.fieldNodes[0].selectionSet) {
@@ -127,15 +92,14 @@ function createAccountLoader(rpc) {
127
92
  }
128
93
  };
129
94
  }
130
-
131
- // src/loaders/transaction.ts
132
95
  function normalizeArgs2(args) {
133
- const { commitment, encoding } = args;
96
+ const { commitment, encoding, signature } = args;
134
97
  return {
135
98
  commitment: commitment ?? "confirmed",
136
99
  encoding: encoding ?? "jsonParsed",
137
100
  // Always use 0 to avoid silly errors
138
- maxSupportedTransactionVersion: 0
101
+ maxSupportedTransactionVersion: 0,
102
+ signature
139
103
  };
140
104
  }
141
105
  function refineJsonParsedInstructionData(jsonParsedInstructionData) {
@@ -188,21 +152,16 @@ function refineJsonParsedTransaction({ encoding, transaction }) {
188
152
  function processQueryResponse2({ encoding, transaction }) {
189
153
  return refineJsonParsedTransaction({ encoding, transaction });
190
154
  }
191
- async function loadTransaction({ signature, ...config }, cache, rpc, _info) {
192
- const requestConfig = normalizeArgs2(config);
193
- const { encoding } = requestConfig;
194
- const cached = cache.get(signature, requestConfig);
195
- if (cached !== null) {
196
- return cached;
197
- }
198
- let transaction = await rpc.getTransaction(signature, requestConfig).send().catch((e) => {
155
+ async function loadTransaction(rpc, { signature, ...config }) {
156
+ const { encoding } = config;
157
+ let transaction = await rpc.getTransaction(signature, config).send().catch((e) => {
199
158
  throw e;
200
159
  });
201
160
  if (transaction === null) {
202
161
  return null;
203
162
  }
204
163
  if (encoding !== "jsonParsed") {
205
- const transactionJsonParsed = await rpc.getTransaction(signature, requestConfig).send().catch((e) => {
164
+ const transactionJsonParsed = await rpc.getTransaction(signature, config).send().catch((e) => {
206
165
  throw e;
207
166
  });
208
167
  if (transactionJsonParsed === null) {
@@ -215,18 +174,35 @@ async function loadTransaction({ signature, ...config }, cache, rpc, _info) {
215
174
  };
216
175
  }
217
176
  const queryResponse = processQueryResponse2({ encoding, transaction });
218
- cache.insert(signature, requestConfig, queryResponse);
219
177
  return queryResponse;
220
178
  }
179
+ function createTransactionBatchLoadFn(rpc) {
180
+ const resolveTransactionUsingRpc = loadTransaction.bind(null, rpc);
181
+ return async (transactionQueryArgs) => {
182
+ return await Promise.all(transactionQueryArgs.map(async (args) => await resolveTransactionUsingRpc(args)));
183
+ };
184
+ }
185
+ function createTransactionLoader(rpc) {
186
+ const loader = new DataLoader__default.default(createTransactionBatchLoadFn(rpc), { cacheKeyFn: fastStableStringify__default.default });
187
+ return {
188
+ load: async (args, info) => {
189
+ if (onlyPresentFieldRequested("signature", info)) {
190
+ return { signature: args.signature };
191
+ }
192
+ return loader.load(normalizeArgs2(args));
193
+ }
194
+ };
195
+ }
221
196
 
222
197
  // src/loaders/block.ts
223
198
  function normalizeArgs3(args) {
224
- const { commitment, encoding, transactionDetails } = args;
199
+ const { commitment, encoding, slot, transactionDetails } = args;
225
200
  return {
226
201
  commitment: commitment ?? "confirmed",
227
202
  encoding: encoding ?? "jsonParsed",
228
203
  // Always use 0 to avoid silly errors
229
204
  maxSupportedTransactionVersion: 0,
205
+ slot,
230
206
  transactionDetails: transactionDetails ?? "full"
231
207
  };
232
208
  }
@@ -261,33 +237,43 @@ function processQueryResponse3({
261
237
  transactionDetails
262
238
  };
263
239
  }
264
- async function loadBlock({ slot, ...config }, cache, rpc, _info) {
265
- const requestConfig = normalizeArgs3(config);
266
- const { encoding, transactionDetails } = requestConfig;
267
- const cached = cache.get(slot, config);
268
- if (cached !== null) {
269
- return cached;
270
- }
271
- const block = await rpc.getBlock(slot, requestConfig).send().catch((e) => {
240
+ async function loadBlock(rpc, { slot, ...config }) {
241
+ const { encoding, transactionDetails } = config;
242
+ const block = await rpc.getBlock(slot, config).send().catch((e) => {
272
243
  throw e;
273
244
  });
274
245
  if (block === null) {
275
246
  return { slot };
276
247
  }
277
248
  const queryResponse = processQueryResponse3({ block, encoding, transactionDetails });
278
- cache.insert(slot, requestConfig, queryResponse);
279
249
  return queryResponse;
280
250
  }
281
-
282
- // src/loaders/program-accounts.ts
251
+ function createBlockBatchLoadFn(rpc) {
252
+ const resolveBlockUsingRpc = loadBlock.bind(null, rpc);
253
+ return async (blockQueryArgs) => {
254
+ return await Promise.all(blockQueryArgs.map(async (args) => await resolveBlockUsingRpc(args)));
255
+ };
256
+ }
257
+ function createBlockLoader(rpc) {
258
+ const loader = new DataLoader__default.default(createBlockBatchLoadFn(rpc), { cacheKeyFn: fastStableStringify__default.default });
259
+ return {
260
+ load: async (args, info) => {
261
+ if (onlyPresentFieldRequested("slot", info)) {
262
+ return { slot: args.slot };
263
+ }
264
+ return loader.load(normalizeArgs3(args));
265
+ }
266
+ };
267
+ }
283
268
  function normalizeArgs4(args) {
284
- const { commitment, dataSlice, encoding, filters, minContextSlot } = args;
269
+ const { commitment, dataSlice, encoding, filters, minContextSlot, programAddress } = args;
285
270
  return {
286
271
  commitment: commitment ?? "confirmed",
287
272
  dataSlice,
288
273
  encoding: encoding ?? "jsonParsed",
289
274
  filters,
290
- minContextSlot
275
+ minContextSlot,
276
+ programAddress
291
277
  };
292
278
  }
293
279
  function processQueryResponse4({ encoding, programAccounts }) {
@@ -309,14 +295,9 @@ function processQueryResponse4({ encoding, programAccounts }) {
309
295
  };
310
296
  });
311
297
  }
312
- async function loadProgramAccounts({ programAddress, ...config }, cache, rpc, _info) {
313
- const requestConfig = normalizeArgs4(config);
314
- const { encoding } = requestConfig;
315
- const cached = cache.get(programAddress, requestConfig);
316
- if (cached !== null) {
317
- return cached;
318
- }
319
- const programAccounts = await rpc.getProgramAccounts(programAddress, requestConfig).send().then((res) => {
298
+ async function loadProgramAccounts(rpc, { programAddress, ...config }) {
299
+ const { encoding } = config;
300
+ const programAccounts = await rpc.getProgramAccounts(programAddress, config).send().then((res) => {
320
301
  if ("value" in res) {
321
302
  return res.value;
322
303
  }
@@ -325,24 +306,36 @@ async function loadProgramAccounts({ programAddress, ...config }, cache, rpc, _i
325
306
  throw e;
326
307
  });
327
308
  const queryResponse = processQueryResponse4({ encoding, programAccounts });
328
- cache.insert(programAddress, requestConfig, queryResponse);
329
309
  return queryResponse;
330
310
  }
311
+ function createProgramAccountsBatchLoadFn(rpc) {
312
+ const resolveProgramAccountsUsingRpc = loadProgramAccounts.bind(null, rpc);
313
+ return async (programAccountsQueryArgs) => {
314
+ return await Promise.all(
315
+ programAccountsQueryArgs.map(async (args) => await resolveProgramAccountsUsingRpc(args))
316
+ );
317
+ };
318
+ }
319
+ function createProgramAccountsLoader(rpc) {
320
+ const loader = new DataLoader__default.default(createProgramAccountsBatchLoadFn(rpc), { cacheKeyFn: fastStableStringify__default.default });
321
+ return {
322
+ load: async (args, info) => {
323
+ if (onlyPresentFieldRequested("programAddress", info)) {
324
+ return { programAddress: args.programAddress };
325
+ }
326
+ return loader.load(normalizeArgs4(args));
327
+ }
328
+ };
329
+ }
331
330
 
332
331
  // src/context.ts
333
332
  function createSolanaGraphQLContext(rpc) {
334
- const cache = createGraphQLCache();
335
333
  return {
336
- accountLoader: createAccountLoader(rpc),
337
- cache,
338
- loadBlock(args, info) {
339
- return loadBlock(args, this.cache, this.rpc);
340
- },
341
- loadProgramAccounts(args, info) {
342
- return loadProgramAccounts(args, this.cache, this.rpc);
343
- },
344
- loadTransaction(args, info) {
345
- return loadTransaction(args, this.cache, this.rpc);
334
+ loaders: {
335
+ account: createAccountLoader(rpc),
336
+ block: createBlockLoader(rpc),
337
+ programAccounts: createProgramAccountsLoader(rpc),
338
+ transaction: createTransactionLoader(rpc)
346
339
  },
347
340
  rpc
348
341
  };
@@ -350,7 +343,7 @@ function createSolanaGraphQLContext(rpc) {
350
343
 
351
344
  // src/resolvers/account.ts
352
345
  var resolveAccount = (fieldName) => {
353
- return (parent, args, context, info) => parent[fieldName] === null ? null : context.accountLoader.load({ ...args, address: parent[fieldName] }, info);
346
+ return (parent, args, context, info) => parent[fieldName] === null ? null : context.loaders.account.load({ ...args, address: parent[fieldName] }, info);
354
347
  };
355
348
 
356
349
  // src/schema/account.ts
@@ -359,8 +352,8 @@ var accountTypeDefs = (
359
352
  `
360
353
  # Account interface
361
354
  interface Account {
362
- address: String
363
- encoding: String
355
+ address: Address
356
+ encoding: AccountEncoding
364
357
  executable: Boolean
365
358
  lamports: BigInt
366
359
  owner: Account
@@ -369,9 +362,9 @@ var accountTypeDefs = (
369
362
 
370
363
  # An account with base58 encoded data
371
364
  type AccountBase58 implements Account {
372
- address: String
373
- data: String
374
- encoding: String
365
+ address: Address
366
+ data: Base58EncodedBytes
367
+ encoding: AccountEncoding
375
368
  executable: Boolean
376
369
  lamports: BigInt
377
370
  owner: Account
@@ -380,9 +373,9 @@ var accountTypeDefs = (
380
373
 
381
374
  # An account with base64 encoded data
382
375
  type AccountBase64 implements Account {
383
- address: String
384
- data: String
385
- encoding: String
376
+ address: Address
377
+ data: Base64EncodedBytes
378
+ encoding: AccountEncoding
386
379
  executable: Boolean
387
380
  lamports: BigInt
388
381
  owner: Account
@@ -391,9 +384,9 @@ var accountTypeDefs = (
391
384
 
392
385
  # An account with base64+zstd encoded data
393
386
  type AccountBase64Zstd implements Account {
394
- address: String
395
- data: String
396
- encoding: String
387
+ address: Address
388
+ data: Base64ZstdEncodedBytes
389
+ encoding: AccountEncoding
397
390
  executable: Boolean
398
391
  lamports: BigInt
399
392
  owner: Account
@@ -420,9 +413,9 @@ var accountTypeDefs = (
420
413
  feeCalculator: NonceAccountFeeCalculator
421
414
  }
422
415
  type NonceAccount implements Account & AccountJsonParsed {
423
- address: String
416
+ address: Address
424
417
  data: NonceAccountData
425
- encoding: String
418
+ encoding: AccountEncoding
426
419
  executable: Boolean
427
420
  lamports: BigInt
428
421
  meta: JsonParsedAccountMeta
@@ -439,9 +432,9 @@ var accountTypeDefs = (
439
432
  lastExtendedSlotStartIndex: Int
440
433
  }
441
434
  type LookupTableAccount implements Account & AccountJsonParsed {
442
- address: String
435
+ address: Address
443
436
  data: LookupTableAccountData
444
- encoding: String
437
+ encoding: AccountEncoding
445
438
  executable: Boolean
446
439
  lamports: BigInt
447
440
  meta: JsonParsedAccountMeta
@@ -458,9 +451,9 @@ var accountTypeDefs = (
458
451
  supply: String
459
452
  }
460
453
  type MintAccount implements Account & AccountJsonParsed {
461
- address: String
454
+ address: Address
462
455
  data: MintAccountData
463
- encoding: String
456
+ encoding: AccountEncoding
464
457
  executable: Boolean
465
458
  lamports: BigInt
466
459
  meta: JsonParsedAccountMeta
@@ -477,9 +470,9 @@ var accountTypeDefs = (
477
470
  tokenAmount: TokenAmount
478
471
  }
479
472
  type TokenAccount implements Account & AccountJsonParsed {
480
- address: String
473
+ address: Address
481
474
  data: TokenAccountData
482
- encoding: String
475
+ encoding: AccountEncoding
483
476
  executable: Boolean
484
477
  lamports: BigInt
485
478
  meta: JsonParsedAccountMeta
@@ -518,9 +511,9 @@ var accountTypeDefs = (
518
511
  stake: StakeAccountDataStake
519
512
  }
520
513
  type StakeAccount implements Account & AccountJsonParsed {
521
- address: String
514
+ address: Address
522
515
  data: StakeAccountData
523
- encoding: String
516
+ encoding: AccountEncoding
524
517
  executable: Boolean
525
518
  lamports: BigInt
526
519
  meta: JsonParsedAccountMeta
@@ -558,9 +551,9 @@ var accountTypeDefs = (
558
551
  votes: [VoteAccountDataVote]
559
552
  }
560
553
  type VoteAccount implements Account & AccountJsonParsed {
561
- address: String
554
+ address: Address
562
555
  data: VoteAccountData
563
- encoding: String
556
+ encoding: AccountEncoding
564
557
  executable: Boolean
565
558
  lamports: BigInt
566
559
  meta: JsonParsedAccountMeta
@@ -679,7 +672,7 @@ var blockTypeDefs = (
679
672
  }
680
673
 
681
674
  type TransactionDataForAccounts {
682
- accountKeys: [String]
675
+ accountKeys: [Address]
683
676
  signatures: [String]
684
677
  }
685
678
 
@@ -769,26 +762,6 @@ var blockResolvers = {
769
762
  var inputTypeDefs = (
770
763
  /* GraphQL */
771
764
  `
772
- enum AccountEncoding {
773
- base58
774
- base64
775
- base64Zstd
776
- jsonParsed
777
- }
778
-
779
- enum BlockTransactionDetails {
780
- accounts
781
- full
782
- none
783
- signatures
784
- }
785
-
786
- enum Commitment {
787
- confirmed
788
- finalized
789
- processed
790
- }
791
-
792
765
  input DataSlice {
793
766
  offset: Int
794
767
  length: Int
@@ -797,37 +770,41 @@ var inputTypeDefs = (
797
770
  input ProgramAccountsFilter {
798
771
  bytes: BigInt
799
772
  dataSize: BigInt
800
- encoding: String
773
+ encoding: AccountEncoding
801
774
  offset: BigInt
802
775
  }
803
-
804
- enum TransactionEncoding {
805
- base58
806
- base64
807
- jsonParsed
808
- }
809
-
810
- enum TransactionVersion {
811
- legacy
812
- zero
813
- }
814
776
  `
815
777
  );
816
- var inputResolvers = {
817
- AccountEncoding: {
818
- base64Zstd: "base64+zstd"
819
- },
820
- TransactionVersion: {
821
- zero: 0
822
- }
823
- };
778
+ var inputResolvers = {};
824
779
  var scalarTypeDefs = (
825
780
  /* GraphQL */
826
781
  `
782
+ scalar Address
783
+ scalar Base58EncodedBytes
784
+ scalar Base64EncodedBytes
785
+ scalar Base64ZstdEncodedBytes
827
786
  scalar BigInt
828
787
  `
829
788
  );
789
+ var stringScalarAlias = {
790
+ __parseLiteral(ast) {
791
+ if (ast.kind === graphql.Kind.STRING) {
792
+ return ast.value.toString();
793
+ }
794
+ return null;
795
+ },
796
+ __parseValue(value) {
797
+ return value;
798
+ },
799
+ __serialize(value) {
800
+ return value;
801
+ }
802
+ };
830
803
  var scalarResolvers = {
804
+ Address: stringScalarAlias,
805
+ Base58EncodedBytes: stringScalarAlias,
806
+ Base64EncodedBytes: stringScalarAlias,
807
+ Base64ZstdEncodedBytes: stringScalarAlias,
831
808
  BigInt: {
832
809
  __parseLiteral(ast) {
833
810
  if (ast.kind === graphql.Kind.STRING) {
@@ -848,16 +825,36 @@ var scalarResolvers = {
848
825
  var commonTypeDefs = (
849
826
  /* GraphQL */
850
827
  `
828
+ enum AccountEncoding {
829
+ BASE_58
830
+ BASE_64
831
+ BASE_64_ZSTD
832
+ PARSED
833
+ }
834
+
835
+ enum BlockTransactionDetails {
836
+ accounts
837
+ full
838
+ none
839
+ signatures
840
+ }
841
+
842
+ enum Commitment {
843
+ confirmed
844
+ finalized
845
+ processed
846
+ }
847
+
851
848
  type ReturnData {
852
- data: String
853
- programId: String
849
+ data: Base64EncodedBytes
850
+ programId: Address
854
851
  }
855
852
 
856
853
  type Reward {
857
854
  commission: Int
858
855
  lamports: BigInt
859
856
  postBalance: BigInt
860
- pubkey: String
857
+ pubkey: Address
861
858
  rewardType: String
862
859
  }
863
860
 
@@ -872,15 +869,41 @@ var commonTypeDefs = (
872
869
  accountIndex: Int
873
870
  mint: Account
874
871
  owner: Account
875
- programId: String
872
+ programId: Address
876
873
  uiTokenAmount: TokenAmount
877
874
  }
875
+
876
+ enum TransactionEncoding {
877
+ BASE_58
878
+ BASE_64
879
+ PARSED
880
+ }
881
+
882
+ enum TransactionVersion {
883
+ LEGACY
884
+ ZERO
885
+ }
878
886
  `
879
887
  );
880
888
  var commonResolvers = {
889
+ AccountEncoding: {
890
+ BASE_58: "base58",
891
+ BASE_64: "base64",
892
+ BASE_64_ZSTD: "base64+zstd",
893
+ PARSED: "jsonParsed"
894
+ },
881
895
  TokenBalance: {
882
896
  mint: resolveAccount("mint"),
883
897
  owner: resolveAccount("owner")
898
+ },
899
+ TransactionEncoding: {
900
+ BASE_58: "base58",
901
+ BASE_64: "base64",
902
+ PARSED: "jsonParsed"
903
+ },
904
+ TransactionVersion: {
905
+ LEGACY: "legacy",
906
+ ZERO: 0
884
907
  }
885
908
  };
886
909
 
@@ -895,14 +918,14 @@ var instructionTypeDefs = (
895
918
 
896
919
  # Transaction instruction interface
897
920
  interface TransactionInstruction {
898
- programId: String
921
+ programId: Address
899
922
  }
900
923
 
901
924
  # Generic transaction instruction
902
925
  type GenericInstruction implements TransactionInstruction {
903
- accounts: [String]
904
- data: String
905
- programId: String
926
+ accounts: [Address]
927
+ data: Base64EncodedBytes
928
+ programId: Address
906
929
  }
907
930
 
908
931
  # AddressLookupTable: CreateLookupTable
@@ -917,21 +940,21 @@ var instructionTypeDefs = (
917
940
  type CreateLookupTableInstruction implements TransactionInstruction {
918
941
  data: CreateLookupTableInstructionData
919
942
  meta: JsonParsedInstructionMeta
920
- programId: String
943
+ programId: Address
921
944
  }
922
945
 
923
946
  # AddressLookupTable: ExtendLookupTable
924
947
  type ExtendLookupTableInstructionData {
925
948
  lookupTableAccount: Account
926
949
  lookupTableAuthority: Account
927
- newAddresses: [String]
950
+ newAddresses: [Address]
928
951
  payerAccount: Account
929
952
  systemProgram: Account
930
953
  }
931
954
  type ExtendLookupTableInstruction implements TransactionInstruction {
932
955
  data: ExtendLookupTableInstructionData
933
956
  meta: JsonParsedInstructionMeta
934
- programId: String
957
+ programId: Address
935
958
  }
936
959
 
937
960
  # AddressLookupTable: FreezeLookupTable
@@ -942,7 +965,7 @@ var instructionTypeDefs = (
942
965
  type FreezeLookupTableInstruction implements TransactionInstruction {
943
966
  data: FreezeLookupTableInstructionData
944
967
  meta: JsonParsedInstructionMeta
945
- programId: String
968
+ programId: Address
946
969
  }
947
970
 
948
971
  # AddressLookupTable: DeactivateLookupTable
@@ -953,7 +976,7 @@ var instructionTypeDefs = (
953
976
  type DeactivateLookupTableInstruction implements TransactionInstruction {
954
977
  data: DeactivateLookupTableInstructionData
955
978
  meta: JsonParsedInstructionMeta
956
- programId: String
979
+ programId: Address
957
980
  }
958
981
 
959
982
  # AddressLookupTable: CloseLookupTable
@@ -965,19 +988,19 @@ var instructionTypeDefs = (
965
988
  type CloseLookupTableInstruction implements TransactionInstruction {
966
989
  data: CloseLookupTableInstructionData
967
990
  meta: JsonParsedInstructionMeta
968
- programId: String
991
+ programId: Address
969
992
  }
970
993
 
971
994
  # BpfLoader: Write
972
995
  type BpfLoaderWriteInstructionData {
973
996
  account: Account
974
- bytes: String
997
+ bytes: Base64EncodedBytes
975
998
  offset: BigInt # FIXME:*
976
999
  }
977
1000
  type BpfLoaderWriteInstruction implements TransactionInstruction {
978
1001
  data: BpfLoaderWriteInstructionData
979
1002
  meta: JsonParsedInstructionMeta
980
- programId: String
1003
+ programId: Address
981
1004
  }
982
1005
 
983
1006
  # BpfLoader: Finalize
@@ -987,7 +1010,7 @@ var instructionTypeDefs = (
987
1010
  type BpfLoaderFinalizeInstruction implements TransactionInstruction {
988
1011
  data: BpfLoaderFinalizeInstructionData
989
1012
  meta: JsonParsedInstructionMeta
990
- programId: String
1013
+ programId: Address
991
1014
  }
992
1015
 
993
1016
  # BpfUpgradeableLoader: InitializeBuffer
@@ -997,53 +1020,53 @@ var instructionTypeDefs = (
997
1020
  type BpfUpgradeableLoaderInitializeBufferInstruction implements TransactionInstruction {
998
1021
  data: BpfUpgradeableLoaderInitializeBufferInstructionData
999
1022
  meta: JsonParsedInstructionMeta
1000
- programId: String
1023
+ programId: Address
1001
1024
  }
1002
1025
 
1003
1026
  # BpfUpgradeableLoader: Write
1004
1027
  type BpfUpgradeableLoaderWriteInstructionData {
1005
1028
  account: Account
1006
1029
  authority: Account
1007
- bytes: String
1030
+ bytes: Base64EncodedBytes
1008
1031
  offset: BigInt # FIXME:*
1009
1032
  }
1010
1033
  type BpfUpgradeableLoaderWriteInstruction implements TransactionInstruction {
1011
1034
  data: BpfUpgradeableLoaderWriteInstructionData
1012
1035
  meta: JsonParsedInstructionMeta
1013
- programId: String
1036
+ programId: Address
1014
1037
  }
1015
1038
 
1016
1039
  # BpfUpgradeableLoader: DeployWithMaxDataLen
1017
1040
  type BpfUpgradeableLoaderDeployWithMaxDataLenInstructionData {
1018
1041
  authority: Account
1019
1042
  bufferAccount: Account
1020
- clockSysvar: String
1043
+ clockSysvar: Address
1021
1044
  maxDataLen: BigInt
1022
1045
  payerAccount: Account
1023
1046
  programAccount: Account
1024
1047
  programDataAccount: Account
1025
- rentSysvar: String
1048
+ rentSysvar: Address
1026
1049
  }
1027
1050
  type BpfUpgradeableLoaderDeployWithMaxDataLenInstruction implements TransactionInstruction {
1028
1051
  data: BpfUpgradeableLoaderDeployWithMaxDataLenInstructionData
1029
1052
  meta: JsonParsedInstructionMeta
1030
- programId: String
1053
+ programId: Address
1031
1054
  }
1032
1055
 
1033
1056
  # BpfUpgradeableLoader: Upgrade
1034
1057
  type BpfUpgradeableLoaderUpgradeInstructionData {
1035
1058
  authority: Account
1036
1059
  bufferAccount: Account
1037
- clockSysvar: String
1060
+ clockSysvar: Address
1038
1061
  programAccount: Account
1039
1062
  programDataAccount: Account
1040
- rentSysvar: String
1063
+ rentSysvar: Address
1041
1064
  spillAccount: Account
1042
1065
  }
1043
1066
  type BpfUpgradeableLoaderUpgradeInstruction implements TransactionInstruction {
1044
1067
  data: BpfUpgradeableLoaderUpgradeInstructionData
1045
1068
  meta: JsonParsedInstructionMeta
1046
- programId: String
1069
+ programId: Address
1047
1070
  }
1048
1071
 
1049
1072
  # BpfUpgradeableLoader: SetAuthority
@@ -1055,7 +1078,7 @@ var instructionTypeDefs = (
1055
1078
  type BpfUpgradeableLoaderSetAuthorityInstruction implements TransactionInstruction {
1056
1079
  data: BpfUpgradeableLoaderSetAuthorityInstructionData
1057
1080
  meta: JsonParsedInstructionMeta
1058
- programId: String
1081
+ programId: Address
1059
1082
  }
1060
1083
 
1061
1084
  # BpfUpgradeableLoader: SetAuthorityChecked
@@ -1067,7 +1090,7 @@ var instructionTypeDefs = (
1067
1090
  type BpfUpgradeableLoaderSetAuthorityCheckedInstruction implements TransactionInstruction {
1068
1091
  data: BpfUpgradeableLoaderSetAuthorityCheckedInstructionData
1069
1092
  meta: JsonParsedInstructionMeta
1070
- programId: String
1093
+ programId: Address
1071
1094
  }
1072
1095
 
1073
1096
  # BpfUpgradeableLoader: Close
@@ -1080,7 +1103,7 @@ var instructionTypeDefs = (
1080
1103
  type BpfUpgradeableLoaderCloseInstruction implements TransactionInstruction {
1081
1104
  data: BpfUpgradeableLoaderCloseInstructionData
1082
1105
  meta: JsonParsedInstructionMeta
1083
- programId: String
1106
+ programId: Address
1084
1107
  }
1085
1108
 
1086
1109
  # BpfUpgradeableLoader: ExtendProgram
@@ -1094,13 +1117,13 @@ var instructionTypeDefs = (
1094
1117
  type BpfUpgradeableLoaderExtendProgramInstruction implements TransactionInstruction {
1095
1118
  data: BpfUpgradeableLoaderExtendProgramInstructionData
1096
1119
  meta: JsonParsedInstructionMeta
1097
- programId: String
1120
+ programId: Address
1098
1121
  }
1099
1122
 
1100
1123
  # SplAssociatedTokenAccount: Create
1101
1124
  type SplAssociatedTokenCreateInstructionData {
1102
1125
  account: Account
1103
- mint: String
1126
+ mint: Address
1104
1127
  source: Account
1105
1128
  systemProgram: Account
1106
1129
  tokenProgram: Account
@@ -1109,13 +1132,13 @@ var instructionTypeDefs = (
1109
1132
  type SplAssociatedTokenCreateInstruction implements TransactionInstruction {
1110
1133
  data: SplAssociatedTokenCreateInstructionData
1111
1134
  meta: JsonParsedInstructionMeta
1112
- programId: String
1135
+ programId: Address
1113
1136
  }
1114
1137
 
1115
1138
  # SplAssociatedTokenAccount: CreateIdempotent
1116
1139
  type SplAssociatedTokenCreateIdempotentInstructionData {
1117
1140
  account: Account
1118
- mint: String
1141
+ mint: Address
1119
1142
  source: Account
1120
1143
  systemProgram: Account
1121
1144
  tokenProgram: Account
@@ -1124,7 +1147,7 @@ var instructionTypeDefs = (
1124
1147
  type SplAssociatedTokenCreateIdempotentInstruction implements TransactionInstruction {
1125
1148
  data: SplAssociatedTokenCreateIdempotentInstructionData
1126
1149
  meta: JsonParsedInstructionMeta
1127
- programId: String
1150
+ programId: Address
1128
1151
  }
1129
1152
 
1130
1153
  # SplAssociatedTokenAccount: RecoverNested
@@ -1140,7 +1163,7 @@ var instructionTypeDefs = (
1140
1163
  type SplAssociatedTokenRecoverNestedInstruction implements TransactionInstruction {
1141
1164
  data: SplAssociatedTokenRecoverNestedInstructionData
1142
1165
  meta: JsonParsedInstructionMeta
1143
- programId: String
1166
+ programId: Address
1144
1167
  }
1145
1168
 
1146
1169
  # SplMemo
@@ -1150,7 +1173,7 @@ var instructionTypeDefs = (
1150
1173
  type SplMemoInstruction implements TransactionInstruction {
1151
1174
  data: SplMemoInstructionData
1152
1175
  meta: JsonParsedInstructionMeta
1153
- programId: String
1176
+ programId: Address
1154
1177
  }
1155
1178
 
1156
1179
  # SplToken: InitializeMint
@@ -1159,12 +1182,12 @@ var instructionTypeDefs = (
1159
1182
  freezeAuthority: Account
1160
1183
  mint: Account
1161
1184
  mintAuthority: Account
1162
- rentSysvar: String
1185
+ rentSysvar: Address
1163
1186
  }
1164
1187
  type SplTokenInitializeMintInstruction implements TransactionInstruction {
1165
1188
  data: SplTokenInitializeMintInstructionData
1166
1189
  meta: JsonParsedInstructionMeta
1167
- programId: String
1190
+ programId: Address
1168
1191
  }
1169
1192
 
1170
1193
  # SplToken: InitializeMint2
@@ -1177,7 +1200,7 @@ var instructionTypeDefs = (
1177
1200
  type SplTokenInitializeMint2Instruction implements TransactionInstruction {
1178
1201
  data: SplTokenInitializeMint2InstructionData
1179
1202
  meta: JsonParsedInstructionMeta
1180
- programId: String
1203
+ programId: Address
1181
1204
  }
1182
1205
 
1183
1206
  # SplToken: InitializeAccount
@@ -1185,12 +1208,12 @@ var instructionTypeDefs = (
1185
1208
  account: Account
1186
1209
  mint: Account
1187
1210
  owner: Account
1188
- rentSysvar: String
1211
+ rentSysvar: Address
1189
1212
  }
1190
1213
  type SplTokenInitializeAccountInstruction implements TransactionInstruction {
1191
1214
  data: SplTokenInitializeAccountInstructionData
1192
1215
  meta: JsonParsedInstructionMeta
1193
- programId: String
1216
+ programId: Address
1194
1217
  }
1195
1218
 
1196
1219
  # SplToken: InitializeAccount2
@@ -1198,12 +1221,12 @@ var instructionTypeDefs = (
1198
1221
  account: Account
1199
1222
  mint: Account
1200
1223
  owner: Account
1201
- rentSysvar: String
1224
+ rentSysvar: Address
1202
1225
  }
1203
1226
  type SplTokenInitializeAccount2Instruction implements TransactionInstruction {
1204
1227
  data: SplTokenInitializeAccount2InstructionData
1205
1228
  meta: JsonParsedInstructionMeta
1206
- programId: String
1229
+ programId: Address
1207
1230
  }
1208
1231
 
1209
1232
  # SplToken: InitializeAccount3
@@ -1215,32 +1238,32 @@ var instructionTypeDefs = (
1215
1238
  type SplTokenInitializeAccount3Instruction implements TransactionInstruction {
1216
1239
  data: SplTokenInitializeAccount3InstructionData
1217
1240
  meta: JsonParsedInstructionMeta
1218
- programId: String
1241
+ programId: Address
1219
1242
  }
1220
1243
 
1221
1244
  # SplToken: InitializeMultisig
1222
1245
  type SplTokenInitializeMultisigInstructionData {
1223
1246
  m: BigInt # FIXME:*
1224
1247
  multisig: Account
1225
- rentSysvar: String
1226
- signers: [String]
1248
+ rentSysvar: Address
1249
+ signers: [Address]
1227
1250
  }
1228
1251
  type SplTokenInitializeMultisigInstruction implements TransactionInstruction {
1229
1252
  data: SplTokenInitializeMultisigInstructionData
1230
1253
  meta: JsonParsedInstructionMeta
1231
- programId: String
1254
+ programId: Address
1232
1255
  }
1233
1256
 
1234
1257
  # SplToken: InitializeMultisig2
1235
1258
  type SplTokenInitializeMultisig2InstructionData {
1236
1259
  m: BigInt # FIXME:*
1237
1260
  multisig: Account
1238
- signers: [String]
1261
+ signers: [Address]
1239
1262
  }
1240
1263
  type SplTokenInitializeMultisig2Instruction implements TransactionInstruction {
1241
1264
  data: SplTokenInitializeMultisig2InstructionData
1242
1265
  meta: JsonParsedInstructionMeta
1243
- programId: String
1266
+ programId: Address
1244
1267
  }
1245
1268
 
1246
1269
  # SplToken: Transfer
@@ -1254,7 +1277,7 @@ var instructionTypeDefs = (
1254
1277
  type SplTokenTransferInstruction implements TransactionInstruction {
1255
1278
  data: SplTokenTransferInstructionData
1256
1279
  meta: JsonParsedInstructionMeta
1257
- programId: String
1280
+ programId: Address
1258
1281
  }
1259
1282
 
1260
1283
  # SplToken: Approve
@@ -1268,7 +1291,7 @@ var instructionTypeDefs = (
1268
1291
  type SplTokenApproveInstruction implements TransactionInstruction {
1269
1292
  data: SplTokenApproveInstructionData
1270
1293
  meta: JsonParsedInstructionMeta
1271
- programId: String
1294
+ programId: Address
1272
1295
  }
1273
1296
 
1274
1297
  # SplToken: Revoke
@@ -1280,7 +1303,7 @@ var instructionTypeDefs = (
1280
1303
  type SplTokenRevokeInstruction implements TransactionInstruction {
1281
1304
  data: SplTokenRevokeInstructionData
1282
1305
  meta: JsonParsedInstructionMeta
1283
- programId: String
1306
+ programId: Address
1284
1307
  }
1285
1308
 
1286
1309
  # SplToken: SetAuthority
@@ -1293,7 +1316,7 @@ var instructionTypeDefs = (
1293
1316
  type SplTokenSetAuthorityInstruction implements TransactionInstruction {
1294
1317
  data: SplTokenSetAuthorityInstructionData
1295
1318
  meta: JsonParsedInstructionMeta
1296
- programId: String
1319
+ programId: Address
1297
1320
  }
1298
1321
 
1299
1322
  # SplToken: MintTo
@@ -1308,7 +1331,7 @@ var instructionTypeDefs = (
1308
1331
  type SplTokenMintToInstruction implements TransactionInstruction {
1309
1332
  data: SplTokenMintToInstructionData
1310
1333
  meta: JsonParsedInstructionMeta
1311
- programId: String
1334
+ programId: Address
1312
1335
  }
1313
1336
 
1314
1337
  # SplToken: Burn
@@ -1322,7 +1345,7 @@ var instructionTypeDefs = (
1322
1345
  type SplTokenBurnInstruction implements TransactionInstruction {
1323
1346
  data: SplTokenBurnInstructionData
1324
1347
  meta: JsonParsedInstructionMeta
1325
- programId: String
1348
+ programId: Address
1326
1349
  }
1327
1350
 
1328
1351
  # SplToken: CloseAccount
@@ -1335,7 +1358,7 @@ var instructionTypeDefs = (
1335
1358
  type SplTokenCloseAccountInstruction implements TransactionInstruction {
1336
1359
  data: SplTokenCloseAccountInstructionData
1337
1360
  meta: JsonParsedInstructionMeta
1338
- programId: String
1361
+ programId: Address
1339
1362
  }
1340
1363
 
1341
1364
  # SplToken: FreezeAccount
@@ -1348,7 +1371,7 @@ var instructionTypeDefs = (
1348
1371
  type SplTokenFreezeAccountInstruction implements TransactionInstruction {
1349
1372
  data: SplTokenFreezeAccountInstructionData
1350
1373
  meta: JsonParsedInstructionMeta
1351
- programId: String
1374
+ programId: Address
1352
1375
  }
1353
1376
 
1354
1377
  # SplToken: ThawAccount
@@ -1361,7 +1384,7 @@ var instructionTypeDefs = (
1361
1384
  type SplTokenThawAccountInstruction implements TransactionInstruction {
1362
1385
  data: SplTokenThawAccountInstructionData
1363
1386
  meta: JsonParsedInstructionMeta
1364
- programId: String
1387
+ programId: Address
1365
1388
  }
1366
1389
 
1367
1390
  # SplToken: TransferChecked
@@ -1378,7 +1401,7 @@ var instructionTypeDefs = (
1378
1401
  type SplTokenTransferCheckedInstruction implements TransactionInstruction {
1379
1402
  data: SplTokenTransferCheckedInstructionData
1380
1403
  meta: JsonParsedInstructionMeta
1381
- programId: String
1404
+ programId: Address
1382
1405
  }
1383
1406
 
1384
1407
  # SplToken: ApproveChecked
@@ -1393,7 +1416,7 @@ var instructionTypeDefs = (
1393
1416
  type SplTokenApproveCheckedInstruction implements TransactionInstruction {
1394
1417
  data: SplTokenApproveCheckedInstructionData
1395
1418
  meta: JsonParsedInstructionMeta
1396
- programId: String
1419
+ programId: Address
1397
1420
  }
1398
1421
 
1399
1422
  # SplToken: MintToChecked
@@ -1408,7 +1431,7 @@ var instructionTypeDefs = (
1408
1431
  type SplTokenMintToCheckedInstruction implements TransactionInstruction {
1409
1432
  data: SplTokenMintToCheckedInstructionData
1410
1433
  meta: JsonParsedInstructionMeta
1411
- programId: String
1434
+ programId: Address
1412
1435
  }
1413
1436
 
1414
1437
  # SplToken: BurnChecked
@@ -1422,7 +1445,7 @@ var instructionTypeDefs = (
1422
1445
  type SplTokenBurnCheckedInstruction implements TransactionInstruction {
1423
1446
  data: SplTokenBurnCheckedInstructionData
1424
1447
  meta: JsonParsedInstructionMeta
1425
- programId: String
1448
+ programId: Address
1426
1449
  }
1427
1450
 
1428
1451
  # SplToken: SyncNative
@@ -1432,7 +1455,7 @@ var instructionTypeDefs = (
1432
1455
  type SplTokenSyncNativeInstruction implements TransactionInstruction {
1433
1456
  data: SplTokenSyncNativeInstructionData
1434
1457
  meta: JsonParsedInstructionMeta
1435
- programId: String
1458
+ programId: Address
1436
1459
  }
1437
1460
 
1438
1461
  # SplToken: GetAccountDataSize
@@ -1443,7 +1466,7 @@ var instructionTypeDefs = (
1443
1466
  type SplTokenGetAccountDataSizeInstruction implements TransactionInstruction {
1444
1467
  data: SplTokenGetAccountDataSizeInstructionData
1445
1468
  meta: JsonParsedInstructionMeta
1446
- programId: String
1469
+ programId: Address
1447
1470
  }
1448
1471
 
1449
1472
  # SplToken: InitializeImmutableOwner
@@ -1453,7 +1476,7 @@ var instructionTypeDefs = (
1453
1476
  type SplTokenInitializeImmutableOwnerInstruction implements TransactionInstruction {
1454
1477
  data: SplTokenInitializeImmutableOwnerInstructionData
1455
1478
  meta: JsonParsedInstructionMeta
1456
- programId: String
1479
+ programId: Address
1457
1480
  }
1458
1481
 
1459
1482
  # SplToken: AmountToUiAmount
@@ -1464,7 +1487,7 @@ var instructionTypeDefs = (
1464
1487
  type SplTokenAmountToUiAmountInstruction implements TransactionInstruction {
1465
1488
  data: SplTokenAmountToUiAmountInstructionData
1466
1489
  meta: JsonParsedInstructionMeta
1467
- programId: String
1490
+ programId: Address
1468
1491
  }
1469
1492
 
1470
1493
  # SplToken: UiAmountToAmount
@@ -1475,7 +1498,7 @@ var instructionTypeDefs = (
1475
1498
  type SplTokenUiAmountToAmountInstruction implements TransactionInstruction {
1476
1499
  data: SplTokenUiAmountToAmountInstructionData
1477
1500
  meta: JsonParsedInstructionMeta
1478
- programId: String
1501
+ programId: Address
1479
1502
  }
1480
1503
 
1481
1504
  # SplToken: InitializeMintCloseAuthority
@@ -1486,7 +1509,7 @@ var instructionTypeDefs = (
1486
1509
  type SplTokenInitializeMintCloseAuthorityInstruction implements TransactionInstruction {
1487
1510
  data: SplTokenInitializeMintCloseAuthorityInstructionData
1488
1511
  meta: JsonParsedInstructionMeta
1489
- programId: String
1512
+ programId: Address
1490
1513
  }
1491
1514
 
1492
1515
  # TODO: Extensions!
@@ -1519,20 +1542,20 @@ var instructionTypeDefs = (
1519
1542
  type StakeInitializeInstructionData {
1520
1543
  authorized: StakeInitializeInstructionDataAuthorized
1521
1544
  lockup: Lockup
1522
- rentSysvar: String
1545
+ rentSysvar: Address
1523
1546
  stakeAccount: Account
1524
1547
  }
1525
1548
  type StakeInitializeInstruction implements TransactionInstruction {
1526
1549
  data: StakeInitializeInstructionData
1527
1550
  meta: JsonParsedInstructionMeta
1528
- programId: String
1551
+ programId: Address
1529
1552
  }
1530
1553
 
1531
1554
  # Stake: Authorize
1532
1555
  type StakeAuthorizeInstructionData {
1533
1556
  authority: Account
1534
1557
  authorityType: String
1535
- clockSysvar: String
1558
+ clockSysvar: Address
1536
1559
  custodian: Account
1537
1560
  newAuthority: Account
1538
1561
  stakeAccount: Account
@@ -1540,22 +1563,22 @@ var instructionTypeDefs = (
1540
1563
  type StakeAuthorizeInstruction implements TransactionInstruction {
1541
1564
  data: StakeAuthorizeInstructionData
1542
1565
  meta: JsonParsedInstructionMeta
1543
- programId: String
1566
+ programId: Address
1544
1567
  }
1545
1568
 
1546
1569
  # Stake: DelegateStake
1547
1570
  type StakeDelegateStakeInstructionData {
1548
- clockSysvar: String
1571
+ clockSysvar: Address
1549
1572
  stakeAccount: Account
1550
1573
  stakeAuthority: Account
1551
1574
  stakeConfigAccount: Account
1552
- stakeHistorySysvar: String
1575
+ stakeHistorySysvar: Address
1553
1576
  voteAccount: Account
1554
1577
  }
1555
1578
  type StakeDelegateStakeInstruction implements TransactionInstruction {
1556
1579
  data: StakeDelegateStakeInstructionData
1557
1580
  meta: JsonParsedInstructionMeta
1558
- programId: String
1581
+ programId: Address
1559
1582
  }
1560
1583
 
1561
1584
  # Stake: Split
@@ -1568,12 +1591,12 @@ var instructionTypeDefs = (
1568
1591
  type StakeSplitInstruction implements TransactionInstruction {
1569
1592
  data: StakeSplitInstructionData
1570
1593
  meta: JsonParsedInstructionMeta
1571
- programId: String
1594
+ programId: Address
1572
1595
  }
1573
1596
 
1574
1597
  # Stake: Withdraw
1575
1598
  type StakeWithdrawInstructionData {
1576
- clockSysvar: String
1599
+ clockSysvar: Address
1577
1600
  destination: Account
1578
1601
  lamports: BigInt
1579
1602
  stakeAccount: Account
@@ -1582,19 +1605,19 @@ var instructionTypeDefs = (
1582
1605
  type StakeWithdrawInstruction implements TransactionInstruction {
1583
1606
  data: StakeWithdrawInstructionData
1584
1607
  meta: JsonParsedInstructionMeta
1585
- programId: String
1608
+ programId: Address
1586
1609
  }
1587
1610
 
1588
1611
  # Stake: Deactivate
1589
1612
  type StakeDeactivateInstructionData {
1590
- clockSysvar: String
1613
+ clockSysvar: Address
1591
1614
  stakeAccount: Account
1592
1615
  stakeAuthority: Account
1593
1616
  }
1594
1617
  type StakeDeactivateInstruction implements TransactionInstruction {
1595
1618
  data: StakeDeactivateInstructionData
1596
1619
  meta: JsonParsedInstructionMeta
1597
- programId: String
1620
+ programId: Address
1598
1621
  }
1599
1622
 
1600
1623
  # Stake: SetLockup
@@ -1606,21 +1629,21 @@ var instructionTypeDefs = (
1606
1629
  type StakeSetLockupInstruction implements TransactionInstruction {
1607
1630
  data: StakeSetLockupInstructionData
1608
1631
  meta: JsonParsedInstructionMeta
1609
- programId: String
1632
+ programId: Address
1610
1633
  }
1611
1634
 
1612
1635
  # Stake: Merge
1613
1636
  type StakeMergeInstructionData {
1614
- clockSysvar: String
1637
+ clockSysvar: Address
1615
1638
  destination: Account
1616
1639
  source: Account
1617
1640
  stakeAuthority: Account
1618
- stakeHistorySysvar: String
1641
+ stakeHistorySysvar: Address
1619
1642
  }
1620
1643
  type StakeMergeInstruction implements TransactionInstruction {
1621
1644
  data: StakeMergeInstructionData
1622
1645
  meta: JsonParsedInstructionMeta
1623
- programId: String
1646
+ programId: Address
1624
1647
  }
1625
1648
 
1626
1649
  # Stake: AuthorizeWithSeed
@@ -1629,7 +1652,7 @@ var instructionTypeDefs = (
1629
1652
  authorityOwner: Account
1630
1653
  authoritySeed: String
1631
1654
  authorityType: String
1632
- clockSysvar: String
1655
+ clockSysvar: Address
1633
1656
  custodian: Account
1634
1657
  newAuthorized: Account
1635
1658
  stakeAccount: Account
@@ -1637,12 +1660,12 @@ var instructionTypeDefs = (
1637
1660
  type StakeAuthorizeWithSeedInstruction implements TransactionInstruction {
1638
1661
  data: StakeAuthorizeWithSeedInstructionData
1639
1662
  meta: JsonParsedInstructionMeta
1640
- programId: String
1663
+ programId: Address
1641
1664
  }
1642
1665
 
1643
1666
  # Stake: InitializeChecked
1644
1667
  type StakeInitializeCheckedInstructionDataAuthorized {
1645
- rentSysvar: String
1668
+ rentSysvar: Address
1646
1669
  stakeAccount: Account
1647
1670
  staker: Account
1648
1671
  withdrawer: Account
@@ -1650,14 +1673,14 @@ var instructionTypeDefs = (
1650
1673
  type StakeInitializeCheckedInstruction implements TransactionInstruction {
1651
1674
  data: StakeInitializeCheckedInstructionDataAuthorized
1652
1675
  meta: JsonParsedInstructionMeta
1653
- programId: String
1676
+ programId: Address
1654
1677
  }
1655
1678
 
1656
1679
  # Stake: AuthorizeChecked
1657
1680
  type StakeAuthorizeCheckedInstructionData {
1658
1681
  authority: Account
1659
1682
  authorityType: String
1660
- clockSysvar: String
1683
+ clockSysvar: Address
1661
1684
  custodian: Account
1662
1685
  newAuthority: Account
1663
1686
  stakeAccount: Account
@@ -1665,7 +1688,7 @@ var instructionTypeDefs = (
1665
1688
  type StakeAuthorizeCheckedInstruction implements TransactionInstruction {
1666
1689
  data: StakeAuthorizeCheckedInstructionData
1667
1690
  meta: JsonParsedInstructionMeta
1668
- programId: String
1691
+ programId: Address
1669
1692
  }
1670
1693
 
1671
1694
  # Stake: AuthorizeCheckedWithSeed
@@ -1674,7 +1697,7 @@ var instructionTypeDefs = (
1674
1697
  authorityOwner: Account
1675
1698
  authoritySeed: String
1676
1699
  authorityType: String
1677
- clockSysvar: String
1700
+ clockSysvar: Address
1678
1701
  custodian: Account
1679
1702
  newAuthorized: Account
1680
1703
  stakeAccount: Account
@@ -1682,7 +1705,7 @@ var instructionTypeDefs = (
1682
1705
  type StakeAuthorizeCheckedWithSeedInstruction implements TransactionInstruction {
1683
1706
  data: StakeAuthorizeCheckedWithSeedInstructionData
1684
1707
  meta: JsonParsedInstructionMeta
1685
- programId: String
1708
+ programId: Address
1686
1709
  }
1687
1710
 
1688
1711
  # Stake: SetLockupChecked
@@ -1694,7 +1717,7 @@ var instructionTypeDefs = (
1694
1717
  type StakeSetLockupCheckedInstruction implements TransactionInstruction {
1695
1718
  data: StakeSetLockupCheckedInstructionData
1696
1719
  meta: JsonParsedInstructionMeta
1697
- programId: String
1720
+ programId: Address
1698
1721
  }
1699
1722
 
1700
1723
  # Stake: DeactivateDelinquent
@@ -1706,7 +1729,7 @@ var instructionTypeDefs = (
1706
1729
  type StakeDeactivateDelinquentInstruction implements TransactionInstruction {
1707
1730
  data: StakeDeactivateDelinquentInstructionData
1708
1731
  meta: JsonParsedInstructionMeta
1709
- programId: String
1732
+ programId: Address
1710
1733
  }
1711
1734
 
1712
1735
  # Stake: Redelegate
@@ -1720,7 +1743,7 @@ var instructionTypeDefs = (
1720
1743
  type StakeRedelegateInstruction implements TransactionInstruction {
1721
1744
  data: StakeRedelegateInstructionData
1722
1745
  meta: JsonParsedInstructionMeta
1723
- programId: String
1746
+ programId: Address
1724
1747
  }
1725
1748
 
1726
1749
  # System: CreateAccount
@@ -1734,7 +1757,7 @@ var instructionTypeDefs = (
1734
1757
  type CreateAccountInstruction implements TransactionInstruction {
1735
1758
  data: CreateAccountInstructionData
1736
1759
  meta: JsonParsedInstructionMeta
1737
- programId: String
1760
+ programId: Address
1738
1761
  }
1739
1762
 
1740
1763
  # System: Assign
@@ -1745,7 +1768,7 @@ var instructionTypeDefs = (
1745
1768
  type AssignInstruction implements TransactionInstruction {
1746
1769
  data: AssignInstructionData
1747
1770
  meta: JsonParsedInstructionMeta
1748
- programId: String
1771
+ programId: Address
1749
1772
  }
1750
1773
 
1751
1774
  # System: Transfer
@@ -1757,7 +1780,7 @@ var instructionTypeDefs = (
1757
1780
  type TransferInstruction implements TransactionInstruction {
1758
1781
  data: TransferInstructionData
1759
1782
  meta: JsonParsedInstructionMeta
1760
- programId: String
1783
+ programId: Address
1761
1784
  }
1762
1785
 
1763
1786
  # System: CreateAccountWithSeed
@@ -1771,19 +1794,19 @@ var instructionTypeDefs = (
1771
1794
  type CreateAccountWithSeedInstruction implements TransactionInstruction {
1772
1795
  data: CreateAccountWithSeedInstructionData
1773
1796
  meta: JsonParsedInstructionMeta
1774
- programId: String
1797
+ programId: Address
1775
1798
  }
1776
1799
 
1777
1800
  # System: AdvanceNonceAccount
1778
1801
  type AdvanceNonceAccountInstructionData {
1779
1802
  nonceAccount: Account
1780
1803
  nonceAuthority: Account
1781
- recentBlockhashesSysvar: String
1804
+ recentBlockhashesSysvar: Address
1782
1805
  }
1783
1806
  type AdvanceNonceAccountInstruction implements TransactionInstruction {
1784
1807
  data: AdvanceNonceAccountInstructionData
1785
1808
  meta: JsonParsedInstructionMeta
1786
- programId: String
1809
+ programId: Address
1787
1810
  }
1788
1811
 
1789
1812
  # System: WithdrawNonceAccount
@@ -1792,26 +1815,26 @@ var instructionTypeDefs = (
1792
1815
  lamports: BigInt
1793
1816
  nonceAccount: Account
1794
1817
  nonceAuthority: Account
1795
- recentBlockhashesSysvar: String
1796
- rentSysvar: String
1818
+ recentBlockhashesSysvar: Address
1819
+ rentSysvar: Address
1797
1820
  }
1798
1821
  type WithdrawNonceAccountInstruction implements TransactionInstruction {
1799
1822
  data: WithdrawNonceAccountInstructionData
1800
1823
  meta: JsonParsedInstructionMeta
1801
- programId: String
1824
+ programId: Address
1802
1825
  }
1803
1826
 
1804
1827
  # System: InitializeNonceAccount
1805
1828
  type InitializeNonceAccountInstructionData {
1806
1829
  nonceAccount: Account
1807
1830
  nonceAuthority: Account
1808
- recentBlockhashesSysvar: String
1809
- rentSysvar: String
1831
+ recentBlockhashesSysvar: Address
1832
+ rentSysvar: Address
1810
1833
  }
1811
1834
  type InitializeNonceAccountInstruction implements TransactionInstruction {
1812
1835
  data: InitializeNonceAccountInstructionData
1813
1836
  meta: JsonParsedInstructionMeta
1814
- programId: String
1837
+ programId: Address
1815
1838
  }
1816
1839
 
1817
1840
  # System: AuthorizeNonceAccount
@@ -1823,7 +1846,7 @@ var instructionTypeDefs = (
1823
1846
  type AuthorizeNonceAccountInstruction implements TransactionInstruction {
1824
1847
  data: AuthorizeNonceAccountInstructionData
1825
1848
  meta: JsonParsedInstructionMeta
1826
- programId: String
1849
+ programId: Address
1827
1850
  }
1828
1851
 
1829
1852
  # System: UpgradeNonceAccount
@@ -1834,7 +1857,7 @@ var instructionTypeDefs = (
1834
1857
  type UpgradeNonceAccountInstruction implements TransactionInstruction {
1835
1858
  data: UpgradeNonceAccountInstructionData
1836
1859
  meta: JsonParsedInstructionMeta
1837
- programId: String
1860
+ programId: Address
1838
1861
  }
1839
1862
 
1840
1863
  # System: Allocate
@@ -1845,13 +1868,13 @@ var instructionTypeDefs = (
1845
1868
  type AllocateInstruction implements TransactionInstruction {
1846
1869
  data: AllocateInstructionData
1847
1870
  meta: JsonParsedInstructionMeta
1848
- programId: String
1871
+ programId: Address
1849
1872
  }
1850
1873
 
1851
1874
  # System: AllocateWithSeed
1852
1875
  type AllocateWithSeedInstructionData {
1853
1876
  account: Account
1854
- base: String
1877
+ base: Address
1855
1878
  owner: Account
1856
1879
  seed: String
1857
1880
  space: BigInt
@@ -1859,20 +1882,20 @@ var instructionTypeDefs = (
1859
1882
  type AllocateWithSeedInstruction implements TransactionInstruction {
1860
1883
  data: AllocateWithSeedInstructionData
1861
1884
  meta: JsonParsedInstructionMeta
1862
- programId: String
1885
+ programId: Address
1863
1886
  }
1864
1887
 
1865
1888
  # System: AssignWithSeed
1866
1889
  type AssignWithSeedInstructionData {
1867
1890
  account: Account
1868
- base: String
1891
+ base: Address
1869
1892
  owner: Account
1870
1893
  seed: String
1871
1894
  }
1872
1895
  type AssignWithSeedInstruction implements TransactionInstruction {
1873
1896
  data: AssignWithSeedInstructionData
1874
1897
  meta: JsonParsedInstructionMeta
1875
- programId: String
1898
+ programId: Address
1876
1899
  }
1877
1900
 
1878
1901
  # System: TransferWithSeed
@@ -1880,76 +1903,76 @@ var instructionTypeDefs = (
1880
1903
  destination: Account
1881
1904
  lamports: BigInt
1882
1905
  source: Account
1883
- sourceBase: String
1906
+ sourceBase: Address
1884
1907
  sourceOwner: Account
1885
1908
  sourceSeed: String
1886
1909
  }
1887
1910
  type TransferWithSeedInstruction implements TransactionInstruction {
1888
1911
  data: TransferWithSeedInstructionData
1889
1912
  meta: JsonParsedInstructionMeta
1890
- programId: String
1913
+ programId: Address
1891
1914
  }
1892
1915
 
1893
1916
  # Vote: InitializeAccount
1894
1917
  type VoteInitializeAccountInstructionData {
1895
1918
  authorizedVoter: Account
1896
1919
  authorizedWithdrawer: Account
1897
- clockSysvar: String
1920
+ clockSysvar: Address
1898
1921
  commission: BigInt # FIXME:*
1899
1922
  node: Account
1900
- rentSysvar: String
1923
+ rentSysvar: Address
1901
1924
  voteAccount: Account
1902
1925
  }
1903
1926
  type VoteInitializeAccountInstruction implements TransactionInstruction {
1904
1927
  data: VoteInitializeAccountInstructionData
1905
1928
  meta: JsonParsedInstructionMeta
1906
- programId: String
1929
+ programId: Address
1907
1930
  }
1908
1931
 
1909
1932
  # Vote: Authorize
1910
1933
  type VoteAuthorizeInstructionData {
1911
1934
  authority: Account
1912
1935
  authorityType: String
1913
- clockSysvar: String
1936
+ clockSysvar: Address
1914
1937
  newAuthority: Account
1915
1938
  voteAccount: Account
1916
1939
  }
1917
1940
  type VoteAuthorizeInstruction implements TransactionInstruction {
1918
1941
  data: VoteAuthorizeInstructionData
1919
1942
  meta: JsonParsedInstructionMeta
1920
- programId: String
1943
+ programId: Address
1921
1944
  }
1922
1945
 
1923
1946
  # Vote: AuthorizeWithSeed
1924
1947
  type VoteAuthorizeWithSeedInstructionData {
1925
- authorityBaseKey: String
1948
+ authorityBaseKey: Address
1926
1949
  authorityOwner: Account
1927
1950
  authoritySeed: String
1928
1951
  authorityType: String
1929
- clockSysvar: String
1952
+ clockSysvar: Address
1930
1953
  newAuthority: Account
1931
1954
  voteAccount: Account
1932
1955
  }
1933
1956
  type VoteAuthorizeWithSeedInstruction implements TransactionInstruction {
1934
1957
  data: VoteAuthorizeWithSeedInstructionData
1935
1958
  meta: JsonParsedInstructionMeta
1936
- programId: String
1959
+ programId: Address
1937
1960
  }
1938
1961
 
1939
1962
  # Vote: AuthorizeCheckedWithSeed
1940
1963
  type VoteAuthorizeCheckedWithSeedInstructionData {
1941
- authorityBaseKey: String
1964
+ authorityBaseKey: Address
1942
1965
  authorityOwner: Account
1943
1966
  authoritySeed: String
1944
1967
  authorityType: String
1945
- clockSysvar: String
1968
+ clockSysvar: Address
1946
1969
  newAuthority: Account
1947
1970
  voteAccount: Account
1948
1971
  }
1949
1972
  type VoteAuthorizeCheckedWithSeedInstruction implements TransactionInstruction {
1950
1973
  data: VoteAuthorizeCheckedWithSeedInstructionData
1951
1974
  meta: JsonParsedInstructionMeta
1952
- programId: String
1975
+ programId: Address
1953
1976
  }
1954
1977
 
1955
1978
  type Vote {
@@ -1960,8 +1983,8 @@ var instructionTypeDefs = (
1960
1983
 
1961
1984
  # Vote: Vote
1962
1985
  type VoteVoteInstructionData {
1963
- clockSysvar: String
1964
- slotHashesSysvar: String
1986
+ clockSysvar: Address
1987
+ slotHashesSysvar: Address
1965
1988
  vote: Vote
1966
1989
  voteAccount: Account
1967
1990
  voteAuthority: Account
@@ -1969,7 +1992,7 @@ var instructionTypeDefs = (
1969
1992
  type VoteVoteInstruction implements TransactionInstruction {
1970
1993
  data: VoteVoteInstructionData
1971
1994
  meta: JsonParsedInstructionMeta
1972
- programId: String
1995
+ programId: Address
1973
1996
  }
1974
1997
 
1975
1998
  type VoteStateUpdateLockout {
@@ -1993,7 +2016,7 @@ var instructionTypeDefs = (
1993
2016
  type VoteUpdateVoteStateInstruction implements TransactionInstruction {
1994
2017
  data: VoteUpdateVoteStateInstructionData
1995
2018
  meta: JsonParsedInstructionMeta
1996
- programId: String
2019
+ programId: Address
1997
2020
  }
1998
2021
 
1999
2022
  # Vote: UpdateVoteStateSwitch
@@ -2006,7 +2029,7 @@ var instructionTypeDefs = (
2006
2029
  type VoteUpdateVoteStateSwitchInstruction implements TransactionInstruction {
2007
2030
  data: VoteUpdateVoteStateSwitchInstructionData
2008
2031
  meta: JsonParsedInstructionMeta
2009
- programId: String
2032
+ programId: Address
2010
2033
  }
2011
2034
 
2012
2035
  # Vote: CompactUpdateVoteState
@@ -2019,7 +2042,7 @@ var instructionTypeDefs = (
2019
2042
  type VoteCompactUpdateVoteStateInstruction implements TransactionInstruction {
2020
2043
  data: VoteCompactUpdateVoteStateInstructionData
2021
2044
  meta: JsonParsedInstructionMeta
2022
- programId: String
2045
+ programId: Address
2023
2046
  }
2024
2047
 
2025
2048
  # Vote: CompactUpdateVoteStateSwitch
@@ -2032,7 +2055,7 @@ var instructionTypeDefs = (
2032
2055
  type VoteCompactUpdateVoteStateSwitchInstruction implements TransactionInstruction {
2033
2056
  data: VoteCompactUpdateVoteStateSwitchInstructionData
2034
2057
  meta: JsonParsedInstructionMeta
2035
- programId: String
2058
+ programId: Address
2036
2059
  }
2037
2060
 
2038
2061
  # Vote: Withdraw
@@ -2045,7 +2068,7 @@ var instructionTypeDefs = (
2045
2068
  type VoteWithdrawInstruction implements TransactionInstruction {
2046
2069
  data: VoteWithdrawInstructionData
2047
2070
  meta: JsonParsedInstructionMeta
2048
- programId: String
2071
+ programId: Address
2049
2072
  }
2050
2073
 
2051
2074
  # Vote: UpdateValidatorIdentity
@@ -2057,7 +2080,7 @@ var instructionTypeDefs = (
2057
2080
  type VoteUpdateValidatorIdentityInstruction implements TransactionInstruction {
2058
2081
  data: VoteUpdateValidatorIdentityInstructionData
2059
2082
  meta: JsonParsedInstructionMeta
2060
- programId: String
2083
+ programId: Address
2061
2084
  }
2062
2085
 
2063
2086
  # Vote: UpdateCommission
@@ -2069,14 +2092,14 @@ var instructionTypeDefs = (
2069
2092
  type VoteUpdateCommissionInstruction implements TransactionInstruction {
2070
2093
  data: VoteUpdateCommissionInstructionData
2071
2094
  meta: JsonParsedInstructionMeta
2072
- programId: String
2095
+ programId: Address
2073
2096
  }
2074
2097
 
2075
2098
  # Vote: VoteSwitch
2076
2099
  type VoteVoteSwitchInstructionData {
2077
- clockSysvar: String
2100
+ clockSysvar: Address
2078
2101
  hash: String
2079
- slotHashesSysvar: String
2102
+ slotHashesSysvar: Address
2080
2103
  vote: Vote
2081
2104
  voteAccount: Account
2082
2105
  voteAuthority: Account
@@ -2084,21 +2107,21 @@ var instructionTypeDefs = (
2084
2107
  type VoteVoteSwitchInstruction implements TransactionInstruction {
2085
2108
  data: VoteVoteSwitchInstructionData
2086
2109
  meta: JsonParsedInstructionMeta
2087
- programId: String
2110
+ programId: Address
2088
2111
  }
2089
2112
 
2090
2113
  # Vote: AuthorizeChecked
2091
2114
  type VoteAuthorizeCheckedInstructionData {
2092
2115
  authority: Account
2093
2116
  authorityType: String
2094
- clockSysvar: String
2117
+ clockSysvar: Address
2095
2118
  newAuthority: Account
2096
2119
  voteAccount: Account
2097
2120
  }
2098
2121
  type VoteAuthorizeCheckedInstruction implements TransactionInstruction {
2099
2122
  data: VoteAuthorizeCheckedInstructionData
2100
2123
  meta: JsonParsedInstructionMeta
2101
- programId: String
2124
+ programId: Address
2102
2125
  }
2103
2126
  `
2104
2127
  );
@@ -2858,14 +2881,14 @@ var transactionTypeDefs = (
2858
2881
  }
2859
2882
 
2860
2883
  type TransactionMessageAccountKey {
2861
- pubkey: String
2884
+ pubkey: Address
2862
2885
  signer: Boolean
2863
2886
  source: String
2864
2887
  writable: Boolean
2865
2888
  }
2866
2889
 
2867
2890
  type TransactionMessageAddressTableLookup {
2868
- accountKey: String
2891
+ accountKey: Address
2869
2892
  readableIndexes: [Int]
2870
2893
  writableIndexes: [Int]
2871
2894
  }
@@ -2887,7 +2910,7 @@ var transactionTypeDefs = (
2887
2910
  # Transaction interface
2888
2911
  interface Transaction {
2889
2912
  blockTime: String
2890
- encoding: String
2913
+ encoding: TransactionEncoding
2891
2914
  meta: TransactionMeta
2892
2915
  slot: BigInt
2893
2916
  version: String
@@ -2896,8 +2919,8 @@ var transactionTypeDefs = (
2896
2919
  # A transaction with base58 encoded data
2897
2920
  type TransactionBase58 implements Transaction {
2898
2921
  blockTime: String
2899
- data: String
2900
- encoding: String
2922
+ data: Base58EncodedBytes
2923
+ encoding: TransactionEncoding
2901
2924
  meta: TransactionMeta
2902
2925
  slot: BigInt
2903
2926
  version: String
@@ -2906,8 +2929,8 @@ var transactionTypeDefs = (
2906
2929
  # A transaction with base64 encoded data
2907
2930
  type TransactionBase64 implements Transaction {
2908
2931
  blockTime: String
2909
- data: String
2910
- encoding: String
2932
+ data: Base64EncodedBytes
2933
+ encoding: TransactionEncoding
2911
2934
  meta: TransactionMeta
2912
2935
  slot: BigInt
2913
2936
  version: String
@@ -2921,7 +2944,7 @@ var transactionTypeDefs = (
2921
2944
  type TransactionParsed implements Transaction {
2922
2945
  blockTime: String
2923
2946
  data: TransactionDataParsed
2924
- encoding: String
2947
+ encoding: TransactionEncoding
2925
2948
  meta: TransactionMeta
2926
2949
  slot: BigInt
2927
2950
  version: String
@@ -2984,16 +3007,16 @@ var schemaTypeDefs = (
2984
3007
  var schemaResolvers = {
2985
3008
  Query: {
2986
3009
  account(_, args, context, info) {
2987
- return context.accountLoader.load(args, info);
3010
+ return context.loaders.account.load(args, info);
2988
3011
  },
2989
3012
  block(_, args, context, info) {
2990
- return context.loadBlock(args, info);
3013
+ return context.loaders.block.load(args, info);
2991
3014
  },
2992
3015
  programAccounts(_, args, context, info) {
2993
- return context.loadProgramAccounts(args, info);
3016
+ return context.loaders.programAccounts.load(args, info);
2994
3017
  },
2995
3018
  transaction(_, args, context, info) {
2996
- return context.loadTransaction(args, info);
3019
+ return context.loaders.transaction.load(args, info);
2997
3020
  }
2998
3021
  }
2999
3022
  };
@@ -3029,14 +3052,12 @@ function createRpcGraphQL(rpc) {
3029
3052
  return {
3030
3053
  context,
3031
3054
  async query(source, variableValues) {
3032
- const result = await graphql.graphql({
3055
+ return graphql.graphql({
3033
3056
  contextValue: this.context,
3034
3057
  schema: this.schema,
3035
3058
  source,
3036
3059
  variableValues
3037
3060
  });
3038
- this.context.cache.flush();
3039
- return result;
3040
3061
  },
3041
3062
  schema
3042
3063
  };