@solana/web3.js 1.97.0 → 1.98.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.
@@ -5005,18 +5005,6 @@ const GetParsedTransactionRpcResult = jsonRpcResult(superstruct.nullable(superst
5005
5005
  version: superstruct.optional(TransactionVersionStruct)
5006
5006
  })));
5007
5007
 
5008
- /**
5009
- * Expected JSON RPC response for the "getRecentBlockhash" message
5010
- *
5011
- * @deprecated Deprecated since RPC v1.8.0. Please use {@link GetLatestBlockhashRpcResult} instead.
5012
- */
5013
- const GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(superstruct.type({
5014
- blockhash: superstruct.string(),
5015
- feeCalculator: superstruct.type({
5016
- lamportsPerSignature: superstruct.number()
5017
- })
5018
- }));
5019
-
5020
5008
  /**
5021
5009
  * Expected JSON RPC response for the "getLatestBlockhash" message
5022
5010
  */
@@ -6394,13 +6382,27 @@ class Connection {
6394
6382
  * @deprecated Deprecated since RPC v1.9.0. Please use {@link getLatestBlockhash} instead.
6395
6383
  */
6396
6384
  async getRecentBlockhashAndContext(commitment) {
6397
- const args = this._buildArgs([], commitment);
6398
- const unsafeRes = await this._rpcRequest('getRecentBlockhash', args);
6399
- const res = superstruct.create(unsafeRes, GetRecentBlockhashAndContextRpcResult);
6400
- if ('error' in res) {
6401
- throw new SolanaJSONRPCError(res.error, 'failed to get recent blockhash');
6402
- }
6403
- return res.result;
6385
+ const {
6386
+ context,
6387
+ value: {
6388
+ blockhash
6389
+ }
6390
+ } = await this.getLatestBlockhashAndContext(commitment);
6391
+ const feeCalculator = {
6392
+ get lamportsPerSignature() {
6393
+ throw new Error('The capability to fetch `lamportsPerSignature` using the `getRecentBlockhash` API is ' + 'no longer offered by the network. Use the `getFeeForMessage` API to obtain the fee ' + 'for a given message.');
6394
+ },
6395
+ toJSON() {
6396
+ return {};
6397
+ }
6398
+ };
6399
+ return {
6400
+ context,
6401
+ value: {
6402
+ blockhash,
6403
+ feeCalculator
6404
+ }
6405
+ };
6404
6406
  }
6405
6407
 
6406
6408
  /**