From 4b9272501cdc37e67a59a5c5de7cd9a393ab5728 Mon Sep 17 00:00:00 2001 From: ieow Date: Wed, 17 Apr 2024 10:58:06 +0800 Subject: [PATCH 01/13] feat: demo for recover, export and import tss key --- demo/redirect-flow-example/src/App.tsx | 72 ++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/demo/redirect-flow-example/src/App.tsx b/demo/redirect-flow-example/src/App.tsx index 3c40586d..3be647de 100644 --- a/demo/redirect-flow-example/src/App.tsx +++ b/demo/redirect-flow-example/src/App.tsx @@ -512,6 +512,78 @@ function App() { await coreKitInstance.commitChanges(); } + const exportTssKey= async () => { + if (!coreKitInstance) { + throw new Error("coreKitInstance is not set"); + } + const key = await coreKitInstance._UNSAFE_exportTssKey(); + let web3Local = new Web3() + let account = web3Local.eth.accounts.privateKeyToAccount(key) + let signedTx = await account.signTransaction({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000" }) + console.log(signedTx) + return key + } + + const importTssKey = async (newOauthLogin: string, importTssKey: string) => { + // import key to new instance + let { idToken, parsedToken } = await mockLogin(newOauthLogin); + + const newCoreKitInstance = new Web3AuthMPCCoreKit( + { + web3AuthClientId: 'BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ', + web3AuthNetwork: selectedNetwork, + uxMode: 'redirect', + manualSync: true, + setupProviderOnInit: false, + // sessionTime: 3600, // <== can provide variable session time based on user subscribed plan + } + ); + newCoreKitInstance.init({ handleRedirectResult: false, rehydrate :false }); + + uiConsole("TSS Private Key: ", importTssKey); + + await newCoreKitInstance.loginWithJWT({ + verifier: 'torus-test-health', + verifierId: parsedToken.email, + idToken: idToken, + importTssKey: importTssKey + }); + uiConsole("TSS Private Key: ", importTssKey); + } + + + const recoverTssKey = async (factorKeys: string[], newOauthLogin: string) => { + const recoverMpcInstance = new Web3AuthMPCCoreKit( + { + web3AuthClientId: 'BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ', + web3AuthNetwork: selectedNetwork, + uxMode: 'redirect', + manualSync: true, + setupProviderOnInit: false, + // sessionTime: 3600, // <== can provide variable session time based on user subscribed plan + } + ); + await recoverMpcInstance.init({ handleRedirectResult: false, rehydrate: false }); + + let recoveredTssKey = await recoverMpcInstance._UNSAFE_recoverTssKey(factorKeys); + uiConsole("Recovered TSS Private Key: ", recoveredTssKey); + let web3Local = new Web3() + let account = web3Local.eth.accounts.privateKeyToAccount(recoveredTssKey) + let signedTx = await account.signTransaction({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000" }) + console.log(signedTx) + return recoveredTssKey + } + + const exportTssKeyImportTssKey = async (newOauthLogin: string) => { + let key = await exportTssKey(); + await importTssKey(newOauthLogin, key); + } + + const recoverTssKeyImportTssKey = async (factorKeys: string[], newOauthLogin: string) => { + let key = await recoverTssKey(factorKeys, newOauthLogin); + await importTssKey(newOauthLogin, key); + } + const loggedInView = ( <>

Account Details

From 56b01f8730e8e6e96cce11f849b19bc38eeb2b71 Mon Sep 17 00:00:00 2001 From: ieow Date: Wed, 17 Apr 2024 10:58:06 +0800 Subject: [PATCH 02/13] feat: demo for recover, export and import tss key From 8340277923da17198c004174e8636a46c0021b44 Mon Sep 17 00:00:00 2001 From: lwin Date: Wed, 17 Apr 2024 16:49:24 +0800 Subject: [PATCH 03/13] update demo with export/import/recovery tss key, refactor and fixed MFA --- demo/redirect-flow-example/package-lock.json | 47 +- demo/redirect-flow-example/src/App.css | 39 +- demo/redirect-flow-example/src/App.tsx | 721 +++-------- .../src/LoggedinView.tsx | 194 +++ .../src/components/BlockchainCalls.tsx | 152 +++ .../src/components/SecurityQuestion.tsx | 88 ++ demo/redirect-flow-example/src/utils.ts | 46 + package-lock.json | 1153 ++++++++++++++--- src/interfaces.ts | 3 +- src/mpcCoreKit.ts | 2 +- 10 files changed, 1699 insertions(+), 746 deletions(-) create mode 100644 demo/redirect-flow-example/src/LoggedinView.tsx create mode 100644 demo/redirect-flow-example/src/components/BlockchainCalls.tsx create mode 100644 demo/redirect-flow-example/src/components/SecurityQuestion.tsx create mode 100644 demo/redirect-flow-example/src/utils.ts diff --git a/demo/redirect-flow-example/package-lock.json b/demo/redirect-flow-example/package-lock.json index 31dcb1ba..16fef736 100644 --- a/demo/redirect-flow-example/package-lock.json +++ b/demo/redirect-flow-example/package-lock.json @@ -46,7 +46,7 @@ }, "../..": { "name": "@web3auth/mpc-core-kit", - "version": "2.1.0", + "version": "2.3.0", "license": "ISC", "dependencies": { "@metamask/swappable-obj-proxy": "^2.1.0", @@ -56,50 +56,51 @@ "@tkey-mpc/share-serialization": "^9.1.0", "@tkey-mpc/storage-layer-torus": "^9.1.0", "@toruslabs/constants": "^13.0.1", - "@toruslabs/customauth": "^16.0.6", + "@toruslabs/customauth": "^18.1.0", "@toruslabs/eccrypto": "4.0.0", - "@toruslabs/fetch-node-details": "^13.0.1", + "@toruslabs/fetch-node-details": "^13.1.1", "@toruslabs/fnd-base": "^13.1.1", "@toruslabs/metadata-helpers": "^5.x", "@toruslabs/openlogin-session-manager": "^3.0.0", - "@toruslabs/torus.js": "^12.1.0", + "@toruslabs/openlogin-utils": "^8.0.0", + "@toruslabs/torus.js": "12.2.0", "@toruslabs/tss-client": "^2.1.0", "@toruslabs/tss-lib": "^2.0.0", - "@web3auth-mpc/ethereum-provider": "^2.3.0", - "@web3auth/base": "^7.0.1", - "@web3auth/base-provider": "^7.0.1", + "@web3auth-mpc/ethereum-provider": "^3.1.0", + "@web3auth/base": "^7.3.1", + "@web3auth/base-provider": "^7.3.1", "bn.js": "^5.2.1", "bowser": "^2.11.0", "elliptic": "^6.5.4" }, "devDependencies": { - "@babel/register": "^7.22.15", + "@babel/register": "^7.23.7", "@toruslabs/config": "^2.0.2", - "@toruslabs/eslint-config-typescript": "^3.0.1", - "@toruslabs/torus-scripts": "^5.0.5", + "@toruslabs/eslint-config-typescript": "^3.1.0", + "@toruslabs/torus-scripts": "^5.2.0", "@toruslabs/tss-lib-node": "^1.1.3", - "@types/chai": "^4.3.6", - "@types/elliptic": "^6.4.14", + "@types/chai": "^4.3.11", + "@types/elliptic": "^6.4.18", "@types/jsonwebtoken": "^9.0.5", - "@types/node": "^20.6.3", - "@typescript-eslint/eslint-plugin": "^6.7.0", - "chai": "^4.3.8", + "@types/node": "^20.11.16", + "@typescript-eslint/eslint-plugin": "^6.20.0", + "chai": "^5.0.3", "cross-env": "^7.0.3", - "dotenv": "^16.3.1", + "dotenv": "^16.4.1", "esbuild-register": "^3.5.0", - "eslint": "^8.49.0", - "husky": "^8.0.3", + "eslint": "^8.56.0", + "husky": "^9.0.10", "jsonwebtoken": "^9.0.2", - "lint-staged": "^14.0.1", + "lint-staged": "^15.2.1", "mocha": "^10.2.0", "node-fetch": "^3.3.2", - "prettier": "^3.0.3", - "rimraf": "^5.0.1", - "ts-node": "^10.9.1", + "prettier": "^3.2.4", + "rimraf": "^5.0.5", + "ts-node": "^10.9.2", "tsconfig-paths": "^4.2.0", "tsconfig-paths-webpack-plugin": "^4.1.0", "tslib": "^2.6.2", - "typescript": "^5.2.2" + "typescript": "^5.3.3" }, "engines": { "node": ">=20.x" diff --git a/demo/redirect-flow-example/src/App.css b/demo/redirect-flow-example/src/App.css index 8f38bacd..e5f8ddca 100644 --- a/demo/redirect-flow-example/src/App.css +++ b/demo/redirect-flow-example/src/App.css @@ -1,5 +1,6 @@ .container { width: 60%; + min-width: 400px; margin: auto; padding: 0 2rem; } @@ -82,9 +83,9 @@ } @media (max-width: 1200px) { - .container { + /* .container { width: 100%; - } + } */ } .flex-container { @@ -117,9 +118,39 @@ .disabledDiv { pointer-events: none; opacity: 0.4; - } +} + +.hidden { + display: none; +} .flex-column { display: flex; flex-direction: column; -} \ No newline at end of file +} + +.recover-account-div { + width: 100%; +} + +.recover-account-div .recovery-form { + display: flex; + width: 100%; + justify-content: center; + margin-bottom: 10px; +} + +.recover-account-div .recovery-form .right,.left { + width: 50%; +} + +.recover-account-div label { + font-size: 0.8rem; +} + +.recover-account-div input { + display: block; + width: 70%; + font-size: 0.9rem; + padding: 5px; +} diff --git a/demo/redirect-flow-example/src/App.tsx b/demo/redirect-flow-example/src/App.tsx index 3be647de..555a7fb4 100644 --- a/demo/redirect-flow-example/src/App.tsx +++ b/demo/redirect-flow-example/src/App.tsx @@ -1,15 +1,26 @@ import { useEffect, useState } from "react"; -import { Web3AuthMPCCoreKit, WEB3AUTH_NETWORK, Point, SubVerifierDetailsParams, TssShareType, keyToMnemonic, getWebBrowserFactor, COREKIT_STATUS, TssSecurityQuestion, generateFactorKey, mnemonicToKey, parseToken, DEFAULT_CHAIN_CONFIG } from "@web3auth/mpc-core-kit"; +import { + Web3AuthMPCCoreKit, + WEB3AUTH_NETWORK, + SubVerifierDetailsParams, + getWebBrowserFactor, + COREKIT_STATUS, + TssSecurityQuestion, + parseToken, + DEFAULT_CHAIN_CONFIG, + mnemonicToKey, +} from "@web3auth/mpc-core-kit"; import Web3 from "web3"; import type { provider } from "web3-core"; import "./App.css"; -import { CHAIN_NAMESPACES, SafeEventEmitterProvider } from "@web3auth/base"; +import { SafeEventEmitterProvider } from "@web3auth/base"; import { BN } from "bn.js"; import jwt, { Algorithm } from "jsonwebtoken"; import { flow } from "./flow"; - +import LoggedinView from "./LoggedinView"; +import { CHAIN_CONFIGS, CHAIN_NAMESPACE } from "./utils"; const uiConsole = (...args: any[]): void => { const el = document.querySelector("#console>p"); @@ -27,15 +38,14 @@ const selectedNetwork = WEB3AUTH_NETWORK.DEVNET; // setupProvdiverOnInit: false, // } -const coreKitInstance = new Web3AuthMPCCoreKit( - { - web3AuthClientId: 'BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ', - web3AuthNetwork: selectedNetwork, - uxMode: 'redirect', - manualSync: true, - setupProviderOnInit: false - } -); +let coreKitInstance = new Web3AuthMPCCoreKit({ + web3AuthClientId: "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ", + web3AuthNetwork: selectedNetwork, + uxMode: "redirect", + manualSync: true, + setupProviderOnInit: false, + // sessionTime: 3600, // <== can provide variable session time based on user subscribed plan +}); const privateKey = "MEECAQAwEwYHKoZIzj0CAQYIKoZIzj0DAQcEJzAlAgEBBCCD7oLrcKae+jVZPGx52Cb/lKhdKxpXjl9eGNa1MlY57A=="; const jwtPrivateKey = `-----BEGIN PRIVATE KEY-----\n${privateKey}\n-----END PRIVATE KEY-----`; @@ -56,7 +66,7 @@ export const mockLogin = async (email: string) => { expiresIn: 120, algorithm: alg, }; - + console.log("payload", payload); const token = jwt.sign(payload, jwtPrivateKey, algo); const idToken = token; const parsedToken = parseToken(idToken); @@ -64,21 +74,16 @@ export const mockLogin = async (email: string) => { }; function App() { - const [mockEmail, setMockEmail] = useState(undefined); + const [mockEmail, setMockEmail] = useState("testuser@corp.com"); - const [backupFactorKey, setBackupFactorKey] = useState(undefined); + const [backupFactorKey, setBackupFactorKey] = useState(""); + const [deviceFactorKey, setDeviceFactorKey] = useState(""); + const [recoveryFactor, setRecoveryFactor] = useState(""); const [provider, setProvider] = useState(null); - const [web3, setWeb3] = useState(undefined) - const [exportTssShareType, setExportTssShareType] = useState(TssShareType.DEVICE); - const [factorPubToDelete, setFactorPubToDelete] = useState(""); + const [web3, setWeb3] = useState(undefined); const [coreKitStatus, setCoreKitStatus] = useState(COREKIT_STATUS.NOT_INITIALIZED); const [answer, setAnswer] = useState(undefined); - const [newAnswer, setNewAnswer] = useState(undefined); const [question, setQuestion] = useState(undefined); - const [newQuestion, setNewQuestion] = useState(undefined); - - - const securityQuestion: TssSecurityQuestion = new TssSecurityQuestion(); @@ -103,10 +108,12 @@ function App() { } if (coreKitInstance.status === COREKIT_STATUS.REQUIRED_SHARE) { - uiConsole("required more shares, please enter your backup/ device factor key, or reset account unrecoverable once reset, please use it with caution]"); + uiConsole( + "required more shares, please enter your backup/ device factor key, or reset account unrecoverable once reset, please use it with caution]" + ); } - console.log("coreKitInstance.status", coreKitInstance.status) + console.log("coreKitInstance.status", coreKitInstance.status); setCoreKitStatus(coreKitInstance.status); try { @@ -125,87 +132,75 @@ function App() { const web3 = new Web3(provider as provider); setWeb3(web3); } - }, [provider]) - - - const keyDetails = async () => { - if (!coreKitInstance) { - throw new Error('coreKitInstance not found'); - } - uiConsole(coreKitInstance.getKeyDetails()); - }; - - const listFactors = async () => { - if (!coreKitInstance) { - throw new Error('coreKitInstance not found'); - } - const factorPubs = coreKitInstance.tKey.metadata.factorPubs; - if (!factorPubs) { - throw new Error('factorPubs not found'); - } - const pubsHex = factorPubs[coreKitInstance.tKey.tssTag].map((pub: any) => { - return Point.fromTkeyPoint(pub).toBufferSEC1(true).toString('hex'); - }); - uiConsole(pubsHex); - }; + }, [provider]); const loginWithMock = async () => { try { if (!mockEmail) { - throw new Error('mockEmail not found'); + throw new Error("mockEmail not found"); } const { idToken, parsedToken } = await mockLogin(mockEmail); - await coreKitInstance.loginWithJWT({ - verifier: 'torus-test-health', - verifierId: parsedToken.email, - idToken, - }, {prefetchTssPublicKeys: 1} ); - if (coreKitInstance.provider) { - setProvider(coreKitInstance.provider); - } - else { - coreKitInstance.setupProvider({ chainConfig: DEFAULT_CHAIN_CONFIG }).then((provider) => { - - setProvider(coreKitInstance.provider); - }); - } + await coreKitInstance.loginWithJWT( + { + verifier: "torus-test-health", + verifierId: parsedToken.email, + idToken, + }, + { prefetchTssPublicKeys: 1 } + ); + console.log('coreKitInstance.status', coreKitInstance.status); setCoreKitStatus(coreKitInstance.status); + + if (coreKitInstance.status === COREKIT_STATUS.LOGGED_IN) { + await setUpProvider(); + } } catch (error: unknown) { console.error(error); } + }; + + const setUpProvider = async () => { + if (!coreKitInstance.provider) { + await coreKitInstance.setupProvider({ chainConfig: DEFAULT_CHAIN_CONFIG }); + } + setProvider(coreKitInstance.provider); } const timedFlow = async () => { try { if (!mockEmail) { - throw new Error('mockEmail not found'); + throw new Error("mockEmail not found"); } const { idToken, parsedToken } = await mockLogin(mockEmail); - await flow({ selectedNetwork, manualSync: true, setupProviderOnInit: false, verifier: 'torus-test-health', verifierId: parsedToken.email, idToken }); - } - catch (error: unknown) { + await flow({ + selectedNetwork, + manualSync: true, + setupProviderOnInit: false, + verifier: "torus-test-health", + verifierId: parsedToken.email, + idToken, + }); + } catch (error: unknown) { console.error(error); } - } + }; const login = async () => { try { // Triggering Login using Service Provider ==> opens the popup if (!coreKitInstance) { - throw new Error('initiated to login'); + throw new Error("initiated to login"); } const verifierConfig = { subVerifierDetails: { - typeOfLogin: 'google', - verifier: 'w3a-google-demo', - clientId: - '519228911939-cri01h55lsjbsia1k7ll6qpalrus75ps.apps.googleusercontent.com', - } + typeOfLogin: "google", + verifier: "w3a-google-demo", + clientId: "519228911939-cri01h55lsjbsia1k7ll6qpalrus75ps.apps.googleusercontent.com", + }, } as SubVerifierDetailsParams; await coreKitInstance.loginWithOauth(verifierConfig); setCoreKitStatus(coreKitInstance.status); - } catch (error: unknown) { console.error(error); } @@ -213,9 +208,13 @@ function App() { const getDeviceShare = async () => { const factorKey = await getWebBrowserFactor(coreKitInstance!); - setBackupFactorKey(factorKey); - uiConsole("Device share: ", factorKey); - } + console.log('DeviceShare', factorKey); + if (factorKey) { + setDeviceFactorKey(factorKey); + setBackupFactorKey(factorKey); + uiConsole("Device share: ", factorKey); + } + }; const inputBackupFactorKey = async () => { if (!coreKitInstance) { @@ -224,17 +223,27 @@ function App() { if (!backupFactorKey) { throw new Error("backupFactorKey not found"); } - const factorKey = new BN(backupFactorKey, "hex") - await coreKitInstance.inputFactorKey(factorKey); + const factorStr = mnemonicToKey(backupFactorKey) + console.log("factorStr", factorStr); + const factorKey = new BN(factorStr, "hex"); + console.log("factorKeyBN", factorKey); + + await coreKitInstance.inputFactorKey(factorKey); + console.log("coreKitInstance.status", coreKitInstance.status); if (coreKitInstance.status === COREKIT_STATUS.REQUIRED_SHARE) { - uiConsole("required more shares even after inputing backup factor key, please enter your backup/ device factor key, or reset account [unrecoverable once reset, please use it with caution]"); + uiConsole( + "required more shares even after inputing backup factor key, please enter your backup/ device factor key, or reset account [unrecoverable once reset, please use it with caution]" + ); } + setUpProvider(); + + setCoreKitStatus(coreKitInstance.status); if (coreKitInstance.provider) { setProvider(coreKitInstance.provider); } - } + }; const recoverSecurityQuestionFactor = async () => { if (!coreKitInstance) { @@ -247,7 +256,7 @@ function App() { let factorKey = await securityQuestion.recoverFactor(coreKitInstance, answer); setBackupFactorKey(factorKey); uiConsole("Security Question share: ", factorKey); - } + }; const logout = async () => { if (!coreKitInstance) { @@ -259,169 +268,15 @@ function App() { setCoreKitStatus(coreKitInstance.status); }; - const getUserInfo = (): void => { - const user = coreKitInstance?.getUserInfo(); - uiConsole(user); - }; - - const exportFactor = async (): Promise => { - if (!coreKitInstance) { - throw new Error("coreKitInstance is not set"); - } - uiConsole("export share type: ", exportTssShareType); - const factorKey = generateFactorKey(); - await coreKitInstance.createFactor({ - shareType: exportTssShareType, - factorKey: factorKey.private - }); - let mnemonic = keyToMnemonic(factorKey.private.toString('hex')); - let key = mnemonicToKey(mnemonic); - - uiConsole("Export factor key: ", factorKey); - console.log("menmonic : ", mnemonic); - console.log("key: ", key); - } - - const deleteFactor = async (): Promise => { - if (!coreKitInstance) { - throw new Error("coreKitInstance is not set"); - } - const pubBuffer = Buffer.from(factorPubToDelete, 'hex'); - const pub = Point.fromBufferSEC1(pubBuffer); - await coreKitInstance.deleteFactor(pub.toTkeyPoint()); - uiConsole("factor deleted"); - } - - const getChainID = async () => { - if (!web3) { - uiConsole("web3 not initialized yet"); - return; - } - const chainId = await web3.eth.getChainId(); - uiConsole(chainId); - return chainId; - }; - - const setTSSWalletIndex = async (index=0) => { - await coreKitInstance.setTssWalletIndex(index); - // log new account details - await getAccounts(); - } - - - const getAccounts = async () => { - if (!web3) { - uiConsole("web3 not initialized yet"); - return; - } - const address = (await web3.eth.getAccounts())[0]; - uiConsole(address); - return address; - }; - - const getBalance = async () => { - if (!web3) { - uiConsole("web3 not initialized yet"); - return; - } - const address = (await web3.eth.getAccounts())[0]; - const balance = web3.utils.fromWei( - await web3.eth.getBalance(address) // Balance is in wei - ); - uiConsole(balance); - return balance; - }; - - const signMessage = async (): Promise => { - if (!web3) { - uiConsole("web3 not initialized yet"); - return; - } - const fromAddress = (await web3.eth.getAccounts())[0]; - const originalMessage = [ - { - type: "string", - name: "fullName", - value: "Satoshi Nakamoto", - }, - { - type: "uint32", - name: "userId", - value: "1212", - }, - ]; - const params = [originalMessage, fromAddress]; - const method = "eth_signTypedData"; - const signedMessage = await (web3.currentProvider as any)?.sendAsync({ - id: 1, - method, - params, - fromAddress, - }); - uiConsole(signedMessage); - }; - - const switchChainSepolia = async () => { + const switchChain = async (namespace: CHAIN_NAMESPACE) => { if (!provider) { uiConsole("provider not initialized yet"); return; } - const newChainConfig = { - chainId: "0xaa36a7", // for wallet connect make sure to pass in this chain in the loginSettings of the adapter. - displayName: "Ethereum Sepolia", - chainNamespace: CHAIN_NAMESPACES.EIP155, - tickerName: "Ethereum Sepolia", - ticker: "ETH", - decimals: 18, - rpcTarget: "https://rpc.ankr.com/eth_sepolia", - blockExplorer: "https://sepolia.etherscan.io", - logo: "https://cryptologos.cc/logos/ethereum-eth-logo.png", - }; + const newChainConfig = CHAIN_CONFIGS[namespace]; await coreKitInstance.switchChain(newChainConfig); setProvider(coreKitInstance.provider); - uiConsole("Changed to Sepolia Network"); - }; - - const switchChainPolygon = async () => { - if (!provider) { - uiConsole("provider not initialized yet"); - return; - } - const newChainConfig = { - chainNamespace: CHAIN_NAMESPACES.EIP155, - chainId: "0x89", // hex of 137, polygon mainnet - rpcTarget: "https://rpc.ankr.com/polygon", - // Avoid using public rpcTarget in production. - // Use services like Infura, Quicknode etc - displayName: "Polygon Mainnet", - blockExplorer: "https://polygonscan.com", - ticker: "MATIC", - tickerName: "MATIC", - }; - await coreKitInstance.switchChain(newChainConfig); - setProvider(coreKitInstance.provider); - uiConsole("Changed to Sepolia Network"); - }; - - const switchChainOPBNB = async () => { - if (!provider) { - uiConsole("provider not initialized yet"); - return; - } - const newChainConfig = { - chainNamespace: CHAIN_NAMESPACES.EIP155, - chainId: "0xCC", // hex of 1261120 - rpcTarget: "https://opbnb-mainnet-rpc.bnbchain.org", - // Avoid using public rpcTarget in production. - // Use services like Infura, Quicknode etc - displayName: "opBNB Mainnet", - blockExplorer: "https://opbnbscan.com", - ticker: "BNB", - tickerName: "opBNB", - }; - await coreKitInstance.switchChain(newChainConfig); - setProvider(coreKitInstance.provider); - uiConsole("Changed to Sepolia Network"); + uiConsole(`Changed to ${namespace} Network`); }; const criticalResetAccount = async (): Promise => { @@ -439,308 +294,93 @@ function App() { privKey: new BN(coreKitInstance.metadataKey!, "hex"), input: { message: "KEY_NOT_FOUND" }, }); - uiConsole('reset'); + uiConsole("reset"); setProvider(null); - } - - const sendTransaction = async () => { - if (!web3) { - uiConsole("web3 not initialized yet"); - return; - } - const fromAddress = (await web3.eth.getAccounts())[0]; - - const destination = "0x2E464670992574A613f10F7682D5057fB507Cc21"; - const amount = web3.utils.toWei("0.0001"); // Convert 1 ether to wei - - // Submit transaction to the blockchain and wait for it to be mined - uiConsole("Sending transaction..."); - const receipt = await web3.eth.sendTransaction({ - from: fromAddress, - to: destination, - value: amount, - }); - uiConsole(receipt); }; - const createSecurityQuestion = async (question: string, answer: string) => { - if (!coreKitInstance) { - throw new Error("coreKitInstance is not set"); - } - await securityQuestion.setSecurityQuestion({ mpcCoreKit: coreKitInstance, question, answer, shareType: TssShareType.RECOVERY }); - setNewQuestion(undefined); - let result = await securityQuestion.getQuestion(coreKitInstance); - if (result) { - setQuestion(question); - } - } - - const changeSecurityQuestion = async (newQuestion: string, newAnswer: string, answer: string) => { - if (!coreKitInstance) { - throw new Error("coreKitInstance is not set"); - } - await securityQuestion.changeSecurityQuestion({ mpcCoreKit: coreKitInstance, newQuestion, newAnswer, answer }); - let result = await securityQuestion.getQuestion(coreKitInstance); - if (result) { - setQuestion(question); - } - } - - const deleteSecurityQuestion = async () => { - if (!coreKitInstance) { - throw new Error("coreKitInstance is not set"); - } - await securityQuestion.deleteSecurityQuestion(coreKitInstance); - setQuestion(undefined); - - } - - const enableMFA = async () => { - if (!coreKitInstance) { - throw new Error("coreKitInstance is not set"); - } - const factorKey = await coreKitInstance.enableMFA({}); - const factorKeyMnemonic = await keyToMnemonic(factorKey); - - uiConsole("MFA enabled, device factor stored in local store, deleted hashed cloud key, your backup factor key: ", factorKeyMnemonic); - } - - const commit = async () => { - if (!coreKitInstance) { - throw new Error("coreKitInstance is not set"); - } - await coreKitInstance.commitChanges(); - } - - const exportTssKey= async () => { + const exportTssKey = async () => { if (!coreKitInstance) { throw new Error("coreKitInstance is not set"); } const key = await coreKitInstance._UNSAFE_exportTssKey(); - let web3Local = new Web3() - let account = web3Local.eth.accounts.privateKeyToAccount(key) - let signedTx = await account.signTransaction({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000" }) - console.log(signedTx) - return key - } + console.log('key', key); + let web3Local = new Web3(); + + let account = web3Local.eth.accounts.privateKeyToAccount(`0x${key}`); + console.log('account', account); + // let signedTx = await account.signTransaction({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000" }); + // console.log('signedTx', signedTx); + return key; + }; - const importTssKey = async (newOauthLogin: string, importTssKey: string) => { + const importTssKey = async (newOauthLogin: string, importedTssKey: string) => { // import key to new instance let { idToken, parsedToken } = await mockLogin(newOauthLogin); - const newCoreKitInstance = new Web3AuthMPCCoreKit( - { - web3AuthClientId: 'BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ', - web3AuthNetwork: selectedNetwork, - uxMode: 'redirect', - manualSync: true, - setupProviderOnInit: false, - // sessionTime: 3600, // <== can provide variable session time based on user subscribed plan - } - ); - newCoreKitInstance.init({ handleRedirectResult: false, rehydrate :false }); - - uiConsole("TSS Private Key: ", importTssKey); + const newCoreKitInstance = new Web3AuthMPCCoreKit({ + web3AuthClientId: "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ", + web3AuthNetwork: selectedNetwork, + uxMode: "redirect", + manualSync: true, + setupProviderOnInit: false, + }); + await newCoreKitInstance.init({ handleRedirectResult: false, rehydrate: false }); + uiConsole("TSS Private Key: ", importedTssKey); await newCoreKitInstance.loginWithJWT({ - verifier: 'torus-test-health', + verifier: "torus-test-health", verifierId: parsedToken.email, idToken: idToken, - importTssKey: importTssKey + importTssKey: importedTssKey, }); - uiConsole("TSS Private Key: ", importTssKey); - } - + uiConsole(JSON.stringify({ + tssPriKey: importedTssKey, + coreKitStatus: newCoreKitInstance.status, + })); + coreKitInstance = newCoreKitInstance; + setCoreKitStatus(newCoreKitInstance.status); + }; const recoverTssKey = async (factorKeys: string[], newOauthLogin: string) => { - const recoverMpcInstance = new Web3AuthMPCCoreKit( - { - web3AuthClientId: 'BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ', - web3AuthNetwork: selectedNetwork, - uxMode: 'redirect', - manualSync: true, - setupProviderOnInit: false, - // sessionTime: 3600, // <== can provide variable session time based on user subscribed plan - } - ); + const recoverMpcInstance = new Web3AuthMPCCoreKit({ + web3AuthClientId: "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ", + web3AuthNetwork: selectedNetwork, + uxMode: "redirect", + manualSync: true, + setupProviderOnInit: false, + // sessionTime: 3600, // <== can provide variable session time based on user subscribed plan + }); await recoverMpcInstance.init({ handleRedirectResult: false, rehydrate: false }); - + let recoveredTssKey = await recoverMpcInstance._UNSAFE_recoverTssKey(factorKeys); uiConsole("Recovered TSS Private Key: ", recoveredTssKey); - let web3Local = new Web3() - let account = web3Local.eth.accounts.privateKeyToAccount(recoveredTssKey) - let signedTx = await account.signTransaction({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000" }) - console.log(signedTx) - return recoveredTssKey - } + // let web3Local = new Web3(); + // let account = web3Local.eth.accounts.privateKeyToAccount(recoveredTssKey); + // let signedTx = await account.signTransaction({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000" }); + // console.log(signedTx); + return recoveredTssKey; + }; - const exportTssKeyImportTssKey = async (newOauthLogin: string) => { + const exportTssKeyImportTssKey = async (newOauthLogin?: string) => { + console.log('exportTssKeyImportTssKeyFunc', newOauthLogin); let key = await exportTssKey(); - await importTssKey(newOauthLogin, key); - } - - const recoverTssKeyImportTssKey = async (factorKeys: string[], newOauthLogin: string) => { - let key = await recoverTssKey(factorKeys, newOauthLogin); - await importTssKey(newOauthLogin, key); - } - - const loggedInView = ( - <> -

Account Details

-
- - - - - - - - - -
-
- - - - - - - -
-

Recovery/ Key Manipulation

-
-

Enabling MFA

-
- -
-

Manual Factors Manipulation

-
- - - - -
-
- - setFactorPubToDelete(e.target.value)}> - -
-
- setBackupFactorKey(e.target.value)}> - -
- - -

Security Question

- -
{question}
-
-
- - setNewQuestion(e.target.value)}> - setAnswer(e.target.value)}> - -
- -
- - setNewQuestion(e.target.value)}> - setNewAnswer(e.target.value)}> - setAnswer(e.target.value)}> - - -
-
-
-
- -
-
-
-

Blockchain Calls

-
- - - - - - - - - - - - - - - - - - + console.log('key', key); + await logout(); + // wait for 2 sec before import and login + await new Promise(r => setTimeout(r, 2000)); + await importTssKey(newOauthLogin || mockEmail, key); + }; - -
- - ); + const recoverTssKeyImportTssKey = async () => { + const factorKeys = [mnemonicToKey(deviceFactorKey), mnemonicToKey(recoveryFactor)]; + let key = await recoverTssKey(factorKeys, mockEmail); + await importTssKey(mockEmail, key); + }; const unloggedInView = ( <> - setMockEmail(e.target.value)}> + + setMockEmail(e.target.value)} /> @@ -748,8 +388,7 @@ function App() { -
- +
@@ -761,10 +400,7 @@ function App() { - -
- setAnswer(e.target.value)}> @@ -772,12 +408,27 @@ function App() { Recover Using Security Answer
-
- +
+
+

Recover account with factors

+
+
+ + setDeviceFactorKey(e.target.value)} /> +
+
+ + setRecoveryFactor(e.target.value)} /> +
+
+ +
); @@ -786,17 +437,35 @@ function App() {

Web3Auth MPC Core Kit - {" "} + {" "} Redirect Flow Example

-
{coreKitStatus === COREKIT_STATUS.LOGGED_IN ? loggedInView : unloggedInView}
+
+ {coreKitStatus === COREKIT_STATUS.LOGGED_IN ? ( + + ) : ( + unloggedInView + )} +

diff --git a/demo/redirect-flow-example/src/LoggedinView.tsx b/demo/redirect-flow-example/src/LoggedinView.tsx new file mode 100644 index 00000000..41336d1f --- /dev/null +++ b/demo/redirect-flow-example/src/LoggedinView.tsx @@ -0,0 +1,194 @@ +import { Web3AuthMPCCoreKit, Point, keyToMnemonic, TssShareType, generateFactorKey, mnemonicToKey } from "@web3auth/mpc-core-kit"; +import { useState } from "react"; +import SecurityQuestion from "./components/SecurityQuestion"; +import BlockchainCalls from "./components/BlockchainCalls"; +import { CHAIN_NAMESPACE } from "./utils"; +import Web3 from "web3"; + +interface ILoggedinViewProps { + web3: Web3; + coreKitInstance: Web3AuthMPCCoreKit; + criticalResetAccount: () => void; + logout: () => void; + switchChain: (namespace: CHAIN_NAMESPACE) => void; + inputBackupFactorKey: () => void; + exportImportTssKey: () => void; +} + +function uiConsole(...args: any[]): void { + const el = document.querySelector("#console>p"); + if (el) { + el.innerHTML = JSON.stringify(args || {}, null, 2); + } + console.log(...args); +} + +function LoggedinView({ web3, coreKitInstance, criticalResetAccount, logout, inputBackupFactorKey, switchChain, exportImportTssKey }: ILoggedinViewProps) { + const [exportTssShareType, setExportTssShareType] = useState(TssShareType.DEVICE); + const [factorPubToDelete, setFactorPubToDelete] = useState(""); + const [backupFactorKey, setBackupFactorKey] = useState(undefined); + + const getUserInfo = async () => { + const userInfo = coreKitInstance.getUserInfo(); + uiConsole(userInfo); + }; + + const keyDetails = async () => { + if (!coreKitInstance) { + throw new Error("coreKitInstance not found"); + } + uiConsole(coreKitInstance.getKeyDetails()); + }; + + const listFactors = async () => { + if (!coreKitInstance) { + throw new Error("coreKitInstance not found"); + } + const factorPubs = coreKitInstance.tKey.metadata.factorPubs; + if (!factorPubs) { + throw new Error("factorPubs not found"); + } + const pubsHex = factorPubs[coreKitInstance.tKey.tssTag].map((pub: any) => { + return Point.fromTkeyPoint(pub).toBufferSEC1(true).toString("hex"); + }); + uiConsole(pubsHex); + }; + + const commit = async () => { + if (!coreKitInstance) { + throw new Error("coreKitInstance is not set"); + } + await coreKitInstance.commitChanges(); + }; + + const enableMFA = async () => { + if (!coreKitInstance) { + throw new Error("coreKitInstance is not set"); + } + const factorKey = await coreKitInstance.enableMFA({}); + const factorKeyMnemonic = keyToMnemonic(factorKey); + + uiConsole("MFA enabled, device factor stored in local store, deleted hashed cloud key, your backup factor key: ", factorKeyMnemonic); + }; + + const exportFactor = async (): Promise => { + if (!coreKitInstance) { + throw new Error("coreKitInstance is not set"); + } + uiConsole("export share type: ", exportTssShareType); + const factorKey = generateFactorKey(); + await coreKitInstance.createFactor({ + shareType: exportTssShareType, + factorKey: factorKey.private, + }); + let mnemonic = keyToMnemonic(factorKey.private.toString("hex")); + let key = mnemonicToKey(mnemonic); + + uiConsole("Export factor key: ", factorKey); + console.log("menmonic : ", mnemonic); + console.log("key: ", key); + }; + + const deleteFactor = async (): Promise => { + if (!coreKitInstance) { + throw new Error("coreKitInstance is not set"); + } + const pubBuffer = Buffer.from(factorPubToDelete, "hex"); + const pub = Point.fromBufferSEC1(pubBuffer); + await coreKitInstance.deleteFactor(pub.toTkeyPoint()); + uiConsole("factor deleted"); + }; + + const unsafeExportTssKey = async () => { + const exportedTssKey = await coreKitInstance._UNSAFE_exportTssKey(); + uiConsole(exportedTssKey); + } + + const exportAndImportTssKey = () => { + console.log('exportAndImportTssKey', exportAndImportTssKey); + exportImportTssKey(); + } + + return ( +
+

Account Details

+
+ + + + + + + + + +
+
+ + + + + + + +
+

Recovery/ Key Manipulation

+
+

Enabling MFA

+
+ +
+

Manual Factors Manipulation

+
+ + + +
+
+ + setFactorPubToDelete(e.target.value)}> + +
+
+ setBackupFactorKey(e.target.value)}> + +
+ + +
+ + +
+ ); +} + +export default LoggedinView; diff --git a/demo/redirect-flow-example/src/components/BlockchainCalls.tsx b/demo/redirect-flow-example/src/components/BlockchainCalls.tsx new file mode 100644 index 00000000..9ee5367d --- /dev/null +++ b/demo/redirect-flow-example/src/components/BlockchainCalls.tsx @@ -0,0 +1,152 @@ +import Web3 from "web3"; +import { Web3AuthMPCCoreKit } from "@web3auth/mpc-core-kit"; +import { CHAIN_CONFIGS, uiConsole } from "../utils"; + +interface IBlockchainCalls { + web3: Web3; + coreKitInstance: Web3AuthMPCCoreKit; + switchChain: (namespace: keyof typeof CHAIN_CONFIGS) => void; +} + +const BlockchainCalls = ({ web3, coreKitInstance, switchChain }: IBlockchainCalls) => { + + const getChainID = async () => { + if (!web3) { + uiConsole("web3 not initialized yet"); + return; + } + const chainId = await web3.eth.getChainId(); + uiConsole(chainId); + return chainId; + }; + + const getAccounts = async () => { + if (!web3) { + uiConsole("web3 not initialized yet"); + return; + } + const address = (await web3.eth.getAccounts())[0]; + uiConsole(address); + return address; + }; + + const setTSSWalletIndex = async (index=0) => { + coreKitInstance.setTssWalletIndex(index); + // log new account details + await getAccounts(); + } + + const getBalance = async () => { + if (!web3) { + uiConsole("web3 not initialized yet"); + return; + } + const address = (await web3.eth.getAccounts())[0]; + const balance = web3.utils.fromWei( + await web3.eth.getBalance(address) // Balance is in wei + ); + uiConsole(balance); + return balance; + }; + + const signMessage = async (): Promise => { + if (!web3) { + uiConsole("web3 not initialized yet"); + return; + } + const fromAddress = (await web3.eth.getAccounts())[0]; + const originalMessage = [ + { + type: "string", + name: "fullName", + value: "Satoshi Nakamoto", + }, + { + type: "uint32", + name: "userId", + value: "1212", + }, + ]; + const params = [originalMessage, fromAddress]; + const method = "eth_signTypedData"; + const signedMessage = await (web3.currentProvider as any)?.sendAsync({ + id: 1, + method, + params, + fromAddress, + }); + uiConsole(signedMessage); + }; + + const sendTransaction = async () => { + if (!web3) { + uiConsole("web3 not initialized yet"); + return; + } + const fromAddress = (await web3.eth.getAccounts())[0]; + + const destination = "0x2E464670992574A613f10F7682D5057fB507Cc21"; + const amount = web3.utils.toWei("0.0001"); // Convert 1 ether to wei + + // Submit transaction to the blockchain and wait for it to be mined + uiConsole("Sending transaction..."); + const receipt = await web3.eth.sendTransaction({ + from: fromAddress, + to: destination, + value: amount, + }); + uiConsole(receipt); + }; + + return ( + <> +

Blockchain Calls

+
+ + + + + + + + + + + + + + + + + + + + +
+ + ) +} + +export default BlockchainCalls; diff --git a/demo/redirect-flow-example/src/components/SecurityQuestion.tsx b/demo/redirect-flow-example/src/components/SecurityQuestion.tsx new file mode 100644 index 00000000..2696148b --- /dev/null +++ b/demo/redirect-flow-example/src/components/SecurityQuestion.tsx @@ -0,0 +1,88 @@ +import { useState } from "react"; +import { TssSecurityQuestion, TssShareType, Web3AuthMPCCoreKit } from "@web3auth/mpc-core-kit"; + + +interface ISecurityQuestionProps { + // createSecurityQuestion: (question: string, answer: string) => void; + // changeSecurityQuestion: (question: string, newAnswer: string, oldAnswer: string) => void; + // deleteSecurityQuestion: () => void; + coreKitInstance: Web3AuthMPCCoreKit +} + +const SecurityQuestion = ({ coreKitInstance }: ISecurityQuestionProps) => { + const securityQuestion: TssSecurityQuestion = new TssSecurityQuestion(); + + const [question, setQuestion] = useState(undefined); + const [newQuestion, setNewQuestion] = useState(undefined); + const [answer, setAnswer] = useState(undefined); + const [newAnswer, setNewAnswer] = useState(undefined); + + const createSecurityQuestion = async (question: string, answer: string) => { + if (!coreKitInstance) { + throw new Error("coreKitInstance is not set"); + } + await securityQuestion.setSecurityQuestion({ mpcCoreKit: coreKitInstance, question, answer, shareType: TssShareType.RECOVERY }); + setNewQuestion(undefined); + let result = securityQuestion.getQuestion(coreKitInstance); + if (result) { + setQuestion(question); + } + } + + const changeSecurityQuestion = async (newQuestion: string, newAnswer: string, answer: string) => { + if (!coreKitInstance) { + throw new Error("coreKitInstance is not set"); + } + await securityQuestion.changeSecurityQuestion({ mpcCoreKit: coreKitInstance, newQuestion, newAnswer, answer }); + let result = securityQuestion.getQuestion(coreKitInstance); + if (result) { + setQuestion(question); + } + } + + const deleteSecurityQuestion = async () => { + if (!coreKitInstance) { + throw new Error("coreKitInstance is not set"); + } + await securityQuestion.deleteSecurityQuestion(coreKitInstance); + setQuestion(undefined); + } + + return ( + <> +

Security Question

+ +
{question}
+
+
+ + setNewQuestion(e.target.value)}> + setAnswer(e.target.value)}> + +
+ +
+ + setNewQuestion(e.target.value)}> + setNewAnswer(e.target.value)}> + setAnswer(e.target.value)}> + + +
+
+
+
+ +
+
+ + ) +} + +export default SecurityQuestion; diff --git a/demo/redirect-flow-example/src/utils.ts b/demo/redirect-flow-example/src/utils.ts new file mode 100644 index 00000000..8d35e210 --- /dev/null +++ b/demo/redirect-flow-example/src/utils.ts @@ -0,0 +1,46 @@ +import { CHAIN_NAMESPACES } from "@web3auth/base"; + +export function uiConsole(...args: any[]): void { + const el = document.querySelector("#console>p"); + if (el) { + el.innerHTML = JSON.stringify(args || {}, null, 2); + } + console.log(...args); +}; + +export const CHAIN_CONFIGS = { + SEPOLIA: { + chainId: "0xaa36a7", // for wallet connect make sure to pass in this chain in the loginSettings of the adapter. + displayName: "Ethereum Sepolia", + chainNamespace: CHAIN_NAMESPACES.EIP155, + tickerName: "Ethereum Sepolia", + ticker: "ETH", + decimals: 18, + rpcTarget: "https://rpc.ankr.com/eth_sepolia", + blockExplorer: "https://sepolia.etherscan.io", + logo: "https://cryptologos.cc/logos/ethereum-eth-logo.png", + }, + POLYGON: { + chainNamespace: CHAIN_NAMESPACES.EIP155, + chainId: "0x89", // hex of 137, polygon mainnet + rpcTarget: "https://rpc.ankr.com/polygon", + // Avoid using public rpcTarget in production. + // Use services like Infura, Quicknode etc + displayName: "Polygon Mainnet", + blockExplorer: "https://polygonscan.com", + ticker: "MATIC", + tickerName: "MATIC", + }, + OPBNB: { + chainNamespace: CHAIN_NAMESPACES.EIP155, + chainId: "0xCC", // hex of 1261120 + rpcTarget: "https://opbnb-mainnet-rpc.bnbchain.org", + // Avoid using public rpcTarget in production. + // Use services like Infura, Quicknode etc + displayName: "opBNB Mainnet", + blockExplorer: "https://opbnbscan.com", + ticker: "BNB", + tickerName: "opBNB", + }, +} +export type CHAIN_NAMESPACE = keyof typeof CHAIN_CONFIGS; diff --git a/package-lock.json b/package-lock.json index f38d2c47..28598059 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3374,9 +3374,9 @@ } }, "node_modules/@octokit/openapi-types": { - "version": "20.0.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-20.0.0.tgz", - "integrity": "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==", + "version": "22.1.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.1.0.tgz", + "integrity": "sha512-pGUdSP+eEPfZiQHNkZI0U01HLipxncisdJQB4G//OAmfeO8sqTQ9KRa0KF03TUPCziNsoXUrTg4B2Q1EX++T0Q==", "dev": true }, "node_modules/@octokit/plugin-paginate-rest": { @@ -3422,14 +3422,14 @@ } }, "node_modules/@octokit/request": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.2.0.tgz", - "integrity": "sha512-exPif6x5uwLqv1N1irkLG1zZNJkOtj8bZxuVHd71U5Ftuxf2wGNvAJyNBcPbPC+EBzwYEbBDdSFb8EPcjpYxPQ==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.4.0.tgz", + "integrity": "sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==", "dev": true, "dependencies": { - "@octokit/endpoint": "^9.0.0", - "@octokit/request-error": "^5.0.0", - "@octokit/types": "^12.0.0", + "@octokit/endpoint": "^9.0.1", + "@octokit/request-error": "^5.1.0", + "@octokit/types": "^13.1.0", "universal-user-agent": "^6.0.0" }, "engines": { @@ -3451,27 +3451,312 @@ } }, "node_modules/@octokit/rest": { - "version": "20.0.2", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-20.0.2.tgz", - "integrity": "sha512-Ux8NDgEraQ/DMAU1PlAohyfBBXDwhnX2j33Z1nJNziqAfHi70PuxkFYIcIt8aIAxtRE7KVuKp8lSR8pA0J5iOQ==", + "version": "20.1.0", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-20.1.0.tgz", + "integrity": "sha512-STVO3itHQLrp80lvcYB2UIKoeil5Ctsgd2s1AM+du3HqZIR35ZH7WE9HLwUOLXH0myA0y3AGNPo8gZtcgIbw0g==", "dev": true, "dependencies": { - "@octokit/core": "^5.0.0", - "@octokit/plugin-paginate-rest": "^9.0.0", + "@octokit/core": "^5.0.2", + "@octokit/plugin-paginate-rest": "^9.1.5", "@octokit/plugin-request-log": "^4.0.0", - "@octokit/plugin-rest-endpoint-methods": "^10.0.0" + "@octokit/plugin-rest-endpoint-methods": "^10.2.0" }, "engines": { "node": ">= 18" } }, "node_modules/@octokit/types": { - "version": "12.6.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.6.0.tgz", - "integrity": "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==", + "version": "13.4.1", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.4.1.tgz", + "integrity": "sha512-Y73oOAzRBAUzR/iRAbGULzpNkX8vaxKCqEtg6K74Ff3w9f5apFnWtE/2nade7dMWWW3bS5Kkd6DJS4HF04xreg==", "dev": true, "dependencies": { - "@octokit/openapi-types": "^20.0.0" + "@octokit/openapi-types": "^22.1.0" + } + }, + "node_modules/@parcel/watcher": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.4.1.tgz", + "integrity": "sha512-HNjmfLQEVRZmHRET336f20H/8kOozUGwk7yajvsonjNxbj2wBTK1WsQuHkD5yYh9RxFGL2EyDHryOihOwUoKDA==", + "dependencies": { + "detect-libc": "^1.0.3", + "is-glob": "^4.0.3", + "micromatch": "^4.0.5", + "node-addon-api": "^7.0.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "@parcel/watcher-android-arm64": "2.4.1", + "@parcel/watcher-darwin-arm64": "2.4.1", + "@parcel/watcher-darwin-x64": "2.4.1", + "@parcel/watcher-freebsd-x64": "2.4.1", + "@parcel/watcher-linux-arm-glibc": "2.4.1", + "@parcel/watcher-linux-arm64-glibc": "2.4.1", + "@parcel/watcher-linux-arm64-musl": "2.4.1", + "@parcel/watcher-linux-x64-glibc": "2.4.1", + "@parcel/watcher-linux-x64-musl": "2.4.1", + "@parcel/watcher-win32-arm64": "2.4.1", + "@parcel/watcher-win32-ia32": "2.4.1", + "@parcel/watcher-win32-x64": "2.4.1" + } + }, + "node_modules/@parcel/watcher-android-arm64": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.4.1.tgz", + "integrity": "sha512-LOi/WTbbh3aTn2RYddrO8pnapixAziFl6SMxHM69r3tvdSm94JtCenaKgk1GRg5FJ5wpMCpHeW+7yqPlvZv7kg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-darwin-arm64": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.4.1.tgz", + "integrity": "sha512-ln41eihm5YXIY043vBrrHfn94SIBlqOWmoROhsMVTSXGh0QahKGy77tfEywQ7v3NywyxBBkGIfrWRHm0hsKtzA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-darwin-x64": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.4.1.tgz", + "integrity": "sha512-yrw81BRLjjtHyDu7J61oPuSoeYWR3lDElcPGJyOvIXmor6DEo7/G2u1o7I38cwlcoBHQFULqF6nesIX3tsEXMg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-freebsd-x64": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.4.1.tgz", + "integrity": "sha512-TJa3Pex/gX3CWIx/Co8k+ykNdDCLx+TuZj3f3h7eOjgpdKM+Mnix37RYsYU4LHhiYJz3DK5nFCCra81p6g050w==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm-glibc": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.4.1.tgz", + "integrity": "sha512-4rVYDlsMEYfa537BRXxJ5UF4ddNwnr2/1O4MHM5PjI9cvV2qymvhwZSFgXqbS8YoTk5i/JR0L0JDs69BUn45YA==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-glibc": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.4.1.tgz", + "integrity": "sha512-BJ7mH985OADVLpbrzCLgrJ3TOpiZggE9FMblfO65PlOCdG++xJpKUJ0Aol74ZUIYfb8WsRlUdgrZxKkz3zXWYA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-musl": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.4.1.tgz", + "integrity": "sha512-p4Xb7JGq3MLgAfYhslU2SjoV9G0kI0Xry0kuxeG/41UfpjHGOhv7UoUDAz/jb1u2elbhazy4rRBL8PegPJFBhA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-glibc": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.4.1.tgz", + "integrity": "sha512-s9O3fByZ/2pyYDPoLM6zt92yu6P4E39a03zvO0qCHOTjxmt3GHRMLuRZEWhWLASTMSrrnVNWdVI/+pUElJBBBg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-musl": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.4.1.tgz", + "integrity": "sha512-L2nZTYR1myLNST0O632g0Dx9LyMNHrn6TOt76sYxWLdff3cB22/GZX2UPtJnaqQPdCRoszoY5rcOj4oMTtp5fQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-wasm": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-wasm/-/watcher-wasm-2.4.1.tgz", + "integrity": "sha512-/ZR0RxqxU/xxDGzbzosMjh4W6NdYFMqq2nvo2b8SLi7rsl/4jkL8S5stIikorNkdR50oVDvqb/3JT05WM+CRRA==", + "bundleDependencies": [ + "napi-wasm" + ], + "dependencies": { + "is-glob": "^4.0.3", + "micromatch": "^4.0.5", + "napi-wasm": "^1.1.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-wasm/node_modules/napi-wasm": { + "version": "1.1.0", + "inBundle": true, + "license": "MIT" + }, + "node_modules/@parcel/watcher-win32-arm64": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.4.1.tgz", + "integrity": "sha512-Uq2BPp5GWhrq/lcuItCHoqxjULU1QYEcyjSO5jqqOK8RNFDBQnenMMx4gAl3v8GiWa59E9+uDM7yZ6LxwUIfRg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-ia32": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.4.1.tgz", + "integrity": "sha512-maNRit5QQV2kgHFSYwftmPBxiuK5u4DXjbXx7q6eKjq5dsLXZ4FJiVvlcw35QXzk0KrUecJmuVFbj4uV9oYrcw==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-x64": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.4.1.tgz", + "integrity": "sha512-+DvS92F9ezicfswqrvIRM2njcYJbd5mb9CUgtrHCHmvn7pPPa+nMDRu1o1bYYz/l5IB2NVGNJWiH7h1E58IF2A==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, "node_modules/@pkgjs/parseargs": { @@ -3617,9 +3902,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz", - "integrity": "sha512-+ac02NL/2TCKRrJu2wffk1kZ+RyqxVUlbjSagNgPm94frxtr+XDL12E5Ll1enWskLrtrZ2r8L3wED1orIibV/w==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.14.3.tgz", + "integrity": "sha512-X9alQ3XM6I9IlSlmC8ddAvMSyG1WuHk5oUnXGw+yUBs3BFoTizmG1La/Gr8fVJvDWAq+zlYTZ9DBgrlKRVY06g==", "cpu": [ "arm" ], @@ -3630,9 +3915,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.0.tgz", - "integrity": "sha512-OBqcX2BMe6nvjQ0Nyp7cC90cnumt8PXmO7Dp3gfAju/6YwG0Tj74z1vKrfRz7qAv23nBcYM8BCbhrsWqO7PzQQ==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.14.3.tgz", + "integrity": "sha512-eQK5JIi+POhFpzk+LnjKIy4Ks+pwJ+NXmPxOCSvOKSNRPONzKuUvWE+P9JxGZVxrtzm6BAYMaL50FFuPe0oWMQ==", "cpu": [ "arm64" ], @@ -3643,9 +3928,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.0.tgz", - "integrity": "sha512-X64tZd8dRE/QTrBIEs63kaOBG0b5GVEd3ccoLtyf6IdXtHdh8h+I56C2yC3PtC9Ucnv0CpNFJLqKFVgCYe0lOQ==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.14.3.tgz", + "integrity": "sha512-Od4vE6f6CTT53yM1jgcLqNfItTsLt5zE46fdPaEmeFHvPs5SjZYlLpHrSiHEKR1+HdRfxuzXHjDOIxQyC3ptBA==", "cpu": [ "arm64" ], @@ -3656,9 +3941,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.0.tgz", - "integrity": "sha512-cc71KUZoVbUJmGP2cOuiZ9HSOP14AzBAThn3OU+9LcA1+IUqswJyR1cAJj3Mg55HbjZP6OLAIscbQsQLrpgTOg==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.14.3.tgz", + "integrity": "sha512-0IMAO21axJeNIrvS9lSe/PGthc8ZUS+zC53O0VhF5gMxfmcKAP4ESkKOCwEi6u2asUrt4mQv2rjY8QseIEb1aw==", "cpu": [ "x64" ], @@ -3669,9 +3954,22 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.0.tgz", - "integrity": "sha512-a6w/Y3hyyO6GlpKL2xJ4IOh/7d+APaqLYdMf86xnczU3nurFTaVN9s9jOXQg97BE4nYm/7Ga51rjec5nfRdrvA==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.14.3.tgz", + "integrity": "sha512-ge2DC7tHRHa3caVEoSbPRJpq7azhG+xYsd6u2MEnJ6XzPSzQsTKyXvh6iWjXRf7Rt9ykIUWHtl0Uz3T6yXPpKw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.14.3.tgz", + "integrity": "sha512-ljcuiDI4V3ySuc7eSk4lQ9wU8J8r8KrOUvB2U+TtK0TiW6OFDmJ+DdIjjwZHIw9CNxzbmXY39wwpzYuFDwNXuw==", "cpu": [ "arm" ], @@ -3682,9 +3980,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.0.tgz", - "integrity": "sha512-0fZBq27b+D7Ar5CQMofVN8sggOVhEtzFUwOwPppQt0k+VR+7UHMZZY4y+64WJ06XOhBTKXtQB/Sv0NwQMXyNAA==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.14.3.tgz", + "integrity": "sha512-Eci2us9VTHm1eSyn5/eEpaC7eP/mp5n46gTRB3Aar3BgSvDQGJZuicyq6TsH4HngNBgVqC5sDYxOzTExSU+NjA==", "cpu": [ "arm64" ], @@ -3695,9 +3993,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.0.tgz", - "integrity": "sha512-eTvzUS3hhhlgeAv6bfigekzWZjaEX9xP9HhxB0Dvrdbkk5w/b+1Sxct2ZuDxNJKzsRStSq1EaEkVSEe7A7ipgQ==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.14.3.tgz", + "integrity": "sha512-UrBoMLCq4E92/LCqlh+blpqMz5h1tJttPIniwUgOFJyjWI1qrtrDhhpHPuFxULlUmjFHfloWdixtDhSxJt5iKw==", "cpu": [ "arm64" ], @@ -3707,10 +4005,23 @@ "linux" ] }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.14.3.tgz", + "integrity": "sha512-5aRjvsS8q1nWN8AoRfrq5+9IflC3P1leMoy4r2WjXyFqf3qcqsxRCfxtZIV58tCxd+Yv7WELPcO9mY9aeQyAmw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.0.tgz", - "integrity": "sha512-ix+qAB9qmrCRiaO71VFfY8rkiAZJL8zQRXveS27HS+pKdjwUfEhqo2+YF2oI+H/22Xsiski+qqwIBxVewLK7sw==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.14.3.tgz", + "integrity": "sha512-sk/Qh1j2/RJSX7FhEpJn8n0ndxy/uf0kI/9Zc4b1ELhqULVdTfN6HL31CDaTChiBAOgLcsJ1sgVZjWv8XNEsAQ==", "cpu": [ "riscv64" ], @@ -3720,10 +4031,23 @@ "linux" ] }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.14.3.tgz", + "integrity": "sha512-jOO/PEaDitOmY9TgkxF/TQIjXySQe5KVYB57H/8LRP/ux0ZoO8cSHCX17asMSv3ruwslXW/TLBcxyaUzGRHcqg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.0.tgz", - "integrity": "sha512-TenQhZVOtw/3qKOPa7d+QgkeM6xY0LtwzR8OplmyL5LrgTWIXpTQg2Q2ycBf8jm+SFW2Wt/DTn1gf7nFp3ssVA==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.14.3.tgz", + "integrity": "sha512-8ybV4Xjy59xLMyWo3GCfEGqtKV5M5gCSrZlxkPGvEPCGDLNla7v48S662HSGwRd6/2cSneMQWiv+QzcttLrrOA==", "cpu": [ "x64" ], @@ -3734,9 +4058,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.0.tgz", - "integrity": "sha512-LfFdRhNnW0zdMvdCb5FNuWlls2WbbSridJvxOvYWgSBOYZtgBfW9UGNJG//rwMqTX1xQE9BAodvMH9tAusKDUw==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.14.3.tgz", + "integrity": "sha512-s+xf1I46trOY10OqAtZ5Rm6lzHre/UiLA1J2uOhCFXWkbZrJRkYBPO6FhvGfHmdtQ3Bx793MNa7LvoWFAm93bg==", "cpu": [ "x64" ], @@ -3747,9 +4071,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.0.tgz", - "integrity": "sha512-JPDxovheWNp6d7AHCgsUlkuCKvtu3RB55iNEkaQcf0ttsDU/JZF+iQnYcQJSk/7PtT4mjjVG8N1kpwnI9SLYaw==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.14.3.tgz", + "integrity": "sha512-+4h2WrGOYsOumDQ5S2sYNyhVfrue+9tc9XcLWLh+Kw3UOxAvrfOrSMFon60KspcDdytkNDh7K2Vs6eMaYImAZg==", "cpu": [ "arm64" ], @@ -3760,9 +4084,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.0.tgz", - "integrity": "sha512-fjtuvMWRGJn1oZacG8IPnzIV6GF2/XG+h71FKn76OYFqySXInJtseAqdprVTDTyqPxQOG9Exak5/E9Z3+EJ8ZA==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.14.3.tgz", + "integrity": "sha512-T1l7y/bCeL/kUwh9OD4PQT4aM7Bq43vX05htPJJ46RTI4r5KNt6qJRzAfNfM+OYMNEVBWQzR2Gyk+FXLZfogGw==", "cpu": [ "ia32" ], @@ -3773,9 +4097,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.0.tgz", - "integrity": "sha512-ZYmr5mS2wd4Dew/JjT0Fqi2NPB/ZhZ2VvPp7SmvPZb4Y1CG/LRcS6tcRo2cYU7zLK5A7cdbhWnnWmUjoI4qapg==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.14.3.tgz", + "integrity": "sha512-/BypzV0H1y1HzgYpxqRaXGBRqfodgoBBCcsrujT6QRcakDQdfU+Lq9PENPh5jB4I44YWq+0C2eHsHya+nZY1sA==", "cpu": [ "x64" ], @@ -3786,9 +4110,9 @@ ] }, "node_modules/@rushstack/eslint-patch": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.7.2.tgz", - "integrity": "sha512-RbhOOTCNoCrbfkRyoXODZp75MlpiHMgbE5MEBZAnnnLyQNgrigEj4p0lzsMDyc1zVsJDLrivB58tgg3emX0eEA==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.10.2.tgz", + "integrity": "sha512-hw437iINopmQuxWPSUEvqE56NCPsiU8N4AYtfHmJFckclktzK9YQJieD3XkDCDH4OjL+C7zgPUh73R/nrcHrqw==", "dev": true }, "node_modules/@scure/base": { @@ -3842,22 +4166,148 @@ "url": "https://github.com/sindresorhus/is?sponsor=1" } }, - "node_modules/@sindresorhus/merge-streams": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", - "integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==", - "dev": true, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node_modules/@sindresorhus/merge-streams": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", + "integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@socket.io/component-emitter": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.1.tgz", + "integrity": "sha512-dzJtaDAAoXx4GCOJpbB2eG/Qj8VDpdwkLsWGzGm+0L7E8/434RyMbAHmk9ubXWVAb9nXmc44jUf8GKqVDiKezg==" + }, + "node_modules/@stablelib/aead": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/aead/-/aead-1.0.1.tgz", + "integrity": "sha512-q39ik6sxGHewqtO0nP4BuSe3db5G1fEJE8ukvngS2gLkBXyy6E7pLubhbYgnkDFv6V8cWaxcE4Xn0t6LWcJkyg==" + }, + "node_modules/@stablelib/binary": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/binary/-/binary-1.0.1.tgz", + "integrity": "sha512-ClJWvmL6UBM/wjkvv/7m5VP3GMr9t0osr4yVgLZsLCOz4hGN9gIAFEqnJ0TsSMAN+n840nf2cHZnA5/KFqHC7Q==", + "dependencies": { + "@stablelib/int": "^1.0.1" + } + }, + "node_modules/@stablelib/bytes": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/bytes/-/bytes-1.0.1.tgz", + "integrity": "sha512-Kre4Y4kdwuqL8BR2E9hV/R5sOrUj6NanZaZis0V6lX5yzqC3hBuVSDXUIBqQv/sCpmuWRiHLwqiT1pqqjuBXoQ==" + }, + "node_modules/@stablelib/chacha": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/chacha/-/chacha-1.0.1.tgz", + "integrity": "sha512-Pmlrswzr0pBzDofdFuVe1q7KdsHKhhU24e8gkEwnTGOmlC7PADzLVxGdn2PoNVBBabdg0l/IfLKg6sHAbTQugg==", + "dependencies": { + "@stablelib/binary": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "node_modules/@stablelib/chacha20poly1305": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/chacha20poly1305/-/chacha20poly1305-1.0.1.tgz", + "integrity": "sha512-MmViqnqHd1ymwjOQfghRKw2R/jMIGT3wySN7cthjXCBdO+qErNPUBnRzqNpnvIwg7JBCg3LdeCZZO4de/yEhVA==", + "dependencies": { + "@stablelib/aead": "^1.0.1", + "@stablelib/binary": "^1.0.1", + "@stablelib/chacha": "^1.0.1", + "@stablelib/constant-time": "^1.0.1", + "@stablelib/poly1305": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "node_modules/@stablelib/constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/constant-time/-/constant-time-1.0.1.tgz", + "integrity": "sha512-tNOs3uD0vSJcK6z1fvef4Y+buN7DXhzHDPqRLSXUel1UfqMB1PWNsnnAezrKfEwTLpN0cGH2p9NNjs6IqeD0eg==" + }, + "node_modules/@stablelib/hash": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/hash/-/hash-1.0.1.tgz", + "integrity": "sha512-eTPJc/stDkdtOcrNMZ6mcMK1e6yBbqRBaNW55XA1jU8w/7QdnCF0CmMmOD1m7VSkBR44PWrMHU2l6r8YEQHMgg==" + }, + "node_modules/@stablelib/hkdf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/hkdf/-/hkdf-1.0.1.tgz", + "integrity": "sha512-SBEHYE16ZXlHuaW5RcGk533YlBj4grMeg5TooN80W3NpcHRtLZLLXvKyX0qcRFxf+BGDobJLnwkvgEwHIDBR6g==", + "dependencies": { + "@stablelib/hash": "^1.0.1", + "@stablelib/hmac": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "node_modules/@stablelib/hmac": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/hmac/-/hmac-1.0.1.tgz", + "integrity": "sha512-V2APD9NSnhVpV/QMYgCVMIYKiYG6LSqw1S65wxVoirhU/51ACio6D4yDVSwMzuTJXWZoVHbDdINioBwKy5kVmA==", + "dependencies": { + "@stablelib/constant-time": "^1.0.1", + "@stablelib/hash": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "node_modules/@stablelib/int": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/int/-/int-1.0.1.tgz", + "integrity": "sha512-byr69X/sDtDiIjIV6m4roLVWnNNlRGzsvxw+agj8CIEazqWGOQp2dTYgQhtyVXV9wpO6WyXRQUzLV/JRNumT2w==" + }, + "node_modules/@stablelib/keyagreement": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/keyagreement/-/keyagreement-1.0.1.tgz", + "integrity": "sha512-VKL6xBwgJnI6l1jKrBAfn265cspaWBPAPEc62VBQrWHLqVgNRE09gQ/AnOEyKUWrrqfD+xSQ3u42gJjLDdMDQg==", + "dependencies": { + "@stablelib/bytes": "^1.0.1" + } + }, + "node_modules/@stablelib/poly1305": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/poly1305/-/poly1305-1.0.1.tgz", + "integrity": "sha512-1HlG3oTSuQDOhSnLwJRKeTRSAdFNVB/1djy2ZbS35rBSJ/PFqx9cf9qatinWghC2UbfOYD8AcrtbUQl8WoxabA==", + "dependencies": { + "@stablelib/constant-time": "^1.0.1", + "@stablelib/wipe": "^1.0.1" } }, - "node_modules/@socket.io/component-emitter": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz", - "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==" + "node_modules/@stablelib/random": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@stablelib/random/-/random-1.0.2.tgz", + "integrity": "sha512-rIsE83Xpb7clHPVRlBj8qNe5L8ISQOzjghYQm/dZ7VaM2KHYwMW5adjQjrzTZCchFnNCNhkwtnOBa9HTMJCI8w==", + "dependencies": { + "@stablelib/binary": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "node_modules/@stablelib/sha256": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/sha256/-/sha256-1.0.1.tgz", + "integrity": "sha512-GIIH3e6KH+91FqGV42Kcj71Uefd/QEe7Dy42sBTeqppXV95ggCcxLTk39bEr+lZfJmp+ghsR07J++ORkRELsBQ==", + "dependencies": { + "@stablelib/binary": "^1.0.1", + "@stablelib/hash": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "node_modules/@stablelib/wipe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/wipe/-/wipe-1.0.1.tgz", + "integrity": "sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg==" + }, + "node_modules/@stablelib/x25519": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@stablelib/x25519/-/x25519-1.0.3.tgz", + "integrity": "sha512-KnTbKmUhPhHavzobclVJQG5kuivH+qDLpe84iRqX3CLrKp881cF160JvXJ+hjn1aMyCwYOKeIZefIH/P5cJoRw==", + "dependencies": { + "@stablelib/keyagreement": "^1.0.1", + "@stablelib/random": "^1.0.2", + "@stablelib/wipe": "^1.0.1" + } }, "node_modules/@szmarczak/http-timer": { "version": "5.0.1", @@ -4481,6 +4931,258 @@ "typescript": "^5.x" } }, + "node_modules/@toruslabs/eslint-config-typescript/node_modules/@typescript-eslint/eslint-plugin": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.7.0.tgz", + "integrity": "sha512-GJWR0YnfrKnsRoluVO3PRb9r5aMZriiMMM/RHj5nnTrBy1/wIgk76XCtCKcnXGjpZQJQRFtGV9/0JJ6n30uwpQ==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "7.7.0", + "@typescript-eslint/type-utils": "7.7.0", + "@typescript-eslint/utils": "7.7.0", + "@typescript-eslint/visitor-keys": "7.7.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@toruslabs/eslint-config-typescript/node_modules/@typescript-eslint/parser": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.7.0.tgz", + "integrity": "sha512-fNcDm3wSwVM8QYL4HKVBggdIPAy9Q41vcvC/GtDobw3c4ndVT3K6cqudUmjHPw8EAp4ufax0o58/xvWaP2FmTg==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "7.7.0", + "@typescript-eslint/types": "7.7.0", + "@typescript-eslint/typescript-estree": "7.7.0", + "@typescript-eslint/visitor-keys": "7.7.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@toruslabs/eslint-config-typescript/node_modules/@typescript-eslint/scope-manager": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.7.0.tgz", + "integrity": "sha512-/8INDn0YLInbe9Wt7dK4cXLDYp0fNHP5xKLHvZl3mOT5X17rK/YShXaiNmorl+/U4VKCVIjJnx4Ri5b0y+HClw==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.7.0", + "@typescript-eslint/visitor-keys": "7.7.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@toruslabs/eslint-config-typescript/node_modules/@typescript-eslint/type-utils": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.7.0.tgz", + "integrity": "sha512-bOp3ejoRYrhAlnT/bozNQi3nio9tIgv3U5C0mVDdZC7cpcQEDZXvq8inrHYghLVwuNABRqrMW5tzAv88Vy77Sg==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "7.7.0", + "@typescript-eslint/utils": "7.7.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@toruslabs/eslint-config-typescript/node_modules/@typescript-eslint/types": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.7.0.tgz", + "integrity": "sha512-G01YPZ1Bd2hn+KPpIbrAhEWOn5lQBrjxkzHkWvP6NucMXFtfXoevK82hzQdpfuQYuhkvFDeQYbzXCjR1z9Z03w==", + "dev": true, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@toruslabs/eslint-config-typescript/node_modules/@typescript-eslint/typescript-estree": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.7.0.tgz", + "integrity": "sha512-8p71HQPE6CbxIBy2kWHqM1KGrC07pk6RJn40n0DSc6bMOBBREZxSDJ+BmRzc8B5OdaMh1ty3mkuWRg4sCFiDQQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.7.0", + "@typescript-eslint/visitor-keys": "7.7.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@toruslabs/eslint-config-typescript/node_modules/@typescript-eslint/utils": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.7.0.tgz", + "integrity": "sha512-LKGAXMPQs8U/zMRFXDZOzmMKgFv3COlxUQ+2NMPhbqgVm6R1w+nU1i4836Pmxu9jZAuIeyySNrN/6Rc657ggig==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.15", + "@types/semver": "^7.5.8", + "@typescript-eslint/scope-manager": "7.7.0", + "@typescript-eslint/types": "7.7.0", + "@typescript-eslint/typescript-estree": "7.7.0", + "semver": "^7.6.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + } + }, + "node_modules/@toruslabs/eslint-config-typescript/node_modules/@typescript-eslint/visitor-keys": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.7.0.tgz", + "integrity": "sha512-h0WHOj8MhdhY8YWkzIF30R379y0NqyOHExI9N9KCzvmu05EgG4FumeYa3ccfKUSphyWkWQE1ybVrgz/Pbam6YA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.7.0", + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@toruslabs/eslint-config-typescript/node_modules/eslint-config-airbnb-typescript": { + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-18.0.0.tgz", + "integrity": "sha512-oc+Lxzgzsu8FQyFVa4QFaVKiitTYiiW3frB9KYW5OWdPrqFc7FzxgB20hP4cHMlr+MBzGcLl3jnCOVOydL9mIg==", + "dev": true, + "dependencies": { + "eslint-config-airbnb-base": "^15.0.0" + }, + "peerDependencies": { + "@typescript-eslint/eslint-plugin": "^7.0.0", + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" + } + }, + "node_modules/@toruslabs/eslint-config-typescript/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@toruslabs/eslint-config-typescript/node_modules/minimatch": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@toruslabs/eslint-config-typescript/node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@toruslabs/eslint-config-typescript/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/@toruslabs/fetch-node-details": { "version": "13.1.1", "resolved": "https://registry.npmjs.org/@toruslabs/fetch-node-details/-/fetch-node-details-13.1.1.tgz", @@ -4816,9 +5518,9 @@ } }, "node_modules/@toruslabs/torus-scripts": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@toruslabs/torus-scripts/-/torus-scripts-5.2.0.tgz", - "integrity": "sha512-OQQj1SrScxeMRqv2nfefzkf0oRQGgmkkdpQ/TEiiKmwsQYrEdUQei9i9M8bXwRlPK8n71tnCv7JnEeEIm1QLaA==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@toruslabs/torus-scripts/-/torus-scripts-5.3.1.tgz", + "integrity": "sha512-W/h+ZHxBZocxncqskm2VOa4eWpQ8J0oq2sQsMcUL5iai1+plD47r7No+0zu1lnNGYVxuQIpQug2FALeiZ2pVlw==", "dev": true, "dependencies": { "@babel/core": "^7.23.7", @@ -5019,9 +5721,9 @@ } }, "node_modules/@types/eslint": { - "version": "8.56.5", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.5.tgz", - "integrity": "sha512-u5/YPJHo1tvkSF2CE0USEkxon82Z5DBy2xR+qfyYNszpX9qcs4sT6uq2kBbj4BXY1+DBGDPnrhMZV3pKWGNukw==", + "version": "8.56.9", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.9.tgz", + "integrity": "sha512-W4W3KcqzjJ0sHg2vAq9vfml6OhsJ53TcUjUqfzzZf/EChUtwspszj/S0pzMxnfRcO55/iGq47dscXw71Fxc4Zg==", "dev": true, "dependencies": { "@types/estree": "*", @@ -5101,9 +5803,9 @@ "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==" }, "node_modules/@types/node": { - "version": "20.11.22", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.22.tgz", - "integrity": "sha512-/G+IxWxma6V3E+pqK1tSl2Fo1kl41pK1yeCyDsgkF9WlVAme4j5ISYM2zR11bgLFJGLN5sVK40T4RJNuiZbEjA==", + "version": "20.12.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.7.tgz", + "integrity": "sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==", "dependencies": { "undici-types": "~5.26.4" } @@ -5519,32 +6221,110 @@ "resolved": "https://registry.npmjs.org/@toruslabs/http-helpers/-/http-helpers-3.4.0.tgz", "integrity": "sha512-CoeJSL32mpp0gmYjxv48odu6pfjHk/rbJHDwCtYPcMHAl+qUQ/DTpVOOn9U0fGkD+fYZrQmZbRkXFgLhiT0ajQ==", "dependencies": { - "lodash.merge": "^4.6.2", - "loglevel": "^1.8.1" - }, - "engines": { - "node": ">=14.17.0", - "npm": ">=6.x" - }, - "peerDependencies": { - "@babel/runtime": "^7.x", - "@sentry/types": "^7.x" - }, - "peerDependenciesMeta": { - "@sentry/types": { - "optional": true - } + "@walletconnect/jsonrpc-types": "^1.0.2", + "tslib": "1.14.1" } }, - "node_modules/@web3auth/base": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/@web3auth/base/-/base-7.3.2.tgz", - "integrity": "sha512-Bg5Mjqr51ETTRtya+4+v2G/OUjHPbkuRbtLGFjQ4uzrBuFokbEaE70kodnR7ZpIhOn41p8nciSxEo1ZJT+rBUQ==", + "node_modules/@walletconnect/relay-api/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@walletconnect/safe-json": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@walletconnect/safe-json/-/safe-json-1.0.2.tgz", + "integrity": "sha512-Ogb7I27kZ3LPC3ibn8ldyUr5544t3/STow9+lzz7Sfo808YD7SBWk7SAsdBFlYgP2zDRy2hS3sKRcuSRM0OTmA==", "dependencies": { - "@toruslabs/http-helpers": "^6.0.0", - "@toruslabs/openlogin": "^6.2.11", - "@toruslabs/openlogin-jrpc": "^6.2.11", - "@toruslabs/openlogin-utils": "^6.2.11", + "tslib": "1.14.1" + } + }, + "node_modules/@walletconnect/safe-json/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@walletconnect/time": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@walletconnect/time/-/time-1.0.2.tgz", + "integrity": "sha512-uzdd9woDcJ1AaBZRhqy5rNC9laqWGErfc4dxA9a87mPdKOgWMD85mcFo9dIYIts/Jwocfwn07EC6EzclKubk/g==", + "dependencies": { + "tslib": "1.14.1" + } + }, + "node_modules/@walletconnect/time/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@walletconnect/types": { + "version": "2.12.2", + "resolved": "https://registry.npmjs.org/@walletconnect/types/-/types-2.12.2.tgz", + "integrity": "sha512-9CmwTlPbrFTzayTL9q7xM7s3KTJkS6kYFtH2m1/fHFgALs6pIUjf1qAx1TF2E4tv7SEzLAIzU4NqgYUt2vWXTg==", + "dependencies": { + "@walletconnect/events": "^1.0.1", + "@walletconnect/heartbeat": "1.2.1", + "@walletconnect/jsonrpc-types": "1.0.3", + "@walletconnect/keyvaluestorage": "^1.1.1", + "@walletconnect/logger": "^2.0.1", + "events": "^3.3.0" + } + }, + "node_modules/@walletconnect/utils": { + "version": "2.12.2", + "resolved": "https://registry.npmjs.org/@walletconnect/utils/-/utils-2.12.2.tgz", + "integrity": "sha512-zf50HeS3SfoLv1N9GPl2IXTZ9TsXfet4usVAsZmX9P6/Xzq7d/7QakjVQCHH/Wk1O9XkcsfeoZoUhRxoMJ5uJw==", + "dependencies": { + "@stablelib/chacha20poly1305": "1.0.1", + "@stablelib/hkdf": "1.0.1", + "@stablelib/random": "^1.0.2", + "@stablelib/sha256": "1.0.1", + "@stablelib/x25519": "^1.0.3", + "@walletconnect/relay-api": "^1.0.9", + "@walletconnect/safe-json": "^1.0.2", + "@walletconnect/time": "^1.0.2", + "@walletconnect/types": "2.12.2", + "@walletconnect/window-getters": "^1.0.1", + "@walletconnect/window-metadata": "^1.0.1", + "detect-browser": "5.3.0", + "query-string": "7.1.3", + "uint8arrays": "^3.1.0" + } + }, + "node_modules/@walletconnect/window-getters": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@walletconnect/window-getters/-/window-getters-1.0.1.tgz", + "integrity": "sha512-vHp+HqzGxORPAN8gY03qnbTMnhqIwjeRJNOMOAzePRg4xVEEE2WvYsI9G2NMjOknA8hnuYbU3/hwLcKbjhc8+Q==", + "dependencies": { + "tslib": "1.14.1" + } + }, + "node_modules/@walletconnect/window-getters/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@walletconnect/window-metadata": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@walletconnect/window-metadata/-/window-metadata-1.0.1.tgz", + "integrity": "sha512-9koTqyGrM2cqFRW517BPY/iEtUDx2r1+Pwwu5m7sJ7ka79wi3EyqhqcICk/yDmv6jAS1rjKgTKXlEhanYjijcA==", + "dependencies": { + "@walletconnect/window-getters": "^1.0.1", + "tslib": "1.14.1" + } + }, + "node_modules/@walletconnect/window-metadata/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@web3auth-mpc/base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@web3auth-mpc/base/-/base-3.1.0.tgz", + "integrity": "sha512-y3f1rxwdnH735SFD/EfSEVGvfZkEgckH2ZzpfHpr5dL4AYpu+Jn5kBWLcTwd9EwkauKJRvRT4wEwgQTQyI85jQ==", + "dependencies": { + "@toruslabs/http-helpers": "^5.0.0", + "@toruslabs/openlogin-jrpc": "^6.1.0", + "@toruslabs/openlogin-utils": "^6.1.0", "jwt-decode": "^4.0.0", "loglevel": "^1.8.1", "ts-custom-error": "^3.3.1" @@ -7234,9 +8014,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001591", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001591.tgz", - "integrity": "sha512-PCzRMei/vXjJyL5mJtzNiUCKP59dm8Apqc3PH8gJkMnMXZGox93RbE76jHsmLwmIo6/3nsYIpJtx0O7u5PqFuQ==", + "version": "1.0.30001610", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001610.tgz", + "integrity": "sha512-QFutAY4NgaelojVMjY63o6XlZyORPaLfyMnsl3HgnWdJUcX6K0oaJymHjH8PT5Gk7sTm8rvC/c5COUQKXqmOMA==", "dev": true, "funding": [ { @@ -7656,9 +8436,9 @@ "dev": true }, "node_modules/core-js-compat": { - "version": "3.36.0", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.36.0.tgz", - "integrity": "sha512-iV9Pd/PsgjNWBXeq8XRtWVSgz2tKAfhfvBs7qxYty+RlRd+OCksaWmOnc4JKrTc1cToXL1N0s3l/vwlxPtdElw==", + "version": "3.37.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.37.0.tgz", + "integrity": "sha512-vYq4L+T8aS5UuFg4UwDhc7YNRWVeVZwltad9C/jV3R2LgVOpS9BDr7l/WL6BN0dbV3k1XejPTHqqEzJgsa0frA==", "dev": true, "dependencies": { "browserslist": "^4.22.3" @@ -8199,9 +8979,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.687", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.687.tgz", - "integrity": "sha512-Ic85cOuXSP6h7KM0AIJ2hpJ98Bo4hyTUjc4yjMbkvD+8yTxEhfK9+8exT2KKYsSjnCn2tGsKVSZwE7ZgTORQCw==", + "version": "1.4.738", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.738.tgz", + "integrity": "sha512-lwKft2CLFztD+vEIpesrOtCrko/TFnEJlHFdRhazU7Y/jx5qc4cqsocfVrBg4So4gGe9lvxnbLIoev47WMpg+A==", "dev": true }, "node_modules/elliptic": { @@ -8911,9 +9691,9 @@ } }, "node_modules/eslint-plugin-mocha": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.3.0.tgz", - "integrity": "sha512-IWzbg2K6B1Q7h37Ih4zMyW+nhmw1JvUlHlbCUUUu6PfOOAUGCB0gxmvv7/U+TQQ6e8yHUv+q7KMdIIum4bx+PA==", + "version": "10.4.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.4.2.tgz", + "integrity": "sha512-cur4dVYnSEWTBwdqIBQFxa/9siAhesu0TX+lbJ4ClE9j0eNMNe6BSx3vkFFNz6tGoveyMyELFXa30f3fvuAVDg==", "dev": true, "dependencies": { "eslint-utils": "^3.0.0", @@ -9079,9 +9859,9 @@ } }, "node_modules/eslint-plugin-simple-import-sort": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-10.0.0.tgz", - "integrity": "sha512-AeTvO9UCMSNzIHRkg8S6c3RPy5YEwKWSQPx3DYghLedo2ZQxowPFLGDN1AZ2evfg6r6mjBSZSLxLFsWSu3acsw==", + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-12.1.0.tgz", + "integrity": "sha512-Y2fqAfC11TcG/WP3TrI1Gi3p3nc8XJyEOJYHyEPEGI/UAgNx6akxxlX74p7SbAQdLcgASKhj8M0GKvH3vq/+ig==", "dev": true, "peerDependencies": { "eslint": ">=5.0.0" @@ -9413,11 +10193,11 @@ } }, "node_modules/ethereum-bloom-filters": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.10.tgz", - "integrity": "sha512-rxJ5OFN3RwjQxDcFP2Z5+Q9ho4eIdEmSc2ht0fCu8Se9nbXjZ7/031uXoUYJ87KHCOdVeiUuwSnoS7hmYAGVHA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ethereum-bloom-filters/-/ethereum-bloom-filters-1.1.0.tgz", + "integrity": "sha512-J1gDRkLpuGNvWYzWslBQR9cDV4nd4kfvVTE/Wy4Kkm4yb3EYRSlyi0eB/inTsSTTVyA0+HyzHgbr95Fn/Z1fSw==", "dependencies": { - "js-sha3": "^0.8.0" + "@noble/hashes": "^1.4.0" } }, "node_modules/ethereum-cryptography": { @@ -10829,12 +11609,12 @@ } }, "node_modules/inquirer": { - "version": "9.2.14", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.2.14.tgz", - "integrity": "sha512-4ByIMt677Iz5AvjyKrDpzaepIyMewNvDcvwpVVRZNmy9dLakVoVgdCHZXbK1SlVJra1db0JZ6XkJyHsanpdrdQ==", + "version": "9.2.17", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.2.17.tgz", + "integrity": "sha512-Vr3Ia2ud5sGnioURkE69endl4SkeJcMzTF6SosKcX5GALJfId7C+JvO5ZZb6y1LOXnEofCPbwzoQ1q0e8Gaduw==", "dev": true, "dependencies": { - "@ljharb/through": "^2.3.12", + "@ljharb/through": "^2.3.13", "ansi-escapes": "^4.3.2", "chalk": "^5.3.0", "cli-cursor": "^3.1.0", @@ -11667,9 +12447,9 @@ } }, "node_modules/issue-parser": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/issue-parser/-/issue-parser-6.0.0.tgz", - "integrity": "sha512-zKa/Dxq2lGsBIXQ7CUZWTHfvxPC2ej0KfO7fIPqLlHB9J2hJ7rGhZ5rilhuufylr4RXYPzJUeFjKxz305OsNlA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/issue-parser/-/issue-parser-7.0.0.tgz", + "integrity": "sha512-jgAw78HO3gs9UrKqJNQvfDj9Ouy8Mhu40fbEJ8yXff4MW8+/Fcn9iFjyWUQ6SKbX8ipPk3X5A3AyfYHRu6uVLw==", "dev": true, "dependencies": { "lodash.capitalize": "^4.2.1", @@ -11679,7 +12459,7 @@ "lodash.uniqby": "^4.7.0" }, "engines": { - "node": ">=10.13" + "node": "^18.17 || >=20.6.1" } }, "node_modules/iterate-iterator": { @@ -13506,9 +14286,9 @@ } }, "node_modules/open": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/open/-/open-10.0.3.tgz", - "integrity": "sha512-dtbI5oW7987hwC9qjJTyABldTaa19SuyJse1QboWv3b0qCcrrLNVDqBx1XgELAjh9QTVQaP/C5b1nhQebd1H2A==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/open/-/open-10.1.0.tgz", + "integrity": "sha512-mnkeQ1qP5Ue2wd+aivTD3NHd/lZ96Lu0jgf0pwktLPtx6cTZiH7tyeGRRHs0zX0rbrahXPnXlUnbeXyaBBuIaw==", "dev": true, "dependencies": { "default-browser": "^5.2.1", @@ -14142,9 +14922,9 @@ } }, "node_modules/pony-cause": { - "version": "2.1.10", - "resolved": "https://registry.npmjs.org/pony-cause/-/pony-cause-2.1.10.tgz", - "integrity": "sha512-3IKLNXclQgkU++2fSi93sQ6BznFuxSLB11HdvZQ6JW/spahf/P1pAHBQEahr20rs0htZW0UDkM1HmA+nZkXKsw==", + "version": "2.1.11", + "resolved": "https://registry.npmjs.org/pony-cause/-/pony-cause-2.1.11.tgz", + "integrity": "sha512-M7LhCsdNbNgiLYiP4WjsfLUuFmCfnjdF6jKe2R9NKl4WFN+HZPGHJZ9lnLP7f9ZnKe3U9nuWD0szirmj+migUg==", "engines": { "node": ">=12.0.0" } @@ -14326,9 +15106,9 @@ } }, "node_modules/qs": { - "version": "6.11.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz", - "integrity": "sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==", + "version": "6.12.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.12.1.tgz", + "integrity": "sha512-zWmv4RSuB9r2mYQw3zxQuHWeU+42aKi1wWig/j4ele4ygELZ7PEO6MM7rim9oAQH2A5MWfsAVf/jPvTPgCbvUQ==", "dev": true, "dependencies": { "side-channel": "^1.0.4" @@ -14579,9 +15359,9 @@ } }, "node_modules/release-it": { - "version": "17.1.1", - "resolved": "https://registry.npmjs.org/release-it/-/release-it-17.1.1.tgz", - "integrity": "sha512-b+4Tu2eb5f2wIdIe5E9hre0evbMQrXp/kRq0natHsHYJVqu1Bd4/h2a+swFi0faGmC3cJdB16uYR6LscG9SchQ==", + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/release-it/-/release-it-17.2.0.tgz", + "integrity": "sha512-Cidaq5W4apZSpdEDQd2TJhH7GZAwfaG+ewe60p7B7+txyCHYR/T6lGvkKinJmePpdHsM0fzA05yGGXKCiHJHmA==", "dev": true, "funding": [ { @@ -14595,7 +15375,7 @@ ], "dependencies": { "@iarna/toml": "2.2.5", - "@octokit/rest": "20.0.2", + "@octokit/rest": "20.1.0", "async-retry": "1.3.3", "chalk": "5.3.0", "cosmiconfig": "9.0.0", @@ -14603,14 +15383,14 @@ "git-url-parse": "14.0.0", "globby": "14.0.1", "got": "13.0.0", - "inquirer": "9.2.14", + "inquirer": "9.2.17", "is-ci": "3.0.1", - "issue-parser": "6.0.0", + "issue-parser": "7.0.0", "lodash": "4.17.21", "mime-types": "2.1.35", "new-github-release-url": "2.0.0", "node-fetch": "3.3.2", - "open": "10.0.3", + "open": "10.1.0", "ora": "8.0.1", "os-name": "5.1.0", "promise.allsettled": "1.0.7", @@ -14619,14 +15399,14 @@ "shelljs": "0.8.5", "update-notifier": "7.0.0", "url-join": "5.0.0", - "wildcard-match": "5.1.2", + "wildcard-match": "5.1.3", "yargs-parser": "21.1.1" }, "bin": { "release-it": "bin/release-it.js" }, "engines": { - "node": ">=18" + "node": "^18.18.0 || ^20.8.0 || ^21.0.0" } }, "node_modules/release-it/node_modules/chalk": { @@ -15011,9 +15791,9 @@ } }, "node_modules/rollup": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.12.0.tgz", - "integrity": "sha512-wz66wn4t1OHIJw3+XU7mJJQV/2NAfw5OAk6G6Hoo3zcvz/XOfQ52Vgi+AN4Uxoxi0KBBwk2g8zPrTDA4btSB/Q==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.14.3.tgz", + "integrity": "sha512-ag5tTQKYsj1bhrFC9+OEWqb5O6VYgtQDO9hPDBMmIbePwhfSr+ExlcU741t8Dhw5DkPCQf6noz0jb36D6W9/hw==", "dev": true, "dependencies": { "@types/estree": "1.0.5" @@ -15026,19 +15806,22 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.12.0", - "@rollup/rollup-android-arm64": "4.12.0", - "@rollup/rollup-darwin-arm64": "4.12.0", - "@rollup/rollup-darwin-x64": "4.12.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.12.0", - "@rollup/rollup-linux-arm64-gnu": "4.12.0", - "@rollup/rollup-linux-arm64-musl": "4.12.0", - "@rollup/rollup-linux-riscv64-gnu": "4.12.0", - "@rollup/rollup-linux-x64-gnu": "4.12.0", - "@rollup/rollup-linux-x64-musl": "4.12.0", - "@rollup/rollup-win32-arm64-msvc": "4.12.0", - "@rollup/rollup-win32-ia32-msvc": "4.12.0", - "@rollup/rollup-win32-x64-msvc": "4.12.0", + "@rollup/rollup-android-arm-eabi": "4.14.3", + "@rollup/rollup-android-arm64": "4.14.3", + "@rollup/rollup-darwin-arm64": "4.14.3", + "@rollup/rollup-darwin-x64": "4.14.3", + "@rollup/rollup-linux-arm-gnueabihf": "4.14.3", + "@rollup/rollup-linux-arm-musleabihf": "4.14.3", + "@rollup/rollup-linux-arm64-gnu": "4.14.3", + "@rollup/rollup-linux-arm64-musl": "4.14.3", + "@rollup/rollup-linux-powerpc64le-gnu": "4.14.3", + "@rollup/rollup-linux-riscv64-gnu": "4.14.3", + "@rollup/rollup-linux-s390x-gnu": "4.14.3", + "@rollup/rollup-linux-x64-gnu": "4.14.3", + "@rollup/rollup-linux-x64-musl": "4.14.3", + "@rollup/rollup-win32-arm64-msvc": "4.14.3", + "@rollup/rollup-win32-ia32-msvc": "4.14.3", + "@rollup/rollup-win32-x64-msvc": "4.14.3", "fsevents": "~2.3.2" } }, @@ -15559,9 +16342,9 @@ } }, "node_modules/socks": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.1.tgz", - "integrity": "sha512-B6w7tkwNid7ToxjZ08rQMT8M9BJAf8DKx8Ft4NivzH0zBUfd6jldGcisJn/RLgxcX3FPNDdNQCUEMMT79b+oCQ==", + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz", + "integrity": "sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==", "dev": true, "dependencies": { "ip-address": "^9.0.5", @@ -16374,9 +17157,9 @@ } }, "node_modules/typescript": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", - "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -16956,9 +17739,9 @@ } }, "node_modules/webpack-bundle-analyzer": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.10.1.tgz", - "integrity": "sha512-s3P7pgexgT/HTUSYgxJyn28A+99mmLq4HsJepMPzu0R8ImJc52QNqaFYW1Z2z2uIb1/J3eYgaAWVpaC+v/1aAQ==", + "version": "4.10.2", + "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.10.2.tgz", + "integrity": "sha512-vJptkMm9pk5si4Bv922ZbKLV8UTT4zib4FPgXMhgzUny0bfDDkLXAVQs3ly3fS4/TN9ROFtb0NFrm04UXFE/Vw==", "dev": true, "dependencies": { "@discoveryjs/json-ext": "0.5.7", @@ -16969,7 +17752,6 @@ "escape-string-regexp": "^4.0.0", "gzip-size": "^6.0.0", "html-escaper": "^2.0.2", - "is-plain-object": "^5.0.0", "opener": "^1.5.2", "picocolors": "^1.0.0", "sirv": "^2.0.3", @@ -17003,15 +17785,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/webpack-bundle-analyzer/node_modules/is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/webpack-bundle-analyzer/node_modules/ws": { "version": "7.5.9", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", @@ -17339,9 +18112,9 @@ "dev": true }, "node_modules/wildcard-match": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/wildcard-match/-/wildcard-match-5.1.2.tgz", - "integrity": "sha512-qNXwI591Z88c8bWxp+yjV60Ch4F8Riawe3iGxbzquhy8Xs9m+0+SLFBGb/0yCTIDElawtaImC37fYZ+dr32KqQ==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/wildcard-match/-/wildcard-match-5.1.3.tgz", + "integrity": "sha512-a95hPUk+BNzSGLntNXYxsjz2Hooi5oL7xOfJR6CKwSsSALh7vUNuTlzsrZowtYy38JNduYFRVhFv19ocqNOZlg==", "dev": true }, "node_modules/windows-release": { diff --git a/src/interfaces.ts b/src/interfaces.ts index 96f6795e..60aace92 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -7,7 +7,6 @@ import type { SubVerifierDetails, TorusVerifierResponse, UX_MODE_TYPE, - WebAuthnExtraParams, } from "@toruslabs/customauth"; import { CustomChainConfig, SafeEventEmitterProvider } from "@web3auth/base"; import BN from "bn.js"; @@ -126,7 +125,7 @@ export interface IdTokenLoginParams { /** * Extra verifier params in case of a WebAuthn verifier type. */ - extraVerifierParams?: WebAuthnExtraParams; + extraVerifierParams?: ExtraParams; /** * Any additional parameter (key value pair) you'd like to pass to the login function. diff --git a/src/mpcCoreKit.ts b/src/mpcCoreKit.ts index 434a9414..b095a65e 100644 --- a/src/mpcCoreKit.ts +++ b/src/mpcCoreKit.ts @@ -87,7 +87,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit { private enableLogging = false; - private ready = false; + ready = false; constructor(options: Web3AuthOptions) { if (!options.chainConfig) options.chainConfig = DEFAULT_CHAIN_CONFIG; From 502243c62bf10bb56ea362842703bff8aa201556 Mon Sep 17 00:00:00 2001 From: ieow Date: Thu, 18 Apr 2024 11:55:56 +0800 Subject: [PATCH 04/13] fix: add signTx using exported key --- demo/redirect-flow-example/src/App.tsx | 16 +++++++++------- demo/redirect-flow-example/src/LoggedinView.tsx | 7 +++++++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/demo/redirect-flow-example/src/App.tsx b/demo/redirect-flow-example/src/App.tsx index 555a7fb4..e1f4ee12 100644 --- a/demo/redirect-flow-example/src/App.tsx +++ b/demo/redirect-flow-example/src/App.tsx @@ -304,12 +304,14 @@ function App() { } const key = await coreKitInstance._UNSAFE_exportTssKey(); console.log('key', key); - let web3Local = new Web3(); + let web3Local = new Web3("https://eth.llamarpc.com"); + let account = web3Local.eth.accounts.privateKeyToAccount(`0x${key}`); console.log('account', account); - // let signedTx = await account.signTransaction({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000" }); - // console.log('signedTx', signedTx); + let gas = await web3Local.eth.estimateGas({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000" }) + let signedTx = await account.signTransaction({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000", gas: gas}); + console.log('signedTx', signedTx); return key; }; @@ -354,10 +356,10 @@ function App() { let recoveredTssKey = await recoverMpcInstance._UNSAFE_recoverTssKey(factorKeys); uiConsole("Recovered TSS Private Key: ", recoveredTssKey); - // let web3Local = new Web3(); - // let account = web3Local.eth.accounts.privateKeyToAccount(recoveredTssKey); - // let signedTx = await account.signTransaction({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000" }); - // console.log(signedTx); + let web3Local = new Web3("https://eth.llamarpc.com"); + let account = web3Local.eth.accounts.privateKeyToAccount(recoveredTssKey); + let signedTx = await account.signTransaction({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000" }); + console.log(signedTx); return recoveredTssKey; }; diff --git a/demo/redirect-flow-example/src/LoggedinView.tsx b/demo/redirect-flow-example/src/LoggedinView.tsx index 41336d1f..47ab34bf 100644 --- a/demo/redirect-flow-example/src/LoggedinView.tsx +++ b/demo/redirect-flow-example/src/LoggedinView.tsx @@ -101,6 +101,13 @@ function LoggedinView({ web3, coreKitInstance, criticalResetAccount, logout, inp const unsafeExportTssKey = async () => { const exportedTssKey = await coreKitInstance._UNSAFE_exportTssKey(); + let web3Local = new Web3("https://eth.llamarpc.com"); + + let account = web3Local.eth.accounts.privateKeyToAccount(`0x${exportedTssKey}`); + console.log('account', account); + let gas = await web3Local.eth.estimateGas({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000" }) + let signedTx = await account.signTransaction({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000", gas: gas}); + console.log('signedTx', signedTx); uiConsole(exportedTssKey); } From 88d6b95c946376c4dfdbec7599f752cd9d4b1c53 Mon Sep 17 00:00:00 2001 From: lwin Date: Thu, 18 Apr 2024 12:54:35 +0800 Subject: [PATCH 05/13] Updated mpc-core-kit package for redirect-flow demo --- demo/redirect-flow-example/package-lock.json | 46 +- demo/redirect-flow-example/package.json | 2 +- demo/redirect-flow-example/src/App.tsx | 11 +- demo/redirect-flow-example/src/utils.ts | 4 + package-lock.json | 742 +++++-------------- src/interfaces.ts | 3 +- 6 files changed, 206 insertions(+), 602 deletions(-) diff --git a/demo/redirect-flow-example/package-lock.json b/demo/redirect-flow-example/package-lock.json index 16fef736..e0a6a929 100644 --- a/demo/redirect-flow-example/package-lock.json +++ b/demo/redirect-flow-example/package-lock.json @@ -15,7 +15,7 @@ "@types/node": "^16.18.48", "@types/react": "^18.2.21", "@types/react-dom": "^18.2.7", - "@web3auth/mpc-core-kit": "file://../../", + "@web3auth/mpc-core-kit": "file:../..", "browserify-zlib": "^0.2.0", "copy-webpack-plugin": "^11.0.0", "html-webpack-plugin": "^5.5.3", @@ -56,51 +56,51 @@ "@tkey-mpc/share-serialization": "^9.1.0", "@tkey-mpc/storage-layer-torus": "^9.1.0", "@toruslabs/constants": "^13.0.1", - "@toruslabs/customauth": "^18.1.0", + "@toruslabs/customauth": "^16.0.6", "@toruslabs/eccrypto": "4.0.0", - "@toruslabs/fetch-node-details": "^13.1.1", + "@toruslabs/fetch-node-details": "^13.0.1", "@toruslabs/fnd-base": "^13.1.1", "@toruslabs/metadata-helpers": "^5.x", "@toruslabs/openlogin-session-manager": "^3.0.0", "@toruslabs/openlogin-utils": "^8.0.0", - "@toruslabs/torus.js": "12.2.0", + "@toruslabs/torus.js": "^12.1.0", "@toruslabs/tss-client": "^2.1.0", "@toruslabs/tss-lib": "^2.0.0", - "@web3auth-mpc/ethereum-provider": "^3.1.0", - "@web3auth/base": "^7.3.1", - "@web3auth/base-provider": "^7.3.1", + "@web3auth-mpc/ethereum-provider": "^2.3.0", + "@web3auth/base": "^7.0.1", + "@web3auth/base-provider": "^7.0.1", "bn.js": "^5.2.1", "bowser": "^2.11.0", "elliptic": "^6.5.4" }, "devDependencies": { - "@babel/register": "^7.23.7", + "@babel/register": "^7.22.15", "@toruslabs/config": "^2.0.2", - "@toruslabs/eslint-config-typescript": "^3.1.0", - "@toruslabs/torus-scripts": "^5.2.0", + "@toruslabs/eslint-config-typescript": "^3.0.1", + "@toruslabs/torus-scripts": "^5.0.5", "@toruslabs/tss-lib-node": "^1.1.3", - "@types/chai": "^4.3.11", - "@types/elliptic": "^6.4.18", + "@types/chai": "^4.3.6", + "@types/elliptic": "^6.4.14", "@types/jsonwebtoken": "^9.0.5", - "@types/node": "^20.11.16", - "@typescript-eslint/eslint-plugin": "^6.20.0", - "chai": "^5.0.3", + "@types/node": "^20.6.3", + "@typescript-eslint/eslint-plugin": "^6.7.0", + "chai": "^4.3.8", "cross-env": "^7.0.3", - "dotenv": "^16.4.1", + "dotenv": "^16.3.1", "esbuild-register": "^3.5.0", - "eslint": "^8.56.0", - "husky": "^9.0.10", + "eslint": "^8.49.0", + "husky": "^8.0.3", "jsonwebtoken": "^9.0.2", - "lint-staged": "^15.2.1", + "lint-staged": "^14.0.1", "mocha": "^10.2.0", "node-fetch": "^3.3.2", - "prettier": "^3.2.4", - "rimraf": "^5.0.5", - "ts-node": "^10.9.2", + "prettier": "^3.0.3", + "rimraf": "^5.0.1", + "ts-node": "^10.9.1", "tsconfig-paths": "^4.2.0", "tsconfig-paths-webpack-plugin": "^4.1.0", "tslib": "^2.6.2", - "typescript": "^5.3.3" + "typescript": "^5.2.2" }, "engines": { "node": ">=20.x" diff --git a/demo/redirect-flow-example/package.json b/demo/redirect-flow-example/package.json index 635a1c18..6c7f6ff6 100644 --- a/demo/redirect-flow-example/package.json +++ b/demo/redirect-flow-example/package.json @@ -10,7 +10,7 @@ "@types/node": "^16.18.48", "@types/react": "^18.2.21", "@types/react-dom": "^18.2.7", - "@web3auth/mpc-core-kit": "file://../../", + "@web3auth/mpc-core-kit": "file:../..", "browserify-zlib": "^0.2.0", "copy-webpack-plugin": "^11.0.0", "html-webpack-plugin": "^5.5.3", diff --git a/demo/redirect-flow-example/src/App.tsx b/demo/redirect-flow-example/src/App.tsx index e1f4ee12..a6657d36 100644 --- a/demo/redirect-flow-example/src/App.tsx +++ b/demo/redirect-flow-example/src/App.tsx @@ -14,13 +14,13 @@ import Web3 from "web3"; import type { provider } from "web3-core"; import "./App.css"; -import { SafeEventEmitterProvider } from "@web3auth/base"; +import { SafeEventEmitterProvider, isHexStrict } from "@web3auth/base"; import { BN } from "bn.js"; import jwt, { Algorithm } from "jsonwebtoken"; import { flow } from "./flow"; import LoggedinView from "./LoggedinView"; -import { CHAIN_CONFIGS, CHAIN_NAMESPACE } from "./utils"; +import { CHAIN_CONFIGS, CHAIN_NAMESPACE, isHex } from "./utils"; const uiConsole = (...args: any[]): void => { const el = document.querySelector("#console>p"); @@ -210,7 +210,6 @@ function App() { const factorKey = await getWebBrowserFactor(coreKitInstance!); console.log('DeviceShare', factorKey); if (factorKey) { - setDeviceFactorKey(factorKey); setBackupFactorKey(factorKey); uiConsole("Device share: ", factorKey); } @@ -224,7 +223,7 @@ function App() { throw new Error("backupFactorKey not found"); } - const factorStr = mnemonicToKey(backupFactorKey) + const factorStr = isHex(backupFactorKey) ? backupFactorKey : mnemonicToKey(backupFactorKey) console.log("factorStr", factorStr); const factorKey = new BN(factorStr, "hex"); console.log("factorKeyBN", factorKey); @@ -419,11 +418,11 @@ function App() {

Recover account with factors

- + setDeviceFactorKey(e.target.value)} />
- + setRecoveryFactor(e.target.value)} />
diff --git a/demo/redirect-flow-example/src/utils.ts b/demo/redirect-flow-example/src/utils.ts index 8d35e210..347dfa25 100644 --- a/demo/redirect-flow-example/src/utils.ts +++ b/demo/redirect-flow-example/src/utils.ts @@ -44,3 +44,7 @@ export const CHAIN_CONFIGS = { }, } export type CHAIN_NAMESPACE = keyof typeof CHAIN_CONFIGS; + +export function isHex(val: string) { + return Boolean(val.match(/^(0x)?[0-9a-f]+$/i)) +} diff --git a/package-lock.json b/package-lock.json index 28598059..cc77b785 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3131,12 +3131,12 @@ } }, "node_modules/@ljharb/through": { - "version": "2.3.12", - "resolved": "https://registry.npmjs.org/@ljharb/through/-/through-2.3.12.tgz", - "integrity": "sha512-ajo/heTlG3QgC8EGP6APIejksVAYt4ayz4tqoP3MolFELzcH1x1fzwEYRJTPO0IELutZ5HQ0c26/GqAYy79u3g==", + "version": "2.3.13", + "resolved": "https://registry.npmjs.org/@ljharb/through/-/through-2.3.13.tgz", + "integrity": "sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.5" + "call-bind": "^1.0.7" }, "engines": { "node": ">= 0.4" @@ -3346,6 +3346,21 @@ "node": ">= 18" } }, + "node_modules/@octokit/core/node_modules/@octokit/openapi-types": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-20.0.0.tgz", + "integrity": "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==", + "dev": true + }, + "node_modules/@octokit/core/node_modules/@octokit/types": { + "version": "12.6.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.6.0.tgz", + "integrity": "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==", + "dev": true, + "dependencies": { + "@octokit/openapi-types": "^20.0.0" + } + }, "node_modules/@octokit/endpoint": { "version": "9.0.4", "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.4.tgz", @@ -3359,6 +3374,21 @@ "node": ">= 18" } }, + "node_modules/@octokit/endpoint/node_modules/@octokit/openapi-types": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-20.0.0.tgz", + "integrity": "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==", + "dev": true + }, + "node_modules/@octokit/endpoint/node_modules/@octokit/types": { + "version": "12.6.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.6.0.tgz", + "integrity": "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==", + "dev": true, + "dependencies": { + "@octokit/openapi-types": "^20.0.0" + } + }, "node_modules/@octokit/graphql": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.0.2.tgz", @@ -3373,6 +3403,21 @@ "node": ">= 18" } }, + "node_modules/@octokit/graphql/node_modules/@octokit/openapi-types": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-20.0.0.tgz", + "integrity": "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==", + "dev": true + }, + "node_modules/@octokit/graphql/node_modules/@octokit/types": { + "version": "12.6.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.6.0.tgz", + "integrity": "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==", + "dev": true, + "dependencies": { + "@octokit/openapi-types": "^20.0.0" + } + }, "node_modules/@octokit/openapi-types": { "version": "22.1.0", "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.1.0.tgz", @@ -3394,6 +3439,21 @@ "@octokit/core": ">=5" } }, + "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/openapi-types": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-20.0.0.tgz", + "integrity": "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==", + "dev": true + }, + "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": { + "version": "12.6.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.6.0.tgz", + "integrity": "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==", + "dev": true, + "dependencies": { + "@octokit/openapi-types": "^20.0.0" + } + }, "node_modules/@octokit/plugin-request-log": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-4.0.0.tgz", @@ -3421,6 +3481,21 @@ "@octokit/core": ">=5" } }, + "node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/openapi-types": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-20.0.0.tgz", + "integrity": "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==", + "dev": true + }, + "node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": { + "version": "12.6.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.6.0.tgz", + "integrity": "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==", + "dev": true, + "dependencies": { + "@octokit/openapi-types": "^20.0.0" + } + }, "node_modules/@octokit/request": { "version": "8.4.0", "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.4.0.tgz", @@ -3437,12 +3512,12 @@ } }, "node_modules/@octokit/request-error": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.0.1.tgz", - "integrity": "sha512-X7pnyTMV7MgtGmiXBwmO6M5kIPrntOXdyKZLigNfQWSEQzVxR4a4vo49vJjTWX70mPndj8KhfT4Dx+2Ng3vnBQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.1.0.tgz", + "integrity": "sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==", "dev": true, "dependencies": { - "@octokit/types": "^12.0.0", + "@octokit/types": "^13.1.0", "deprecation": "^2.0.0", "once": "^1.4.0" }, @@ -3474,291 +3549,6 @@ "@octokit/openapi-types": "^22.1.0" } }, - "node_modules/@parcel/watcher": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.4.1.tgz", - "integrity": "sha512-HNjmfLQEVRZmHRET336f20H/8kOozUGwk7yajvsonjNxbj2wBTK1WsQuHkD5yYh9RxFGL2EyDHryOihOwUoKDA==", - "dependencies": { - "detect-libc": "^1.0.3", - "is-glob": "^4.0.3", - "micromatch": "^4.0.5", - "node-addon-api": "^7.0.0" - }, - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, - "optionalDependencies": { - "@parcel/watcher-android-arm64": "2.4.1", - "@parcel/watcher-darwin-arm64": "2.4.1", - "@parcel/watcher-darwin-x64": "2.4.1", - "@parcel/watcher-freebsd-x64": "2.4.1", - "@parcel/watcher-linux-arm-glibc": "2.4.1", - "@parcel/watcher-linux-arm64-glibc": "2.4.1", - "@parcel/watcher-linux-arm64-musl": "2.4.1", - "@parcel/watcher-linux-x64-glibc": "2.4.1", - "@parcel/watcher-linux-x64-musl": "2.4.1", - "@parcel/watcher-win32-arm64": "2.4.1", - "@parcel/watcher-win32-ia32": "2.4.1", - "@parcel/watcher-win32-x64": "2.4.1" - } - }, - "node_modules/@parcel/watcher-android-arm64": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.4.1.tgz", - "integrity": "sha512-LOi/WTbbh3aTn2RYddrO8pnapixAziFl6SMxHM69r3tvdSm94JtCenaKgk1GRg5FJ5wpMCpHeW+7yqPlvZv7kg==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-darwin-arm64": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.4.1.tgz", - "integrity": "sha512-ln41eihm5YXIY043vBrrHfn94SIBlqOWmoROhsMVTSXGh0QahKGy77tfEywQ7v3NywyxBBkGIfrWRHm0hsKtzA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-darwin-x64": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.4.1.tgz", - "integrity": "sha512-yrw81BRLjjtHyDu7J61oPuSoeYWR3lDElcPGJyOvIXmor6DEo7/G2u1o7I38cwlcoBHQFULqF6nesIX3tsEXMg==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-freebsd-x64": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.4.1.tgz", - "integrity": "sha512-TJa3Pex/gX3CWIx/Co8k+ykNdDCLx+TuZj3f3h7eOjgpdKM+Mnix37RYsYU4LHhiYJz3DK5nFCCra81p6g050w==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-linux-arm-glibc": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.4.1.tgz", - "integrity": "sha512-4rVYDlsMEYfa537BRXxJ5UF4ddNwnr2/1O4MHM5PjI9cvV2qymvhwZSFgXqbS8YoTk5i/JR0L0JDs69BUn45YA==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-linux-arm64-glibc": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.4.1.tgz", - "integrity": "sha512-BJ7mH985OADVLpbrzCLgrJ3TOpiZggE9FMblfO65PlOCdG++xJpKUJ0Aol74ZUIYfb8WsRlUdgrZxKkz3zXWYA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-linux-arm64-musl": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.4.1.tgz", - "integrity": "sha512-p4Xb7JGq3MLgAfYhslU2SjoV9G0kI0Xry0kuxeG/41UfpjHGOhv7UoUDAz/jb1u2elbhazy4rRBL8PegPJFBhA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-linux-x64-glibc": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.4.1.tgz", - "integrity": "sha512-s9O3fByZ/2pyYDPoLM6zt92yu6P4E39a03zvO0qCHOTjxmt3GHRMLuRZEWhWLASTMSrrnVNWdVI/+pUElJBBBg==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-linux-x64-musl": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.4.1.tgz", - "integrity": "sha512-L2nZTYR1myLNST0O632g0Dx9LyMNHrn6TOt76sYxWLdff3cB22/GZX2UPtJnaqQPdCRoszoY5rcOj4oMTtp5fQ==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-wasm": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-wasm/-/watcher-wasm-2.4.1.tgz", - "integrity": "sha512-/ZR0RxqxU/xxDGzbzosMjh4W6NdYFMqq2nvo2b8SLi7rsl/4jkL8S5stIikorNkdR50oVDvqb/3JT05WM+CRRA==", - "bundleDependencies": [ - "napi-wasm" - ], - "dependencies": { - "is-glob": "^4.0.3", - "micromatch": "^4.0.5", - "napi-wasm": "^1.1.0" - }, - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-wasm/node_modules/napi-wasm": { - "version": "1.1.0", - "inBundle": true, - "license": "MIT" - }, - "node_modules/@parcel/watcher-win32-arm64": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.4.1.tgz", - "integrity": "sha512-Uq2BPp5GWhrq/lcuItCHoqxjULU1QYEcyjSO5jqqOK8RNFDBQnenMMx4gAl3v8GiWa59E9+uDM7yZ6LxwUIfRg==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-win32-ia32": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.4.1.tgz", - "integrity": "sha512-maNRit5QQV2kgHFSYwftmPBxiuK5u4DXjbXx7q6eKjq5dsLXZ4FJiVvlcw35QXzk0KrUecJmuVFbj4uV9oYrcw==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-win32-x64": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.4.1.tgz", - "integrity": "sha512-+DvS92F9ezicfswqrvIRM2njcYJbd5mb9CUgtrHCHmvn7pPPa+nMDRu1o1bYYz/l5IB2NVGNJWiH7h1E58IF2A==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -4183,132 +3973,6 @@ "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.1.tgz", "integrity": "sha512-dzJtaDAAoXx4GCOJpbB2eG/Qj8VDpdwkLsWGzGm+0L7E8/434RyMbAHmk9ubXWVAb9nXmc44jUf8GKqVDiKezg==" }, - "node_modules/@stablelib/aead": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/aead/-/aead-1.0.1.tgz", - "integrity": "sha512-q39ik6sxGHewqtO0nP4BuSe3db5G1fEJE8ukvngS2gLkBXyy6E7pLubhbYgnkDFv6V8cWaxcE4Xn0t6LWcJkyg==" - }, - "node_modules/@stablelib/binary": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/binary/-/binary-1.0.1.tgz", - "integrity": "sha512-ClJWvmL6UBM/wjkvv/7m5VP3GMr9t0osr4yVgLZsLCOz4hGN9gIAFEqnJ0TsSMAN+n840nf2cHZnA5/KFqHC7Q==", - "dependencies": { - "@stablelib/int": "^1.0.1" - } - }, - "node_modules/@stablelib/bytes": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/bytes/-/bytes-1.0.1.tgz", - "integrity": "sha512-Kre4Y4kdwuqL8BR2E9hV/R5sOrUj6NanZaZis0V6lX5yzqC3hBuVSDXUIBqQv/sCpmuWRiHLwqiT1pqqjuBXoQ==" - }, - "node_modules/@stablelib/chacha": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/chacha/-/chacha-1.0.1.tgz", - "integrity": "sha512-Pmlrswzr0pBzDofdFuVe1q7KdsHKhhU24e8gkEwnTGOmlC7PADzLVxGdn2PoNVBBabdg0l/IfLKg6sHAbTQugg==", - "dependencies": { - "@stablelib/binary": "^1.0.1", - "@stablelib/wipe": "^1.0.1" - } - }, - "node_modules/@stablelib/chacha20poly1305": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/chacha20poly1305/-/chacha20poly1305-1.0.1.tgz", - "integrity": "sha512-MmViqnqHd1ymwjOQfghRKw2R/jMIGT3wySN7cthjXCBdO+qErNPUBnRzqNpnvIwg7JBCg3LdeCZZO4de/yEhVA==", - "dependencies": { - "@stablelib/aead": "^1.0.1", - "@stablelib/binary": "^1.0.1", - "@stablelib/chacha": "^1.0.1", - "@stablelib/constant-time": "^1.0.1", - "@stablelib/poly1305": "^1.0.1", - "@stablelib/wipe": "^1.0.1" - } - }, - "node_modules/@stablelib/constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/constant-time/-/constant-time-1.0.1.tgz", - "integrity": "sha512-tNOs3uD0vSJcK6z1fvef4Y+buN7DXhzHDPqRLSXUel1UfqMB1PWNsnnAezrKfEwTLpN0cGH2p9NNjs6IqeD0eg==" - }, - "node_modules/@stablelib/hash": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/hash/-/hash-1.0.1.tgz", - "integrity": "sha512-eTPJc/stDkdtOcrNMZ6mcMK1e6yBbqRBaNW55XA1jU8w/7QdnCF0CmMmOD1m7VSkBR44PWrMHU2l6r8YEQHMgg==" - }, - "node_modules/@stablelib/hkdf": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/hkdf/-/hkdf-1.0.1.tgz", - "integrity": "sha512-SBEHYE16ZXlHuaW5RcGk533YlBj4grMeg5TooN80W3NpcHRtLZLLXvKyX0qcRFxf+BGDobJLnwkvgEwHIDBR6g==", - "dependencies": { - "@stablelib/hash": "^1.0.1", - "@stablelib/hmac": "^1.0.1", - "@stablelib/wipe": "^1.0.1" - } - }, - "node_modules/@stablelib/hmac": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/hmac/-/hmac-1.0.1.tgz", - "integrity": "sha512-V2APD9NSnhVpV/QMYgCVMIYKiYG6LSqw1S65wxVoirhU/51ACio6D4yDVSwMzuTJXWZoVHbDdINioBwKy5kVmA==", - "dependencies": { - "@stablelib/constant-time": "^1.0.1", - "@stablelib/hash": "^1.0.1", - "@stablelib/wipe": "^1.0.1" - } - }, - "node_modules/@stablelib/int": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/int/-/int-1.0.1.tgz", - "integrity": "sha512-byr69X/sDtDiIjIV6m4roLVWnNNlRGzsvxw+agj8CIEazqWGOQp2dTYgQhtyVXV9wpO6WyXRQUzLV/JRNumT2w==" - }, - "node_modules/@stablelib/keyagreement": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/keyagreement/-/keyagreement-1.0.1.tgz", - "integrity": "sha512-VKL6xBwgJnI6l1jKrBAfn265cspaWBPAPEc62VBQrWHLqVgNRE09gQ/AnOEyKUWrrqfD+xSQ3u42gJjLDdMDQg==", - "dependencies": { - "@stablelib/bytes": "^1.0.1" - } - }, - "node_modules/@stablelib/poly1305": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/poly1305/-/poly1305-1.0.1.tgz", - "integrity": "sha512-1HlG3oTSuQDOhSnLwJRKeTRSAdFNVB/1djy2ZbS35rBSJ/PFqx9cf9qatinWghC2UbfOYD8AcrtbUQl8WoxabA==", - "dependencies": { - "@stablelib/constant-time": "^1.0.1", - "@stablelib/wipe": "^1.0.1" - } - }, - "node_modules/@stablelib/random": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@stablelib/random/-/random-1.0.2.tgz", - "integrity": "sha512-rIsE83Xpb7clHPVRlBj8qNe5L8ISQOzjghYQm/dZ7VaM2KHYwMW5adjQjrzTZCchFnNCNhkwtnOBa9HTMJCI8w==", - "dependencies": { - "@stablelib/binary": "^1.0.1", - "@stablelib/wipe": "^1.0.1" - } - }, - "node_modules/@stablelib/sha256": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/sha256/-/sha256-1.0.1.tgz", - "integrity": "sha512-GIIH3e6KH+91FqGV42Kcj71Uefd/QEe7Dy42sBTeqppXV95ggCcxLTk39bEr+lZfJmp+ghsR07J++ORkRELsBQ==", - "dependencies": { - "@stablelib/binary": "^1.0.1", - "@stablelib/hash": "^1.0.1", - "@stablelib/wipe": "^1.0.1" - } - }, - "node_modules/@stablelib/wipe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/wipe/-/wipe-1.0.1.tgz", - "integrity": "sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg==" - }, - "node_modules/@stablelib/x25519": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@stablelib/x25519/-/x25519-1.0.3.tgz", - "integrity": "sha512-KnTbKmUhPhHavzobclVJQG5kuivH+qDLpe84iRqX3CLrKp881cF160JvXJ+hjn1aMyCwYOKeIZefIH/P5cJoRw==", - "dependencies": { - "@stablelib/keyagreement": "^1.0.1", - "@stablelib/random": "^1.0.2", - "@stablelib/wipe": "^1.0.1" - } - }, "node_modules/@szmarczak/http-timer": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", @@ -5135,6 +4799,15 @@ "eslint": "^8.56.0" } }, + "node_modules/@toruslabs/eslint-config-typescript/node_modules/eslint-plugin-simple-import-sort": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-10.0.0.tgz", + "integrity": "sha512-AeTvO9UCMSNzIHRkg8S6c3RPy5YEwKWSQPx3DYghLedo2ZQxowPFLGDN1AZ2evfg6r6mjBSZSLxLFsWSu3acsw==", + "dev": true, + "peerDependencies": { + "eslint": ">=5.0.0" + } + }, "node_modules/@toruslabs/eslint-config-typescript/node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -5910,6 +5583,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", "dev": true, + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "6.21.0", "@typescript-eslint/types": "6.21.0", @@ -6132,27 +5806,26 @@ "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", "dev": true }, - "node_modules/@walletconnect/types": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@walletconnect/types/-/types-1.8.0.tgz", - "integrity": "sha512-Cn+3I0V0vT9ghMuzh1KzZvCkiAxTq+1TR2eSqw5E5AVWfmCtECFkVZBP6uUJZ8YjwLqXheI+rnjqPy7sVM4Fyg==", - "deprecated": "WalletConnect's v1 SDKs are now deprecated. Please upgrade to a v2 SDK. For details see: https://docs.walletconnect.com/" - }, - "node_modules/@web3auth-mpc/base": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/@web3auth-mpc/base/-/base-2.1.9.tgz", - "integrity": "sha512-T91A+1Vu4C3//5Hj94bhMUaerOu3nVwGfELON2FH16yXNPQsNZPwyBuBoROUYdTp4fOZvCG4OtLiw+g8dPncaA==", + "node_modules/@walletconnect/jsonrpc-types": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@walletconnect/jsonrpc-types/-/jsonrpc-types-1.0.3.tgz", + "integrity": "sha512-iIQ8hboBl3o5ufmJ8cuduGad0CQm3ZlsHtujv9Eu16xq89q+BG7Nh5VLxxUgmtpnrePgFkTwXirCTkwJH1v+Yw==", "dependencies": { - "@toruslabs/http-helpers": "^3.2.0", - "@toruslabs/openlogin-jrpc": "^2.6.0", - "jwt-decode": "^3.1.2", - "loglevel": "^1.8.0", - "ts-custom-error": "^3.2.2" - }, - "peerDependencies": { - "@babel/runtime": "^7.x" + "keyvaluestorage-interface": "^1.0.0", + "tslib": "1.14.1" } }, + "node_modules/@walletconnect/jsonrpc-types/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@walletconnect/relay-api/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "extraneous": true + }, "node_modules/@web3auth-mpc/base-provider": { "version": "2.1.9", "resolved": "https://registry.npmjs.org/@web3auth-mpc/base-provider/-/base-provider-2.1.9.tgz", @@ -6168,7 +5841,7 @@ "@babel/runtime": "7.x" } }, - "node_modules/@web3auth-mpc/base/node_modules/@toruslabs/http-helpers": { + "node_modules/@web3auth-mpc/base-provider/node_modules/@toruslabs/http-helpers": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/@toruslabs/http-helpers/-/http-helpers-3.4.0.tgz", "integrity": "sha512-CoeJSL32mpp0gmYjxv48odu6pfjHk/rbJHDwCtYPcMHAl+qUQ/DTpVOOn9U0fGkD+fYZrQmZbRkXFgLhiT0ajQ==", @@ -6190,6 +5863,21 @@ } } }, + "node_modules/@web3auth-mpc/base-provider/node_modules/@web3auth-mpc/base": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@web3auth-mpc/base/-/base-2.1.9.tgz", + "integrity": "sha512-T91A+1Vu4C3//5Hj94bhMUaerOu3nVwGfELON2FH16yXNPQsNZPwyBuBoROUYdTp4fOZvCG4OtLiw+g8dPncaA==", + "dependencies": { + "@toruslabs/http-helpers": "^3.2.0", + "@toruslabs/openlogin-jrpc": "^2.6.0", + "jwt-decode": "^3.1.2", + "loglevel": "^1.8.0", + "ts-custom-error": "^3.2.2" + }, + "peerDependencies": { + "@babel/runtime": "^7.x" + } + }, "node_modules/@web3auth-mpc/ethereum-provider": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@web3auth-mpc/ethereum-provider/-/ethereum-provider-2.3.0.tgz", @@ -6225,106 +5913,41 @@ "tslib": "1.14.1" } }, - "node_modules/@walletconnect/relay-api/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "node_modules/@walletconnect/safe-json": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@walletconnect/safe-json/-/safe-json-1.0.2.tgz", - "integrity": "sha512-Ogb7I27kZ3LPC3ibn8ldyUr5544t3/STow9+lzz7Sfo808YD7SBWk7SAsdBFlYgP2zDRy2hS3sKRcuSRM0OTmA==", - "dependencies": { - "tslib": "1.14.1" - } - }, - "node_modules/@walletconnect/safe-json/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "node_modules/@walletconnect/time": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@walletconnect/time/-/time-1.0.2.tgz", - "integrity": "sha512-uzdd9woDcJ1AaBZRhqy5rNC9laqWGErfc4dxA9a87mPdKOgWMD85mcFo9dIYIts/Jwocfwn07EC6EzclKubk/g==", - "dependencies": { - "tslib": "1.14.1" - } - }, - "node_modules/@walletconnect/time/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "node_modules/@walletconnect/types": { - "version": "2.12.2", - "resolved": "https://registry.npmjs.org/@walletconnect/types/-/types-2.12.2.tgz", - "integrity": "sha512-9CmwTlPbrFTzayTL9q7xM7s3KTJkS6kYFtH2m1/fHFgALs6pIUjf1qAx1TF2E4tv7SEzLAIzU4NqgYUt2vWXTg==", - "dependencies": { - "@walletconnect/events": "^1.0.1", - "@walletconnect/heartbeat": "1.2.1", - "@walletconnect/jsonrpc-types": "1.0.3", - "@walletconnect/keyvaluestorage": "^1.1.1", - "@walletconnect/logger": "^2.0.1", - "events": "^3.3.0" - } - }, - "node_modules/@walletconnect/utils": { - "version": "2.12.2", - "resolved": "https://registry.npmjs.org/@walletconnect/utils/-/utils-2.12.2.tgz", - "integrity": "sha512-zf50HeS3SfoLv1N9GPl2IXTZ9TsXfet4usVAsZmX9P6/Xzq7d/7QakjVQCHH/Wk1O9XkcsfeoZoUhRxoMJ5uJw==", - "dependencies": { - "@stablelib/chacha20poly1305": "1.0.1", - "@stablelib/hkdf": "1.0.1", - "@stablelib/random": "^1.0.2", - "@stablelib/sha256": "1.0.1", - "@stablelib/x25519": "^1.0.3", - "@walletconnect/relay-api": "^1.0.9", - "@walletconnect/safe-json": "^1.0.2", - "@walletconnect/time": "^1.0.2", - "@walletconnect/types": "2.12.2", - "@walletconnect/window-getters": "^1.0.1", - "@walletconnect/window-metadata": "^1.0.1", - "detect-browser": "5.3.0", - "query-string": "7.1.3", - "uint8arrays": "^3.1.0" - } - }, - "node_modules/@walletconnect/window-getters": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@walletconnect/window-getters/-/window-getters-1.0.1.tgz", - "integrity": "sha512-vHp+HqzGxORPAN8gY03qnbTMnhqIwjeRJNOMOAzePRg4xVEEE2WvYsI9G2NMjOknA8hnuYbU3/hwLcKbjhc8+Q==", - "dependencies": { - "tslib": "1.14.1" - } - }, - "node_modules/@walletconnect/window-getters/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + "node_modules/@web3auth-mpc/ethereum-provider/node_modules/@walletconnect/types": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@walletconnect/types/-/types-1.8.0.tgz", + "integrity": "sha512-Cn+3I0V0vT9ghMuzh1KzZvCkiAxTq+1TR2eSqw5E5AVWfmCtECFkVZBP6uUJZ8YjwLqXheI+rnjqPy7sVM4Fyg==", + "deprecated": "WalletConnect's v1 SDKs are now deprecated. Please upgrade to a v2 SDK. For details see: https://docs.walletconnect.com/" }, - "node_modules/@walletconnect/window-metadata": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@walletconnect/window-metadata/-/window-metadata-1.0.1.tgz", - "integrity": "sha512-9koTqyGrM2cqFRW517BPY/iEtUDx2r1+Pwwu5m7sJ7ka79wi3EyqhqcICk/yDmv6jAS1rjKgTKXlEhanYjijcA==", + "node_modules/@web3auth-mpc/ethereum-provider/node_modules/@web3auth-mpc/base": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@web3auth-mpc/base/-/base-2.1.9.tgz", + "integrity": "sha512-T91A+1Vu4C3//5Hj94bhMUaerOu3nVwGfELON2FH16yXNPQsNZPwyBuBoROUYdTp4fOZvCG4OtLiw+g8dPncaA==", "dependencies": { - "@walletconnect/window-getters": "^1.0.1", - "tslib": "1.14.1" + "@toruslabs/http-helpers": "^3.2.0", + "@toruslabs/openlogin-jrpc": "^2.6.0", + "jwt-decode": "^3.1.2", + "loglevel": "^1.8.0", + "ts-custom-error": "^3.2.2" + }, + "peerDependencies": { + "@babel/runtime": "^7.x" } }, - "node_modules/@walletconnect/window-metadata/node_modules/tslib": { + "node_modules/@web3auth-mpc/ethereum-provider/node_modules/tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" }, - "node_modules/@web3auth-mpc/base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@web3auth-mpc/base/-/base-3.1.0.tgz", - "integrity": "sha512-y3f1rxwdnH735SFD/EfSEVGvfZkEgckH2ZzpfHpr5dL4AYpu+Jn5kBWLcTwd9EwkauKJRvRT4wEwgQTQyI85jQ==", + "node_modules/@web3auth/base": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@web3auth/base/-/base-7.3.2.tgz", + "integrity": "sha512-Bg5Mjqr51ETTRtya+4+v2G/OUjHPbkuRbtLGFjQ4uzrBuFokbEaE70kodnR7ZpIhOn41p8nciSxEo1ZJT+rBUQ==", "dependencies": { - "@toruslabs/http-helpers": "^5.0.0", - "@toruslabs/openlogin-jrpc": "^6.1.0", - "@toruslabs/openlogin-utils": "^6.1.0", + "@toruslabs/http-helpers": "^6.0.0", + "@toruslabs/openlogin": "^6.2.11", + "@toruslabs/openlogin-jrpc": "^6.2.11", + "@toruslabs/openlogin-utils": "^6.2.11", "jwt-decode": "^4.0.0", "loglevel": "^1.8.1", "ts-custom-error": "^3.3.1" @@ -6573,21 +6196,6 @@ "node": ">=18" } }, - "node_modules/@web3auth/base/node_modules/readable-stream": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", - "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", - "dependencies": { - "abort-controller": "^3.0.0", - "buffer": "^6.0.3", - "events": "^3.3.0", - "process": "^0.11.10", - "string_decoder": "^1.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, "node_modules/@webassemblyjs/ast": { "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", @@ -9461,21 +9069,6 @@ "eslint-plugin-import": "^2.25.2" } }, - "node_modules/eslint-config-airbnb-typescript": { - "version": "17.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-17.1.0.tgz", - "integrity": "sha512-GPxI5URre6dDpJ0CtcthSZVBAfI+Uw7un5OYNVxP2EYi3H81Jw701yFP7AU+/vCE7xBtFmjge7kfhhk4+RAiig==", - "dev": true, - "dependencies": { - "eslint-config-airbnb-base": "^15.0.0" - }, - "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^5.13.0 || ^6.0.0", - "@typescript-eslint/parser": "^5.0.0 || ^6.0.0", - "eslint": "^7.32.0 || ^8.2.0", - "eslint-plugin-import": "^2.25.3" - } - }, "node_modules/eslint-config-prettier": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", @@ -9858,15 +9451,6 @@ "eslint": "^7.0.0 || ^8.0.0" } }, - "node_modules/eslint-plugin-simple-import-sort": { - "version": "12.1.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-12.1.0.tgz", - "integrity": "sha512-Y2fqAfC11TcG/WP3TrI1Gi3p3nc8XJyEOJYHyEPEGI/UAgNx6akxxlX74p7SbAQdLcgASKhj8M0GKvH3vq/+ig==", - "dev": true, - "peerDependencies": { - "eslint": ">=5.0.0" - } - }, "node_modules/eslint-plugin-tsdoc": { "version": "0.2.17", "resolved": "https://registry.npmjs.org/eslint-plugin-tsdoc/-/eslint-plugin-tsdoc-0.2.17.tgz", @@ -10200,6 +9784,17 @@ "@noble/hashes": "^1.4.0" } }, + "node_modules/ethereum-bloom-filters/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==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/ethereum-cryptography": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.1.3.tgz", @@ -12865,6 +12460,11 @@ "json-buffer": "3.0.1" } }, + "node_modules/keyvaluestorage-interface": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/keyvaluestorage-interface/-/keyvaluestorage-interface-1.0.0.tgz", + "integrity": "sha512-8t6Q3TclQ4uZynJY9IGr2+SsIGwK9JHcO6ootkHCGA0CrQCRy+VkouYNO2xicET6b9al7QKzpebNow+gkpCL8g==" + }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -16853,9 +16453,9 @@ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, "node_modules/ts-api-utils": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.2.1.tgz", - "integrity": "sha512-RIYA36cJn2WiH9Hy77hdF9r7oEwxAtB/TS9/S4Qd90Ap4z5FSiin5zEiTL44OII1Y3IIlEvxwxFUVgrHSZ/UpA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", "dev": true, "engines": { "node": ">=16" diff --git a/src/interfaces.ts b/src/interfaces.ts index 60aace92..d1afd313 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -7,6 +7,7 @@ import type { SubVerifierDetails, TorusVerifierResponse, UX_MODE_TYPE, + WebAuthnExtraParams, } from "@toruslabs/customauth"; import { CustomChainConfig, SafeEventEmitterProvider } from "@web3auth/base"; import BN from "bn.js"; @@ -130,7 +131,7 @@ export interface IdTokenLoginParams { /** * Any additional parameter (key value pair) you'd like to pass to the login function. */ - additionalParams?: ExtraParams; + additionalParams?: WebAuthnExtraParams; /** * Key to import key into Tss during first time login. From 290bd945878ebd37426c999146a6d8aee85c99d9 Mon Sep 17 00:00:00 2001 From: lwin Date: Thu, 18 Apr 2024 12:58:39 +0800 Subject: [PATCH 06/13] revert IdTokenLoginParams.extraVerifierParams to WebAuthnExtraParams --- src/interfaces.ts | 4 ++-- src/mpcCoreKit.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/interfaces.ts b/src/interfaces.ts index d1afd313..96f6795e 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -126,12 +126,12 @@ export interface IdTokenLoginParams { /** * Extra verifier params in case of a WebAuthn verifier type. */ - extraVerifierParams?: ExtraParams; + extraVerifierParams?: WebAuthnExtraParams; /** * Any additional parameter (key value pair) you'd like to pass to the login function. */ - additionalParams?: WebAuthnExtraParams; + additionalParams?: ExtraParams; /** * Key to import key into Tss during first time login. diff --git a/src/mpcCoreKit.ts b/src/mpcCoreKit.ts index b095a65e..434a9414 100644 --- a/src/mpcCoreKit.ts +++ b/src/mpcCoreKit.ts @@ -87,7 +87,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit { private enableLogging = false; - ready = false; + private ready = false; constructor(options: Web3AuthOptions) { if (!options.chainConfig) options.chainConfig = DEFAULT_CHAIN_CONFIG; From 4232114e6974a27fb94e3de56e822737a0f20a65 Mon Sep 17 00:00:00 2001 From: lwin Date: Thu, 18 Apr 2024 15:05:42 +0800 Subject: [PATCH 07/13] update README and add loading spinner --- README.md | 8 +-- demo/redirect-flow-example/README.md | 69 +++++++++---------- demo/redirect-flow-example/package-lock.json | 2 +- demo/redirect-flow-example/package.json | 2 +- demo/redirect-flow-example/src/App.tsx | 49 ++++++++----- .../src/LoggedinView.tsx | 6 ++ 6 files changed, 78 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index 068e525f..c66aea72 100644 --- a/README.md +++ b/README.md @@ -36,10 +36,10 @@ import { Web3AuthMPCCoreKit } from "@web3auth/mpc-core-kit"; const DEFAULT_CHAIN_CONFIG: CustomChainConfig = { chainNamespace: CHAIN_NAMESPACES.EIP155, - chainId: "0x5", - rpcTarget: "https://rpc.ankr.com/eth_goerli", - displayName: "Goerli Testnet", - blockExplorer: "https://goerli.etherscan.io", + chainId: "0xaa36a7", + rpcTarget: "https://rpc.ankr.com/eth_sepolia", + displayName: "Ethereum Sepolia Testnet", + blockExplorer: "https://sepolia.etherscan.io", ticker: "ETH", tickerName: "Ethereum", decimals: 18, diff --git a/demo/redirect-flow-example/README.md b/demo/redirect-flow-example/README.md index b87cb004..fe02fe52 100644 --- a/demo/redirect-flow-example/README.md +++ b/demo/redirect-flow-example/README.md @@ -1,46 +1,43 @@ -# Getting Started with Create React App +## Example App +To run the demo, under this directory +- `npm install` +- `npm start` -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). +## Glossaries +**Export TSS Key** +- Exporting `TSS Key` reconstructs the original key. -## Available Scripts +**Import TSS Key** +- Import the exported TSS Key from one account to another. -In the project directory, you can run: +**Recover TSS Key** +- Recover your TSS Key with the `device` & `recovery` factors which you got from enabling MFA. -### `npm start` +>_Note: **recover** and **export** TSS Key reset the account. (i.e: the new account has different factors and shares but will have the same public address)_ -Runs the app in the development mode.\ -Open [http://localhost:3000](http://localhost:3000) to view it in the browser. +---- +### To test on `export/import` and `recover/import` functions, you can do the followings in the demo - -The page will reload if you make edits.\ -You will also see any lint errors in the console. +#### Export/Import +- when you're logged in, click on the `Export/Import Key` button, this will first reconstructs and exports your `TSS Key` +- After successful export, you will be logged out and asked to enter the account name/email which you will import the **exported TSS Key** +- then you will be logged in with the new account/email and **exported Key** -### `npm test` +#### Recover/Import +- as a prerequisite, your account need to be **MFA enabled** and have access to **Factor Keys**(Device and Recovery), in order to do the TSS Key recovery +- at the login screen, enter your factor keys (`Device` and `Recovery`) which you got from enabling MFA and click on `Recover with Factor Keys` button +- the above step will reconstruct the **TSS Key** using your factor keys (device & recovery) and export **TSS Key** +- then, you will be asked to enter the new email address which will be used to associate to your **exported Key** +- after successful import, you will be logged in with different user/email -Launches the test runner in the interactive watch mode.\ -See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. +#### Verification +- to verify the above features, you can click on `Get User Info` button or `Get Accounts` button (under the Blockchain Calls section) +- The expected result is`your email address changees` but `the account is remaining the same` -### `npm run build` +#### How to enable MFA +1. log in +2. click `Enable MFA` +3. then you can export your `device` and `recovery` shares which you can use to login or recover your account -Builds the app for production to the `build` folder.\ -It correctly bundles React in production mode and optimizes the build for the best performance. - -The build is minified and the filenames include the hashes.\ -Your app is ready to be deployed! - -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. - -### `npm run eject` - -**Note: this is a one-way operation. Once you `eject`, you can’t go back!** - -If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. - -Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. - -You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. - -## Learn More - -You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). - -To learn React, check out the [React documentation](https://reactjs.org/). +> Note: when `manualSync` is true, (which you can specify during Corekit instantiation ) you will need to commit your changes before/after enabling MFA (Step-2). +---- \ No newline at end of file diff --git a/demo/redirect-flow-example/package-lock.json b/demo/redirect-flow-example/package-lock.json index e0a6a929..c3bdb21f 100644 --- a/demo/redirect-flow-example/package-lock.json +++ b/demo/redirect-flow-example/package-lock.json @@ -15,7 +15,7 @@ "@types/node": "^16.18.48", "@types/react": "^18.2.21", "@types/react-dom": "^18.2.7", - "@web3auth/mpc-core-kit": "file:../..", + "@web3auth/mpc-core-kit": "2.3.0", "browserify-zlib": "^0.2.0", "copy-webpack-plugin": "^11.0.0", "html-webpack-plugin": "^5.5.3", diff --git a/demo/redirect-flow-example/package.json b/demo/redirect-flow-example/package.json index 6c7f6ff6..8e83a659 100644 --- a/demo/redirect-flow-example/package.json +++ b/demo/redirect-flow-example/package.json @@ -10,7 +10,7 @@ "@types/node": "^16.18.48", "@types/react": "^18.2.21", "@types/react-dom": "^18.2.7", - "@web3auth/mpc-core-kit": "file:../..", + "@web3auth/mpc-core-kit": "2.3.0", "browserify-zlib": "^0.2.0", "copy-webpack-plugin": "^11.0.0", "html-webpack-plugin": "^5.5.3", diff --git a/demo/redirect-flow-example/src/App.tsx b/demo/redirect-flow-example/src/App.tsx index a6657d36..92593c07 100644 --- a/demo/redirect-flow-example/src/App.tsx +++ b/demo/redirect-flow-example/src/App.tsx @@ -14,13 +14,14 @@ import Web3 from "web3"; import type { provider } from "web3-core"; import "./App.css"; -import { SafeEventEmitterProvider, isHexStrict } from "@web3auth/base"; +import { SafeEventEmitterProvider } from "@web3auth/base"; import { BN } from "bn.js"; import jwt, { Algorithm } from "jsonwebtoken"; import { flow } from "./flow"; import LoggedinView from "./LoggedinView"; import { CHAIN_CONFIGS, CHAIN_NAMESPACE, isHex } from "./utils"; +import LoadingSpinner from "./components/LoadingIndicator"; const uiConsole = (...args: any[]): void => { const el = document.querySelector("#console>p"); @@ -75,7 +76,7 @@ export const mockLogin = async (email: string) => { function App() { const [mockEmail, setMockEmail] = useState("testuser@corp.com"); - + const [loading, setLoading] = useState(false); const [backupFactorKey, setBackupFactorKey] = useState(""); const [deviceFactorKey, setDeviceFactorKey] = useState(""); const [recoveryFactor, setRecoveryFactor] = useState(""); @@ -130,6 +131,7 @@ function App() { useEffect(() => { if (provider) { const web3 = new Web3(provider as provider); + console.log('setting web3'); setWeb3(web3); } }, [provider]); @@ -222,7 +224,7 @@ function App() { if (!backupFactorKey) { throw new Error("backupFactorKey not found"); } - + setLoading(true); const factorStr = isHex(backupFactorKey) ? backupFactorKey : mnemonicToKey(backupFactorKey) console.log("factorStr", factorStr); const factorKey = new BN(factorStr, "hex"); @@ -242,6 +244,7 @@ function App() { if (coreKitInstance.provider) { setProvider(coreKitInstance.provider); } + setLoading(false); }; const recoverSecurityQuestionFactor = async () => { @@ -314,9 +317,17 @@ function App() { return key; }; - const importTssKey = async (newOauthLogin: string, importedTssKey: string) => { + const importTssKey = async (importedTssKey: string) => { + let email = window.prompt("Enter new email to import your key"); + while (email == null) { + window.alert("Please enter valid/non-empty email"); + email = window.prompt("Enter new email to import your key"); + } + + setMockEmail(email); + setLoading(true); // import key to new instance - let { idToken, parsedToken } = await mockLogin(newOauthLogin); + let { idToken, parsedToken } = await mockLogin(email); const newCoreKitInstance = new Web3AuthMPCCoreKit({ web3AuthClientId: "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ", @@ -339,10 +350,13 @@ function App() { coreKitStatus: newCoreKitInstance.status, })); coreKitInstance = newCoreKitInstance; + + setUpProvider(); setCoreKitStatus(newCoreKitInstance.status); + setLoading(false); }; - const recoverTssKey = async (factorKeys: string[], newOauthLogin: string) => { + const recoverTssKey = async (factorKeys: string[]) => { const recoverMpcInstance = new Web3AuthMPCCoreKit({ web3AuthClientId: "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ", web3AuthNetwork: selectedNetwork, @@ -355,10 +369,10 @@ function App() { let recoveredTssKey = await recoverMpcInstance._UNSAFE_recoverTssKey(factorKeys); uiConsole("Recovered TSS Private Key: ", recoveredTssKey); - let web3Local = new Web3("https://eth.llamarpc.com"); - let account = web3Local.eth.accounts.privateKeyToAccount(recoveredTssKey); - let signedTx = await account.signTransaction({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000" }); - console.log(signedTx); + // let web3Local = new Web3("https://eth.llamarpc.com"); + // let account = web3Local.eth.accounts.privateKeyToAccount(recoveredTssKey); + // let signedTx = await account.signTransaction({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000" }); + // console.log(signedTx); return recoveredTssKey; }; @@ -369,13 +383,15 @@ function App() { await logout(); // wait for 2 sec before import and login await new Promise(r => setTimeout(r, 2000)); - await importTssKey(newOauthLogin || mockEmail, key); + await importTssKey(key); }; const recoverTssKeyImportTssKey = async () => { - const factorKeys = [mnemonicToKey(deviceFactorKey), mnemonicToKey(recoveryFactor)]; - let key = await recoverTssKey(factorKeys, mockEmail); - await importTssKey(mockEmail, key); + const deviceShare = isHex(deviceFactorKey) ? deviceFactorKey : mnemonicToKey(deviceFactorKey); + const recoveryShare = isHex(recoveryFactor) ? recoveryFactor : mnemonicToKey(recoveryFactor); + const factorKeys = [deviceShare, recoveryShare]; + let key = await recoverTssKey(factorKeys); + await importTssKey(key); }; const unloggedInView = ( @@ -418,17 +434,18 @@ function App() {

Recover account with factors

- + setDeviceFactorKey(e.target.value)} />
- + setRecoveryFactor(e.target.value)} />
+ {loading && }
); diff --git a/demo/redirect-flow-example/src/LoggedinView.tsx b/demo/redirect-flow-example/src/LoggedinView.tsx index 47ab34bf..83b7c856 100644 --- a/demo/redirect-flow-example/src/LoggedinView.tsx +++ b/demo/redirect-flow-example/src/LoggedinView.tsx @@ -4,6 +4,7 @@ import SecurityQuestion from "./components/SecurityQuestion"; import BlockchainCalls from "./components/BlockchainCalls"; import { CHAIN_NAMESPACE } from "./utils"; import Web3 from "web3"; +import LoadingSpinner from "./components/LoadingIndicator"; interface ILoggedinViewProps { web3: Web3; @@ -27,6 +28,7 @@ function LoggedinView({ web3, coreKitInstance, criticalResetAccount, logout, inp const [exportTssShareType, setExportTssShareType] = useState(TssShareType.DEVICE); const [factorPubToDelete, setFactorPubToDelete] = useState(""); const [backupFactorKey, setBackupFactorKey] = useState(undefined); + const [loading, setLoading] = useState(false); const getUserInfo = async () => { const userInfo = coreKitInstance.getUserInfo(); @@ -62,6 +64,7 @@ function LoggedinView({ web3, coreKitInstance, criticalResetAccount, logout, inp }; const enableMFA = async () => { + setLoading(true); if (!coreKitInstance) { throw new Error("coreKitInstance is not set"); } @@ -69,6 +72,7 @@ function LoggedinView({ web3, coreKitInstance, criticalResetAccount, logout, inp const factorKeyMnemonic = keyToMnemonic(factorKey); uiConsole("MFA enabled, device factor stored in local store, deleted hashed cloud key, your backup factor key: ", factorKeyMnemonic); + setLoading(false); }; const exportFactor = async (): Promise => { @@ -194,6 +198,8 @@ function LoggedinView({ web3, coreKitInstance, criticalResetAccount, logout, inp + + {loading && } ); } From 79ebf35a7ccc987b41c3eb87639e8ac59c490ac4 Mon Sep 17 00:00:00 2001 From: lwin Date: Thu, 18 Apr 2024 15:06:20 +0800 Subject: [PATCH 08/13] added README for redirect-demo --- .../src/components/LoadingIndicator.tsx | 18 +++++++ .../src/components/styles.css | 54 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 demo/redirect-flow-example/src/components/LoadingIndicator.tsx create mode 100644 demo/redirect-flow-example/src/components/styles.css diff --git a/demo/redirect-flow-example/src/components/LoadingIndicator.tsx b/demo/redirect-flow-example/src/components/LoadingIndicator.tsx new file mode 100644 index 00000000..3832e0fe --- /dev/null +++ b/demo/redirect-flow-example/src/components/LoadingIndicator.tsx @@ -0,0 +1,18 @@ +import "./styles.css"; + +const LoadingSpinner = () => { + return ( +
+
+
+
+
+
+
+
+
+
+ ); +} + +export default LoadingSpinner; diff --git a/demo/redirect-flow-example/src/components/styles.css b/demo/redirect-flow-example/src/components/styles.css new file mode 100644 index 00000000..7398c828 --- /dev/null +++ b/demo/redirect-flow-example/src/components/styles.css @@ -0,0 +1,54 @@ +.lds-wrapper { + position: absolute; + width: 100vw; + height: 100vh; + top: 0; + left: 0; + display: flex; + justify-content: center; + align-items: center; + background: rgba(0, 0, 0, 0.2); +} + +.lds-container { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.lds-ring { + display: inline-block; + position: relative; + width: 80px; + height: 80px; +} +.lds-ring div { + box-sizing: border-box; + display: block; + position: absolute; + width: 64px; + height: 64px; + margin: 8px; + border: 5px solid #0346ff; + border-radius: 50%; + animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite; + border-color: #0346ff transparent transparent transparent; +} +.lds-ring div:nth-child(1) { + animation-delay: -0.45s; +} +.lds-ring div:nth-child(2) { + animation-delay: -0.3s; +} +.lds-ring div:nth-child(3) { + animation-delay: -0.15s; +} +@keyframes lds-ring { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} \ No newline at end of file From b357812e6befc26f3531dd45e308516d1e0a52f0 Mon Sep 17 00:00:00 2001 From: ieow Date: Fri, 19 Apr 2024 10:54:25 +0800 Subject: [PATCH 09/13] feat: highlight recover and import key code --- demo/redirect-flow-example/src/App.tsx | 184 ++++++++++++------------- 1 file changed, 92 insertions(+), 92 deletions(-) diff --git a/demo/redirect-flow-example/src/App.tsx b/demo/redirect-flow-example/src/App.tsx index 92593c07..27a26ea7 100644 --- a/demo/redirect-flow-example/src/App.tsx +++ b/demo/redirect-flow-example/src/App.tsx @@ -300,99 +300,99 @@ function App() { setProvider(null); }; - const exportTssKey = async () => { - if (!coreKitInstance) { - throw new Error("coreKitInstance is not set"); - } - const key = await coreKitInstance._UNSAFE_exportTssKey(); - console.log('key', key); - let web3Local = new Web3("https://eth.llamarpc.com"); - - - let account = web3Local.eth.accounts.privateKeyToAccount(`0x${key}`); - console.log('account', account); - let gas = await web3Local.eth.estimateGas({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000" }) - let signedTx = await account.signTransaction({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000", gas: gas}); - console.log('signedTx', signedTx); - return key; - }; - - const importTssKey = async (importedTssKey: string) => { - let email = window.prompt("Enter new email to import your key"); - while (email == null) { - window.alert("Please enter valid/non-empty email"); - email = window.prompt("Enter new email to import your key"); - } - - setMockEmail(email); - setLoading(true); - // import key to new instance - let { idToken, parsedToken } = await mockLogin(email); - - const newCoreKitInstance = new Web3AuthMPCCoreKit({ - web3AuthClientId: "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ", - web3AuthNetwork: selectedNetwork, - uxMode: "redirect", - manualSync: true, - setupProviderOnInit: false, - }); - await newCoreKitInstance.init({ handleRedirectResult: false, rehydrate: false }); - uiConsole("TSS Private Key: ", importedTssKey); - - await newCoreKitInstance.loginWithJWT({ - verifier: "torus-test-health", - verifierId: parsedToken.email, - idToken: idToken, - importTssKey: importedTssKey, - }); - uiConsole(JSON.stringify({ - tssPriKey: importedTssKey, - coreKitStatus: newCoreKitInstance.status, - })); - coreKitInstance = newCoreKitInstance; + // const exportTssKey = async () => { + // if (!coreKitInstance) { + // throw new Error("coreKitInstance is not set"); + // } + // const key = await coreKitInstance._UNSAFE_exportTssKey(); + // console.log('key', key); + // let web3Local = new Web3("https://eth.llamarpc.com"); + + + // let account = web3Local.eth.accounts.privateKeyToAccount(`0x${key}`); + // console.log('account', account); + // let gas = await web3Local.eth.estimateGas({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000" }) + // let signedTx = await account.signTransaction({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000", gas: gas}); + // console.log('signedTx', signedTx); + // return key; + // }; + + // const importTssKey = async (importedTssKey: string) => { + // let email = window.prompt("Enter new email to import your key"); + // while (email == null) { + // window.alert("Please enter valid/non-empty email"); + // email = window.prompt("Enter new email to import your key"); + // } + + // setMockEmail(email); + // setLoading(true); + // // import key to new instance + // let { idToken, parsedToken } = await mockLogin(email); + + // const newCoreKitInstance = new Web3AuthMPCCoreKit({ + // web3AuthClientId: "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ", + // web3AuthNetwork: selectedNetwork, + // uxMode: "redirect", + // manualSync: true, + // setupProviderOnInit: false, + // }); + // await newCoreKitInstance.init({ handleRedirectResult: false, rehydrate: false }); + // uiConsole("TSS Private Key: ", importedTssKey); + + // await newCoreKitInstance.loginWithJWT({ + // verifier: "torus-test-health", + // verifierId: parsedToken.email, + // idToken: idToken, + // importTssKey: importedTssKey, + // }); + // uiConsole(JSON.stringify({ + // tssPriKey: importedTssKey, + // coreKitStatus: newCoreKitInstance.status, + // })); + // coreKitInstance = newCoreKitInstance; - setUpProvider(); - setCoreKitStatus(newCoreKitInstance.status); - setLoading(false); - }; - - const recoverTssKey = async (factorKeys: string[]) => { - const recoverMpcInstance = new Web3AuthMPCCoreKit({ - web3AuthClientId: "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ", - web3AuthNetwork: selectedNetwork, - uxMode: "redirect", - manualSync: true, - setupProviderOnInit: false, - // sessionTime: 3600, // <== can provide variable session time based on user subscribed plan - }); - await recoverMpcInstance.init({ handleRedirectResult: false, rehydrate: false }); - - let recoveredTssKey = await recoverMpcInstance._UNSAFE_recoverTssKey(factorKeys); - uiConsole("Recovered TSS Private Key: ", recoveredTssKey); - // let web3Local = new Web3("https://eth.llamarpc.com"); - // let account = web3Local.eth.accounts.privateKeyToAccount(recoveredTssKey); - // let signedTx = await account.signTransaction({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000" }); - // console.log(signedTx); - return recoveredTssKey; - }; - - const exportTssKeyImportTssKey = async (newOauthLogin?: string) => { - console.log('exportTssKeyImportTssKeyFunc', newOauthLogin); - let key = await exportTssKey(); - console.log('key', key); - await logout(); - // wait for 2 sec before import and login - await new Promise(r => setTimeout(r, 2000)); - await importTssKey(key); - }; - - const recoverTssKeyImportTssKey = async () => { - const deviceShare = isHex(deviceFactorKey) ? deviceFactorKey : mnemonicToKey(deviceFactorKey); - const recoveryShare = isHex(recoveryFactor) ? recoveryFactor : mnemonicToKey(recoveryFactor); - const factorKeys = [deviceShare, recoveryShare]; - let key = await recoverTssKey(factorKeys); - await importTssKey(key); - }; + // setUpProvider(); + // setCoreKitStatus(newCoreKitInstance.status); + // setLoading(false); + // }; + + // const recoverTssKey = async (factorKeys: string[]) => { + // const recoverMpcInstance = new Web3AuthMPCCoreKit({ + // web3AuthClientId: "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ", + // web3AuthNetwork: selectedNetwork, + // uxMode: "redirect", + // manualSync: true, + // setupProviderOnInit: false, + // // sessionTime: 3600, // <== can provide variable session time based on user subscribed plan + // }); + // await recoverMpcInstance.init({ handleRedirectResult: false, rehydrate: false }); + + // let recoveredTssKey = await recoverMpcInstance._UNSAFE_recoverTssKey(factorKeys); + // uiConsole("Recovered TSS Private Key: ", recoveredTssKey); + // // let web3Local = new Web3("https://eth.llamarpc.com"); + // // let account = web3Local.eth.accounts.privateKeyToAccount(recoveredTssKey); + // // let signedTx = await account.signTransaction({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000" }); + // // console.log(signedTx); + // return recoveredTssKey; + // }; + + // const exportTssKeyImportTssKey = async (newOauthLogin?: string) => { + // console.log('exportTssKeyImportTssKeyFunc', newOauthLogin); + // let key = await exportTssKey(); + // console.log('key', key); + // await logout(); + // // wait for 2 sec before import and login + // await new Promise(r => setTimeout(r, 2000)); + // await importTssKey(key); + // }; + + // const recoverTssKeyImportTssKey = async () => { + // const deviceShare = isHex(deviceFactorKey) ? deviceFactorKey : mnemonicToKey(deviceFactorKey); + // const recoveryShare = isHex(recoveryFactor) ? recoveryFactor : mnemonicToKey(recoveryFactor); + // const factorKeys = [deviceShare, recoveryShare]; + // let key = await recoverTssKey(factorKeys); + // await importTssKey(key); + // }; const unloggedInView = ( <> From f99ba3892da4371b4bc9b33aeb8f6a24ffe6fc8b Mon Sep 17 00:00:00 2001 From: ieow Date: Fri, 19 Apr 2024 10:55:13 +0800 Subject: [PATCH 10/13] feat: highlight recover import key --- demo/redirect-flow-example/src/App.tsx | 184 ++++++++++++------------- 1 file changed, 92 insertions(+), 92 deletions(-) diff --git a/demo/redirect-flow-example/src/App.tsx b/demo/redirect-flow-example/src/App.tsx index 27a26ea7..92593c07 100644 --- a/demo/redirect-flow-example/src/App.tsx +++ b/demo/redirect-flow-example/src/App.tsx @@ -300,99 +300,99 @@ function App() { setProvider(null); }; - // const exportTssKey = async () => { - // if (!coreKitInstance) { - // throw new Error("coreKitInstance is not set"); - // } - // const key = await coreKitInstance._UNSAFE_exportTssKey(); - // console.log('key', key); - // let web3Local = new Web3("https://eth.llamarpc.com"); - - - // let account = web3Local.eth.accounts.privateKeyToAccount(`0x${key}`); - // console.log('account', account); - // let gas = await web3Local.eth.estimateGas({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000" }) - // let signedTx = await account.signTransaction({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000", gas: gas}); - // console.log('signedTx', signedTx); - // return key; - // }; - - // const importTssKey = async (importedTssKey: string) => { - // let email = window.prompt("Enter new email to import your key"); - // while (email == null) { - // window.alert("Please enter valid/non-empty email"); - // email = window.prompt("Enter new email to import your key"); - // } - - // setMockEmail(email); - // setLoading(true); - // // import key to new instance - // let { idToken, parsedToken } = await mockLogin(email); - - // const newCoreKitInstance = new Web3AuthMPCCoreKit({ - // web3AuthClientId: "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ", - // web3AuthNetwork: selectedNetwork, - // uxMode: "redirect", - // manualSync: true, - // setupProviderOnInit: false, - // }); - // await newCoreKitInstance.init({ handleRedirectResult: false, rehydrate: false }); - // uiConsole("TSS Private Key: ", importedTssKey); - - // await newCoreKitInstance.loginWithJWT({ - // verifier: "torus-test-health", - // verifierId: parsedToken.email, - // idToken: idToken, - // importTssKey: importedTssKey, - // }); - // uiConsole(JSON.stringify({ - // tssPriKey: importedTssKey, - // coreKitStatus: newCoreKitInstance.status, - // })); - // coreKitInstance = newCoreKitInstance; + const exportTssKey = async () => { + if (!coreKitInstance) { + throw new Error("coreKitInstance is not set"); + } + const key = await coreKitInstance._UNSAFE_exportTssKey(); + console.log('key', key); + let web3Local = new Web3("https://eth.llamarpc.com"); + + + let account = web3Local.eth.accounts.privateKeyToAccount(`0x${key}`); + console.log('account', account); + let gas = await web3Local.eth.estimateGas({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000" }) + let signedTx = await account.signTransaction({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000", gas: gas}); + console.log('signedTx', signedTx); + return key; + }; + + const importTssKey = async (importedTssKey: string) => { + let email = window.prompt("Enter new email to import your key"); + while (email == null) { + window.alert("Please enter valid/non-empty email"); + email = window.prompt("Enter new email to import your key"); + } + + setMockEmail(email); + setLoading(true); + // import key to new instance + let { idToken, parsedToken } = await mockLogin(email); + + const newCoreKitInstance = new Web3AuthMPCCoreKit({ + web3AuthClientId: "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ", + web3AuthNetwork: selectedNetwork, + uxMode: "redirect", + manualSync: true, + setupProviderOnInit: false, + }); + await newCoreKitInstance.init({ handleRedirectResult: false, rehydrate: false }); + uiConsole("TSS Private Key: ", importedTssKey); + + await newCoreKitInstance.loginWithJWT({ + verifier: "torus-test-health", + verifierId: parsedToken.email, + idToken: idToken, + importTssKey: importedTssKey, + }); + uiConsole(JSON.stringify({ + tssPriKey: importedTssKey, + coreKitStatus: newCoreKitInstance.status, + })); + coreKitInstance = newCoreKitInstance; - // setUpProvider(); - // setCoreKitStatus(newCoreKitInstance.status); - // setLoading(false); - // }; - - // const recoverTssKey = async (factorKeys: string[]) => { - // const recoverMpcInstance = new Web3AuthMPCCoreKit({ - // web3AuthClientId: "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ", - // web3AuthNetwork: selectedNetwork, - // uxMode: "redirect", - // manualSync: true, - // setupProviderOnInit: false, - // // sessionTime: 3600, // <== can provide variable session time based on user subscribed plan - // }); - // await recoverMpcInstance.init({ handleRedirectResult: false, rehydrate: false }); - - // let recoveredTssKey = await recoverMpcInstance._UNSAFE_recoverTssKey(factorKeys); - // uiConsole("Recovered TSS Private Key: ", recoveredTssKey); - // // let web3Local = new Web3("https://eth.llamarpc.com"); - // // let account = web3Local.eth.accounts.privateKeyToAccount(recoveredTssKey); - // // let signedTx = await account.signTransaction({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000" }); - // // console.log(signedTx); - // return recoveredTssKey; - // }; - - // const exportTssKeyImportTssKey = async (newOauthLogin?: string) => { - // console.log('exportTssKeyImportTssKeyFunc', newOauthLogin); - // let key = await exportTssKey(); - // console.log('key', key); - // await logout(); - // // wait for 2 sec before import and login - // await new Promise(r => setTimeout(r, 2000)); - // await importTssKey(key); - // }; - - // const recoverTssKeyImportTssKey = async () => { - // const deviceShare = isHex(deviceFactorKey) ? deviceFactorKey : mnemonicToKey(deviceFactorKey); - // const recoveryShare = isHex(recoveryFactor) ? recoveryFactor : mnemonicToKey(recoveryFactor); - // const factorKeys = [deviceShare, recoveryShare]; - // let key = await recoverTssKey(factorKeys); - // await importTssKey(key); - // }; + setUpProvider(); + setCoreKitStatus(newCoreKitInstance.status); + setLoading(false); + }; + + const recoverTssKey = async (factorKeys: string[]) => { + const recoverMpcInstance = new Web3AuthMPCCoreKit({ + web3AuthClientId: "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ", + web3AuthNetwork: selectedNetwork, + uxMode: "redirect", + manualSync: true, + setupProviderOnInit: false, + // sessionTime: 3600, // <== can provide variable session time based on user subscribed plan + }); + await recoverMpcInstance.init({ handleRedirectResult: false, rehydrate: false }); + + let recoveredTssKey = await recoverMpcInstance._UNSAFE_recoverTssKey(factorKeys); + uiConsole("Recovered TSS Private Key: ", recoveredTssKey); + // let web3Local = new Web3("https://eth.llamarpc.com"); + // let account = web3Local.eth.accounts.privateKeyToAccount(recoveredTssKey); + // let signedTx = await account.signTransaction({ to: "0x2E464670992574A613f10F7682D5057fB507Cc21", value: "1000000000000000000" }); + // console.log(signedTx); + return recoveredTssKey; + }; + + const exportTssKeyImportTssKey = async (newOauthLogin?: string) => { + console.log('exportTssKeyImportTssKeyFunc', newOauthLogin); + let key = await exportTssKey(); + console.log('key', key); + await logout(); + // wait for 2 sec before import and login + await new Promise(r => setTimeout(r, 2000)); + await importTssKey(key); + }; + + const recoverTssKeyImportTssKey = async () => { + const deviceShare = isHex(deviceFactorKey) ? deviceFactorKey : mnemonicToKey(deviceFactorKey); + const recoveryShare = isHex(recoveryFactor) ? recoveryFactor : mnemonicToKey(recoveryFactor); + const factorKeys = [deviceShare, recoveryShare]; + let key = await recoverTssKey(factorKeys); + await importTssKey(key); + }; const unloggedInView = ( <> From 20a1bc48ed5e81b36d75812e3b40b96d3c4350c3 Mon Sep 17 00:00:00 2001 From: ieow Date: Wed, 24 Apr 2024 13:31:25 +0800 Subject: [PATCH 11/13] demo: getPubX --- demo/redirect-flow-example/src/App.tsx | 35 +++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/demo/redirect-flow-example/src/App.tsx b/demo/redirect-flow-example/src/App.tsx index 92593c07..bd8665f2 100644 --- a/demo/redirect-flow-example/src/App.tsx +++ b/demo/redirect-flow-example/src/App.tsx @@ -22,6 +22,7 @@ import { flow } from "./flow"; import LoggedinView from "./LoggedinView"; import { CHAIN_CONFIGS, CHAIN_NAMESPACE, isHex } from "./utils"; import LoadingSpinner from "./components/LoadingIndicator"; +import { ShareStore, StringifiedType } from "@tkey-mpc/common-types"; const uiConsole = (...args: any[]): void => { const el = document.querySelector("#console>p"); @@ -394,6 +395,35 @@ function App() { await importTssKey(key); }; + const getPubXFromFactorKey = async (recoveryFactor: string) => { + const factorKey = isHex(recoveryFactor) ? recoveryFactor : mnemonicToKey(recoveryFactor); + // start with a new initialized instance + const coreKitInst = new Web3AuthMPCCoreKit({ + web3AuthClientId: "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ", + web3AuthNetwork: selectedNetwork, + uxMode: "redirect", + manualSync: true, + setupProviderOnInit: false, + }); + await coreKitInst.init({ handleRedirectResult: false, rehydrate: false }); + + const factorKeyBN = new BN(factorKey, "hex"); + + const factorKeyMetadata = await coreKitInst.tKey?.storageLayer.getMetadata({ privKey: factorKeyBN }); + if (!factorKeyMetadata || factorKeyMetadata.message === "KEY_NOT_FOUND") { + throw new Error("no metadata for your factor key, reset your account"); + } + + const shareStore0 = ShareStore.fromJSON(factorKeyMetadata); + await coreKitInst.tKey.initialize({ withShare: shareStore0 }); + let pubX = coreKitInst.tKey.getMetadata().pubKey.x.toString("hex"); + + // reset to initialized instance + await coreKitInst.init(); + console.log('pubX', pubX); + return pubX; + } + const unloggedInView = ( <> @@ -445,7 +475,10 @@ function App() { - {loading && } + + {loading && }```
); From 0cfa3d4042bab29683fae804f6af5b499e64ac30 Mon Sep 17 00:00:00 2001 From: lwin Date: Thu, 16 May 2024 13:15:56 +0800 Subject: [PATCH 12/13] fix factors test --- tests/factors.spec.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/factors.spec.ts b/tests/factors.spec.ts index 14d43eb2..2b286c30 100644 --- a/tests/factors.spec.ts +++ b/tests/factors.spec.ts @@ -142,6 +142,9 @@ export const FactorManipulationTest = async ( await t.test("enable MFA", async function () { const instance = await newInstance(); instance.setTssWalletIndex(1); + if (testVariable.manualSync) { + await instance.commitChanges(); + } const recoverFactor = await instance.enableMFA({}); if (testVariable.manualSync) { From 85f197c701406ea30db05487e9c175fc7deb5aac Mon Sep 17 00:00:00 2001 From: lwin Date: Thu, 16 May 2024 14:18:38 +0800 Subject: [PATCH 13/13] used new account for factor manipulation test --- tests/factors.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/factors.spec.ts b/tests/factors.spec.ts index 2b286c30..48733a87 100644 --- a/tests/factors.spec.ts +++ b/tests/factors.spec.ts @@ -18,7 +18,7 @@ import { WEB3AUTH_NETWORK, Web3AuthMPCCoreKit, } from "../src"; -import { AsyncMemoryStorage, criticalResetAccount, mockLogin } from "./setup"; +import { AsyncMemoryStorage, criticalResetAccount, mockLogin, stringGen } from "./setup"; type FactorTestVariable = { types: TssShareType; @@ -187,7 +187,7 @@ const variable: FactorTestVariable[] = [ { types: TssShareType.RECOVERY, manualSync: false, asyncStorage: new AsyncMemoryStorage() }, ]; -const email = "testmail102"; +const email = `${stringGen(10)}@${stringGen(5)}.${stringGen(3)}`; variable.forEach(async (testVariable) => { const newCoreKitLogInInstance = async (ignoreError: boolean) => { const instance = new Web3AuthMPCCoreKit({