@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.
package/lib/index.iife.js CHANGED
@@ -21108,13 +21108,22 @@ var solanaWeb3 = (function (exports) {
21108
21108
  *
21109
21109
  * @param publicKey Public key of the account to monitor
21110
21110
  * @param callback Function to invoke whenever the account is changed
21111
- * @param commitment Specify the commitment level account changes must reach before notification
21111
+ * @param config
21112
21112
  * @return subscription id
21113
21113
  */
21114
- onAccountChange(publicKey, callback, commitment) {
21114
+
21115
+ /** @deprecated Instead, pass in an {@link AccountSubscriptionConfig} */
21116
+ // eslint-disable-next-line no-dupe-class-members
21117
+
21118
+ // eslint-disable-next-line no-dupe-class-members
21119
+ onAccountChange(publicKey, callback, commitmentOrConfig) {
21120
+ const {
21121
+ commitment,
21122
+ config
21123
+ } = extractCommitmentFromConfig(commitmentOrConfig);
21115
21124
  const args = this._buildArgs([publicKey.toBase58()], commitment || this._commitment || 'finalized',
21116
21125
  // Apply connection/server default.
21117
- 'base64');
21126
+ 'base64', config);
21118
21127
  return this._makeSubscription({
21119
21128
  callback,
21120
21129
  method: 'accountSubscribe',
@@ -21151,15 +21160,23 @@ var solanaWeb3 = (function (exports) {
21151
21160
  *
21152
21161
  * @param programId Public key of the program to monitor
21153
21162
  * @param callback Function to invoke whenever the account is changed
21154
- * @param commitment Specify the commitment level account changes must reach before notification
21155
- * @param filters The program account filters to pass into the RPC method
21163
+ * @param config
21156
21164
  * @return subscription id
21157
21165
  */
21158
- onProgramAccountChange(programId, callback, commitment, filters) {
21166
+
21167
+ /** @deprecated Instead, pass in a {@link ProgramAccountSubscriptionConfig} */
21168
+ // eslint-disable-next-line no-dupe-class-members
21169
+
21170
+ // eslint-disable-next-line no-dupe-class-members
21171
+ onProgramAccountChange(programId, callback, commitmentOrConfig, maybeFilters) {
21172
+ const {
21173
+ commitment,
21174
+ config
21175
+ } = extractCommitmentFromConfig(commitmentOrConfig);
21159
21176
  const args = this._buildArgs([programId.toBase58()], commitment || this._commitment || 'finalized',
21160
21177
  // Apply connection/server default.
21161
- 'base64' /* encoding */, filters ? {
21162
- filters: filters
21178
+ 'base64' /* encoding */, config ? config : maybeFilters ? {
21179
+ filters: maybeFilters
21163
21180
  } : undefined /* extra */);
21164
21181
  return this._makeSubscription({
21165
21182
  callback,