@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.
@@ -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
  /**
@@ -6933,7 +6935,7 @@ class Connection {
6933
6935
  */
6934
6936
  async getConfirmedTransaction(signature, commitment) {
6935
6937
  const args = this._buildArgsAtLeastConfirmed([signature], commitment);
6936
- const unsafeRes = await this._rpcRequest('getConfirmedTransaction', args);
6938
+ const unsafeRes = await this._rpcRequest('getTransaction', args);
6937
6939
  const res = create(unsafeRes, GetTransactionRpcResult);
6938
6940
  if ('error' in res) {
6939
6941
  throw new SolanaJSONRPCError(res.error, 'failed to get transaction');
@@ -6955,7 +6957,7 @@ class Connection {
6955
6957
  */
6956
6958
  async getParsedConfirmedTransaction(signature, commitment) {
6957
6959
  const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');
6958
- const unsafeRes = await this._rpcRequest('getConfirmedTransaction', args);
6960
+ const unsafeRes = await this._rpcRequest('getTransaction', args);
6959
6961
  const res = create(unsafeRes, GetParsedTransactionRpcResult);
6960
6962
  if ('error' in res) {
6961
6963
  throw new SolanaJSONRPCError(res.error, 'failed to get confirmed transaction');
@@ -6972,7 +6974,7 @@ class Connection {
6972
6974
  const batch = signatures.map(signature => {
6973
6975
  const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');
6974
6976
  return {
6975
- methodName: 'getConfirmedTransaction',
6977
+ methodName: 'getTransaction',
6976
6978
  args
6977
6979
  };
6978
6980
  });