@@ -33,9 +33,9 @@ import {
3333 LegacyShareRequestResult ,
3434 LegacyVerifierLookupResponse ,
3535 NonceMetadataParams ,
36- RetrieveSharesResponse ,
3736 SetNonceData ,
3837 TorusCtorOptions ,
38+ TorusKey ,
3939 TorusPublicKey ,
4040 UserType ,
4141 v2NonceResultType ,
@@ -115,7 +115,7 @@ class Torus {
115115 verifierParams : VerifierParams ,
116116 idToken : string ,
117117 extraParams : Record < string , unknown > = { }
118- ) : Promise < RetrieveSharesResponse > {
118+ ) : Promise < TorusKey > {
119119 if ( this . isLegacyNetwork ) return this . legacyRetrieveShares ( endpoints , indexes , verifier , verifierParams , idToken , extraParams ) ;
120120 return retrieveOrImportShare ( {
121121 legacyMetadataHost : this . legacyMetadataHost ,
@@ -152,7 +152,7 @@ class Torus {
152152 idToken : string ,
153153 newPrivateKey : string ,
154154 extraParams : Record < string , unknown > = { }
155- ) : Promise < RetrieveSharesResponse > {
155+ ) : Promise < TorusKey > {
156156 if ( this . isLegacyNetwork ) throw new Error ( "This function is not supported on legacy networks" ) ;
157157 if ( endpoints . length !== nodeIndexes . length ) {
158158 throw new Error ( `length of endpoints array must be same as length of nodeIndexes array` ) ;
@@ -240,7 +240,7 @@ class Torus {
240240 verifierParams : VerifierParams ,
241241 idToken : string ,
242242 extraParams : Record < string , unknown > = { }
243- ) : Promise < RetrieveSharesResponse > {
243+ ) : Promise < TorusKey > {
244244 const promiseArr = [ ] ;
245245 await get < void > (
246246 this . allowHost ,
@@ -442,7 +442,7 @@ class Torus {
442442 let metadataNonce : BN ;
443443 let finalPubKey : curve . base . BasePoint ;
444444 let typeOfUser : UserType = "v1" ;
445- let pubKeyNonceResult : { x : string ; y : string } | undefined ;
445+ let pubKeyNonceResult : { X : string ; Y : string } | undefined ;
446446 if ( this . enableOneKey ) {
447447 const nonceResult = await getNonce ( this . legacyMetadataHost , this . ec , this . serverTimeOffset , oAuthKeyX , oAuthKeyY , oAuthKey ) ;
448448 metadataNonce = new BN ( nonceResult . nonce || "0" , 16 ) ;
@@ -456,7 +456,7 @@ class Torus {
456456 . keyFromPublic ( { x : ( nonceResult as v2NonceResultType ) . pubNonce . x , y : ( nonceResult as v2NonceResultType ) . pubNonce . y } )
457457 . getPublic ( )
458458 ) ;
459- pubKeyNonceResult = ( nonceResult as v2NonceResultType ) . pubNonce ;
459+ pubKeyNonceResult = { X : ( nonceResult as v2NonceResultType ) . pubNonce . x , Y : ( nonceResult as v2NonceResultType ) . pubNonce . y } ;
460460 }
461461 } else {
462462 // for imported keys in legacy networks
@@ -615,7 +615,7 @@ class Torus {
615615 throw new GetOrSetNonceError ( "metadata nonce is missing in share response" ) ;
616616 }
617617 const { pub_key_X : X , pub_key_Y : Y } = keyResult . keys [ 0 ] ;
618- let pubNonce : { x : string ; y : string } | undefined ;
618+ let pubNonce : { X : string ; Y : string } | undefined ;
619619 const nonce = new BN ( nonceResult ?. nonce || "0" , 16 ) ;
620620 let oAuthPubKey : curve . base . BasePoint ;
621621 let finalPubKey : curve . base . BasePoint ;
@@ -639,7 +639,7 @@ class Torus {
639639 . getPublic ( )
640640 . add ( this . ec . keyFromPublic ( { x : v2NonceResult . pubNonce . x , y : v2NonceResult . pubNonce . y } ) . getPublic ( ) ) ;
641641
642- pubNonce = v2NonceResult . pubNonce ;
642+ pubNonce = { X : v2NonceResult . pubNonce . x , Y : v2NonceResult . pubNonce . y } ;
643643 }
644644
645645 if ( ! oAuthPubKey ) {
@@ -648,7 +648,7 @@ class Torus {
648648 const oAuthX = oAuthPubKey . getX ( ) . toString ( 16 , 64 ) ;
649649 const oAuthY = oAuthPubKey . getY ( ) . toString ( 16 , 64 ) ;
650650 const oAuthAddress = generateAddressFromPubKey ( this . ec , oAuthPubKey . getX ( ) , oAuthPubKey . getY ( ) ) ;
651- log . debug ( "> torus.js/getPublicAddress, oAuthPubKeyData " , { X : oAuthX , Y : oAuthY , oAuthAddress, nonce : nonce ?. toString ( 16 ) , pubNonce } ) ;
651+ log . debug ( "> torus.js/getPublicAddress, oAuthKeyData " , { X : oAuthX , Y : oAuthY , oAuthAddress, nonce : nonce ?. toString ( 16 ) , pubNonce } ) ;
652652
653653 if ( ! finalPubKey ) {
654654 throw new Error ( "Unable to derive finalPubKey" ) ;
@@ -657,15 +657,15 @@ class Torus {
657657 const finalY = finalPubKey ? finalPubKey . getY ( ) . toString ( 16 , 64 ) : "" ;
658658 const finalAddress = finalPubKey ? generateAddressFromPubKey ( this . ec , finalPubKey . getX ( ) , finalPubKey . getY ( ) ) : "" ;
659659 return {
660- oAuthPubKeyData : {
660+ oAuthKeyData : {
661661 evmAddress : oAuthAddress ,
662- x : oAuthX ,
663- y : oAuthY ,
662+ X : oAuthX ,
663+ Y : oAuthY ,
664664 } ,
665- finalPubKeyData : {
665+ finalKeyData : {
666666 evmAddress : finalAddress ,
667- x : finalX ,
668- y : finalY ,
667+ X : finalX ,
668+ Y : finalY ,
669669 } ,
670670 metadata : {
671671 pubNonce,
@@ -690,7 +690,7 @@ class Torus {
690690 let nonce : BN ;
691691 let finalPubKey : curve . base . BasePoint ;
692692 let typeOfUser : GetOrSetNonceResult [ "typeOfUser" ] ;
693- let pubNonce : { x : string ; y : string } | undefined ;
693+ let pubNonce : { X : string ; Y : string } | undefined ;
694694
695695 const oAuthPubKey = this . ec . keyFromPublic ( { x : X , y : Y } ) . getPublic ( ) ;
696696
@@ -712,7 +712,7 @@ class Torus {
712712 . keyFromPublic ( { x : X , y : Y } )
713713 . getPublic ( )
714714 . add ( this . ec . keyFromPublic ( { x : nonceResult . pubNonce . x , y : nonceResult . pubNonce . y } ) . getPublic ( ) ) ;
715- pubNonce = nonceResult . pubNonce ;
715+ pubNonce = { X : nonceResult . pubNonce . x , Y : nonceResult . pubNonce . y } ;
716716 } else {
717717 throw new Error ( "getOrSetNonce should always return typeOfUser." ) ;
718718 }
@@ -731,7 +731,7 @@ class Torus {
731731 const oAuthX = oAuthPubKey . getX ( ) . toString ( 16 , 64 ) ;
732732 const oAuthY = oAuthPubKey . getY ( ) . toString ( 16 , 64 ) ;
733733 const oAuthAddress = generateAddressFromPubKey ( this . ec , oAuthPubKey . getX ( ) , oAuthPubKey . getY ( ) ) ;
734- log . debug ( "> torus.js/getPublicAddress, oAuthPubKeyData " , { X : oAuthX , Y : oAuthY , oAuthAddress, nonce : nonce ?. toString ( 16 ) , pubNonce } ) ;
734+ log . debug ( "> torus.js/getPublicAddress, oAuthKeyData " , { X : oAuthX , Y : oAuthY , oAuthAddress, nonce : nonce ?. toString ( 16 ) , pubNonce } ) ;
735735
736736 if ( typeOfUser === "v2" && ! finalPubKey ) {
737737 throw new Error ( "Unable to derive finalPubKey" ) ;
@@ -740,15 +740,15 @@ class Torus {
740740 const finalY = finalPubKey ? finalPubKey . getY ( ) . toString ( 16 , 64 ) : "" ;
741741 const finalAddress = finalPubKey ? generateAddressFromPubKey ( this . ec , finalPubKey . getX ( ) , finalPubKey . getY ( ) ) : "" ;
742742 return {
743- oAuthPubKeyData : {
743+ oAuthKeyData : {
744744 evmAddress : oAuthAddress ,
745- x : oAuthX ,
746- y : oAuthY ,
745+ X : oAuthX ,
746+ Y : oAuthY ,
747747 } ,
748- finalPubKeyData : {
748+ finalKeyData : {
749749 evmAddress : finalAddress ,
750- x : finalX ,
751- y : finalY ,
750+ X : finalX ,
751+ Y : finalY ,
752752 } ,
753753 metadata : {
754754 pubNonce,
0 commit comments