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
feat: implement shutdown method for helios-ts (#778)
- Implement a proper cleanup so Helios instance can be safely garbage collected
- Bonus: return Helios reference from on() and removeListener() methods as per EIP-1193 spec
If Helios is used as a transport for `ethers` or `viem`, calling `EthersProvider.destroy()` will NOT destroy underlying Helios instance nor will stop the background tasks.
133
+
134
+
For proper cleanup, call `shutdown()` (or its alias `destroy()`) on your Helios provider instance to properly release resources:
135
+
136
+
```typescript
137
+
// Clean up when done
138
+
awaitheliosProvider.shutdown();
139
+
```
140
+
141
+
This unsubscribes all active subscriptions, aborts background tasks, removes event listeners, and frees WASM memory. The method is idempotent—calling it multiple times is safe. After dereferencing Helios provider instance will be garbage collected.
142
+
130
143
## Documentation
131
144
132
145
See [helios github repo](https://github.com/a16z/helios/) for more details.
0 commit comments