Skip to content

Commit

Permalink
document custom provider type
Browse files Browse the repository at this point in the history
  • Loading branch information
jonesmac committed Nov 17, 2023
1 parent 5e51b6b commit c07acb3
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ import { SupportedEventProposals } from './SupportedEvents'
*/
export class EIP1193Events<TProvider extends EIP1193Provider> {
private eventsEnabled: boolean = false
// Not relying on an ethers provider because it doesn't have types for EIP-1193 events
private listeningProvider = window.ethereum as TProvider
private providerListeners: [event: EIP1193EventNames, listener: Listener][] = []

constructor(private supportedEvents?: SupportedEventProposals[]) {
constructor(supportedEvents?: SupportedEventProposals[]) {
this.eventsEnabled = !!supportedEvents?.includes('EIP-1193')
}

Expand Down

0 comments on commit c07acb3

Please sign in to comment.