@solana/web3.js 1.74.0 → 1.75.0

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.
@@ -3536,6 +3536,13 @@ const GetInflationRewardResult = jsonRpcResult(superstruct.array(superstruct.nul
3536
3536
  postBalance: superstruct.number(),
3537
3537
  commission: superstruct.optional(superstruct.nullable(superstruct.number()))
3538
3538
  }))));
3539
+ /**
3540
+ * Expected JSON RPC response for the "getRecentPrioritizationFees" message
3541
+ */
3542
+ const GetRecentPrioritizationFeesResult = superstruct.array(superstruct.type({
3543
+ slot: superstruct.number(),
3544
+ prioritizationFee: superstruct.number()
3545
+ }));
3539
3546
  /**
3540
3547
  * Expected JSON RPC response for the "getInflationRate" message
3541
3548
  */
@@ -3737,6 +3744,11 @@ const GetInflationGovernorRpcResult = jsonRpcResult(GetInflationGovernorResult);
3737
3744
  */
3738
3745
  const GetInflationRateRpcResult = jsonRpcResult(GetInflationRateResult);
3739
3746
 
3747
+ /**
3748
+ * Expected JSON RPC response for the "getRecentPrioritizationFees" message
3749
+ */
3750
+ const GetRecentPrioritizationFeesRpcResult = jsonRpcResult(GetRecentPrioritizationFeesResult);
3751
+
3740
3752
  /**
3741
3753
  * Expected JSON RPC response for the "getEpochInfo" message
3742
3754
  */
@@ -5634,6 +5646,19 @@ class Connection {
5634
5646
  return res.result;
5635
5647
  }
5636
5648
 
5649
+ /**
5650
+ * Fetch a list of prioritization fees from recent blocks.
5651
+ */
5652
+ async getRecentPrioritizationFees(config) {
5653
+ const accounts = config?.lockedWritableAccounts?.map(key => key.toBase58());
5654
+ const args = this._buildArgs(accounts?.length ? [accounts] : []);
5655
+ const unsafeRes = await this._rpcRequest('getRecentPrioritizationFees', args);
5656
+ const res = superstruct.create(unsafeRes, GetRecentPrioritizationFeesRpcResult);
5657
+ if ('error' in res) {
5658
+ throw new SolanaJSONRPCError(res.error, 'failed to get recent prioritization fees');
5659
+ }
5660
+ return res.result;
5661
+ }
5637
5662
  /**
5638
5663
  * Fetch a recent blockhash from the cluster
5639
5664
  * @return {Promise<{blockhash: Blockhash, feeCalculator: FeeCalculator}>}