@solana/web3.js 1.74.1 → 1.75.1

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.
package/lib/index.cjs.js CHANGED
@@ -6057,6 +6057,13 @@ const GetInflationRewardResult = jsonRpcResult(superstruct.array(superstruct.nul
6057
6057
  postBalance: superstruct.number(),
6058
6058
  commission: superstruct.optional(superstruct.nullable(superstruct.number()))
6059
6059
  }))));
6060
+ /**
6061
+ * Expected JSON RPC response for the "getRecentPrioritizationFees" message
6062
+ */
6063
+ const GetRecentPrioritizationFeesResult = superstruct.array(superstruct.type({
6064
+ slot: superstruct.number(),
6065
+ prioritizationFee: superstruct.number()
6066
+ }));
6060
6067
  /**
6061
6068
  * Expected JSON RPC response for the "getInflationRate" message
6062
6069
  */
@@ -6281,6 +6288,11 @@ const GetInflationGovernorRpcResult = jsonRpcResult(GetInflationGovernorResult);
6281
6288
  */
6282
6289
  const GetInflationRateRpcResult = jsonRpcResult(GetInflationRateResult);
6283
6290
 
6291
+ /**
6292
+ * Expected JSON RPC response for the "getRecentPrioritizationFees" message
6293
+ */
6294
+ const GetRecentPrioritizationFeesRpcResult = jsonRpcResult(GetRecentPrioritizationFeesResult);
6295
+
6284
6296
  /**
6285
6297
  * Expected JSON RPC response for the "getEpochInfo" message
6286
6298
  */
@@ -6972,7 +6984,7 @@ const LogsNotificationResult = superstruct.type({
6972
6984
 
6973
6985
  /** @internal */
6974
6986
  const COMMON_HTTP_HEADERS = {
6975
- 'solana-client': `js/${"1.74.1" }`
6987
+ 'solana-client': `js/${"1.75.1" }`
6976
6988
  };
6977
6989
 
6978
6990
  /**
@@ -8178,6 +8190,19 @@ class Connection {
8178
8190
  return res.result;
8179
8191
  }
8180
8192
 
8193
+ /**
8194
+ * Fetch a list of prioritization fees from recent blocks.
8195
+ */
8196
+ async getRecentPrioritizationFees(config) {
8197
+ const accounts = config?.lockedWritableAccounts?.map(key => key.toBase58());
8198
+ const args = this._buildArgs(accounts?.length ? [accounts] : []);
8199
+ const unsafeRes = await this._rpcRequest('getRecentPrioritizationFees', args);
8200
+ const res = superstruct.create(unsafeRes, GetRecentPrioritizationFeesRpcResult);
8201
+ if ('error' in res) {
8202
+ throw new SolanaJSONRPCError(res.error, 'failed to get recent prioritization fees');
8203
+ }
8204
+ return res.result;
8205
+ }
8181
8206
  /**
8182
8207
  * Fetch a recent blockhash from the cluster
8183
8208
  * @return {Promise<{blockhash: Blockhash, feeCalculator: FeeCalculator}>}