You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
* refactor subscription's logic
- Moved subscribing to provider events from Web3Subscription to Web3SubscriptionManager
- subscribe and un subscribe called at Web3Subscription now is the same as calling them on Web3SubscriptionManager
- Web3Subscription is lined now to Web3SubscriptionManager instead of directly to Web3RequestManager
- update test cases
* add `SimpleProvider` the base of `EIP1193Provider`
* update CHANGELOG.md
* enable backward compatibility for subscriptions
+ mark the obsolete as deprecated
* add `removeListener` events to `EIP1193Provider`
* Fix some events types at `SocketProvider`
* add and fix old test cases for multiple subscriptions
Copy file name to clipboardExpand all lines: packages/web3-core/CHANGELOG.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,6 +121,17 @@ Documentation:
121
121
122
122
## [Unreleased]
123
123
124
+
### Added
125
+
126
+
- Web3Subscription constructor accept a Subscription Manager (as an alternative to accepting Request Manager that is now marked marked as deprecated) (#6210)
127
+
128
+
### Changed
129
+
130
+
- Web3Subscription constructor overloading that accept a Request Manager is marked as deprecated (#6210)
131
+
124
132
### Fixed
125
133
126
134
- Fixed Batch requests erroring out on one request (#6164)
135
+
- Fixed the issue: Subscribing to multiple blockchain events causes every listener to be fired for every registered event (#6210)
136
+
- Fixed the issue: Unsubscribe at a Web3Subscription class will still have the id of the subscription at the Web3SubscriptionManager (#6210)
137
+
- Fixed the issue: A call to the provider is made for every subscription object (#6210)
// Process if the received data is related to a subscription
137
+
if(subscriptionId){
138
+
constsub=this._subscriptions.get(subscriptionId);
139
+
sub?.processSubscriptionData(data);
140
+
}
141
+
}
66
142
/**
67
143
* Will create a new subscription
68
144
*
69
145
* @param name - The subscription you want to subscribe to
70
-
* @param args (optional) - Optional additional parameters, depending on the subscription type
71
-
* @param returnFormat ({@link DataFormat} defaults to {@link DEFAULT_RETURN_FORMAT}) - Specifies how the return data from the call should be formatted.
146
+
* @param args - Optional additional parameters, depending on the subscription type
147
+
* @param returnFormat- ({@link DataFormat} defaults to {@link DEFAULT_RETURN_FORMAT}) - Specifies how the return data from the call should be formatted.
72
148
*
73
149
* Will subscribe to a specific topic (note: name)
74
150
* @returns The subscription object
@@ -78,19 +154,16 @@ export class Web3SubscriptionManager<
0 commit comments