@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana/web3.js",
3
- "version": "1.97.0",
3
+ "version": "1.98.0",
4
4
  "description": "Solana Javascript API",
5
5
  "keywords": [
6
6
  "api",
package/src/connection.ts CHANGED
@@ -2599,20 +2599,6 @@ const GetParsedTransactionRpcResult = jsonRpcResult(
2599
2599
  ),
2600
2600
  );
2601
2601
 
2602
- /**
2603
- * Expected JSON RPC response for the "getRecentBlockhash" message
2604
- *
2605
- * @deprecated Deprecated since RPC v1.8.0. Please use {@link GetLatestBlockhashRpcResult} instead.
2606
- */
2607
- const GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(
2608
- pick({
2609
- blockhash: string(),
2610
- feeCalculator: pick({
2611
- lamportsPerSignature: number(),
2612
- }),
2613
- }),
2614
- );
2615
-
2616
2602
  /**
2617
2603
  * Expected JSON RPC response for the "getLatestBlockhash" message
2618
2604
  */
@@ -4567,13 +4553,29 @@ export class Connection {
4567
4553
  feeCalculator: FeeCalculator;
4568
4554
  }>
4569
4555
  > {
4570
- const args = this._buildArgs([], commitment);
4571
- const unsafeRes = await this._rpcRequest('getRecentBlockhash', args);
4572
- const res = create(unsafeRes, GetRecentBlockhashAndContextRpcResult);
4573
- if ('error' in res) {
4574
- throw new SolanaJSONRPCError(res.error, 'failed to get recent blockhash');
4575
- }
4576
- return res.result;
4556
+ const {
4557
+ context,
4558
+ value: {blockhash},
4559
+ } = await this.getLatestBlockhashAndContext(commitment);
4560
+ const feeCalculator = {
4561
+ get lamportsPerSignature(): number {
4562
+ throw new Error(
4563
+ 'The capability to fetch `lamportsPerSignature` using the `getRecentBlockhash` API is ' +
4564
+ 'no longer offered by the network. Use the `getFeeForMessage` API to obtain the fee ' +
4565
+ 'for a given message.',
4566
+ );
4567
+ },
4568
+ toJSON() {
4569
+ return {};
4570
+ },
4571
+ };
4572
+ return {
4573
+ context,
4574
+ value: {
4575
+ blockhash,
4576
+ feeCalculator,
4577
+ },
4578
+ };
4577
4579
  }
4578
4580
 
4579
4581
  /**