@solana/web3.js 1.96.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
  /**
@@ -20806,7 +20808,7 @@ var solanaWeb3 = (function (exports) {
20806
20808
  */
20807
20809
  async getConfirmedTransaction(signature, commitment) {
20808
20810
  const args = this._buildArgsAtLeastConfirmed([signature], commitment);
20809
- const unsafeRes = await this._rpcRequest('getConfirmedTransaction', args);
20811
+ const unsafeRes = await this._rpcRequest('getTransaction', args);
20810
20812
  const res = create(unsafeRes, GetTransactionRpcResult);
20811
20813
  if ('error' in res) {
20812
20814
  throw new SolanaJSONRPCError(res.error, 'failed to get transaction');
@@ -20828,7 +20830,7 @@ var solanaWeb3 = (function (exports) {
20828
20830
  */
20829
20831
  async getParsedConfirmedTransaction(signature, commitment) {
20830
20832
  const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');
20831
- const unsafeRes = await this._rpcRequest('getConfirmedTransaction', args);
20833
+ const unsafeRes = await this._rpcRequest('getTransaction', args);
20832
20834
  const res = create(unsafeRes, GetParsedTransactionRpcResult);
20833
20835
  if ('error' in res) {
20834
20836
  throw new SolanaJSONRPCError(res.error, 'failed to get confirmed transaction');
@@ -20845,7 +20847,7 @@ var solanaWeb3 = (function (exports) {
20845
20847
  const batch = signatures.map(signature => {
20846
20848
  const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');
20847
20849
  return {
20848
- methodName: 'getConfirmedTransaction',
20850
+ methodName: 'getTransaction',
20849
20851
  args
20850
20852
  };
20851
20853
  });