File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
packages/thirdweb/src/adapters/eip1193 Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,7 @@ export function fromProvider(options: FromEip1193AdapterOptions): Wallet {
9797 chain = connectedChain ;
9898 handleDisconnect = doDisconnect ;
9999 handleSwitchChain = doSwitchChain ;
100+ emitter . emit ( "onConnect" , connectOptions ) ;
100101 trackConnect ( {
101102 client : connectOptions . client ,
102103 walletType : id ,
@@ -119,6 +120,7 @@ export function fromProvider(options: FromEip1193AdapterOptions): Wallet {
119120 chain = connectedChain ;
120121 handleDisconnect = doDisconnect ;
121122 handleSwitchChain = doSwitchChain ;
123+ emitter . emit ( "onConnect" , connectOptions ) ;
122124 trackConnect ( {
123125 client : connectOptions . client ,
124126 walletType : id ,
@@ -130,7 +132,11 @@ export function fromProvider(options: FromEip1193AdapterOptions): Wallet {
130132 disconnect : async ( ) => {
131133 reset ( ) ;
132134 await handleDisconnect ( ) ;
135+ emitter . emit ( "disconnect" , undefined ) ;
136+ } ,
137+ switchChain : async ( c ) => {
138+ await handleSwitchChain ( c ) ;
139+ emitter . emit ( "chainChanged" , c ) ;
133140 } ,
134- switchChain : ( c ) => handleSwitchChain ( c ) ,
135141 } ;
136142}
You can’t perform that action at this time.
0 commit comments