diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/project.pbxproj b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/project.pbxproj index a128c8aa..1f218405 100644 --- a/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/project.pbxproj +++ b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/project.pbxproj @@ -23,10 +23,9 @@ 281ED74C2BE0EC77002E990C /* RecoveryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 281ED74B2BE0EC77002E990C /* RecoveryView.swift */; }; 281ED74E2BE0EC8F002E990C /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 281ED74D2BE0EC8F002E990C /* HomeView.swift */; }; 282411192BE0F5590097006B /* LoadingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 282411182BE0F5590097006B /* LoadingView.swift */; }; - 2847121A2BFB825A0088411D /* mpc-core-kit-swift in Frameworks */ = {isa = PBXBuildFile; productRef = 284712192BFB825A0088411D /* mpc-core-kit-swift */; }; - 2847121D2BFB826A0088411D /* MpcProviderSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 2847121C2BFB826A0088411D /* MpcProviderSwift */; }; 2847121F2BFB83250088411D /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2847121E2BFB83250088411D /* Extensions.swift */; }; - 28BE823B2BF37114008A2B0C /* JWTDecode in Frameworks */ = {isa = PBXBuildFile; productRef = 28BE823A2BF37114008A2B0C /* JWTDecode */; }; + 28D0FE942D35831A00B32EAE /* MpcProviderSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 28D0FE932D35831A00B32EAE /* MpcProviderSwift */; }; + 28D0FE972D35849500B32EAE /* mpc-core-kit-swift in Frameworks */ = {isa = PBXBuildFile; productRef = 28D0FE962D35849500B32EAE /* mpc-core-kit-swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -73,11 +72,10 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 28D0FE942D35831A00B32EAE /* MpcProviderSwift in Frameworks */, 281ED73D2BE0E5AF002E990C /* Auth0 in Frameworks */, 281ED7402BE0E5DD002E990C /* web3.swift in Frameworks */, - 28BE823B2BF37114008A2B0C /* JWTDecode in Frameworks */, - 2847121A2BFB825A0088411D /* mpc-core-kit-swift in Frameworks */, - 2847121D2BFB826A0088411D /* MpcProviderSwift in Frameworks */, + 28D0FE972D35849500B32EAE /* mpc-core-kit-swift in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -206,9 +204,8 @@ packageProductDependencies = ( 281ED73C2BE0E5AF002E990C /* Auth0 */, 281ED73F2BE0E5DD002E990C /* web3.swift */, - 28BE823A2BF37114008A2B0C /* JWTDecode */, - 284712192BFB825A0088411D /* mpc-core-kit-swift */, - 2847121C2BFB826A0088411D /* MpcProviderSwift */, + 28D0FE932D35831A00B32EAE /* MpcProviderSwift */, + 28D0FE962D35849500B32EAE /* mpc-core-kit-swift */, ); productName = "mpc-core-kit-ios-auth0"; productReference = 281ED7032BE0DFB9002E990C /* mpc-core-kit-ios-auth0.app */; @@ -285,9 +282,8 @@ packageReferences = ( 281ED73B2BE0E5AF002E990C /* XCRemoteSwiftPackageReference "Auth0" */, 281ED73E2BE0E5DD002E990C /* XCRemoteSwiftPackageReference "web3" */, - 28BE82392BF37114008A2B0C /* XCRemoteSwiftPackageReference "JWTDecode" */, - 284712182BFB825A0088411D /* XCRemoteSwiftPackageReference "mpc-core-kit-swift" */, - 2847121B2BFB826A0088411D /* XCRemoteSwiftPackageReference "MpcProviderSwift" */, + 28D0FE922D35831A00B32EAE /* XCRemoteSwiftPackageReference "MpcProviderSwift" */, + 28D0FE952D35849500B32EAE /* XCRemoteSwiftPackageReference "mpc-core-kit-swift" */, ); productRefGroup = 281ED7042BE0DFB9002E990C /* Products */; projectDirPath = ""; @@ -679,7 +675,7 @@ repositoryURL = "https://github.com/auth0/Auth0.swift"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 2.7.0; + minimumVersion = 2.9.0; }; }; 281ED73E2BE0E5DD002E990C /* XCRemoteSwiftPackageReference "web3" */ = { @@ -690,28 +686,20 @@ minimumVersion = 1.6.1; }; }; - 284712182BFB825A0088411D /* XCRemoteSwiftPackageReference "mpc-core-kit-swift" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/tkey/mpc-core-kit-swift"; - requirement = { - branch = main; - kind = branch; - }; - }; - 2847121B2BFB826A0088411D /* XCRemoteSwiftPackageReference "MpcProviderSwift" */ = { + 28D0FE922D35831A00B32EAE /* XCRemoteSwiftPackageReference "MpcProviderSwift" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/tkey/MpcProviderSwift"; requirement = { - branch = main; + branch = "feat/update-dependency"; kind = branch; }; }; - 28BE82392BF37114008A2B0C /* XCRemoteSwiftPackageReference "JWTDecode" */ = { + 28D0FE952D35849500B32EAE /* XCRemoteSwiftPackageReference "mpc-core-kit-swift" */ = { isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/auth0/JWTDecode.swift"; + repositoryURL = "https://github.com/tkey/mpc-core-kit-swift"; requirement = { - kind = upToNextMajorVersion; - minimumVersion = 3.1.0; + branch = update_dependencies; + kind = branch; }; }; /* End XCRemoteSwiftPackageReference section */ @@ -727,20 +715,15 @@ package = 281ED73E2BE0E5DD002E990C /* XCRemoteSwiftPackageReference "web3" */; productName = web3.swift; }; - 284712192BFB825A0088411D /* mpc-core-kit-swift */ = { - isa = XCSwiftPackageProductDependency; - package = 284712182BFB825A0088411D /* XCRemoteSwiftPackageReference "mpc-core-kit-swift" */; - productName = "mpc-core-kit-swift"; - }; - 2847121C2BFB826A0088411D /* MpcProviderSwift */ = { + 28D0FE932D35831A00B32EAE /* MpcProviderSwift */ = { isa = XCSwiftPackageProductDependency; - package = 2847121B2BFB826A0088411D /* XCRemoteSwiftPackageReference "MpcProviderSwift" */; + package = 28D0FE922D35831A00B32EAE /* XCRemoteSwiftPackageReference "MpcProviderSwift" */; productName = MpcProviderSwift; }; - 28BE823A2BF37114008A2B0C /* JWTDecode */ = { + 28D0FE962D35849500B32EAE /* mpc-core-kit-swift */ = { isa = XCSwiftPackageProductDependency; - package = 28BE82392BF37114008A2B0C /* XCRemoteSwiftPackageReference "JWTDecode" */; - productName = JWTDecode; + package = 28D0FE952D35849500B32EAE /* XCRemoteSwiftPackageReference "mpc-core-kit-swift" */; + productName = "mpc-core-kit-swift"; }; /* End XCSwiftPackageProductDependency section */ }; diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 657bb4e1..ba8ba572 100644 --- a/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,31 +1,22 @@ { - "originHash" : "6eb679ca10e6ba273c0a4c520af3222830fe4d28810a355d4409ece0c2cf4329", + "originHash" : "e8eff63083561ba987d76bd5bb3c8628eea4fc9a94f6b90b01d9bd73ba50da93", "pins" : [ - { - "identity" : "anycodable", - "kind" : "remoteSourceControl", - "location" : "https://github.com/Flight-School/AnyCodable", - "state" : { - "revision" : "862808b2070cd908cb04f9aafe7de83d35f81b05", - "version" : "0.6.7" - } - }, { "identity" : "auth0.swift", "kind" : "remoteSourceControl", "location" : "https://github.com/auth0/Auth0.swift", "state" : { - "revision" : "ecd6fbd0c00d2144d9275a6dbceb213afc7f2a2d", - "version" : "2.7.0" + "revision" : "9fee002fcd5fa572c0452eaeb9fb7a75be5fa4de", + "version" : "2.10.0" } }, { "identity" : "bigint", "kind" : "remoteSourceControl", - "location" : "https://github.com/attaswift/BigInt.git", + "location" : "https://github.com/attaswift/BigInt", "state" : { - "revision" : "0ed110f7555c34ff468e72e1686e59721f2b0da6", - "version" : "5.3.0" + "revision" : "114343a705df4725dfe7ab8a2a326b8883cfd79c", + "version" : "5.5.1" } }, { @@ -33,8 +24,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/tkey/curvelib.swift", "state" : { - "revision" : "9f88bd5e56d1df443a908f7a7e81ae4f4d9170ea", - "version" : "1.0.1" + "revision" : "432bf1abe7ff505fc2ac9fcf697341ff5b2dc6d0", + "version" : "2.0.0" } }, { @@ -42,17 +33,17 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/torusresearch/customauth-swift-sdk", "state" : { - "revision" : "60b48acb161fb4341c353c27bc6dd96af76887ff", - "version" : "10.0.1" + "revision" : "67f947d087e1c9c6ca37c6627b595fe6913bc558", + "version" : "11.0.2" } }, { "identity" : "fetch-node-details-swift", "kind" : "remoteSourceControl", - "location" : "https://github.com/torusresearch/fetch-node-details-swift.git", + "location" : "https://github.com/torusresearch/fetch-node-details-swift", "state" : { - "revision" : "22bfadf7491d77a0bc1953af002cadbd61383e7d", - "version" : "6.0.2" + "revision" : "52fb5efaa94e0fe3775913ab00964bcb51601c2a", + "version" : "8.0.0" } }, { @@ -69,17 +60,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/auth0/JWTDecode.swift.git", "state" : { - "revision" : "58af7278797871e460d79496621b3e5366b865b2", - "version" : "3.1.0" - } - }, - { - "identity" : "keychain-swift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/evgenyneu/keychain-swift.git", - "state" : { - "revision" : "d108a1fa6189e661f91560548ef48651ed8d93b9", - "version" : "20.0.0" + "revision" : "1e153ef009969543191970c66b7c60163c0b4a65", + "version" : "3.2.0" } }, { @@ -87,8 +69,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/tkey/mpc-core-kit-swift", "state" : { - "branch" : "main", - "revision" : "183f205cb24ff8aa9c6c59bea905f365fe03d34e" + "branch" : "update_dependencies", + "revision" : "9b37f29c0f9a2805ec396d35fa73295a8ba0e5e3" } }, { @@ -96,8 +78,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/tkey/MpcProviderSwift", "state" : { - "branch" : "main", - "revision" : "f087b89ee543710fc23b35dc05fa233b1d16b7e1" + "branch" : "feat/update-dependency", + "revision" : "1e8aa2e96cfea11488736b79ff29a81d0e1fbac2" } }, { @@ -105,17 +87,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/GigaBitcoin/secp256k1.swift.git", "state" : { - "revision" : "347b84ed2aad2305a7233f2a48d76f41e52062a1", - "version" : "0.16.0" - } - }, - { - "identity" : "session-manager-swift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/Web3Auth/session-manager-swift.git", - "state" : { - "revision" : "20cc7bff065d7fe53164d17e7714a3f17d4cea2a", - "version" : "4.0.2" + "revision" : "9683e8e311c76d8114cd308b697dad2f9fc58fed", + "version" : "0.17.0" } }, { @@ -123,17 +96,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/auth0/SimpleKeychain.git", "state" : { - "revision" : "f082494aab8056139a4fe234c920a9f92f681aff", - "version" : "1.1.0" - } - }, - { - "identity" : "single-factor-auth-swift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/Web3Auth/single-factor-auth-swift", - "state" : { - "revision" : "73c5066d369c7d2aa1057c56a89b7f1dcdda3270", - "version" : "5.0.0" + "revision" : "b694f155907b189bc82e93586695a26f558c742f", + "version" : "1.2.0" } }, { @@ -141,8 +105,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/socketio/socket.io-client-swift", "state" : { - "revision" : "175da8b5156f6b132436f0676cc84c2f6a766b6e", - "version" : "16.1.0" + "revision" : "42da871d9369f290d6ec4930636c40672143905b", + "version" : "16.1.1" } }, { @@ -150,8 +114,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/daltoniam/Starscream", "state" : { - "revision" : "ac6c0fc9da221873e01bd1a0d4818498a71eef33", - "version" : "4.0.6" + "revision" : "c6bfd1af48efcc9a9ad203665db12375ba6b145a", + "version" : "4.0.8" } }, { @@ -168,8 +132,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-collections.git", "state" : { - "revision" : "94cf62b3ba8d4bed62680a282d4c25f9c63c2efb", - "version" : "1.1.0" + "revision" : "671108c96644956dddcd89dd59c203dcdb36cec7", + "version" : "1.1.4" } }, { @@ -177,8 +141,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-http-types", "state" : { - "revision" : "12358d55a3824bd5fed310b999ea8cf83a9a1a65", - "version" : "1.0.3" + "revision" : "ef18d829e8b92d731ad27bb81583edd2094d1ce3", + "version" : "1.3.1" } }, { @@ -186,8 +150,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-log.git", "state" : { - "revision" : "e97a6fcb1ab07462881ac165fdbb37f067e205d5", - "version" : "1.5.4" + "revision" : "96a2f8a0fa41e9e09af4585e2724c4e825410b91", + "version" : "1.6.2" } }, { @@ -195,8 +159,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio.git", "state" : { - "revision" : "359c461e5561d22c6334828806cc25d759ca7aa6", - "version" : "2.65.0" + "revision" : "27c839f4700069928196cd0e9fa03b22f297078a", + "version" : "2.78.0" } }, { @@ -204,8 +168,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-extras.git", "state" : { - "revision" : "a3b640d7dc567225db7c94386a6e71aded1bfa63", - "version" : "1.22.0" + "revision" : "2e9746cfc57554f70b650b021b6ae4738abef3e6", + "version" : "1.24.1" } }, { @@ -213,8 +177,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-http2.git", "state" : { - "revision" : "c6afe04165c865faaa687b42c32ed76dfcc91076", - "version" : "1.31.0" + "revision" : "170f4ca06b6a9c57b811293cebcb96e81b661310", + "version" : "1.35.0" } }, { @@ -222,8 +186,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-ssl.git", "state" : { - "revision" : "7c381eb6083542b124a6c18fae742f55001dc2b5", - "version" : "2.26.0" + "revision" : "c7e95421334b1068490b5d41314a50e70bab23d1", + "version" : "2.29.0" } }, { @@ -231,8 +195,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-transport-services.git", "state" : { - "revision" : "6cbe0ed2b394f21ab0d46b9f0c50c6be964968ce", - "version" : "1.20.1" + "revision" : "bbd5e63cf949b7db0c9edaf7a21e141c52afe214", + "version" : "1.23.0" } }, { @@ -240,8 +204,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-system.git", "state" : { - "revision" : "025bcb1165deab2e20d4eaba79967ce73013f496", - "version" : "1.2.1" + "revision" : "c8a44d836fe7913603e246acab7c528c2e780168", + "version" : "1.4.0" } }, { @@ -249,8 +213,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/tkey/tkey-mpc-swift", "state" : { - "revision" : "8fe0cc8d5cc2ad5d38bf068bc29f6af7e3146d08", - "version" : "3.0.0" + "revision" : "b6d9d1013f21f51105e845a0c16ee39b2f01fd1c", + "version" : "4.0.1" } }, { @@ -258,8 +222,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/torusresearch/torus-utils-swift.git", "state" : { - "revision" : "ff85c3e96bfa29013309b487875c4d9383e4ac80", - "version" : "8.1.1" + "revision" : "baa822fc67bdb208ed1a2dc5b3c10485cfca15df", + "version" : "10.0.0" } }, { @@ -267,8 +231,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/torusresearch/tss-client-swift.git", "state" : { - "revision" : "40246d5e3ff1d2c97d41846576f7a81d58858981", - "version" : "4.0.0" + "revision" : "6f00e4e03184a77eea0330b5b8d092d1452b9eb4", + "version" : "5.0.1" } }, { diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/project.xcworkspace/xcuserdata/apollo.xcuserdatad/UserInterfaceState.xcuserstate b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/project.xcworkspace/xcuserdata/apollo.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 00000000..1ef4dedc Binary files /dev/null and b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/project.xcworkspace/xcuserdata/apollo.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/project.xcworkspace/xcuserdata/ayushb.xcuserdatad/UserInterfaceState.xcuserstate b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/project.xcworkspace/xcuserdata/ayushb.xcuserdatad/UserInterfaceState.xcuserstate index c0c2289d..94549608 100644 Binary files a/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/project.xcworkspace/xcuserdata/ayushb.xcuserdatad/UserInterfaceState.xcuserstate and b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/project.xcworkspace/xcuserdata/ayushb.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/xcuserdata/apollo.xcuserdatad/xcschemes/xcschememanagement.plist b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/xcuserdata/apollo.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 00000000..ead12ed7 --- /dev/null +++ b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/xcuserdata/apollo.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + mpc-core-kit-ios-auth0.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/xcuserdata/ayushb.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/xcuserdata/ayushb.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 023f2cb8..05f5b075 100644 --- a/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/xcuserdata/ayushb.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/xcuserdata/ayushb.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -16,7 +16,7 @@ endingColumnNumber = "9223372036854775807" startingLineNumber = "345" endingLineNumber = "345" - landmarkName = "inputFactor(factorKey:)" + landmarkName = "newUser()" landmarkType = "7"> @@ -50,53 +50,6 @@ endingLineNumber = "57" landmarkName = "tssSign(message:)" landmarkType = "7"> - - - - - - - - - - - - - - @@ -223,8 +144,8 @@ endingColumnNumber = "9223372036854775807" startingLineNumber = "207" endingLineNumber = "207" - landmarkName = "addNewFactor(newFactorKey:tssShareIndex:)" - landmarkType = "7"> + landmarkName = "MpcCoreKit" + landmarkType = "21"> @@ -269,9 +190,9 @@ filePath = "mpc-core-kit-ios-auth0/Models/MainViewModel.swift" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "318" - endingLineNumber = "318" - landmarkName = "toggleIsLoggedIn()" + startingLineNumber = "348" + endingLineNumber = "348" + landmarkName = "refreshFactorPubs()" landmarkType = "7"> @@ -285,8 +206,8 @@ filePath = "mpc-core-kit-ios-auth0/Models/MainViewModel.swift" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "243" - endingLineNumber = "243" + startingLineNumber = "240" + endingLineNumber = "240" landmarkName = "recoverUsingSeedPhrase(seedPhrase:)" landmarkType = "7"> @@ -301,8 +222,8 @@ filePath = "mpc-core-kit-ios-auth0/Models/MainViewModel.swift" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "242" - endingLineNumber = "242" + startingLineNumber = "239" + endingLineNumber = "239" landmarkName = "recoverUsingSeedPhrase(seedPhrase:)" landmarkType = "7"> @@ -317,10 +238,10 @@ filePath = "mpc-core-kit-ios-auth0/Models/MainViewModel.swift" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "34" - endingLineNumber = "34" - landmarkName = "initialize()" - landmarkType = "7"> + startingLineNumber = "36" + endingLineNumber = "36" + landmarkName = "MainViewModel" + landmarkType = "3"> - - - - - - - - - - - - + landmarkName = "MpcCoreKit" + landmarkType = "21"> - - - - - - - - - - - - + endingLineNumber = "318"> + endingLineNumber = "320"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/xcuserdata/ayushb.xcuserdatad/xcschemes/xcschememanagement.plist b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/xcuserdata/ayushb.xcuserdatad/xcschemes/xcschememanagement.plist index 231e1996..c4a7c4f3 100644 --- a/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/xcuserdata/ayushb.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0.xcodeproj/xcuserdata/ayushb.xcuserdatad/xcschemes/xcschememanagement.plist @@ -30,63 +30,189 @@ isShown orderHint - 7 + 6 Demo (Playground) 2.xcscheme isShown orderHint - 8 + 7 + + Demo (Playground) 3.xcscheme + + isShown + + orderHint + 13 + + Demo (Playground) 4.xcscheme + + isShown + + orderHint + 15 + + Demo (Playground) 5.xcscheme + + isShown + + orderHint + 16 + + Demo (Playground) 6.xcscheme + + isShown + + orderHint + 31 + + Demo (Playground) 7.xcscheme + + isShown + + orderHint + 32 + + Demo (Playground) 8.xcscheme + + isShown + + orderHint + 33 Demo (Playground).xcscheme isShown orderHint - 6 + 4 JWTDecode (Playground) 1.xcscheme isShown orderHint - 13 + 2 JWTDecode (Playground) 2.xcscheme isShown orderHint - 14 + 3 + + JWTDecode (Playground) 3.xcscheme + + isShown + + orderHint + 5 + + JWTDecode (Playground) 4.xcscheme + + isShown + + orderHint + 9 + + JWTDecode (Playground) 5.xcscheme + + isShown + + orderHint + 10 + + JWTDecode (Playground) 6.xcscheme + + isShown + + orderHint + 28 + + JWTDecode (Playground) 7.xcscheme + + isShown + + orderHint + 29 + + JWTDecode (Playground) 8.xcscheme + + isShown + + orderHint + 30 JWTDecode (Playground).xcscheme isShown orderHint - 12 + 1 Playground (Playground) 1.xcscheme isShown orderHint - 17 + 11 Playground (Playground) 2.xcscheme isShown orderHint - 18 + 14 + + Playground (Playground) 3.xcscheme + + isShown + + orderHint + 12 + + Playground (Playground) 4.xcscheme + + isShown + + orderHint + 21 + + Playground (Playground) 5.xcscheme + + isShown + + orderHint + 23 + + Playground (Playground) 6.xcscheme + + isShown + + orderHint + 25 + + Playground (Playground) 7.xcscheme + + isShown + + orderHint + 26 + + Playground (Playground) 8.xcscheme + + isShown + + orderHint + 27 Playground (Playground).xcscheme isShown orderHint - 16 + 8 mpc-core-kit-ios-auth0.xcscheme_^#shared#^_ diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0/Helpers/EthereumClient.swift b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0/Helpers/EthereumClient.swift index 0f2b0236..0836efc8 100644 --- a/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0/Helpers/EthereumClient.swift +++ b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0/Helpers/EthereumClient.swift @@ -26,7 +26,7 @@ struct EthereumClient { let nonce = try await web3Client.eth_getTransactionCount( address: address, block: .Latest ) - return nonce + 1 + return nonce } catch let error { throw error } diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0/Helpers/Extensions.swift b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0/Helpers/Extensions.swift index 2baf860b..1c320ec0 100644 --- a/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0/Helpers/Extensions.swift +++ b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0/Helpers/Extensions.swift @@ -13,7 +13,7 @@ import web3 extension MpcCoreKit : EvmSigner { public func sign(message: Data) throws -> Data { - let data = try self.tssSign(message: message) + let data = try self.tssSignSync(message: message) return data } @@ -21,9 +21,10 @@ extension MpcCoreKit : EvmSigner { let fullAddress = try! KeyPoint( address: self.getTssPubKey().hexString ).getPublicKey(format: .FullAddress) - - return Data(hex: fullAddress).suffix(64) + + + return Data(hex: fullAddress)?.suffix(64) ?? Data() } - + } diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0/Helpers/UserStorage.swift b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0/Helpers/UserStorage.swift index dcd1e792..f94df2cf 100644 --- a/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0/Helpers/UserStorage.swift +++ b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0/Helpers/UserStorage.swift @@ -8,7 +8,7 @@ import Foundation import mpc_core_kit_swift -class UserStorage : ILocalStorage { +class UserStorage : IStorage { func get(key: String) async throws -> Data { print(key) guard let data = UserDefaults().value(forKey: key) as? Data else { diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0/Models/MainViewModel.swift b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0/Models/MainViewModel.swift index 545feb22..97c9fd26 100644 --- a/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0/Models/MainViewModel.swift +++ b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0/Models/MainViewModel.swift @@ -13,6 +13,8 @@ import UIKit import tkey import Auth0 import JWTDecode +import CustomAuth +import curveSecp256k1 class MainViewModel: ObservableObject { @Published var isLoggedIn: Bool = false @@ -28,15 +30,17 @@ class MainViewModel: ObservableObject { private var ethereumClient: EthereumClient! private var mpcEthereumProvider: MPCEthereumProvider! private var webAuth: WebAuth! - var userInfo: [String: Any]! + var userInfo: Any? var alertContent: String = "" var loaderContent: String = "" func initialize() { - mpcCoreKit = MpcCoreKit( - web3AuthClientId: "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ", - web3AuthNetwork: .SAPPHIRE_MAINNET, - localStorage: UserStorage() + mpcCoreKit = try! MpcCoreKit( + options: .init( + web3AuthClientId: "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ", + web3AuthNetwork: .SAPPHIRE_MAINNET, + storage: UserStorage() + ) ) webAuth = Auth0.webAuth(clientId: "hUVVf4SEsZT7syOiL0gLU9hFEtm2gQ6O", domain: "web3auth.au.auth0.com") @@ -55,7 +59,7 @@ class MainViewModel: ObservableObject { let jwt = try decode(jwt: auth0Creds.idToken) guard let sub = jwt.body["sub"] as? String else { - throw "Sub not found in JWT" + return } let result = try await mpcCoreKit.loginWithJwt( @@ -64,15 +68,15 @@ class MainViewModel: ObservableObject { idToken: auth0Creds.idToken ) - userInfo = try mpcCoreKit.getUserInfo() + userInfo = mpcCoreKit.getUserInfo() - DispatchQueue.main.async { - self.isRecoveryRequired = result.requiredFactors > 0 - } - - if(!self.isRecoveryRequired) { + if(!(result.requiredFactors > 0)) { try await login() - + + } else { + DispatchQueue.main.async { + self.isRecoveryRequired = true + } } hideLoader() @@ -154,7 +158,7 @@ class MainViewModel: ObservableObject { ) let transaction = EthereumTransaction.init( to: address, - data: Data.init(hex: "0x00") + data: Data.init(hex: "0x00")! ) let gasLimit = try await self.ethereumClient.getGasLimit( @@ -169,7 +173,7 @@ class MainViewModel: ObservableObject { value: 1000000000000, data: transaction.data, nonce: nonce, - gasPrice: gasPrice, + gasPrice: gasPrice.multiplied(by: .init(stringLiteral: "2")), gasLimit: gasLimit, chainId: Int(self.ethereumClient.getChainId()) ) @@ -199,17 +203,14 @@ class MainViewModel: ObservableObject { do { showLoader("Adding new factor") let factor = try await mpcCoreKit.createFactor( - tssShareIndex: .RECOVERY, + tssShareIndex: .recovery, factorKey: nil, factorDescription: .SeedPhrase ) - guard let seedPhrase = mpcCoreKit.keyToMnemonic( - factorKey: factor, - format: "mnemonic" - ) else { - return - } + let seedPhrase = try mpcCoreKit.keyToMnemonic( + factorKey: factor + ) print(seedPhrase) @@ -228,13 +229,9 @@ class MainViewModel: ObservableObject { Task { do { showLoader("Recovering account") - guard let factorKey = mpcCoreKit.mnemonicToKey( - shareMnemonic: seedPhrase, - format: "mnemonic" - ) else { - hideLoader() - return - } + let factorKey = try mpcCoreKit.mnemonicToKey( + shareMnemonic: seedPhrase + ) try await mpcCoreKit.inputFactor( factorKey: factorKey @@ -254,18 +251,48 @@ class MainViewModel: ObservableObject { } } + func setDeviceFactor() { + Task { + do { + showLoader("Setting Device Factor") + let deviceFactor = try curveSecp256k1.SecretKey().serialize() + try await mpcCoreKit.setDeviceFactor(factorKey: deviceFactor) + + showAlert(message: "Device Factor added successfully") + hideLoader() + await refreshFactorPubs() + } catch let error { + hideLoader() + print(error.localizedDescription) + showAlert(message: error.localizedDescription) + } + } + } + + func getDeviceFactor() { + Task { + do { + showLoader("Deleting Device Factor") + let deviceFactor = try await mpcCoreKit.getDeviceFactor() + + showAlert(message: "Device Factor: " + deviceFactor) + hideLoader() + } catch let error { + hideLoader() + print(error.localizedDescription) + showAlert(message: error.localizedDescription) + } + } + } + func enableMFA() { Task { do { showLoader("Enabling MFA") - let recoveryFactorKey = try await mpcCoreKit.enableMFA() - guard let seedPhrase = mpcCoreKit.keyToMnemonic( - factorKey: recoveryFactorKey!, - format: "mnemonic" - ) else { - hideLoader() - return - } + let recoveryFactorKey = try await mpcCoreKit.enableMFAWithRecoveryFactor() + let seedPhrase = try mpcCoreKit.keyToMnemonic( + factorKey: recoveryFactorKey + ) print(seedPhrase) @@ -282,8 +309,9 @@ class MainViewModel: ObservableObject { } private func login() async throws { - let pubKey = try await mpcCoreKit.getTssPubKey() + let pubKey = try mpcCoreKit.getTssPubKey() let keyDetails = try await mpcCoreKit.getKeyDetails() + print("Description") print(keyDetails.requiredFactors) mpcEthereumProvider = MPCEthereumProvider(evmSigner: mpcCoreKit) @@ -294,7 +322,7 @@ class MainViewModel: ObservableObject { let address = KeyUtil.generateAddress( - from: Data(hex: fullAddress).suffix(64) + from: Data(hex: fullAddress)!.suffix(64) ) print(address) @@ -313,6 +341,8 @@ class MainViewModel: ObservableObject { private func refreshFactorPubs() async { do { + let keyDetails = try await mpcCoreKit.getKeyDetails() + print(keyDetails.shareDescriptions) let localFactorPubs = try await mpcCoreKit.getAllFactorPubs() DispatchQueue.main.async { self.factorPubs = localFactorPubs diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0/Views/ContentView.swift b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0/Views/ContentView.swift index 3d00eef9..65a22047 100644 --- a/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0/Views/ContentView.swift +++ b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0/Views/ContentView.swift @@ -13,11 +13,7 @@ struct ContentView: View { var body: some View { NavigationView { if viewModel.isLoggedIn { - if viewModel.isRecoveryRequired { - RecoveryView(viewModel: viewModel) - } else { - HomeView(viewModel: viewModel) - } + HomeView(viewModel: viewModel) } else if viewModel.isRecoveryRequired { RecoveryView(viewModel: viewModel) } else { diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0/Views/HomeView.swift b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0/Views/HomeView.swift index 6ddab027..dddefdb8 100644 --- a/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0/Views/HomeView.swift +++ b/mpc-core-kit-ios/mpc-core-kit-ios-auth0/mpc-core-kit-ios-auth0/Views/HomeView.swift @@ -6,6 +6,7 @@ // import SwiftUI +import CustomAuth struct HomeView: View { @StateObject var viewModel: MainViewModel @@ -30,7 +31,7 @@ struct HomeView: View { Button( action: { - viewModel.showAlert(message: viewModel.userInfo.debugDescription) + viewModel.showAlert(message: (viewModel.userInfo as! UserInfo).name) }, label: { Text("View User info") }) @@ -118,6 +119,22 @@ struct HomeView: View { Text("Enable MFA") } ) + Button( + action: { + viewModel.setDeviceFactor() + }, + label: { + Text("Set Device Factor") + } + ) + Button( + action: { + viewModel.getDeviceFactor() + }, + label: { + Text("Get Device Factor") + } + ) Button( action: { viewModel.createNewTssFactor() diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.xcodeproj/project.pbxproj b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.xcodeproj/project.pbxproj index 9574f6c3..20f5f900 100644 --- a/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.xcodeproj/project.pbxproj +++ b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.xcodeproj/project.pbxproj @@ -7,9 +7,7 @@ objects = { /* Begin PBXBuildFile section */ - 284712222BFB94220088411D /* MpcProviderSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 284712212BFB94220088411D /* MpcProviderSwift */; }; 284712242BFB94450088411D /* Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 284712232BFB94450088411D /* Extension.swift */; }; - 284712272BFB97FE0088411D /* mpc-core-kit-swift in Frameworks */ = {isa = PBXBuildFile; productRef = 284712262BFB97FE0088411D /* mpc-core-kit-swift */; }; 284BE5FE2BC509500049C203 /* mpc_core_kit_ios_quick_startApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 284BE5FD2BC509500049C203 /* mpc_core_kit_ios_quick_startApp.swift */; }; 284BE6002BC509500049C203 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 284BE5FF2BC509500049C203 /* ContentView.swift */; }; 284BE6022BC509520049C203 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 284BE6012BC509520049C203 /* Assets.xcassets */; }; @@ -23,6 +21,9 @@ 284BE6342BC512A80049C203 /* RecoveryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 284BE6332BC512A80049C203 /* RecoveryView.swift */; }; 284BE6362BC512B20049C203 /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 284BE6352BC512B20049C203 /* HomeView.swift */; }; 284BE63E2BC55A080049C203 /* EthereumHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 284BE63D2BC55A080049C203 /* EthereumHelper.swift */; }; + F0B964702D376989008A3FE1 /* LoadingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0B9646F2D376983008A3FE1 /* LoadingView.swift */; }; + F0EB92902D27C1270024D038 /* mpc-core-kit-swift in Frameworks */ = {isa = PBXBuildFile; productRef = F0EB928F2D27C1270024D038 /* mpc-core-kit-swift */; }; + F0EB92922D27C12A0024D038 /* MpcProviderSwift in Frameworks */ = {isa = PBXBuildFile; productRef = F0EB92912D27C12A0024D038 /* MpcProviderSwift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -60,6 +61,8 @@ 284BE6332BC512A80049C203 /* RecoveryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecoveryView.swift; sourceTree = ""; }; 284BE6352BC512B20049C203 /* HomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeView.swift; sourceTree = ""; }; 284BE63D2BC55A080049C203 /* EthereumHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EthereumHelper.swift; sourceTree = ""; }; + F09C56682D2F93C00056861D /* mpc-core-kit-ios-quick-start.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "mpc-core-kit-ios-quick-start.entitlements"; sourceTree = ""; }; + F0B9646F2D376983008A3FE1 /* LoadingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadingView.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -67,8 +70,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 284712222BFB94220088411D /* MpcProviderSwift in Frameworks */, - 284712272BFB97FE0088411D /* mpc-core-kit-swift in Frameworks */, + F0EB92922D27C12A0024D038 /* MpcProviderSwift in Frameworks */, + F0EB92902D27C1270024D038 /* mpc-core-kit-swift in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -95,6 +98,7 @@ 284BE5FC2BC509500049C203 /* mpc-core-kit-ios-quick-start */, 284BE60D2BC509520049C203 /* mpc-core-kit-ios-quick-startTests */, 284BE6172BC509520049C203 /* mpc-core-kit-ios-quick-startUITests */, + F0EB928E2D27C1270024D038 /* Frameworks */, 284BE5FB2BC509500049C203 /* Products */, ); sourceTree = ""; @@ -112,6 +116,7 @@ 284BE5FC2BC509500049C203 /* mpc-core-kit-ios-quick-start */ = { isa = PBXGroup; children = ( + F09C56682D2F93C00056861D /* mpc-core-kit-ios-quick-start.entitlements */, 284BE6302BC50C3C0049C203 /* Helpers */, 284BE62B2BC50A0E0049C203 /* Models */, 284BE62A2BC50A080049C203 /* Views */, @@ -150,6 +155,7 @@ 284BE62A2BC50A080049C203 /* Views */ = { isa = PBXGroup; children = ( + F0B9646F2D376983008A3FE1 /* LoadingView.swift */, 284BE5FF2BC509500049C203 /* ContentView.swift */, 284BE62C2BC50A1F0049C203 /* LoginView.swift */, 284BE6332BC512A80049C203 /* RecoveryView.swift */, @@ -176,6 +182,13 @@ path = Helpers; sourceTree = ""; }; + F0EB928E2D27C1270024D038 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -193,8 +206,8 @@ ); name = "mpc-core-kit-ios-quick-start"; packageProductDependencies = ( - 284712212BFB94220088411D /* MpcProviderSwift */, - 284712262BFB97FE0088411D /* mpc-core-kit-swift */, + F0EB928F2D27C1270024D038 /* mpc-core-kit-swift */, + F0EB92912D27C12A0024D038 /* MpcProviderSwift */, ); productName = "mpc-core-kit-ios-quick-start"; productReference = 284BE5FA2BC509500049C203 /* mpc-core-kit-ios-quick-start.app */; @@ -269,8 +282,8 @@ ); mainGroup = 284BE5F12BC509500049C203; packageReferences = ( - 284712202BFB94220088411D /* XCRemoteSwiftPackageReference "MpcProviderSwift" */, - 284712252BFB97FE0088411D /* XCRemoteSwiftPackageReference "mpc-core-kit-swift" */, + F0EB928C2D27B02B0024D038 /* XCRemoteSwiftPackageReference "mpc-core-kit-swift" */, + F0EB928D2D27C06C0024D038 /* XCRemoteSwiftPackageReference "MpcProviderSwift" */, ); productRefGroup = 284BE5FB2BC509500049C203 /* Products */; projectDirPath = ""; @@ -316,6 +329,7 @@ files = ( 284712242BFB94450088411D /* Extension.swift in Sources */, 284BE62D2BC50A1F0049C203 /* LoginView.swift in Sources */, + F0B964702D376989008A3FE1 /* LoadingView.swift in Sources */, 284BE6362BC512B20049C203 /* HomeView.swift in Sources */, 284BE6002BC509500049C203 /* ContentView.swift in Sources */, 284BE5FE2BC509500049C203 /* mpc_core_kit_ios_quick_startApp.swift in Sources */, @@ -483,6 +497,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = "mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.entitlements"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"mpc-core-kit-ios-quick-start/Preview Content\""; @@ -512,6 +527,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = "mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.entitlements"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"mpc-core-kit-ios-quick-start/Preview Content\""; @@ -654,34 +670,34 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ - 284712202BFB94220088411D /* XCRemoteSwiftPackageReference "MpcProviderSwift" */ = { + F0EB928C2D27B02B0024D038 /* XCRemoteSwiftPackageReference "mpc-core-kit-swift" */ = { isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/tkey/MpcProviderSwift"; + repositoryURL = "https://github.com/web3auth/mpc-core-kit-swift"; requirement = { - branch = main; + branch = "fix/enableMFA-ManualSync"; kind = branch; }; }; - 284712252BFB97FE0088411D /* XCRemoteSwiftPackageReference "mpc-core-kit-swift" */ = { + F0EB928D2D27C06C0024D038 /* XCRemoteSwiftPackageReference "MpcProviderSwift" */ = { isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/tkey/mpc-core-kit-swift"; + repositoryURL = "https://github.com/tkey/MpcProviderSwift"; requirement = { - branch = main; + branch = "feat/update-dependency"; kind = branch; }; }; /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - 284712212BFB94220088411D /* MpcProviderSwift */ = { + F0EB928F2D27C1270024D038 /* mpc-core-kit-swift */ = { isa = XCSwiftPackageProductDependency; - package = 284712202BFB94220088411D /* XCRemoteSwiftPackageReference "MpcProviderSwift" */; - productName = MpcProviderSwift; + package = F0EB928C2D27B02B0024D038 /* XCRemoteSwiftPackageReference "mpc-core-kit-swift" */; + productName = "mpc-core-kit-swift"; }; - 284712262BFB97FE0088411D /* mpc-core-kit-swift */ = { + F0EB92912D27C12A0024D038 /* MpcProviderSwift */ = { isa = XCSwiftPackageProductDependency; - package = 284712252BFB97FE0088411D /* XCRemoteSwiftPackageReference "mpc-core-kit-swift" */; - productName = "mpc-core-kit-swift"; + package = F0EB928D2D27C06C0024D038 /* XCRemoteSwiftPackageReference "MpcProviderSwift" */; + productName = MpcProviderSwift; }; /* End XCSwiftPackageProductDependency section */ }; diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 6c08f666..5753e8d1 100644 --- a/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,22 +1,13 @@ { - "originHash" : "d4e2e31ed5983dc7f95752b5f7cec96879f6838af173debe46909665a1b9adab", + "originHash" : "24dbe6a6a12ff57d0f65bcadc8dc07e5c4c4d2f8da5daf9ba0042c506c57383a", "pins" : [ - { - "identity" : "anycodable", - "kind" : "remoteSourceControl", - "location" : "https://github.com/Flight-School/AnyCodable", - "state" : { - "revision" : "862808b2070cd908cb04f9aafe7de83d35f81b05", - "version" : "0.6.7" - } - }, { "identity" : "bigint", "kind" : "remoteSourceControl", "location" : "https://github.com/attaswift/BigInt.git", "state" : { - "revision" : "0ed110f7555c34ff468e72e1686e59721f2b0da6", - "version" : "5.3.0" + "revision" : "114343a705df4725dfe7ab8a2a326b8883cfd79c", + "version" : "5.5.1" } }, { @@ -24,8 +15,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/tkey/curvelib.swift", "state" : { - "revision" : "9f88bd5e56d1df443a908f7a7e81ae4f4d9170ea", - "version" : "1.0.1" + "revision" : "432bf1abe7ff505fc2ac9fcf697341ff5b2dc6d0", + "version" : "2.0.0" } }, { @@ -33,17 +24,17 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/torusresearch/customauth-swift-sdk", "state" : { - "revision" : "60b48acb161fb4341c353c27bc6dd96af76887ff", - "version" : "10.0.1" + "revision" : "67f947d087e1c9c6ca37c6627b595fe6913bc558", + "version" : "11.0.2" } }, { "identity" : "fetch-node-details-swift", "kind" : "remoteSourceControl", - "location" : "https://github.com/torusresearch/fetch-node-details-swift.git", + "location" : "https://github.com/torusresearch/fetch-node-details-swift", "state" : { - "revision" : "22bfadf7491d77a0bc1953af002cadbd61383e7d", - "version" : "6.0.2" + "revision" : "5b42dd1675f8a51ffe64feb688db7b1d764d5fc0", + "version" : "8.0.1" } }, { @@ -60,26 +51,17 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/auth0/JWTDecode.swift.git", "state" : { - "revision" : "58af7278797871e460d79496621b3e5366b865b2", - "version" : "3.1.0" - } - }, - { - "identity" : "keychain-swift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/evgenyneu/keychain-swift.git", - "state" : { - "revision" : "d108a1fa6189e661f91560548ef48651ed8d93b9", - "version" : "20.0.0" + "revision" : "1e153ef009969543191970c66b7c60163c0b4a65", + "version" : "3.2.0" } }, { "identity" : "mpc-core-kit-swift", "kind" : "remoteSourceControl", - "location" : "https://github.com/tkey/mpc-core-kit-swift", + "location" : "https://github.com/web3auth/mpc-core-kit-swift", "state" : { - "branch" : "main", - "revision" : "183f205cb24ff8aa9c6c59bea905f365fe03d34e" + "branch" : "fix/enableMFA-ManualSync", + "revision" : "59dba91ac15f76c1e88ab8875f097d27b5103976" } }, { @@ -87,8 +69,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/tkey/MpcProviderSwift", "state" : { - "branch" : "main", - "revision" : "f087b89ee543710fc23b35dc05fa233b1d16b7e1" + "branch" : "feat/update-dependency", + "revision" : "d9e9fb09ee98a01a2d46c65b4fa954affdca31cc" } }, { @@ -96,26 +78,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/GigaBitcoin/secp256k1.swift.git", "state" : { - "revision" : "9683e8e311c76d8114cd308b697dad2f9fc58fed", - "version" : "0.17.0" - } - }, - { - "identity" : "session-manager-swift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/Web3Auth/session-manager-swift.git", - "state" : { - "revision" : "20cc7bff065d7fe53164d17e7714a3f17d4cea2a", - "version" : "4.0.2" - } - }, - { - "identity" : "single-factor-auth-swift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/Web3Auth/single-factor-auth-swift", - "state" : { - "revision" : "73c5066d369c7d2aa1057c56a89b7f1dcdda3270", - "version" : "5.0.0" + "revision" : "57ce9af6db14e0114af631ace25231a9d0ccccbd", + "version" : "0.18.0" } }, { @@ -123,8 +87,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/socketio/socket.io-client-swift", "state" : { - "revision" : "175da8b5156f6b132436f0676cc84c2f6a766b6e", - "version" : "16.1.0" + "revision" : "42da871d9369f290d6ec4930636c40672143905b", + "version" : "16.1.1" } }, { @@ -132,8 +96,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/daltoniam/Starscream", "state" : { - "revision" : "ac6c0fc9da221873e01bd1a0d4818498a71eef33", - "version" : "4.0.6" + "revision" : "c6bfd1af48efcc9a9ad203665db12375ba6b145a", + "version" : "4.0.8" } }, { @@ -150,8 +114,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-collections.git", "state" : { - "revision" : "94cf62b3ba8d4bed62680a282d4c25f9c63c2efb", - "version" : "1.1.0" + "revision" : "671108c96644956dddcd89dd59c203dcdb36cec7", + "version" : "1.1.4" } }, { @@ -159,8 +123,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-http-types", "state" : { - "revision" : "9bee2fdb79cc740081abd8ebd80738063d632286", - "version" : "1.1.0" + "revision" : "ef18d829e8b92d731ad27bb81583edd2094d1ce3", + "version" : "1.3.1" } }, { @@ -168,8 +132,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-log.git", "state" : { - "revision" : "e97a6fcb1ab07462881ac165fdbb37f067e205d5", - "version" : "1.5.4" + "revision" : "96a2f8a0fa41e9e09af4585e2724c4e825410b91", + "version" : "1.6.2" } }, { @@ -177,8 +141,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio.git", "state" : { - "revision" : "359c461e5561d22c6334828806cc25d759ca7aa6", - "version" : "2.65.0" + "revision" : "ba72f31e11275fc5bf060c966cf6c1f36842a291", + "version" : "2.79.0" } }, { @@ -186,8 +150,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-extras.git", "state" : { - "revision" : "a3b640d7dc567225db7c94386a6e71aded1bfa63", - "version" : "1.22.0" + "revision" : "2e9746cfc57554f70b650b021b6ae4738abef3e6", + "version" : "1.24.1" } }, { @@ -195,8 +159,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-http2.git", "state" : { - "revision" : "c6afe04165c865faaa687b42c32ed76dfcc91076", - "version" : "1.31.0" + "revision" : "170f4ca06b6a9c57b811293cebcb96e81b661310", + "version" : "1.35.0" } }, { @@ -204,8 +168,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-ssl.git", "state" : { - "revision" : "7c381eb6083542b124a6c18fae742f55001dc2b5", - "version" : "2.26.0" + "revision" : "c7e95421334b1068490b5d41314a50e70bab23d1", + "version" : "2.29.0" } }, { @@ -213,8 +177,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-transport-services.git", "state" : { - "revision" : "38ac8221dd20674682148d6451367f89c2652980", - "version" : "1.21.0" + "revision" : "bbd5e63cf949b7db0c9edaf7a21e141c52afe214", + "version" : "1.23.0" } }, { @@ -222,8 +186,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-system.git", "state" : { - "revision" : "f9266c85189c2751589a50ea5aec72799797e471", - "version" : "1.3.0" + "revision" : "c8a44d836fe7913603e246acab7c528c2e780168", + "version" : "1.4.0" } }, { @@ -231,8 +195,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/tkey/tkey-mpc-swift", "state" : { - "revision" : "8fe0cc8d5cc2ad5d38bf068bc29f6af7e3146d08", - "version" : "3.0.0" + "revision" : "74ea5301e316163b48e653ba107fd9edd4fe6bf8", + "version" : "4.0.2" } }, { @@ -240,8 +204,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/torusresearch/torus-utils-swift.git", "state" : { - "revision" : "ff85c3e96bfa29013309b487875c4d9383e4ac80", - "version" : "8.1.1" + "revision" : "235a70839d3ff5723402df95d665b15b8c551ad8", + "version" : "10.0.1" } }, { @@ -249,8 +213,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/torusresearch/tss-client-swift.git", "state" : { - "revision" : "40246d5e3ff1d2c97d41846576f7a81d58858981", - "version" : "4.0.0" + "revision" : "6f00e4e03184a77eea0330b5b8d092d1452b9eb4", + "version" : "5.0.1" } }, { diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.xcodeproj/project.xcworkspace/xcuserdata/apollo.xcuserdatad/UserInterfaceState.xcuserstate b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.xcodeproj/project.xcworkspace/xcuserdata/apollo.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 00000000..84ac7998 Binary files /dev/null and b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.xcodeproj/project.xcworkspace/xcuserdata/apollo.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.xcodeproj/project.xcworkspace/xcuserdata/dmstrider.xcuserdatad/UserInterfaceState.xcuserstate b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.xcodeproj/project.xcworkspace/xcuserdata/dmstrider.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 00000000..2a55a015 Binary files /dev/null and b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.xcodeproj/project.xcworkspace/xcuserdata/dmstrider.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.xcodeproj/xcuserdata/apollo.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.xcodeproj/xcuserdata/apollo.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 00000000..3fb66972 --- /dev/null +++ b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.xcodeproj/xcuserdata/apollo.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,852 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.xcodeproj/xcuserdata/apollo.xcuserdatad/xcschemes/xcschememanagement.plist b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.xcodeproj/xcuserdata/apollo.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 00000000..25816725 --- /dev/null +++ b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.xcodeproj/xcuserdata/apollo.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + mpc-core-kit-ios-quick-start.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.xcodeproj/xcuserdata/dmstrider.xcuserdatad/xcschemes/xcschememanagement.plist b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.xcodeproj/xcuserdata/dmstrider.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 00000000..25816725 --- /dev/null +++ b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.xcodeproj/xcuserdata/dmstrider.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + mpc-core-kit-ios-quick-start.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/Helpers/Extension.swift b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/Helpers/Extension.swift index 2f100462..c3d9bb45 100644 --- a/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/Helpers/Extension.swift +++ b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/Helpers/Extension.swift @@ -13,7 +13,7 @@ import web3 extension MpcCoreKit : EvmSigner { public func sign(message: Data) throws -> Data { - let data = try self.tssSign(message: message) + let data = try self.tssSignSync(message: message) return data } @@ -22,7 +22,7 @@ extension MpcCoreKit : EvmSigner { address: self.getTssPubKey().hexString ).getPublicKey(format: .FullAddress) - return Data(hex: fullAddress).suffix(64) + return Data(hex: fullAddress)?.suffix(64) ?? Data() } } diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/Helpers/UserStorage.swift b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/Helpers/UserStorage.swift index d3f02676..3b383a90 100644 --- a/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/Helpers/UserStorage.swift +++ b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/Helpers/UserStorage.swift @@ -8,7 +8,7 @@ import Foundation import mpc_core_kit_swift -class UserStorage : ILocalStorage { +class UserStorage : IStorage { func get(key: String) async throws -> Data { print(key) guard let data = UserDefaults().value(forKey: key) as? Data else { diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/Models/MainViewModel.swift b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/Models/MainViewModel.swift index 291c5fee..6ea241d1 100644 --- a/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/Models/MainViewModel.swift +++ b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/Models/MainViewModel.swift @@ -11,11 +11,15 @@ import MpcProviderSwift import web3 import UIKit -class MainViewModel: ObservableObject { +@MainActor class MainViewModel: ObservableObject { @Published var isLoggedIn: Bool = false @Published var isRecoveryRequired: Bool = false @Published var factorPubs: [String] = [] + @Published var showAlert: Bool = false + + @Published var isLoaderVisible: Bool = false + var publicAddress: String! @@ -23,28 +27,87 @@ class MainViewModel: ObservableObject { private var ethereumClient: EthereumClient! private var mpcEthereumProvider: MPCEthereumProvider! - func initialize() { - mpcCoreKit = MpcCoreKit( - web3AuthClientId: "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ", - web3AuthNetwork: .SAPPHIRE_MAINNET, - localStorage: UserStorage() + + var alertContent: String = "" + var loaderContent: String = "" + + func initialize() throws { + mpcCoreKit = try MpcCoreKit( + options: .init(web3AuthClientId: "BHgArYmWwSeq21czpcarYh0EVq2WWOzflX-NTK-tY1-1pauPzHKRRLgpABkmYiIV_og9jAvoIxQ8L3Smrwe04Lw", + web3AuthNetwork: .SAPPHIRE_DEVNET, storage: UserStorage() + ) ) ethereumClient = EthereumClient() } - func loginWithJWT() { + func mockLogin(email: String) async throws -> Data { + // Create URL + let url = URL(string: "https://li6lnimoyrwgn2iuqtgdwlrwvq0upwtr.lambda-url.eu-west-1.on.aws/")! + + // Create URLRequest + var request = URLRequest(url: url) + request.httpMethod = "POST" + request.setValue("application/json", forHTTPHeaderField: "Content-Type") + + // Create JSON data to send in the request body + // verifier: "torus-key-test", scope: "email", extraPayload: { email }, alg: "ES256" + let jsonObject: [String: Any] = [ + "verifier": "torus-test-health", + "iss" : "torus-key-test", + "aud" : "torus-key-test", + "emailVerified": true, + "email": email, + "scope": email, + "extraPayload": [ + "email": email, + ], + "alg": "ES256", + ] + let jsonData = try JSONSerialization.data(withJSONObject: jsonObject) + request.httpBody = jsonData + + // Perform the request asynchronously + let (data, _) = try await URLSession.shared.data(for: request) + + return data + } + + + func loginWithJWT(verifierId: String) { Task { do { + let verifierId = verifierId + let verifier = "torus-test-health" + let clientId = "torus-test-health" + let email = verifierId + + let mockResult = try await mockLogin(email: email) + + guard let mockResult = try JSONSerialization.jsonObject(with: mockResult) as? [String: Any] else { + throw NSError(domain: "", code: 0, userInfo: nil) + + } + guard let token = mockResult["token"] as? String else { + throw NSError(domain: "", code: 0, userInfo: nil) + + } + print(token) + + + mpcCoreKit = try MpcCoreKit( + options: .init(web3AuthClientId: clientId, + web3AuthNetwork: .SAPPHIRE_DEVNET, storage: UserStorage() + ) + ) + let result = try await mpcCoreKit.loginWithJwt( - verifier: "w3a-firebase-demo", - verifierId: "", - idToken: "String" + verifier: verifier, + verifierId: email, + idToken: token ) - DispatchQueue.main.async { - self.isRecoveryRequired = result.requiredFactors > 0 - } + self.isRecoveryRequired = result.requiredFactors > 0 try await login() } catch let error { @@ -57,15 +120,10 @@ class MainViewModel: ObservableObject { Task { do { let result = try await mpcCoreKit.loginWithOAuth( - loginProvider: .google, - clientId: "519228911939-cri01h55lsjbsia1k7ll6qpalrus75ps.apps.googleusercontent.com", - verifier: "w3a-google-demo" - + singleLoginParams: .init(typeOfLogin: .google, verifier: "w3a-sfa-web-google", clientId: "519228911939-cri01h55lsjbsia1k7ll6qpalrus75ps.apps.googleusercontent.com") ) - DispatchQueue.main.async { - self.isRecoveryRequired = result.requiredFactors > 0 - } + self.isRecoveryRequired = result.requiredFactors > 0 try await login() @@ -79,10 +137,9 @@ class MainViewModel: ObservableObject { func resetAccount() { Task { do { - try await mpcCoreKit.resetAccount() - DispatchQueue.main.async { - self.isRecoveryRequired.toggle() - } + try await mpc_core_kit_swift.resetAccount(coreKitInstance: mpcCoreKit) + self.isRecoveryRequired = false + self.isLoggedIn = false } catch let error { print(error.localizedDescription) } @@ -104,7 +161,6 @@ class MainViewModel: ObservableObject { func signMessage(onSigned: @escaping (_ signedMessage: String?, _ error: String?) -> ()){ Task { do { - print(mpcCoreKit.debugDescription) let signature = try mpcEthereumProvider.signMessage(message: "YOUR_MESSAGE".data(using: .ascii)!) onSigned(signature, nil) } catch let error { @@ -122,7 +178,7 @@ class MainViewModel: ObservableObject { ) let transaction = EthereumTransaction.init( to: address, - data: Data.init(hex: "0x") + data: Data.init(hex: "0x") ?? Data() ) let gasLimit = try await self.ethereumClient.getGasLimit( @@ -164,17 +220,14 @@ class MainViewModel: ObservableObject { Task { do { let factor = try await mpcCoreKit.createFactor( - tssShareIndex: .RECOVERY, + tssShareIndex: .recovery, factorKey: nil, factorDescription: .SeedPhrase ) - guard let seedPhrase = mpcCoreKit.keyToMnemonic( - factorKey: factor, - format: "mnemonic" - ) else { - return - } + let seedPhrase = try FactorSerialization.keyToMnemonic(tkey: mpcCoreKit.tkey!, + shareHex: factor + ) print(seedPhrase) @@ -187,30 +240,36 @@ class MainViewModel: ObservableObject { func recoverUsingSeedPhrase(seedPhrase: String) { Task { do { - guard let factorKey = mpcCoreKit.mnemonicToKey( - shareMnemonic: seedPhrase, - format: "mnemonic" - ) else { - return - } + let factorKey = try FactorSerialization.mnemonicToKey(tkey: mpcCoreKit.tkey!, + shareMnemonic: seedPhrase + ) print(factorKey.count) - try await mpcCoreKit.inputFactor( + try await mpcCoreKit.inputFactorKey( factorKey: factorKey ) try await login() - DispatchQueue.main.async { - self.isRecoveryRequired.toggle() - } + self.isRecoveryRequired.toggle() } catch let error { print(error.localizedDescription) } } } + func getKeyDetails() { + Task { + do { + let keyDetails = try await mpcCoreKit.getKeyDetails() + print(keyDetails) + } catch let error { + print(error) + } + } + } + func enableMFA() { Task { do { @@ -222,6 +281,15 @@ class MainViewModel: ObservableObject { } } + func logout() { + Task { + do { + try await mpcCoreKit.logout() + toggleIsLoggedIn() + } + } + } + private func login() async throws { mpcEthereumProvider = MPCEthereumProvider(evmSigner: mpcCoreKit) publicAddress = mpcEthereumProvider.address.toChecksumAddress() @@ -232,9 +300,7 @@ class MainViewModel: ObservableObject { private func refreshFactorPubs() async throws { let localFactorPubs = try await mpcCoreKit.getAllFactorPubs() - DispatchQueue.main.async { - self.factorPubs = localFactorPubs - } + self.factorPubs = localFactorPubs } func toggleIsLoggedIn() { @@ -242,4 +308,24 @@ class MainViewModel: ObservableObject { self.isLoggedIn.toggle() } } + + func showLoader(_ message: String) { + loaderContent = message + DispatchQueue.main.async { + self.isLoaderVisible = true + } + } + + func hideLoader() { + DispatchQueue.main.async { + self.isLoaderVisible = false + } + } + + func showAlert(message: String) { + alertContent = message + DispatchQueue.main.async { + self.showAlert = true + } + } } diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/Views/HomeView.swift b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/Views/HomeView.swift index 357b354e..3e42e6c9 100644 --- a/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/Views/HomeView.swift +++ b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/Views/HomeView.swift @@ -17,107 +17,141 @@ struct HomeView: View { var body: some View { NavigationView { - Form { - Section(header: Text("Public Address")) { - Button( - action: { - UIPasteboard.general.string = viewModel.publicAddress - }, label: { - Text(viewModel.publicAddress) - }) + LoadingView(viewModel: viewModel, content: { + Form { + Section(header: Text("Public Address")) { + Button( + action: { + UIPasteboard.general.string = viewModel.publicAddress + }, label: { + Text(viewModel.publicAddress) + }) + + } - } - - Section(header: Text("Chain Interactions")) { - Button( - action: { - viewModel.signMessage{ - result, error in - if result != nil { - signedMessage = result + Section(header: Text("Chain Interactions")) { + Button( + action: { + viewModel.signMessage{ + result, error in + if result != nil { + signedMessage = result + } } + }, + label: { + Text("Sign Message") } - }, - label: { - Text("Sign Message") + ) + + if signedMessage != nil { + Text(signedMessage!) } - ) - - if signedMessage != nil { - Text(signedMessage!) - } - - Button( - action: { - viewModel.sendTransaction{ - result, error in - if result != nil { - hash = result + + Button( + action: { + viewModel.sendTransaction{ + result, error in + if result != nil { + hash = result + } } + }, + label: { + Text("Send 0.001 ETH") } - }, - label: { - Text("Send 0.001 ETH") + ) + + if(hash != nil) { + Link( + hash!, + destination: URL( + string: "https://sepolia.etherscan.io/tx/\(hash!)" + )! + ).underline() } - ) - - if(hash != nil) { - Link( - hash!, - destination: URL( - string: "https://sepolia.etherscan.io/tx/\(hash!)" - )! - ).underline() + + Text("The sample uses Eth Sepolia, you can choose any EVM network of your choice. Send 0.001 ETH will perform self transfer of ETH. You'll need to have Sepolia faucet to perform transaction.").font(.caption) + } - Text("The sample uses Eth Sepolia, you can choose any EVM network of your choice. Send 0.001 ETH will perform self transfer of ETH. You'll need to have Sepolia faucet to perform transaction.").font(.caption) - - } - - if(!viewModel.factorPubs.isEmpty) { - Section(header: Text("TSS Factors PubKey")) { - ForEach(Array(viewModel.factorPubs), id: \.self) { factorPub in - HStack( - alignment: .top, - spacing: 24, - content: { - Text(factorPub) - Button(action: { - withAnimation { - viewModel.deleteFactor( - factorPub: factorPub - ) + if(!viewModel.factorPubs.isEmpty) { + Section(header: Text("TSS Factors PubKey")) { + ForEach(Array(viewModel.factorPubs), id: \.self) { factorPub in + HStack( + alignment: .top, + spacing: 24, + content: { + Text(factorPub) + Button(action: { + withAnimation { + viewModel.deleteFactor( + factorPub: factorPub + ) + } + }) { + Label("",systemImage: "trash") } - }) { - Label("",systemImage: "trash") } - } - ) + ) + } } } + + Section( + header: Text("TSS Operations") + ) { + Button( + action: { + viewModel.enableMFA() + }, + label: { + Text("Enable MFA") + } + ) + Button( + action: { + + viewModel.showAlert(message: "creating factor...") + viewModel.createNewTssFactor() + viewModel.hideLoader() + }, + label: { + Text("Create new Factor") + } + ) + Button( + action: { + + viewModel.getKeyDetails() + }, + label: { + Text("Get Key Details") + } + ) + + Button( + action: { + viewModel.logout() + }, + label: { + Text("Logout") + } + ) + + Button( + action: { + viewModel.resetAccount() + }, + label: { + Text("Reset") + } + ) + } } - - Section( - header: Text("TSS Operations") - ) { - Button( - action: { - viewModel.enableMFA() - }, - label: { - Text("Enable MFA") - } - ) - Button( - action: { - viewModel.createNewTssFactor() - }, - label: { - Text("Create new Factor") - } - ) - } - } - } + }) + }.alert(isPresented: $viewModel.showAlert, content: { + Alert(title: Text(viewModel.alertContent)) + }) } } diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/Views/LoadingView.swift b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/Views/LoadingView.swift new file mode 100644 index 00000000..ddf9e692 --- /dev/null +++ b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/Views/LoadingView.swift @@ -0,0 +1,50 @@ +// +// Loading.swift +// mpc-core-kit-ios-quick-start +// +// Created by CW Lee on 15/01/2025. +// + +import SwiftUI + +struct ActivityIndicator: UIViewRepresentable { + + @Binding var isAnimating: Bool + let style: UIActivityIndicatorView.Style + + func makeUIView(context: UIViewRepresentableContext) -> UIActivityIndicatorView { + return UIActivityIndicatorView(style: style) + } + + func updateUIView(_ uiView: UIActivityIndicatorView, context: UIViewRepresentableContext) { + isAnimating ? uiView.startAnimating() : uiView.stopAnimating() + } +} + +struct LoadingView: View where Content: View { + @StateObject var viewModel: MainViewModel + var content: () -> Content + + var body: some View { + GeometryReader { geometry in + ZStack(alignment: .center) { + + self.content() + .disabled(viewModel.isLoaderVisible) + .blur(radius: viewModel.isLoaderVisible ? 3 : 0) + + VStack { + Text(viewModel.loaderContent) + ActivityIndicator(isAnimating: .constant(true), style: .large) + } + .frame(width: geometry.size.width / 2, + height: geometry.size.height / 5) + .background(Color.secondary.colorInvert()) + .foregroundColor(Color.primary) + .cornerRadius(20) + .opacity(viewModel.isLoaderVisible ? 1 : 0) + + } + } + } +} diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/Views/LoginView.swift b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/Views/LoginView.swift index a7b41785..0895452c 100644 --- a/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/Views/LoginView.swift +++ b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/Views/LoginView.swift @@ -9,6 +9,7 @@ import SwiftUI struct LoginView: View { @StateObject var viewModel: MainViewModel + @State private var email: String = "" var body: some View { VStack(spacing: 16) { @@ -24,9 +25,22 @@ struct LoginView: View { Text("Sign in with Google") } ).buttonStyle(.bordered) + TextField( + "Enter your email", + text: $email + ).textFieldStyle(.roundedBorder).padding() + Button( + action: { + viewModel.loginWithJWT(verifierId: email) + }, + label: { + Text("Sign in with Mock") + } + ).buttonStyle(.bordered) + Spacer() }.onAppear { - viewModel.initialize() + try? viewModel.initialize() } } diff --git a/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.entitlements b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.entitlements new file mode 100644 index 00000000..fbad0237 --- /dev/null +++ b/mpc-core-kit-ios/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start/mpc-core-kit-ios-quick-start.entitlements @@ -0,0 +1,8 @@ + + + + + keychain-access-groups + + + diff --git a/mpc-core-kit-react-native/mpc-core-kit-expo-ed25519/ios/mpccorekitexpoed25519.xcworkspace/xcuserdata/apollo.xcuserdatad/UserInterfaceState.xcuserstate b/mpc-core-kit-react-native/mpc-core-kit-expo-ed25519/ios/mpccorekitexpoed25519.xcworkspace/xcuserdata/apollo.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 00000000..27385de9 Binary files /dev/null and b/mpc-core-kit-react-native/mpc-core-kit-expo-ed25519/ios/mpccorekitexpoed25519.xcworkspace/xcuserdata/apollo.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/mpc-core-kit-web/quick-starts/mpc-core-kit-react-quick-start/package-lock.json b/mpc-core-kit-web/quick-starts/mpc-core-kit-react-quick-start/package-lock.json index a21963f4..5c9d88ab 100644 --- a/mpc-core-kit-web/quick-starts/mpc-core-kit-react-quick-start/package-lock.json +++ b/mpc-core-kit-web/quick-starts/mpc-core-kit-react-quick-start/package-lock.json @@ -17,17 +17,15 @@ "@types/react-dom": "^18.3.0", "@vitejs/plugin-react": "^4.3.1", "@web3auth/base": "^9.3.0", - "@web3auth/base-provider": "^9.3.0", - "@web3auth/ethereum-mpc-provider": "^9.3.0", + "@web3auth/ethereum-mpc-provider": "file:../../../../web3auth-web/packages/providers/ethereum-mpc-provider/web3auth-ethereum-mpc-provider-9.5.2.tgz", "@web3auth/mpc-core-kit": "^3.2.4", - "@web3auth/single-factor-auth": "^9.2.0", "bn.js": "^5.2.1", "ethers": "^6.13.3", "firebase": "^10.13.2", "react": "^18.3.1", "react-dom": "^18.3.1", "typescript": "^5.6.2", - "viem": "^2.21.18", + "viem": "^2.22.4", "vite": "^5.4.8", "web3": "^4.13.0" }, @@ -3316,9 +3314,9 @@ } }, "node_modules/@noble/hashes": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.5.0.tgz", - "integrity": "sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.7.0.tgz", + "integrity": "sha512-HXydb0DgzTpDPwbVeDGCG1gIu7X6+AuU6Zl6av/E/KG8LMsvPntvq+w17CHRpKBmN6Ybdrt1eP3k4cj8DJa78w==", "engines": { "node": "^14.21.3 || >=16" }, @@ -3359,9 +3357,9 @@ } }, "node_modules/@nx/nx-linux-x64-gnu": { - "version": "19.7.3", - "resolved": "https://registry.npmjs.org/@nx/nx-linux-x64-gnu/-/nx-linux-x64-gnu-19.7.3.tgz", - "integrity": "sha512-YMb4WGGovwgxsP6VvAEnyWvLoUwsDrdE5CxFQ2yoThD2BixmSHUKLtx6dtPDHz25nOE3v1ZzM0xTwYXBhPaeRQ==", + "version": "20.3.1", + "resolved": "https://registry.npmjs.org/@nx/nx-linux-x64-gnu/-/nx-linux-x64-gnu-20.3.1.tgz", + "integrity": "sha512-qC2On2qwYCtn/Kt8epvUn0H3NY6zG9yYhiNjkm6RvVTDmvogFQ4gtfiWSRP/EnabCRqM8FACDIO/ws5CnRBX+Q==", "cpu": [ "x64" ], @@ -3885,15 +3883,14 @@ } }, "node_modules/@toruslabs/base-controllers": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/@toruslabs/base-controllers/-/base-controllers-6.2.2.tgz", - "integrity": "sha512-9kCeHqtUcTUD9zj1FnY8lbMWaRCceP9dn6s7XdSwuC/wS+rqIxrNwgfwfbvGUl9ZgcskJ7lyNXQqAwZ92Xlzig==", - "license": "ISC", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@toruslabs/base-controllers/-/base-controllers-7.0.1.tgz", + "integrity": "sha512-vc1LH6im084UdmLuUrFVXTQ5fh9ZXrXpwoml7o44F+UGZHtNcJYhOV5J9z8BMcQFonc2eJxzsD8daC/YFfPaUQ==", "dependencies": { "@ethereumjs/util": "^9.1.0", "@toruslabs/broadcast-channel": "^11.0.0", "@toruslabs/http-helpers": "^7.0.0", - "@web3auth/auth": "^9.3.3", + "@web3auth/auth": "^9.6.2", "async-mutex": "^0.5.0", "bignumber.js": "^9.1.2", "bowser": "^2.11.0", @@ -4255,10 +4252,11 @@ } }, "node_modules/@toruslabs/secure-pub-sub": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@toruslabs/secure-pub-sub/-/secure-pub-sub-1.0.0.tgz", - "integrity": "sha512-Xv8SExIJ4/DBw5QHcSN+EGPMddZ2du4NcI9jztLde1K/0Hfnurqw6CcAniU6zpKVRVCRwjiauYCNYIRPBi2M4g==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@toruslabs/secure-pub-sub/-/secure-pub-sub-1.1.0.tgz", + "integrity": "sha512-OFN0Zsa37+c9aStHd4wzau+IYPY+gve9fBPDuPSIuS06cz/bov39DvCP0LaTQUKxK4eQMZENcPu6PeyBvQYQQA==", "dependencies": { + "@toruslabs/constants": "^14.1.1", "@toruslabs/eccrypto": "^5.0.0", "@toruslabs/http-helpers": "^7.0.0", "@toruslabs/metadata-helpers": "^6.0.0", @@ -4273,6 +4271,18 @@ "@babel/runtime": "7.x" } }, + "node_modules/@toruslabs/secure-pub-sub/node_modules/@toruslabs/constants": { + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/@toruslabs/constants/-/constants-14.2.0.tgz", + "integrity": "sha512-Mb5EfYNSPyvvw5s1JXnpZwritCgp4NmLni1imTqrSKGV3yikYhUn1ufyLMAHGnBBgv4AuMIXBIe3EpJJ+SpA0g==", + "engines": { + "node": ">=18.x", + "npm": ">=9.x" + }, + "peerDependencies": { + "@babel/runtime": "7.x" + } + }, "node_modules/@toruslabs/secure-pub-sub/node_modules/@toruslabs/eccrypto": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/@toruslabs/eccrypto/-/eccrypto-5.0.4.tgz", @@ -4286,11 +4296,11 @@ } }, "node_modules/@toruslabs/session-manager": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@toruslabs/session-manager/-/session-manager-3.1.0.tgz", - "integrity": "sha512-VTaYjTTGTqpUm14YWRsSmY0Tt5z7evC0aOdVW7Ahw/jzyb1witNL4Va2+7XzunziEkLJS3luH+LkziHx67jyQg==", - "license": "MIT", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@toruslabs/session-manager/-/session-manager-3.2.0.tgz", + "integrity": "sha512-t+EGFZhn8pxZ5Gjhxr99qNmK20zZD/RYEMRROBuwsETyy/QU17H6dKhqIb306GjmwUPkz2VKKTtJcOg9Ifijuw==", "dependencies": { + "@toruslabs/constants": "^14.1.1", "@toruslabs/eccrypto": "^5.0.4", "@toruslabs/http-helpers": "^7.0.0", "@toruslabs/metadata-helpers": "^6.0.0" @@ -4300,22 +4310,33 @@ "npm": ">=9.x" }, "optionalDependencies": { - "@rollup/rollup-linux-x64-gnu": "^4.22.4" + "@rollup/rollup-linux-x64-gnu": "^4.24.4" } }, "node_modules/@toruslabs/session-manager/node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.24.0.tgz", - "integrity": "sha512-ZXFk7M72R0YYFN5q13niV0B7G8/5dcQ9JDp8keJSfr3GoZeXEoMHP/HlvqROA3OMbMdfr19IjCeNAnPUG93b6A==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.30.1.tgz", + "integrity": "sha512-UtgGb7QGgXDIO+tqqJ5oZRGHsDLO8SlpE4MhqpY9Llpzi5rJMvrK6ZGhsRCST2abZdBqIBeXW6WPD5fGK5SDwg==", "cpu": [ "x64" ], - "license": "MIT", "optional": true, "os": [ "linux" ] }, + "node_modules/@toruslabs/session-manager/node_modules/@toruslabs/constants": { + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/@toruslabs/constants/-/constants-14.2.0.tgz", + "integrity": "sha512-Mb5EfYNSPyvvw5s1JXnpZwritCgp4NmLni1imTqrSKGV3yikYhUn1ufyLMAHGnBBgv4AuMIXBIe3EpJJ+SpA0g==", + "engines": { + "node": ">=18.x", + "npm": ">=9.x" + }, + "peerDependencies": { + "@babel/runtime": "7.x" + } + }, "node_modules/@toruslabs/session-manager/node_modules/@toruslabs/eccrypto": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/@toruslabs/eccrypto/-/eccrypto-5.0.4.tgz", @@ -4330,16 +4351,16 @@ } }, "node_modules/@toruslabs/starkware-crypto": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@toruslabs/starkware-crypto/-/starkware-crypto-4.0.0.tgz", - "integrity": "sha512-oEvcwEulCkLbOfRq3Rz3wS1DgSYV5oCh4N4YNWYDQhz1WoQe3S87hJlVUPvRQHHqhp9vBM0qDUVi0Ez7ibYhMA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@toruslabs/starkware-crypto/-/starkware-crypto-4.0.1.tgz", + "integrity": "sha512-AhnXUscFN2+oLeQuOEbi8vvrQnxUKnE0USWpg7eFHmqUBV8kg6+PAFiWsvJ01+GMQPTMKhKZHyMysxW5AFHc6Q==", "dependencies": { "assert": "^2.1.0", "bip39": "^3.1.0", "bn.js": "^5.2.1", - "elliptic": "~6.5.5", + "elliptic": "^6.6.1", "enc-utils": "^3.0.0", - "ethereum-cryptography": "^2.2.0", + "ethereum-cryptography": "^2.2.1", "hash.js": "^1.1.7" }, "engines": { @@ -4931,18 +4952,17 @@ } }, "node_modules/@web3auth/auth": { - "version": "9.4.1", - "resolved": "https://registry.npmjs.org/@web3auth/auth/-/auth-9.4.1.tgz", - "integrity": "sha512-V5JNBc7VeHDmP+9VN4obAIav/NbkyZXEVJ3rD9C4SdbO/ZF3Hc+G8SdVPymJlR2JrBCsuPJiFsUatBl1hx+FSg==", - "license": "MIT", + "version": "9.6.3", + "resolved": "https://registry.npmjs.org/@web3auth/auth/-/auth-9.6.3.tgz", + "integrity": "sha512-OqwEneMSEl0w40sJqWcKMm3gh9cBzS1oz7BqKYWXcb6xvPn8xq8RUMYVTl+yEno/9ePoT05rj6JTfWWtpte3Bg==", "dependencies": { "@ethereumjs/util": "^9.1.0", - "@toruslabs/constants": "^14.0.0", + "@toruslabs/constants": "^14.2.0", "@toruslabs/ffjavascript": "^4.0.0", "@toruslabs/metadata-helpers": "^6.0.0", - "@toruslabs/secure-pub-sub": "^1.0.0", - "@toruslabs/session-manager": "^3.0.0", - "@toruslabs/starkware-crypto": "^4.0.0", + "@toruslabs/secure-pub-sub": "^1.1.0", + "@toruslabs/session-manager": "^3.2.0", + "@toruslabs/starkware-crypto": "^4.0.1", "@toruslabs/tweetnacl-js": "^1.0.4", "base64url": "^3.0.1", "bip39": "^3.1.0", @@ -4954,9 +4974,9 @@ "events": "^3.3.0", "fast-safe-stringify": "^2.1.1", "json-stable-stringify": "^1.1.1", - "loglevel": "^1.9.1", + "loglevel": "^1.9.2", "once": "^1.4.0", - "pump": "^3.0.0", + "pump": "^3.0.2", "readable-stream": "^4.5.2", "ts-custom-error": "^3.3.1", "typed-emitter": "^2.1.0" @@ -4966,17 +4986,29 @@ "npm": ">=9.x" }, "optionalDependencies": { - "@nx/nx-linux-x64-gnu": "^19.6.3", - "@rollup/rollup-linux-x64-gnu": "^4.21.1" + "@nx/nx-linux-x64-gnu": "^20.2.2", + "@rollup/rollup-linux-x64-gnu": "^4.28.1" }, "peerDependencies": { "@babel/runtime": "7.x" } }, + "node_modules/@web3auth/auth/node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.30.1.tgz", + "integrity": "sha512-UtgGb7QGgXDIO+tqqJ5oZRGHsDLO8SlpE4MhqpY9Llpzi5rJMvrK6ZGhsRCST2abZdBqIBeXW6WPD5fGK5SDwg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@web3auth/auth/node_modules/@toruslabs/constants": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/@toruslabs/constants/-/constants-14.0.0.tgz", - "integrity": "sha512-c0lrqxxiR0FL+XdtbX+77PWTeB8izFUrnPwkF2pjjfXlMJLukAWPLhALpmZmqlGmJApT8kJbMN7be2LurAGa1g==", + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/@toruslabs/constants/-/constants-14.2.0.tgz", + "integrity": "sha512-Mb5EfYNSPyvvw5s1JXnpZwritCgp4NmLni1imTqrSKGV3yikYhUn1ufyLMAHGnBBgv4AuMIXBIe3EpJJ+SpA0g==", "engines": { "node": ">=18.x", "npm": ">=9.x" @@ -4995,15 +5027,14 @@ } }, "node_modules/@web3auth/base": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@web3auth/base/-/base-9.3.0.tgz", - "integrity": "sha512-S1X3i83T7HWr+pF+qBG6nAh49bhE/91LzQxQqSTMQ3f0NGdaMWtuQK3QewyO+G71+9+yrhIS0vggnXyAgY9NaA==", - "license": "ISC", + "version": "9.5.2", + "resolved": "https://registry.npmjs.org/@web3auth/base/-/base-9.5.2.tgz", + "integrity": "sha512-mBwQrmDBPp7sqyGwBtc1h9FSitdsEk1ZzABxUb+3BM8mJncddRk8ePQMFshzG4rqvuGtIWEgZ4QwUfW3v4dJSQ==", "dependencies": { - "@toruslabs/base-controllers": "^6.2.2", - "@toruslabs/constants": "^14.0.0", + "@toruslabs/base-controllers": "^7.0.1", + "@toruslabs/constants": "^14.2.0", "@toruslabs/http-helpers": "^7.0.0", - "@web3auth/auth": "^9.4.1", + "@web3auth/auth": "^9.6.2", "jwt-decode": "^4.0.0", "loglevel": "^1.9.2", "ts-custom-error": "^3.3.1" @@ -5017,14 +5048,13 @@ } }, "node_modules/@web3auth/base-provider": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@web3auth/base-provider/-/base-provider-9.3.0.tgz", - "integrity": "sha512-WiBpeVvyzmrjLQ8XNZMTWdtukDivuEvX8nOwT5FjyWBow5f06GViDRIRhB1D/M8n3xtsID8O/7qb8Gr6lw48zw==", - "license": "ISC", + "version": "9.5.2", + "resolved": "https://registry.npmjs.org/@web3auth/base-provider/-/base-provider-9.5.2.tgz", + "integrity": "sha512-hSVowBasodCCmR/IHQDXLtgirGOBaqnAU8+CucgbrDmnmJWU7RbkkIJ3yWLtHviION/na4OTH1NQhrByjAwf2Q==", "dependencies": { - "@toruslabs/base-controllers": "^6.2.2", - "@web3auth/auth": "^9.4.1", - "@web3auth/base": "^9.3.0", + "@toruslabs/base-controllers": "^7.0.1", + "@web3auth/auth": "^9.6.2", + "@web3auth/base": "^9.5.2", "json-rpc-random-id": "^1.0.1" }, "engines": { @@ -5036,9 +5066,9 @@ } }, "node_modules/@web3auth/base/node_modules/@toruslabs/constants": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/@toruslabs/constants/-/constants-14.0.0.tgz", - "integrity": "sha512-c0lrqxxiR0FL+XdtbX+77PWTeB8izFUrnPwkF2pjjfXlMJLukAWPLhALpmZmqlGmJApT8kJbMN7be2LurAGa1g==", + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/@toruslabs/constants/-/constants-14.2.0.tgz", + "integrity": "sha512-Mb5EfYNSPyvvw5s1JXnpZwritCgp4NmLni1imTqrSKGV3yikYhUn1ufyLMAHGnBBgv4AuMIXBIe3EpJJ+SpA0g==", "engines": { "node": ">=18.x", "npm": ">=9.x" @@ -5048,18 +5078,18 @@ } }, "node_modules/@web3auth/ethereum-mpc-provider": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@web3auth/ethereum-mpc-provider/-/ethereum-mpc-provider-9.3.0.tgz", - "integrity": "sha512-QshYFjPcXUzIkVMSWKy2LRhMDSTvjV4AED4cnYIm3QibXVYvvUfwRO4eUixZ5uSqn8/0EPhLsiBCpaNw3sAghA==", - "license": "ISC", + "version": "9.5.2", + "resolved": "file:../../../../web3auth-web/packages/providers/ethereum-mpc-provider/web3auth-ethereum-mpc-provider-9.5.2.tgz", + "integrity": "sha512-WNQh0UhPaaybqIkmkywTIQ5sfUa+lhhAxMtl6SJJaFWaTdf5bF7cbw5yfG7O3mS84b7t8EADKad1jzYkQzxHTA==", "dependencies": { "@ethereumjs/util": "^9.1.0", - "@toruslabs/base-controllers": "^6.2.2", - "@web3auth/auth": "^9.4.1", - "@web3auth/base": "^9.3.0", - "@web3auth/base-provider": "^9.3.0", - "@web3auth/ethereum-provider": "^9.3.0", - "ethers": "^6.13.4" + "@toruslabs/base-controllers": "^7.0.1", + "@web3auth/auth": "^9.6.2", + "@web3auth/base": "^9.5.2", + "@web3auth/base-provider": "^9.5.2", + "@web3auth/ethereum-provider": "^9.5.2", + "ethers": "^6.13.4", + "viem": "^2.22.5" }, "engines": { "node": ">=18.x", @@ -5070,18 +5100,17 @@ } }, "node_modules/@web3auth/ethereum-provider": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@web3auth/ethereum-provider/-/ethereum-provider-9.3.0.tgz", - "integrity": "sha512-Qe9PAupSJqJEgkSruyusMB0Pu2mVw3JiieaRF4ixTrBnX1V2+wLdYLmQSYl+KBJ3m7ZsQO+omzFaDdZLyFPkew==", - "license": "ISC", + "version": "9.5.2", + "resolved": "https://registry.npmjs.org/@web3auth/ethereum-provider/-/ethereum-provider-9.5.2.tgz", + "integrity": "sha512-MLm3ZpnFXigHJoNCpP7nhmZpq59ztf+jmye6rMZAlEUDAeCVluH9kMPuu5ldL/iOaW8ho2i58dZasjVh4XwHwA==", "dependencies": { "@ethereumjs/util": "^9.1.0", - "@toruslabs/base-controllers": "^6.2.2", + "@toruslabs/base-controllers": "^7.0.1", "@toruslabs/eccrypto": "^5.0.4", "@toruslabs/http-helpers": "^7.0.0", - "@web3auth/auth": "^9.4.1", - "@web3auth/base": "^9.3.0", - "@web3auth/base-provider": "^9.3.0", + "@web3auth/auth": "^9.6.2", + "@web3auth/base": "^9.5.2", + "@web3auth/base-provider": "^9.5.2", "assert": "^2.1.0", "bignumber.js": "^9.1.2", "bn.js": "^5.2.1", @@ -5100,7 +5129,6 @@ "version": "5.0.4", "resolved": "https://registry.npmjs.org/@toruslabs/eccrypto/-/eccrypto-5.0.4.tgz", "integrity": "sha512-5PrSe2sn5Ed0u/2oRFtKaGOYpXJS+rJQXlYqxzy7Tbe2wLPCJh5/hZ3yStLfZmrYjHlWYwUx3AIpL/pUOOSU4w==", - "license": "CC0-1.0", "dependencies": { "elliptic": "^6.5.5" }, @@ -5167,78 +5195,6 @@ "@babel/runtime": "7.x" } }, - "node_modules/@web3auth/single-factor-auth": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/@web3auth/single-factor-auth/-/single-factor-auth-9.2.0.tgz", - "integrity": "sha512-slJAR0w9gOnAvFaT/gqoKxYsOCuEgVRiXN0GkaGgE/m/jYwczn92QzmR9qfn4S0I9Lt+jGPj2+rURMK0nkDaMg==", - "license": "ISC", - "dependencies": { - "@toruslabs/base-controllers": "^6.1.2", - "@toruslabs/constants": "^14.0.0", - "@toruslabs/fetch-node-details": "^14.0.1", - "@toruslabs/session-manager": "^3.0.0", - "@toruslabs/torus.js": "^14.0.2", - "@web3auth/auth": "^9.3.3", - "@web3auth/base": "^9.0.0", - "bs58": "^5.0.0" - }, - "engines": { - "node": ">=18.x", - "npm": ">=9.x" - }, - "peerDependencies": { - "@babel/runtime": "^7.x" - } - }, - "node_modules/@web3auth/single-factor-auth/node_modules/@toruslabs/constants": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/@toruslabs/constants/-/constants-14.0.0.tgz", - "integrity": "sha512-c0lrqxxiR0FL+XdtbX+77PWTeB8izFUrnPwkF2pjjfXlMJLukAWPLhALpmZmqlGmJApT8kJbMN7be2LurAGa1g==", - "license": "MIT", - "engines": { - "node": ">=18.x", - "npm": ">=9.x" - }, - "peerDependencies": { - "@babel/runtime": "7.x" - } - }, - "node_modules/@web3auth/single-factor-auth/node_modules/@toruslabs/eccrypto": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@toruslabs/eccrypto/-/eccrypto-5.0.4.tgz", - "integrity": "sha512-5PrSe2sn5Ed0u/2oRFtKaGOYpXJS+rJQXlYqxzy7Tbe2wLPCJh5/hZ3yStLfZmrYjHlWYwUx3AIpL/pUOOSU4w==", - "license": "CC0-1.0", - "dependencies": { - "elliptic": "^6.5.5" - }, - "engines": { - "node": ">=18.x", - "npm": ">=9.x" - } - }, - "node_modules/@web3auth/single-factor-auth/node_modules/@toruslabs/torus.js": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@toruslabs/torus.js/-/torus.js-14.0.2.tgz", - "integrity": "sha512-+I3ftH6V/65SyEbltSJHMFVfumHaDphyr5r0tK1+ZZzNzsIJhiQxzIjODyKxlCmxANtl2Z0IVV4NQbZ7j5agjg==", - "license": "MIT", - "dependencies": { - "@toruslabs/constants": "^14.0.0", - "@toruslabs/eccrypto": "^5.0.4", - "@toruslabs/http-helpers": "^7.0.0", - "bn.js": "^5.2.1", - "elliptic": "^6.5.5", - "ethereum-cryptography": "^2.2.1", - "json-stable-stringify": "^1.1.1", - "loglevel": "^1.9.1" - }, - "engines": { - "node": ">=18.x", - "npm": ">=9.x" - }, - "peerDependencies": { - "@babel/runtime": "7.x" - } - }, "node_modules/@webassemblyjs/ast": { "version": "1.12.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", @@ -5862,11 +5818,6 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, - "node_modules/base-x": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz", - "integrity": "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==" - }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -6094,14 +6045,6 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, - "node_modules/bs58": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz", - "integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==", - "dependencies": { - "base-x": "^4.0.0" - } - }, "node_modules/buffer": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", @@ -6654,9 +6597,9 @@ "integrity": "sha512-mBhODedOXg4v5QWwl21DjM5amzjmI1zw9EPrPK/5Wx7C8jt33bpZNrC7OhHUG3pxRtbLpr3W2dXT+Ph1SsfRZA==" }, "node_modules/elliptic": { - "version": "6.5.7", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.7.tgz", - "integrity": "sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q==", + "version": "6.6.1", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz", + "integrity": "sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==", "dependencies": { "bn.js": "^4.11.9", "brorand": "^1.1.0", @@ -9377,16 +9320,15 @@ } }, "node_modules/isows": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/isows/-/isows-1.0.4.tgz", - "integrity": "sha512-hEzjY+x9u9hPmBom9IIAqdJCwNLax+xrPb51vEPpERoFlIxgmZcHzsT5jKG06nvInKOBGvReAVz80Umed5CczQ==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/isows/-/isows-1.0.6.tgz", + "integrity": "sha512-lPHCayd40oW98/I0uvgaHKWCSvkzY27LjWLbtzOm64yQ+G3Q5npjjbdppU65iZXkK1Zt+kH9pfegli0AYfwYYw==", "funding": [ { "type": "github", - "url": "https://github.com/sponsors/wagmi-dev" + "url": "https://github.com/sponsors/wevm" } ], - "license": "MIT", "peerDependencies": { "ws": "*" } @@ -9549,10 +9491,9 @@ } }, "node_modules/jsonschema": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.1.tgz", - "integrity": "sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ==", - "license": "MIT", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.5.0.tgz", + "integrity": "sha512-K+A9hhqbn0f3pJX17Q/7H6yQfD/5OXgdrR5UE12gMXCiN9D5Xq2o5mddV2QEcX/bjla99ASsAAQUyMCCRWAEhw==", "engines": { "node": "*" } @@ -10056,6 +9997,101 @@ "integrity": "sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A==", "dev": true }, + "node_modules/ox": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/ox/-/ox-0.6.0.tgz", + "integrity": "sha512-blUzTLidvUlshv0O02CnLFqBLidNzPoAZdIth894avUAotTuWziznv6IENv5idRuOSSP3dH8WzcYw84zVdu0Aw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/wevm" + } + ], + "dependencies": { + "@adraffy/ens-normalize": "^1.10.1", + "@noble/curves": "^1.6.0", + "@noble/hashes": "^1.5.0", + "@scure/bip32": "^1.5.0", + "@scure/bip39": "^1.4.0", + "abitype": "^1.0.6", + "eventemitter3": "5.0.1" + }, + "peerDependencies": { + "typescript": ">=5.4.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/ox/node_modules/@noble/curves": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.8.0.tgz", + "integrity": "sha512-j84kjAbzEnQHaSIhRPUmB3/eVXu2k3dKPl2LOrR8fSOIL+89U+7lV117EWHtq/GHM3ReGHM46iRBdZfpc4HRUQ==", + "dependencies": { + "@noble/hashes": "1.7.0" + }, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/ox/node_modules/@scure/base": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.1.tgz", + "integrity": "sha512-DGmGtC8Tt63J5GfHgfl5CuAXh96VF/LD8K9Hr/Gv0J2lAoRGlPOMpqMpMbCTOoOJMZCk2Xt+DskdDyn6dEFdzQ==", + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/ox/node_modules/@scure/bip32": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.6.1.tgz", + "integrity": "sha512-jSO+5Ud1E588Y+LFo8TaB8JVPNAZw/lGGao+1SepHDeTs2dFLurdNIAgUuDlwezqEjRjElkCJajVrtrZaBxvaQ==", + "dependencies": { + "@noble/curves": "~1.8.0", + "@noble/hashes": "~1.7.0", + "@scure/base": "~1.2.1" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/ox/node_modules/@scure/bip39": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.5.1.tgz", + "integrity": "sha512-GnlufVSP9UdAo/H2Patfv22VTtpNTyfi+I3qCKpvuB5l1KWzEYx+l2TNpBy9Ksh4xTs3Rn06tBlpWCi/1Vz8gw==", + "dependencies": { + "@noble/hashes": "~1.7.0", + "@scure/base": "~1.2.1" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/ox/node_modules/abitype": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.0.8.tgz", + "integrity": "sha512-ZeiI6h3GnW06uYDLx0etQtX/p8E24UaHHBj57RSjK7YBFe7iuVn07EDpOeP451D06sF27VOz9JJPlIKJmXgkEg==", + "funding": { + "url": "https://github.com/sponsors/wevm" + }, + "peerDependencies": { + "typescript": ">=5.0.4", + "zod": "^3 >=3.22.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + }, + "zod": { + "optional": true + } + } + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -11772,26 +11808,25 @@ "dev": true }, "node_modules/viem": { - "version": "2.21.18", - "resolved": "https://registry.npmjs.org/viem/-/viem-2.21.18.tgz", - "integrity": "sha512-CuZpymwBsuK2/YNDJE06EXxpfYs71X4v5ZwiGV5RczLKOwfHa/XuM3+GKbAoKCVeQ/tFt5n8XeHsMnbvEAauTg==", + "version": "2.22.5", + "resolved": "https://registry.npmjs.org/viem/-/viem-2.22.5.tgz", + "integrity": "sha512-rked1t/qPQAFNTLoFU18/OCv5KdbIZPwAwlY2X7dtH8unt28kccN6RBrjEjhNrY6wQlbO4phGwslNUzd8a2faw==", "funding": [ { "type": "github", "url": "https://github.com/sponsors/wevm" } ], - "license": "MIT", "dependencies": { - "@adraffy/ens-normalize": "1.10.0", - "@noble/curves": "1.4.0", - "@noble/hashes": "1.4.0", - "@scure/bip32": "1.4.0", - "@scure/bip39": "1.4.0", - "abitype": "1.0.5", - "isows": "1.0.4", - "webauthn-p256": "0.0.5", - "ws": "8.17.1" + "@noble/curves": "1.7.0", + "@noble/hashes": "1.6.1", + "@scure/bip32": "1.6.0", + "@scure/bip39": "1.5.0", + "abitype": "1.0.7", + "isows": "1.0.6", + "ox": "0.6.0", + "webauthn-p256": "0.0.10", + "ws": "8.18.0" }, "peerDependencies": { "typescript": ">=5.0.4" @@ -11802,66 +11837,79 @@ } } }, - "node_modules/viem/node_modules/@adraffy/ens-normalize": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.0.tgz", - "integrity": "sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q==", - "license": "MIT" - }, "node_modules/viem/node_modules/@noble/curves": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.0.tgz", - "integrity": "sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg==", - "license": "MIT", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.7.0.tgz", + "integrity": "sha512-UTMhXK9SeDhFJVrHeUJ5uZlI6ajXg10O6Ddocf9S6GjbSBVZsJo88HzKwXznNfGpMTRDyJkqMjNDPYgf0qFWnw==", "dependencies": { - "@noble/hashes": "1.4.0" + "@noble/hashes": "1.6.0" + }, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/viem/node_modules/@noble/curves/node_modules/@noble/hashes": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.6.0.tgz", + "integrity": "sha512-YUULf0Uk4/mAA89w+k3+yUYh6NrEvxZa5T6SY3wlMvE2chHkxFUUIDI8/XW1QSC357iA5pSnqt7XEhvFOqmDyQ==", + "engines": { + "node": "^14.21.3 || >=16" }, "funding": { "url": "https://paulmillr.com/funding/" } }, "node_modules/viem/node_modules/@noble/hashes": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", - "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", - "license": "MIT", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.6.1.tgz", + "integrity": "sha512-pq5D8h10hHBjyqX+cfBm0i8JUXJ0UhczFc4r74zbuT9XgewFo2E3J1cOaGtdZynILNmQ685YWGzGE1Zv6io50w==", "engines": { - "node": ">= 16" + "node": "^14.21.3 || >=16" }, "funding": { "url": "https://paulmillr.com/funding/" } }, - "node_modules/viem/node_modules/@scure/bip39": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.4.0.tgz", - "integrity": "sha512-BEEm6p8IueV/ZTfQLp/0vhw4NPnT9oWf5+28nvmeUICjP99f4vr2d+qc7AVGDDtwRep6ifR43Yed9ERVmiITzw==", - "license": "MIT", + "node_modules/viem/node_modules/@scure/base": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.1.tgz", + "integrity": "sha512-DGmGtC8Tt63J5GfHgfl5CuAXh96VF/LD8K9Hr/Gv0J2lAoRGlPOMpqMpMbCTOoOJMZCk2Xt+DskdDyn6dEFdzQ==", + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/viem/node_modules/@scure/bip32": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.6.0.tgz", + "integrity": "sha512-82q1QfklrUUdXJzjuRU7iG7D7XiFx5PHYVS0+oeNKhyDLT7WPqs6pBcM2W5ZdwOwKCwoE1Vy1se+DHjcXwCYnA==", "dependencies": { - "@noble/hashes": "~1.5.0", - "@scure/base": "~1.1.8" + "@noble/curves": "~1.7.0", + "@noble/hashes": "~1.6.0", + "@scure/base": "~1.2.1" }, "funding": { "url": "https://paulmillr.com/funding/" } }, - "node_modules/viem/node_modules/@scure/bip39/node_modules/@noble/hashes": { + "node_modules/viem/node_modules/@scure/bip39": { "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.5.0.tgz", - "integrity": "sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA==", - "license": "MIT", - "engines": { - "node": "^14.21.3 || >=16" + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.5.0.tgz", + "integrity": "sha512-Dop+ASYhnrwm9+HA/HwXg7j2ZqM6yk2fyLWb5znexjctFY3+E+eU8cIWI0Pql0Qx4hPZCijlGq4OL71g+Uz30A==", + "dependencies": { + "@noble/hashes": "~1.6.0", + "@scure/base": "~1.2.1" }, "funding": { "url": "https://paulmillr.com/funding/" } }, "node_modules/viem/node_modules/abitype": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.0.5.tgz", - "integrity": "sha512-YzDhti7cjlfaBhHutMaboYB21Ha3rXR9QTkNJFzYC4kC8YclaiwPBBBJY8ejFdu2wnJeZCVZSMlQJ7fi8S6hsw==", - "license": "MIT", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.0.7.tgz", + "integrity": "sha512-ZfYYSktDQUwc2eduYu8C4wOs+RDPmnRYMh7zNfzeMtGGgb0U+6tLGjixUic6mXf5xKKCcgT5Qp6cv39tOARVFw==", "funding": { "url": "https://github.com/sponsors/wevm" }, @@ -11878,6 +11926,26 @@ } } }, + "node_modules/viem/node_modules/ws": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/vite": { "version": "5.4.8", "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.8.tgz", @@ -12293,16 +12361,15 @@ } }, "node_modules/webauthn-p256": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/webauthn-p256/-/webauthn-p256-0.0.5.tgz", - "integrity": "sha512-drMGNWKdaixZNobeORVIqq7k5DsRC9FnG201K2QjeOoQLmtSDaSsVZdkg6n5jUALJKcAG++zBPJXmv6hy0nWFg==", + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/webauthn-p256/-/webauthn-p256-0.0.10.tgz", + "integrity": "sha512-EeYD+gmIT80YkSIDb2iWq0lq2zbHo1CxHlQTeJ+KkCILWpVy3zASH3ByD4bopzfk0uCwXxLqKGLqp2W4O28VFA==", "funding": [ { "type": "github", "url": "https://github.com/sponsors/wevm" } ], - "license": "MIT", "dependencies": { "@noble/curves": "^1.4.0", "@noble/hashes": "^1.4.0" diff --git a/mpc-core-kit-web/quick-starts/mpc-core-kit-react-quick-start/package.json b/mpc-core-kit-web/quick-starts/mpc-core-kit-react-quick-start/package.json index 21f5ab4f..9349450a 100644 --- a/mpc-core-kit-web/quick-starts/mpc-core-kit-react-quick-start/package.json +++ b/mpc-core-kit-web/quick-starts/mpc-core-kit-react-quick-start/package.json @@ -13,7 +13,7 @@ "@types/react-dom": "^18.3.0", "@vitejs/plugin-react": "^4.3.1", "@web3auth/base": "^9.3.0", - "@web3auth/ethereum-mpc-provider": "^9.3.0", + "@web3auth/ethereum-mpc-provider": "file:../../../../web3auth-web/packages/providers/ethereum-mpc-provider/web3auth-ethereum-mpc-provider-9.5.2.tgz", "@web3auth/mpc-core-kit": "^3.2.4", "bn.js": "^5.2.1", "ethers": "^6.13.3", @@ -21,7 +21,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "typescript": "^5.6.2", - "viem": "^2.21.18", + "viem": "^2.22.4", "vite": "^5.4.8", "web3": "^4.13.0" }, @@ -67,4 +67,4 @@ "build": "tsc && vite build", "serve": "vite preview" } -} \ No newline at end of file +} diff --git a/mpc-core-kit-web/quick-starts/mpc-core-kit-react-quick-start/src/App.tsx b/mpc-core-kit-web/quick-starts/mpc-core-kit-react-quick-start/src/App.tsx index 7853ef4f..ee384955 100644 --- a/mpc-core-kit-web/quick-starts/mpc-core-kit-react-quick-start/src/App.tsx +++ b/mpc-core-kit-web/quick-starts/mpc-core-kit-react-quick-start/src/App.tsx @@ -23,6 +23,9 @@ import { BN } from "bn.js"; import { initializeApp } from "firebase/app"; import { getAuth, GoogleAuthProvider, signInWithEmailAndPassword, signInWithPopup, UserCredential } from "firebase/auth"; import { useEffect, useState } from "react"; +import { createWalletClient, custom, TypedData, verifyTypedData } from 'viem' +import { baseSepolia } from 'viem/chains' + // IMP END - Quick Start // IMP START - Blockchain Calls @@ -382,6 +385,70 @@ function App() { console.log(...args); } + + async function viemSignTypedData() { + const chainConfig = { + chainId: '0x14a34', + displayName: 'Base Sepolia Testnet', + chainNamespace: CHAIN_NAMESPACES.EIP155, + tickerName: 'Vastlink Token', + ticker: 'VAST', + decimals: 18, + rpcTarget: "https://base-sepolia-rpc.publicnode.com", + blockExplorerUrl: "https://sepolia.basescan.org", + } + + const evmProvider = new EthereumSigningProvider({ config: { chainConfig } }); + evmProvider.setupProvider(makeEthereumSigner(coreKitInstance)); + const userWalletClient = createWalletClient({ + chain: baseSepolia, + transport: custom(evmProvider), + }) + + const domain = { + name: 'Ether Mail', + version: '1', + chainId: 84532, + verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', + } as const + + const types : TypedData = { + Person: [ + { name: 'name', type: 'string' }, + { name: 'wallet', type: 'address' }, + ], + Mail: [ + { name: 'from', type: 'Person' }, + { name: 'to', type: 'Person' }, + { name: 'contents', type: 'string' }, + ], + } as const + + const [account] = await userWalletClient.getAddresses() + const params = { + account, + domain, + types, + primaryType: 'Mail', + message: { + from: { + name: 'Cow', + wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', + }, + to: { + name: 'Bob', + wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', + }, + contents: 'Hello, Bob!', + }, + } + + const signature = await userWalletClient.signTypedData(params as any) + + console.log(signature) + console.log(await verifyTypedData( {...params, signature, address: account} ) ) + + } const loggedInView = (
@@ -414,6 +481,11 @@ function App() { Sign Message
+
+ +