@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.
@@ -3504,6 +3504,13 @@ const GetInflationRewardResult = jsonRpcResult(array(nullable(type({
3504
3504
  postBalance: number(),
3505
3505
  commission: optional(nullable(number()))
3506
3506
  }))));
3507
+ /**
3508
+ * Expected JSON RPC response for the "getRecentPrioritizationFees" message
3509
+ */
3510
+ const GetRecentPrioritizationFeesResult = array(type({
3511
+ slot: number(),
3512
+ prioritizationFee: number()
3513
+ }));
3507
3514
  /**
3508
3515
  * Expected JSON RPC response for the "getInflationRate" message
3509
3516
  */
@@ -3705,6 +3712,11 @@ const GetInflationGovernorRpcResult = jsonRpcResult(GetInflationGovernorResult);
3705
3712
  */
3706
3713
  const GetInflationRateRpcResult = jsonRpcResult(GetInflationRateResult);
3707
3714
 
3715
+ /**
3716
+ * Expected JSON RPC response for the "getRecentPrioritizationFees" message
3717
+ */
3718
+ const GetRecentPrioritizationFeesRpcResult = jsonRpcResult(GetRecentPrioritizationFeesResult);
3719
+
3708
3720
  /**
3709
3721
  * Expected JSON RPC response for the "getEpochInfo" message
3710
3722
  */
@@ -5602,6 +5614,19 @@ class Connection {
5602
5614
  return res.result;
5603
5615
  }
5604
5616
 
5617
+ /**
5618
+ * Fetch a list of prioritization fees from recent blocks.
5619
+ */
5620
+ async getRecentPrioritizationFees(config) {
5621
+ const accounts = config?.lockedWritableAccounts?.map(key => key.toBase58());
5622
+ const args = this._buildArgs(accounts?.length ? [accounts] : []);
5623
+ const unsafeRes = await this._rpcRequest('getRecentPrioritizationFees', args);
5624
+ const res = create(unsafeRes, GetRecentPrioritizationFeesRpcResult);
5625
+ if ('error' in res) {
5626
+ throw new SolanaJSONRPCError(res.error, 'failed to get recent prioritization fees');
5627
+ }
5628
+ return res.result;
5629
+ }
5605
5630
  /**
5606
5631
  * Fetch a recent blockhash from the cluster
5607
5632
  * @return {Promise<{blockhash: Blockhash, feeCalculator: FeeCalculator}>}