magic-js
magic-js copied to clipboard
Audit our EIP1193 Implementation; Add support for events
✅ Prerequisites
- [x] Did you perform a cursory search of open issues? Is this feature already requested elsewhere?
- [x] Are you reporting to the correct repository (
magic-sdk
)?
✨ Feature Request
The EIP1193 spec is finally stable. We already, through total accident, implement request
to the specification via BaseModule.request
. We should offer an implementation of Web3 events. This could be a great addition for any extension APIs to have as well, so I think we should implement it at the BaseModule
layer.
PromiEvent
landed in v1.4.0
, which also makes eventemitter3
a dependency of Magic SDK. Since v1.4.0
, we are also overloading the RPCProviderModule
interface with EventEmitter
methods. To gain full support for EIP1193 subscriptions, we must now implement the WebSocket events.