@solana/web3.js 1.93.2 → 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.
@@ -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,