File tree Expand file tree Collapse file tree
packages/wallet/dapp-client/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -655,27 +655,22 @@ export class ChainSessionManager {
655655 ) : Promise < void > {
656656 if ( ! this . provider || ! this . wallet )
657657 throw new InitializationError ( 'Manager core components not ready for explicit session.' )
658+ if ( ! this . sessionManager ) throw new InitializationError ( 'Main session manager is not initialized.' )
659+
660+ const signerAddress = Address . fromPublicKey ( Secp256k1 . getPublicKey ( { privateKey : pk } ) )
658661
659662 const maxRetries = allowRetries ? 3 : 1
660663 let lastError : Error | null = null
661664
662665 for ( let attempt = 1 ; attempt <= maxRetries ; attempt ++ ) {
663666 try {
664- const tempManager = new Signers . SessionManager ( this . wallet , {
665- sessionManagerAddress : Extensions . Rc3 . sessions ,
666- provider : this . provider ,
667- } )
668- const topology = await tempManager . getTopology ( )
667+ const topology = await this . sessionManager . getTopology ( )
669668
670- const signerAddress = Address . fromPublicKey ( Secp256k1 . getPublicKey ( { privateKey : pk } ) )
671669 const permissions = SessionConfig . getSessionPermissions ( topology , signerAddress )
672-
673670 if ( ! permissions ) {
674671 throw new InitializationError ( `Permissions not found for session key.` )
675672 }
676673
677- if ( ! this . sessionManager ) throw new InitializationError ( 'Main session manager is not initialized.' )
678-
679674 const explicitSigner = new Signers . Session . Explicit ( pk , permissions )
680675 this . sessionManager = this . sessionManager . withExplicitSigner ( explicitSigner )
681676
You can’t perform that action at this time.
0 commit comments