@@ -682,7 +682,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
682682 */
683683 public getPubKey ( ) : Buffer {
684684 const { tssPubKey } = this . state ;
685- return tssPubKey ;
685+ return Buffer . from ( tssPubKey ) ;
686686 }
687687
688688 /**
@@ -761,7 +761,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
761761 }
762762
763763 // Client lib expects pub key in XY-format, base64-encoded.
764- const tssPubKeyBase64 = tssPubKey . toSEC1 ( secp256k1 ) . subarray ( 1 ) . toString ( "base64" ) ;
764+ const tssPubKeyBase64 = Buffer . from ( tssPubKey . toSEC1 ( secp256k1 ) . subarray ( 1 ) ) . toString ( "base64" ) ;
765765
766766 const client = new Client (
767767 currentSession ,
@@ -801,7 +801,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
801801 this . wasmLib = await this . loadTssWasm ( ) ;
802802 if ( this . keyType === KeyType . secp256k1 ) {
803803 const sig = await this . sign_ECDSA_secp256k1 ( data , hashed , secp256k1Precompute ) ;
804- return Buffer . concat ( [ new Uint8Array ( sig . r ) , new Uint8Array ( sig . s ) , new Uint8Array ( [ sig . v ] ) ] ) ;
804+ return Buffer . concat ( [ sig . r , sig . s , Buffer . from ( [ sig . v ] ) ] ) ;
805805 } else if ( this . keyType === KeyType . ed25519 ) {
806806 return this . sign_ed25519 ( data , hashed ) ;
807807 }
@@ -898,7 +898,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
898898 await this . tKey . _syncShareMetadata ( ) ;
899899 await this . tKey . syncLocalMetadataTransitions ( ) ;
900900
901- if ( this . sessionId ) {
901+ if ( this . sessionManager && this . sessionId ) {
902902 const payload : SessionData = {
903903 postBoxKey : this . state . postBoxKey ,
904904 postboxKeyNodeIndexes : this . state . postboxKeyNodeIndexes || [ ] ,
@@ -1257,7 +1257,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
12571257 postboxKeyNodeIndexes : postboxKeyNodeIndexes || [ ] ,
12581258 factorKey : factorKey ?. toString ( "hex" ) ,
12591259 tssShareIndex : tssShareIndex as number ,
1260- tssPubKey : tssPubKey . toString ( "hex" ) ,
1260+ tssPubKey : Buffer . from ( tssPubKey ) . toString ( "hex" ) ,
12611261 signatures : this . signatures ,
12621262 userInfo,
12631263 } ;
@@ -1534,7 +1534,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
15341534 clientXCoord ,
15351535 clientShareAdjustedHex ,
15361536 pubKeyHex ,
1537- new Uint8Array ( data ) ,
1537+ data ,
15381538 serverCoefficientsHex ,
15391539 this . socketTransports
15401540 ) ;
0 commit comments