@retinalabsllc/zairusjs 11.0.15 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +65 -34
- package/dist/index.mjs +65 -34
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -792,7 +792,7 @@ var Banner = ({
|
|
|
792
792
|
};
|
|
793
793
|
const currentConfig = config[type];
|
|
794
794
|
const IconToUse = icon || currentConfig.defaultIcon;
|
|
795
|
-
return /* @__PURE__ */ import_react13.default.createElement("div", { className: `relative w-full rounded-2xl p-4 flex items-start gap-4 transition-all duration-300 animate-in fade-in slide-in-from-top-2 ${currentConfig.bg}` }, /* @__PURE__ */ import_react13.default.createElement("div", { className: "flex-1 flex flex-col min-w-0" }, /* @__PURE__ */ import_react13.default.createElement("h4", { className: `text-
|
|
795
|
+
return /* @__PURE__ */ import_react13.default.createElement("div", { className: `relative w-full rounded-2xl p-4 flex items-start gap-4 transition-all duration-300 animate-in fade-in slide-in-from-top-2 ${currentConfig.bg}` }, /* @__PURE__ */ import_react13.default.createElement("div", { className: "flex-1 flex flex-col min-w-0" }, /* @__PURE__ */ import_react13.default.createElement("h4", { className: `text-xs tracking-tight mb-1 ${currentConfig.titleColor}` }, title), /* @__PURE__ */ import_react13.default.createElement("p", { className: `text-xs leading-relaxed ${currentConfig.msgColor}` }, message), action && /* @__PURE__ */ import_react13.default.createElement("div", { className: "mt-3" }, action)), isDismissible && /* @__PURE__ */ import_react13.default.createElement(
|
|
796
796
|
"button",
|
|
797
797
|
{
|
|
798
798
|
onClick: handleDismiss,
|
|
@@ -1601,7 +1601,7 @@ var UniversalWalletPage = ({
|
|
|
1601
1601
|
const [hasBackedUp, setHasBackedUp] = (0, import_react27.useState)(false);
|
|
1602
1602
|
const [verifyWords, setVerifyWords] = (0, import_react27.useState)([]);
|
|
1603
1603
|
const [walletPassword, setWalletPassword] = (0, import_react27.useState)("");
|
|
1604
|
-
const [
|
|
1604
|
+
const [importWords, setImportWords] = (0, import_react27.useState)(Array(24).fill(""));
|
|
1605
1605
|
const [isProcessing, setIsProcessing] = (0, import_react27.useState)(false);
|
|
1606
1606
|
const filteredWallets = wallets.filter((wallet) => {
|
|
1607
1607
|
const q = localSearchQuery.toLowerCase();
|
|
@@ -1630,61 +1630,66 @@ CRITICAL WARNING: Keep this phrase completely secure. Anyone who has access to t
|
|
|
1630
1630
|
import_react_hot_toast6.default.success("Phrase downloaded.");
|
|
1631
1631
|
};
|
|
1632
1632
|
const startWalletGeneration = () => {
|
|
1633
|
-
if (onGeneratePhrase) {
|
|
1634
|
-
const phrase = onGeneratePhrase();
|
|
1635
|
-
setGeneratedPhrase(phrase);
|
|
1636
|
-
setVerifyWords(Array(phrase.split(" ").length).fill(""));
|
|
1637
|
-
}
|
|
1638
|
-
setHasBackedUp(false);
|
|
1639
|
-
setWalletPassword("");
|
|
1640
1633
|
setFlowStep(1);
|
|
1641
1634
|
setAddModalOpen(true);
|
|
1642
1635
|
};
|
|
1643
|
-
const handleGridPaste = async () => {
|
|
1644
|
-
try {
|
|
1645
|
-
const text = await navigator.clipboard.readText();
|
|
1646
|
-
const pastedWords = text.trim().split(/\s+/);
|
|
1647
|
-
if (pastedWords.length > 0) {
|
|
1648
|
-
const newWords = [...verifyWords];
|
|
1649
|
-
for (let i = 0; i < pastedWords.length && i < newWords.length; i++) {
|
|
1650
|
-
newWords[i] = pastedWords[i].toLowerCase();
|
|
1651
|
-
}
|
|
1652
|
-
setVerifyWords(newWords);
|
|
1653
|
-
import_react_hot_toast6.default.success("Phrase auto-filled.");
|
|
1654
|
-
}
|
|
1655
|
-
} catch (err) {
|
|
1656
|
-
import_react_hot_toast6.default.error("Clipboard access denied. Please allow clipboard access or type manually.");
|
|
1657
|
-
}
|
|
1658
|
-
};
|
|
1659
1636
|
const handleCreationNext = () => {
|
|
1660
1637
|
if (flowStep === 1) {
|
|
1661
|
-
if (
|
|
1638
|
+
if (onGeneratePhrase) {
|
|
1639
|
+
const phrase = onGeneratePhrase();
|
|
1640
|
+
setGeneratedPhrase(phrase);
|
|
1641
|
+
setVerifyWords(Array(phrase.split(" ").length).fill(""));
|
|
1642
|
+
}
|
|
1643
|
+
setHasBackedUp(false);
|
|
1644
|
+
setWalletPassword("");
|
|
1662
1645
|
setFlowStep(2);
|
|
1663
1646
|
} else if (flowStep === 2) {
|
|
1647
|
+
if (!hasBackedUp) return import_react_hot_toast6.default.error("Please confirm you have backed up the phrase.");
|
|
1648
|
+
setFlowStep(3);
|
|
1649
|
+
} else if (flowStep === 3) {
|
|
1664
1650
|
const reconstructed = verifyWords.map((w) => w.trim()).join(" ");
|
|
1665
1651
|
if (reconstructed !== generatedPhrase.trim()) {
|
|
1666
1652
|
return import_react_hot_toast6.default.error("Phrase verification failed. Ensure words are in the correct order.");
|
|
1667
1653
|
}
|
|
1668
|
-
setFlowStep(
|
|
1654
|
+
setFlowStep(4);
|
|
1669
1655
|
}
|
|
1670
1656
|
};
|
|
1671
1657
|
const startWalletImport = () => {
|
|
1672
|
-
|
|
1658
|
+
setImportWords(Array(24).fill(""));
|
|
1673
1659
|
setWalletPassword("");
|
|
1674
1660
|
setFlowStep(1);
|
|
1675
1661
|
setImportModalOpen(true);
|
|
1676
1662
|
};
|
|
1663
|
+
const handleGridPaste = async (targetStateSetter, currentWords) => {
|
|
1664
|
+
try {
|
|
1665
|
+
const text = await navigator.clipboard.readText();
|
|
1666
|
+
const pastedWords = text.trim().split(/\s+/);
|
|
1667
|
+
if (pastedWords.length > 0) {
|
|
1668
|
+
const newLength = Math.max(pastedWords.length, 12);
|
|
1669
|
+
const newWords = Array(newLength).fill("");
|
|
1670
|
+
for (let i = 0; i < pastedWords.length && i < newWords.length; i++) {
|
|
1671
|
+
newWords[i] = pastedWords[i].toLowerCase();
|
|
1672
|
+
}
|
|
1673
|
+
targetStateSetter(newWords);
|
|
1674
|
+
import_react_hot_toast6.default.success("Phrase auto-filled.");
|
|
1675
|
+
}
|
|
1676
|
+
} catch (err) {
|
|
1677
|
+
import_react_hot_toast6.default.error("Clipboard access denied. Please allow clipboard access or type manually.");
|
|
1678
|
+
}
|
|
1679
|
+
};
|
|
1677
1680
|
const handleImportNext = () => {
|
|
1678
|
-
|
|
1679
|
-
if (
|
|
1680
|
-
|
|
1681
|
+
const reconstructed = importWords.filter((w) => w.trim() !== "").map((w) => w.trim()).join(" ");
|
|
1682
|
+
if (!reconstructed) return import_react_hot_toast6.default.error("Please enter your phrase.");
|
|
1683
|
+
if (onValidatePhrase && !onValidatePhrase(reconstructed)) {
|
|
1684
|
+
return import_react_hot_toast6.default.error("Invalid recovery phrase. Please check your spelling and word order.");
|
|
1681
1685
|
}
|
|
1682
1686
|
setFlowStep(2);
|
|
1683
1687
|
};
|
|
1684
|
-
const handleSaveWallet = async (
|
|
1688
|
+
const handleSaveWallet = async (phraseSource) => {
|
|
1685
1689
|
if (!walletPassword || walletPassword.length < 6) return import_react_hot_toast6.default.error("Password must be at least 6 characters.");
|
|
1686
1690
|
setIsProcessing(true);
|
|
1687
1691
|
try {
|
|
1692
|
+
const phrase = phraseSource === "generated" ? generatedPhrase : importWords.filter((w) => w.trim() !== "").join(" ");
|
|
1688
1693
|
if (onSaveLocally) {
|
|
1689
1694
|
const res = await onSaveLocally(phrase, walletPassword);
|
|
1690
1695
|
if (res.success) {
|
|
@@ -1708,7 +1713,7 @@ CRITICAL WARNING: Keep this phrase completely secure. Anyone who has access to t
|
|
|
1708
1713
|
onChange: (e) => setLocalSearchQuery(e.target.value),
|
|
1709
1714
|
className: "w-full pl-10 pr-4 py-2 bg-white rounded-full text-[13px] text-black placeholder-neutral-400 outline-none transition-colors focus:border-black"
|
|
1710
1715
|
}
|
|
1711
|
-
)), /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex items-center gap-3 w-auto pb-0 shrink-0" }, /* @__PURE__ */ import_react27.default.createElement("button", { onClick: startWalletGeneration, className: "flex items-center justify-center bg-white w-9 h-9 rounded-full text-neutral-500 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ import_react27.default.createElement(import_react28.HugeiconsIcon, { icon: import_core_free_icons9.PlusSignIcon, size: 16 })), /* @__PURE__ */ import_react27.default.createElement("button", { onClick: startWalletImport, className: "flex items-center justify-center bg-white w-9 h-9 rounded-full text-neutral-500 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ import_react27.default.createElement(import_react28.HugeiconsIcon, { icon: import_core_free_icons9.Upload01Icon, size: 16 })))), /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex flex-col gap-8 p-6 rounded-2xl bg-white w-full" }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex flex-col sm:flex-row sm:items-start justify-between gap-4" }, /* @__PURE__ */ import_react27.default.createElement("div", null, /* @__PURE__ */ import_react27.default.createElement("h1", { className: "text-black text-xl mb-1 tracking-tight" }, headerTitle), headerDescription && /* @__PURE__ */ import_react27.default.createElement("p", { className: "text-xs text-neutral-500" }, headerDescription))), /* @__PURE__ */ import_react27.default.createElement("div", { className: "w-full overflow-hidden" }, isLoading ? /* @__PURE__ */ import_react27.default.createElement(PageSpinner3, null) : /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ import_react27.default.createElement("div", null, filteredWallets.length === 0 ? /* @__PURE__ */ import_react27.default.createElement("p", { className: "text-xs text-neutral-400 py-6 text-center" }, "No wallets found") : filteredWallets.map((wallet) => /* @__PURE__ */ import_react27.default.createElement("div", { key: wallet.id, onClick: () => setSelectedWallet(wallet), className: "flex items-center justify-between py-4 hover:bg-neutral-50 transition-colors cursor-pointer group min-w-0 px-3 -mx-3 rounded-xl" }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex items-center gap-4 min-w-0 flex-1" }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "relative shrink-0" }, /* @__PURE__ */ import_react27.default.createElement(WalletLogo, { src: wallet.logoSrc, alt: wallet.name }), wallet.networkLogoSrc && /* @__PURE__ */ import_react27.default.createElement("div", { className: "absolute -bottom-1 -right-1 w-4 h-4 rounded-full border border-white bg-white overflow-hidden shadow-sm" }, /* @__PURE__ */ import_react27.default.createElement("img", { src: wallet.networkLogoSrc, alt: "Network", className: "w-full h-full object-cover" }))), /* @__PURE__ */ import_react27.default.createElement("div", { className: "min-w-0 flex-1 flex flex-col gap-1" }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ import_react27.default.createElement("p", { className: "text-[13px] text-black truncate" }, wallet.name), wallet.isActive !== void 0 && /* @__PURE__ */ import_react27.default.createElement("span", { className: `text-[9px] px-1.5 py-0.5 rounded-sm tracking-widest uppercase ${wallet.isActive ? "bg-emerald-50 text-emerald-600" : "bg-red-50 text-red-600"}` }, wallet.isActive ? "Active" : "Inactive")), /* @__PURE__ */ import_react27.default.createElement("p", { className: `text-[13px] text-neutral-500 truncate transition-all duration-300 ${hideBalanceAmounts ? "blur-sm opacity-40 select-none" : ""}` }, wallet.balance, " ", wallet.currency))), /* @__PURE__ */ import_react27.default.createElement("div", { className: "shrink-0 flex flex-col items-end gap-1 text-right" }, /* @__PURE__ */ import_react27.default.createElement("span", { className: "text-[10px] tracking-wide text-neutral-600 bg-neutral-100 px-2.5 py-1 rounded-full " }, wallet.network)))))))), addModalOpen && /* @__PURE__ */ import_react27.default.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "absolute inset-0 bg-black/40 ", onClick: () => !isProcessing && setAddModalOpen(false) }), /* @__PURE__ */ import_react27.default.createElement("div", { className: "relative w-full max-w-md bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, /* @__PURE__ */ import_react27.default.createElement("h3", { className: "text-[15px] text-black tracking-tight" }, flowStep === 1 ? "Secret Recovery Phrase" : flowStep ===
|
|
1716
|
+
)), /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex items-center gap-3 w-auto pb-0 shrink-0" }, /* @__PURE__ */ import_react27.default.createElement("button", { onClick: startWalletGeneration, className: "flex items-center justify-center bg-white w-9 h-9 rounded-full text-neutral-500 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ import_react27.default.createElement(import_react28.HugeiconsIcon, { icon: import_core_free_icons9.PlusSignIcon, size: 16 })), /* @__PURE__ */ import_react27.default.createElement("button", { onClick: startWalletImport, className: "flex items-center justify-center bg-white w-9 h-9 rounded-full text-neutral-500 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ import_react27.default.createElement(import_react28.HugeiconsIcon, { icon: import_core_free_icons9.Upload01Icon, size: 16 })))), /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex flex-col gap-8 p-6 rounded-2xl bg-white w-full" }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex flex-col sm:flex-row sm:items-start justify-between gap-4" }, /* @__PURE__ */ import_react27.default.createElement("div", null, /* @__PURE__ */ import_react27.default.createElement("h1", { className: "text-black text-xl mb-1 tracking-tight" }, headerTitle), headerDescription && /* @__PURE__ */ import_react27.default.createElement("p", { className: "text-xs text-neutral-500" }, headerDescription))), /* @__PURE__ */ import_react27.default.createElement("div", { className: "w-full overflow-hidden" }, isLoading ? /* @__PURE__ */ import_react27.default.createElement(PageSpinner3, null) : /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ import_react27.default.createElement("div", null, filteredWallets.length === 0 ? /* @__PURE__ */ import_react27.default.createElement("p", { className: "text-xs text-neutral-400 py-6 text-center" }, "No wallets found") : filteredWallets.map((wallet) => /* @__PURE__ */ import_react27.default.createElement("div", { key: wallet.id, onClick: () => setSelectedWallet(wallet), className: "flex items-center justify-between py-4 hover:bg-neutral-50 transition-colors cursor-pointer group min-w-0 px-3 -mx-3 rounded-xl" }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex items-center gap-4 min-w-0 flex-1" }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "relative shrink-0" }, /* @__PURE__ */ import_react27.default.createElement(WalletLogo, { src: wallet.logoSrc, alt: wallet.name }), wallet.networkLogoSrc && /* @__PURE__ */ import_react27.default.createElement("div", { className: "absolute -bottom-1 -right-1 w-4 h-4 rounded-full border border-white bg-white overflow-hidden shadow-sm" }, /* @__PURE__ */ import_react27.default.createElement("img", { src: wallet.networkLogoSrc, alt: "Network", className: "w-full h-full object-cover" }))), /* @__PURE__ */ import_react27.default.createElement("div", { className: "min-w-0 flex-1 flex flex-col gap-1" }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ import_react27.default.createElement("p", { className: "text-[13px] text-black truncate" }, wallet.name), wallet.isActive !== void 0 && /* @__PURE__ */ import_react27.default.createElement("span", { className: `text-[9px] px-1.5 py-0.5 rounded-sm tracking-widest uppercase ${wallet.isActive ? "bg-emerald-50 text-emerald-600" : "bg-red-50 text-red-600"}` }, wallet.isActive ? "Active" : "Inactive")), /* @__PURE__ */ import_react27.default.createElement("p", { className: `text-[13px] text-neutral-500 truncate transition-all duration-300 ${hideBalanceAmounts ? "blur-sm opacity-40 select-none" : ""}` }, wallet.balance, " ", wallet.currency))), /* @__PURE__ */ import_react27.default.createElement("div", { className: "shrink-0 flex flex-col items-end gap-1 text-right" }, /* @__PURE__ */ import_react27.default.createElement("span", { className: "text-[10px] tracking-wide text-neutral-600 bg-neutral-100 px-2.5 py-1 rounded-full " }, wallet.network)))))))), addModalOpen && /* @__PURE__ */ import_react27.default.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "absolute inset-0 bg-black/40 ", onClick: () => !isProcessing && setAddModalOpen(false) }), /* @__PURE__ */ import_react27.default.createElement("div", { className: "relative w-full max-w-md bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, /* @__PURE__ */ import_react27.default.createElement("h3", { className: "text-[15px] text-black tracking-tight" }, flowStep === 1 ? "Important Notice" : flowStep === 2 ? "Secret Recovery Phrase" : flowStep === 3 ? "Verify Phrase" : "Secure Wallet"), /* @__PURE__ */ import_react27.default.createElement("button", { onClick: () => !isProcessing && setAddModalOpen(false), className: "text-neutral-400 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ import_react27.default.createElement(import_react28.HugeiconsIcon, { icon: import_core_free_icons9.CancelCircleIcon, size: 18 }))), /* @__PURE__ */ import_react27.default.createElement("div", { className: "p-6" }, flowStep === 1 && /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex flex-col gap-6 animate-in fade-in" }, /* @__PURE__ */ import_react27.default.createElement(Banner, { type: "alert", title: "Critical Warning", message: "You are about to generate a Self-Custodial Recovery Phrase. This phrase is the absolute master key to your wallet and all assets within it. Aeona DOES NOT store this phrase. If you lose it, your funds are permanently lost. Do not share this phrase with anyone.", isDismissible: false }), /* @__PURE__ */ import_react27.default.createElement(ThreeDActionButton, { onClick: handleCreationNext, className: "w-full mt-2" }, "I Understand, Generate Phrase")), flowStep === 2 && /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex flex-col gap-6 animate-in fade-in slide-in-from-right-4" }, /* @__PURE__ */ import_react27.default.createElement("p", { className: "text-sm text-neutral-600" }, "Please write down these words in the exact order shown. Store them in a secure, offline location."), /* @__PURE__ */ import_react27.default.createElement("div", { className: "grid grid-cols-3 gap-2 max-h-48 overflow-y-auto custom-scrollbar pr-1" }, generatedPhrase.split(" ").map((word, idx) => /* @__PURE__ */ import_react27.default.createElement("div", { key: idx, className: "flex items-center gap-1.5 bg-neutral-50 rounded-lg p-2 selection:bg-neutral-200" }, /* @__PURE__ */ import_react27.default.createElement("span", { className: "text-[10px] text-neutral-400 font-mono select-none w-4 text-right shrink-0" }, idx + 1, "."), /* @__PURE__ */ import_react27.default.createElement("span", { className: "text-[13px] text-black font-medium" }, word)))), /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex items-center justify-between gap-2 0 pt-4" }, /* @__PURE__ */ import_react27.default.createElement("button", { onClick: () => handleCopy(generatedPhrase, false), className: "text-xs text-black flex items-center gap-1.5 hover:underline outline-none" }, /* @__PURE__ */ import_react27.default.createElement(import_react28.HugeiconsIcon, { icon: import_core_free_icons9.Copy01Icon, size: 14 }), " Copy Phrase"), /* @__PURE__ */ import_react27.default.createElement("button", { onClick: handleDownloadTxt, className: "text-xs text-black flex items-center gap-1.5 hover:underline outline-none" }, /* @__PURE__ */ import_react27.default.createElement(import_react28.HugeiconsIcon, { icon: import_core_free_icons9.Download01Icon, size: 14 }), " Download .txt")), /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex items-start gap-3 p-3 rounded-xl border border-neutral-200 mt-2" }, /* @__PURE__ */ import_react27.default.createElement("input", { type: "checkbox", id: "backup-confirm", checked: hasBackedUp, onChange: (e) => setHasBackedUp(e.target.checked), className: "mt-0.5 w-4 h-4 bg-white border-neutral-300 rounded text-black focus:ring-black cursor-pointer shrink-0" }), /* @__PURE__ */ import_react27.default.createElement("label", { htmlFor: "backup-confirm", className: "text-xs text-neutral-600 cursor-pointer leading-relaxed" }, "I have securely copied and stored my recovery phrase. I understand that if I lose it, my funds are gone forever.")), /* @__PURE__ */ import_react27.default.createElement(ThreeDActionButton, { onClick: handleCreationNext, className: "w-full mt-2" }, "Continue")), flowStep === 3 && /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex flex-col gap-6 animate-in fade-in slide-in-from-right-4" }, /* @__PURE__ */ import_react27.default.createElement("p", { className: "text-sm text-neutral-600" }, "Please enter or paste your recovery phrase below to verify your backup."), /* @__PURE__ */ import_react27.default.createElement("div", { className: "grid grid-cols-3 gap-2 max-h-56 overflow-y-auto custom-scrollbar pr-1 pb-1" }, verifyWords.map((word, idx) => /* @__PURE__ */ import_react27.default.createElement("div", { key: idx, className: "flex items-center gap-1 bg-white border border-neutral-200 focus-within:border-black rounded-lg p-1.5 transition-colors" }, /* @__PURE__ */ import_react27.default.createElement("span", { className: "text-[10px] text-neutral-400 font-mono w-4 shrink-0 text-right select-none" }, idx + 1, "."), /* @__PURE__ */ import_react27.default.createElement(
|
|
1712
1717
|
"input",
|
|
1713
1718
|
{
|
|
1714
1719
|
type: "text",
|
|
@@ -1733,7 +1738,33 @@ CRITICAL WARNING: Keep this phrase completely secure. Anyone who has access to t
|
|
|
1733
1738
|
},
|
|
1734
1739
|
className: "w-full bg-transparent text-[13px] text-black outline-none min-w-0"
|
|
1735
1740
|
}
|
|
1736
|
-
)))), /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex items-center justify-between pt-4" }, /* @__PURE__ */ import_react27.default.createElement("button", { onClick: handleGridPaste, className: "text-xs text-black flex items-center gap-1.5 hover:underline outline-none" }, /* @__PURE__ */ import_react27.default.createElement(import_react28.HugeiconsIcon, { icon: import_core_free_icons9.ClipboardIcon, size: 14 }), " Paste Phrase")), /* @__PURE__ */ import_react27.default.createElement(ThreeDActionButton, { onClick: handleCreationNext, className: "w-full mt-2" }, "Verify Backup")), flowStep ===
|
|
1741
|
+
)))), /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex items-center justify-between pt-4" }, /* @__PURE__ */ import_react27.default.createElement("button", { onClick: () => handleGridPaste(setVerifyWords, verifyWords), className: "text-xs text-black flex items-center gap-1.5 hover:underline outline-none" }, /* @__PURE__ */ import_react27.default.createElement(import_react28.HugeiconsIcon, { icon: import_core_free_icons9.ClipboardIcon, size: 14 }), " Paste Phrase")), /* @__PURE__ */ import_react27.default.createElement(ThreeDActionButton, { onClick: handleCreationNext, className: "w-full mt-2" }, "Verify Backup")), flowStep === 4 && /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex flex-col gap-6 animate-in fade-in slide-in-from-right-4" }, /* @__PURE__ */ import_react27.default.createElement(Banner, { type: "success", title: "Phrase Verified", message: "Your phrase is correct. Now set a local password to encrypt your wallet on this browser.", isDismissible: false }), /* @__PURE__ */ import_react27.default.createElement(TextInput, { label: "Local Password", type: "password", value: walletPassword, onChange: setWalletPassword, placeholder: "Enter a strong password" }), /* @__PURE__ */ import_react27.default.createElement(ThreeDActionButton, { onClick: () => handleSaveWallet("generated"), isLoading: isProcessing, className: "w-full mt-2" }, "Encrypt & Save Wallet"))))), importModalOpen && /* @__PURE__ */ import_react27.default.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "absolute inset-0 bg-black/40 ", onClick: () => !isProcessing && setImportModalOpen(false) }), /* @__PURE__ */ import_react27.default.createElement("div", { className: "relative w-full max-w-md bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex items-center justify-between p-5 shrink-0 " }, /* @__PURE__ */ import_react27.default.createElement("h3", { className: "text-[15px] text-black tracking-tight" }, "Import Wallet"), /* @__PURE__ */ import_react27.default.createElement("button", { onClick: () => !isProcessing && setImportModalOpen(false), className: "text-neutral-400 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ import_react27.default.createElement(import_react28.HugeiconsIcon, { icon: import_core_free_icons9.CancelCircleIcon, size: 18 }))), /* @__PURE__ */ import_react27.default.createElement("div", { className: "p-6" }, flowStep === 1 && /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex flex-col gap-6 animate-in fade-in" }, /* @__PURE__ */ import_react27.default.createElement("p", { className: "text-sm text-neutral-600" }, "Enter your 12 or 24-word recovery phrase to restore your wallet on this device."), /* @__PURE__ */ import_react27.default.createElement("div", { className: "grid grid-cols-3 gap-2 max-h-56 overflow-y-auto custom-scrollbar pr-1 pb-1" }, importWords.map((word, idx) => /* @__PURE__ */ import_react27.default.createElement("div", { key: idx, className: "flex items-center gap-1 bg-white border border-neutral-200 focus-within:border-black rounded-lg p-1.5 transition-colors" }, /* @__PURE__ */ import_react27.default.createElement("span", { className: "text-[10px] text-neutral-400 font-mono w-4 shrink-0 text-right select-none" }, idx + 1, "."), /* @__PURE__ */ import_react27.default.createElement(
|
|
1742
|
+
"input",
|
|
1743
|
+
{
|
|
1744
|
+
type: "text",
|
|
1745
|
+
value: word,
|
|
1746
|
+
onChange: (e) => {
|
|
1747
|
+
const newWords = [...importWords];
|
|
1748
|
+
newWords[idx] = e.target.value.trim().toLowerCase();
|
|
1749
|
+
setImportWords(newWords);
|
|
1750
|
+
},
|
|
1751
|
+
onPaste: (e) => {
|
|
1752
|
+
const pastedData = e.clipboardData.getData("text").trim();
|
|
1753
|
+
const pastedWords = pastedData.split(/\s+/);
|
|
1754
|
+
if (pastedWords.length > 1) {
|
|
1755
|
+
e.preventDefault();
|
|
1756
|
+
const newLength = Math.max(pastedWords.length, 12);
|
|
1757
|
+
const newWords = Array(newLength).fill("");
|
|
1758
|
+
for (let i = 0; i < pastedWords.length && i < newWords.length; i++) {
|
|
1759
|
+
newWords[i] = pastedWords[i].toLowerCase();
|
|
1760
|
+
}
|
|
1761
|
+
setImportWords(newWords);
|
|
1762
|
+
import_react_hot_toast6.default.success("Phrase auto-filled.");
|
|
1763
|
+
}
|
|
1764
|
+
},
|
|
1765
|
+
className: "w-full bg-transparent text-[13px] text-black outline-none min-w-0"
|
|
1766
|
+
}
|
|
1767
|
+
)))), /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex items-center justify-between pt-4" }, /* @__PURE__ */ import_react27.default.createElement("button", { onClick: () => handleGridPaste(setImportWords, importWords), className: "text-xs text-black flex items-center gap-1.5 hover:underline outline-none" }, /* @__PURE__ */ import_react27.default.createElement(import_react28.HugeiconsIcon, { icon: import_core_free_icons9.ClipboardIcon, size: 14 }), " Paste Phrase")), /* @__PURE__ */ import_react27.default.createElement(ThreeDActionButton, { onClick: handleImportNext, className: "w-full mt-2" }, "Continue")), flowStep === 2 && /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex flex-col gap-6 animate-in fade-in slide-in-from-right-4" }, /* @__PURE__ */ import_react27.default.createElement("p", { className: "text-sm text-neutral-600" }, "Set a local password to encrypt this wallet on this specific browser."), /* @__PURE__ */ import_react27.default.createElement(TextInput, { label: "Local Password", type: "password", value: walletPassword, onChange: setWalletPassword, placeholder: "Enter a strong password" }), /* @__PURE__ */ import_react27.default.createElement(ThreeDActionButton, { onClick: () => handleSaveWallet("imported"), isLoading: isProcessing, className: "w-full mt-2" }, "Encrypt & Import Wallet"))))), selectedWallet && /* @__PURE__ */ import_react27.default.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "absolute inset-0 bg-black/40 ", onClick: () => setSelectedWallet(null) }), /* @__PURE__ */ import_react27.default.createElement("div", { className: "relative w-full max-w-sm bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 max-h-[90vh]" }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex items-center justify-between p-5 shrink-0 " }, /* @__PURE__ */ import_react27.default.createElement("h3", { className: "text-[15px] text-black tracking-tight" }, "Wallet Details"), /* @__PURE__ */ import_react27.default.createElement("button", { onClick: () => setSelectedWallet(null), className: "text-neutral-400 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ import_react27.default.createElement(import_react28.HugeiconsIcon, { icon: import_core_free_icons9.CancelCircleIcon, size: 18 }))), /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-6 pt-6" }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex flex-col items-center justify-center mb-6" }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "relative mb-4" }, /* @__PURE__ */ import_react27.default.createElement(WalletLogo, { src: selectedWallet.logoSrc, alt: selectedWallet.name, sizeClass: "w-14 h-14" }), selectedWallet.networkLogoSrc && /* @__PURE__ */ import_react27.default.createElement("div", { className: "absolute -bottom-1 -right-1 w-5 h-5 rounded-full border border-white bg-white overflow-hidden shadow-sm" }, /* @__PURE__ */ import_react27.default.createElement("img", { src: selectedWallet.networkLogoSrc, alt: "Network", className: "w-full h-full object-cover" }))), /* @__PURE__ */ import_react27.default.createElement("h2", { className: `text-2xl text-black mb-2 transition-all duration-300 ${hideBalanceAmounts ? "blur-[6px] opacity-40 select-none" : ""}` }, selectedWallet.balance, " ", selectedWallet.currency), /* @__PURE__ */ import_react27.default.createElement("span", { className: "text-[9px] tracking-widest text-neutral-500 px-4 py-1.5 rounded-full border border-neutral-200 mt-1 " }, selectedWallet.network, " NETWORK")), renderQrCode && /* @__PURE__ */ import_react27.default.createElement("div", { className: "w-full flex justify-center mb-6 mix-blend-multiply" }, renderQrCode(selectedWallet)), /* @__PURE__ */ import_react27.default.createElement("div", { className: "grid grid-cols-1 gap-y-6 gap-x-4 mb-10" }, /* @__PURE__ */ import_react27.default.createElement("div", null, /* @__PURE__ */ import_react27.default.createElement("span", { className: "text-[11px] tracking-[0.2em] text-neutral-400 block mb-2" }, "Wallet Address"), /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex items-center gap-2 min-w-0" }, /* @__PURE__ */ import_react27.default.createElement("span", { className: "text-[13px] text-black truncate min-w-0 block" }, truncateAddress2(selectedWallet.address)), /* @__PURE__ */ import_react27.default.createElement("button", { onClick: () => handleCopy(selectedWallet.address, true), className: "text-neutral-400 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ import_react27.default.createElement(import_react28.HugeiconsIcon, { icon: import_core_free_icons9.Copy01Icon, size: 14 })))), /* @__PURE__ */ import_react27.default.createElement("div", null, /* @__PURE__ */ import_react27.default.createElement("span", { className: "text-[11px] tracking-[0.2em] text-neutral-400 block mb-2" }, "Wallet Status"), selectedWallet.isActive ? /* @__PURE__ */ import_react27.default.createElement("span", { className: "text-[13px] text-emerald-600 font-medium" }, "Active on this device") : /* @__PURE__ */ import_react27.default.createElement("span", { className: "text-[13px] text-red-600 font-medium" }, "Inactive - Requires Import"))), /* @__PURE__ */ import_react27.default.createElement("div", { className: "flex flex-col gap-3" }, /* @__PURE__ */ import_react27.default.createElement(ThreeDActionButton, { onClick: () => onDownloadPayId && onDownloadPayId(selectedWallet), isLoading: isGeneratingStatement, className: "w-full" }, "Generate Statement"), /* @__PURE__ */ import_react27.default.createElement("button", { onClick: () => handleCopy(selectedWallet.address, true), className: "w-full flex items-center justify-center py-2.5 rounded-full border border-neutral-200 text-black hover:bg-neutral-50 outline-none text-xs tracking-wide transition-colors" }, "Copy Wallet Address")))))));
|
|
1737
1768
|
};
|
|
1738
1769
|
|
|
1739
1770
|
// src/components/UniversalCardPage.tsx
|
package/dist/index.mjs
CHANGED
|
@@ -725,7 +725,7 @@ var Banner = ({
|
|
|
725
725
|
};
|
|
726
726
|
const currentConfig = config[type];
|
|
727
727
|
const IconToUse = icon || currentConfig.defaultIcon;
|
|
728
|
-
return /* @__PURE__ */ React10.createElement("div", { className: `relative w-full rounded-2xl p-4 flex items-start gap-4 transition-all duration-300 animate-in fade-in slide-in-from-top-2 ${currentConfig.bg}` }, /* @__PURE__ */ React10.createElement("div", { className: "flex-1 flex flex-col min-w-0" }, /* @__PURE__ */ React10.createElement("h4", { className: `text-
|
|
728
|
+
return /* @__PURE__ */ React10.createElement("div", { className: `relative w-full rounded-2xl p-4 flex items-start gap-4 transition-all duration-300 animate-in fade-in slide-in-from-top-2 ${currentConfig.bg}` }, /* @__PURE__ */ React10.createElement("div", { className: "flex-1 flex flex-col min-w-0" }, /* @__PURE__ */ React10.createElement("h4", { className: `text-xs tracking-tight mb-1 ${currentConfig.titleColor}` }, title), /* @__PURE__ */ React10.createElement("p", { className: `text-xs leading-relaxed ${currentConfig.msgColor}` }, message), action && /* @__PURE__ */ React10.createElement("div", { className: "mt-3" }, action)), isDismissible && /* @__PURE__ */ React10.createElement(
|
|
729
729
|
"button",
|
|
730
730
|
{
|
|
731
731
|
onClick: handleDismiss,
|
|
@@ -1564,7 +1564,7 @@ var UniversalWalletPage = ({
|
|
|
1564
1564
|
const [hasBackedUp, setHasBackedUp] = useState10(false);
|
|
1565
1565
|
const [verifyWords, setVerifyWords] = useState10([]);
|
|
1566
1566
|
const [walletPassword, setWalletPassword] = useState10("");
|
|
1567
|
-
const [
|
|
1567
|
+
const [importWords, setImportWords] = useState10(Array(24).fill(""));
|
|
1568
1568
|
const [isProcessing, setIsProcessing] = useState10(false);
|
|
1569
1569
|
const filteredWallets = wallets.filter((wallet) => {
|
|
1570
1570
|
const q = localSearchQuery.toLowerCase();
|
|
@@ -1593,61 +1593,66 @@ CRITICAL WARNING: Keep this phrase completely secure. Anyone who has access to t
|
|
|
1593
1593
|
toast5.success("Phrase downloaded.");
|
|
1594
1594
|
};
|
|
1595
1595
|
const startWalletGeneration = () => {
|
|
1596
|
-
if (onGeneratePhrase) {
|
|
1597
|
-
const phrase = onGeneratePhrase();
|
|
1598
|
-
setGeneratedPhrase(phrase);
|
|
1599
|
-
setVerifyWords(Array(phrase.split(" ").length).fill(""));
|
|
1600
|
-
}
|
|
1601
|
-
setHasBackedUp(false);
|
|
1602
|
-
setWalletPassword("");
|
|
1603
1596
|
setFlowStep(1);
|
|
1604
1597
|
setAddModalOpen(true);
|
|
1605
1598
|
};
|
|
1606
|
-
const handleGridPaste = async () => {
|
|
1607
|
-
try {
|
|
1608
|
-
const text = await navigator.clipboard.readText();
|
|
1609
|
-
const pastedWords = text.trim().split(/\s+/);
|
|
1610
|
-
if (pastedWords.length > 0) {
|
|
1611
|
-
const newWords = [...verifyWords];
|
|
1612
|
-
for (let i = 0; i < pastedWords.length && i < newWords.length; i++) {
|
|
1613
|
-
newWords[i] = pastedWords[i].toLowerCase();
|
|
1614
|
-
}
|
|
1615
|
-
setVerifyWords(newWords);
|
|
1616
|
-
toast5.success("Phrase auto-filled.");
|
|
1617
|
-
}
|
|
1618
|
-
} catch (err) {
|
|
1619
|
-
toast5.error("Clipboard access denied. Please allow clipboard access or type manually.");
|
|
1620
|
-
}
|
|
1621
|
-
};
|
|
1622
1599
|
const handleCreationNext = () => {
|
|
1623
1600
|
if (flowStep === 1) {
|
|
1624
|
-
if (
|
|
1601
|
+
if (onGeneratePhrase) {
|
|
1602
|
+
const phrase = onGeneratePhrase();
|
|
1603
|
+
setGeneratedPhrase(phrase);
|
|
1604
|
+
setVerifyWords(Array(phrase.split(" ").length).fill(""));
|
|
1605
|
+
}
|
|
1606
|
+
setHasBackedUp(false);
|
|
1607
|
+
setWalletPassword("");
|
|
1625
1608
|
setFlowStep(2);
|
|
1626
1609
|
} else if (flowStep === 2) {
|
|
1610
|
+
if (!hasBackedUp) return toast5.error("Please confirm you have backed up the phrase.");
|
|
1611
|
+
setFlowStep(3);
|
|
1612
|
+
} else if (flowStep === 3) {
|
|
1627
1613
|
const reconstructed = verifyWords.map((w) => w.trim()).join(" ");
|
|
1628
1614
|
if (reconstructed !== generatedPhrase.trim()) {
|
|
1629
1615
|
return toast5.error("Phrase verification failed. Ensure words are in the correct order.");
|
|
1630
1616
|
}
|
|
1631
|
-
setFlowStep(
|
|
1617
|
+
setFlowStep(4);
|
|
1632
1618
|
}
|
|
1633
1619
|
};
|
|
1634
1620
|
const startWalletImport = () => {
|
|
1635
|
-
|
|
1621
|
+
setImportWords(Array(24).fill(""));
|
|
1636
1622
|
setWalletPassword("");
|
|
1637
1623
|
setFlowStep(1);
|
|
1638
1624
|
setImportModalOpen(true);
|
|
1639
1625
|
};
|
|
1626
|
+
const handleGridPaste = async (targetStateSetter, currentWords) => {
|
|
1627
|
+
try {
|
|
1628
|
+
const text = await navigator.clipboard.readText();
|
|
1629
|
+
const pastedWords = text.trim().split(/\s+/);
|
|
1630
|
+
if (pastedWords.length > 0) {
|
|
1631
|
+
const newLength = Math.max(pastedWords.length, 12);
|
|
1632
|
+
const newWords = Array(newLength).fill("");
|
|
1633
|
+
for (let i = 0; i < pastedWords.length && i < newWords.length; i++) {
|
|
1634
|
+
newWords[i] = pastedWords[i].toLowerCase();
|
|
1635
|
+
}
|
|
1636
|
+
targetStateSetter(newWords);
|
|
1637
|
+
toast5.success("Phrase auto-filled.");
|
|
1638
|
+
}
|
|
1639
|
+
} catch (err) {
|
|
1640
|
+
toast5.error("Clipboard access denied. Please allow clipboard access or type manually.");
|
|
1641
|
+
}
|
|
1642
|
+
};
|
|
1640
1643
|
const handleImportNext = () => {
|
|
1641
|
-
|
|
1642
|
-
if (
|
|
1643
|
-
|
|
1644
|
+
const reconstructed = importWords.filter((w) => w.trim() !== "").map((w) => w.trim()).join(" ");
|
|
1645
|
+
if (!reconstructed) return toast5.error("Please enter your phrase.");
|
|
1646
|
+
if (onValidatePhrase && !onValidatePhrase(reconstructed)) {
|
|
1647
|
+
return toast5.error("Invalid recovery phrase. Please check your spelling and word order.");
|
|
1644
1648
|
}
|
|
1645
1649
|
setFlowStep(2);
|
|
1646
1650
|
};
|
|
1647
|
-
const handleSaveWallet = async (
|
|
1651
|
+
const handleSaveWallet = async (phraseSource) => {
|
|
1648
1652
|
if (!walletPassword || walletPassword.length < 6) return toast5.error("Password must be at least 6 characters.");
|
|
1649
1653
|
setIsProcessing(true);
|
|
1650
1654
|
try {
|
|
1655
|
+
const phrase = phraseSource === "generated" ? generatedPhrase : importWords.filter((w) => w.trim() !== "").join(" ");
|
|
1651
1656
|
if (onSaveLocally) {
|
|
1652
1657
|
const res = await onSaveLocally(phrase, walletPassword);
|
|
1653
1658
|
if (res.success) {
|
|
@@ -1671,7 +1676,7 @@ CRITICAL WARNING: Keep this phrase completely secure. Anyone who has access to t
|
|
|
1671
1676
|
onChange: (e) => setLocalSearchQuery(e.target.value),
|
|
1672
1677
|
className: "w-full pl-10 pr-4 py-2 bg-white rounded-full text-[13px] text-black placeholder-neutral-400 outline-none transition-colors focus:border-black"
|
|
1673
1678
|
}
|
|
1674
|
-
)), /* @__PURE__ */ React17.createElement("div", { className: "flex items-center gap-3 w-auto pb-0 shrink-0" }, /* @__PURE__ */ React17.createElement("button", { onClick: startWalletGeneration, className: "flex items-center justify-center bg-white w-9 h-9 rounded-full text-neutral-500 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ React17.createElement(HugeiconsIcon11, { icon: PlusSignIcon, size: 16 })), /* @__PURE__ */ React17.createElement("button", { onClick: startWalletImport, className: "flex items-center justify-center bg-white w-9 h-9 rounded-full text-neutral-500 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ React17.createElement(HugeiconsIcon11, { icon: Upload01Icon, size: 16 })))), /* @__PURE__ */ React17.createElement("div", { className: "flex flex-col gap-8 p-6 rounded-2xl bg-white w-full" }, /* @__PURE__ */ React17.createElement("div", { className: "flex flex-col sm:flex-row sm:items-start justify-between gap-4" }, /* @__PURE__ */ React17.createElement("div", null, /* @__PURE__ */ React17.createElement("h1", { className: "text-black text-xl mb-1 tracking-tight" }, headerTitle), headerDescription && /* @__PURE__ */ React17.createElement("p", { className: "text-xs text-neutral-500" }, headerDescription))), /* @__PURE__ */ React17.createElement("div", { className: "w-full overflow-hidden" }, isLoading ? /* @__PURE__ */ React17.createElement(PageSpinner3, null) : /* @__PURE__ */ React17.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ React17.createElement("div", null, filteredWallets.length === 0 ? /* @__PURE__ */ React17.createElement("p", { className: "text-xs text-neutral-400 py-6 text-center" }, "No wallets found") : filteredWallets.map((wallet) => /* @__PURE__ */ React17.createElement("div", { key: wallet.id, onClick: () => setSelectedWallet(wallet), className: "flex items-center justify-between py-4 hover:bg-neutral-50 transition-colors cursor-pointer group min-w-0 px-3 -mx-3 rounded-xl" }, /* @__PURE__ */ React17.createElement("div", { className: "flex items-center gap-4 min-w-0 flex-1" }, /* @__PURE__ */ React17.createElement("div", { className: "relative shrink-0" }, /* @__PURE__ */ React17.createElement(WalletLogo, { src: wallet.logoSrc, alt: wallet.name }), wallet.networkLogoSrc && /* @__PURE__ */ React17.createElement("div", { className: "absolute -bottom-1 -right-1 w-4 h-4 rounded-full border border-white bg-white overflow-hidden shadow-sm" }, /* @__PURE__ */ React17.createElement("img", { src: wallet.networkLogoSrc, alt: "Network", className: "w-full h-full object-cover" }))), /* @__PURE__ */ React17.createElement("div", { className: "min-w-0 flex-1 flex flex-col gap-1" }, /* @__PURE__ */ React17.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React17.createElement("p", { className: "text-[13px] text-black truncate" }, wallet.name), wallet.isActive !== void 0 && /* @__PURE__ */ React17.createElement("span", { className: `text-[9px] px-1.5 py-0.5 rounded-sm tracking-widest uppercase ${wallet.isActive ? "bg-emerald-50 text-emerald-600" : "bg-red-50 text-red-600"}` }, wallet.isActive ? "Active" : "Inactive")), /* @__PURE__ */ React17.createElement("p", { className: `text-[13px] text-neutral-500 truncate transition-all duration-300 ${hideBalanceAmounts ? "blur-sm opacity-40 select-none" : ""}` }, wallet.balance, " ", wallet.currency))), /* @__PURE__ */ React17.createElement("div", { className: "shrink-0 flex flex-col items-end gap-1 text-right" }, /* @__PURE__ */ React17.createElement("span", { className: "text-[10px] tracking-wide text-neutral-600 bg-neutral-100 px-2.5 py-1 rounded-full " }, wallet.network)))))))), addModalOpen && /* @__PURE__ */ React17.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React17.createElement("div", { className: "absolute inset-0 bg-black/40 ", onClick: () => !isProcessing && setAddModalOpen(false) }), /* @__PURE__ */ React17.createElement("div", { className: "relative w-full max-w-md bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ React17.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, /* @__PURE__ */ React17.createElement("h3", { className: "text-[15px] text-black tracking-tight" }, flowStep === 1 ? "Secret Recovery Phrase" : flowStep ===
|
|
1679
|
+
)), /* @__PURE__ */ React17.createElement("div", { className: "flex items-center gap-3 w-auto pb-0 shrink-0" }, /* @__PURE__ */ React17.createElement("button", { onClick: startWalletGeneration, className: "flex items-center justify-center bg-white w-9 h-9 rounded-full text-neutral-500 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ React17.createElement(HugeiconsIcon11, { icon: PlusSignIcon, size: 16 })), /* @__PURE__ */ React17.createElement("button", { onClick: startWalletImport, className: "flex items-center justify-center bg-white w-9 h-9 rounded-full text-neutral-500 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ React17.createElement(HugeiconsIcon11, { icon: Upload01Icon, size: 16 })))), /* @__PURE__ */ React17.createElement("div", { className: "flex flex-col gap-8 p-6 rounded-2xl bg-white w-full" }, /* @__PURE__ */ React17.createElement("div", { className: "flex flex-col sm:flex-row sm:items-start justify-between gap-4" }, /* @__PURE__ */ React17.createElement("div", null, /* @__PURE__ */ React17.createElement("h1", { className: "text-black text-xl mb-1 tracking-tight" }, headerTitle), headerDescription && /* @__PURE__ */ React17.createElement("p", { className: "text-xs text-neutral-500" }, headerDescription))), /* @__PURE__ */ React17.createElement("div", { className: "w-full overflow-hidden" }, isLoading ? /* @__PURE__ */ React17.createElement(PageSpinner3, null) : /* @__PURE__ */ React17.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ React17.createElement("div", null, filteredWallets.length === 0 ? /* @__PURE__ */ React17.createElement("p", { className: "text-xs text-neutral-400 py-6 text-center" }, "No wallets found") : filteredWallets.map((wallet) => /* @__PURE__ */ React17.createElement("div", { key: wallet.id, onClick: () => setSelectedWallet(wallet), className: "flex items-center justify-between py-4 hover:bg-neutral-50 transition-colors cursor-pointer group min-w-0 px-3 -mx-3 rounded-xl" }, /* @__PURE__ */ React17.createElement("div", { className: "flex items-center gap-4 min-w-0 flex-1" }, /* @__PURE__ */ React17.createElement("div", { className: "relative shrink-0" }, /* @__PURE__ */ React17.createElement(WalletLogo, { src: wallet.logoSrc, alt: wallet.name }), wallet.networkLogoSrc && /* @__PURE__ */ React17.createElement("div", { className: "absolute -bottom-1 -right-1 w-4 h-4 rounded-full border border-white bg-white overflow-hidden shadow-sm" }, /* @__PURE__ */ React17.createElement("img", { src: wallet.networkLogoSrc, alt: "Network", className: "w-full h-full object-cover" }))), /* @__PURE__ */ React17.createElement("div", { className: "min-w-0 flex-1 flex flex-col gap-1" }, /* @__PURE__ */ React17.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React17.createElement("p", { className: "text-[13px] text-black truncate" }, wallet.name), wallet.isActive !== void 0 && /* @__PURE__ */ React17.createElement("span", { className: `text-[9px] px-1.5 py-0.5 rounded-sm tracking-widest uppercase ${wallet.isActive ? "bg-emerald-50 text-emerald-600" : "bg-red-50 text-red-600"}` }, wallet.isActive ? "Active" : "Inactive")), /* @__PURE__ */ React17.createElement("p", { className: `text-[13px] text-neutral-500 truncate transition-all duration-300 ${hideBalanceAmounts ? "blur-sm opacity-40 select-none" : ""}` }, wallet.balance, " ", wallet.currency))), /* @__PURE__ */ React17.createElement("div", { className: "shrink-0 flex flex-col items-end gap-1 text-right" }, /* @__PURE__ */ React17.createElement("span", { className: "text-[10px] tracking-wide text-neutral-600 bg-neutral-100 px-2.5 py-1 rounded-full " }, wallet.network)))))))), addModalOpen && /* @__PURE__ */ React17.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React17.createElement("div", { className: "absolute inset-0 bg-black/40 ", onClick: () => !isProcessing && setAddModalOpen(false) }), /* @__PURE__ */ React17.createElement("div", { className: "relative w-full max-w-md bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ React17.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, /* @__PURE__ */ React17.createElement("h3", { className: "text-[15px] text-black tracking-tight" }, flowStep === 1 ? "Important Notice" : flowStep === 2 ? "Secret Recovery Phrase" : flowStep === 3 ? "Verify Phrase" : "Secure Wallet"), /* @__PURE__ */ React17.createElement("button", { onClick: () => !isProcessing && setAddModalOpen(false), className: "text-neutral-400 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ React17.createElement(HugeiconsIcon11, { icon: CancelCircleIcon3, size: 18 }))), /* @__PURE__ */ React17.createElement("div", { className: "p-6" }, flowStep === 1 && /* @__PURE__ */ React17.createElement("div", { className: "flex flex-col gap-6 animate-in fade-in" }, /* @__PURE__ */ React17.createElement(Banner, { type: "alert", title: "Critical Warning", message: "You are about to generate a Self-Custodial Recovery Phrase. This phrase is the absolute master key to your wallet and all assets within it. Aeona DOES NOT store this phrase. If you lose it, your funds are permanently lost. Do not share this phrase with anyone.", isDismissible: false }), /* @__PURE__ */ React17.createElement(ThreeDActionButton, { onClick: handleCreationNext, className: "w-full mt-2" }, "I Understand, Generate Phrase")), flowStep === 2 && /* @__PURE__ */ React17.createElement("div", { className: "flex flex-col gap-6 animate-in fade-in slide-in-from-right-4" }, /* @__PURE__ */ React17.createElement("p", { className: "text-sm text-neutral-600" }, "Please write down these words in the exact order shown. Store them in a secure, offline location."), /* @__PURE__ */ React17.createElement("div", { className: "grid grid-cols-3 gap-2 max-h-48 overflow-y-auto custom-scrollbar pr-1" }, generatedPhrase.split(" ").map((word, idx) => /* @__PURE__ */ React17.createElement("div", { key: idx, className: "flex items-center gap-1.5 bg-neutral-50 rounded-lg p-2 selection:bg-neutral-200" }, /* @__PURE__ */ React17.createElement("span", { className: "text-[10px] text-neutral-400 font-mono select-none w-4 text-right shrink-0" }, idx + 1, "."), /* @__PURE__ */ React17.createElement("span", { className: "text-[13px] text-black font-medium" }, word)))), /* @__PURE__ */ React17.createElement("div", { className: "flex items-center justify-between gap-2 0 pt-4" }, /* @__PURE__ */ React17.createElement("button", { onClick: () => handleCopy(generatedPhrase, false), className: "text-xs text-black flex items-center gap-1.5 hover:underline outline-none" }, /* @__PURE__ */ React17.createElement(HugeiconsIcon11, { icon: Copy01Icon2, size: 14 }), " Copy Phrase"), /* @__PURE__ */ React17.createElement("button", { onClick: handleDownloadTxt, className: "text-xs text-black flex items-center gap-1.5 hover:underline outline-none" }, /* @__PURE__ */ React17.createElement(HugeiconsIcon11, { icon: Download01Icon, size: 14 }), " Download .txt")), /* @__PURE__ */ React17.createElement("div", { className: "flex items-start gap-3 p-3 rounded-xl border border-neutral-200 mt-2" }, /* @__PURE__ */ React17.createElement("input", { type: "checkbox", id: "backup-confirm", checked: hasBackedUp, onChange: (e) => setHasBackedUp(e.target.checked), className: "mt-0.5 w-4 h-4 bg-white border-neutral-300 rounded text-black focus:ring-black cursor-pointer shrink-0" }), /* @__PURE__ */ React17.createElement("label", { htmlFor: "backup-confirm", className: "text-xs text-neutral-600 cursor-pointer leading-relaxed" }, "I have securely copied and stored my recovery phrase. I understand that if I lose it, my funds are gone forever.")), /* @__PURE__ */ React17.createElement(ThreeDActionButton, { onClick: handleCreationNext, className: "w-full mt-2" }, "Continue")), flowStep === 3 && /* @__PURE__ */ React17.createElement("div", { className: "flex flex-col gap-6 animate-in fade-in slide-in-from-right-4" }, /* @__PURE__ */ React17.createElement("p", { className: "text-sm text-neutral-600" }, "Please enter or paste your recovery phrase below to verify your backup."), /* @__PURE__ */ React17.createElement("div", { className: "grid grid-cols-3 gap-2 max-h-56 overflow-y-auto custom-scrollbar pr-1 pb-1" }, verifyWords.map((word, idx) => /* @__PURE__ */ React17.createElement("div", { key: idx, className: "flex items-center gap-1 bg-white border border-neutral-200 focus-within:border-black rounded-lg p-1.5 transition-colors" }, /* @__PURE__ */ React17.createElement("span", { className: "text-[10px] text-neutral-400 font-mono w-4 shrink-0 text-right select-none" }, idx + 1, "."), /* @__PURE__ */ React17.createElement(
|
|
1675
1680
|
"input",
|
|
1676
1681
|
{
|
|
1677
1682
|
type: "text",
|
|
@@ -1696,7 +1701,33 @@ CRITICAL WARNING: Keep this phrase completely secure. Anyone who has access to t
|
|
|
1696
1701
|
},
|
|
1697
1702
|
className: "w-full bg-transparent text-[13px] text-black outline-none min-w-0"
|
|
1698
1703
|
}
|
|
1699
|
-
)))), /* @__PURE__ */ React17.createElement("div", { className: "flex items-center justify-between pt-4" }, /* @__PURE__ */ React17.createElement("button", { onClick: handleGridPaste, className: "text-xs text-black flex items-center gap-1.5 hover:underline outline-none" }, /* @__PURE__ */ React17.createElement(HugeiconsIcon11, { icon: ClipboardIcon, size: 14 }), " Paste Phrase")), /* @__PURE__ */ React17.createElement(ThreeDActionButton, { onClick: handleCreationNext, className: "w-full mt-2" }, "Verify Backup")), flowStep ===
|
|
1704
|
+
)))), /* @__PURE__ */ React17.createElement("div", { className: "flex items-center justify-between pt-4" }, /* @__PURE__ */ React17.createElement("button", { onClick: () => handleGridPaste(setVerifyWords, verifyWords), className: "text-xs text-black flex items-center gap-1.5 hover:underline outline-none" }, /* @__PURE__ */ React17.createElement(HugeiconsIcon11, { icon: ClipboardIcon, size: 14 }), " Paste Phrase")), /* @__PURE__ */ React17.createElement(ThreeDActionButton, { onClick: handleCreationNext, className: "w-full mt-2" }, "Verify Backup")), flowStep === 4 && /* @__PURE__ */ React17.createElement("div", { className: "flex flex-col gap-6 animate-in fade-in slide-in-from-right-4" }, /* @__PURE__ */ React17.createElement(Banner, { type: "success", title: "Phrase Verified", message: "Your phrase is correct. Now set a local password to encrypt your wallet on this browser.", isDismissible: false }), /* @__PURE__ */ React17.createElement(TextInput, { label: "Local Password", type: "password", value: walletPassword, onChange: setWalletPassword, placeholder: "Enter a strong password" }), /* @__PURE__ */ React17.createElement(ThreeDActionButton, { onClick: () => handleSaveWallet("generated"), isLoading: isProcessing, className: "w-full mt-2" }, "Encrypt & Save Wallet"))))), importModalOpen && /* @__PURE__ */ React17.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React17.createElement("div", { className: "absolute inset-0 bg-black/40 ", onClick: () => !isProcessing && setImportModalOpen(false) }), /* @__PURE__ */ React17.createElement("div", { className: "relative w-full max-w-md bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ React17.createElement("div", { className: "flex items-center justify-between p-5 shrink-0 " }, /* @__PURE__ */ React17.createElement("h3", { className: "text-[15px] text-black tracking-tight" }, "Import Wallet"), /* @__PURE__ */ React17.createElement("button", { onClick: () => !isProcessing && setImportModalOpen(false), className: "text-neutral-400 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ React17.createElement(HugeiconsIcon11, { icon: CancelCircleIcon3, size: 18 }))), /* @__PURE__ */ React17.createElement("div", { className: "p-6" }, flowStep === 1 && /* @__PURE__ */ React17.createElement("div", { className: "flex flex-col gap-6 animate-in fade-in" }, /* @__PURE__ */ React17.createElement("p", { className: "text-sm text-neutral-600" }, "Enter your 12 or 24-word recovery phrase to restore your wallet on this device."), /* @__PURE__ */ React17.createElement("div", { className: "grid grid-cols-3 gap-2 max-h-56 overflow-y-auto custom-scrollbar pr-1 pb-1" }, importWords.map((word, idx) => /* @__PURE__ */ React17.createElement("div", { key: idx, className: "flex items-center gap-1 bg-white border border-neutral-200 focus-within:border-black rounded-lg p-1.5 transition-colors" }, /* @__PURE__ */ React17.createElement("span", { className: "text-[10px] text-neutral-400 font-mono w-4 shrink-0 text-right select-none" }, idx + 1, "."), /* @__PURE__ */ React17.createElement(
|
|
1705
|
+
"input",
|
|
1706
|
+
{
|
|
1707
|
+
type: "text",
|
|
1708
|
+
value: word,
|
|
1709
|
+
onChange: (e) => {
|
|
1710
|
+
const newWords = [...importWords];
|
|
1711
|
+
newWords[idx] = e.target.value.trim().toLowerCase();
|
|
1712
|
+
setImportWords(newWords);
|
|
1713
|
+
},
|
|
1714
|
+
onPaste: (e) => {
|
|
1715
|
+
const pastedData = e.clipboardData.getData("text").trim();
|
|
1716
|
+
const pastedWords = pastedData.split(/\s+/);
|
|
1717
|
+
if (pastedWords.length > 1) {
|
|
1718
|
+
e.preventDefault();
|
|
1719
|
+
const newLength = Math.max(pastedWords.length, 12);
|
|
1720
|
+
const newWords = Array(newLength).fill("");
|
|
1721
|
+
for (let i = 0; i < pastedWords.length && i < newWords.length; i++) {
|
|
1722
|
+
newWords[i] = pastedWords[i].toLowerCase();
|
|
1723
|
+
}
|
|
1724
|
+
setImportWords(newWords);
|
|
1725
|
+
toast5.success("Phrase auto-filled.");
|
|
1726
|
+
}
|
|
1727
|
+
},
|
|
1728
|
+
className: "w-full bg-transparent text-[13px] text-black outline-none min-w-0"
|
|
1729
|
+
}
|
|
1730
|
+
)))), /* @__PURE__ */ React17.createElement("div", { className: "flex items-center justify-between pt-4" }, /* @__PURE__ */ React17.createElement("button", { onClick: () => handleGridPaste(setImportWords, importWords), className: "text-xs text-black flex items-center gap-1.5 hover:underline outline-none" }, /* @__PURE__ */ React17.createElement(HugeiconsIcon11, { icon: ClipboardIcon, size: 14 }), " Paste Phrase")), /* @__PURE__ */ React17.createElement(ThreeDActionButton, { onClick: handleImportNext, className: "w-full mt-2" }, "Continue")), flowStep === 2 && /* @__PURE__ */ React17.createElement("div", { className: "flex flex-col gap-6 animate-in fade-in slide-in-from-right-4" }, /* @__PURE__ */ React17.createElement("p", { className: "text-sm text-neutral-600" }, "Set a local password to encrypt this wallet on this specific browser."), /* @__PURE__ */ React17.createElement(TextInput, { label: "Local Password", type: "password", value: walletPassword, onChange: setWalletPassword, placeholder: "Enter a strong password" }), /* @__PURE__ */ React17.createElement(ThreeDActionButton, { onClick: () => handleSaveWallet("imported"), isLoading: isProcessing, className: "w-full mt-2" }, "Encrypt & Import Wallet"))))), selectedWallet && /* @__PURE__ */ React17.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React17.createElement("div", { className: "absolute inset-0 bg-black/40 ", onClick: () => setSelectedWallet(null) }), /* @__PURE__ */ React17.createElement("div", { className: "relative w-full max-w-sm bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 max-h-[90vh]" }, /* @__PURE__ */ React17.createElement("div", { className: "flex items-center justify-between p-5 shrink-0 " }, /* @__PURE__ */ React17.createElement("h3", { className: "text-[15px] text-black tracking-tight" }, "Wallet Details"), /* @__PURE__ */ React17.createElement("button", { onClick: () => setSelectedWallet(null), className: "text-neutral-400 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ React17.createElement(HugeiconsIcon11, { icon: CancelCircleIcon3, size: 18 }))), /* @__PURE__ */ React17.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-6 pt-6" }, /* @__PURE__ */ React17.createElement("div", { className: "flex flex-col items-center justify-center mb-6" }, /* @__PURE__ */ React17.createElement("div", { className: "relative mb-4" }, /* @__PURE__ */ React17.createElement(WalletLogo, { src: selectedWallet.logoSrc, alt: selectedWallet.name, sizeClass: "w-14 h-14" }), selectedWallet.networkLogoSrc && /* @__PURE__ */ React17.createElement("div", { className: "absolute -bottom-1 -right-1 w-5 h-5 rounded-full border border-white bg-white overflow-hidden shadow-sm" }, /* @__PURE__ */ React17.createElement("img", { src: selectedWallet.networkLogoSrc, alt: "Network", className: "w-full h-full object-cover" }))), /* @__PURE__ */ React17.createElement("h2", { className: `text-2xl text-black mb-2 transition-all duration-300 ${hideBalanceAmounts ? "blur-[6px] opacity-40 select-none" : ""}` }, selectedWallet.balance, " ", selectedWallet.currency), /* @__PURE__ */ React17.createElement("span", { className: "text-[9px] tracking-widest text-neutral-500 px-4 py-1.5 rounded-full border border-neutral-200 mt-1 " }, selectedWallet.network, " NETWORK")), renderQrCode && /* @__PURE__ */ React17.createElement("div", { className: "w-full flex justify-center mb-6 mix-blend-multiply" }, renderQrCode(selectedWallet)), /* @__PURE__ */ React17.createElement("div", { className: "grid grid-cols-1 gap-y-6 gap-x-4 mb-10" }, /* @__PURE__ */ React17.createElement("div", null, /* @__PURE__ */ React17.createElement("span", { className: "text-[11px] tracking-[0.2em] text-neutral-400 block mb-2" }, "Wallet Address"), /* @__PURE__ */ React17.createElement("div", { className: "flex items-center gap-2 min-w-0" }, /* @__PURE__ */ React17.createElement("span", { className: "text-[13px] text-black truncate min-w-0 block" }, truncateAddress2(selectedWallet.address)), /* @__PURE__ */ React17.createElement("button", { onClick: () => handleCopy(selectedWallet.address, true), className: "text-neutral-400 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ React17.createElement(HugeiconsIcon11, { icon: Copy01Icon2, size: 14 })))), /* @__PURE__ */ React17.createElement("div", null, /* @__PURE__ */ React17.createElement("span", { className: "text-[11px] tracking-[0.2em] text-neutral-400 block mb-2" }, "Wallet Status"), selectedWallet.isActive ? /* @__PURE__ */ React17.createElement("span", { className: "text-[13px] text-emerald-600 font-medium" }, "Active on this device") : /* @__PURE__ */ React17.createElement("span", { className: "text-[13px] text-red-600 font-medium" }, "Inactive - Requires Import"))), /* @__PURE__ */ React17.createElement("div", { className: "flex flex-col gap-3" }, /* @__PURE__ */ React17.createElement(ThreeDActionButton, { onClick: () => onDownloadPayId && onDownloadPayId(selectedWallet), isLoading: isGeneratingStatement, className: "w-full" }, "Generate Statement"), /* @__PURE__ */ React17.createElement("button", { onClick: () => handleCopy(selectedWallet.address, true), className: "w-full flex items-center justify-center py-2.5 rounded-full border border-neutral-200 text-black hover:bg-neutral-50 outline-none text-xs tracking-wide transition-colors" }, "Copy Wallet Address")))))));
|
|
1700
1731
|
};
|
|
1701
1732
|
|
|
1702
1733
|
// src/components/UniversalCardPage.tsx
|