@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.
package/lib/index.iife.js CHANGED
@@ -18852,18 +18852,6 @@ var solanaWeb3 = (function (exports) {
18852
18852
  version: optional(TransactionVersionStruct)
18853
18853
  })));
18854
18854
 
18855
- /**
18856
- * Expected JSON RPC response for the "getRecentBlockhash" message
18857
- *
18858
- * @deprecated Deprecated since RPC v1.8.0. Please use {@link GetLatestBlockhashRpcResult} instead.
18859
- */
18860
- const GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(type({
18861
- blockhash: string(),
18862
- feeCalculator: type({
18863
- lamportsPerSignature: number()
18864
- })
18865
- }));
18866
-
18867
18855
  /**
18868
18856
  * Expected JSON RPC response for the "getLatestBlockhash" message
18869
18857
  */
@@ -20241,13 +20229,27 @@ var solanaWeb3 = (function (exports) {
20241
20229
  * @deprecated Deprecated since RPC v1.9.0. Please use {@link getLatestBlockhash} instead.
20242
20230
  */
20243
20231
  async getRecentBlockhashAndContext(commitment) {
20244
- const args = this._buildArgs([], commitment);
20245
- const unsafeRes = await this._rpcRequest('getRecentBlockhash', args);
20246
- const res = create(unsafeRes, GetRecentBlockhashAndContextRpcResult);
20247
- if ('error' in res) {
20248
- throw new SolanaJSONRPCError(res.error, 'failed to get recent blockhash');
20249
- }
20250
- return res.result;
20232
+ const {
20233
+ context,
20234
+ value: {
20235
+ blockhash
20236
+ }
20237
+ } = await this.getLatestBlockhashAndContext(commitment);
20238
+ const feeCalculator = {
20239
+ get lamportsPerSignature() {
20240
+ 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.');
20241
+ },
20242
+ toJSON() {
20243
+ return {};
20244
+ }
20245
+ };
20246
+ return {
20247
+ context,
20248
+ value: {
20249
+ blockhash,
20250
+ feeCalculator
20251
+ }
20252
+ };
20251
20253
  }
20252
20254
 
20253
20255
  /**