From 0a486b30bbe17f8de4e937e6fe52001c03de1f3c Mon Sep 17 00:00:00 2001 From: "Alisher A. Khassanov" Date: Thu, 28 Mar 2024 13:19:09 +0500 Subject: [PATCH] Add `StartEventsListening` doc comment --- blockchain/client.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/blockchain/client.go b/blockchain/client.go index 6e2b8c9..6412b47 100644 --- a/blockchain/client.go +++ b/blockchain/client.go @@ -50,6 +50,11 @@ func NewClient(url string) (*Client, error) { }, nil } +// StartEventsListening subscribes for blockchain events and passes events starting from the +// 'begin' block to registered events listeners. Listeners registered after this call will only +// receive live events meaning all listeners which need historical events from 'begin' block +// should be registered at the moment of calling this function. The 'afterBlock' callback is +// invoked after all registered events listeners are already invoked. func (c *Client) StartEventsListening( begin types.BlockNumber, afterBlock func(blockNumber types.BlockNumber, blockHash types.Hash),