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