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

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.
@@ -5,41 +5,6 @@ import { makeExecutableSchema } from '@graphql-tools/schema';
5
5
 
6
6
  // src/rpc.ts
7
7
 
8
- // src/cache.ts
9
- var stringifyValue = (value) => JSON.stringify(value, (_, value2) => {
10
- if (typeof value2 === "bigint") {
11
- return value2.toString() + "n";
12
- }
13
- return value2;
14
- });
15
- var parseValue = (value) => JSON.parse(value, (_, value2) => {
16
- if (typeof value2 === "string" && /\d+n$/.test(value2)) {
17
- return BigInt(value2.slice(0, -1));
18
- }
19
- return value2;
20
- });
21
- var cacheKey = (key, variables) => `GraphQLCache:${stringifyValue(key)}:${stringifyValue(variables)}`;
22
- function createGraphQLCache() {
23
- return {
24
- // Browser
25
- flush: () => {
26
- for (let i = localStorage.length - 1; i >= 0; i--) {
27
- const storageKey = localStorage.key(i);
28
- if (storageKey && storageKey.startsWith("GraphQLCache:")) {
29
- localStorage.removeItem(storageKey);
30
- }
31
- }
32
- },
33
- get: (key, variables) => {
34
- const value = localStorage.getItem(cacheKey(key, variables));
35
- return value === null ? null : parseValue(value);
36
- },
37
- insert: (key, variables, value) => {
38
- localStorage.setItem(cacheKey(key, variables), stringifyValue(value));
39
- }
40
- } ;
41
- }
42
-
43
8
  // src/loaders/common/resolve-info.ts
44
9
  function onlyPresentFieldRequested(fieldName, info) {
45
10
  if (info && info.fieldNodes[0].selectionSet) {
@@ -120,15 +85,14 @@ function createAccountLoader(rpc) {
120
85
  }
121
86
  };
122
87
  }
123
-
124
- // src/loaders/transaction.ts
125
88
  function normalizeArgs2(args) {
126
- const { commitment, encoding } = args;
89
+ const { commitment, encoding, signature } = args;
127
90
  return {
128
91
  commitment: commitment ?? "confirmed",
129
92
  encoding: encoding ?? "jsonParsed",
130
93
  // Always use 0 to avoid silly errors
131
- maxSupportedTransactionVersion: 0
94
+ maxSupportedTransactionVersion: 0,
95
+ signature
132
96
  };
133
97
  }
134
98
  function refineJsonParsedInstructionData(jsonParsedInstructionData) {
@@ -181,21 +145,16 @@ function refineJsonParsedTransaction({ encoding, transaction }) {
181
145
  function processQueryResponse2({ encoding, transaction }) {
182
146
  return refineJsonParsedTransaction({ encoding, transaction });
183
147
  }
184
- async function loadTransaction({ signature, ...config }, cache, rpc, _info) {
185
- const requestConfig = normalizeArgs2(config);
186
- const { encoding } = requestConfig;
187
- const cached = cache.get(signature, requestConfig);
188
- if (cached !== null) {
189
- return cached;
190
- }
191
- let transaction = await rpc.getTransaction(signature, requestConfig).send().catch((e) => {
148
+ async function loadTransaction(rpc, { signature, ...config }) {
149
+ const { encoding } = config;
150
+ let transaction = await rpc.getTransaction(signature, config).send().catch((e) => {
192
151
  throw e;
193
152
  });
194
153
  if (transaction === null) {
195
154
  return null;
196
155
  }
197
156
  if (encoding !== "jsonParsed") {
198
- const transactionJsonParsed = await rpc.getTransaction(signature, requestConfig).send().catch((e) => {
157
+ const transactionJsonParsed = await rpc.getTransaction(signature, config).send().catch((e) => {
199
158
  throw e;
200
159
  });
201
160
  if (transactionJsonParsed === null) {
@@ -208,18 +167,35 @@ async function loadTransaction({ signature, ...config }, cache, rpc, _info) {
208
167
  };
209
168
  }
210
169
  const queryResponse = processQueryResponse2({ encoding, transaction });
211
- cache.insert(signature, requestConfig, queryResponse);
212
170
  return queryResponse;
213
171
  }
172
+ function createTransactionBatchLoadFn(rpc) {
173
+ const resolveTransactionUsingRpc = loadTransaction.bind(null, rpc);
174
+ return async (transactionQueryArgs) => {
175
+ return await Promise.all(transactionQueryArgs.map(async (args) => await resolveTransactionUsingRpc(args)));
176
+ };
177
+ }
178
+ function createTransactionLoader(rpc) {
179
+ const loader = new DataLoader(createTransactionBatchLoadFn(rpc), { cacheKeyFn: fastStableStringify });
180
+ return {
181
+ load: async (args, info) => {
182
+ if (onlyPresentFieldRequested("signature", info)) {
183
+ return { signature: args.signature };
184
+ }
185
+ return loader.load(normalizeArgs2(args));
186
+ }
187
+ };
188
+ }
214
189
 
215
190
  // src/loaders/block.ts
216
191
  function normalizeArgs3(args) {
217
- const { commitment, encoding, transactionDetails } = args;
192
+ const { commitment, encoding, slot, transactionDetails } = args;
218
193
  return {
219
194
  commitment: commitment ?? "confirmed",
220
195
  encoding: encoding ?? "jsonParsed",
221
196
  // Always use 0 to avoid silly errors
222
197
  maxSupportedTransactionVersion: 0,
198
+ slot,
223
199
  transactionDetails: transactionDetails ?? "full"
224
200
  };
225
201
  }
@@ -254,33 +230,43 @@ function processQueryResponse3({
254
230
  transactionDetails
255
231
  };
256
232
  }
257
- async function loadBlock({ slot, ...config }, cache, rpc, _info) {
258
- const requestConfig = normalizeArgs3(config);
259
- const { encoding, transactionDetails } = requestConfig;
260
- const cached = cache.get(slot, config);
261
- if (cached !== null) {
262
- return cached;
263
- }
264
- const block = await rpc.getBlock(slot, requestConfig).send().catch((e) => {
233
+ async function loadBlock(rpc, { slot, ...config }) {
234
+ const { encoding, transactionDetails } = config;
235
+ const block = await rpc.getBlock(slot, config).send().catch((e) => {
265
236
  throw e;
266
237
  });
267
238
  if (block === null) {
268
239
  return { slot };
269
240
  }
270
241
  const queryResponse = processQueryResponse3({ block, encoding, transactionDetails });
271
- cache.insert(slot, requestConfig, queryResponse);
272
242
  return queryResponse;
273
243
  }
274
-
275
- // src/loaders/program-accounts.ts
244
+ function createBlockBatchLoadFn(rpc) {
245
+ const resolveBlockUsingRpc = loadBlock.bind(null, rpc);
246
+ return async (blockQueryArgs) => {
247
+ return await Promise.all(blockQueryArgs.map(async (args) => await resolveBlockUsingRpc(args)));
248
+ };
249
+ }
250
+ function createBlockLoader(rpc) {
251
+ const loader = new DataLoader(createBlockBatchLoadFn(rpc), { cacheKeyFn: fastStableStringify });
252
+ return {
253
+ load: async (args, info) => {
254
+ if (onlyPresentFieldRequested("slot", info)) {
255
+ return { slot: args.slot };
256
+ }
257
+ return loader.load(normalizeArgs3(args));
258
+ }
259
+ };
260
+ }
276
261
  function normalizeArgs4(args) {
277
- const { commitment, dataSlice, encoding, filters, minContextSlot } = args;
262
+ const { commitment, dataSlice, encoding, filters, minContextSlot, programAddress } = args;
278
263
  return {
279
264
  commitment: commitment ?? "confirmed",
280
265
  dataSlice,
281
266
  encoding: encoding ?? "jsonParsed",
282
267
  filters,
283
- minContextSlot
268
+ minContextSlot,
269
+ programAddress
284
270
  };
285
271
  }
286
272
  function processQueryResponse4({ encoding, programAccounts }) {
@@ -302,14 +288,9 @@ function processQueryResponse4({ encoding, programAccounts }) {
302
288
  };
303
289
  });
304
290
  }
305
- async function loadProgramAccounts({ programAddress, ...config }, cache, rpc, _info) {
306
- const requestConfig = normalizeArgs4(config);
307
- const { encoding } = requestConfig;
308
- const cached = cache.get(programAddress, requestConfig);
309
- if (cached !== null) {
310
- return cached;
311
- }
312
- const programAccounts = await rpc.getProgramAccounts(programAddress, requestConfig).send().then((res) => {
291
+ async function loadProgramAccounts(rpc, { programAddress, ...config }) {
292
+ const { encoding } = config;
293
+ const programAccounts = await rpc.getProgramAccounts(programAddress, config).send().then((res) => {
313
294
  if ("value" in res) {
314
295
  return res.value;
315
296
  }
@@ -318,24 +299,36 @@ async function loadProgramAccounts({ programAddress, ...config }, cache, rpc, _i
318
299
  throw e;
319
300
  });
320
301
  const queryResponse = processQueryResponse4({ encoding, programAccounts });
321
- cache.insert(programAddress, requestConfig, queryResponse);
322
302
  return queryResponse;
323
303
  }
304
+ function createProgramAccountsBatchLoadFn(rpc) {
305
+ const resolveProgramAccountsUsingRpc = loadProgramAccounts.bind(null, rpc);
306
+ return async (programAccountsQueryArgs) => {
307
+ return await Promise.all(
308
+ programAccountsQueryArgs.map(async (args) => await resolveProgramAccountsUsingRpc(args))
309
+ );
310
+ };
311
+ }
312
+ function createProgramAccountsLoader(rpc) {
313
+ const loader = new DataLoader(createProgramAccountsBatchLoadFn(rpc), { cacheKeyFn: fastStableStringify });
314
+ return {
315
+ load: async (args, info) => {
316
+ if (onlyPresentFieldRequested("programAddress", info)) {
317
+ return { programAddress: args.programAddress };
318
+ }
319
+ return loader.load(normalizeArgs4(args));
320
+ }
321
+ };
322
+ }
324
323
 
325
324
  // src/context.ts
326
325
  function createSolanaGraphQLContext(rpc) {
327
- const cache = createGraphQLCache();
328
326
  return {
329
- accountLoader: createAccountLoader(rpc),
330
- cache,
331
- loadBlock(args, info) {
332
- return loadBlock(args, this.cache, this.rpc);
333
- },
334
- loadProgramAccounts(args, info) {
335
- return loadProgramAccounts(args, this.cache, this.rpc);
336
- },
337
- loadTransaction(args, info) {
338
- return loadTransaction(args, this.cache, this.rpc);
327
+ loaders: {
328
+ account: createAccountLoader(rpc),
329
+ block: createBlockLoader(rpc),
330
+ programAccounts: createProgramAccountsLoader(rpc),
331
+ transaction: createTransactionLoader(rpc)
339
332
  },
340
333
  rpc
341
334
  };
@@ -343,7 +336,7 @@ function createSolanaGraphQLContext(rpc) {
343
336
 
344
337
  // src/resolvers/account.ts
345
338
  var resolveAccount = (fieldName) => {
346
- return (parent, args, context, info) => parent[fieldName] === null ? null : context.accountLoader.load({ ...args, address: parent[fieldName] }, info);
339
+ return (parent, args, context, info) => parent[fieldName] === null ? null : context.loaders.account.load({ ...args, address: parent[fieldName] }, info);
347
340
  };
348
341
 
349
342
  // src/schema/account.ts
@@ -352,8 +345,8 @@ var accountTypeDefs = (
352
345
  `
353
346
  # Account interface
354
347
  interface Account {
355
- address: String
356
- encoding: String
348
+ address: Address
349
+ encoding: AccountEncoding
357
350
  executable: Boolean
358
351
  lamports: BigInt
359
352
  owner: Account
@@ -362,9 +355,9 @@ var accountTypeDefs = (
362
355
 
363
356
  # An account with base58 encoded data
364
357
  type AccountBase58 implements Account {
365
- address: String
366
- data: String
367
- encoding: String
358
+ address: Address
359
+ data: Base58EncodedBytes
360
+ encoding: AccountEncoding
368
361
  executable: Boolean
369
362
  lamports: BigInt
370
363
  owner: Account
@@ -373,9 +366,9 @@ var accountTypeDefs = (
373
366
 
374
367
  # An account with base64 encoded data
375
368
  type AccountBase64 implements Account {
376
- address: String
377
- data: String
378
- encoding: String
369
+ address: Address
370
+ data: Base64EncodedBytes
371
+ encoding: AccountEncoding
379
372
  executable: Boolean
380
373
  lamports: BigInt
381
374
  owner: Account
@@ -384,9 +377,9 @@ var accountTypeDefs = (
384
377
 
385
378
  # An account with base64+zstd encoded data
386
379
  type AccountBase64Zstd implements Account {
387
- address: String
388
- data: String
389
- encoding: String
380
+ address: Address
381
+ data: Base64ZstdEncodedBytes
382
+ encoding: AccountEncoding
390
383
  executable: Boolean
391
384
  lamports: BigInt
392
385
  owner: Account
@@ -413,9 +406,9 @@ var accountTypeDefs = (
413
406
  feeCalculator: NonceAccountFeeCalculator
414
407
  }
415
408
  type NonceAccount implements Account & AccountJsonParsed {
416
- address: String
409
+ address: Address
417
410
  data: NonceAccountData
418
- encoding: String
411
+ encoding: AccountEncoding
419
412
  executable: Boolean
420
413
  lamports: BigInt
421
414
  meta: JsonParsedAccountMeta
@@ -432,9 +425,9 @@ var accountTypeDefs = (
432
425
  lastExtendedSlotStartIndex: Int
433
426
  }
434
427
  type LookupTableAccount implements Account & AccountJsonParsed {
435
- address: String
428
+ address: Address
436
429
  data: LookupTableAccountData
437
- encoding: String
430
+ encoding: AccountEncoding
438
431
  executable: Boolean
439
432
  lamports: BigInt
440
433
  meta: JsonParsedAccountMeta
@@ -451,9 +444,9 @@ var accountTypeDefs = (
451
444
  supply: String
452
445
  }
453
446
  type MintAccount implements Account & AccountJsonParsed {
454
- address: String
447
+ address: Address
455
448
  data: MintAccountData
456
- encoding: String
449
+ encoding: AccountEncoding
457
450
  executable: Boolean
458
451
  lamports: BigInt
459
452
  meta: JsonParsedAccountMeta
@@ -470,9 +463,9 @@ var accountTypeDefs = (
470
463
  tokenAmount: TokenAmount
471
464
  }
472
465
  type TokenAccount implements Account & AccountJsonParsed {
473
- address: String
466
+ address: Address
474
467
  data: TokenAccountData
475
- encoding: String
468
+ encoding: AccountEncoding
476
469
  executable: Boolean
477
470
  lamports: BigInt
478
471
  meta: JsonParsedAccountMeta
@@ -511,9 +504,9 @@ var accountTypeDefs = (
511
504
  stake: StakeAccountDataStake
512
505
  }
513
506
  type StakeAccount implements Account & AccountJsonParsed {
514
- address: String
507
+ address: Address
515
508
  data: StakeAccountData
516
- encoding: String
509
+ encoding: AccountEncoding
517
510
  executable: Boolean
518
511
  lamports: BigInt
519
512
  meta: JsonParsedAccountMeta
@@ -551,9 +544,9 @@ var accountTypeDefs = (
551
544
  votes: [VoteAccountDataVote]
552
545
  }
553
546
  type VoteAccount implements Account & AccountJsonParsed {
554
- address: String
547
+ address: Address
555
548
  data: VoteAccountData
556
- encoding: String
549
+ encoding: AccountEncoding
557
550
  executable: Boolean
558
551
  lamports: BigInt
559
552
  meta: JsonParsedAccountMeta
@@ -672,7 +665,7 @@ var blockTypeDefs = (
672
665
  }
673
666
 
674
667
  type TransactionDataForAccounts {
675
- accountKeys: [String]
668
+ accountKeys: [Address]
676
669
  signatures: [String]
677
670
  }
678
671
 
@@ -762,26 +755,6 @@ var blockResolvers = {
762
755
  var inputTypeDefs = (
763
756
  /* GraphQL */
764
757
  `
765
- enum AccountEncoding {
766
- base58
767
- base64
768
- base64Zstd
769
- jsonParsed
770
- }
771
-
772
- enum BlockTransactionDetails {
773
- accounts
774
- full
775
- none
776
- signatures
777
- }
778
-
779
- enum Commitment {
780
- confirmed
781
- finalized
782
- processed
783
- }
784
-
785
758
  input DataSlice {
786
759
  offset: Int
787
760
  length: Int
@@ -790,37 +763,41 @@ var inputTypeDefs = (
790
763
  input ProgramAccountsFilter {
791
764
  bytes: BigInt
792
765
  dataSize: BigInt
793
- encoding: String
766
+ encoding: AccountEncoding
794
767
  offset: BigInt
795
768
  }
796
-
797
- enum TransactionEncoding {
798
- base58
799
- base64
800
- jsonParsed
801
- }
802
-
803
- enum TransactionVersion {
804
- legacy
805
- zero
806
- }
807
769
  `
808
770
  );
809
- var inputResolvers = {
810
- AccountEncoding: {
811
- base64Zstd: "base64+zstd"
812
- },
813
- TransactionVersion: {
814
- zero: 0
815
- }
816
- };
771
+ var inputResolvers = {};
817
772
  var scalarTypeDefs = (
818
773
  /* GraphQL */
819
774
  `
775
+ scalar Address
776
+ scalar Base58EncodedBytes
777
+ scalar Base64EncodedBytes
778
+ scalar Base64ZstdEncodedBytes
820
779
  scalar BigInt
821
780
  `
822
781
  );
782
+ var stringScalarAlias = {
783
+ __parseLiteral(ast) {
784
+ if (ast.kind === Kind.STRING) {
785
+ return ast.value.toString();
786
+ }
787
+ return null;
788
+ },
789
+ __parseValue(value) {
790
+ return value;
791
+ },
792
+ __serialize(value) {
793
+ return value;
794
+ }
795
+ };
823
796
  var scalarResolvers = {
797
+ Address: stringScalarAlias,
798
+ Base58EncodedBytes: stringScalarAlias,
799
+ Base64EncodedBytes: stringScalarAlias,
800
+ Base64ZstdEncodedBytes: stringScalarAlias,
824
801
  BigInt: {
825
802
  __parseLiteral(ast) {
826
803
  if (ast.kind === Kind.STRING) {
@@ -841,16 +818,36 @@ var scalarResolvers = {
841
818
  var commonTypeDefs = (
842
819
  /* GraphQL */
843
820
  `
821
+ enum AccountEncoding {
822
+ BASE_58
823
+ BASE_64
824
+ BASE_64_ZSTD
825
+ PARSED
826
+ }
827
+
828
+ enum BlockTransactionDetails {
829
+ accounts
830
+ full
831
+ none
832
+ signatures
833
+ }
834
+
835
+ enum Commitment {
836
+ confirmed
837
+ finalized
838
+ processed
839
+ }
840
+
844
841
  type ReturnData {
845
- data: String
846
- programId: String
842
+ data: Base64EncodedBytes
843
+ programId: Address
847
844
  }
848
845
 
849
846
  type Reward {
850
847
  commission: Int
851
848
  lamports: BigInt
852
849
  postBalance: BigInt
853
- pubkey: String
850
+ pubkey: Address
854
851
  rewardType: String
855
852
  }
856
853
 
@@ -865,15 +862,41 @@ var commonTypeDefs = (
865
862
  accountIndex: Int
866
863
  mint: Account
867
864
  owner: Account
868
- programId: String
865
+ programId: Address
869
866
  uiTokenAmount: TokenAmount
870
867
  }
868
+
869
+ enum TransactionEncoding {
870
+ BASE_58
871
+ BASE_64
872
+ PARSED
873
+ }
874
+
875
+ enum TransactionVersion {
876
+ LEGACY
877
+ ZERO
878
+ }
871
879
  `
872
880
  );
873
881
  var commonResolvers = {
882
+ AccountEncoding: {
883
+ BASE_58: "base58",
884
+ BASE_64: "base64",
885
+ BASE_64_ZSTD: "base64+zstd",
886
+ PARSED: "jsonParsed"
887
+ },
874
888
  TokenBalance: {
875
889
  mint: resolveAccount("mint"),
876
890
  owner: resolveAccount("owner")
891
+ },
892
+ TransactionEncoding: {
893
+ BASE_58: "base58",
894
+ BASE_64: "base64",
895
+ PARSED: "jsonParsed"
896
+ },
897
+ TransactionVersion: {
898
+ LEGACY: "legacy",
899
+ ZERO: 0
877
900
  }
878
901
  };
879
902
 
@@ -888,14 +911,14 @@ var instructionTypeDefs = (
888
911
 
889
912
  # Transaction instruction interface
890
913
  interface TransactionInstruction {
891
- programId: String
914
+ programId: Address
892
915
  }
893
916
 
894
917
  # Generic transaction instruction
895
918
  type GenericInstruction implements TransactionInstruction {
896
- accounts: [String]
897
- data: String
898
- programId: String
919
+ accounts: [Address]
920
+ data: Base64EncodedBytes
921
+ programId: Address
899
922
  }
900
923
 
901
924
  # AddressLookupTable: CreateLookupTable
@@ -910,21 +933,21 @@ var instructionTypeDefs = (
910
933
  type CreateLookupTableInstruction implements TransactionInstruction {
911
934
  data: CreateLookupTableInstructionData
912
935
  meta: JsonParsedInstructionMeta
913
- programId: String
936
+ programId: Address
914
937
  }
915
938
 
916
939
  # AddressLookupTable: ExtendLookupTable
917
940
  type ExtendLookupTableInstructionData {
918
941
  lookupTableAccount: Account
919
942
  lookupTableAuthority: Account
920
- newAddresses: [String]
943
+ newAddresses: [Address]
921
944
  payerAccount: Account
922
945
  systemProgram: Account
923
946
  }
924
947
  type ExtendLookupTableInstruction implements TransactionInstruction {
925
948
  data: ExtendLookupTableInstructionData
926
949
  meta: JsonParsedInstructionMeta
927
- programId: String
950
+ programId: Address
928
951
  }
929
952
 
930
953
  # AddressLookupTable: FreezeLookupTable
@@ -935,7 +958,7 @@ var instructionTypeDefs = (
935
958
  type FreezeLookupTableInstruction implements TransactionInstruction {
936
959
  data: FreezeLookupTableInstructionData
937
960
  meta: JsonParsedInstructionMeta
938
- programId: String
961
+ programId: Address
939
962
  }
940
963
 
941
964
  # AddressLookupTable: DeactivateLookupTable
@@ -946,7 +969,7 @@ var instructionTypeDefs = (
946
969
  type DeactivateLookupTableInstruction implements TransactionInstruction {
947
970
  data: DeactivateLookupTableInstructionData
948
971
  meta: JsonParsedInstructionMeta
949
- programId: String
972
+ programId: Address
950
973
  }
951
974
 
952
975
  # AddressLookupTable: CloseLookupTable
@@ -958,19 +981,19 @@ var instructionTypeDefs = (
958
981
  type CloseLookupTableInstruction implements TransactionInstruction {
959
982
  data: CloseLookupTableInstructionData
960
983
  meta: JsonParsedInstructionMeta
961
- programId: String
984
+ programId: Address
962
985
  }
963
986
 
964
987
  # BpfLoader: Write
965
988
  type BpfLoaderWriteInstructionData {
966
989
  account: Account
967
- bytes: String
990
+ bytes: Base64EncodedBytes
968
991
  offset: BigInt # FIXME:*
969
992
  }
970
993
  type BpfLoaderWriteInstruction implements TransactionInstruction {
971
994
  data: BpfLoaderWriteInstructionData
972
995
  meta: JsonParsedInstructionMeta
973
- programId: String
996
+ programId: Address
974
997
  }
975
998
 
976
999
  # BpfLoader: Finalize
@@ -980,7 +1003,7 @@ var instructionTypeDefs = (
980
1003
  type BpfLoaderFinalizeInstruction implements TransactionInstruction {
981
1004
  data: BpfLoaderFinalizeInstructionData
982
1005
  meta: JsonParsedInstructionMeta
983
- programId: String
1006
+ programId: Address
984
1007
  }
985
1008
 
986
1009
  # BpfUpgradeableLoader: InitializeBuffer
@@ -990,53 +1013,53 @@ var instructionTypeDefs = (
990
1013
  type BpfUpgradeableLoaderInitializeBufferInstruction implements TransactionInstruction {
991
1014
  data: BpfUpgradeableLoaderInitializeBufferInstructionData
992
1015
  meta: JsonParsedInstructionMeta
993
- programId: String
1016
+ programId: Address
994
1017
  }
995
1018
 
996
1019
  # BpfUpgradeableLoader: Write
997
1020
  type BpfUpgradeableLoaderWriteInstructionData {
998
1021
  account: Account
999
1022
  authority: Account
1000
- bytes: String
1023
+ bytes: Base64EncodedBytes
1001
1024
  offset: BigInt # FIXME:*
1002
1025
  }
1003
1026
  type BpfUpgradeableLoaderWriteInstruction implements TransactionInstruction {
1004
1027
  data: BpfUpgradeableLoaderWriteInstructionData
1005
1028
  meta: JsonParsedInstructionMeta
1006
- programId: String
1029
+ programId: Address
1007
1030
  }
1008
1031
 
1009
1032
  # BpfUpgradeableLoader: DeployWithMaxDataLen
1010
1033
  type BpfUpgradeableLoaderDeployWithMaxDataLenInstructionData {
1011
1034
  authority: Account
1012
1035
  bufferAccount: Account
1013
- clockSysvar: String
1036
+ clockSysvar: Address
1014
1037
  maxDataLen: BigInt
1015
1038
  payerAccount: Account
1016
1039
  programAccount: Account
1017
1040
  programDataAccount: Account
1018
- rentSysvar: String
1041
+ rentSysvar: Address
1019
1042
  }
1020
1043
  type BpfUpgradeableLoaderDeployWithMaxDataLenInstruction implements TransactionInstruction {
1021
1044
  data: BpfUpgradeableLoaderDeployWithMaxDataLenInstructionData
1022
1045
  meta: JsonParsedInstructionMeta
1023
- programId: String
1046
+ programId: Address
1024
1047
  }
1025
1048
 
1026
1049
  # BpfUpgradeableLoader: Upgrade
1027
1050
  type BpfUpgradeableLoaderUpgradeInstructionData {
1028
1051
  authority: Account
1029
1052
  bufferAccount: Account
1030
- clockSysvar: String
1053
+ clockSysvar: Address
1031
1054
  programAccount: Account
1032
1055
  programDataAccount: Account
1033
- rentSysvar: String
1056
+ rentSysvar: Address
1034
1057
  spillAccount: Account
1035
1058
  }
1036
1059
  type BpfUpgradeableLoaderUpgradeInstruction implements TransactionInstruction {
1037
1060
  data: BpfUpgradeableLoaderUpgradeInstructionData
1038
1061
  meta: JsonParsedInstructionMeta
1039
- programId: String
1062
+ programId: Address
1040
1063
  }
1041
1064
 
1042
1065
  # BpfUpgradeableLoader: SetAuthority
@@ -1048,7 +1071,7 @@ var instructionTypeDefs = (
1048
1071
  type BpfUpgradeableLoaderSetAuthorityInstruction implements TransactionInstruction {
1049
1072
  data: BpfUpgradeableLoaderSetAuthorityInstructionData
1050
1073
  meta: JsonParsedInstructionMeta
1051
- programId: String
1074
+ programId: Address
1052
1075
  }
1053
1076
 
1054
1077
  # BpfUpgradeableLoader: SetAuthorityChecked
@@ -1060,7 +1083,7 @@ var instructionTypeDefs = (
1060
1083
  type BpfUpgradeableLoaderSetAuthorityCheckedInstruction implements TransactionInstruction {
1061
1084
  data: BpfUpgradeableLoaderSetAuthorityCheckedInstructionData
1062
1085
  meta: JsonParsedInstructionMeta
1063
- programId: String
1086
+ programId: Address
1064
1087
  }
1065
1088
 
1066
1089
  # BpfUpgradeableLoader: Close
@@ -1073,7 +1096,7 @@ var instructionTypeDefs = (
1073
1096
  type BpfUpgradeableLoaderCloseInstruction implements TransactionInstruction {
1074
1097
  data: BpfUpgradeableLoaderCloseInstructionData
1075
1098
  meta: JsonParsedInstructionMeta
1076
- programId: String
1099
+ programId: Address
1077
1100
  }
1078
1101
 
1079
1102
  # BpfUpgradeableLoader: ExtendProgram
@@ -1087,13 +1110,13 @@ var instructionTypeDefs = (
1087
1110
  type BpfUpgradeableLoaderExtendProgramInstruction implements TransactionInstruction {
1088
1111
  data: BpfUpgradeableLoaderExtendProgramInstructionData
1089
1112
  meta: JsonParsedInstructionMeta
1090
- programId: String
1113
+ programId: Address
1091
1114
  }
1092
1115
 
1093
1116
  # SplAssociatedTokenAccount: Create
1094
1117
  type SplAssociatedTokenCreateInstructionData {
1095
1118
  account: Account
1096
- mint: String
1119
+ mint: Address
1097
1120
  source: Account
1098
1121
  systemProgram: Account
1099
1122
  tokenProgram: Account
@@ -1102,13 +1125,13 @@ var instructionTypeDefs = (
1102
1125
  type SplAssociatedTokenCreateInstruction implements TransactionInstruction {
1103
1126
  data: SplAssociatedTokenCreateInstructionData
1104
1127
  meta: JsonParsedInstructionMeta
1105
- programId: String
1128
+ programId: Address
1106
1129
  }
1107
1130
 
1108
1131
  # SplAssociatedTokenAccount: CreateIdempotent
1109
1132
  type SplAssociatedTokenCreateIdempotentInstructionData {
1110
1133
  account: Account
1111
- mint: String
1134
+ mint: Address
1112
1135
  source: Account
1113
1136
  systemProgram: Account
1114
1137
  tokenProgram: Account
@@ -1117,7 +1140,7 @@ var instructionTypeDefs = (
1117
1140
  type SplAssociatedTokenCreateIdempotentInstruction implements TransactionInstruction {
1118
1141
  data: SplAssociatedTokenCreateIdempotentInstructionData
1119
1142
  meta: JsonParsedInstructionMeta
1120
- programId: String
1143
+ programId: Address
1121
1144
  }
1122
1145
 
1123
1146
  # SplAssociatedTokenAccount: RecoverNested
@@ -1133,7 +1156,7 @@ var instructionTypeDefs = (
1133
1156
  type SplAssociatedTokenRecoverNestedInstruction implements TransactionInstruction {
1134
1157
  data: SplAssociatedTokenRecoverNestedInstructionData
1135
1158
  meta: JsonParsedInstructionMeta
1136
- programId: String
1159
+ programId: Address
1137
1160
  }
1138
1161
 
1139
1162
  # SplMemo
@@ -1143,7 +1166,7 @@ var instructionTypeDefs = (
1143
1166
  type SplMemoInstruction implements TransactionInstruction {
1144
1167
  data: SplMemoInstructionData
1145
1168
  meta: JsonParsedInstructionMeta
1146
- programId: String
1169
+ programId: Address
1147
1170
  }
1148
1171
 
1149
1172
  # SplToken: InitializeMint
@@ -1152,12 +1175,12 @@ var instructionTypeDefs = (
1152
1175
  freezeAuthority: Account
1153
1176
  mint: Account
1154
1177
  mintAuthority: Account
1155
- rentSysvar: String
1178
+ rentSysvar: Address
1156
1179
  }
1157
1180
  type SplTokenInitializeMintInstruction implements TransactionInstruction {
1158
1181
  data: SplTokenInitializeMintInstructionData
1159
1182
  meta: JsonParsedInstructionMeta
1160
- programId: String
1183
+ programId: Address
1161
1184
  }
1162
1185
 
1163
1186
  # SplToken: InitializeMint2
@@ -1170,7 +1193,7 @@ var instructionTypeDefs = (
1170
1193
  type SplTokenInitializeMint2Instruction implements TransactionInstruction {
1171
1194
  data: SplTokenInitializeMint2InstructionData
1172
1195
  meta: JsonParsedInstructionMeta
1173
- programId: String
1196
+ programId: Address
1174
1197
  }
1175
1198
 
1176
1199
  # SplToken: InitializeAccount
@@ -1178,12 +1201,12 @@ var instructionTypeDefs = (
1178
1201
  account: Account
1179
1202
  mint: Account
1180
1203
  owner: Account
1181
- rentSysvar: String
1204
+ rentSysvar: Address
1182
1205
  }
1183
1206
  type SplTokenInitializeAccountInstruction implements TransactionInstruction {
1184
1207
  data: SplTokenInitializeAccountInstructionData
1185
1208
  meta: JsonParsedInstructionMeta
1186
- programId: String
1209
+ programId: Address
1187
1210
  }
1188
1211
 
1189
1212
  # SplToken: InitializeAccount2
@@ -1191,12 +1214,12 @@ var instructionTypeDefs = (
1191
1214
  account: Account
1192
1215
  mint: Account
1193
1216
  owner: Account
1194
- rentSysvar: String
1217
+ rentSysvar: Address
1195
1218
  }
1196
1219
  type SplTokenInitializeAccount2Instruction implements TransactionInstruction {
1197
1220
  data: SplTokenInitializeAccount2InstructionData
1198
1221
  meta: JsonParsedInstructionMeta
1199
- programId: String
1222
+ programId: Address
1200
1223
  }
1201
1224
 
1202
1225
  # SplToken: InitializeAccount3
@@ -1208,32 +1231,32 @@ var instructionTypeDefs = (
1208
1231
  type SplTokenInitializeAccount3Instruction implements TransactionInstruction {
1209
1232
  data: SplTokenInitializeAccount3InstructionData
1210
1233
  meta: JsonParsedInstructionMeta
1211
- programId: String
1234
+ programId: Address
1212
1235
  }
1213
1236
 
1214
1237
  # SplToken: InitializeMultisig
1215
1238
  type SplTokenInitializeMultisigInstructionData {
1216
1239
  m: BigInt # FIXME:*
1217
1240
  multisig: Account
1218
- rentSysvar: String
1219
- signers: [String]
1241
+ rentSysvar: Address
1242
+ signers: [Address]
1220
1243
  }
1221
1244
  type SplTokenInitializeMultisigInstruction implements TransactionInstruction {
1222
1245
  data: SplTokenInitializeMultisigInstructionData
1223
1246
  meta: JsonParsedInstructionMeta
1224
- programId: String
1247
+ programId: Address
1225
1248
  }
1226
1249
 
1227
1250
  # SplToken: InitializeMultisig2
1228
1251
  type SplTokenInitializeMultisig2InstructionData {
1229
1252
  m: BigInt # FIXME:*
1230
1253
  multisig: Account
1231
- signers: [String]
1254
+ signers: [Address]
1232
1255
  }
1233
1256
  type SplTokenInitializeMultisig2Instruction implements TransactionInstruction {
1234
1257
  data: SplTokenInitializeMultisig2InstructionData
1235
1258
  meta: JsonParsedInstructionMeta
1236
- programId: String
1259
+ programId: Address
1237
1260
  }
1238
1261
 
1239
1262
  # SplToken: Transfer
@@ -1247,7 +1270,7 @@ var instructionTypeDefs = (
1247
1270
  type SplTokenTransferInstruction implements TransactionInstruction {
1248
1271
  data: SplTokenTransferInstructionData
1249
1272
  meta: JsonParsedInstructionMeta
1250
- programId: String
1273
+ programId: Address
1251
1274
  }
1252
1275
 
1253
1276
  # SplToken: Approve
@@ -1261,7 +1284,7 @@ var instructionTypeDefs = (
1261
1284
  type SplTokenApproveInstruction implements TransactionInstruction {
1262
1285
  data: SplTokenApproveInstructionData
1263
1286
  meta: JsonParsedInstructionMeta
1264
- programId: String
1287
+ programId: Address
1265
1288
  }
1266
1289
 
1267
1290
  # SplToken: Revoke
@@ -1273,7 +1296,7 @@ var instructionTypeDefs = (
1273
1296
  type SplTokenRevokeInstruction implements TransactionInstruction {
1274
1297
  data: SplTokenRevokeInstructionData
1275
1298
  meta: JsonParsedInstructionMeta
1276
- programId: String
1299
+ programId: Address
1277
1300
  }
1278
1301
 
1279
1302
  # SplToken: SetAuthority
@@ -1286,7 +1309,7 @@ var instructionTypeDefs = (
1286
1309
  type SplTokenSetAuthorityInstruction implements TransactionInstruction {
1287
1310
  data: SplTokenSetAuthorityInstructionData
1288
1311
  meta: JsonParsedInstructionMeta
1289
- programId: String
1312
+ programId: Address
1290
1313
  }
1291
1314
 
1292
1315
  # SplToken: MintTo
@@ -1301,7 +1324,7 @@ var instructionTypeDefs = (
1301
1324
  type SplTokenMintToInstruction implements TransactionInstruction {
1302
1325
  data: SplTokenMintToInstructionData
1303
1326
  meta: JsonParsedInstructionMeta
1304
- programId: String
1327
+ programId: Address
1305
1328
  }
1306
1329
 
1307
1330
  # SplToken: Burn
@@ -1315,7 +1338,7 @@ var instructionTypeDefs = (
1315
1338
  type SplTokenBurnInstruction implements TransactionInstruction {
1316
1339
  data: SplTokenBurnInstructionData
1317
1340
  meta: JsonParsedInstructionMeta
1318
- programId: String
1341
+ programId: Address
1319
1342
  }
1320
1343
 
1321
1344
  # SplToken: CloseAccount
@@ -1328,7 +1351,7 @@ var instructionTypeDefs = (
1328
1351
  type SplTokenCloseAccountInstruction implements TransactionInstruction {
1329
1352
  data: SplTokenCloseAccountInstructionData
1330
1353
  meta: JsonParsedInstructionMeta
1331
- programId: String
1354
+ programId: Address
1332
1355
  }
1333
1356
 
1334
1357
  # SplToken: FreezeAccount
@@ -1341,7 +1364,7 @@ var instructionTypeDefs = (
1341
1364
  type SplTokenFreezeAccountInstruction implements TransactionInstruction {
1342
1365
  data: SplTokenFreezeAccountInstructionData
1343
1366
  meta: JsonParsedInstructionMeta
1344
- programId: String
1367
+ programId: Address
1345
1368
  }
1346
1369
 
1347
1370
  # SplToken: ThawAccount
@@ -1354,7 +1377,7 @@ var instructionTypeDefs = (
1354
1377
  type SplTokenThawAccountInstruction implements TransactionInstruction {
1355
1378
  data: SplTokenThawAccountInstructionData
1356
1379
  meta: JsonParsedInstructionMeta
1357
- programId: String
1380
+ programId: Address
1358
1381
  }
1359
1382
 
1360
1383
  # SplToken: TransferChecked
@@ -1371,7 +1394,7 @@ var instructionTypeDefs = (
1371
1394
  type SplTokenTransferCheckedInstruction implements TransactionInstruction {
1372
1395
  data: SplTokenTransferCheckedInstructionData
1373
1396
  meta: JsonParsedInstructionMeta
1374
- programId: String
1397
+ programId: Address
1375
1398
  }
1376
1399
 
1377
1400
  # SplToken: ApproveChecked
@@ -1386,7 +1409,7 @@ var instructionTypeDefs = (
1386
1409
  type SplTokenApproveCheckedInstruction implements TransactionInstruction {
1387
1410
  data: SplTokenApproveCheckedInstructionData
1388
1411
  meta: JsonParsedInstructionMeta
1389
- programId: String
1412
+ programId: Address
1390
1413
  }
1391
1414
 
1392
1415
  # SplToken: MintToChecked
@@ -1401,7 +1424,7 @@ var instructionTypeDefs = (
1401
1424
  type SplTokenMintToCheckedInstruction implements TransactionInstruction {
1402
1425
  data: SplTokenMintToCheckedInstructionData
1403
1426
  meta: JsonParsedInstructionMeta
1404
- programId: String
1427
+ programId: Address
1405
1428
  }
1406
1429
 
1407
1430
  # SplToken: BurnChecked
@@ -1415,7 +1438,7 @@ var instructionTypeDefs = (
1415
1438
  type SplTokenBurnCheckedInstruction implements TransactionInstruction {
1416
1439
  data: SplTokenBurnCheckedInstructionData
1417
1440
  meta: JsonParsedInstructionMeta
1418
- programId: String
1441
+ programId: Address
1419
1442
  }
1420
1443
 
1421
1444
  # SplToken: SyncNative
@@ -1425,7 +1448,7 @@ var instructionTypeDefs = (
1425
1448
  type SplTokenSyncNativeInstruction implements TransactionInstruction {
1426
1449
  data: SplTokenSyncNativeInstructionData
1427
1450
  meta: JsonParsedInstructionMeta
1428
- programId: String
1451
+ programId: Address
1429
1452
  }
1430
1453
 
1431
1454
  # SplToken: GetAccountDataSize
@@ -1436,7 +1459,7 @@ var instructionTypeDefs = (
1436
1459
  type SplTokenGetAccountDataSizeInstruction implements TransactionInstruction {
1437
1460
  data: SplTokenGetAccountDataSizeInstructionData
1438
1461
  meta: JsonParsedInstructionMeta
1439
- programId: String
1462
+ programId: Address
1440
1463
  }
1441
1464
 
1442
1465
  # SplToken: InitializeImmutableOwner
@@ -1446,7 +1469,7 @@ var instructionTypeDefs = (
1446
1469
  type SplTokenInitializeImmutableOwnerInstruction implements TransactionInstruction {
1447
1470
  data: SplTokenInitializeImmutableOwnerInstructionData
1448
1471
  meta: JsonParsedInstructionMeta
1449
- programId: String
1472
+ programId: Address
1450
1473
  }
1451
1474
 
1452
1475
  # SplToken: AmountToUiAmount
@@ -1457,7 +1480,7 @@ var instructionTypeDefs = (
1457
1480
  type SplTokenAmountToUiAmountInstruction implements TransactionInstruction {
1458
1481
  data: SplTokenAmountToUiAmountInstructionData
1459
1482
  meta: JsonParsedInstructionMeta
1460
- programId: String
1483
+ programId: Address
1461
1484
  }
1462
1485
 
1463
1486
  # SplToken: UiAmountToAmount
@@ -1468,7 +1491,7 @@ var instructionTypeDefs = (
1468
1491
  type SplTokenUiAmountToAmountInstruction implements TransactionInstruction {
1469
1492
  data: SplTokenUiAmountToAmountInstructionData
1470
1493
  meta: JsonParsedInstructionMeta
1471
- programId: String
1494
+ programId: Address
1472
1495
  }
1473
1496
 
1474
1497
  # SplToken: InitializeMintCloseAuthority
@@ -1479,7 +1502,7 @@ var instructionTypeDefs = (
1479
1502
  type SplTokenInitializeMintCloseAuthorityInstruction implements TransactionInstruction {
1480
1503
  data: SplTokenInitializeMintCloseAuthorityInstructionData
1481
1504
  meta: JsonParsedInstructionMeta
1482
- programId: String
1505
+ programId: Address
1483
1506
  }
1484
1507
 
1485
1508
  # TODO: Extensions!
@@ -1512,20 +1535,20 @@ var instructionTypeDefs = (
1512
1535
  type StakeInitializeInstructionData {
1513
1536
  authorized: StakeInitializeInstructionDataAuthorized
1514
1537
  lockup: Lockup
1515
- rentSysvar: String
1538
+ rentSysvar: Address
1516
1539
  stakeAccount: Account
1517
1540
  }
1518
1541
  type StakeInitializeInstruction implements TransactionInstruction {
1519
1542
  data: StakeInitializeInstructionData
1520
1543
  meta: JsonParsedInstructionMeta
1521
- programId: String
1544
+ programId: Address
1522
1545
  }
1523
1546
 
1524
1547
  # Stake: Authorize
1525
1548
  type StakeAuthorizeInstructionData {
1526
1549
  authority: Account
1527
1550
  authorityType: String
1528
- clockSysvar: String
1551
+ clockSysvar: Address
1529
1552
  custodian: Account
1530
1553
  newAuthority: Account
1531
1554
  stakeAccount: Account
@@ -1533,22 +1556,22 @@ var instructionTypeDefs = (
1533
1556
  type StakeAuthorizeInstruction implements TransactionInstruction {
1534
1557
  data: StakeAuthorizeInstructionData
1535
1558
  meta: JsonParsedInstructionMeta
1536
- programId: String
1559
+ programId: Address
1537
1560
  }
1538
1561
 
1539
1562
  # Stake: DelegateStake
1540
1563
  type StakeDelegateStakeInstructionData {
1541
- clockSysvar: String
1564
+ clockSysvar: Address
1542
1565
  stakeAccount: Account
1543
1566
  stakeAuthority: Account
1544
1567
  stakeConfigAccount: Account
1545
- stakeHistorySysvar: String
1568
+ stakeHistorySysvar: Address
1546
1569
  voteAccount: Account
1547
1570
  }
1548
1571
  type StakeDelegateStakeInstruction implements TransactionInstruction {
1549
1572
  data: StakeDelegateStakeInstructionData
1550
1573
  meta: JsonParsedInstructionMeta
1551
- programId: String
1574
+ programId: Address
1552
1575
  }
1553
1576
 
1554
1577
  # Stake: Split
@@ -1561,12 +1584,12 @@ var instructionTypeDefs = (
1561
1584
  type StakeSplitInstruction implements TransactionInstruction {
1562
1585
  data: StakeSplitInstructionData
1563
1586
  meta: JsonParsedInstructionMeta
1564
- programId: String
1587
+ programId: Address
1565
1588
  }
1566
1589
 
1567
1590
  # Stake: Withdraw
1568
1591
  type StakeWithdrawInstructionData {
1569
- clockSysvar: String
1592
+ clockSysvar: Address
1570
1593
  destination: Account
1571
1594
  lamports: BigInt
1572
1595
  stakeAccount: Account
@@ -1575,19 +1598,19 @@ var instructionTypeDefs = (
1575
1598
  type StakeWithdrawInstruction implements TransactionInstruction {
1576
1599
  data: StakeWithdrawInstructionData
1577
1600
  meta: JsonParsedInstructionMeta
1578
- programId: String
1601
+ programId: Address
1579
1602
  }
1580
1603
 
1581
1604
  # Stake: Deactivate
1582
1605
  type StakeDeactivateInstructionData {
1583
- clockSysvar: String
1606
+ clockSysvar: Address
1584
1607
  stakeAccount: Account
1585
1608
  stakeAuthority: Account
1586
1609
  }
1587
1610
  type StakeDeactivateInstruction implements TransactionInstruction {
1588
1611
  data: StakeDeactivateInstructionData
1589
1612
  meta: JsonParsedInstructionMeta
1590
- programId: String
1613
+ programId: Address
1591
1614
  }
1592
1615
 
1593
1616
  # Stake: SetLockup
@@ -1599,21 +1622,21 @@ var instructionTypeDefs = (
1599
1622
  type StakeSetLockupInstruction implements TransactionInstruction {
1600
1623
  data: StakeSetLockupInstructionData
1601
1624
  meta: JsonParsedInstructionMeta
1602
- programId: String
1625
+ programId: Address
1603
1626
  }
1604
1627
 
1605
1628
  # Stake: Merge
1606
1629
  type StakeMergeInstructionData {
1607
- clockSysvar: String
1630
+ clockSysvar: Address
1608
1631
  destination: Account
1609
1632
  source: Account
1610
1633
  stakeAuthority: Account
1611
- stakeHistorySysvar: String
1634
+ stakeHistorySysvar: Address
1612
1635
  }
1613
1636
  type StakeMergeInstruction implements TransactionInstruction {
1614
1637
  data: StakeMergeInstructionData
1615
1638
  meta: JsonParsedInstructionMeta
1616
- programId: String
1639
+ programId: Address
1617
1640
  }
1618
1641
 
1619
1642
  # Stake: AuthorizeWithSeed
@@ -1622,7 +1645,7 @@ var instructionTypeDefs = (
1622
1645
  authorityOwner: Account
1623
1646
  authoritySeed: String
1624
1647
  authorityType: String
1625
- clockSysvar: String
1648
+ clockSysvar: Address
1626
1649
  custodian: Account
1627
1650
  newAuthorized: Account
1628
1651
  stakeAccount: Account
@@ -1630,12 +1653,12 @@ var instructionTypeDefs = (
1630
1653
  type StakeAuthorizeWithSeedInstruction implements TransactionInstruction {
1631
1654
  data: StakeAuthorizeWithSeedInstructionData
1632
1655
  meta: JsonParsedInstructionMeta
1633
- programId: String
1656
+ programId: Address
1634
1657
  }
1635
1658
 
1636
1659
  # Stake: InitializeChecked
1637
1660
  type StakeInitializeCheckedInstructionDataAuthorized {
1638
- rentSysvar: String
1661
+ rentSysvar: Address
1639
1662
  stakeAccount: Account
1640
1663
  staker: Account
1641
1664
  withdrawer: Account
@@ -1643,14 +1666,14 @@ var instructionTypeDefs = (
1643
1666
  type StakeInitializeCheckedInstruction implements TransactionInstruction {
1644
1667
  data: StakeInitializeCheckedInstructionDataAuthorized
1645
1668
  meta: JsonParsedInstructionMeta
1646
- programId: String
1669
+ programId: Address
1647
1670
  }
1648
1671
 
1649
1672
  # Stake: AuthorizeChecked
1650
1673
  type StakeAuthorizeCheckedInstructionData {
1651
1674
  authority: Account
1652
1675
  authorityType: String
1653
- clockSysvar: String
1676
+ clockSysvar: Address
1654
1677
  custodian: Account
1655
1678
  newAuthority: Account
1656
1679
  stakeAccount: Account
@@ -1658,7 +1681,7 @@ var instructionTypeDefs = (
1658
1681
  type StakeAuthorizeCheckedInstruction implements TransactionInstruction {
1659
1682
  data: StakeAuthorizeCheckedInstructionData
1660
1683
  meta: JsonParsedInstructionMeta
1661
- programId: String
1684
+ programId: Address
1662
1685
  }
1663
1686
 
1664
1687
  # Stake: AuthorizeCheckedWithSeed
@@ -1667,7 +1690,7 @@ var instructionTypeDefs = (
1667
1690
  authorityOwner: Account
1668
1691
  authoritySeed: String
1669
1692
  authorityType: String
1670
- clockSysvar: String
1693
+ clockSysvar: Address
1671
1694
  custodian: Account
1672
1695
  newAuthorized: Account
1673
1696
  stakeAccount: Account
@@ -1675,7 +1698,7 @@ var instructionTypeDefs = (
1675
1698
  type StakeAuthorizeCheckedWithSeedInstruction implements TransactionInstruction {
1676
1699
  data: StakeAuthorizeCheckedWithSeedInstructionData
1677
1700
  meta: JsonParsedInstructionMeta
1678
- programId: String
1701
+ programId: Address
1679
1702
  }
1680
1703
 
1681
1704
  # Stake: SetLockupChecked
@@ -1687,7 +1710,7 @@ var instructionTypeDefs = (
1687
1710
  type StakeSetLockupCheckedInstruction implements TransactionInstruction {
1688
1711
  data: StakeSetLockupCheckedInstructionData
1689
1712
  meta: JsonParsedInstructionMeta
1690
- programId: String
1713
+ programId: Address
1691
1714
  }
1692
1715
 
1693
1716
  # Stake: DeactivateDelinquent
@@ -1699,7 +1722,7 @@ var instructionTypeDefs = (
1699
1722
  type StakeDeactivateDelinquentInstruction implements TransactionInstruction {
1700
1723
  data: StakeDeactivateDelinquentInstructionData
1701
1724
  meta: JsonParsedInstructionMeta
1702
- programId: String
1725
+ programId: Address
1703
1726
  }
1704
1727
 
1705
1728
  # Stake: Redelegate
@@ -1713,7 +1736,7 @@ var instructionTypeDefs = (
1713
1736
  type StakeRedelegateInstruction implements TransactionInstruction {
1714
1737
  data: StakeRedelegateInstructionData
1715
1738
  meta: JsonParsedInstructionMeta
1716
- programId: String
1739
+ programId: Address
1717
1740
  }
1718
1741
 
1719
1742
  # System: CreateAccount
@@ -1727,7 +1750,7 @@ var instructionTypeDefs = (
1727
1750
  type CreateAccountInstruction implements TransactionInstruction {
1728
1751
  data: CreateAccountInstructionData
1729
1752
  meta: JsonParsedInstructionMeta
1730
- programId: String
1753
+ programId: Address
1731
1754
  }
1732
1755
 
1733
1756
  # System: Assign
@@ -1738,7 +1761,7 @@ var instructionTypeDefs = (
1738
1761
  type AssignInstruction implements TransactionInstruction {
1739
1762
  data: AssignInstructionData
1740
1763
  meta: JsonParsedInstructionMeta
1741
- programId: String
1764
+ programId: Address
1742
1765
  }
1743
1766
 
1744
1767
  # System: Transfer
@@ -1750,7 +1773,7 @@ var instructionTypeDefs = (
1750
1773
  type TransferInstruction implements TransactionInstruction {
1751
1774
  data: TransferInstructionData
1752
1775
  meta: JsonParsedInstructionMeta
1753
- programId: String
1776
+ programId: Address
1754
1777
  }
1755
1778
 
1756
1779
  # System: CreateAccountWithSeed
@@ -1764,19 +1787,19 @@ var instructionTypeDefs = (
1764
1787
  type CreateAccountWithSeedInstruction implements TransactionInstruction {
1765
1788
  data: CreateAccountWithSeedInstructionData
1766
1789
  meta: JsonParsedInstructionMeta
1767
- programId: String
1790
+ programId: Address
1768
1791
  }
1769
1792
 
1770
1793
  # System: AdvanceNonceAccount
1771
1794
  type AdvanceNonceAccountInstructionData {
1772
1795
  nonceAccount: Account
1773
1796
  nonceAuthority: Account
1774
- recentBlockhashesSysvar: String
1797
+ recentBlockhashesSysvar: Address
1775
1798
  }
1776
1799
  type AdvanceNonceAccountInstruction implements TransactionInstruction {
1777
1800
  data: AdvanceNonceAccountInstructionData
1778
1801
  meta: JsonParsedInstructionMeta
1779
- programId: String
1802
+ programId: Address
1780
1803
  }
1781
1804
 
1782
1805
  # System: WithdrawNonceAccount
@@ -1785,26 +1808,26 @@ var instructionTypeDefs = (
1785
1808
  lamports: BigInt
1786
1809
  nonceAccount: Account
1787
1810
  nonceAuthority: Account
1788
- recentBlockhashesSysvar: String
1789
- rentSysvar: String
1811
+ recentBlockhashesSysvar: Address
1812
+ rentSysvar: Address
1790
1813
  }
1791
1814
  type WithdrawNonceAccountInstruction implements TransactionInstruction {
1792
1815
  data: WithdrawNonceAccountInstructionData
1793
1816
  meta: JsonParsedInstructionMeta
1794
- programId: String
1817
+ programId: Address
1795
1818
  }
1796
1819
 
1797
1820
  # System: InitializeNonceAccount
1798
1821
  type InitializeNonceAccountInstructionData {
1799
1822
  nonceAccount: Account
1800
1823
  nonceAuthority: Account
1801
- recentBlockhashesSysvar: String
1802
- rentSysvar: String
1824
+ recentBlockhashesSysvar: Address
1825
+ rentSysvar: Address
1803
1826
  }
1804
1827
  type InitializeNonceAccountInstruction implements TransactionInstruction {
1805
1828
  data: InitializeNonceAccountInstructionData
1806
1829
  meta: JsonParsedInstructionMeta
1807
- programId: String
1830
+ programId: Address
1808
1831
  }
1809
1832
 
1810
1833
  # System: AuthorizeNonceAccount
@@ -1816,7 +1839,7 @@ var instructionTypeDefs = (
1816
1839
  type AuthorizeNonceAccountInstruction implements TransactionInstruction {
1817
1840
  data: AuthorizeNonceAccountInstructionData
1818
1841
  meta: JsonParsedInstructionMeta
1819
- programId: String
1842
+ programId: Address
1820
1843
  }
1821
1844
 
1822
1845
  # System: UpgradeNonceAccount
@@ -1827,7 +1850,7 @@ var instructionTypeDefs = (
1827
1850
  type UpgradeNonceAccountInstruction implements TransactionInstruction {
1828
1851
  data: UpgradeNonceAccountInstructionData
1829
1852
  meta: JsonParsedInstructionMeta
1830
- programId: String
1853
+ programId: Address
1831
1854
  }
1832
1855
 
1833
1856
  # System: Allocate
@@ -1838,13 +1861,13 @@ var instructionTypeDefs = (
1838
1861
  type AllocateInstruction implements TransactionInstruction {
1839
1862
  data: AllocateInstructionData
1840
1863
  meta: JsonParsedInstructionMeta
1841
- programId: String
1864
+ programId: Address
1842
1865
  }
1843
1866
 
1844
1867
  # System: AllocateWithSeed
1845
1868
  type AllocateWithSeedInstructionData {
1846
1869
  account: Account
1847
- base: String
1870
+ base: Address
1848
1871
  owner: Account
1849
1872
  seed: String
1850
1873
  space: BigInt
@@ -1852,20 +1875,20 @@ var instructionTypeDefs = (
1852
1875
  type AllocateWithSeedInstruction implements TransactionInstruction {
1853
1876
  data: AllocateWithSeedInstructionData
1854
1877
  meta: JsonParsedInstructionMeta
1855
- programId: String
1878
+ programId: Address
1856
1879
  }
1857
1880
 
1858
1881
  # System: AssignWithSeed
1859
1882
  type AssignWithSeedInstructionData {
1860
1883
  account: Account
1861
- base: String
1884
+ base: Address
1862
1885
  owner: Account
1863
1886
  seed: String
1864
1887
  }
1865
1888
  type AssignWithSeedInstruction implements TransactionInstruction {
1866
1889
  data: AssignWithSeedInstructionData
1867
1890
  meta: JsonParsedInstructionMeta
1868
- programId: String
1891
+ programId: Address
1869
1892
  }
1870
1893
 
1871
1894
  # System: TransferWithSeed
@@ -1873,76 +1896,76 @@ var instructionTypeDefs = (
1873
1896
  destination: Account
1874
1897
  lamports: BigInt
1875
1898
  source: Account
1876
- sourceBase: String
1899
+ sourceBase: Address
1877
1900
  sourceOwner: Account
1878
1901
  sourceSeed: String
1879
1902
  }
1880
1903
  type TransferWithSeedInstruction implements TransactionInstruction {
1881
1904
  data: TransferWithSeedInstructionData
1882
1905
  meta: JsonParsedInstructionMeta
1883
- programId: String
1906
+ programId: Address
1884
1907
  }
1885
1908
 
1886
1909
  # Vote: InitializeAccount
1887
1910
  type VoteInitializeAccountInstructionData {
1888
1911
  authorizedVoter: Account
1889
1912
  authorizedWithdrawer: Account
1890
- clockSysvar: String
1913
+ clockSysvar: Address
1891
1914
  commission: BigInt # FIXME:*
1892
1915
  node: Account
1893
- rentSysvar: String
1916
+ rentSysvar: Address
1894
1917
  voteAccount: Account
1895
1918
  }
1896
1919
  type VoteInitializeAccountInstruction implements TransactionInstruction {
1897
1920
  data: VoteInitializeAccountInstructionData
1898
1921
  meta: JsonParsedInstructionMeta
1899
- programId: String
1922
+ programId: Address
1900
1923
  }
1901
1924
 
1902
1925
  # Vote: Authorize
1903
1926
  type VoteAuthorizeInstructionData {
1904
1927
  authority: Account
1905
1928
  authorityType: String
1906
- clockSysvar: String
1929
+ clockSysvar: Address
1907
1930
  newAuthority: Account
1908
1931
  voteAccount: Account
1909
1932
  }
1910
1933
  type VoteAuthorizeInstruction implements TransactionInstruction {
1911
1934
  data: VoteAuthorizeInstructionData
1912
1935
  meta: JsonParsedInstructionMeta
1913
- programId: String
1936
+ programId: Address
1914
1937
  }
1915
1938
 
1916
1939
  # Vote: AuthorizeWithSeed
1917
1940
  type VoteAuthorizeWithSeedInstructionData {
1918
- authorityBaseKey: String
1941
+ authorityBaseKey: Address
1919
1942
  authorityOwner: Account
1920
1943
  authoritySeed: String
1921
1944
  authorityType: String
1922
- clockSysvar: String
1945
+ clockSysvar: Address
1923
1946
  newAuthority: Account
1924
1947
  voteAccount: Account
1925
1948
  }
1926
1949
  type VoteAuthorizeWithSeedInstruction implements TransactionInstruction {
1927
1950
  data: VoteAuthorizeWithSeedInstructionData
1928
1951
  meta: JsonParsedInstructionMeta
1929
- programId: String
1952
+ programId: Address
1930
1953
  }
1931
1954
 
1932
1955
  # Vote: AuthorizeCheckedWithSeed
1933
1956
  type VoteAuthorizeCheckedWithSeedInstructionData {
1934
- authorityBaseKey: String
1957
+ authorityBaseKey: Address
1935
1958
  authorityOwner: Account
1936
1959
  authoritySeed: String
1937
1960
  authorityType: String
1938
- clockSysvar: String
1961
+ clockSysvar: Address
1939
1962
  newAuthority: Account
1940
1963
  voteAccount: Account
1941
1964
  }
1942
1965
  type VoteAuthorizeCheckedWithSeedInstruction implements TransactionInstruction {
1943
1966
  data: VoteAuthorizeCheckedWithSeedInstructionData
1944
1967
  meta: JsonParsedInstructionMeta
1945
- programId: String
1968
+ programId: Address
1946
1969
  }
1947
1970
 
1948
1971
  type Vote {
@@ -1953,8 +1976,8 @@ var instructionTypeDefs = (
1953
1976
 
1954
1977
  # Vote: Vote
1955
1978
  type VoteVoteInstructionData {
1956
- clockSysvar: String
1957
- slotHashesSysvar: String
1979
+ clockSysvar: Address
1980
+ slotHashesSysvar: Address
1958
1981
  vote: Vote
1959
1982
  voteAccount: Account
1960
1983
  voteAuthority: Account
@@ -1962,7 +1985,7 @@ var instructionTypeDefs = (
1962
1985
  type VoteVoteInstruction implements TransactionInstruction {
1963
1986
  data: VoteVoteInstructionData
1964
1987
  meta: JsonParsedInstructionMeta
1965
- programId: String
1988
+ programId: Address
1966
1989
  }
1967
1990
 
1968
1991
  type VoteStateUpdateLockout {
@@ -1986,7 +2009,7 @@ var instructionTypeDefs = (
1986
2009
  type VoteUpdateVoteStateInstruction implements TransactionInstruction {
1987
2010
  data: VoteUpdateVoteStateInstructionData
1988
2011
  meta: JsonParsedInstructionMeta
1989
- programId: String
2012
+ programId: Address
1990
2013
  }
1991
2014
 
1992
2015
  # Vote: UpdateVoteStateSwitch
@@ -1999,7 +2022,7 @@ var instructionTypeDefs = (
1999
2022
  type VoteUpdateVoteStateSwitchInstruction implements TransactionInstruction {
2000
2023
  data: VoteUpdateVoteStateSwitchInstructionData
2001
2024
  meta: JsonParsedInstructionMeta
2002
- programId: String
2025
+ programId: Address
2003
2026
  }
2004
2027
 
2005
2028
  # Vote: CompactUpdateVoteState
@@ -2012,7 +2035,7 @@ var instructionTypeDefs = (
2012
2035
  type VoteCompactUpdateVoteStateInstruction implements TransactionInstruction {
2013
2036
  data: VoteCompactUpdateVoteStateInstructionData
2014
2037
  meta: JsonParsedInstructionMeta
2015
- programId: String
2038
+ programId: Address
2016
2039
  }
2017
2040
 
2018
2041
  # Vote: CompactUpdateVoteStateSwitch
@@ -2025,7 +2048,7 @@ var instructionTypeDefs = (
2025
2048
  type VoteCompactUpdateVoteStateSwitchInstruction implements TransactionInstruction {
2026
2049
  data: VoteCompactUpdateVoteStateSwitchInstructionData
2027
2050
  meta: JsonParsedInstructionMeta
2028
- programId: String
2051
+ programId: Address
2029
2052
  }
2030
2053
 
2031
2054
  # Vote: Withdraw
@@ -2038,7 +2061,7 @@ var instructionTypeDefs = (
2038
2061
  type VoteWithdrawInstruction implements TransactionInstruction {
2039
2062
  data: VoteWithdrawInstructionData
2040
2063
  meta: JsonParsedInstructionMeta
2041
- programId: String
2064
+ programId: Address
2042
2065
  }
2043
2066
 
2044
2067
  # Vote: UpdateValidatorIdentity
@@ -2050,7 +2073,7 @@ var instructionTypeDefs = (
2050
2073
  type VoteUpdateValidatorIdentityInstruction implements TransactionInstruction {
2051
2074
  data: VoteUpdateValidatorIdentityInstructionData
2052
2075
  meta: JsonParsedInstructionMeta
2053
- programId: String
2076
+ programId: Address
2054
2077
  }
2055
2078
 
2056
2079
  # Vote: UpdateCommission
@@ -2062,14 +2085,14 @@ var instructionTypeDefs = (
2062
2085
  type VoteUpdateCommissionInstruction implements TransactionInstruction {
2063
2086
  data: VoteUpdateCommissionInstructionData
2064
2087
  meta: JsonParsedInstructionMeta
2065
- programId: String
2088
+ programId: Address
2066
2089
  }
2067
2090
 
2068
2091
  # Vote: VoteSwitch
2069
2092
  type VoteVoteSwitchInstructionData {
2070
- clockSysvar: String
2093
+ clockSysvar: Address
2071
2094
  hash: String
2072
- slotHashesSysvar: String
2095
+ slotHashesSysvar: Address
2073
2096
  vote: Vote
2074
2097
  voteAccount: Account
2075
2098
  voteAuthority: Account
@@ -2077,21 +2100,21 @@ var instructionTypeDefs = (
2077
2100
  type VoteVoteSwitchInstruction implements TransactionInstruction {
2078
2101
  data: VoteVoteSwitchInstructionData
2079
2102
  meta: JsonParsedInstructionMeta
2080
- programId: String
2103
+ programId: Address
2081
2104
  }
2082
2105
 
2083
2106
  # Vote: AuthorizeChecked
2084
2107
  type VoteAuthorizeCheckedInstructionData {
2085
2108
  authority: Account
2086
2109
  authorityType: String
2087
- clockSysvar: String
2110
+ clockSysvar: Address
2088
2111
  newAuthority: Account
2089
2112
  voteAccount: Account
2090
2113
  }
2091
2114
  type VoteAuthorizeCheckedInstruction implements TransactionInstruction {
2092
2115
  data: VoteAuthorizeCheckedInstructionData
2093
2116
  meta: JsonParsedInstructionMeta
2094
- programId: String
2117
+ programId: Address
2095
2118
  }
2096
2119
  `
2097
2120
  );
@@ -2851,14 +2874,14 @@ var transactionTypeDefs = (
2851
2874
  }
2852
2875
 
2853
2876
  type TransactionMessageAccountKey {
2854
- pubkey: String
2877
+ pubkey: Address
2855
2878
  signer: Boolean
2856
2879
  source: String
2857
2880
  writable: Boolean
2858
2881
  }
2859
2882
 
2860
2883
  type TransactionMessageAddressTableLookup {
2861
- accountKey: String
2884
+ accountKey: Address
2862
2885
  readableIndexes: [Int]
2863
2886
  writableIndexes: [Int]
2864
2887
  }
@@ -2880,7 +2903,7 @@ var transactionTypeDefs = (
2880
2903
  # Transaction interface
2881
2904
  interface Transaction {
2882
2905
  blockTime: String
2883
- encoding: String
2906
+ encoding: TransactionEncoding
2884
2907
  meta: TransactionMeta
2885
2908
  slot: BigInt
2886
2909
  version: String
@@ -2889,8 +2912,8 @@ var transactionTypeDefs = (
2889
2912
  # A transaction with base58 encoded data
2890
2913
  type TransactionBase58 implements Transaction {
2891
2914
  blockTime: String
2892
- data: String
2893
- encoding: String
2915
+ data: Base58EncodedBytes
2916
+ encoding: TransactionEncoding
2894
2917
  meta: TransactionMeta
2895
2918
  slot: BigInt
2896
2919
  version: String
@@ -2899,8 +2922,8 @@ var transactionTypeDefs = (
2899
2922
  # A transaction with base64 encoded data
2900
2923
  type TransactionBase64 implements Transaction {
2901
2924
  blockTime: String
2902
- data: String
2903
- encoding: String
2925
+ data: Base64EncodedBytes
2926
+ encoding: TransactionEncoding
2904
2927
  meta: TransactionMeta
2905
2928
  slot: BigInt
2906
2929
  version: String
@@ -2914,7 +2937,7 @@ var transactionTypeDefs = (
2914
2937
  type TransactionParsed implements Transaction {
2915
2938
  blockTime: String
2916
2939
  data: TransactionDataParsed
2917
- encoding: String
2940
+ encoding: TransactionEncoding
2918
2941
  meta: TransactionMeta
2919
2942
  slot: BigInt
2920
2943
  version: String
@@ -2977,16 +3000,16 @@ var schemaTypeDefs = (
2977
3000
  var schemaResolvers = {
2978
3001
  Query: {
2979
3002
  account(_, args, context, info) {
2980
- return context.accountLoader.load(args, info);
3003
+ return context.loaders.account.load(args, info);
2981
3004
  },
2982
3005
  block(_, args, context, info) {
2983
- return context.loadBlock(args, info);
3006
+ return context.loaders.block.load(args, info);
2984
3007
  },
2985
3008
  programAccounts(_, args, context, info) {
2986
- return context.loadProgramAccounts(args, info);
3009
+ return context.loaders.programAccounts.load(args, info);
2987
3010
  },
2988
3011
  transaction(_, args, context, info) {
2989
- return context.loadTransaction(args, info);
3012
+ return context.loaders.transaction.load(args, info);
2990
3013
  }
2991
3014
  }
2992
3015
  };
@@ -3022,14 +3045,12 @@ function createRpcGraphQL(rpc) {
3022
3045
  return {
3023
3046
  context,
3024
3047
  async query(source, variableValues) {
3025
- const result = await graphql({
3048
+ return graphql({
3026
3049
  contextValue: this.context,
3027
3050
  schema: this.schema,
3028
3051
  source,
3029
3052
  variableValues
3030
3053
  });
3031
- this.context.cache.flush();
3032
- return result;
3033
3054
  },
3034
3055
  schema
3035
3056
  };