@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.
@@ -4979,18 +4979,6 @@ const GetParsedTransactionRpcResult = jsonRpcResult(nullable(type({
4979
4979
  version: optional(TransactionVersionStruct)
4980
4980
  })));
4981
4981
 
4982
- /**
4983
- * Expected JSON RPC response for the "getRecentBlockhash" message
4984
- *
4985
- * @deprecated Deprecated since RPC v1.8.0. Please use {@link GetLatestBlockhashRpcResult} instead.
4986
- */
4987
- const GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(type({
4988
- blockhash: string(),
4989
- feeCalculator: type({
4990
- lamportsPerSignature: number()
4991
- })
4992
- }));
4993
-
4994
4982
  /**
4995
4983
  * Expected JSON RPC response for the "getLatestBlockhash" message
4996
4984
  */
@@ -6368,13 +6356,27 @@ class Connection {
6368
6356
  * @deprecated Deprecated since RPC v1.9.0. Please use {@link getLatestBlockhash} instead.
6369
6357
  */
6370
6358
  async getRecentBlockhashAndContext(commitment) {
6371
- const args = this._buildArgs([], commitment);
6372
- const unsafeRes = await this._rpcRequest('getRecentBlockhash', args);
6373
- const res = create(unsafeRes, GetRecentBlockhashAndContextRpcResult);
6374
- if ('error' in res) {
6375
- throw new SolanaJSONRPCError(res.error, 'failed to get recent blockhash');
6376
- }
6377
- return res.result;
6359
+ const {
6360
+ context,
6361
+ value: {
6362
+ blockhash
6363
+ }
6364
+ } = await this.getLatestBlockhashAndContext(commitment);
6365
+ const feeCalculator = {
6366
+ get lamportsPerSignature() {
6367
+ 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.');
6368
+ },
6369
+ toJSON() {
6370
+ return {};
6371
+ }
6372
+ };
6373
+ return {
6374
+ context,
6375
+ value: {
6376
+ blockhash,
6377
+ feeCalculator
6378
+ }
6379
+ };
6378
6380
  }
6379
6381
 
6380
6382
  /**