diff --git a/tkey-ios-mpc/tkey-ios-mpc.xcodeproj/project.pbxproj b/tkey-ios-mpc/tkey-ios-mpc.xcodeproj/project.pbxproj index 944c00d..800dcca 100644 --- a/tkey-ios-mpc/tkey-ios-mpc.xcodeproj/project.pbxproj +++ b/tkey-ios-mpc/tkey-ios-mpc.xcodeproj/project.pbxproj @@ -12,7 +12,9 @@ 28122A412BB4429E00B6FA63 /* EthereumClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28122A402BB4429E00B6FA63 /* EthereumClient.swift */; }; 28122A442BB4431800B6FA63 /* web3-zksync.swift in Frameworks */ = {isa = PBXBuildFile; productRef = 28122A432BB4431800B6FA63 /* web3-zksync.swift */; }; 28122A462BB4431800B6FA63 /* web3.swift in Frameworks */ = {isa = PBXBuildFile; productRef = 28122A452BB4431800B6FA63 /* web3.swift */; }; - 285FF2622BBC3F4000A526F5 /* SingleFactorAuth in Frameworks */ = {isa = PBXBuildFile; productRef = 285FF2612BBC3F4000A526F5 /* SingleFactorAuth */; }; + 283C543E2BC014AC008CD381 /* SingleFactorAuth in Frameworks */ = {isa = PBXBuildFile; productRef = 283C543D2BC014AC008CD381 /* SingleFactorAuth */; }; + 283C54412BC01576008CD381 /* tkey-mpc-swift in Frameworks */ = {isa = PBXBuildFile; productRef = 283C54402BC01576008CD381 /* tkey-mpc-swift */; }; + 283C54442BC02A85008CD381 /* TorusUtils in Frameworks */ = {isa = PBXBuildFile; productRef = 283C54432BC02A85008CD381 /* TorusUtils */; }; 285FF2642BBC7D1800A526F5 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 285FF2632BBC7D1800A526F5 /* GoogleService-Info.plist */; }; 285FF2672BBC7D8C00A526F5 /* FirebaseAuth in Frameworks */ = {isa = PBXBuildFile; productRef = 285FF2662BBC7D8C00A526F5 /* FirebaseAuth */; }; 285FF26A2BBC7DF700A526F5 /* GoogleSignIn in Frameworks */ = {isa = PBXBuildFile; productRef = 285FF2692BBC7DF700A526F5 /* GoogleSignIn */; }; @@ -24,12 +26,10 @@ 2882D6742BADAE6B00B3E518 /* tkey_ios_mpcTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2882D6732BADAE6B00B3E518 /* tkey_ios_mpcTests.swift */; }; 2882D67E2BADAE6B00B3E518 /* tkey_ios_mpcUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2882D67D2BADAE6B00B3E518 /* tkey_ios_mpcUITests.swift */; }; 2882D6802BADAE6B00B3E518 /* tkey_ios_mpcUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2882D67F2BADAE6B00B3E518 /* tkey_ios_mpcUITestsLaunchTests.swift */; }; - 2882D6912BADC5BD00B3E518 /* ThresholdKey in Frameworks */ = {isa = PBXBuildFile; productRef = 2882D6902BADC5BD00B3E518 /* ThresholdKey */; }; 2882D6942BADC5E800B3E518 /* CustomAuthViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2882D6932BADC5E800B3E518 /* CustomAuthViewModel.swift */; }; 2882D6982BADCA0500B3E518 /* LoginView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2882D6972BADCA0500B3E518 /* LoginView.swift */; }; 2882D69A2BADCC4300B3E518 /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2882D6992BADCC4300B3E518 /* HomeView.swift */; }; 2882D69C2BADCD2400B3E518 /* ThresholdKeyViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2882D69B2BADCD2400B3E518 /* ThresholdKeyViewModel.swift */; }; - 2882D69F2BAE8D2F00B3E518 /* TorusUtils in Frameworks */ = {isa = PBXBuildFile; productRef = 2882D69E2BAE8D2F00B3E518 /* TorusUtils */; }; 2882D6A22BAEC57C00B3E518 /* KeyChainInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2882D6A12BAEC57C00B3E518 /* KeyChainInterface.swift */; }; /* End PBXBuildFile section */ @@ -78,12 +78,12 @@ buildActionMask = 2147483647; files = ( 285FF26C2BBC7DF700A526F5 /* GoogleSignInSwift in Frameworks */, - 2882D6912BADC5BD00B3E518 /* ThresholdKey in Frameworks */, + 283C54442BC02A85008CD381 /* TorusUtils in Frameworks */, 285FF26A2BBC7DF700A526F5 /* GoogleSignIn in Frameworks */, + 283C54412BC01576008CD381 /* tkey-mpc-swift in Frameworks */, + 283C543E2BC014AC008CD381 /* SingleFactorAuth in Frameworks */, 28122A442BB4431800B6FA63 /* web3-zksync.swift in Frameworks */, 28122A3F2BB2A04A00B6FA63 /* Web3SwiftMpcProvider in Frameworks */, - 285FF2622BBC3F4000A526F5 /* SingleFactorAuth in Frameworks */, - 2882D69F2BAE8D2F00B3E518 /* TorusUtils in Frameworks */, 285FF2672BBC7D8C00A526F5 /* FirebaseAuth in Frameworks */, 28122A462BB4431800B6FA63 /* web3.swift in Frameworks */, ); @@ -212,15 +212,15 @@ ); name = "tkey-ios-mpc"; packageProductDependencies = ( - 2882D6902BADC5BD00B3E518 /* ThresholdKey */, - 2882D69E2BAE8D2F00B3E518 /* TorusUtils */, 28122A3E2BB2A04A00B6FA63 /* Web3SwiftMpcProvider */, 28122A432BB4431800B6FA63 /* web3-zksync.swift */, 28122A452BB4431800B6FA63 /* web3.swift */, - 285FF2612BBC3F4000A526F5 /* SingleFactorAuth */, 285FF2662BBC7D8C00A526F5 /* FirebaseAuth */, 285FF2692BBC7DF700A526F5 /* GoogleSignIn */, 285FF26B2BBC7DF700A526F5 /* GoogleSignInSwift */, + 283C543D2BC014AC008CD381 /* SingleFactorAuth */, + 283C54402BC01576008CD381 /* tkey-mpc-swift */, + 283C54432BC02A85008CD381 /* TorusUtils */, ); productName = "tkey-ios-mpc"; productReference = 2882D65F2BADAE6900B3E518 /* tkey-ios-mpc.app */; @@ -295,13 +295,13 @@ ); mainGroup = 2882D6562BADAE6900B3E518; packageReferences = ( - 2882D68F2BADC5BD00B3E518 /* XCRemoteSwiftPackageReference "tkey-mpc-swift" */, - 2882D69D2BAE8D2F00B3E518 /* XCRemoteSwiftPackageReference "torus-utils-swift" */, 28122A3D2BB2A04A00B6FA63 /* XCRemoteSwiftPackageReference "web3-swift-mpc-provider" */, 28122A422BB4431800B6FA63 /* XCRemoteSwiftPackageReference "web3" */, - 285FF2602BBC3F4000A526F5 /* XCRemoteSwiftPackageReference "single-factor-auth-swift" */, 285FF2652BBC7D8C00A526F5 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */, 285FF2682BBC7DF700A526F5 /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */, + 283C543C2BC014AC008CD381 /* XCRemoteSwiftPackageReference "single-factor-auth-swift" */, + 283C543F2BC01575008CD381 /* XCRemoteSwiftPackageReference "tkey-mpc-swift" */, + 283C54422BC02A85008CD381 /* XCRemoteSwiftPackageReference "torus-utils-swift" */, ); productRefGroup = 2882D6602BADAE6900B3E518 /* Products */; projectDirPath = ""; @@ -704,44 +704,44 @@ version = 1.6.1; }; }; - 285FF2602BBC3F4000A526F5 /* XCRemoteSwiftPackageReference "single-factor-auth-swift" */ = { + 283C543C2BC014AC008CD381 /* XCRemoteSwiftPackageReference "single-factor-auth-swift" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/Web3Auth/single-factor-auth-swift"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 3.0.0; + minimumVersion = 4.0.0; }; }; - 285FF2652BBC7D8C00A526F5 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */ = { + 283C543F2BC01575008CD381 /* XCRemoteSwiftPackageReference "tkey-mpc-swift" */ = { isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/firebase/firebase-ios-sdk"; + repositoryURL = "https://github.com/tkey/tkey-mpc-swift"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 10.23.1; + minimumVersion = 2.1.0; }; }; - 285FF2682BBC7DF700A526F5 /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */ = { + 283C54422BC02A85008CD381 /* XCRemoteSwiftPackageReference "torus-utils-swift" */ = { isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/google/GoogleSignIn-iOS"; + repositoryURL = "https://github.com/torusresearch/torus-utils-swift"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 7.1.0; + minimumVersion = 8.0.0; }; }; - 2882D68F2BADC5BD00B3E518 /* XCRemoteSwiftPackageReference "tkey-mpc-swift" */ = { + 285FF2652BBC7D8C00A526F5 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */ = { isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/tkey/tkey-mpc-swift"; + repositoryURL = "https://github.com/firebase/firebase-ios-sdk"; requirement = { - kind = exactVersion; - version = 1.1.0; + kind = upToNextMajorVersion; + minimumVersion = 10.23.1; }; }; - 2882D69D2BAE8D2F00B3E518 /* XCRemoteSwiftPackageReference "torus-utils-swift" */ = { + 285FF2682BBC7DF700A526F5 /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */ = { isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/torusresearch/torus-utils-swift"; + repositoryURL = "https://github.com/google/GoogleSignIn-iOS"; requirement = { - branch = master; - kind = branch; + kind = upToNextMajorVersion; + minimumVersion = 7.1.0; }; }; /* End XCRemoteSwiftPackageReference section */ @@ -762,11 +762,21 @@ package = 28122A422BB4431800B6FA63 /* XCRemoteSwiftPackageReference "web3" */; productName = web3.swift; }; - 285FF2612BBC3F4000A526F5 /* SingleFactorAuth */ = { + 283C543D2BC014AC008CD381 /* SingleFactorAuth */ = { isa = XCSwiftPackageProductDependency; - package = 285FF2602BBC3F4000A526F5 /* XCRemoteSwiftPackageReference "single-factor-auth-swift" */; + package = 283C543C2BC014AC008CD381 /* XCRemoteSwiftPackageReference "single-factor-auth-swift" */; productName = SingleFactorAuth; }; + 283C54402BC01576008CD381 /* tkey-mpc-swift */ = { + isa = XCSwiftPackageProductDependency; + package = 283C543F2BC01575008CD381 /* XCRemoteSwiftPackageReference "tkey-mpc-swift" */; + productName = "tkey-mpc-swift"; + }; + 283C54432BC02A85008CD381 /* TorusUtils */ = { + isa = XCSwiftPackageProductDependency; + package = 283C54422BC02A85008CD381 /* XCRemoteSwiftPackageReference "torus-utils-swift" */; + productName = TorusUtils; + }; 285FF2662BBC7D8C00A526F5 /* FirebaseAuth */ = { isa = XCSwiftPackageProductDependency; package = 285FF2652BBC7D8C00A526F5 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; @@ -782,16 +792,6 @@ package = 285FF2682BBC7DF700A526F5 /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */; productName = GoogleSignInSwift; }; - 2882D6902BADC5BD00B3E518 /* ThresholdKey */ = { - isa = XCSwiftPackageProductDependency; - package = 2882D68F2BADC5BD00B3E518 /* XCRemoteSwiftPackageReference "tkey-mpc-swift" */; - productName = ThresholdKey; - }; - 2882D69E2BAE8D2F00B3E518 /* TorusUtils */ = { - isa = XCSwiftPackageProductDependency; - package = 2882D69D2BAE8D2F00B3E518 /* XCRemoteSwiftPackageReference "torus-utils-swift" */; - productName = TorusUtils; - }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 2882D6572BADAE6900B3E518 /* Project object */; diff --git a/tkey-ios-mpc/tkey-ios-mpc.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/tkey-ios-mpc/tkey-ios-mpc.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 59dc9c6..76e4e25 100644 --- a/tkey-ios-mpc/tkey-ios-mpc.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/tkey-ios-mpc/tkey-ios-mpc.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -212,8 +212,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/Web3Auth/session-manager-swift.git", "state" : { - "revision" : "f4e6f24dfe0bac88eb9a7aeda1cd73caad69a9ce", - "version" : "3.0.1" + "revision" : "c89d9205a1ce38cd6c6374b906a9039d9cc03f05", + "version" : "3.1.1" } }, { @@ -221,8 +221,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/Web3Auth/single-factor-auth-swift", "state" : { - "revision" : "30f6a265ff91c85779482d16bc9ed20b930be161", - "version" : "3.0.0" + "revision" : "8baa2b8cf55b0a38cb98c412bea1c6597adb78ba", + "version" : "4.0.0" } }, { @@ -347,8 +347,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/tkey/tkey-mpc-swift", "state" : { - "revision" : "afd10e64b6b28793b5fd981a53c29373759e3242", - "version" : "1.1.0" + "revision" : "0b1020f2fe0c3790bc50aa133bb613ff1b55172f", + "version" : "2.1.0" } }, { @@ -356,8 +356,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/torusresearch/torus-utils-swift", "state" : { - "branch" : "master", - "revision" : "3fb829e71caa275556a067a1ffa1ca579bafbf8e" + "revision" : "04c62fd5f73f21bd01b7c07e08f6135db26c5940", + "version" : "8.0.0" } }, { diff --git a/tkey-ios-mpc/tkey-ios-mpc.xcodeproj/project.xcworkspace/xcuserdata/ayushb.xcuserdatad/UserInterfaceState.xcuserstate b/tkey-ios-mpc/tkey-ios-mpc.xcodeproj/project.xcworkspace/xcuserdata/ayushb.xcuserdatad/UserInterfaceState.xcuserstate index d0e0418..5d9828f 100644 Binary files a/tkey-ios-mpc/tkey-ios-mpc.xcodeproj/project.xcworkspace/xcuserdata/ayushb.xcuserdatad/UserInterfaceState.xcuserstate and b/tkey-ios-mpc/tkey-ios-mpc.xcodeproj/project.xcworkspace/xcuserdata/ayushb.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/tkey-ios-mpc/tkey-ios-mpc.xcodeproj/xcuserdata/ayushb.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/tkey-ios-mpc/tkey-ios-mpc.xcodeproj/xcuserdata/ayushb.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index b1f1c2d..4c109ef 100644 --- a/tkey-ios-mpc/tkey-ios-mpc.xcodeproj/xcuserdata/ayushb.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/tkey-ios-mpc/tkey-ios-mpc.xcodeproj/xcuserdata/ayushb.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -14,8 +14,8 @@ filePath = "tkey-ios-mpc/ViewModels/ThresholdKeyViewModel.swift" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "160" - endingLineNumber = "160" + startingLineNumber = "151" + endingLineNumber = "151" landmarkName = "initialize()" landmarkType = "7"> @@ -62,8 +62,8 @@ filePath = "tkey-ios-mpc/ViewModels/ThresholdKeyViewModel.swift" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "155" - endingLineNumber = "155" + startingLineNumber = "146" + endingLineNumber = "146" landmarkName = "initialize()" landmarkType = "7"> @@ -78,8 +78,8 @@ filePath = "tkey-ios-mpc/ViewModels/ThresholdKeyViewModel.swift" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "689" - endingLineNumber = "689" + startingLineNumber = "676" + endingLineNumber = "676" landmarkName = "showAlert(alertContent:)" landmarkType = "7"> @@ -88,48 +88,16 @@ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> - - - - - - @@ -158,8 +126,8 @@ filePath = "tkey-ios-mpc/ViewModels/ThresholdKeyViewModel.swift" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "342" - endingLineNumber = "342" + startingLineNumber = "333" + endingLineNumber = "333" landmarkName = "addSecurityQuestion(question:answer:)" landmarkType = "7"> @@ -174,8 +142,8 @@ filePath = "tkey-ios-mpc/ViewModels/ThresholdKeyViewModel.swift" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "698" - endingLineNumber = "698" + startingLineNumber = "685" + endingLineNumber = "685" landmarkName = "prepareEthTssAccout(factorKey:)" landmarkType = "7"> @@ -190,8 +158,8 @@ filePath = "tkey-ios-mpc/ViewModels/ThresholdKeyViewModel.swift" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "696" - endingLineNumber = "696" + startingLineNumber = "683" + endingLineNumber = "683" landmarkName = "prepareEthTssAccout(factorKey:)" landmarkType = "7"> @@ -206,8 +174,8 @@ filePath = "tkey-ios-mpc/ViewModels/ThresholdKeyViewModel.swift" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "325" - endingLineNumber = "325" + startingLineNumber = "316" + endingLineNumber = "316" landmarkName = "addSecurityQuestion(question:answer:)" landmarkType = "7"> @@ -222,129 +190,144 @@ filePath = "tkey-ios-mpc/ViewModels/ThresholdKeyViewModel.swift" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "659" - endingLineNumber = "659" + startingLineNumber = "646" + endingLineNumber = "646" landmarkName = "saveNewTSSFactor(newFactorKey:)" landmarkType = "7"> + + diff --git a/tkey-ios-mpc/tkey-ios-mpc.xcodeproj/xcuserdata/ayushb.xcuserdatad/xcschemes/xcschememanagement.plist b/tkey-ios-mpc/tkey-ios-mpc.xcodeproj/xcuserdata/ayushb.xcuserdatad/xcschemes/xcschememanagement.plist index b9351ba..5a508a1 100644 --- a/tkey-ios-mpc/tkey-ios-mpc.xcodeproj/xcuserdata/ayushb.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/tkey-ios-mpc/tkey-ios-mpc.xcodeproj/xcuserdata/ayushb.xcuserdatad/xcschemes/xcschememanagement.plist @@ -9,84 +9,231 @@ isShown orderHint - 11 + 14 + + AnyCodable (Playground) 10.xcscheme + + isShown + + orderHint + 53 + + AnyCodable (Playground) 11.xcscheme + + isShown + + orderHint + 54 + + AnyCodable (Playground) 12.xcscheme + + isShown + + orderHint + 57 + + AnyCodable (Playground) 13.xcscheme + + isShown + + orderHint + 58 + + AnyCodable (Playground) 14.xcscheme + + isShown + + orderHint + 59 AnyCodable (Playground) 2.xcscheme isShown orderHint - 13 + 15 AnyCodable (Playground) 3.xcscheme isShown orderHint - 18 + 22 AnyCodable (Playground) 4.xcscheme isShown orderHint - 19 + 23 AnyCodable (Playground) 5.xcscheme isShown orderHint - 20 + 24 + + AnyCodable (Playground) 6.xcscheme + + isShown + + orderHint + 34 + + AnyCodable (Playground) 7.xcscheme + + isShown + + orderHint + 35 + + AnyCodable (Playground) 8.xcscheme + + isShown + + orderHint + 36 + + AnyCodable (Playground) 9.xcscheme + + isShown + + orderHint + 52 AnyCodable (Playground).xcscheme isShown orderHint - 9 + 13 Demo (Playground) 1.xcscheme isShown orderHint - 1 + 2 + + Demo (Playground) 10.xcscheme + + isShown + + orderHint + 41 + + Demo (Playground) 11.xcscheme + + isShown + + orderHint + 42 + + Demo (Playground) 12.xcscheme + + isShown + + orderHint + 46 + + Demo (Playground) 13.xcscheme + + isShown + + orderHint + 47 + + Demo (Playground) 14.xcscheme + + isShown + + orderHint + 48 + + Demo (Playground) 15.xcscheme + + isShown + + orderHint + 66 + + Demo (Playground) 16.xcscheme + + isShown + + orderHint + 67 + + Demo (Playground) 17.xcscheme + + isShown + + orderHint + 68 Demo (Playground) 2.xcscheme isShown orderHint - 2 + 3 Demo (Playground) 3.xcscheme isShown orderHint - 21 + 10 Demo (Playground) 4.xcscheme isShown orderHint - 22 + 11 Demo (Playground) 5.xcscheme isShown orderHint - 23 + 12 + + Demo (Playground) 6.xcscheme + + isShown + + orderHint + 25 + + Demo (Playground) 7.xcscheme + + isShown + + orderHint + 26 + + Demo (Playground) 8.xcscheme + + isShown + + orderHint + 27 + + Demo (Playground) 9.xcscheme + + isShown + + orderHint + 40 Demo (Playground).xcscheme isShown orderHint - 0 + 1 JWTDecode (Playground) 1.xcscheme @@ -137,33 +284,96 @@ orderHint 8 + Playground (Playground) 10.xcscheme + + isShown + + orderHint + 50 + + Playground (Playground) 11.xcscheme + + isShown + + orderHint + 51 + + Playground (Playground) 12.xcscheme + + isShown + + orderHint + 60 + + Playground (Playground) 13.xcscheme + + isShown + + orderHint + 61 + + Playground (Playground) 14.xcscheme + + isShown + + orderHint + 62 + Playground (Playground) 2.xcscheme isShown orderHint - 10 + 9 Playground (Playground) 3.xcscheme isShown orderHint - 24 + 19 Playground (Playground) 4.xcscheme isShown orderHint - 25 + 20 Playground (Playground) 5.xcscheme isShown orderHint - 26 + 21 + + Playground (Playground) 6.xcscheme + + isShown + + orderHint + 37 + + Playground (Playground) 7.xcscheme + + isShown + + orderHint + 38 + + Playground (Playground) 8.xcscheme + + isShown + + orderHint + 39 + + Playground (Playground) 9.xcscheme + + isShown + + orderHint + 49 Playground (Playground).xcscheme @@ -177,26 +387,131 @@ isShown orderHint - 29 + 5 + + Promises (Playground) 10.xcscheme + + isShown + + orderHint + 32 + + Promises (Playground) 11.xcscheme + + isShown + + orderHint + 33 + + Promises (Playground) 12.xcscheme + + isShown + + orderHint + 43 + + Promises (Playground) 13.xcscheme + + isShown + + orderHint + 44 + + Promises (Playground) 14.xcscheme + + isShown + + orderHint + 45 + + Promises (Playground) 15.xcscheme + + isShown + + orderHint + 63 + + Promises (Playground) 16.xcscheme + + isShown + + orderHint + 64 + + Promises (Playground) 17.xcscheme + + isShown + + orderHint + 65 Promises (Playground) 2.xcscheme + + isShown + + orderHint + 6 + + Promises (Playground) 3.xcscheme + + isShown + + orderHint + 16 + + Promises (Playground) 4.xcscheme + + isShown + + orderHint + 17 + + Promises (Playground) 5.xcscheme + + isShown + + orderHint + 18 + + Promises (Playground) 6.xcscheme + + isShown + + orderHint + 28 + + Promises (Playground) 7.xcscheme + + isShown + + orderHint + 29 + + Promises (Playground) 8.xcscheme isShown orderHint 30 + Promises (Playground) 9.xcscheme + + isShown + + orderHint + 31 + Promises (Playground).xcscheme isShown orderHint - 28 + 4 tkey-ios-mpc.xcscheme_^#shared#^_ orderHint - 3 + 0 diff --git a/tkey-ios-mpc/tkey-ios-mpc/ViewModels/CustomAuthViewModel.swift b/tkey-ios-mpc/tkey-ios-mpc/ViewModels/CustomAuthViewModel.swift index cbd6f20..a366b9e 100644 --- a/tkey-ios-mpc/tkey-ios-mpc/ViewModels/CustomAuthViewModel.swift +++ b/tkey-ios-mpc/tkey-ios-mpc/ViewModels/CustomAuthViewModel.swift @@ -10,33 +10,22 @@ import SingleFactorAuth import FirebaseAuth import GoogleSignIn import FirebaseCore +import TorusUtils class CustomAuthViewModel: ObservableObject { -// var customAuth: CustomAuth! - var torusSFAKey: TorusSFAKey! + var torusSFAKey: TorusKey! var singleFactorAuth: SingleFactorAuth! + var authDataResult: AuthDataResult! @Published var isLoggedIn: Bool = false func intialize() { Task { - let singleFactorAuthArgs = SingleFactorAuthArgs(network: .sapphire(.SAPPHIRE_MAINNET)) + let singleFactorAuthArgs = SingleFactorAuthArgs( + web3AuthClientId: "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ", + network: .SAPPHIRE_MAINNET + ) singleFactorAuth = SingleFactorAuth(singleFactorAuthArgs: singleFactorAuthArgs) -// let subVerifierDetails = SubVerifierDetails( -// loginType: .web, -// loginProvider: .google, -// clientId: "519228911939-cri01h55lsjbsia1k7ll6qpalrus75ps.apps.googleusercontent.com", -// verifier: "w3a-google-demo", -// redirectURL: "tdsdk://tdsdk/oauthCallback", -// browserRedirectURL: "https://scripts.toruswallet.io/redirect.html" -// -// ) -// customAuth = CustomAuth.init( -// aggregateVerifierType: .singleLogin, -// aggregateVerifier: "w3a-google-demo", -// subVerifierDetails: [subVerifierDetails], -// network: .sapphire(.SAPPHIRE_MAINNET) -// ) } } @@ -49,10 +38,9 @@ class CustomAuthViewModel: ObservableObject { guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene else { return } - guard let rootViewController = windowScene.windows.first?.rootViewController else { return } - + - GIDSignIn.sharedInstance.signIn(withPresenting: rootViewController.presentedViewController!) { [unowned self] user, error in + GIDSignIn.sharedInstance.signIn(withPresenting: windowScene.keyWindow!.rootViewController!) { [unowned self] user, error in if(user != nil) { authenticateUser(for: user!, with: error) } else { @@ -67,16 +55,17 @@ class CustomAuthViewModel: ObservableObject { return } - guard let idToken = user?.user.idToken else { return } + guard let idToken = user?.user.idToken else { return } guard let accessToken = user?.user.accessToken else {return} - + let credential = GoogleAuthProvider.credential(withIDToken: idToken.tokenString, accessToken: accessToken.tokenString) - - Auth.auth().signIn(with: credential) { [unowned self] (_, error) in + + Auth.auth().signIn(with: credential) { [unowned self] (result, error) in if let error = error { print(error.localizedDescription) } else { - self.isLoggedIn.toggle() + authDataResult = result! + loginWithSFA() } } } @@ -86,14 +75,14 @@ class CustomAuthViewModel: ObservableObject { func loginWithSFA() { Task { do { -// try await singleFactorAuth.getKey( -// loginParams: LoginParams( -// verifier: <#T##String#>, -// verifierId: <#T##String#>, -// idToken: <#T##String#> -// ) -// ) - torusKeyDetails = try await singleFactorAuth. + torusSFAKey = try await singleFactorAuth.getTorusKey( + loginParams: LoginParams( + verifier: "w3a-firebase-demo", + verifierId: authDataResult.user.uid, + idToken: try authDataResult.user.getIDToken() + ) + ) + DispatchQueue.main.async { self.isLoggedIn.toggle() } diff --git a/tkey-ios-mpc/tkey-ios-mpc/ViewModels/ThresholdKeyViewModel.swift b/tkey-ios-mpc/tkey-ios-mpc/ViewModels/ThresholdKeyViewModel.swift index 04205b5..35d7e28 100644 --- a/tkey-ios-mpc/tkey-ios-mpc/ViewModels/ThresholdKeyViewModel.swift +++ b/tkey-ios-mpc/tkey-ios-mpc/ViewModels/ThresholdKeyViewModel.swift @@ -6,7 +6,6 @@ // import Foundation -import tkey_pkg import TorusUtils import FetchNodeDetails import CommonSources @@ -15,14 +14,14 @@ import web3 import CryptoSwift import UIKit import SingleFactorAuth +import tkey_mpc_swift class ThresholdKeyViewModel: ObservableObject { - - var torusSFAKey: TorusSFAKey + var customAuthViewModel: CustomAuthViewModel var ethereumClient: EthereumClient! - init(torusSFAKey: TorusSFAKey) { - self.torusSFAKey = torusSFAKey + init(customAuthViewModel: CustomAuthViewModel) { + self.customAuthViewModel = customAuthViewModel ethereumClient = EthereumClient() } @@ -54,35 +53,26 @@ class ThresholdKeyViewModel: ObservableObject { func initialize() { Task { do { - guard let finalKeyData = torusSFAKey.getPrivateKey() else { - showAlert(alertContent:"Failed to get public address from userinfo") + guard let postboxkey = self.customAuthViewModel.torusSFAKey.finalKeyData?.privKey else { + showAlert(alertContent: "Not able to retrive private key") return } - guard let verifierLocal = userData.userInfo["verifier"] as? String, let verifierIdLocal = userData.userInfo["verifierId"] as? String else { - showAlert(alertContent: "Failed to get verifier or verifierId from userinfo") - return - } - verifier = verifierLocal - verifierId = verifierIdLocal + verifier = "w3a-firebase-demo" + verifierId = customAuthViewModel.authDataResult.user.uid - guard let postboxkey = finalKeyData.privKey else { - showAlert(alertContent:"Failed to get postboxkey") - return - } + let idToken = try await self.customAuthViewModel.authDataResult.user.getIDToken() - guard let sessionData = userData.torusKey.sessionData else { - showAlert(alertContent:"Failed to get sessionData") + guard let sessionData = self.customAuthViewModel.torusSFAKey.sessionData else { + showAlert(alertContent: "Failed to retrive session data") return } let sessionTokenData = sessionData.sessionTokenData signatures = sessionTokenData.map { token in - return [ "data": Data(hex: token!.token).base64EncodedString(), - "sig": token!.signature ] + return [ "data": Data.init(hex: token!.token).base64EncodedString(), "sig": token!.signature ] } - assert(signatures.isEmpty != true) guard let storage_layer = try? StorageLayer( enable_logging: true, @@ -95,7 +85,8 @@ class ThresholdKeyViewModel: ObservableObject { torusUtils = TorusUtils( enableOneKey: true, - network: .sapphire(.SAPPHIRE_MAINNET) + network: .sapphire(.SAPPHIRE_MAINNET), + clientId: "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ" ) let nodeDetailsManager = NodeDetailManager( @@ -353,13 +344,9 @@ class ThresholdKeyViewModel: ObservableObject { func resetAccount() { Task { do { - guard let finalKeyData = userData.torusKey.finalKeyData else { - showAlert(alertContent:"Failed to get public address from userinfo") - return - } - guard let postboxkey = finalKeyData.privKey else { - showAlert(alertContent: "Failed to get public address from userinfo") + guard let postboxkey = self.customAuthViewModel.torusSFAKey.finalKeyData?.privKey else { + showAlert(alertContent: "Not able to retrive private key") return } @@ -743,7 +730,7 @@ class ThresholdKeyViewModel: ObservableObject { selectedTag: tag, verifier: verifier, verifierID: verifierId, - nodeIndexes: tssPublicAddressInfo.nodeIndexes.sorted(), + nodeIndexes: tssPublicAddressInfo.nodeIndexes, tssEndpoints: tssEndPoints, authSigs: sigs ) diff --git a/tkey-ios-mpc/tkey-ios-mpc/Views/ContentView.swift b/tkey-ios-mpc/tkey-ios-mpc/Views/ContentView.swift index ebb8deb..8079732 100644 --- a/tkey-ios-mpc/tkey-ios-mpc/Views/ContentView.swift +++ b/tkey-ios-mpc/tkey-ios-mpc/Views/ContentView.swift @@ -14,7 +14,7 @@ struct ContentView: View { NavigationView { if customAuthViewModel.isLoggedIn { ThresholdKeyView(thresholdKeyViewModel: ThresholdKeyViewModel( - userData: customAuthViewModel.torusKeyDetails + customAuthViewModel: customAuthViewModel )) } else {