@solana/web3.js 1.93.1 → 1.93.3

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.
@@ -7746,13 +7746,22 @@ class Connection {
7746
7746
  *
7747
7747
  * @param publicKey Public key of the account to monitor
7748
7748
  * @param callback Function to invoke whenever the account is changed
7749
- * @param commitment Specify the commitment level account changes must reach before notification
7749
+ * @param config
7750
7750
  * @return subscription id
7751
7751
  */
7752
- onAccountChange(publicKey, callback, commitment) {
7752
+
7753
+ /** @deprecated Instead, pass in an {@link AccountSubscriptionConfig} */
7754
+ // eslint-disable-next-line no-dupe-class-members
7755
+
7756
+ // eslint-disable-next-line no-dupe-class-members
7757
+ onAccountChange(publicKey, callback, commitmentOrConfig) {
7758
+ const {
7759
+ commitment,
7760
+ config
7761
+ } = extractCommitmentFromConfig(commitmentOrConfig);
7753
7762
  const args = this._buildArgs([publicKey.toBase58()], commitment || this._commitment || 'finalized',
7754
7763
  // Apply connection/server default.
7755
- 'base64');
7764
+ 'base64', config);
7756
7765
  return this._makeSubscription({
7757
7766
  callback,
7758
7767
  method: 'accountSubscribe',
@@ -7789,15 +7798,23 @@ class Connection {
7789
7798
  *
7790
7799
  * @param programId Public key of the program to monitor
7791
7800
  * @param callback Function to invoke whenever the account is changed
7792
- * @param commitment Specify the commitment level account changes must reach before notification
7793
- * @param filters The program account filters to pass into the RPC method
7801
+ * @param config
7794
7802
  * @return subscription id
7795
7803
  */
7796
- onProgramAccountChange(programId, callback, commitment, filters) {
7804
+
7805
+ /** @deprecated Instead, pass in a {@link ProgramAccountSubscriptionConfig} */
7806
+ // eslint-disable-next-line no-dupe-class-members
7807
+
7808
+ // eslint-disable-next-line no-dupe-class-members
7809
+ onProgramAccountChange(programId, callback, commitmentOrConfig, maybeFilters) {
7810
+ const {
7811
+ commitment,
7812
+ config
7813
+ } = extractCommitmentFromConfig(commitmentOrConfig);
7797
7814
  const args = this._buildArgs([programId.toBase58()], commitment || this._commitment || 'finalized',
7798
7815
  // Apply connection/server default.
7799
- 'base64' /* encoding */, filters ? {
7800
- filters: filters
7816
+ 'base64' /* encoding */, config ? config : maybeFilters ? {
7817
+ filters: maybeFilters
7801
7818
  } : undefined /* extra */);
7802
7819
  return this._makeSubscription({
7803
7820
  callback,