@solana/web3.js 1.95.0 → 1.95.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.
@@ -3804,6 +3804,19 @@ function extractCommitmentFromConfig(commitmentOrConfig) {
3804
3804
  };
3805
3805
  }
3806
3806
 
3807
+ /**
3808
+ * @internal
3809
+ */
3810
+ function applyDefaultMemcmpEncodingToFilters(filters) {
3811
+ return filters.map(filter => 'memcmp' in filter ? {
3812
+ ...filter,
3813
+ memcmp: {
3814
+ ...filter.memcmp,
3815
+ encoding: filter.memcmp.encoding ?? 'base58'
3816
+ }
3817
+ } : filter);
3818
+ }
3819
+
3807
3820
  /**
3808
3821
  * @internal
3809
3822
  */
@@ -5217,7 +5230,7 @@ const LogsNotificationResult = superstruct.type({
5217
5230
 
5218
5231
  /** @internal */
5219
5232
  const COMMON_HTTP_HEADERS = {
5220
- 'solana-client': `js/${"0.0.0-development" }`
5233
+ 'solana-client': `js/${"0.0.0-development"}`
5221
5234
  };
5222
5235
 
5223
5236
  /**
@@ -5711,7 +5724,12 @@ class Connection {
5711
5724
  encoding,
5712
5725
  ...configWithoutEncoding
5713
5726
  } = config || {};
5714
- const args = this._buildArgs([programId.toBase58()], commitment, encoding || 'base64', configWithoutEncoding);
5727
+ const args = this._buildArgs([programId.toBase58()], commitment, encoding || 'base64', {
5728
+ ...configWithoutEncoding,
5729
+ ...(configWithoutEncoding.filters ? {
5730
+ filters: applyDefaultMemcmpEncodingToFilters(configWithoutEncoding.filters)
5731
+ } : null)
5732
+ });
5715
5733
  const unsafeRes = await this._rpcRequest('getProgramAccounts', args);
5716
5734
  const baseSchema = superstruct.array(KeyedAccountInfoResult);
5717
5735
  const res = configWithoutEncoding.withContext === true ? superstruct.create(unsafeRes, jsonRpcResultAndContext(baseSchema)) : superstruct.create(unsafeRes, jsonRpcResult(baseSchema));
@@ -7860,7 +7878,7 @@ class Connection {
7860
7878
  const args = this._buildArgs([programId.toBase58()], commitment || this._commitment || 'finalized',
7861
7879
  // Apply connection/server default.
7862
7880
  'base64' /* encoding */, config ? config : maybeFilters ? {
7863
- filters: maybeFilters
7881
+ filters: applyDefaultMemcmpEncodingToFilters(maybeFilters)
7864
7882
  } : undefined /* extra */);
7865
7883
  return this._makeSubscription({
7866
7884
  callback,