diff --git a/package.json b/package.json index d8386937e..6f374e5f7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { - "name": "umami-ui", - "version": "0.1.0", + "name": "umami", + "productName": "umami", + "version": "2.0.0", "private": true, "author": "Trilitech ", "description": "Tezos Wallet", @@ -19,6 +20,7 @@ "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", + "@toruslabs/customauth": "^11.5.0", "@types/jest": "^27.5.2", "@types/node": "^16.18.14", "@types/react": "^18.0.28", @@ -100,7 +102,7 @@ "babel-plugin-named-exports-order": "^0.0.2", "concurrently": "^7.6.0", "cross-env": "^7.0.3", - "electron": "^23.1.3", + "electron": "^23.2.0", "electron-builder": "^23.6.0", "electronmon": "^2.0.2", "eslint": "^8.38.0", @@ -143,13 +145,41 @@ "buildResources": "public" }, "mac": { - "target": "dmg" + "icon": "./public/logo512.png", + "hardenedRuntime": true, + "gatekeeperAssess": false, + "target": [ + { + "target": "dmg", + "arch": [ + "arm64", + "x64" + ] + } + ] }, "win": { - "target": "nsis" + "icon": "build/logo512.png", + "target": [ + { + "target": "portable", + "arch": [ + "x64" + ] + } + ] }, "linux": { - "target": "deb" + "target": "AppImage", + "mimeTypes": [ + "x-scheme-handler/umami" + ] + }, + "protocols": { + "name": "umami", + "schemes": [ + "umami" + ] } } } diff --git a/public/electron.js b/public/electron.js index 48cf19efc..ac15c4956 100644 --- a/public/electron.js +++ b/public/electron.js @@ -1,16 +1,36 @@ // Module to control the application lifecycle and the native browser window. -const { app, BrowserWindow, protocol } = require("electron"); +const { app, BrowserWindow } = require("electron"); const path = require("path"); const url = require("url"); +// Keep a global reference of the window object, if you don't, the window will +// be closed automatically when the JavaScript object is garbage collected. +let mainWindow; +let deeplinkURL; + +// Assure single instance +if (!app.requestSingleInstanceLock()) { + app.quit(); + return; +} + +// Temporary fix broken high-dpi scale factor on Windows (125% scaling) +// info: https://github.com/electron/electron/issues/9691 +if (process.platform === "win32") { + app.commandLine.appendSwitch("high-dpi-support", "true"); + app.commandLine.appendSwitch("force-device-scale-factor", "1"); +} + // Create the native browser window. function createWindow() { - const mainWindow = new BrowserWindow({ - width: 800, - height: 600, - // Set the path of an additional "preload" script that can be used to - // communicate between node-land and browser-land. + mainWindow = new BrowserWindow({ + width: 1440, + height: 1024, + show: false, + icon: path.join(__dirname, "icon.ico"), webPreferences: { + // Set the path of an additional "preload" script that can be used to + // communicate between node-land and browser-land. preload: path.join(__dirname, "preload.js"), }, }); @@ -27,34 +47,91 @@ function createWindow() { : "http://localhost:3000"; mainWindow.loadURL(appURL); - // Automatically open Chrome's DevTools in development mode. - if (!app.isPackaged) { - mainWindow.webContents.openDevTools(); - } -} + mainWindow.once("ready-to-show", () => { + mainWindow.show(); -// Setup a local proxy to adjust the paths of requested files when loading -// them from the local production bundle (e.g.: local fonts, etc...). -function setupLocalFilesNormalizerProxy() { - protocol.registerHttpProtocol( - "file", - (request, callback) => { - const url = request.url.substr(8); - callback({ path: path.normalize(`${__dirname}/${url}`) }); - }, - (error) => { - if (error) console.error("Failed to register protocol"); + if (deeplinkURL) { + mainWindow.webContents.send("deeplinkURL", deeplinkURL); + deeplinkURL = null; + } else if (process.platform === "win32" || process.platform === "linux") { + // Protocol handler for windows & linux + const argv = process.argv; + const index = argv.findIndex((arg) => arg.startsWith("umami://")); + if (index !== -1) { + mainWindow.webContents.send("deeplinkURL", argv[index]); + } + } + }); + + mainWindow.webContents.setWindowOpenHandler((details) => { + if (details.frameName === "_blank") { + require("electron").shell.openExternal(details.url); + return { action: "deny" }; + } else { + return { action: "allow" }; } - ); + }); + + // Emitted when the window is closed. + mainWindow.on("closed", () => { + // Dereference the window object, usually you would store windows + // in an array if your app supports multi windows, this is the time + // when you should delete the corresponding element. + mainWindow = null; + }); +} + +app.commandLine.appendSwitch("disable-features", "OutOfBlinkCors"); + +if (!app.isDefaultProtocolClient("umami")) { + // Define custom protocol handler. Deep linking works on packaged versions of the application! + app.setAsDefaultProtocolClient("umami"); } +// Quit when all windows are closed. +app.on("window-all-closed", () => { + // On macOS it is common for applications and their menu bar + // to stay active until the user quits explicitly with Cmd + Q + if (process.platform !== "darwin") { + app.quit(); + } +}); + +app.on("second-instance", (event, argv, cwd) => { + if (mainWindow) { + if (mainWindow.isMinimized()) { + mainWindow.restore(); + } + mainWindow.focus(); + // Protocol handler for win32 + // argv: An array of the second instance’s (command line / deep linked) arguments + if (process.platform === "win32" || process.platform === "linux") { + // Protocol handler for windows & linux + const index = argv.findIndex((arg) => arg.startsWith("umami://")); + if (index !== -1) { + mainWindow.webContents.send("deeplinkURL", argv[index]); + } + } + } else { + createWindow(); + } +}); + +app.on("open-url", (event, url) => { + console.log("open-url", url); + if (mainWindow) { + mainWindow.webContents.send("deeplinkURL", url); + } else { + deeplinkURL = url; + createWindow(); + } +}); + // This method will be called when Electron has finished its initialization and // is ready to create the browser windows. // Some APIs can only be used after this event occurs. app.whenReady().then(() => { createWindow(); - setupLocalFilesNormalizerProxy(); - app.on("activate", function () { // On macOS it's common to re-create a window in the app when the // dock icon is clicked and there are no other windows open. @@ -63,29 +140,3 @@ app.whenReady().then(() => { } }); }); - -// Quit when all windows are closed, except on macOS. -// There, it's common for applications and their menu bar to stay active until -// the user quits explicitly with Cmd + Q. -app.on("window-all-closed", function () { - if (process.platform !== "darwin") { - app.quit(); - } -}); - -// If your app has no need to navigate or only needs to navigate to known pages, -// it is a good idea to limit navigation outright to that known scope, -// disallowing any other kinds of navigation. -const allowedNavigationDestinations = "https://my-electron-app.com"; -app.on("web-contents-created", (event, contents) => { - contents.on("will-navigate", (event, navigationUrl) => { - const parsedUrl = new URL(navigationUrl); - - if (!allowedNavigationDestinations.includes(parsedUrl.origin)) { - event.preventDefault(); - } - }); -}); - -// In this file you can include the rest of your app's specific main process -// code. You can also put them in separate files and require them here. diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index a11777cc4..000000000 Binary files a/public/favicon.ico and /dev/null differ diff --git a/public/icon.ico b/public/icon.ico new file mode 100644 index 000000000..ce2924364 Binary files /dev/null and b/public/icon.ico differ diff --git a/public/icon.png b/public/icon.png new file mode 100644 index 000000000..18410a56e Binary files /dev/null and b/public/icon.png differ diff --git a/public/index.html b/public/index.html index e0060bc85..90ddd5d2f 100644 --- a/public/index.html +++ b/public/index.html @@ -2,7 +2,7 @@ - + diff --git a/public/logo192.png b/public/logo192.png index fc44b0a37..3abb430e1 100644 Binary files a/public/logo192.png and b/public/logo192.png differ diff --git a/public/logo512.png b/public/logo512.png index a4e47a654..18410a56e 100644 Binary files a/public/logo512.png and b/public/logo512.png differ diff --git a/public/manifest.json b/public/manifest.json index 080d6c77a..f4905482f 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -1,9 +1,9 @@ { - "short_name": "React App", - "name": "Create React App Sample", + "short_name": "Umami", + "name": "Umami Wallet", "icons": [ { - "src": "favicon.ico", + "src": "icon.ico", "sizes": "64x64 32x32 24x24 16x16", "type": "image/x-icon" }, diff --git a/public/preload.js b/public/preload.js index bd020c84e..7f83c57bc 100644 --- a/public/preload.js +++ b/public/preload.js @@ -1,6 +1,6 @@ // All of the Node.js APIs are available in the preload process. // It has the same sandbox as a Chrome extension. -const { contextBridge } = require("electron"); +const { contextBridge, ipcRenderer } = require("electron"); // As an example, here we use the exposeInMainWorld API to expose the browsers // and node versions to the main window. @@ -8,3 +8,7 @@ const { contextBridge } = require("electron"); process.once("loaded", () => { contextBridge.exposeInMainWorld("versions", process.versions); }); + +contextBridge.exposeInMainWorld("electronAPI", { + onDeeplink: (callback) => ipcRenderer.on("deeplinkURL", callback), +}); diff --git a/src/GoogleAuth.tsx b/src/GoogleAuth.tsx new file mode 100644 index 000000000..306249a18 --- /dev/null +++ b/src/GoogleAuth.tsx @@ -0,0 +1,133 @@ +import { TezosNetwork } from "@airgap/tezos"; +import { Button, useToast } from "@chakra-ui/react"; +import { b58cencode, Prefix, prefix } from "@taquito/utils"; +import CustomAuth from "@toruslabs/customauth"; +import { TORUS_NETWORK_TYPE } from "@toruslabs/fetch-node-details"; +import { useEffect, useState } from "react"; +import { useSelectedNetwork } from "./utils/hooks/assetsHooks"; + +export const parseParams = (url: string) => { + const correctUrl = url.replace("umami://auth/", ""); + const params = new URLSearchParams(correctUrl); + const instanceParams = { + insanceId: params.get("instanceId"), + verifier: params.get("verifier"), + typeOfLogin: params.get("typeOfLogin"), + redirectToOpener: params.get("redirectToOpener"), + }; + + const hashParams = { + state: params.get("state"), + access_token: params.get("access_token"), + token_type: params.get("token_type"), + expires_in: params.get("expires_in"), + scope: params.get("scope"), + id_token: params.get("id_token"), + authuser: params.get("authuser"), + hd: params.get("hd"), + prompt: params.get("prompt"), + }; + + const data = { instanceParams, hashParams }; + const result = { + channel: params.get("channel"), + data: data, + error: params.get("error"), + }; + + return result; +}; + +export type GoogleAuthProps = { + buttonText?: string; + onReceiveSk: (sk: string) => void; + width?: string; + bg?: string; + isLoading?: boolean; +}; + +export const DEFAULT_BTN_TEXT = "Connect with Google"; + +const toTorusNetwork = (n: TezosNetwork): TORUS_NETWORK_TYPE => { + if (n === TezosNetwork.MAINNET) { + return "mainnet"; + } + + // Testnet not working + if (n === TezosNetwork.GHOSTNET) { + return "testnet"; + } + + const error: never = n; + throw new Error(error); +}; + +export const GoogleAuth: React.FC = ({ + buttonText = DEFAULT_BTN_TEXT, + onReceiveSk, + width, + bg, + isLoading = false, +}) => { + const [SSOisLoading, SetSSOIsLoading] = useState(false); + const toast = useToast(); + useEffect(() => { + const internalWindows = window as any; + if (internalWindows && internalWindows.electronAPI) { + internalWindows.electronAPI.onDeeplink((_: any, url: string) => { + const params = parseParams(url); + window.postMessage(params); + }); + } + }); + const umamiNetwork = useSelectedNetwork(); + const torus = new CustomAuth({ + baseUrl: "https://umamiwallet.com/auth/", + redirectPathName: "redirect.html", + redirectToOpener: true, + uxMode: "popup", + network: toTorusNetwork(umamiNetwork), + }); + + const authenticate = async () => { + SetSSOIsLoading(true); + const tmp = { + prompt: "consent", + display: "popup", + }; + await torus.init({ skipSw: true }); + + try { + const result = await torus.triggerAggregateLogin({ + verifierIdentifier: "tezos-google", + aggregateVerifierType: "single_id_verifier", + subVerifierDetailsArray: [ + { + clientId: + "1070572364808-d31nlkneam5ee6dr0tu28fjjbsdkfta5.apps.googleusercontent.com", + typeOfLogin: "google", + verifier: "umami", + jwtParams: tmp, + }, + ], + }); + + const sk = b58cencode(result.privateKey, prefix[Prefix.SPSK]); + onReceiveSk(sk); + } catch (error: any) { + toast({ title: "Torus SSO failed", description: error.message }); + } + SetSSOIsLoading(false); + }; + + return ( + + ); +}; diff --git a/src/ImportSeed.tsx b/src/ImportSeed.tsx index 4bac66c24..a87c28419 100644 --- a/src/ImportSeed.tsx +++ b/src/ImportSeed.tsx @@ -13,14 +13,17 @@ import { useToast, VStack, } from "@chakra-ui/react"; +import { InMemorySigner } from "@taquito/signer"; import { useState } from "react"; import { MakiLogo } from "./components/MakiLogo"; import { seedPhrase } from "./mocks/seedPhrase"; +import { AccountType, SocialAccount } from "./types/Account"; import { encrypt } from "./utils/aes"; import { restoreEncryptedAccounts } from "./utils/restoreAccounts"; import accountsSlice from "./utils/store/accountsSlice"; import { useAppDispatch } from "./utils/store/hooks"; import { getFingerPrint } from "./utils/tezos"; +import { GoogleAuth } from "./GoogleAuth"; type FormValues = { seedPhrase: string; @@ -215,13 +218,34 @@ export const ConfirmPassword: React.FC<{ ); }; +const AddGoogleAccount = () => { + const dispatch = useAppDispatch(); + const handleSk = async (sk: string) => { + const signer = new InMemorySigner(sk); + const account: SocialAccount = { + type: AccountType.SOCIAL, + pk: await signer.publicKey(), + pkh: await signer.publicKeyHash(), + idp: "google", + label: "Google Account", + }; + + dispatch(accountsActions.add([account])); + }; + + return ; +}; + function ImportSeed() { const [seed, setSeed] = useState(); return seed ? ( setSeed(undefined)} /> ) : ( - setSeed(s)} /> + + setSeed(s)} /> + + ); } diff --git a/src/components/sendForm/SendForm.test.tsx b/src/components/sendForm/SendForm.test.tsx index bb96e28ec..d96372bfb 100644 --- a/src/components/sendForm/SendForm.test.tsx +++ b/src/components/sendForm/SendForm.test.tsx @@ -7,6 +7,7 @@ import { waitFor, within, } from "@testing-library/react"; + import { mockAccount, mockBaker, @@ -15,6 +16,9 @@ import { } from "../../mocks/factories"; import { ReactQueryProvider } from "../../providers/ReactQueryProvider"; import { ReduxStore } from "../../providers/ReduxStore"; +import { AccountType } from "../../types/Account"; +import { decrypt } from "../../utils/aes"; +// import { decrypt } from "../../utils/aes"; import { formatPkh } from "../../utils/format"; import accountsSlice from "../../utils/store/accountsSlice"; import assetsSlice from "../../utils/store/assetsSlice"; @@ -30,13 +34,19 @@ import { SendFormMode } from "./types"; const { add } = accountsSlice.actions; +jest.mock("../../GoogleAuth", () => ({ + // eslint-disable-next-line @typescript-eslint/no-var-requires + GoogleAuth: require("../../mocks/GoogleAuthMock").GoogleAuthMock, +})); jest.mock("../../utils/tezos"); jest.mock("react-router-dom"); +jest.mock("../../utils/aes"); const estimateTezTransferMock = estimateTezTransfer as jest.Mock; const estimateFA2transferMock = estimateFA2transfer as jest.Mock; const transferTezMock = transferTez as jest.Mock; const transferFA2TokenMock = transferFA2Token as jest.Mock; +const decryptMock = decrypt as jest.Mock; const fixture = (sender?: string, assetType?: SendFormMode) => ( @@ -48,8 +58,20 @@ const fixture = (sender?: string, assetType?: SendFormMode) => ( ); +const MOCK_SK = "mockSk"; + +beforeEach(() => { + decryptMock.mockResolvedValue(MOCK_SK); +}); beforeAll(() => { - store.dispatch(add([mockAccount(1), mockAccount(2), mockAccount(3)])); + store.dispatch( + add([ + mockAccount(1), + mockAccount(2), + mockAccount(3), + mockAccount(4, AccountType.SOCIAL), + ]) + ); }); describe("", () => { @@ -134,8 +156,7 @@ describe("", () => { expect(transferTezMock).toHaveBeenCalledWith( mockPkh(7), "23", - { data: "mockData1", iv: "mockIv1", salt: "mockSalt1" }, - "mockPass", + MOCK_SK, "mainnet" ); }); @@ -221,8 +242,7 @@ describe("", () => { sender: "tz1h3rQ8wBxFd8L9B3d7Jhaawu6Z568XU3x1", tokenId: "mockId1", }, - { data: "mockData1", iv: "mockIv1", salt: "mockSalt1" }, - "mockPass", + MOCK_SK, "mainnet" ); }); @@ -249,11 +269,72 @@ describe("", () => { // So it's impossible to do a fill use case. // TODO investigate this - // test.only("User can simulate and execute delegations to bakers", async () => { + // test("User can simulate and execute delegations to bakers", async () => { // render(fixture(undefined, { type: "delegation" })); // const senderInput = screen.getByText(/select an account/i); // fireEvent.click(senderInput); // // userEvent.selectOptions(senderInput, mockAccount(1).pkh); // }); }); + describe("case send tez with Google account", () => { + const fillForm = async () => { + render(fixture(mockAccount(4, AccountType.SOCIAL).pkh)); + + const amountInput = screen.getByLabelText(/amount/i); + fireEvent.change(amountInput, { target: { value: "23" } }); + + const recipientInput = screen.getByLabelText(/to/i); + fireEvent.change(recipientInput, { target: { value: mockPkh(7) } }); + + const submitBtn = screen.getByText(/preview/i); + + await waitFor(() => { + expect(submitBtn).toBeEnabled(); + }); + + estimateTezTransferMock.mockResolvedValueOnce({ + suggestedFeeMutez: 12345, + }); + + fireEvent.click(submitBtn); + + await waitFor(() => { + const subTotal = screen.getByLabelText(/^sub-total$/i); + expect(subTotal).toHaveTextContent(/23 ꜩ/i); + + const fee = screen.getByLabelText(/^fee$/i); + expect(fee).toHaveTextContent(/0.012345 ꜩ/i); + + const total = screen.getByLabelText(/^total$/i); + expect(total).toHaveTextContent(/23.012345 ꜩ/i); + }); + }; + test("It doesn't display password in SubmitStep", async () => { + await fillForm(); + expect( + screen.getByRole("button", { name: /submit transaction/i }) + ).toBeTruthy(); + expect(screen.queryByLabelText(/password/i)).not.toBeInTheDocument(); + }); + + test("Clicking on submit transaction signs with google private key and shows operation submitted message", async () => { + await fillForm(); + + const googleSSOBtn = screen.getByText(/submit transaction/i); + + transferTezMock.mockResolvedValueOnce({ + hash: "foo", + }); + + fireEvent.click(googleSSOBtn); + + await waitFor(() => { + expect(screen.getByText(/Operation Submitted/i)).toBeTruthy(); + expect(screen.getByTestId(/tzkt-link/i)).toHaveProperty( + "href", + "https://mainnet.tzkt.io/foo" + ); + }); + }); + }); }); diff --git a/src/components/sendForm/SendForm.tsx b/src/components/sendForm/SendForm.tsx index f132185d1..f1318583f 100644 --- a/src/components/sendForm/SendForm.tsx +++ b/src/components/sendForm/SendForm.tsx @@ -2,8 +2,7 @@ import { TezosNetwork } from "@airgap/tezos"; import { useToast } from "@chakra-ui/react"; import { Estimate } from "@taquito/taquito"; import { useState } from "react"; -import { UmamiEncrypted } from "../../types/UmamiEncrypted"; -import { useAccounts } from "../../utils/hooks/accountHooks"; +import { useGetOwnedAccount } from "../../utils/hooks/accountHooks"; import { useSelectedNetwork } from "../../utils/hooks/assetsHooks"; import { estimateDelegation, @@ -53,16 +52,9 @@ const makeSimulation = ( return Promise.reject(`Unrecognized type!`); }; -export const useGetPkAndEsk = () => { - const accounts = useAccounts(); - - return (pkh: string) => { - const account = accounts.find((a) => a.pkh === pkh); - if (!account) { - throw new Error("No account found"); - } - return { esk: account.esk, pk: account.pk }; - }; +export const useGetPk = () => { + const getAccount = useGetOwnedAccount(); + return (pkh: string) => getAccount(pkh).pk; }; export const SendForm = ({ @@ -76,14 +68,13 @@ export const SendForm = ({ }) => { const network = useSelectedNetwork(); const toast = useToast(); - const getPkAndEsk = useGetPkAndEsk(); + const getPk = useGetPk(); const [isLoading, setIsLoading] = useState(false); const [transferValues, setTransferValues] = useState<{ transaction: TransactionValues; estimate: Estimate; - esk: UmamiEncrypted; }>(); const [hash, setHash] = useState(); @@ -93,16 +84,14 @@ export const SendForm = ({ try { const sender = transaction.values.sender; - const { pk, esk } = getPkAndEsk(sender); + const pk = getPk(sender); // pk needed for simulation const estimate = await makeSimulation(transaction, pk, network); - // esk needed for real transfer setTransferValues({ transaction, estimate, - esk, }); } catch (error: any) { toast({ title: "Invalid transaction", description: error.message }); diff --git a/src/components/sendForm/steps/SubmitStep.tsx b/src/components/sendForm/steps/SubmitStep.tsx index 20c4bb763..ad72fe83a 100644 --- a/src/components/sendForm/steps/SubmitStep.tsx +++ b/src/components/sendForm/steps/SubmitStep.tsx @@ -20,7 +20,10 @@ import { Estimate } from "@taquito/taquito"; import { isValid } from "date-fns"; import { useState } from "react"; import { useForm } from "react-hook-form"; -import { UmamiEncrypted } from "../../../types/UmamiEncrypted"; +import { GoogleAuth } from "../../../GoogleAuth"; +import { AccountType } from "../../../types/Account"; +import { decrypt } from "../../../utils/aes"; +import { useGetOwnedAccount } from "../../../utils/hooks/accountHooks"; import { mutezToTezNumber, prettyTezAmount, @@ -33,28 +36,15 @@ import { TransactionValues } from "../types"; const makeTransfer = ( t: TransactionValues, - esk: UmamiEncrypted, - password: string, + sk: string, network: TezosNetwork ) => { if (t.type === "delegation") { - return delegate( - t.values.sender, - t.values.recipient, - esk, - password, - network - ); + return delegate(t.values.sender, t.values.recipient, sk, network); } if (t.type === "tez") { - return transferTez( - t.values.recipient, - t.values.amount, - esk, - password, - network - ); + return transferTez(t.values.recipient, t.values.amount, sk, network); } if (t.type === "nft") { @@ -67,13 +57,13 @@ const makeTransfer = ( sender: nft.owner, tokenId: nft.tokenId, }, - esk, - password, + sk, network ); } - return Promise.reject(`Unrecognized type!`); + const error: never = t; + throw new Error(error); }; const renderSubTotal = (t: TransactionValues) => { @@ -97,28 +87,51 @@ export const RecapDisplay: React.FC<{ recap: { transaction: TransactionValues; estimate: Estimate; - esk: UmamiEncrypted; }; onSucces: (hash: string) => void; -}> = ({ - recap: { estimate, transaction: transfer, esk }, - network, - onSucces, -}) => { +}> = ({ recap: { estimate, transaction: transfer }, network, onSucces }) => { const isTez = transfer.type === "tez"; const isDelegation = transfer.type === "delegation"; const nft = transfer.type === "nft" ? transfer.data : undefined; const renderAccountTile = useRenderAccountSmallTile(); const renderBakerTile = useRenderBakerSmallTile(); + const getAccount = useGetOwnedAccount(); const { register, handleSubmit } = useForm<{ password: string }>(); const toast = useToast(); const [isLoading, setIsLoading] = useState(false); - const onSubmit = async ({ password }: { password: string }) => { + const signerAccount = getAccount(transfer.values.sender); + + const isGoogleSSO = signerAccount.type === AccountType.SOCIAL; + + const onSubmitGoogleSSO = async (sk: string) => { + if (signerAccount.type === AccountType.MNEMONIC) { + throw new Error(`Wrong signing method called`); + } + setIsLoading(true); try { - const result = await makeTransfer(transfer, esk, password, network); + const result = await makeTransfer(transfer, sk, network); + + onSucces(result.hash); + toast({ title: "Success", description: result.hash }); + } catch (error: any) { + toast({ title: "Error", description: error.message }); + } + setIsLoading(false); + }; + + // TODO remove duplication + const onSubmitNominal = async ({ password }: { password: string }) => { + if (signerAccount.type === AccountType.SOCIAL) { + throw new Error(`Wrong signing method called`); + } + + setIsLoading(true); + try { + const sk = await decrypt(signerAccount.esk, password); + const result = await makeTransfer(transfer, sk, network); onSucces(result.hash); toast({ title: "Success", description: result.hash }); @@ -133,7 +146,7 @@ export const RecapDisplay: React.FC<{ return ( -
+ Recap Transaction details @@ -185,28 +198,40 @@ export const RecapDisplay: React.FC<{ {prettyTezAmount(total, true)} - - Password - - + ) : ( + + Password + + + )} - + {isGoogleSSO ? null : ( + + )}
diff --git a/src/mocks/GoogleAuthMock.tsx b/src/mocks/GoogleAuthMock.tsx new file mode 100644 index 000000000..9180b47c8 --- /dev/null +++ b/src/mocks/GoogleAuthMock.tsx @@ -0,0 +1,20 @@ +import React from "react"; +import { GoogleAuthProps } from "../GoogleAuth"; + +export const MOCK_GOOGLE_SK = "mockGoogleSK"; + +export const GoogleAuthMock: React.FC = (props) => { + return ( + + ); +}; diff --git a/src/mocks/factories.ts b/src/mocks/factories.ts index 28f98cc89..bd791d4f6 100644 --- a/src/mocks/factories.ts +++ b/src/mocks/factories.ts @@ -1,6 +1,6 @@ import { DelegationOperation } from "@tzkt/sdk-api"; +import { Account, AccountType } from "../types/Account"; import { TransactionValues } from "../components/sendForm/types"; -import { Account } from "../types/Account"; import { NFT } from "../types/Asset"; import { Baker } from "../types/Baker"; import { TezTransfer, TokenTransfer } from "../types/Operation"; @@ -62,17 +62,36 @@ export const mockAccountLabel = (index: number) => `account ${index}`; export const mockPk = (index: number) => `edpkuwYWCugiYG7nMnVUdopFmyc3sbMSiLqsJHTQgGtVhtSdLSw6H${index}`; -export const mockAccount = (index: number): Account => { - return { - label: mockAccountLabel(index), - pkh: mockPkh(index), - pk: mockPk(index), - esk: { - data: `mockData${index}`, - iv: `mockIv${index}`, - salt: `mockSalt${index}`, - } as UmamiEncrypted, - }; +export const mockAccount = ( + index: number, + type = AccountType.MNEMONIC +): Account => { + if (type === AccountType.MNEMONIC) { + return { + type, + label: mockAccountLabel(index), + pkh: mockPkh(index), + pk: mockPk(index), + esk: { + data: `mockData${index}`, + iv: `mockIv${index}`, + salt: `mockSalt${index}`, + } as UmamiEncrypted, + }; + } + + if (type === AccountType.SOCIAL) { + return { + type: AccountType.SOCIAL, + label: "google " + mockAccountLabel(index), + pkh: mockPkh(index), + pk: mockPk(index), + idp: "google", + }; + } + + const error: never = type; + throw new Error(error); }; const mockContract = (index: number) => diff --git a/src/types/Account.ts b/src/types/Account.ts index bd57b8c80..92111fbf6 100644 --- a/src/types/Account.ts +++ b/src/types/Account.ts @@ -1,5 +1,10 @@ import { UmamiEncrypted } from "./UmamiEncrypted"; +export enum AccountType { + SOCIAL = "social", + MNEMONIC = "mnemonic", +} + type Base = { pkh: string; pk: string; @@ -9,8 +14,18 @@ export type UnencryptedAccount = Base & { sk: string; }; -export type Account = Base & { - seedFingerPrint?: string; +export type SocialAccount = Base & { label?: string; + type: AccountType.SOCIAL; + idp: "google"; +}; + +export type MnemonicAccount = Base & { + label?: string; + type: AccountType.MNEMONIC; + seedFingerPrint?: string; esk: UmamiEncrypted; }; + +// Account in store can only be Mnemonic or Social +export type Account = MnemonicAccount | SocialAccount; diff --git a/src/utils/hooks/accountHooks.ts b/src/utils/hooks/accountHooks.ts index c33920d33..ba7a1d60c 100644 --- a/src/utils/hooks/accountHooks.ts +++ b/src/utils/hooks/accountHooks.ts @@ -27,3 +27,14 @@ export const useReset = () => { dispatch(accountsSlice.actions.reset()); }; }; + +export const useGetOwnedAccount = () => { + const accounts = useAccounts(); + return (pkh: string) => { + const account = accounts.find((a) => a.pkh === pkh); + if (!account) { + throw new Error(`You do not ownn account:${pkh}`); + } + return account; + }; +}; diff --git a/src/utils/restoreAccounts.test.ts b/src/utils/restoreAccounts.test.ts index ff417d369..446a163b4 100644 --- a/src/utils/restoreAccounts.test.ts +++ b/src/utils/restoreAccounts.test.ts @@ -1,7 +1,7 @@ import { seedPhrase } from "../mocks/seedPhrase"; import { restoreAccounts, restoreEncryptedAccounts } from "./restoreAccounts"; import { addressExists, getFingerPrint } from "./tezos"; -import { Account } from "../types/Account"; +import { Account, AccountType } from "../types/Account"; // Have to use a mutation on a let variable because of jest beforeAll from setupTests.ts let realGetRandomvalues: any; @@ -76,6 +76,7 @@ describe("restoreEncryptedAccounts", () => { const result = await restoreEncryptedAccounts(seedPhrase, "password"); const expected: Account[] = [ { + type: AccountType.MNEMONIC, pk: "edpkuwYWCugiYG7nMnVUdopFmyc3sbMSiLqsJHTQgGtVhtSdLSw6HG", pkh: "tz1UNer1ijeE9ndjzSszRduR3CzX49hoBUB3", seedFingerPrint: "mockFingerPrint", @@ -87,6 +88,7 @@ describe("restoreEncryptedAccounts", () => { label: "Account 0", }, { + type: AccountType.MNEMONIC, pk: "edpkuDBhPULoNAoQbjDUo6pYdpY5o3DugXo1GAJVQGzGMGFyKUVcKN", pkh: "tz1Te4MXuNYxyyuPqmAQdnKwkD8ZgSF9M7d6", seedFingerPrint: "mockFingerPrint", @@ -98,6 +100,7 @@ describe("restoreEncryptedAccounts", () => { label: "Account 1", }, { + type: AccountType.MNEMONIC, pk: "edpktzYEtcJypEEhzZva7QPc8QcvBuKAsXSmTpR1wFPna3xWB48QDy", pkh: "tz1g7Vk9dxDALJUp4w1UTnC41ssvRa7Q4XyS", seedFingerPrint: "mockFingerPrint", diff --git a/src/utils/restoreAccounts.ts b/src/utils/restoreAccounts.ts index 3f3951d58..cd697ee2e 100644 --- a/src/utils/restoreAccounts.ts +++ b/src/utils/restoreAccounts.ts @@ -2,7 +2,7 @@ import { InMemorySigner } from "@taquito/signer"; import { b58cencode, Prefix, prefix } from "@taquito/utils"; import { mnemonicToSeed } from "bip39"; import { derivePath } from "ed25519-hd-key"; -import { Account, UnencryptedAccount } from "../types/Account"; +import { Account, AccountType, UnencryptedAccount } from "../types/Account"; import { encrypt } from "./aes"; import { addressExists, getFingerPrint } from "./tezos"; @@ -65,6 +65,7 @@ export const restoreEncryptedAccounts = async ( seedFingerPrint, esk: await encrypt(sk, password), label: `Account ${i}`, + type: AccountType.MNEMONIC, } as Account; }) ); diff --git a/src/utils/tezos.ts b/src/utils/tezos.ts index c6c71a12c..d5df761f4 100644 --- a/src/utils/tezos.ts +++ b/src/utils/tezos.ts @@ -9,8 +9,6 @@ import axios from "axios"; import { TransactionValues } from "../components/sendForm/types"; import { Baker } from "../types/Baker"; import { Token } from "../types/Token"; -import { UmamiEncrypted } from "../types/UmamiEncrypted"; -import { decrypt } from "./aes"; import { DummySigner } from "./dummySigner"; const nodeUrls = { @@ -35,13 +33,8 @@ export const addressExists = async ( return !balance.isZero(); }; -const makeToolkitWithSigner = async ( - esk: UmamiEncrypted, - password: string, - network: TezosNetwork -) => { +const makeToolkitWithSigner = async (sk: string, network: TezosNetwork) => { const Tezos = new TezosToolkit(nodeUrls[network]); - const sk = await decrypt(esk, password); Tezos.setProvider({ signer: new InMemorySigner(sk), }); @@ -181,12 +174,10 @@ export const estimateBatch = async ( export const delegate = async ( senderPkh: string, bakerPkh: string | undefined, - senderEsk: UmamiEncrypted, - password: string, + sk: string, network: TezosNetwork ) => { - const Tezos = await makeToolkitWithSigner(senderEsk, password, network); - + const Tezos = await makeToolkitWithSigner(sk, network); return Tezos.contract.setDelegate({ source: senderPkh, delegate: bakerPkh, @@ -198,12 +189,10 @@ export const delegate = async ( */ export const transferFA2Token = async ( params: FA2TokenTransferParams, - esk: UmamiEncrypted, - password: string, + sk: string, network: TezosNetwork ) => { - const Tezos = await makeToolkitWithSigner(esk, password, network); - + const Tezos = await makeToolkitWithSigner(sk, network); const contractInstance = await makeContract(params, Tezos); return contractInstance.send(); }; @@ -211,11 +200,10 @@ export const transferFA2Token = async ( export const transferTez = async ( recipient: string, amount: number, - senderEsk: UmamiEncrypted, - password: string, + sk: string, network: TezosNetwork ) => { - const Tezos = await makeToolkitWithSigner(senderEsk, password, network); + const Tezos = await makeToolkitWithSigner(sk, network); return Tezos.contract.transfer({ to: recipient, amount }); }; diff --git a/yarn.lock b/yarn.lock index 0bfaca2bf..b7a5ad02c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1724,7 +1724,7 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.1, @babel/runtime@npm:^7.12.13, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.16.3, @babel/runtime@npm:^7.17.8, @babel/runtime@npm:^7.18.3, @babel/runtime@npm:^7.20.7, @babel/runtime@npm:^7.5.0, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.6.2, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.7.6, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.9.2": +"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.1, @babel/runtime@npm:^7.12.13, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.16.3, @babel/runtime@npm:^7.17.8, @babel/runtime@npm:^7.18.3, @babel/runtime@npm:^7.20.7, @babel/runtime@npm:^7.21.0, @babel/runtime@npm:^7.5.0, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.6.2, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.7.6, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.9.2": version: 7.21.0 resolution: "@babel/runtime@npm:7.21.0" dependencies: @@ -1796,6 +1796,13 @@ __metadata: languageName: node linkType: hard +"@chaitanyapotti/register-service-worker@npm:^1.7.3": + version: 1.7.3 + resolution: "@chaitanyapotti/register-service-worker@npm:1.7.3" + checksum: 52e3a44039bccb4c033485d92234ec4895b83df2767d68ac3f995a9cd0e940dcaba83c7b1b1137d739bc15fcf1bfb4cadb1c487600369ecdb83f1c6e2b46b5a4 + languageName: node + linkType: hard + "@chakra-ui/accordion@npm:2.1.9": version: 2.1.9 resolution: "@chakra-ui/accordion@npm:2.1.9" @@ -3510,6 +3517,219 @@ __metadata: languageName: node linkType: hard +"@ethersproject/abi@npm:^5.6.3": + version: 5.7.0 + resolution: "@ethersproject/abi@npm:5.7.0" + dependencies: + "@ethersproject/address": ^5.7.0 + "@ethersproject/bignumber": ^5.7.0 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/constants": ^5.7.0 + "@ethersproject/hash": ^5.7.0 + "@ethersproject/keccak256": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + "@ethersproject/properties": ^5.7.0 + "@ethersproject/strings": ^5.7.0 + checksum: bc6962bb6cb854e4d2a4d65b2c49c716477675b131b1363312234bdbb7e19badb7d9ce66f4ca2a70ae2ea84f7123dbc4e300a1bfe5d58864a7eafabc1466627e + languageName: node + linkType: hard + +"@ethersproject/abstract-provider@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/abstract-provider@npm:5.7.0" + dependencies: + "@ethersproject/bignumber": ^5.7.0 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + "@ethersproject/networks": ^5.7.0 + "@ethersproject/properties": ^5.7.0 + "@ethersproject/transactions": ^5.7.0 + "@ethersproject/web": ^5.7.0 + checksum: 74cf4696245cf03bb7cc5b6cbf7b4b89dd9a79a1c4688126d214153a938126d4972d42c93182198653ce1de35f2a2cad68be40337d4774b3698a39b28f0228a8 + languageName: node + linkType: hard + +"@ethersproject/abstract-signer@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/abstract-signer@npm:5.7.0" + dependencies: + "@ethersproject/abstract-provider": ^5.7.0 + "@ethersproject/bignumber": ^5.7.0 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + "@ethersproject/properties": ^5.7.0 + checksum: a823dac9cfb761e009851050ebebd5b229d1b1cc4a75b125c2da130ff37e8218208f7f9d1386f77407705b889b23d4a230ad67185f8872f083143e0073cbfbe3 + languageName: node + linkType: hard + +"@ethersproject/address@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/address@npm:5.7.0" + dependencies: + "@ethersproject/bignumber": ^5.7.0 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/keccak256": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + "@ethersproject/rlp": ^5.7.0 + checksum: 64ea5ebea9cc0e845c413e6cb1e54e157dd9fc0dffb98e239d3a3efc8177f2ff798cd4e3206cf3660ee8faeb7bef1a47dc0ebef0d7b132c32e61e550c7d4c843 + languageName: node + linkType: hard + +"@ethersproject/base64@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/base64@npm:5.7.0" + dependencies: + "@ethersproject/bytes": ^5.7.0 + checksum: 7dd5d734d623582f08f665434f53685041a3d3b334a0e96c0c8afa8bbcaab934d50e5b6b980e826a8fde8d353e0b18f11e61faf17468177274b8e7c69cd9742b + languageName: node + linkType: hard + +"@ethersproject/bignumber@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/bignumber@npm:5.7.0" + dependencies: + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + bn.js: ^5.2.1 + checksum: 8c9a134b76f3feb4ec26a5a27379efb4e156b8fb2de0678a67788a91c7f4e30abe9d948638458e4b20f2e42380da0adacc7c9389d05fce070692edc6ae9b4904 + languageName: node + linkType: hard + +"@ethersproject/bytes@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/bytes@npm:5.7.0" + dependencies: + "@ethersproject/logger": ^5.7.0 + checksum: 66ad365ceaab5da1b23b72225c71dce472cf37737af5118181fa8ab7447d696bea15ca22e3a0e8836fdd8cfac161afe321a7c67d0dde96f9f645ddd759676621 + languageName: node + linkType: hard + +"@ethersproject/constants@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/constants@npm:5.7.0" + dependencies: + "@ethersproject/bignumber": ^5.7.0 + checksum: 6d4b1355747cce837b3e76ec3bde70e4732736f23b04f196f706ebfa5d4d9c2be50904a390d4d40ce77803b98d03d16a9b6898418e04ba63491933ce08c4ba8a + languageName: node + linkType: hard + +"@ethersproject/hash@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/hash@npm:5.7.0" + dependencies: + "@ethersproject/abstract-signer": ^5.7.0 + "@ethersproject/address": ^5.7.0 + "@ethersproject/base64": ^5.7.0 + "@ethersproject/bignumber": ^5.7.0 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/keccak256": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + "@ethersproject/properties": ^5.7.0 + "@ethersproject/strings": ^5.7.0 + checksum: 6e9fa8d14eb08171cd32f17f98cc108ec2aeca74a427655f0d689c550fee0b22a83b3b400fad7fb3f41cf14d4111f87f170aa7905bcbcd1173a55f21b06262ef + languageName: node + linkType: hard + +"@ethersproject/keccak256@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/keccak256@npm:5.7.0" + dependencies: + "@ethersproject/bytes": ^5.7.0 + js-sha3: 0.8.0 + checksum: ff70950d82203aab29ccda2553422cbac2e7a0c15c986bd20a69b13606ed8bb6e4fdd7b67b8d3b27d4f841e8222cbaccd33ed34be29f866fec7308f96ed244c6 + languageName: node + linkType: hard + +"@ethersproject/logger@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/logger@npm:5.7.0" + checksum: 075ab2f605f1fd0813f2e39c3308f77b44a67732b36e712d9bc085f22a84aac4da4f71b39bee50fe78da3e1c812673fadc41180c9970fe5e486e91ea17befe0d + languageName: node + linkType: hard + +"@ethersproject/networks@npm:^5.7.0": + version: 5.7.1 + resolution: "@ethersproject/networks@npm:5.7.1" + dependencies: + "@ethersproject/logger": ^5.7.0 + checksum: 0339f312304c17d9a0adce550edb825d4d2c8c9468c1634c44172c67a9ed256f594da62c4cda5c3837a0f28b7fabc03aca9b492f68ff1fdad337ee861b27bd5d + languageName: node + linkType: hard + +"@ethersproject/properties@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/properties@npm:5.7.0" + dependencies: + "@ethersproject/logger": ^5.7.0 + checksum: 6ab0ccf0c3aadc9221e0cdc5306ce6cd0df7f89f77d77bccdd1277182c9ead0202cd7521329ba3acde130820bf8af299e17cf567d0d497c736ee918207bbf59f + languageName: node + linkType: hard + +"@ethersproject/rlp@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/rlp@npm:5.7.0" + dependencies: + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + checksum: bce165b0f7e68e4d091c9d3cf47b247cac33252df77a095ca4281d32d5eeaaa3695d9bc06b2b057c5015353a68df89f13a4a54a72e888e4beeabbe56b15dda6e + languageName: node + linkType: hard + +"@ethersproject/signing-key@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/signing-key@npm:5.7.0" + dependencies: + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + "@ethersproject/properties": ^5.7.0 + bn.js: ^5.2.1 + elliptic: 6.5.4 + hash.js: 1.1.7 + checksum: 8f8de09b0aac709683bbb49339bc0a4cd2f95598f3546436c65d6f3c3a847ffa98e06d35e9ed2b17d8030bd2f02db9b7bd2e11c5cf8a71aad4537487ab4cf03a + languageName: node + linkType: hard + +"@ethersproject/strings@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/strings@npm:5.7.0" + dependencies: + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/constants": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + checksum: 5ff78693ae3fdf3cf23e1f6dc047a61e44c8197d2408c42719fef8cb7b7b3613a4eec88ac0ed1f9f5558c74fe0de7ae3195a29ca91a239c74b9f444d8e8b50df + languageName: node + linkType: hard + +"@ethersproject/transactions@npm:^5.6.2, @ethersproject/transactions@npm:^5.7.0": + version: 5.7.0 + resolution: "@ethersproject/transactions@npm:5.7.0" + dependencies: + "@ethersproject/address": ^5.7.0 + "@ethersproject/bignumber": ^5.7.0 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/constants": ^5.7.0 + "@ethersproject/keccak256": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + "@ethersproject/properties": ^5.7.0 + "@ethersproject/rlp": ^5.7.0 + "@ethersproject/signing-key": ^5.7.0 + checksum: a31b71996d2b283f68486241bff0d3ea3f1ba0e8f1322a8fffc239ccc4f4a7eb2ea9994b8fd2f093283fd75f87bae68171e01b6265261f821369aca319884a79 + languageName: node + linkType: hard + +"@ethersproject/web@npm:^5.7.0": + version: 5.7.1 + resolution: "@ethersproject/web@npm:5.7.1" + dependencies: + "@ethersproject/base64": ^5.7.0 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/logger": ^5.7.0 + "@ethersproject/properties": ^5.7.0 + "@ethersproject/strings": ^5.7.0 + checksum: 7028c47103f82fd2e2c197ce0eecfacaa9180ffeec7de7845b1f4f9b19d84081b7a48227aaddde05a4aaa526af574a9a0ce01cc0fc75e3e371f84b38b5b16b2b + languageName: node + linkType: hard + "@exodus/schemasafe@npm:^1.0.0-rc.2": version: 1.0.0 resolution: "@exodus/schemasafe@npm:1.0.0" @@ -4434,6 +4654,13 @@ __metadata: languageName: node linkType: hard +"@socket.io/component-emitter@npm:~3.1.0": + version: 3.1.0 + resolution: "@socket.io/component-emitter@npm:3.1.0" + checksum: db069d95425b419de1514dffe945cc439795f6a8ef5b9465715acf5b8b50798e2c91b8719cbf5434b3fe7de179d6cdcd503c277b7871cb3dd03febb69bdd50fa + languageName: node + linkType: hard + "@stablelib/binary@npm:^1.0.1": version: 1.0.1 resolution: "@stablelib/binary@npm:1.0.1" @@ -6287,6 +6514,120 @@ __metadata: languageName: node linkType: hard +"@toruslabs/broadcast-channel@npm:^6.2.0": + version: 6.2.0 + resolution: "@toruslabs/broadcast-channel@npm:6.2.0" + dependencies: + "@babel/runtime": ^7.21.0 + "@toruslabs/eccrypto": ^2.0.0 + "@toruslabs/metadata-helpers": ^3.1.0 + bowser: ^2.11.0 + keccak: ^3.0.3 + loglevel: ^1.8.1 + oblivious-set: 1.1.1 + socket.io-client: ^4.6.1 + unload: ^2.4.1 + checksum: 426c6ad5de6477ce75c9b8965b489c9eec9694cc3caaed73bc647050c4dd750c651eb93a640c60fc36517745fa3206f413dfae03bd14391cec7c505b8ce2be04 + languageName: node + linkType: hard + +"@toruslabs/customauth@npm:^11.5.0": + version: 11.5.0 + resolution: "@toruslabs/customauth@npm:11.5.0" + dependencies: + "@chaitanyapotti/register-service-worker": ^1.7.3 + "@toruslabs/broadcast-channel": ^6.2.0 + "@toruslabs/eccrypto": ^2.0.0 + "@toruslabs/fetch-node-details": ^8.1.1 + "@toruslabs/http-helpers": ^3.3.0 + "@toruslabs/metadata-helpers": ^3.1.0 + "@toruslabs/torus.js": ^6.4.0 + bowser: ^2.11.0 + events: ^3.3.0 + jwt-decode: ^3.1.2 + lodash.merge: ^4.6.2 + loglevel: ^1.8.1 + web3-utils: ^1.8.2 + peerDependencies: + "@babel/runtime": ^7.x + "@sentry/types": ^7.x + peerDependenciesMeta: + "@sentry/types": + optional: true + checksum: e6a589c743aeb0e1df664bdc8231cc9afe81318b773fbe9b4b06573a2ea69a6ce154a33de9ae1603b03653de265f25404194cbb70222d8c314e2e8abce9084b8 + languageName: node + linkType: hard + +"@toruslabs/eccrypto@npm:^2.0.0": + version: 2.1.1 + resolution: "@toruslabs/eccrypto@npm:2.1.1" + dependencies: + elliptic: ^6.5.4 + checksum: 30aa2dd491d0e631e6fd58918c55ff85b832a262645abe9d8029cfe45d7b9136b2158af3084fafedd1368e81ddaa3467954bc66b0b0b092f38728db05fe50966 + languageName: node + linkType: hard + +"@toruslabs/fetch-node-details@npm:^8.1.1": + version: 8.1.1 + resolution: "@toruslabs/fetch-node-details@npm:8.1.1" + dependencies: + web3-eth-contract: ^1.8.2 + web3-utils: ^1.8.2 + peerDependencies: + "@babel/runtime": 7.x + checksum: da523bdf45707f33ffd4c144762f871b52f7961c0ae2012a342ce60b31d3034f2caa965bcc69052f617cbc4672688810ab772b245aaca0be895ab00fa825303d + languageName: node + linkType: hard + +"@toruslabs/http-helpers@npm:^3.3.0": + version: 3.3.0 + resolution: "@toruslabs/http-helpers@npm:3.3.0" + dependencies: + lodash.merge: ^4.6.2 + loglevel: ^1.8.1 + peerDependencies: + "@babel/runtime": ^7.x + "@sentry/types": ^7.x + peerDependenciesMeta: + "@sentry/types": + optional: true + checksum: 47a63028f61fc73e8b8badd78a55df7c92fa62a5bddda75f410a3bd91bbd4f4567468691a64277b2a30b3def5e7636ebc142f64524fe15a6963632a0f298f8dd + languageName: node + linkType: hard + +"@toruslabs/metadata-helpers@npm:^3.1.0": + version: 3.1.0 + resolution: "@toruslabs/metadata-helpers@npm:3.1.0" + dependencies: + "@toruslabs/eccrypto": ^2.0.0 + "@toruslabs/http-helpers": ^3.3.0 + elliptic: ^6.5.4 + json-stable-stringify: ^1.0.2 + keccak: ^3.0.3 + peerDependencies: + "@babel/runtime": 7.x + checksum: 905449d1405757c647d4df9bc5bccc6e2875fc12d7fd1c7872fc8f16895a6c5f2205e92a67e292cd13b379280724b1bb5fc974fcf75bb5872144ca8832ed3170 + languageName: node + linkType: hard + +"@toruslabs/torus.js@npm:^6.4.0": + version: 6.4.0 + resolution: "@toruslabs/torus.js@npm:6.4.0" + dependencies: + "@toruslabs/eccrypto": ^2.0.0 + "@toruslabs/http-helpers": ^3.3.0 + bn.js: ^5.2.1 + elliptic: ^6.5.4 + json-stable-stringify: ^1.0.2 + keccak: ^3.0.3 + loglevel: ^1.8.1 + web3-utils: ^1.8.2 + peerDependencies: + "@babel/runtime": 7.x + checksum: 8acfde99c10b76ed29b96b70a2400b72d55f412dbe107389876bd979a3f8e158afa3c1f38847fffe4b22fb7b8a7685a48a5b7d5c3a184aec561ba37fff9787fa + languageName: node + linkType: hard + "@trysound/sax@npm:0.2.0": version: 0.2.0 resolution: "@trysound/sax@npm:0.2.0" @@ -6349,7 +6690,7 @@ __metadata: languageName: node linkType: hard -"@types/bn.js@npm:^5.1.1": +"@types/bn.js@npm:^5.1.0, @types/bn.js@npm:^5.1.1": version: 5.1.1 resolution: "@types/bn.js@npm:5.1.1" dependencies: @@ -6722,6 +7063,13 @@ __metadata: languageName: node linkType: hard +"@types/node@npm:^12.12.6": + version: 12.20.55 + resolution: "@types/node@npm:12.20.55" + checksum: e4f86785f4092706e0d3b0edff8dca5a13b45627e4b36700acd8dfe6ad53db71928c8dee914d4276c7fd3b6ccd829aa919811c9eb708a2c8e4c6eb3701178c37 + languageName: node + linkType: hard + "@types/node@npm:^14.0.10 || ^16.0.0, @types/node@npm:^14.14.20 || ^16.0.0, @types/node@npm:^16.11.26, @types/node@npm:^16.18.14": version: 16.18.18 resolution: "@types/node@npm:16.18.18" @@ -6757,6 +7105,15 @@ __metadata: languageName: node linkType: hard +"@types/pbkdf2@npm:^3.0.0": + version: 3.1.0 + resolution: "@types/pbkdf2@npm:3.1.0" + dependencies: + "@types/node": "*" + checksum: d15024b1957c21cf3b8887329d9bd8dfde754cf13a09d76ae25f1391cfc62bb8b8d7b760773c5dbaa748172fba8b3e0c3dbe962af6ccbd69b76df12a48dfba40 + languageName: node + linkType: hard + "@types/plist@npm:^3.0.1": version: 3.0.2 resolution: "@types/plist@npm:3.0.2" @@ -6861,6 +7218,15 @@ __metadata: languageName: node linkType: hard +"@types/secp256k1@npm:^4.0.1": + version: 4.0.3 + resolution: "@types/secp256k1@npm:4.0.3" + dependencies: + "@types/node": "*" + checksum: 1bd10b9afa724084b655dc81b7b315def3d2d0e272014ef16009fa76e17537411c07c0695fdea412bc7b36d2a02687f5fea33522d55b8ef29eda42992f812913 + languageName: node + linkType: hard + "@types/semver@npm:^7.3.12": version: 7.3.13 resolution: "@types/semver@npm:7.3.13" @@ -7604,6 +7970,13 @@ __metadata: languageName: node linkType: hard +"abortcontroller-polyfill@npm:^1.7.3": + version: 1.7.5 + resolution: "abortcontroller-polyfill@npm:1.7.5" + checksum: daf4169f4228ae0e4f4dbcfa782e501b923667f2666b7c55bd3b7664e5d6b100e333a93371173985fdf21f65d7dfba15bdb2e6031bdc9e57e4ce0297147da3aa + languageName: node + linkType: hard + "accepts@npm:~1.3.4, accepts@npm:~1.3.5, accepts@npm:~1.3.8": version: 1.3.8 resolution: "accepts@npm:1.3.8" @@ -8789,7 +9162,7 @@ __metadata: languageName: node linkType: hard -"bignumber.js@npm:^9.0.2, bignumber.js@npm:^9.1.0": +"bignumber.js@npm:^9.0.0, bignumber.js@npm:^9.0.2, bignumber.js@npm:^9.1.0": version: 9.1.1 resolution: "bignumber.js@npm:9.1.1" checksum: ad243b7e2f9120b112d670bb3d674128f0bd2ca1745b0a6c9df0433bd2c0252c43e6315d944c2ac07b4c639e7496b425e46842773cf89c6a2dcd4f31e5c4b11e @@ -8828,7 +9201,7 @@ __metadata: languageName: node linkType: hard -"blakejs@npm:^1.2.1": +"blakejs@npm:^1.1.0, blakejs@npm:^1.2.1": version: 1.2.1 resolution: "blakejs@npm:1.2.1" checksum: d699ba116cfa21d0b01d12014a03e484dd76d483133e6dc9eb415aa70a119f08beb3bcefb8c71840106a00b542cba77383f8be60cd1f0d4589cb8afb922eefbe @@ -8851,6 +9224,13 @@ __metadata: languageName: node linkType: hard +"bn.js@npm:4.11.6": + version: 4.11.6 + resolution: "bn.js@npm:4.11.6" + checksum: db23047bf06fdf9cf74401c8e76bca9f55313c81df382247d2c753868b368562e69171716b81b7038ada8860af18346fd4bcd1cf9d4963f923fe8e54e61cb58a + languageName: node + linkType: hard + "bn.js@npm:^4.0.0, bn.js@npm:^4.1.0, bn.js@npm:^4.11.9": version: 4.12.0 resolution: "bn.js@npm:4.12.0" @@ -8858,7 +9238,7 @@ __metadata: languageName: node linkType: hard -"bn.js@npm:^5.0.0, bn.js@npm:^5.1.1": +"bn.js@npm:^5.0.0, bn.js@npm:^5.1.1, bn.js@npm:^5.1.2, bn.js@npm:^5.2.0, bn.js@npm:^5.2.1": version: 5.2.1 resolution: "bn.js@npm:5.2.1" checksum: 3dd8c8d38055fedfa95c1d5fc3c99f8dd547b36287b37768db0abab3c239711f88ff58d18d155dd8ad902b0b0cee973747b7ae20ea12a09473272b0201c9edd3 @@ -8911,6 +9291,13 @@ __metadata: languageName: node linkType: hard +"bowser@npm:^2.11.0": + version: 2.11.0 + resolution: "bowser@npm:2.11.0" + checksum: 29c3f01f22e703fa6644fc3b684307442df4240b6e10f6cfe1b61c6ca5721073189ca97cdeedb376081148c8518e33b1d818a57f781d70b0b70e1f31fb48814f + languageName: node + linkType: hard + "boxen@npm:^5.1.2": version: 5.1.2 resolution: "boxen@npm:5.1.2" @@ -9019,7 +9406,7 @@ __metadata: languageName: node linkType: hard -"browserify-aes@npm:^1.0.0, browserify-aes@npm:^1.0.4": +"browserify-aes@npm:^1.0.0, browserify-aes@npm:^1.0.4, browserify-aes@npm:^1.2.0": version: 1.2.0 resolution: "browserify-aes@npm:1.2.0" dependencies: @@ -9218,6 +9605,16 @@ __metadata: languageName: node linkType: hard +"bufferutil@npm:^4.0.1": + version: 4.0.7 + resolution: "bufferutil@npm:4.0.7" + dependencies: + node-gyp: latest + node-gyp-build: ^4.3.0 + checksum: f75aa87e3d1b99b87a95f60a855e63f70af07b57fb8443e75a2ddfef2e47788d130fdd46e3a78fd7e0c10176082b26dfbed970c5b8632e1cc299cafa0e93ce45 + languageName: node + linkType: hard + "builder-util-runtime@npm:9.1.1": version: 9.1.1 resolution: "builder-util-runtime@npm:9.1.1" @@ -10380,7 +10777,7 @@ __metadata: languageName: node linkType: hard -"cross-fetch@npm:^3.1.5": +"cross-fetch@npm:^3.1.4, cross-fetch@npm:^3.1.5": version: 3.1.5 resolution: "cross-fetch@npm:3.1.5" dependencies: @@ -10794,6 +11191,16 @@ __metadata: languageName: node linkType: hard +"d@npm:1, d@npm:^1.0.1": + version: 1.0.1 + resolution: "d@npm:1.0.1" + dependencies: + es5-ext: ^0.10.50 + type: ^1.0.1 + checksum: 49ca0639c7b822db670de93d4fbce44b4aa072cd848c76292c9978a8cd0fff1028763020ff4b0f147bd77bfe29b4c7f82e0f71ade76b2a06100543cdfd948d19 + languageName: node + linkType: hard + "damerau-levenshtein@npm:^1.0.8": version: 1.0.8 resolution: "damerau-levenshtein@npm:1.0.8" @@ -10828,7 +11235,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4": +"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:~4.3.1, debug@npm:~4.3.2": version: 4.3.4 resolution: "debug@npm:4.3.4" dependencies: @@ -11521,16 +11928,16 @@ __metadata: languageName: node linkType: hard -"electron@npm:^23.1.3": - version: 23.2.0 - resolution: "electron@npm:23.2.0" +"electron@npm:^23.2.0": + version: 23.2.2 + resolution: "electron@npm:23.2.2" dependencies: "@electron/get": ^2.0.0 "@types/node": ^16.11.26 extract-zip: ^2.0.1 bin: electron: cli.js - checksum: 175326a42946dd5fa55d4a4e550328109abcf868bda6d34e9f49caaa4a672ddf65624e76260cf767ba37e0278f96cf1b21b7204c8528476f3f516fcc4b4e097f + checksum: 49dc4ec9c456a74b379ce164ce3a3a9d2a1b5463953796f7b0c3a1c29e17d0c680b595c22423bd7366cf0bf8e58db70bfb4ea0bbdba2d7229f7b48cfc4c5688a languageName: node linkType: hard @@ -11548,7 +11955,7 @@ __metadata: languageName: node linkType: hard -"elliptic@npm:^6.5.3, elliptic@npm:^6.5.4": +"elliptic@npm:6.5.4, elliptic@npm:^6.5.3, elliptic@npm:^6.5.4": version: 6.5.4 resolution: "elliptic@npm:6.5.4" dependencies: @@ -11634,6 +12041,26 @@ __metadata: languageName: node linkType: hard +"engine.io-client@npm:~6.4.0": + version: 6.4.0 + resolution: "engine.io-client@npm:6.4.0" + dependencies: + "@socket.io/component-emitter": ~3.1.0 + debug: ~4.3.1 + engine.io-parser: ~5.0.3 + ws: ~8.11.0 + xmlhttprequest-ssl: ~2.0.0 + checksum: f412a5d490d073bc6b1240002ea9d46c4813bfb7ad98edd54db3760d75cac1d7f73c2f802a7ce04827c1e304fa26f4d464785efdb003d6231cadedca649a7146 + languageName: node + linkType: hard + +"engine.io-parser@npm:~5.0.3": + version: 5.0.6 + resolution: "engine.io-parser@npm:5.0.6" + checksum: e92255b5463593cafe6cdc90577f107b39056c9c9337a8ee3477cb274337da1fe4ff53e9b3ad59d0478878e1d55ab15e973e2a91d0334d25ea99d8d6f8032f26 + languageName: node + linkType: hard + "enhanced-resolve@npm:^4.5.0": version: 4.5.0 resolution: "enhanced-resolve@npm:4.5.0" @@ -11809,6 +12236,17 @@ __metadata: languageName: node linkType: hard +"es5-ext@npm:^0.10.35, es5-ext@npm:^0.10.50": + version: 0.10.62 + resolution: "es5-ext@npm:0.10.62" + dependencies: + es6-iterator: ^2.0.3 + es6-symbol: ^3.1.3 + next-tick: ^1.1.0 + checksum: 25f42f6068cfc6e393cf670bc5bba249132c5f5ec2dd0ed6e200e6274aca2fed8e9aec8a31c76031744c78ca283c57f0b41c7e737804c6328c7b8d3fbcba7983 + languageName: node + linkType: hard + "es5-shim@npm:^4.5.13": version: 4.6.7 resolution: "es5-shim@npm:4.6.7" @@ -11823,6 +12261,17 @@ __metadata: languageName: node linkType: hard +"es6-iterator@npm:^2.0.3": + version: 2.0.3 + resolution: "es6-iterator@npm:2.0.3" + dependencies: + d: 1 + es5-ext: ^0.10.35 + es6-symbol: ^3.1.1 + checksum: 6e48b1c2d962c21dee604b3d9f0bc3889f11ed5a8b33689155a2065d20e3107e2a69cc63a71bd125aeee3a589182f8bbcb5c8a05b6a8f38fa4205671b6d09697 + languageName: node + linkType: hard + "es6-object-assign@npm:^1.1.0": version: 1.1.0 resolution: "es6-object-assign@npm:1.1.0" @@ -11837,6 +12286,13 @@ __metadata: languageName: node linkType: hard +"es6-promise@npm:^4.2.8": + version: 4.2.8 + resolution: "es6-promise@npm:4.2.8" + checksum: 95614a88873611cb9165a85d36afa7268af5c03a378b35ca7bda9508e1d4f1f6f19a788d4bc755b3fd37c8ebba40782018e02034564ff24c9d6fa37e959ad57d + languageName: node + linkType: hard + "es6-shim@npm:^0.35.5": version: 0.35.7 resolution: "es6-shim@npm:0.35.7" @@ -11844,6 +12300,16 @@ __metadata: languageName: node linkType: hard +"es6-symbol@npm:^3.1.1, es6-symbol@npm:^3.1.3": + version: 3.1.3 + resolution: "es6-symbol@npm:3.1.3" + dependencies: + d: ^1.0.1 + ext: ^1.1.2 + checksum: cd49722c2a70f011eb02143ef1c8c70658d2660dead6641e160b94619f408b9cf66425515787ffe338affdf0285ad54f4eae30ea5bd510e33f8659ec53bcaa70 + languageName: node + linkType: hard + "escalade@npm:^3.1.1": version: 3.1.1 resolution: "escalade@npm:3.1.1" @@ -12335,6 +12801,68 @@ __metadata: languageName: node linkType: hard +"ethereum-bloom-filters@npm:^1.0.6": + version: 1.0.10 + resolution: "ethereum-bloom-filters@npm:1.0.10" + dependencies: + js-sha3: ^0.8.0 + checksum: 4019cc6f9274ae271a52959194a72f6e9b013366f168f922dc3b349319faf7426bf1010125ee0676b4f75714fe4a440edd4e7e62342c121a046409f4cd4c0af9 + languageName: node + linkType: hard + +"ethereum-cryptography@npm:^0.1.3": + version: 0.1.3 + resolution: "ethereum-cryptography@npm:0.1.3" + dependencies: + "@types/pbkdf2": ^3.0.0 + "@types/secp256k1": ^4.0.1 + blakejs: ^1.1.0 + browserify-aes: ^1.2.0 + bs58check: ^2.1.2 + create-hash: ^1.2.0 + create-hmac: ^1.1.7 + hash.js: ^1.1.7 + keccak: ^3.0.0 + pbkdf2: ^3.0.17 + randombytes: ^2.1.0 + safe-buffer: ^5.1.2 + scrypt-js: ^3.0.0 + secp256k1: ^4.0.1 + setimmediate: ^1.0.5 + checksum: 54bae7a4a96bd81398cdc35c91cfcc74339f71a95ed1b5b694663782e69e8e3afd21357de3b8bac9ff4877fd6f043601e200a7ad9133d94be6fd7d898ee0a449 + languageName: node + linkType: hard + +"ethereumjs-util@npm:^7.1.0": + version: 7.1.5 + resolution: "ethereumjs-util@npm:7.1.5" + dependencies: + "@types/bn.js": ^5.1.0 + bn.js: ^5.1.2 + create-hash: ^1.1.2 + ethereum-cryptography: ^0.1.3 + rlp: ^2.2.4 + checksum: 27a3c79d6e06b2df34b80d478ce465b371c8458b58f5afc14d91c8564c13363ad336e6e83f57eb0bd719fde94d10ee5697ceef78b5aa932087150c5287b286d1 + languageName: node + linkType: hard + +"ethjs-unit@npm:0.1.6": + version: 0.1.6 + resolution: "ethjs-unit@npm:0.1.6" + dependencies: + bn.js: 4.11.6 + number-to-bn: 1.7.0 + checksum: df6b4752ff7461a59a20219f4b1684c631ea601241c39660e3f6c6bd63c950189723841c22b3c6c0ebeb3c9fc99e0e803e3c613101206132603705fcbcf4def5 + languageName: node + linkType: hard + +"eventemitter3@npm:4.0.4": + version: 4.0.4 + resolution: "eventemitter3@npm:4.0.4" + checksum: 7afb1cd851d19898bc99cc55ca894fe18cb1f8a07b0758652830a09bd6f36082879a25345be6219b81d74764140688b1a8fa75bcd1073d96b9a6661e444bc2ea + languageName: node + linkType: hard + "eventemitter3@npm:^4.0.0": version: 4.0.7 resolution: "eventemitter3@npm:4.0.7" @@ -12342,7 +12870,7 @@ __metadata: languageName: node linkType: hard -"events@npm:^3.0.0, events@npm:^3.2.0": +"events@npm:^3.0.0, events@npm:^3.2.0, events@npm:^3.3.0": version: 3.3.0 resolution: "events@npm:3.3.0" checksum: f6f487ad2198aa41d878fa31452f1a3c00958f46e9019286ff4787c84aac329332ab45c9cdc8c445928fc6d7ded294b9e005a7fce9426488518017831b272780 @@ -12485,6 +13013,15 @@ __metadata: languageName: node linkType: hard +"ext@npm:^1.1.2": + version: 1.7.0 + resolution: "ext@npm:1.7.0" + dependencies: + type: ^2.7.2 + checksum: ef481f9ef45434d8c867cfd09d0393b60945b7c8a1798bedc4514cb35aac342ccb8d8ecb66a513e6a2b4ec1e294a338e3124c49b29736f8e7c735721af352c31 + languageName: node + linkType: hard + "extend-shallow@npm:^2.0.1": version: 2.0.1 resolution: "extend-shallow@npm:2.0.1" @@ -13764,7 +14301,7 @@ __metadata: languageName: node linkType: hard -"hash.js@npm:^1.0.0, hash.js@npm:^1.0.3": +"hash.js@npm:1.1.7, hash.js@npm:^1.0.0, hash.js@npm:^1.0.3, hash.js@npm:^1.1.7": version: 1.1.7 resolution: "hash.js@npm:1.1.7" dependencies: @@ -14074,6 +14611,13 @@ __metadata: languageName: node linkType: hard +"http-https@npm:^1.0.0": + version: 1.0.0 + resolution: "http-https@npm:1.0.0" + checksum: 82fc4d2e512c64b35680944d1ae13e68220acfa05b06329832e271fd199c5c7fcff1f53fc1f91a1cd65a737ee4de14004dd3ba9a73cce33da970940c6e6ca774 + languageName: node + linkType: hard + "http-parser-js@npm:>=0.5.1": version: 0.5.8 resolution: "http-parser-js@npm:0.5.8" @@ -14769,6 +15313,13 @@ __metadata: languageName: node linkType: hard +"is-hex-prefixed@npm:1.0.0": + version: 1.0.0 + resolution: "is-hex-prefixed@npm:1.0.0" + checksum: 5ac58e6e528fb029cc43140f6eeb380fad23d0041cc23154b87f7c9a1b728bcf05909974e47248fd0b7fcc11ba33cf7e58d64804883056fabd23e2b898be41de + languageName: node + linkType: hard + "is-hexadecimal@npm:^1.0.0": version: 1.0.4 resolution: "is-hexadecimal@npm:1.0.4" @@ -15939,7 +16490,7 @@ __metadata: languageName: node linkType: hard -"js-sha3@npm:0.8.0": +"js-sha3@npm:0.8.0, js-sha3@npm:^0.8.0": version: 0.8.0 resolution: "js-sha3@npm:0.8.0" checksum: 75df77c1fc266973f06cce8309ce010e9e9f07ec35ab12022ed29b7f0d9c8757f5a73e1b35aa24840dced0dea7059085aa143d817aea9e188e2a80d569d9adce @@ -16090,6 +16641,15 @@ __metadata: languageName: node linkType: hard +"json-stable-stringify@npm:^1.0.2": + version: 1.0.2 + resolution: "json-stable-stringify@npm:1.0.2" + dependencies: + jsonify: ^0.0.1 + checksum: ec10863493fb728481ed7576551382768a173d5b884758db530def00523b862083a3fd70fee24b39e2f47f5f502e22f9a1489dd66da3535b63bf6241dbfca800 + languageName: node + linkType: hard + "json-stringify-safe@npm:^5.0.1": version: 5.0.1 resolution: "json-stringify-safe@npm:5.0.1" @@ -16142,6 +16702,13 @@ __metadata: languageName: node linkType: hard +"jsonify@npm:^0.0.1": + version: 0.0.1 + resolution: "jsonify@npm:0.0.1" + checksum: 027287e1c0294fce15f18c0ff990cfc2318e7f01fb76515f784d5cd0784abfec6fc5c2355c3a2f2cb0ad7f4aa2f5b74ebbfe4e80476c35b2d13cabdb572e1134 + languageName: node + linkType: hard + "jsonpointer@npm:^5.0.0": version: 5.0.1 resolution: "jsonpointer@npm:5.0.1" @@ -16166,6 +16733,25 @@ __metadata: languageName: node linkType: hard +"jwt-decode@npm:^3.1.2": + version: 3.1.2 + resolution: "jwt-decode@npm:3.1.2" + checksum: 20a4b072d44ce3479f42d0d2c8d3dabeb353081ba4982e40b83a779f2459a70be26441be6c160bfc8c3c6eadf9f6380a036fbb06ac5406b5674e35d8c4205eeb + languageName: node + linkType: hard + +"keccak@npm:^3.0.0, keccak@npm:^3.0.3": + version: 3.0.3 + resolution: "keccak@npm:3.0.3" + dependencies: + node-addon-api: ^2.0.0 + node-gyp: latest + node-gyp-build: ^4.2.0 + readable-stream: ^3.6.0 + checksum: f08f04f5cc87013a3fc9e87262f761daff38945c86dd09c01a7f7930a15ae3e14f93b310ef821dcc83675a7b814eb1c983222399a2f263ad980251201d1b9a99 + languageName: node + linkType: hard + "keyv@npm:^4.0.0": version: 4.5.2 resolution: "keyv@npm:4.5.2" @@ -16466,6 +17052,13 @@ __metadata: languageName: node linkType: hard +"loglevel@npm:^1.8.1": + version: 1.8.1 + resolution: "loglevel@npm:1.8.1" + checksum: a1a62db40291aaeaef2f612334c49e531bff71cc1d01a2acab689ab80d59e092f852ab164a5aedc1a752fdc46b7b162cb097d8a9eb2cf0b299511106c29af61d + languageName: node + linkType: hard + "long@npm:^4.0.0": version: 4.0.0 resolution: "long@npm:4.0.0" @@ -17312,6 +17905,13 @@ __metadata: languageName: node linkType: hard +"next-tick@npm:^1.1.0": + version: 1.1.0 + resolution: "next-tick@npm:1.1.0" + checksum: 83b5cf36027a53ee6d8b7f9c0782f2ba87f4858d977342bfc3c20c21629290a2111f8374d13a81221179603ffc4364f38374b5655d17b6a8f8a8c77bdea4fe8b + languageName: node + linkType: hard + "nice-try@npm:^1.0.4": version: 1.0.5 resolution: "nice-try@npm:1.0.5" @@ -17338,6 +17938,15 @@ __metadata: languageName: node linkType: hard +"node-addon-api@npm:^2.0.0": + version: 2.0.2 + resolution: "node-addon-api@npm:2.0.2" + dependencies: + node-gyp: latest + checksum: 31fb22d674648204f8dd94167eb5aac896c841b84a9210d614bf5d97c74ef059cc6326389cf0c54d2086e35312938401d4cc82e5fcd679202503eb8ac84814f8 + languageName: node + linkType: hard + "node-dir@npm:^0.1.10": version: 0.1.17 resolution: "node-dir@npm:0.1.17" @@ -17391,6 +18000,17 @@ __metadata: languageName: node linkType: hard +"node-gyp-build@npm:^4.2.0, node-gyp-build@npm:^4.3.0": + version: 4.6.0 + resolution: "node-gyp-build@npm:4.6.0" + bin: + node-gyp-build: bin.js + node-gyp-build-optional: optional.js + node-gyp-build-test: build-test.js + checksum: 25d78c5ef1f8c24291f4a370c47ba52fcea14f39272041a90a7894cd50d766f7c8cb8fb06c0f42bf6f69b204b49d9be3c8fc344aac09714d5bdb95965499eb15 + languageName: node + linkType: hard + "node-gyp@npm:latest": version: 9.3.1 resolution: "node-gyp@npm:9.3.1" @@ -17592,6 +18212,16 @@ __metadata: languageName: node linkType: hard +"number-to-bn@npm:1.7.0": + version: 1.7.0 + resolution: "number-to-bn@npm:1.7.0" + dependencies: + bn.js: 4.11.6 + strip-hex-prefix: 1.0.0 + checksum: 5b8c9dbe7b49dc7a069e5f0ba4e197257c89db11463478cb002fee7a34dc8868636952bd9f6310e5fdf22b266e0e6dffb5f9537c741734718107e90ae59b3de4 + languageName: node + linkType: hard + "nwsapi@npm:^2.2.0": version: 2.2.2 resolution: "nwsapi@npm:2.2.2" @@ -17812,6 +18442,22 @@ __metadata: languageName: node linkType: hard +"oblivious-set@npm:1.1.1": + version: 1.1.1 + resolution: "oblivious-set@npm:1.1.1" + checksum: ea1830c38ad5b8b71e6573d0dda3ecaf01e7e0c25c5d612d6f2915e8568c2148a5e0aab31a7d4155db96e6623a123cce57d9b4929947d2ab4c040505947674c6 + languageName: node + linkType: hard + +"oboe@npm:2.1.5": + version: 2.1.5 + resolution: "oboe@npm:2.1.5" + dependencies: + http-https: ^1.0.0 + checksum: e6171b33645ffc3559688a824a461952380d0b8f6a203b2daf6767647f277554a73fd7ad795629d88cd8eab68c0460aabb1e1b8b52ef80e3ff7621ac39f832ed + languageName: node + linkType: hard + "obuf@npm:^1.0.0, obuf@npm:^1.1.2": version: 1.1.2 resolution: "obuf@npm:1.1.2" @@ -18282,7 +18928,7 @@ __metadata: languageName: node linkType: hard -"pbkdf2@npm:^3.0.3, pbkdf2@npm:^3.1.2": +"pbkdf2@npm:^3.0.17, pbkdf2@npm:^3.0.3, pbkdf2@npm:^3.1.2": version: 3.1.2 resolution: "pbkdf2@npm:3.1.2" dependencies: @@ -20921,6 +21567,17 @@ __metadata: languageName: node linkType: hard +"rlp@npm:^2.2.4": + version: 2.2.7 + resolution: "rlp@npm:2.2.7" + dependencies: + bn.js: ^5.2.0 + bin: + rlp: bin/rlp + checksum: 3db4dfe5c793f40ac7e0be689a1f75d05e6f2ca0c66189aeb62adab8c436b857ab4420a419251ee60370d41d957a55698fc5e23ab1e1b41715f33217bc4bb558 + languageName: node + linkType: hard + "roarr@npm:^2.15.3": version: 2.15.4 resolution: "roarr@npm:2.15.4" @@ -21202,6 +21859,25 @@ __metadata: languageName: node linkType: hard +"scrypt-js@npm:^3.0.0": + version: 3.0.1 + resolution: "scrypt-js@npm:3.0.1" + checksum: b7c7d1a68d6ca946f2fbb0778e0c4ec63c65501b54023b2af7d7e9f48fdb6c6580d6f7675cd53bda5944c5ebc057560d5a6365079752546865defb3b79dea454 + languageName: node + linkType: hard + +"secp256k1@npm:^4.0.1": + version: 4.0.3 + resolution: "secp256k1@npm:4.0.3" + dependencies: + elliptic: ^6.5.4 + node-addon-api: ^2.0.0 + node-gyp: latest + node-gyp-build: ^4.2.0 + checksum: 21e219adc0024fbd75021001358780a3cc6ac21273c3fcaef46943af73969729709b03f1df7c012a0baab0830fb9a06ccc6b42f8d50050c665cb98078eab477b + languageName: node + linkType: hard + "select-hose@npm:^2.0.0": version: 2.0.0 resolution: "select-hose@npm:2.0.0" @@ -21625,6 +22301,28 @@ __metadata: languageName: node linkType: hard +"socket.io-client@npm:^4.6.1": + version: 4.6.1 + resolution: "socket.io-client@npm:4.6.1" + dependencies: + "@socket.io/component-emitter": ~3.1.0 + debug: ~4.3.2 + engine.io-client: ~6.4.0 + socket.io-parser: ~4.2.1 + checksum: cc6abd3f9db41379d1aa115cee5743c97f450c47cf416885660a62d1250696c38c40d0b6d1e6a6b7c6f7ffa02c504e9c04ceffe1459ae0208c8697dc8f69aae8 + languageName: node + linkType: hard + +"socket.io-parser@npm:~4.2.1": + version: 4.2.2 + resolution: "socket.io-parser@npm:4.2.2" + dependencies: + "@socket.io/component-emitter": ~3.1.0 + debug: ~4.3.1 + checksum: ba929645cb252e23d9800f00c77092480d07cc5d6c97a5d11f515ef636870ea5b3ad6f62b7ba6147b4d703efc92588064f5638a0a0841c8530e4ac50c4b1197a + languageName: node + linkType: hard + "sockjs@npm:^0.3.24": version: 0.3.24 resolution: "sockjs@npm:0.3.24" @@ -22233,6 +22931,15 @@ __metadata: languageName: node linkType: hard +"strip-hex-prefix@npm:1.0.0": + version: 1.0.0 + resolution: "strip-hex-prefix@npm:1.0.0" + dependencies: + is-hex-prefixed: 1.0.0 + checksum: 4cafe7caee1d281d3694d14920fd5d3c11adf09371cef7e2ccedd5b83efd9e9bd2219b5d6ce6e809df6e0f437dc9d30db1192116580875698aad164a6d6b285b + languageName: node + linkType: hard + "strip-indent@npm:^1.0.1": version: 1.0.1 resolution: "strip-indent@npm:1.0.1" @@ -23069,6 +23776,20 @@ __metadata: languageName: node linkType: hard +"type@npm:^1.0.1": + version: 1.2.0 + resolution: "type@npm:1.2.0" + checksum: dae8c64f82c648b985caf321e9dd6e8b7f4f2e2d4f846fc6fd2c8e9dc7769382d8a52369ddbaccd59aeeceb0df7f52fb339c465be5f2e543e81e810e413451ee + languageName: node + linkType: hard + +"type@npm:^2.7.2": + version: 2.7.2 + resolution: "type@npm:2.7.2" + checksum: 0f42379a8adb67fe529add238a3e3d16699d95b42d01adfe7b9a7c5da297f5c1ba93de39265ba30ffeb37dfd0afb3fb66ae09f58d6515da442219c086219f6f4 + languageName: node + linkType: hard + "typed-array-length@npm:^1.0.4": version: 1.0.4 resolution: "typed-array-length@npm:1.0.4" @@ -23139,9 +23860,9 @@ __metadata: languageName: node linkType: hard -"umami-ui@workspace:.": +"umami@workspace:.": version: 0.0.0-use.local - resolution: "umami-ui@workspace:." + resolution: "umami@workspace:." dependencies: "@airgap/tezos": ^0.13.11 "@chakra-ui/icons": ^2.0.17 @@ -23165,6 +23886,7 @@ __metadata: "@testing-library/jest-dom": ^5.16.5 "@testing-library/react": ^13.4.0 "@testing-library/user-event": ^13.5.0 + "@toruslabs/customauth": ^11.5.0 "@types/assert": ^1.5.6 "@types/jest": ^27.5.2 "@types/node": ^16.18.14 @@ -23186,7 +23908,7 @@ __metadata: crypto-browserify: ^3.12.0 date-fns: ^2.29.3 ed25519-hd-key: ^1.3.0 - electron: ^23.1.3 + electron: ^23.2.0 electron-builder: ^23.6.0 electronmon: ^2.0.2 eslint: ^8.38.0 @@ -23471,6 +24193,13 @@ __metadata: languageName: node linkType: hard +"unload@npm:^2.4.1": + version: 2.4.1 + resolution: "unload@npm:2.4.1" + checksum: a6f92d176e2718af3cb4bf087a338f21f2ded32e81c052d97d020c5b402e4a2925784efd8808827c149d35fddf49dad0a01035ecc6a69941f2c8eae90d33dc12 + languageName: node + linkType: hard + "unpipe@npm:1.0.0, unpipe@npm:~1.0.0": version: 1.0.0 resolution: "unpipe@npm:1.0.0" @@ -23625,6 +24354,16 @@ __metadata: languageName: node linkType: hard +"utf-8-validate@npm:^5.0.2": + version: 5.0.10 + resolution: "utf-8-validate@npm:5.0.10" + dependencies: + node-gyp: latest + node-gyp-build: ^4.3.0 + checksum: 5579350a023c66a2326752b6c8804cc7b39dcd251bb088241da38db994b8d78352e388dcc24ad398ab98385ba3c5ffcadb6b5b14b2637e43f767869055e46ba6 + languageName: node + linkType: hard + "utf8-byte-length@npm:^1.0.1": version: 1.0.4 resolution: "utf8-byte-length@npm:1.0.4" @@ -23632,6 +24371,13 @@ __metadata: languageName: node linkType: hard +"utf8@npm:3.0.0": + version: 3.0.0 + resolution: "utf8@npm:3.0.0" + checksum: cb89a69ad9ab393e3eae9b25305b3ff08bebca9adc839191a34f90777eb2942f86a96369d2839925fea58f8f722f7e27031d697f10f5f39690f8c5047303e62d + languageName: node + linkType: hard + "util-deprecate@npm:^1.0.1, util-deprecate@npm:^1.0.2, util-deprecate@npm:~1.0.1": version: 1.0.2 resolution: "util-deprecate@npm:1.0.2" @@ -23679,7 +24425,7 @@ __metadata: languageName: node linkType: hard -"util@npm:^0.12.0": +"util@npm:^0.12.0, util@npm:^0.12.5": version: 0.12.5 resolution: "util@npm:0.12.5" dependencies: @@ -23930,6 +24676,160 @@ __metadata: languageName: node linkType: hard +"web3-core-helpers@npm:1.9.0": + version: 1.9.0 + resolution: "web3-core-helpers@npm:1.9.0" + dependencies: + web3-eth-iban: 1.9.0 + web3-utils: 1.9.0 + checksum: ccfc9fb8ce63b259eed7f6963ebd25837de349b6c19e260e52e9beb0672e9226269a2e535854c7941b72e0af689c971e9374cd3669b9f7da574010af7b39dddc + languageName: node + linkType: hard + +"web3-core-method@npm:1.9.0": + version: 1.9.0 + resolution: "web3-core-method@npm:1.9.0" + dependencies: + "@ethersproject/transactions": ^5.6.2 + web3-core-helpers: 1.9.0 + web3-core-promievent: 1.9.0 + web3-core-subscriptions: 1.9.0 + web3-utils: 1.9.0 + checksum: 6a0b6c997d7ccc41cff2351ab38db68940e10dffd0bc91c03a4da8ab6337b01f819ed504d0af8cd014c84f3ef5e229bca246fdec049076c5037ae2574d18656f + languageName: node + linkType: hard + +"web3-core-promievent@npm:1.9.0": + version: 1.9.0 + resolution: "web3-core-promievent@npm:1.9.0" + dependencies: + eventemitter3: 4.0.4 + checksum: 6470726340863ffca55e43500831398783957a5089fa88d472a39fa8c3327cf92a7af288193570e2cc1d2580c983b9a8541330b1c9c0df93ee49a094aedb700c + languageName: node + linkType: hard + +"web3-core-requestmanager@npm:1.9.0": + version: 1.9.0 + resolution: "web3-core-requestmanager@npm:1.9.0" + dependencies: + util: ^0.12.5 + web3-core-helpers: 1.9.0 + web3-providers-http: 1.9.0 + web3-providers-ipc: 1.9.0 + web3-providers-ws: 1.9.0 + checksum: b80ed82401102373a3290125fc7caa408773dc1d31f0075159a70a357e17aab509112d31eeb4cf911952657aaa2bb6637a99b5568e77528e95444e5114b290f7 + languageName: node + linkType: hard + +"web3-core-subscriptions@npm:1.9.0": + version: 1.9.0 + resolution: "web3-core-subscriptions@npm:1.9.0" + dependencies: + eventemitter3: 4.0.4 + web3-core-helpers: 1.9.0 + checksum: 2d82b6b99292d3895b11f9b0f8d37f2d211cc533176910182a591200a99c163dc6c17254d8675bf2faf65cf396a9a1036dcd40ec01174cd202ebffe6f3dd1e1c + languageName: node + linkType: hard + +"web3-core@npm:1.9.0": + version: 1.9.0 + resolution: "web3-core@npm:1.9.0" + dependencies: + "@types/bn.js": ^5.1.1 + "@types/node": ^12.12.6 + bignumber.js: ^9.0.0 + web3-core-helpers: 1.9.0 + web3-core-method: 1.9.0 + web3-core-requestmanager: 1.9.0 + web3-utils: 1.9.0 + checksum: 37f677f00781793f6ab4b6493827226c56872b9efb80739ad4bcc8ef4ab22d12feba050d35c46d355fd5fbd73c2058fff4ab6d6b866df99f5e3c9c2d2a62eeea + languageName: node + linkType: hard + +"web3-eth-abi@npm:1.9.0": + version: 1.9.0 + resolution: "web3-eth-abi@npm:1.9.0" + dependencies: + "@ethersproject/abi": ^5.6.3 + web3-utils: 1.9.0 + checksum: 33dedf442fa7b5ef68a7a274103a7a9821bde14e4a3b7730f3402bc3ae1cdcf129a21fc81017242a30cc06be6dee8c3d2975ef764c6ab81483c33a5fd8c1466f + languageName: node + linkType: hard + +"web3-eth-contract@npm:^1.8.2": + version: 1.9.0 + resolution: "web3-eth-contract@npm:1.9.0" + dependencies: + "@types/bn.js": ^5.1.1 + web3-core: 1.9.0 + web3-core-helpers: 1.9.0 + web3-core-method: 1.9.0 + web3-core-promievent: 1.9.0 + web3-core-subscriptions: 1.9.0 + web3-eth-abi: 1.9.0 + web3-utils: 1.9.0 + checksum: 1e18b486e903d5c0dfaba29ebcca9d272962f6b7666c10413c8b4f19ca892cc92fe2be38d17f2256c2d5f24c669ff0ad48a9009f59eb2c511ef9ecd9c4f866a5 + languageName: node + linkType: hard + +"web3-eth-iban@npm:1.9.0": + version: 1.9.0 + resolution: "web3-eth-iban@npm:1.9.0" + dependencies: + bn.js: ^5.2.1 + web3-utils: 1.9.0 + checksum: 56210ab553fffb06a679e7a8b3afedd5b5fe31c1488c93579d9243f14bc1de397753511577fbf10fe096014e39eaf751724fadcecd1b1f46651475d49134e729 + languageName: node + linkType: hard + +"web3-providers-http@npm:1.9.0": + version: 1.9.0 + resolution: "web3-providers-http@npm:1.9.0" + dependencies: + abortcontroller-polyfill: ^1.7.3 + cross-fetch: ^3.1.4 + es6-promise: ^4.2.8 + web3-core-helpers: 1.9.0 + checksum: 93900157147c7b22ce426ff47256fdc58c661a40011256e71025b0b2570d9f587f098f012c49fde27234379b1ece93aff03839e74fce0db20e2c14bacc5ab17e + languageName: node + linkType: hard + +"web3-providers-ipc@npm:1.9.0": + version: 1.9.0 + resolution: "web3-providers-ipc@npm:1.9.0" + dependencies: + oboe: 2.1.5 + web3-core-helpers: 1.9.0 + checksum: cafa0a0891bcb63239043b15289a0564417109f103b6b97794e32903c8958f89a2fb471c24f1fe0ae28ef7fc569be0597c519b1dcc5db7e48c064137ec0f6d60 + languageName: node + linkType: hard + +"web3-providers-ws@npm:1.9.0": + version: 1.9.0 + resolution: "web3-providers-ws@npm:1.9.0" + dependencies: + eventemitter3: 4.0.4 + web3-core-helpers: 1.9.0 + websocket: ^1.0.32 + checksum: c2dc4c4ab0cd5ce7217f0aee0afaa1ccb23eba11f297d9c9dec447ac9ca51371b5d9bdd35d461354cfb3a4710d854c3325b2b7e775ea33d708d0938d991191c5 + languageName: node + linkType: hard + +"web3-utils@npm:1.9.0, web3-utils@npm:^1.8.2": + version: 1.9.0 + resolution: "web3-utils@npm:1.9.0" + dependencies: + bn.js: ^5.2.1 + ethereum-bloom-filters: ^1.0.6 + ethereumjs-util: ^7.1.0 + ethjs-unit: 0.1.6 + number-to-bn: 1.7.0 + randombytes: ^2.1.0 + utf8: 3.0.0 + checksum: 3c794a7fcef9387b96e8fcd847fbf286862f0540ab6656063cdb69830ddd7141d955f5e52c049e3d5f28373311934d19f75199f42604741400af72e2348a26f6 + languageName: node + linkType: hard + "webidl-conversions@npm:^3.0.0": version: 3.0.1 resolution: "webidl-conversions@npm:3.0.1" @@ -24229,6 +25129,20 @@ __metadata: languageName: node linkType: hard +"websocket@npm:^1.0.32": + version: 1.0.34 + resolution: "websocket@npm:1.0.34" + dependencies: + bufferutil: ^4.0.1 + debug: ^2.2.0 + es5-ext: ^0.10.50 + typedarray-to-buffer: ^3.1.5 + utf-8-validate: ^5.0.2 + yaeti: ^0.0.6 + checksum: 8a0ce6d79cc1334bb6ea0d607f0092f3d32700b4dd19e4d5540f2a85f3b50e1f8110da0e4716737056584dde70bbebcb40bbd94bbb437d7468c71abfbfa077d8 + languageName: node + linkType: hard + "whatwg-encoding@npm:^1.0.5": version: 1.0.5 resolution: "whatwg-encoding@npm:1.0.5" @@ -24660,6 +25574,21 @@ __metadata: languageName: node linkType: hard +"ws@npm:~8.11.0": + version: 8.11.0 + resolution: "ws@npm:8.11.0" + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + checksum: 316b33aba32f317cd217df66dbfc5b281a2f09ff36815de222bc859e3424d83766d9eb2bd4d667de658b6ab7be151f258318fb1da812416b30be13103e5b5c67 + languageName: node + linkType: hard + "x-default-browser@npm:^0.4.0": version: 0.4.0 resolution: "x-default-browser@npm:0.4.0" @@ -24695,6 +25624,13 @@ __metadata: languageName: node linkType: hard +"xmlhttprequest-ssl@npm:~2.0.0": + version: 2.0.0 + resolution: "xmlhttprequest-ssl@npm:2.0.0" + checksum: 1e98df67f004fec15754392a131343ea92e6ab5ac4d77e842378c5c4e4fd5b6a9134b169d96842cc19422d77b1606b8df84a5685562b3b698cb68441636f827e + languageName: node + linkType: hard + "xtend@npm:^4.0.0, xtend@npm:^4.0.1, xtend@npm:^4.0.2, xtend@npm:~4.0.1": version: 4.0.2 resolution: "xtend@npm:4.0.2" @@ -24716,6 +25652,13 @@ __metadata: languageName: node linkType: hard +"yaeti@npm:^0.0.6": + version: 0.0.6 + resolution: "yaeti@npm:0.0.6" + checksum: 6db12c152f7c363b80071086a3ebf5032e03332604eeda988872be50d6c8469e1f13316175544fa320f72edad696c2d83843ad0ff370659045c1a68bcecfcfea + languageName: node + linkType: hard + "yallist@npm:^3.0.2": version: 3.1.1 resolution: "yallist@npm:3.1.1"