diff --git a/.changeset/wise-suns-hammer.md b/.changeset/wise-suns-hammer.md new file mode 100644 index 00000000..cbeea866 --- /dev/null +++ b/.changeset/wise-suns-hammer.md @@ -0,0 +1,9 @@ +--- +"@paybox/common": patch +"@paybox/recoil": patch +"@paybox/api": patch +"@paybox/backend-common": patch +"@paybox/zeus": patch +--- + +feat: encrypting private keys for account with password diff --git a/apps/web/app/account/[id]/privatekey/components/alert-msg.tsx b/apps/web/app/account/[id]/privatekey/components/alert-msg.tsx new file mode 100644 index 00000000..6c61863c --- /dev/null +++ b/apps/web/app/account/[id]/privatekey/components/alert-msg.tsx @@ -0,0 +1,25 @@ +import { + Alert, + AlertDescription, + AlertTitle, +} from "@/components/ui/alert" +import { RocketIcon } from "lucide-react" + +export function AlertMsg({ + message, + title = "Heads up!", + variant = "default", +}: { + message: string + title?: string + variant?: "default" | "destructive", +}) { + return ( + + + {title} + {message} + + ) + +} \ No newline at end of file diff --git a/apps/web/app/account/[id]/privatekey/components/key-dialog-box.tsx b/apps/web/app/account/[id]/privatekey/components/key-dialog-box.tsx new file mode 100644 index 00000000..71343be8 --- /dev/null +++ b/apps/web/app/account/[id]/privatekey/components/key-dialog-box.tsx @@ -0,0 +1,121 @@ +import { CopyIcon } from "@radix-ui/react-icons" + +import { Button } from "@/components/ui/button" +import { + Dialog, + DialogClose, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, +} from "@/components/ui/dialog" +import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert" +import { AlertTriangle } from 'lucide-react'; +import { + Card, + CardContent, + CardHeader, +} from "@/components/ui/card" +import { Input } from "@/components/ui/input" +import { Label } from "@/components/ui/label" +import { + Tabs, + TabsContent, + TabsList, + TabsTrigger, +} from "@/components/ui/tabs" +import { Textarea } from "@/components/ui/textarea"; +import React from "react"; +import { useRecoilValue } from "recoil"; +import { accountPrivateKeysAtom } from "@paybox/recoil"; + +export function PrivateKeyDialogBox({ + open, + setOpen, + // keys, +}: { + open: boolean, + setOpen: (open: boolean) => void, + // keys: { network: string, privateKey: string }[] +}) { + const keys = useRecoilValue(accountPrivateKeysAtom); + const [copyText, setCopyText] = React.useState("Copy") + + return ( + + + + + + + {keys.map((key, index) => ( + + {key.network} + + ))} + + + + + + + + + {keys.map((key, index) => ( + + + + + + Caution! + Do not share your private keys. Indiviual bearing this has full control on this account! + + + +
+
+ +