@@ -61,7 +61,7 @@ def __init__(self, node_url: str):
61
61
self .node_url : str = node_url
62
62
self .connection : Optional [ClientConnection ] = None
63
63
self ._listen_task : Optional [asyncio .Task ] = None
64
- self ._subscriptions : Dict [int , NotificationHandler ] = {}
64
+ self ._subscriptions : Dict [str , NotificationHandler ] = {}
65
65
self ._message_id = 0
66
66
self ._pending_responses : Dict [int , asyncio .Future ] = {}
67
67
self ._on_chain_reorg : Optional [Callable [[ReorgNotification ], Any ]] = None
@@ -101,7 +101,7 @@ async def subscribe_new_heads(
101
101
handler : Callable [[NewHeadsNotification ], Any ],
102
102
block_hash : Optional [Union [Hash , LatestTag ]] = None ,
103
103
block_number : Optional [Union [int , LatestTag ]] = None ,
104
- ) -> int :
104
+ ) -> str :
105
105
"""
106
106
Creates a WebSocket stream which will fire events for new block headers.
107
107
@@ -125,7 +125,7 @@ async def subscribe_events(
125
125
keys : Optional [List [List [int ]]] = None ,
126
126
block_hash : Optional [Union [Hash , LatestTag ]] = None ,
127
127
block_number : Optional [Union [int , LatestTag ]] = None ,
128
- ) -> int :
128
+ ) -> str :
129
129
"""
130
130
Creates a WebSocket stream which will fire events for new Starknet events with applied filters.
131
131
@@ -160,7 +160,7 @@ async def subscribe_transaction_status(
160
160
self ,
161
161
handler : Callable [[TransactionStatusNotification ], Any ],
162
162
transaction_hash : int ,
163
- ) -> int :
163
+ ) -> str :
164
164
"""
165
165
Creates a WebSocket stream which at first fires an event with the current known transaction status, followed
166
166
by events for every transaction status update.
@@ -181,7 +181,7 @@ async def subscribe_pending_transactions(
181
181
handler : Callable [[PendingTransactionsNotification ], Any ],
182
182
transaction_details : Optional [bool ] = None ,
183
183
sender_address : Optional [List [int ]] = None ,
184
- ) -> int :
184
+ ) -> str :
185
185
"""
186
186
Creates a WebSocket stream which will fire events when a new pending transaction is added.
187
187
While there is no mempool, this notifies of transactions in the pending block.
@@ -226,7 +226,7 @@ def on_chain_reorg(self, handler: Callable[[ReorgNotification], Any]):
226
226
"""
227
227
self ._on_chain_reorg = handler
228
228
229
- async def unsubscribe (self , subscription_id : int ) -> bool :
229
+ async def unsubscribe (self , subscription_id : str ) -> bool :
230
230
"""
231
231
Close a previously opened WebSocket stream, with the corresponding subscription id.
232
232
@@ -250,7 +250,7 @@ async def _subscribe(
250
250
handler : Callable [[Any ], Any ],
251
251
method : str ,
252
252
params : Optional [Dict [str , Any ]] = None ,
253
- ) -> int :
253
+ ) -> str :
254
254
""" "
255
255
Creates a WebSocket stream which will fire events on a specific action.
256
256
0 commit comments