diff --git a/mpc-core-kit-web/quick-starts/mpc-core-kit-react-remote-sign/package-lock.json b/mpc-core-kit-web/quick-starts/mpc-core-kit-react-remote-sign/package-lock.json index 46095c24..05f5e366 100644 --- a/mpc-core-kit-web/quick-starts/mpc-core-kit-react-remote-sign/package-lock.json +++ b/mpc-core-kit-web/quick-starts/mpc-core-kit-react-remote-sign/package-lock.json @@ -10,9 +10,10 @@ "dependencies": { "@ethereumjs/util": "^9.1.0", "@react-oauth/google": "^0.12.1", - "@tkey/common-types": "^15.0.2", - "@toruslabs/tss-dkls-lib": "^4.0.0", - "@toruslabs/tss-frost-lib": "^1.0.0", + "@tkey/common-types": "15.2.1-alpha.0", + "@toruslabs/tss-dkls-lib": "^5.0.0-alpha.0", + "@toruslabs/tss-frost-lib": "^2.0.0-alpha.0", + "@toruslabs/tss-frost-lib-bip340": "^0.1.0-alpha.0", "@types/node": "^18.11.18", "@types/react": "^18.3.10", "@types/react-dom": "^18.3.0", @@ -53,7 +54,7 @@ }, "../../../../mpc-core-kit": { "name": "@web3auth/mpc-core-kit", - "version": "3.2.5", + "version": "4.1.6-alpha.0", "license": "ISC", "dependencies": { "@tkey/common-types": "^15.2.1-alpha.0", @@ -61,19 +62,20 @@ "@tkey/share-serialization": "^15.1.0", "@tkey/storage-layer-torus": "^15.1.0", "@tkey/tss": "^15.2.1-alpha.0", - "@toruslabs/constants": "^14.0.0", + "@toruslabs/constants": "^14.2.0", "@toruslabs/customauth": "^20.3.0", - "@toruslabs/elliptic-wrapper": "^0.1.0", - "@toruslabs/fetch-node-details": "^14.0.1", - "@toruslabs/fnd-base": "^14.0.0", + "@toruslabs/elliptic-wrapper": "^0.1.1", + "@toruslabs/fetch-node-details": "^14.2.0", + "@toruslabs/fnd-base": "^14.2.0", "@toruslabs/http-helpers": "^7.0.0", "@toruslabs/metadata-helpers": "^6.0.0", "@toruslabs/openlogin-utils": "^8.2.1", "@toruslabs/session-manager": "^3.1.0", - "@toruslabs/torus.js": "^15.1.0", - "@toruslabs/tss-client": "^3.1.0", - "@toruslabs/tss-frost-client": "0.3.1", - "@toruslabs/tss-frost-common": "^1.0.1", + "@toruslabs/torus.js": "15.2.0-alpha.0", + "@toruslabs/tss-client": "^3.3.0-alpha.0", + "@toruslabs/tss-frost-client": "^1.0.1-alpha.0", + "@toruslabs/tss-frost-common": "^1.0.2-alpha.0", + "@web3auth/auth": "^9.6.1", "bn.js": "^5.2.1", "bowser": "^2.11.0", "elliptic": "^6.5.7", @@ -82,11 +84,12 @@ }, "devDependencies": { "@babel/register": "^7.25.7", + "@noble/curves": "^1.6.0", "@toruslabs/config": "^2.2.0", "@toruslabs/eslint-config-typescript": "^3.3.3", "@toruslabs/torus-scripts": "^6.1.2", - "@toruslabs/tss-dkls-lib": "^4.0.0", - "@toruslabs/tss-frost-lib": "^1.0.0", + "@toruslabs/tss-dkls-lib": "^5.0.0-alpha.0", + "@toruslabs/tss-frost-lib": "^2.0.0-alpha.0", "@types/chai": "^4.3.16", "@types/elliptic": "^6.4.18", "@types/jsonwebtoken": "^9.0.7", @@ -115,8 +118,9 @@ }, "peerDependencies": { "@babel/runtime": "^7.x", - "@toruslabs/tss-dkls-lib": "^4.0.0", - "@toruslabs/tss-frost-lib": "^1.0.0" + "@toruslabs/tss-dkls-lib": "^5.0.0-alpha.0", + "@toruslabs/tss-frost-lib": "^2.0.0-alpha.0", + "@toruslabs/tss-frost-lib-bip340": "^0.1.0-alpha.0" }, "peerDependenciesMeta": { "@toruslabs/tss-dkls-lib": { @@ -124,6 +128,9 @@ }, "@toruslabs/tss-frost-lib": { "optional": true + }, + "@toruslabs/tss-frost-lib-bip340": { + "optional": true } } }, @@ -3817,10 +3824,9 @@ "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==" }, "node_modules/@tkey/common-types": { - "version": "15.1.0", - "resolved": "https://registry.npmjs.org/@tkey/common-types/-/common-types-15.1.0.tgz", - "integrity": "sha512-oA5gLoyhNNMgCKcjvwLyU31TVS5KMT+lotRrjjoBdDvS0keZwzSLrtHWbXj8jZDlSZaqbd3VlPbCoHcqpk1irA==", - "license": "MIT", + "version": "15.2.1-alpha.0", + "resolved": "https://registry.npmjs.org/@tkey/common-types/-/common-types-15.2.1-alpha.0.tgz", + "integrity": "sha512-0BXtkB2PHNtV+fCmTVhWRqz/0tc975/z2onqCDQyCn0Lk36uhAPbEwCPRJ4vrccICxVizuYagZ+CazaEjk/ICA==", "dependencies": { "@toruslabs/customauth": "^20.3.0", "@toruslabs/eccrypto": "^5.0.4", @@ -4239,14 +4245,19 @@ } }, "node_modules/@toruslabs/tss-dkls-lib": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@toruslabs/tss-dkls-lib/-/tss-dkls-lib-4.0.0.tgz", - "integrity": "sha512-XIYv4M6el0wlX/I4WEJjxDS/TcUKRrG/+PTljNumh3UrchfkNpm4uW4+d4aOHclAXbX42pi1SkRpz81+YM+Gsg==" + "version": "5.0.0-alpha.0", + "resolved": "https://registry.npmjs.org/@toruslabs/tss-dkls-lib/-/tss-dkls-lib-5.0.0-alpha.0.tgz", + "integrity": "sha512-htUWzL2JZoKTtw++WLdQ1AK3wPTe0yezv/twWjpQIzLFkkfoO9Urnl5n9S6jFx98Z1dDRJRBWSED9PSuqY/x7w==" }, "node_modules/@toruslabs/tss-frost-lib": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@toruslabs/tss-frost-lib/-/tss-frost-lib-1.0.0.tgz", - "integrity": "sha512-uDsM7f6NiVvNKVOfTUK+CucZUy1TjvTSYvk5LL8t2i/izWzNbBg4NO9qAFws3Kp9Kt1hG0xo8FkWzh3+oJ82xA==" + "version": "2.0.0-alpha.0", + "resolved": "https://registry.npmjs.org/@toruslabs/tss-frost-lib/-/tss-frost-lib-2.0.0-alpha.0.tgz", + "integrity": "sha512-oZy99HiES3OR8t6rrV6ccxwbrq38kxzz1C/5UIdqUVd2IRSWZzrcD+J4Q2/yR5bDMoK1HrucLShK96uMoXyv/A==" + }, + "node_modules/@toruslabs/tss-frost-lib-bip340": { + "version": "0.1.0-alpha.0", + "resolved": "https://registry.npmjs.org/@toruslabs/tss-frost-lib-bip340/-/tss-frost-lib-bip340-0.1.0-alpha.0.tgz", + "integrity": "sha512-2dK/fhIfkxdbI/WPCRc1nJlL81nu70VMJyj313eJbO6oU13S92YjzoIhiCvBn6G/F3XpftD44wqNkr+S3QbAuA==" }, "node_modules/@toruslabs/tweetnacl-js": { "version": "1.0.4", diff --git a/mpc-core-kit-web/quick-starts/mpc-core-kit-react-remote-sign/package.json b/mpc-core-kit-web/quick-starts/mpc-core-kit-react-remote-sign/package.json index ef80badc..f3fc3949 100644 --- a/mpc-core-kit-web/quick-starts/mpc-core-kit-react-remote-sign/package.json +++ b/mpc-core-kit-web/quick-starts/mpc-core-kit-react-remote-sign/package.json @@ -6,9 +6,11 @@ "dependencies": { "@ethereumjs/util": "^9.1.0", "@react-oauth/google": "^0.12.1", - "@tkey/common-types": "^15.0.2", - "@toruslabs/tss-dkls-lib": "^4.0.0", - "@toruslabs/tss-frost-lib": "^1.0.0", + "@tkey/common-types": "15.2.1-alpha.0", + + "@toruslabs/tss-dkls-lib": "^5.0.0-alpha.0", + "@toruslabs/tss-frost-lib": "^2.0.0-alpha.0", + "@toruslabs/tss-frost-lib-bip340": "^0.1.0-alpha.0", "@types/node": "^18.11.18", "@types/react": "^18.3.10", "@types/react-dom": "^18.3.0", diff --git a/mpc-core-kit-web/quick-starts/mpc-core-kit-react-remote-sign/src/App.tsx b/mpc-core-kit-web/quick-starts/mpc-core-kit-react-remote-sign/src/App.tsx index a52616be..d917e0f4 100644 --- a/mpc-core-kit-web/quick-starts/mpc-core-kit-react-remote-sign/src/App.tsx +++ b/mpc-core-kit-web/quick-starts/mpc-core-kit-react-remote-sign/src/App.tsx @@ -86,8 +86,8 @@ if (typeof window !== "undefined") { // Setup provider for EVM Chain - // evmProvider = new EthereumSigningProvider({ config: { chainConfig } }); - // evmProvider.setupProvider(makeEthereumSigner(coreKitInstance)); + evmProvider = new EthereumSigningProvider({ config: { chainConfig } }); + evmProvider.setupProvider(makeEthereumSigner(coreKitInstance)); } // IMP END - SDK Initialization @@ -124,15 +124,19 @@ function App() { await coreKitInstance.init(); // IMP END - SDK Initialization - if (coreKitInstance.status === COREKIT_STATUS.LOGGED_IN) { + if (coreKitInstance.status !== COREKIT_STATUS.NOT_INITIALIZED) { const authenticatorService = new AuthenticatorService({ backendUrl : "http://localhost:3021", remoteSignerInstance: coreKitInstance, + storage: window.localStorage, }) + await authenticatorService.init(); const smsService = new SmsService({ backendUrl : "http://localhost:3021", remoteSignerInstance: coreKitInstance, + storage: window.localStorage, }) + await smsService.init(); setAuthenticatorService(authenticatorService) setSmsService(smsService) } @@ -191,11 +195,16 @@ function App() { const authenticatorService = new AuthenticatorService({ backendUrl : "http://localhost:3021", remoteSignerInstance: coreKitInstance, + storage: window.localStorage, }) + await authenticatorService.init(); + const smsService = new SmsService({ backendUrl : "http://localhost:3021", remoteSignerInstance: coreKitInstance, + storage: window.localStorage, }) + await smsService.init(); setAuthenticatorService(authenticatorService) setSmsService(smsService) setCoreKitStatus(coreKitInstance.status); diff --git a/mpc-core-kit-web/quick-starts/mpc-core-kit-react-remote-sign/src/RemoteSigner.tsx b/mpc-core-kit-web/quick-starts/mpc-core-kit-react-remote-sign/src/RemoteSigner.tsx index 7869b2b6..aaf0caa9 100644 --- a/mpc-core-kit-web/quick-starts/mpc-core-kit-react-remote-sign/src/RemoteSigner.tsx +++ b/mpc-core-kit-web/quick-starts/mpc-core-kit-react-remote-sign/src/RemoteSigner.tsx @@ -3,9 +3,6 @@ import {QRCodeSVG} from "qrcode.react"; import { COREKIT_STATUS, generateFactorKey, Web3AuthMPCCoreKit } from "@web3auth/mpc-core-kit"; import { AuthenticatorService, getFactorDetailsAndDescriptions } from "@web3auth/mpc-remote-signer-plugin"; - - - export const RemoteSignerFeature = (params:{coreKitInstance: Web3AuthMPCCoreKit, authenticatorService?: AuthenticatorService}) => { const {coreKitInstance, authenticatorService} = params; const [showQrCode, setShowQrCode] = useState(false); @@ -26,11 +23,11 @@ export const RemoteSignerFeature = (params:{coreKitInstance: Web3AuthMPCCoreKit, setShowQrCode(true); }; - const removeAuthenticator = async () => { + const removeAuthenticator = async (force: boolean = false) => { if (!coreKitInstance || !authenticatorService) { throw new Error("coreKitInstance not found"); } - await authenticatorService.unregisterFactor(); + await authenticatorService.unregisterFactor(force); } const verifyRegistration = async ( code : string) => { @@ -60,9 +57,13 @@ export const RemoteSignerFeature = (params:{coreKitInstance: Web3AuthMPCCoreKit, Register Authenticator setOtpValue(e.target.value)}/> - + + }