@solana/web3.js 1.32.0 → 1.32.1

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.d.ts CHANGED
@@ -535,6 +535,8 @@ declare module '@solana/web3.js' {
535
535
  skipPreflight?: boolean;
536
536
  /** preflight commitment level */
537
537
  preflightCommitment?: Commitment;
538
+ /** Maximum number of times for the RPC node to retry sending the transaction to the leader. */
539
+ maxRetries?: number;
538
540
  };
539
541
  /**
540
542
  * Options for confirming transactions
@@ -546,6 +548,8 @@ declare module '@solana/web3.js' {
546
548
  commitment?: Commitment;
547
549
  /** preflight commitment level */
548
550
  preflightCommitment?: Commitment;
551
+ /** Maximum number of times for the RPC node to retry sending the transaction to the leader. */
552
+ maxRetries?: number;
549
553
  };
550
554
  /**
551
555
  * Options for getConfirmedSignaturesForAddress2
@@ -765,8 +769,14 @@ declare module '@solana/web3.js' {
765
769
  };
766
770
  /**
767
771
  * Metadata for a parsed confirmed transaction on the ledger
772
+ *
773
+ * @deprecated Deprecated since Solana v1.8.0. Please use {@link ParsedTransactionMeta} instead.
774
+ */
775
+ export type ParsedConfirmedTransactionMeta = ParsedTransactionMeta;
776
+ /**
777
+ * Metadata for a parsed transaction on the ledger
768
778
  */
769
- export type ParsedConfirmedTransactionMeta = {
779
+ export type ParsedTransactionMeta = {
770
780
  /** The fee charged for processing the transaction */
771
781
  fee: number;
772
782
  /** An array of cross program invoked parsed instructions */
@@ -895,14 +905,20 @@ declare module '@solana/web3.js' {
895
905
  };
896
906
  /**
897
907
  * A parsed and confirmed transaction on the ledger
908
+ *
909
+ * @deprecated Deprecated since Solana v1.8.0. Please use {@link ParsedTransactionWithMeta} instead.
910
+ */
911
+ export type ParsedConfirmedTransaction = ParsedTransactionWithMeta;
912
+ /**
913
+ * A parsed transaction on the ledger with meta
898
914
  */
899
- export type ParsedConfirmedTransaction = {
915
+ export type ParsedTransactionWithMeta = {
900
916
  /** The slot during which the transaction was processed */
901
917
  slot: number;
902
918
  /** The details of the transaction */
903
919
  transaction: ParsedTransaction;
904
920
  /** Metadata produced from the transaction */
905
- meta: ParsedConfirmedTransactionMeta | null;
921
+ meta: ParsedTransactionMeta | null;
906
922
  /** The unix timestamp of when the transaction was processed */
907
923
  blockTime?: number | null;
908
924
  };
@@ -968,9 +984,9 @@ declare module '@solana/web3.js' {
968
984
  blockTime: number | null;
969
985
  };
970
986
  /**
971
- * A ConfirmedBlock on the ledger with signatures only
987
+ * A Block on the ledger with signatures only
972
988
  */
973
- export type ConfirmedBlockSignatures = {
989
+ export type BlockSignatures = {
974
990
  /** Blockhash of this block */
975
991
  blockhash: Blockhash;
976
992
  /** Blockhash of this block's parent */
@@ -1644,6 +1660,8 @@ declare module '@solana/web3.js' {
1644
1660
  /**
1645
1661
  * Fetch a recent blockhash from the cluster, return with context
1646
1662
  * @return {Promise<RpcResponseAndContext<{blockhash: Blockhash, feeCalculator: FeeCalculator}>>}
1663
+ *
1664
+ * @deprecated Deprecated since Solana v1.8.0. Please use {@link getLatestBlockhash} instead.
1647
1665
  */
1648
1666
  getRecentBlockhashAndContext(commitment?: Commitment): Promise<
1649
1667
  RpcResponseAndContext<{
@@ -1658,6 +1676,8 @@ declare module '@solana/web3.js' {
1658
1676
  getRecentPerformanceSamples(limit?: number): Promise<Array<PerfSample>>;
1659
1677
  /**
1660
1678
  * Fetch the fee calculator for a recent blockhash from the cluster, return with context
1679
+ *
1680
+ * @deprecated Deprecated since Solana v1.8.0. Please use {@link getFeeForMessage} instead.
1661
1681
  */
1662
1682
  getFeeCalculatorForBlockhash(
1663
1683
  blockhash: Blockhash,
@@ -1673,11 +1693,31 @@ declare module '@solana/web3.js' {
1673
1693
  /**
1674
1694
  * Fetch a recent blockhash from the cluster
1675
1695
  * @return {Promise<{blockhash: Blockhash, feeCalculator: FeeCalculator}>}
1696
+ *
1697
+ * @deprecated Deprecated since Solana v1.8.0. Please use {@link getLatestBlockhash} instead.
1676
1698
  */
1677
1699
  getRecentBlockhash(commitment?: Commitment): Promise<{
1678
1700
  blockhash: Blockhash;
1679
1701
  feeCalculator: FeeCalculator;
1680
1702
  }>;
1703
+ /**
1704
+ * Fetch the latest blockhash from the cluster
1705
+ * @return {Promise<{blockhash: Blockhash, lastValidBlockHeight: number}>}
1706
+ */
1707
+ getLatestBlockhash(commitment?: Commitment): Promise<{
1708
+ blockhash: Blockhash;
1709
+ lastValidBlockHeight: number;
1710
+ }>;
1711
+ /**
1712
+ * Fetch the latest blockhash from the cluster
1713
+ * @return {Promise<{blockhash: Blockhash, lastValidBlockHeight: number}>}
1714
+ */
1715
+ getLatestBlockhashAndContext(commitment?: Commitment): Promise<
1716
+ RpcResponseAndContext<{
1717
+ blockhash: Blockhash;
1718
+ lastValidBlockHeight: number;
1719
+ }>
1720
+ >;
1681
1721
  /**
1682
1722
  * Fetch the node version
1683
1723
  */
@@ -1696,7 +1736,7 @@ declare module '@solana/web3.js' {
1696
1736
  },
1697
1737
  ): Promise<BlockResponse | null>;
1698
1738
  /**
1699
- * Fetch a processed transaction from the cluster.
1739
+ * Fetch a confirmed or finalized transaction from the cluster.
1700
1740
  */
1701
1741
  getTransaction(
1702
1742
  signature: string,
@@ -1704,6 +1744,20 @@ declare module '@solana/web3.js' {
1704
1744
  commitment?: Finality;
1705
1745
  },
1706
1746
  ): Promise<TransactionResponse | null>;
1747
+ /**
1748
+ * Fetch parsed transaction details for a confirmed or finalized transaction
1749
+ */
1750
+ getParsedTransaction(
1751
+ signature: TransactionSignature,
1752
+ commitment?: Finality,
1753
+ ): Promise<ParsedConfirmedTransaction | null>;
1754
+ /**
1755
+ * Fetch parsed transaction details for a batch of confirmed transactions
1756
+ */
1757
+ getParsedTransactions(
1758
+ signatures: TransactionSignature[],
1759
+ commitment?: Finality,
1760
+ ): Promise<(ParsedConfirmedTransaction | null)[]>;
1707
1761
  /**
1708
1762
  * Fetch a list of Transactions and transaction statuses from the cluster
1709
1763
  * for a confirmed block.
@@ -1722,15 +1776,26 @@ declare module '@solana/web3.js' {
1722
1776
  endSlot?: number,
1723
1777
  commitment?: Finality,
1724
1778
  ): Promise<Array<number>>;
1779
+ /**
1780
+ * Fetch a list of Signatures from the cluster for a block, excluding rewards
1781
+ */
1782
+ getBlockSignatures(
1783
+ slot: number,
1784
+ commitment?: Finality,
1785
+ ): Promise<BlockSignatures>;
1725
1786
  /**
1726
1787
  * Fetch a list of Signatures from the cluster for a confirmed block, excluding rewards
1788
+ *
1789
+ * @deprecated Deprecated since Solana v1.8.0. Please use {@link getBlockSignatures} instead.
1727
1790
  */
1728
1791
  getConfirmedBlockSignatures(
1729
1792
  slot: number,
1730
1793
  commitment?: Finality,
1731
- ): Promise<ConfirmedBlockSignatures>;
1794
+ ): Promise<BlockSignatures>;
1732
1795
  /**
1733
1796
  * Fetch a transaction details for a confirmed transaction
1797
+ *
1798
+ * @deprecated Deprecated since Solana v1.8.0. Please use {@link getTransaction} instead.
1734
1799
  */
1735
1800
  getConfirmedTransaction(
1736
1801
  signature: TransactionSignature,
@@ -1738,6 +1803,8 @@ declare module '@solana/web3.js' {
1738
1803
  ): Promise<ConfirmedTransaction | null>;
1739
1804
  /**
1740
1805
  * Fetch parsed transaction details for a confirmed transaction
1806
+ *
1807
+ * @deprecated Deprecated since Solana v1.8.0. Please use {@link getParsedTransaction} instead.
1741
1808
  */
1742
1809
  getParsedConfirmedTransaction(
1743
1810
  signature: TransactionSignature,
@@ -1745,6 +1812,8 @@ declare module '@solana/web3.js' {
1745
1812
  ): Promise<ParsedConfirmedTransaction | null>;
1746
1813
  /**
1747
1814
  * Fetch parsed transaction details for a batch of confirmed transactions
1815
+ *
1816
+ * @deprecated Deprecated since Solana v1.8.0. Please use {@link getParsedTransactions} instead.
1748
1817
  */
1749
1818
  getParsedConfirmedTransactions(
1750
1819
  signatures: TransactionSignature[],
package/lib/index.esm.js CHANGED
@@ -2929,7 +2929,8 @@ const SYSVAR_STAKE_HISTORY_PUBKEY = new PublicKey('SysvarStakeHistory11111111111
2929
2929
  async function sendAndConfirmTransaction(connection, transaction, signers, options) {
2930
2930
  const sendOptions = options && {
2931
2931
  skipPreflight: options.skipPreflight,
2932
- preflightCommitment: options.preflightCommitment || options.commitment
2932
+ preflightCommitment: options.preflightCommitment || options.commitment,
2933
+ maxRetries: options.maxRetries
2933
2934
  };
2934
2935
  const signature = await connection.sendTransaction(transaction, signers, sendOptions);
2935
2936
  const status = (await connection.confirmTransaction(signature, options && options.commitment)).value;
@@ -4874,8 +4875,31 @@ const ParsedConfirmedTransactionMetaResult = type({
4874
4875
  preTokenBalances: optional(nullable(array(TokenBalanceResult))),
4875
4876
  postTokenBalances: optional(nullable(array(TokenBalanceResult)))
4876
4877
  });
4878
+ /**
4879
+ * Expected JSON RPC response for the "getBlock" message
4880
+ */
4881
+
4882
+ const GetBlockRpcResult = jsonRpcResult(nullable(type({
4883
+ blockhash: string(),
4884
+ previousBlockhash: string(),
4885
+ parentSlot: number(),
4886
+ transactions: array(type({
4887
+ transaction: ConfirmedTransactionResult,
4888
+ meta: nullable(ConfirmedTransactionMetaResult)
4889
+ })),
4890
+ rewards: optional(array(type({
4891
+ pubkey: string(),
4892
+ lamports: number(),
4893
+ postBalance: nullable(number()),
4894
+ rewardType: nullable(string())
4895
+ }))),
4896
+ blockTime: nullable(number()),
4897
+ blockHeight: nullable(number())
4898
+ })));
4877
4899
  /**
4878
4900
  * Expected JSON RPC response for the "getConfirmedBlock" message
4901
+ *
4902
+ * @deprecated Deprecated since Solana v1.8.0. Please use {@link GetBlockRpcResult} instead.
4879
4903
  */
4880
4904
 
4881
4905
  const GetConfirmedBlockRpcResult = jsonRpcResult(nullable(type({
@@ -4895,10 +4919,10 @@ const GetConfirmedBlockRpcResult = jsonRpcResult(nullable(type({
4895
4919
  blockTime: nullable(number())
4896
4920
  })));
4897
4921
  /**
4898
- * Expected JSON RPC response for the "getConfirmedBlockSignatures" message
4922
+ * Expected JSON RPC response for the "getBlock" message
4899
4923
  */
4900
4924
 
4901
- const GetConfirmedBlockSignaturesRpcResult = jsonRpcResult(nullable(type({
4925
+ const GetBlockSignaturesRpcResult = jsonRpcResult(nullable(type({
4902
4926
  blockhash: string(),
4903
4927
  previousBlockhash: string(),
4904
4928
  parentSlot: number(),
@@ -4906,20 +4930,20 @@ const GetConfirmedBlockSignaturesRpcResult = jsonRpcResult(nullable(type({
4906
4930
  blockTime: nullable(number())
4907
4931
  })));
4908
4932
  /**
4909
- * Expected JSON RPC response for the "getConfirmedTransaction" message
4933
+ * Expected JSON RPC response for the "getTransaction" message
4910
4934
  */
4911
4935
 
4912
- const GetConfirmedTransactionRpcResult = jsonRpcResult(nullable(type({
4936
+ const GetTransactionRpcResult = jsonRpcResult(nullable(type({
4913
4937
  slot: number(),
4914
4938
  meta: ConfirmedTransactionMetaResult,
4915
4939
  blockTime: optional(nullable(number())),
4916
4940
  transaction: ConfirmedTransactionResult
4917
4941
  })));
4918
4942
  /**
4919
- * Expected JSON RPC response for the "getConfirmedTransaction" message
4943
+ * Expected parsed JSON RPC response for the "getTransaction" message
4920
4944
  */
4921
4945
 
4922
- const GetParsedConfirmedTransactionRpcResult = jsonRpcResult(nullable(type({
4946
+ const GetParsedTransactionRpcResult = jsonRpcResult(nullable(type({
4923
4947
  slot: number(),
4924
4948
  transaction: ParsedConfirmedTransactionResult,
4925
4949
  meta: nullable(ParsedConfirmedTransactionMetaResult),
@@ -4927,6 +4951,8 @@ const GetParsedConfirmedTransactionRpcResult = jsonRpcResult(nullable(type({
4927
4951
  })));
4928
4952
  /**
4929
4953
  * Expected JSON RPC response for the "getRecentBlockhash" message
4954
+ *
4955
+ * @deprecated Deprecated since Solana v1.8.0. Please use {@link GetLatestBlockhashRpcResult} instead.
4930
4956
  */
4931
4957
 
4932
4958
  const GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(type({
@@ -4935,6 +4961,14 @@ const GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(type({
4935
4961
  lamportsPerSignature: number()
4936
4962
  })
4937
4963
  }));
4964
+ /**
4965
+ * Expected JSON RPC response for the "getLatestBlockhash" message
4966
+ */
4967
+
4968
+ const GetLatestBlockhashRpcResult = jsonRpcResultAndContext(type({
4969
+ blockhash: string(),
4970
+ lastValidBlockHeight: number()
4971
+ }));
4938
4972
  const PerfSampleResult = type({
4939
4973
  slot: number(),
4940
4974
  numTransactions: number(),
@@ -5879,6 +5913,8 @@ class Connection {
5879
5913
  /**
5880
5914
  * Fetch a recent blockhash from the cluster, return with context
5881
5915
  * @return {Promise<RpcResponseAndContext<{blockhash: Blockhash, feeCalculator: FeeCalculator}>>}
5916
+ *
5917
+ * @deprecated Deprecated since Solana v1.8.0. Please use {@link getLatestBlockhash} instead.
5882
5918
  */
5883
5919
 
5884
5920
 
@@ -5914,6 +5950,8 @@ class Connection {
5914
5950
  }
5915
5951
  /**
5916
5952
  * Fetch the fee calculator for a recent blockhash from the cluster, return with context
5953
+ *
5954
+ * @deprecated Deprecated since Solana v1.8.0. Please use {@link getFeeForMessage} instead.
5917
5955
  */
5918
5956
 
5919
5957
 
@@ -5962,6 +6000,8 @@ class Connection {
5962
6000
  /**
5963
6001
  * Fetch a recent blockhash from the cluster
5964
6002
  * @return {Promise<{blockhash: Blockhash, feeCalculator: FeeCalculator}>}
6003
+ *
6004
+ * @deprecated Deprecated since Solana v1.8.0. Please use {@link getLatestBlockhash} instead.
5965
6005
  */
5966
6006
 
5967
6007
 
@@ -5973,6 +6013,38 @@ class Connection {
5973
6013
  throw new Error('failed to get recent blockhash: ' + e);
5974
6014
  }
5975
6015
  }
6016
+ /**
6017
+ * Fetch the latest blockhash from the cluster
6018
+ * @return {Promise<{blockhash: Blockhash, lastValidBlockHeight: number}>}
6019
+ */
6020
+
6021
+
6022
+ async getLatestBlockhash(commitment) {
6023
+ try {
6024
+ const res = await this.getLatestBlockhashAndContext(commitment);
6025
+ return res.value;
6026
+ } catch (e) {
6027
+ throw new Error('failed to get recent blockhash: ' + e);
6028
+ }
6029
+ }
6030
+ /**
6031
+ * Fetch the latest blockhash from the cluster
6032
+ * @return {Promise<{blockhash: Blockhash, lastValidBlockHeight: number}>}
6033
+ */
6034
+
6035
+
6036
+ async getLatestBlockhashAndContext(commitment) {
6037
+ const args = this._buildArgs([], commitment);
6038
+
6039
+ const unsafeRes = await this._rpcRequest('getLatestBlockhash', args);
6040
+ const res = create(unsafeRes, GetLatestBlockhashRpcResult);
6041
+
6042
+ if ('error' in res) {
6043
+ throw new Error('failed to get latest blockhash: ' + res.error.message);
6044
+ }
6045
+
6046
+ return res.result;
6047
+ }
5976
6048
  /**
5977
6049
  * Fetch the node version
5978
6050
  */
@@ -6011,8 +6083,8 @@ class Connection {
6011
6083
  async getBlock(slot, opts) {
6012
6084
  const args = this._buildArgsAtLeastConfirmed([slot], opts && opts.commitment);
6013
6085
 
6014
- const unsafeRes = await this._rpcRequest('getConfirmedBlock', args);
6015
- const res = create(unsafeRes, GetConfirmedBlockRpcResult);
6086
+ const unsafeRes = await this._rpcRequest('getBlock', args);
6087
+ const res = create(unsafeRes, GetBlockRpcResult);
6016
6088
 
6017
6089
  if ('error' in res) {
6018
6090
  throw new Error('failed to get confirmed block: ' + res.error.message);
@@ -6036,18 +6108,18 @@ class Connection {
6036
6108
  };
6037
6109
  }
6038
6110
  /**
6039
- * Fetch a processed transaction from the cluster.
6111
+ * Fetch a confirmed or finalized transaction from the cluster.
6040
6112
  */
6041
6113
 
6042
6114
 
6043
6115
  async getTransaction(signature, opts) {
6044
6116
  const args = this._buildArgsAtLeastConfirmed([signature], opts && opts.commitment);
6045
6117
 
6046
- const unsafeRes = await this._rpcRequest('getConfirmedTransaction', args);
6047
- const res = create(unsafeRes, GetConfirmedTransactionRpcResult);
6118
+ const unsafeRes = await this._rpcRequest('getTransaction', args);
6119
+ const res = create(unsafeRes, GetTransactionRpcResult);
6048
6120
 
6049
6121
  if ('error' in res) {
6050
- throw new Error('failed to get confirmed transaction: ' + res.error.message);
6122
+ throw new Error('failed to get transaction: ' + res.error.message);
6051
6123
  }
6052
6124
 
6053
6125
  const result = res.result;
@@ -6058,6 +6130,49 @@ class Connection {
6058
6130
  }
6059
6131
  };
6060
6132
  }
6133
+ /**
6134
+ * Fetch parsed transaction details for a confirmed or finalized transaction
6135
+ */
6136
+
6137
+
6138
+ async getParsedTransaction(signature, commitment) {
6139
+ const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');
6140
+
6141
+ const unsafeRes = await this._rpcRequest('getTransaction', args);
6142
+ const res = create(unsafeRes, GetParsedTransactionRpcResult);
6143
+
6144
+ if ('error' in res) {
6145
+ throw new Error('failed to get transaction: ' + res.error.message);
6146
+ }
6147
+
6148
+ return res.result;
6149
+ }
6150
+ /**
6151
+ * Fetch parsed transaction details for a batch of confirmed transactions
6152
+ */
6153
+
6154
+
6155
+ async getParsedTransactions(signatures, commitment) {
6156
+ const batch = signatures.map(signature => {
6157
+ const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');
6158
+
6159
+ return {
6160
+ methodName: 'getTransaction',
6161
+ args
6162
+ };
6163
+ });
6164
+ const unsafeRes = await this._rpcBatchRequest(batch);
6165
+ const res = unsafeRes.map(unsafeRes => {
6166
+ const res = create(unsafeRes, GetParsedTransactionRpcResult);
6167
+
6168
+ if ('error' in res) {
6169
+ throw new Error('failed to get transactions: ' + res.error.message);
6170
+ }
6171
+
6172
+ return res.result;
6173
+ });
6174
+ return res;
6175
+ }
6061
6176
  /**
6062
6177
  * Fetch a list of Transactions and transaction statuses from the cluster
6063
6178
  * for a confirmed block.
@@ -6067,18 +6182,39 @@ class Connection {
6067
6182
 
6068
6183
 
6069
6184
  async getConfirmedBlock(slot, commitment) {
6070
- const result = await this.getBlock(slot, {
6071
- commitment
6072
- });
6185
+ const args = this._buildArgsAtLeastConfirmed([slot], commitment);
6186
+
6187
+ const unsafeRes = await this._rpcRequest('getConfirmedBlock', args);
6188
+ const res = create(unsafeRes, GetConfirmedBlockRpcResult);
6189
+
6190
+ if ('error' in res) {
6191
+ throw new Error('failed to get confirmed block: ' + res.error.message);
6192
+ }
6193
+
6194
+ const result = res.result;
6073
6195
 
6074
6196
  if (!result) {
6075
6197
  throw new Error('Confirmed block ' + slot + ' not found');
6076
6198
  }
6077
6199
 
6078
- return { ...result,
6200
+ const block = { ...result,
6079
6201
  transactions: result.transactions.map(({
6080
6202
  transaction,
6081
6203
  meta
6204
+ }) => {
6205
+ const message = new Message(transaction.message);
6206
+ return {
6207
+ meta,
6208
+ transaction: { ...transaction,
6209
+ message
6210
+ }
6211
+ };
6212
+ })
6213
+ };
6214
+ return { ...block,
6215
+ transactions: block.transactions.map(({
6216
+ transaction,
6217
+ meta
6082
6218
  }) => {
6083
6219
  return {
6084
6220
  meta,
@@ -6095,7 +6231,7 @@ class Connection {
6095
6231
  async getBlocks(startSlot, endSlot, commitment) {
6096
6232
  const args = this._buildArgsAtLeastConfirmed(endSlot !== undefined ? [startSlot, endSlot] : [startSlot], commitment);
6097
6233
 
6098
- const unsafeRes = await this._rpcRequest('getConfirmedBlocks', args);
6234
+ const unsafeRes = await this._rpcRequest('getBlocks', args);
6099
6235
  const res = create(unsafeRes, jsonRpcResult(array(number())));
6100
6236
 
6101
6237
  if ('error' in res) {
@@ -6104,8 +6240,36 @@ class Connection {
6104
6240
 
6105
6241
  return res.result;
6106
6242
  }
6243
+ /**
6244
+ * Fetch a list of Signatures from the cluster for a block, excluding rewards
6245
+ */
6246
+
6247
+
6248
+ async getBlockSignatures(slot, commitment) {
6249
+ const args = this._buildArgsAtLeastConfirmed([slot], commitment, undefined, {
6250
+ transactionDetails: 'signatures',
6251
+ rewards: false
6252
+ });
6253
+
6254
+ const unsafeRes = await this._rpcRequest('getBlock', args);
6255
+ const res = create(unsafeRes, GetBlockSignaturesRpcResult);
6256
+
6257
+ if ('error' in res) {
6258
+ throw new Error('failed to get block: ' + res.error.message);
6259
+ }
6260
+
6261
+ const result = res.result;
6262
+
6263
+ if (!result) {
6264
+ throw new Error('Block ' + slot + ' not found');
6265
+ }
6266
+
6267
+ return result;
6268
+ }
6107
6269
  /**
6108
6270
  * Fetch a list of Signatures from the cluster for a confirmed block, excluding rewards
6271
+ *
6272
+ * @deprecated Deprecated since Solana v1.8.0. Please use {@link getBlockSignatures} instead.
6109
6273
  */
6110
6274
 
6111
6275
 
@@ -6116,7 +6280,7 @@ class Connection {
6116
6280
  });
6117
6281
 
6118
6282
  const unsafeRes = await this._rpcRequest('getConfirmedBlock', args);
6119
- const res = create(unsafeRes, GetConfirmedBlockSignaturesRpcResult);
6283
+ const res = create(unsafeRes, GetBlockSignaturesRpcResult);
6120
6284
 
6121
6285
  if ('error' in res) {
6122
6286
  throw new Error('failed to get confirmed block: ' + res.error.message);
@@ -6132,24 +6296,33 @@ class Connection {
6132
6296
  }
6133
6297
  /**
6134
6298
  * Fetch a transaction details for a confirmed transaction
6299
+ *
6300
+ * @deprecated Deprecated since Solana v1.8.0. Please use {@link getTransaction} instead.
6135
6301
  */
6136
6302
 
6137
6303
 
6138
6304
  async getConfirmedTransaction(signature, commitment) {
6139
- const result = await this.getTransaction(signature, {
6140
- commitment
6141
- });
6305
+ const args = this._buildArgsAtLeastConfirmed([signature], commitment);
6306
+
6307
+ const unsafeRes = await this._rpcRequest('getConfirmedTransaction', args);
6308
+ const res = create(unsafeRes, GetTransactionRpcResult);
6309
+
6310
+ if ('error' in res) {
6311
+ throw new Error('failed to get transaction: ' + res.error.message);
6312
+ }
6313
+
6314
+ const result = res.result;
6142
6315
  if (!result) return result;
6143
- const {
6144
- message,
6145
- signatures
6146
- } = result.transaction;
6316
+ const message = new Message(result.transaction.message);
6317
+ const signatures = result.transaction.signatures;
6147
6318
  return { ...result,
6148
6319
  transaction: Transaction.populate(message, signatures)
6149
6320
  };
6150
6321
  }
6151
6322
  /**
6152
6323
  * Fetch parsed transaction details for a confirmed transaction
6324
+ *
6325
+ * @deprecated Deprecated since Solana v1.8.0. Please use {@link getParsedTransaction} instead.
6153
6326
  */
6154
6327
 
6155
6328
 
@@ -6157,7 +6330,7 @@ class Connection {
6157
6330
  const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');
6158
6331
 
6159
6332
  const unsafeRes = await this._rpcRequest('getConfirmedTransaction', args);
6160
- const res = create(unsafeRes, GetParsedConfirmedTransactionRpcResult);
6333
+ const res = create(unsafeRes, GetParsedTransactionRpcResult);
6161
6334
 
6162
6335
  if ('error' in res) {
6163
6336
  throw new Error('failed to get confirmed transaction: ' + res.error.message);
@@ -6167,6 +6340,8 @@ class Connection {
6167
6340
  }
6168
6341
  /**
6169
6342
  * Fetch parsed transaction details for a batch of confirmed transactions
6343
+ *
6344
+ * @deprecated Deprecated since Solana v1.8.0. Please use {@link getParsedTransactions} instead.
6170
6345
  */
6171
6346
 
6172
6347
 
@@ -6181,7 +6356,7 @@ class Connection {
6181
6356
  });
6182
6357
  const unsafeRes = await this._rpcBatchRequest(batch);
6183
6358
  const res = unsafeRes.map(unsafeRes => {
6184
- const res = create(unsafeRes, GetParsedConfirmedTransactionRpcResult);
6359
+ const res = create(unsafeRes, GetParsedTransactionRpcResult);
6185
6360
 
6186
6361
  if ('error' in res) {
6187
6362
  throw new Error('failed to get confirmed transactions: ' + res.error.message);
@@ -6571,6 +6746,10 @@ class Connection {
6571
6746
  const skipPreflight = options && options.skipPreflight;
6572
6747
  const preflightCommitment = options && options.preflightCommitment || this.commitment;
6573
6748
 
6749
+ if (options && options.maxRetries) {
6750
+ config.maxRetries = options.maxRetries;
6751
+ }
6752
+
6574
6753
  if (skipPreflight) {
6575
6754
  config.skipPreflight = skipPreflight;
6576
6755
  }
@@ -8565,12 +8744,12 @@ const endpoint = {
8565
8744
  http: {
8566
8745
  devnet: 'http://api.devnet.solana.com',
8567
8746
  testnet: 'http://api.testnet.solana.com',
8568
- 'mainnet-beta': 'http://api.mainnet-beta.solana.com'
8747
+ 'mainnet-beta': 'http://api.mainnet-beta.solana.com/'
8569
8748
  },
8570
8749
  https: {
8571
8750
  devnet: 'https://api.devnet.solana.com',
8572
8751
  testnet: 'https://api.testnet.solana.com',
8573
- 'mainnet-beta': 'https://api.mainnet-beta.solana.com'
8752
+ 'mainnet-beta': 'https://api.mainnet-beta.solana.com/'
8574
8753
  }
8575
8754
  };
8576
8755