magic-js icon indicating copy to clipboard operation
magic-js copied to clipboard

Audit our EIP1193 Implementation; Add support for events

Open smithki opened this issue 4 years ago • 1 comments

✅ 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.

smithki avatar May 15 '20 20:05 smithki

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.

smithki avatar May 29 '20 02:05 smithki