diff --git a/public/content-script.js b/public/content-script.js index 79b0b93..3b74c85 100644 --- a/public/content-script.js +++ b/public/content-script.js @@ -10,13 +10,12 @@ // In your content script document.addEventListener('qortalExtensionRequests', async (event) => { const { type, payload, requestId, timeout } = event.detail; // Capture the requestId -console.log({type}) + if (type === 'REQUEST_USER_INFO') { const hostname = window.location.hostname const res = await connection(hostname) - console.log('is connected', res) + if(!res){ - console.log('thou') document.dispatchEvent(new CustomEvent('qortalExtensionResponses', { detail: { type: "USER_INFO", data: { error: "Not authorized" @@ -93,7 +92,6 @@ console.log({type}) } else if (type === 'REQUEST_SEND_QORT') { const hostname = window.location.hostname const res = await connection(hostname) - console.log('isconnected', res) if(!res){ document.dispatchEvent(new CustomEvent('qortalExtensionResponses', { detail: { type: "USER_INFO", data: { diff --git a/src/App.tsx b/src/App.tsx index 52f9f67..dd397c7 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -3,10 +3,12 @@ import reactLogo from "./assets/react.svg"; import viteLogo from "/vite.svg"; import "./App.css"; import { useDropzone } from "react-dropzone"; -import { Box, Input, InputLabel, Typography } from "@mui/material"; +import { Box, Input, InputLabel, Tooltip, Typography } from "@mui/material"; import { decryptStoredWallet } from "./utils/decryptWallet"; import { CountdownCircleTimer } from "react-countdown-circle-timer"; import Logo1 from "./assets/svgs/Logo1.svg"; +import Logo1Dark from "./assets/svgs/Logo1Dark.svg"; + import Logo2 from "./assets/svgs/Logo2.svg"; import Copy from "./assets/svgs/Copy.svg"; import { CopyToClipboard } from "react-copy-to-clipboard"; @@ -14,6 +16,7 @@ import Download from "./assets/svgs/Download.svg"; import Logout from "./assets/svgs/Logout.svg"; import Return from "./assets/svgs/Return.svg"; import Success from "./assets/svgs/Success.svg"; +import Info from "./assets/svgs/Info.svg"; import { createAccount, generateRandomSentence, @@ -37,6 +40,7 @@ import { TextSpan, } from "./App-styles"; import { Spacer } from "./common/Spacer"; +import { Loader } from "./components/Loader"; type extStates = | "not-authenticated" @@ -46,7 +50,9 @@ type extStates = | "web-app-request-payment" | "web-app-request-authentication" | "download-wallet" - | "create-wallet"; + | "create-wallet" + | "transfer-success-regular" + | "transfer-success-request"; function App() { const [extState, setExtstate] = useState("not-authenticated"); @@ -66,6 +72,8 @@ function App() { const [walletToBeDownloaded, setWalletToBeDownloaded] = useState(null); const [walletToBeDownloadedPassword, setWalletToBeDownloadedPassword] = useState(""); + const [sendqortState, setSendqortState] = useState(null); + const [isLoading, setIsLoading] = useState(false) const [ walletToBeDownloadedPasswordConfirm, setWalletToBeDownloadedPasswordConfirm, @@ -97,7 +105,7 @@ function App() { // Read the file as text reader.readAsText(file); }); - console.log({ fileContents }); + let error: any = null; let pf: any; @@ -132,52 +140,13 @@ function App() { }, }); - // const storeDecryptedWallet = async () => { - // const res = await decryptStoredWallet("password", rawWallet); - // const wallet2 = new PhraseWallet(res, walletVersion); - // setdecryptedWallet(wallet2); - // }; - // const saveWalletFunc = async (password: string) => { - // console.log({ decryptedWallet }); - // let wallet = structuredClone(decryptedWallet); - // console.log({ decryptedWallet: decryptedWallet?.generateSaveWalletData }); - // const qortAddress = decryptedWallet.addresses[0].address; - // if (decryptedWallet?.generateSaveWalletData) { - // console.log("yes", wallet); - // wallet = await decryptedWallet.generateSaveWalletData( - // password, - // crypto.kdfThreads, - // () => {} - // ); - // } else { - // console.log("no", wallet); - // const res = await decryptStoredWallet(password, wallet); - // const wallet2 = new PhraseWallet(res, walletVersion); - // console.log({ wallet2 }); - // wallet = await wallet2.generateSaveWalletData( - // password, - // crypto.kdfThreads, - // () => {} - // ); - // } - // setWalletToBeDownloaded({ - // wallet, - // qortAddress, - // }); - // return { - // wallet, - // qortAddress, - // }; - // }; + const saveWalletFunc = async (password: string) => { - console.log({ decryptedWallet }); let wallet = structuredClone(rawWallet); - console.log("no", wallet); const res = await decryptStoredWallet(password, wallet); const wallet2 = new PhraseWallet(res, walletVersion); - console.log({ wallet2 }); wallet = await wallet2.generateSaveWalletData( password, crypto.kdfThreads, @@ -210,35 +179,14 @@ function App() { tabs[0].id, { from: "popup", subject: "anySubject" }, function (response) { - console.log(response); + } ); } ); }; - const getWalletInfoFunc = async () => { - // const res = await getWalletInfo() - // console.log({res}) - chrome.runtime.sendMessage({ action: "getWalletInfo" }, (response) => { - if (response) { - console.log("Extension installed: ", response); - // setIsExtensionInstalled(true); - } - }); - }; - const getValidApiFunc = () => { - chrome.runtime.sendMessage({ action: "validApi" }, (response) => { - if (response) { - } - }); - }; - const getNameFunc = () => { - chrome.runtime.sendMessage({ action: "name" }, (response) => { - if (response) { - console.log("name", response); - } - }); - }; + + const getBalanceFunc = () => { chrome.runtime.sendMessage({ action: "balance" }, (response) => { if (response && !response?.error) { @@ -261,6 +209,7 @@ function App() { setSendPaymentError("Please enter your wallet password"); return; } + setIsLoading(true) chrome.runtime.sendMessage( { action: "sendCoin", @@ -272,28 +221,26 @@ function App() { }, (response) => { if (response?.error) { - console.log("coin", response); setSendPaymentError(response.error); } else { - setSendPaymentSuccess("Payment successfully sent"); + setExtstate("transfer-success-regular"); + // setSendPaymentSuccess("Payment successfully sent"); } + setIsLoading(false) } ); }; - console.log({ rawWallet, decryptedWallet }); const clearAllStates = () => { setRequestConnection(null); setRequestAuthentication(null); }; - const [sendqortState, setSendqortState] = useState(null); - useEffect(() => { // Listen for messages from the background script chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { - console.log({ message }); + // Check if the message is to update the state if (message.action === "UPDATE_STATE_CONFIRM_SEND_QORT") { // Update the component state with the received 'sendqort' state @@ -316,7 +263,7 @@ function App() { }); }, []); - console.log({ sendqortState }); + //param = isDecline const confirmPayment = (isDecline: boolean) => { if (isDecline) { @@ -345,6 +292,7 @@ function App() { setSendPaymentError("Please enter your wallet password"); return; } + setIsLoading(true) chrome.runtime.sendMessage( { action: "sendQortConfirmation", @@ -357,9 +305,17 @@ function App() { }, }, (response) => { - if (response) { - setSendPaymentSuccess("Payment successfully sent"); + if (response === true) { + setExtstate("transfer-success-request"); + setCountdown(null); + // setSendPaymentSuccess("Payment successfully sent"); + } else { + + setSendPaymentError( + response?.error || "Unable to perform payment. Please try again." + ); } + setIsLoading(false) } ); }; @@ -391,12 +347,10 @@ function App() { try { chrome.runtime.sendMessage({ action: "getWalletInfo" }, (response) => { if (response && response?.walletInfo) { - console.log("Extension installed: ", response); setRawWallet(response?.walletInfo); setExtstate("authenticated"); } }); - } catch (error) {} }, []); @@ -405,7 +359,6 @@ function App() { try { chrome.runtime.sendMessage({ action: "userInfo" }, (response) => { if (response && !response.error) { - console.log("Extension installed: ", response); setUserInfo(response); } }); @@ -418,7 +371,6 @@ function App() { console.log("exit"); }; }, []); - console.log({ userInfo }); const confirmPasswordToDownload = async () => { try { @@ -427,9 +379,18 @@ function App() { setSendPaymentError("Please enter your password"); return; } + setIsLoading(true) + await new Promise((res)=> { + setTimeout(()=> { + res() + }, 250) + }) const res = await saveWalletFunc(walletToBeDownloadedPassword); } catch (error: any) { setWalletToBeDownloadedError(error?.message); + } finally { + setIsLoading(false) + } }; @@ -441,6 +402,7 @@ function App() { ); } catch (error: any) { setWalletToBeDownloadedError(error?.message); + } finally { } }; @@ -460,8 +422,13 @@ function App() { setWalletToBeDownloadedError("Password fields do not match!"); return; } + setIsLoading(true) + await new Promise((res)=> { + setTimeout(()=> { + res() + }, 250) + }) const res = await createAccount(); - console.log("new account", res); const wallet = await res.generateSaveWalletData( walletToBeDownloadedPassword, crypto.kdfThreads, @@ -475,6 +442,9 @@ function App() { }); } catch (error: any) { setWalletToBeDownloadedError(error?.message); + } finally { + setIsLoading(false) + } }; @@ -482,7 +452,7 @@ function App() { try { chrome.runtime.sendMessage({ action: "logout" }, (response) => { if (response) { - window.close(); + resetAllStates(); } }); } catch (error) {} @@ -499,12 +469,41 @@ function App() { setWalletToBeDownloadedPassword(""); setExtstate("authenticated"); }; + + const resetAllStates = () => { + setExtstate("not-authenticated"); + setBackupjson(null); + setRawWallet(null); + setdecryptedWallet(null); + setRequestConnection(null); + setRequestAuthentication(null); + setUserInfo(null); + setBalance(null); + setPaymentTo(""); + setPaymentAmount(0); + setPaymentPassword(""); + setSendPaymentError(""); + setSendPaymentSuccess(""); + setCountdown(null); + setWalletToBeDownloaded(null); + setWalletToBeDownloadedPassword(""); + setWalletToBeDownloadedPasswordConfirm(""); + setWalletToBeDownloadedError(""); + setSendqortState(null); + }; + return ( {extState === "not-authenticated" && ( <> - +
+ + +
QORTAL WALLET - - - Authenticate - - - { - setExtstate("create-wallet"); + - Create account - + + + Authenticate + + + + + + + + + { + setExtstate("create-wallet"); + }} + > + Create account + + + + )} {/* {extState !== "not-authenticated" && ( @@ -556,16 +587,19 @@ function App() { - - {balance?.toFixed(2)} QORT - + {balance && ( + + {balance?.toFixed(2)} QORT + + )} + {/*

balance: {balance}

*/} @@ -692,7 +726,7 @@ function App() { /> - Confirm wallet password + Confirm Wallet Password - + - {sendqortState?.description} + > + {sendqortState?.description} + - {sendqortState?.amount} QORT - + sx={{ + textAlign: "center", + lineHeight: "24px", + fontSize: "20px", + fontWeight: 700, + }} + > + {sendqortState?.amount} QORT + - Confirm wallet password + Confirm Wallet Password setPaymentPassword(e.target.value)} /> - - + {sendPaymentError} - )} {extState === "web-app-request-connection" && ( <> - +
+ + +
- +
+ + +
-
- {rawWallet?.address0 &&

Welcome {rawWallet?.address0}

} + + + + + +
+ +
+ + + + Download Wallet + + + {!walletToBeDownloaded && ( <> - - Confirm wallet password - - + Confirm Wallet Password + + + - + {walletToBeDownloadedError} @@ -910,7 +1002,9 @@ function App() { {walletToBeDownloaded && ( <> - + + Download wallet + )} @@ -919,8 +1013,34 @@ function App() { <> {!walletToBeDownloaded && ( <> - - + + + { + setExtstate("not-authenticated") + }} + src={Return} + /> + + +
+ + +
- Wallet password + Wallet Password - Confirm wallet password + Confirm Wallet Password - { - saveFileToDiskFunc() - returnToMain() - }}> + { + saveFileToDiskFunc(); + returnToMain(); + }} + > Backup Account )} )} + {extState === "transfer-success-regular" && ( + <> + + + + + The transfer was succesful! + + + { + returnToMain(); + }} + > + Continue + + + )} + {extState === "transfer-success-request" && ( + <> + + + + + The transfer was succesful! + + + { + window.close(); + }} + > + Continue + + + )} {countdown && ( )} + {isLoading && } ); } diff --git a/src/assets/svgs/Logo1Dark.svg b/src/assets/svgs/Logo1Dark.svg new file mode 100644 index 0000000..766d3cc --- /dev/null +++ b/src/assets/svgs/Logo1Dark.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/background.ts b/src/background.ts index 78253cb..ff6a6b0 100644 --- a/src/background.ts +++ b/src/background.ts @@ -55,12 +55,9 @@ async function findUsableApi() { async function getNameInfo() { const wallet = await getSaveWallet(); const address = wallet.address0; - console.log({ address }); const validApi = await findUsableApi(); const response = await fetch(validApi + "/names/address/" + address); - console.log({ response }); const nameData = await response.json(); - console.log({ nameData }); if (nameData?.length > 0) { return nameData[0].name; } else { @@ -92,7 +89,6 @@ async function getSaveWallet() { } async function getUserInfo() { - console.log("entered"); const wallet = await getSaveWallet(); const address = wallet.address0; const addressInfo = await getAddressInfo(address); @@ -111,7 +107,6 @@ async function connection(hostname) { async function getBalanceInfo() { const wallet = await getSaveWallet(); const address = wallet.address0; - console.log({ address }); const validApi = await findUsableApi(); const response = await fetch(validApi + "/addresses/balance/" + address); @@ -140,7 +135,6 @@ const processTransactionVersion2 = async (body: any, validApi: string) => { const transaction = async ({ type, params, apiVersion, keyPair }: any, validApi) => { const tx = createTransaction(type, keyPair, params); - console.log({ tx }); let res; if (apiVersion && apiVersion === 2) { @@ -161,20 +155,7 @@ const makeTransactionRequest = async ( keyPair, validApi ) => { - // let recipientName = await getName(receiver) - // let myTxnrequest = await parentEpml.request('transaction', { - // type: 2, - // nonce: 0, - // params: { - // recipient: receiver, - // recipientName: recipientName, - // amount: amount, - // lastReference: lastRef, - // fee: fee - // }, - // apiVersion: 2 - // }) - console.log({ receiver, lastRef, amount, fee }); + const myTxnrequest = await transaction({ nonce: 0, type: 2, @@ -244,9 +225,7 @@ async function sendCoin({ password, amount, receiver }) { const wallet2 = new PhraseWallet(response, walletVersion); const lastRef = await getLastRef(); - console.log({ lastRef }); const fee = await sendQortFee(); - console.log({ fee }); const validApi = await findUsableApi(); const res = await makeTransactionRequest( @@ -257,7 +236,6 @@ async function sendCoin({ password, amount, receiver }) { wallet2._addresses[0].keyPair, validApi ); - console.log({ res }); return {res, validApi}; } catch (error) { console.log({ error }); @@ -266,7 +244,6 @@ async function sendCoin({ password, amount, receiver }) { } chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { - console.log({ request }); if (request) { switch (request.action) { case "version": @@ -305,7 +282,6 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { getNameInfo() .then((name) => { sendResponse(name); - console.log("name:", name); }) .catch((error) => { console.error(error.message); @@ -315,7 +291,6 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { getUserInfo() .then((name) => { sendResponse(name); - console.log("name:", name); }) .catch((error) => { sendResponse({ error: "User not authenticated" }); @@ -354,15 +329,11 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { }) .catch((error) => { const popupUrl = chrome.runtime.getURL("index.html"); - console.log({ popupUrl }); chrome.windows.getAll( { populate: true, windowTypes: ["popup"] }, (windows) => { - console.log({ windows }); - windows.forEach((win) => { - win.tabs.forEach((tab) => console.log("url", tab.url)); // Attempt to log URLs directly - }); + // Attempt to find an existing popup window that has a tab with the correct URL const existingPopup = windows.find( (w) => @@ -371,7 +342,6 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { (tab) => tab.url && tab.url.startsWith(popupUrl) ) ); - console.log({ existingPopup }); if (existingPopup) { // If the popup exists but is minimized or not focused, focus it chrome.windows.update(existingPopup.id, { @@ -461,20 +431,15 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { const { hostname } = request.payload; connection(hostname) .then((isConnected) => { - console.log({ isConnected }); if (Object.keys(isConnected)?.length > 0 && isConnected[hostname]) { sendResponse(true); } else { const popupUrl = chrome.runtime.getURL("index.html"); - console.log({ popupUrl }); chrome.windows.getAll( { populate: true, windowTypes: ["popup"] }, (windows) => { - console.log({ windows }); - windows.forEach((win) => { - win.tabs.forEach((tab) => console.log("url", tab.url)); // Attempt to log URLs directly - }); + // Attempt to find an existing popup window that has a tab with the correct URL const existingPopup = windows.find( (w) => @@ -483,7 +448,6 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { (tab) => tab.url && tab.url.startsWith(popupUrl) ) ); - console.log({ existingPopup }); if (existingPopup) { // If the popup exists but is minimized or not focused, focus it chrome.windows.update(existingPopup.id, { @@ -547,22 +511,17 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { { const { amount, hostname, address, description } = request.payload; const popupUrl = chrome.runtime.getURL("index.html"); - console.log({ popupUrl }); chrome.windows.getAll( { populate: true, windowTypes: ["popup"] }, (windows) => { - console.log({ windows }); - windows.forEach((win) => { - win.tabs.forEach((tab) => console.log("url", tab.url)); // Attempt to log URLs directly - }); + // Attempt to find an existing popup window that has a tab with the correct URL const existingPopup = windows.find( (w) => w.tabs && w.tabs.some((tab) => tab.url && tab.url.startsWith(popupUrl)) ); - console.log({ existingPopup }); if (existingPopup) { // If the popup exists but is minimized or not focused, focus it chrome.windows.update(existingPopup.id, { @@ -626,7 +585,6 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { case "responseToConnectionRequest": { const { hostname, isOkay } = request.payload; - console.log({ hostname, isOkay }); const interactionId3 = request.payload.interactionId; if (!isOkay) { const originalSendResponse = pendingResponses.get(interactionId3); @@ -665,20 +623,19 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { sendResponse(true); // Use the sendResponse callback to respond to the original message originalSendResponse(res); - chrome.runtime.sendMessage({ - action: "closePopup", - }); + // chrome.runtime.sendMessage({ + // action: "closePopup", + // }); }) .catch((error) => { console.error(error.message); - sendResponse(false); + sendResponse({ error: error.message }); originalSendResponse({ error: error.message }); }); // Remove the callback from the Map as it's no longer needed pendingResponses.delete(interactionId2); } - console.log({ password, amount, receiver }); break; case "logout" : { @@ -700,59 +657,20 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { } return true; }); -// chrome.runtime.onMessageExternal.addListener(function ( -// request, -// sender, -// sendResponse -// ) { -// console.log({ request }); -// if (request) { -// switch (request.action) { -// case "version": -// // Example: respond with the version -// sendResponse({ version: "1.0" }); -// break; -// case "storeWalletInfo": -// chrome.storage.local.set({ walletInfo: request.wallet }, () => { -// if (chrome.runtime.lastError) { -// sendResponse({ error: chrome.runtime.lastError.message }); -// } else { -// sendResponse({ result: "Data saved successfully" }); -// } -// }); -// break; -// case "getWalletInfo": -// chrome.storage.local.get(["walletInfo"], (result) => { -// if (chrome.runtime.lastError) { -// sendResponse({ error: chrome.runtime.lastError.message }); -// } else if (result.walletInfo) { -// sendResponse({ walletInfo: result.walletInfo }); -// } else { -// sendResponse({ error: "No wallet info found" }); -// } -// }); -// break; -// } -// } -// return true; // This is crucial for asynchronous sendResponse -// }); + chrome.action.onClicked.addListener((tab) => { const popupUrl = chrome.runtime.getURL("index.html"); chrome.windows.getAll( { populate: true, windowTypes: ["popup"] }, (windows) => { - console.log({ windows }); - windows.forEach((win) => { - win.tabs.forEach((tab) => console.log("url", tab.url)); // Attempt to log URLs directly - }); + // Attempt to find an existing popup window that has a tab with the correct URL const existingPopup = windows.find( (w) => w.tabs && w.tabs.some((tab) => tab.url && tab.url.startsWith(popupUrl)) ); - console.log({ existingPopup }); if (existingPopup) { // If the popup exists but is minimized or not focused, focus it chrome.windows.update(existingPopup.id, { diff --git a/src/components/Loader.tsx b/src/components/Loader.tsx new file mode 100644 index 0000000..fe0a05e --- /dev/null +++ b/src/components/Loader.tsx @@ -0,0 +1,23 @@ +import React from 'react' +import { Box, CircularProgress } from "@mui/material"; + +export const Loader = () => { + return ( + + + + ) +} diff --git a/src/deps/kdf.ts b/src/deps/kdf.ts index c741a59..98bdc36 100644 --- a/src/deps/kdf.ts +++ b/src/deps/kdf.ts @@ -16,7 +16,6 @@ const stringtoUTF8Array = (message)=> { } const stringToUTF8Array=(message)=> { - console.log({message}) if (typeof message !== 'string') return message; // Assuming you still want to pass through non-string inputs unchanged const encoder = new TextEncoder(); // TextEncoder defaults to UTF-8 return encoder.encode(message); @@ -27,14 +26,7 @@ const computekdf = async (req)=> { const sha512Hash = new Sha512().process(combinedBytes).finish().result const sha512HashBase64 = bytesToBase64(sha512Hash) const result = bcrypt.hashSync(sha512HashBase64.substring(0, 72), staticBcryptSalt) - if(nonce === 0){ - console.log({salt, key, nonce, staticSalt, staticBcryptSalt}) - console.log({combinedBytes}) - console.log({sha512Hash}) - console.log({sha512HashBase64}) - console.log({result}) - - } + return { key, nonce, result } } @@ -53,12 +45,10 @@ export const doInitWorkers = (numberOfWorkers) => { } export const kdf = async (seed, salt, threads) => { - console.log({seed, salt, threads}) const workers = threads const salt2 = new Uint8Array(salt) salt = new Uint8Array(salt) - console.log({salt, salt2}) const seedParts = await Promise.all(workers.map((worker, index) => { const nonce = index return computekdf({ @@ -68,7 +58,6 @@ export const kdf = async (seed, salt, threads) => { staticSalt: crypto.staticSalt, staticBcryptSalt: crypto.staticBcryptSalt }).then(data => { - console.log({data}) let jsonData try { jsonData = JSON.parse(data) @@ -81,7 +70,6 @@ export const kdf = async (seed, salt, threads) => { return data.result }) })) - console.log({seedParts}) const result = new Sha512().process(stringtoUTF8Array(crypto.staticSalt + seedParts.reduce((a, c) => a + c))).finish().result return result } diff --git a/src/index.css b/src/index.css index 9eec189..9f2ef96 100644 --- a/src/index.css +++ b/src/index.css @@ -29,4 +29,27 @@ body { margin: 0px; +} + +.image-container { + position: relative; +} + +.image-container img { + position: absolute; + left: 0; + top: 0; + transition: opacity 0.5s ease; /* Optional: adds a fade effect */ +} + +.image-container .hover-image { + opacity: 0; +} + +.image-container:hover .hover-image { + opacity: 1; +} + +.image-container:hover .base-image { + opacity: 0; } \ No newline at end of file diff --git a/src/utils/decryptWallet.ts b/src/utils/decryptWallet.ts index 1d0b334..21490aa 100644 --- a/src/utils/decryptWallet.ts +++ b/src/utils/decryptWallet.ts @@ -13,11 +13,9 @@ export const decryptStoredWallet = async (password, wallet) => { const salt = Base58.decode(wallet.salt) const key = await kdf(password, salt, threads) - console.log('key2', key) const encryptionKey = key.slice(0, 32) const macKey = key.slice(32, 63) const mac = new HmacSha512(macKey).process(encryptedSeedBytes).finish().result - console.log(Base58.encode(mac), wallet.mac) if (Base58.encode(mac) !== wallet.mac) { throw new Error("Incorrect password") } diff --git a/src/utils/generateWallet/generateWallet.ts b/src/utils/generateWallet/generateWallet.ts index e10fecf..4aa4d78 100644 --- a/src/utils/generateWallet/generateWallet.ts +++ b/src/utils/generateWallet/generateWallet.ts @@ -85,7 +85,6 @@ export const createAccount = async()=> { export const saveFileToDisk= async(data, qortAddress) => { try { - console.log({data, qortAddress}) const dataString = JSON.stringify(data) const blob = new Blob([dataString], { type: 'text/plain;charset=utf-8' }) const fileName = "qortal_backup_" + qortAddress + ".json" diff --git a/src/utils/generateWallet/storeWallet.ts b/src/utils/generateWallet/storeWallet.ts index 77431c5..83222ae 100644 --- a/src/utils/generateWallet/storeWallet.ts +++ b/src/utils/generateWallet/storeWallet.ts @@ -7,7 +7,6 @@ import { doInitWorkers, kdf } from '../../deps/kdf.js' import { crypto as cryptoVals } from '../../constants/decryptWallet.js' const getRandomValues = crypto ? crypto.getRandomValues.bind(crypto) : msCrypto.getRandomValues.bind(msCrypto) -console.log({getRandomValues}) export const generateSaveWalletData = async (wallet, password, kdfThreads) => { const threads = doInitWorkers(cryptoVals.kdfThreads) diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 7dd1057..49912ae 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -22,7 +22,6 @@ const utils = { appendBuffer (buffer1, buffer2) { buffer1 = new Uint8Array(buffer1) buffer2 = new Uint8Array(buffer2) - console.log('buffer1.byteLength ', buffer1.byteLength , buffer2.byteLength) const tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength) tmp.set(buffer1, 0) tmp.set(buffer2, buffer1.byteLength)