@solana/web3.js 1.93.2 → 1.93.4

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.
@@ -4113,7 +4113,7 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(superstruct.t
4113
4113
  /**
4114
4114
  * Metadata for a parsed confirmed transaction on the ledger
4115
4115
  *
4116
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link ParsedTransactionMeta} instead.
4116
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link ParsedTransactionMeta} instead.
4117
4117
  */
4118
4118
 
4119
4119
  /**
@@ -4143,7 +4143,7 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(superstruct.t
4143
4143
  /**
4144
4144
  * A confirmed transaction on the ledger
4145
4145
  *
4146
- * @deprecated Deprecated since Solana v1.8.0.
4146
+ * @deprecated Deprecated since RPC v1.8.0.
4147
4147
  */
4148
4148
 
4149
4149
  /**
@@ -4173,7 +4173,7 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(superstruct.t
4173
4173
  /**
4174
4174
  * A parsed and confirmed transaction on the ledger
4175
4175
  *
4176
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link ParsedTransactionWithMeta} instead.
4176
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link ParsedTransactionWithMeta} instead.
4177
4177
  */
4178
4178
 
4179
4179
  /**
@@ -4219,7 +4219,7 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(superstruct.t
4219
4219
  /**
4220
4220
  * A confirmed block on the ledger
4221
4221
  *
4222
- * @deprecated Deprecated since Solana v1.8.0.
4222
+ * @deprecated Deprecated since RPC v1.8.0.
4223
4223
  */
4224
4224
 
4225
4225
  /**
@@ -4921,7 +4921,7 @@ const GetParsedNoneModeBlockRpcResult = jsonRpcResult(superstruct.nullable(super
4921
4921
  /**
4922
4922
  * Expected JSON RPC response for the "getConfirmedBlock" message
4923
4923
  *
4924
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link GetBlockRpcResult} instead.
4924
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link GetBlockRpcResult} instead.
4925
4925
  */
4926
4926
  const GetConfirmedBlockRpcResult = jsonRpcResult(superstruct.nullable(superstruct.type({
4927
4927
  blockhash: superstruct.string(),
@@ -4971,7 +4971,7 @@ const GetParsedTransactionRpcResult = jsonRpcResult(superstruct.nullable(superst
4971
4971
  /**
4972
4972
  * Expected JSON RPC response for the "getRecentBlockhash" message
4973
4973
  *
4974
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link GetLatestBlockhashRpcResult} instead.
4974
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link GetLatestBlockhashRpcResult} instead.
4975
4975
  */
4976
4976
  const GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(superstruct.type({
4977
4977
  blockhash: superstruct.string(),
@@ -5659,6 +5659,8 @@ class Connection {
5659
5659
 
5660
5660
  /**
5661
5661
  * Returns epoch activation information for a stake account that has been delegated
5662
+ *
5663
+ * @deprecated Deprecated since RPC v1.18; will be removed in a future version.
5662
5664
  */
5663
5665
  async getStakeActivation(publicKey, commitmentOrConfig, epoch) {
5664
5666
  const {
@@ -6230,7 +6232,7 @@ class Connection {
6230
6232
  /**
6231
6233
  * Fetch the current total currency supply of the cluster in lamports
6232
6234
  *
6233
- * @deprecated Deprecated since v1.2.8. Please use {@link getSupply} instead.
6235
+ * @deprecated Deprecated since RPC v1.2.8. Please use {@link getSupply} instead.
6234
6236
  */
6235
6237
  async getTotalSupply(commitment) {
6236
6238
  const result = await this.getSupply({
@@ -6347,7 +6349,7 @@ class Connection {
6347
6349
  * Fetch a recent blockhash from the cluster, return with context
6348
6350
  * @return {Promise<RpcResponseAndContext<{blockhash: Blockhash, feeCalculator: FeeCalculator}>>}
6349
6351
  *
6350
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getLatestBlockhash} instead.
6352
+ * @deprecated Deprecated since RPC v1.9.0. Please use {@link getLatestBlockhash} instead.
6351
6353
  */
6352
6354
  async getRecentBlockhashAndContext(commitment) {
6353
6355
  const args = this._buildArgs([], commitment);
@@ -6375,7 +6377,7 @@ class Connection {
6375
6377
  /**
6376
6378
  * Fetch the fee calculator for a recent blockhash from the cluster, return with context
6377
6379
  *
6378
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getFeeForMessage} instead.
6380
+ * @deprecated Deprecated since RPC v1.9.0. Please use {@link getFeeForMessage} instead.
6379
6381
  */
6380
6382
  async getFeeCalculatorForBlockhash(blockhash, commitment) {
6381
6383
  const args = this._buildArgs([blockhash], commitment);
@@ -6428,7 +6430,7 @@ class Connection {
6428
6430
  * Fetch a recent blockhash from the cluster
6429
6431
  * @return {Promise<{blockhash: Blockhash, feeCalculator: FeeCalculator}>}
6430
6432
  *
6431
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getLatestBlockhash} instead.
6433
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link getLatestBlockhash} instead.
6432
6434
  */
6433
6435
  async getRecentBlockhash(commitment) {
6434
6436
  try {
@@ -6810,7 +6812,7 @@ class Connection {
6810
6812
  * Fetch a list of Transactions and transaction statuses from the cluster
6811
6813
  * for a confirmed block.
6812
6814
  *
6813
- * @deprecated Deprecated since v1.13.0. Please use {@link getBlock} instead.
6815
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getBlock} instead.
6814
6816
  */
6815
6817
  async getConfirmedBlock(slot, commitment) {
6816
6818
  const args = this._buildArgsAtLeastConfirmed([slot], commitment);
@@ -6889,7 +6891,7 @@ class Connection {
6889
6891
  /**
6890
6892
  * Fetch a list of Signatures from the cluster for a confirmed block, excluding rewards
6891
6893
  *
6892
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getBlockSignatures} instead.
6894
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getBlockSignatures} instead.
6893
6895
  */
6894
6896
  async getConfirmedBlockSignatures(slot, commitment) {
6895
6897
  const args = this._buildArgsAtLeastConfirmed([slot], commitment, undefined, {
@@ -6911,7 +6913,7 @@ class Connection {
6911
6913
  /**
6912
6914
  * Fetch a transaction details for a confirmed transaction
6913
6915
  *
6914
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getTransaction} instead.
6916
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getTransaction} instead.
6915
6917
  */
6916
6918
  async getConfirmedTransaction(signature, commitment) {
6917
6919
  const args = this._buildArgsAtLeastConfirmed([signature], commitment);
@@ -6933,7 +6935,7 @@ class Connection {
6933
6935
  /**
6934
6936
  * Fetch parsed transaction details for a confirmed transaction
6935
6937
  *
6936
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getParsedTransaction} instead.
6938
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getParsedTransaction} instead.
6937
6939
  */
6938
6940
  async getParsedConfirmedTransaction(signature, commitment) {
6939
6941
  const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');
@@ -6948,7 +6950,7 @@ class Connection {
6948
6950
  /**
6949
6951
  * Fetch parsed transaction details for a batch of confirmed transactions
6950
6952
  *
6951
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getParsedTransactions} instead.
6953
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getParsedTransactions} instead.
6952
6954
  */
6953
6955
  async getParsedConfirmedTransactions(signatures, commitment) {
6954
6956
  const batch = signatures.map(signature => {
@@ -6973,7 +6975,7 @@ class Connection {
6973
6975
  * Fetch a list of all the confirmed signatures for transactions involving an address
6974
6976
  * within a specified slot range. Max range allowed is 10,000 slots.
6975
6977
  *
6976
- * @deprecated Deprecated since v1.3. Please use {@link getConfirmedSignaturesForAddress2} instead.
6978
+ * @deprecated Deprecated since RPC v1.3. Please use {@link getConfirmedSignaturesForAddress2} instead.
6977
6979
  *
6978
6980
  * @param address queried address
6979
6981
  * @param startSlot start slot, inclusive
@@ -7027,9 +7029,7 @@ class Connection {
7027
7029
  * Returns confirmed signatures for transactions involving an
7028
7030
  * address backwards in time from the provided signature or most recent confirmed block
7029
7031
  *
7030
- *
7031
- * @param address queried address
7032
- * @param options
7032
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getSignaturesForAddress} instead.
7033
7033
  */
7034
7034
  async getConfirmedSignaturesForAddress2(address, options, commitment) {
7035
7035
  const args = this._buildArgsAtLeastConfirmed([address.toBase58()], commitment, undefined, options);
@@ -7772,13 +7772,22 @@ class Connection {
7772
7772
  *
7773
7773
  * @param publicKey Public key of the account to monitor
7774
7774
  * @param callback Function to invoke whenever the account is changed
7775
- * @param commitment Specify the commitment level account changes must reach before notification
7775
+ * @param config
7776
7776
  * @return subscription id
7777
7777
  */
7778
- onAccountChange(publicKey, callback, commitment) {
7778
+
7779
+ /** @deprecated Instead, pass in an {@link AccountSubscriptionConfig} */
7780
+ // eslint-disable-next-line no-dupe-class-members
7781
+
7782
+ // eslint-disable-next-line no-dupe-class-members
7783
+ onAccountChange(publicKey, callback, commitmentOrConfig) {
7784
+ const {
7785
+ commitment,
7786
+ config
7787
+ } = extractCommitmentFromConfig(commitmentOrConfig);
7779
7788
  const args = this._buildArgs([publicKey.toBase58()], commitment || this._commitment || 'finalized',
7780
7789
  // Apply connection/server default.
7781
- 'base64');
7790
+ 'base64', config);
7782
7791
  return this._makeSubscription({
7783
7792
  callback,
7784
7793
  method: 'accountSubscribe',
@@ -7815,15 +7824,23 @@ class Connection {
7815
7824
  *
7816
7825
  * @param programId Public key of the program to monitor
7817
7826
  * @param callback Function to invoke whenever the account is changed
7818
- * @param commitment Specify the commitment level account changes must reach before notification
7819
- * @param filters The program account filters to pass into the RPC method
7827
+ * @param config
7820
7828
  * @return subscription id
7821
7829
  */
7822
- onProgramAccountChange(programId, callback, commitment, filters) {
7830
+
7831
+ /** @deprecated Instead, pass in a {@link ProgramAccountSubscriptionConfig} */
7832
+ // eslint-disable-next-line no-dupe-class-members
7833
+
7834
+ // eslint-disable-next-line no-dupe-class-members
7835
+ onProgramAccountChange(programId, callback, commitmentOrConfig, maybeFilters) {
7836
+ const {
7837
+ commitment,
7838
+ config
7839
+ } = extractCommitmentFromConfig(commitmentOrConfig);
7823
7840
  const args = this._buildArgs([programId.toBase58()], commitment || this._commitment || 'finalized',
7824
7841
  // Apply connection/server default.
7825
- 'base64' /* encoding */, filters ? {
7826
- filters: filters
7842
+ 'base64' /* encoding */, config ? config : maybeFilters ? {
7843
+ filters: maybeFilters
7827
7844
  } : undefined /* extra */);
7828
7845
  return this._makeSubscription({
7829
7846
  callback,