Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit c72a78c

Browse files
committed
Updates Changelog and Docs
1 parent a4fe3f7 commit c72a78c

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Released with 1.0.0-beta.37 code base.
4343
### Fixed
4444

4545
- ``websocket`` dependency fixed (#2971, #2976)
46-
- ``requestOptions`` added to ``WebsocketProvider`` (#2979)
46+
- ``requestOptions`` added to ``WebsocketProvider`` (#2979)
4747
- Node >= v8.0.0 support (#2938)
4848

4949
## [Unreleased]
@@ -74,3 +74,9 @@ Released with 1.0.0-beta.37 code base.
7474
- Gas check fixed (#2381)
7575
- Signing issues #1998, #2033, and #1074 fixed (#3125)
7676
- Fix hexToNumber and hexToNumberString prefix validation (#3086)
77+
78+
## [1.2.2]
79+
80+
### Added
81+
82+
- Emit `connected` event on subscription creation (#3028)

docs/web3-eth-subscribe.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Returns
3838
- ``on("data")`` returns ``Object``: Fires on each incoming log with the log object as argument.
3939
- ``on("changed")`` returns ``Object``: Fires on each log which was removed from the blockchain. The log will have the additional property ``"removed: true"``.
4040
- ``on("error")`` returns ``Object``: Fires when an error in the subscription occurs.
41+
- ``on("connected")`` returns ``Number``: Fires once after the subscription successfully connected. Returns the subscription id.
4142

4243
----------------
4344
Notification returns
@@ -189,6 +190,7 @@ Returns
189190

190191
- ``"data"`` returns ``Object``: Fires on each incoming block header.
191192
- ``"error"`` returns ``Object``: Fires when an error in the subscription occurs.
193+
- ``"connected"`` returns ``Number``: Fires once after the subscription successfully connected. Returns the subscription id.
192194

193195
The structure of a returned block header is as follows:
194196

@@ -230,6 +232,9 @@ Example
230232
231233
console.error(error);
232234
})
235+
.on("connected", function(subscriptionId){
236+
console.log(subscriptionId);
237+
})
233238
.on("data", function(blockHeader){
234239
console.log(blockHeader);
235240
})
@@ -340,6 +345,7 @@ Returns
340345
- ``"data"`` returns ``Object``: Fires on each incoming log with the log object as argument.
341346
- ``"changed"`` returns ``Object``: Fires on each log which was removed from the blockchain. The log will have the additional property ``"removed: true"``.
342347
- ``"error"`` returns ``Object``: Fires when an error in the subscription occurs.
348+
- ``"connected"`` returns ``Number``: Fires once after the subscription successfully connected. Returns the subscription id.
343349

344350
For the structure of a returned event ``Object`` see :ref:`web3.eth.getPastEvents return values <eth-getpastlogs-return>`.
345351

@@ -364,6 +370,9 @@ Example
364370
if (!error)
365371
console.log(result);
366372
})
373+
.on("connected", function(subscriptionId){
374+
console.log(subscriptionId);
375+
})
367376
.on("data", function(log){
368377
console.log(log);
369378
})

0 commit comments

Comments
 (0)