@solana/rpc-graphql 2.0.0-rc.0 → 2.0.0-rc.2

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.
@@ -338,11 +338,7 @@ function createBlockLoader(rpc) {
338
338
  };
339
339
  }
340
340
  async function loadProgramAccounts(rpc, { programAddress, ...config }) {
341
- return await rpc.getProgramAccounts(
342
- programAddress,
343
- // @ts-expect-error FIX ME: https://github.com/microsoft/TypeScript/issues/43187
344
- config
345
- ).send();
341
+ return await rpc.getProgramAccounts(programAddress, config).send();
346
342
  }
347
343
  function createProgramAccountsBatchLoadFn(rpc, config) {
348
344
  const resolveProgramAccountsUsingRpc = loadProgramAccounts.bind(null, rpc);
@@ -2733,7 +2729,8 @@ var rootTypeDefs = (
2733
2729
  programAccounts(
2734
2730
  programAddress: Address!
2735
2731
  commitment: Commitment
2736
- filters: [ProgramAccountsFilter]
2732
+ dataSizeFilters: [ProgramAccountsDataSizeFilter]
2733
+ memcmpFilters: [ProgramAccountsMemcmpFilter]
2737
2734
  minContextSlot: Slot
2738
2735
  ): [Account]
2739
2736
  transaction(signature: Signature!, commitment: CommitmentWithoutProcessed): Transaction
@@ -2867,11 +2864,19 @@ var typeTypeDefs = (
2867
2864
 
2868
2865
  scalar Lamports
2869
2866
 
2870
- input ProgramAccountsFilter {
2871
- bytes: BigInt
2872
- dataSize: BigInt
2873
- encoding: AccountEncoding
2874
- offset: BigInt
2867
+ input ProgramAccountsDataSizeFilter {
2868
+ dataSize: BigInt!
2869
+ }
2870
+
2871
+ enum ProgramAccountsMemcmpFilterAccountEncoding {
2872
+ BASE_58
2873
+ BASE_64
2874
+ }
2875
+
2876
+ input ProgramAccountsMemcmpFilter {
2877
+ bytes: String!
2878
+ encoding: ProgramAccountsMemcmpFilterAccountEncoding!
2879
+ offset: BigInt!
2875
2880
  }
2876
2881
 
2877
2882
  type ReturnData {
@@ -4769,7 +4774,6 @@ function mapJsonParsedInstructions(instructions) {
4769
4774
  function mapJsonParsedInnerInstructions(innerInstructions) {
4770
4775
  return innerInstructions.map(({ index, instructions }) => ({
4771
4776
  index,
4772
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
4773
4777
  instructions: mapJsonParsedInstructions(instructions)
4774
4778
  }));
4775
4779
  }
@@ -4935,8 +4939,22 @@ var resolveBlock = (fieldName) => {
4935
4939
  function resolveProgramAccounts(fieldName) {
4936
4940
  return async (parent, args, context, info) => {
4937
4941
  const programAddress = args.programAddress;
4942
+ let filters = [];
4943
+ if (args.memcmpFilters) {
4944
+ filters.concat(
4945
+ args.memcmpFilters.map((memcmpFilter) => ({
4946
+ memcmp: memcmpFilter
4947
+ }))
4948
+ );
4949
+ }
4950
+ if (args.dataSizeFilters) {
4951
+ filters = filters.concat(args.dataSizeFilters);
4952
+ }
4953
+ if (filters.length === 0) {
4954
+ filters = void 0;
4955
+ }
4938
4956
  if (programAddress) {
4939
- const argsSet = buildProgramAccountsLoaderArgSetFromResolveInfo({ ...args, programAddress }, info);
4957
+ const argsSet = buildProgramAccountsLoaderArgSetFromResolveInfo({ ...args, filters, programAddress }, info);
4940
4958
  const loadedProgramAccountsLists = await context.loaders.programAccounts.loadMany(argsSet);
4941
4959
  const result = {};
4942
4960
  loadedProgramAccountsLists.forEach((programAccounts, i) => {
@@ -5056,6 +5074,10 @@ var typeTypeResolvers = {
5056
5074
  Epoch: bigIntScalarAlias,
5057
5075
  Hash: stringScalarAlias,
5058
5076
  Lamports: bigIntScalarAlias,
5077
+ ProgramAccountsMemcmpFilterAccountEncoding: {
5078
+ BASE_58: "base58",
5079
+ BASE_64: "base64"
5080
+ },
5059
5081
  Signature: stringScalarAlias,
5060
5082
  Slot: bigIntScalarAlias,
5061
5083
  SplTokenDefaultAccountState: {