@@ -137,9 +137,9 @@ export class MultichainSDK extends MultichainCore {
137137 //TODO: We also should report this as an issue, sessions with no sessionScopes should be undefined, is there any reason
138138 //why the object comes empty?
139139 if ( Object . keys ( session ?. sessionScopes ?? { } ) . length > 0 ) {
140- this . emit ( 'sessionChanged ' , session ) ;
140+ this . emit ( 'session_changed ' , session ) ;
141141 } else {
142- this . emit ( 'sessionChanged ' , undefined ) ;
142+ this . emit ( 'session_changed ' , undefined ) ;
143143 }
144144 }
145145 }
@@ -172,7 +172,7 @@ export class MultichainSDK extends MultichainCore {
172172 this . listeners . push ( listener ) ;
173173 const session = await this . getCurrentSession ( ) ;
174174 if ( Object . keys ( session ?. sessionScopes ?? { } ) . length > 0 ) {
175- this . emit ( 'sessionChanged ' , session ) ;
175+ this . emit ( 'session_changed ' , session ) ;
176176 }
177177 }
178178 }
@@ -218,7 +218,7 @@ export class MultichainSDK extends MultichainCore {
218218 const isSameScopes = currentScopes . every ( ( scope ) => proposedScopes . includes ( scope ) ) && proposedScopes . every ( ( scope ) => currentScopes . includes ( scope ) ) ;
219219
220220 if ( isSameScopes ) {
221- this . emit ( 'sessionChanged ' , session ) ;
221+ this . emit ( 'session_changed ' , session ) ;
222222 return ;
223223 }
224224
@@ -231,7 +231,7 @@ export class MultichainSDK extends MultichainCore {
231231 const sessionRequest : CreateSessionParams < RPCAPI > = { optionalScopes } ;
232232
233233 const newSession = await this . provider . createSession ( sessionRequest ) ;
234- this . emit ( 'sessionChanged ' , newSession ) ;
234+ this . emit ( 'session_changed ' , newSession ) ;
235235 }
236236
237237 private getTransportForPlatformType ( platformType : PlatformType ) {
@@ -314,7 +314,7 @@ export class MultichainSDK extends MultichainCore {
314314 __transport = undefined ;
315315 __provider = undefined ;
316316
317- this . emit ( 'sessionChanged ' , undefined ) ;
317+ this . emit ( 'session_changed ' , undefined ) ;
318318 this . listeners = [ ] ;
319319
320320 await this . storage . removeTransport ( ) ;
0 commit comments