From 2ee0380719b790cf3bfd1f15210d9f2bf6a9eac3 Mon Sep 17 00:00:00 2001 From: nattadex Date: Wed, 8 May 2024 13:20:32 +0800 Subject: [PATCH 001/200] fixed error --- apps/web/src/app/app/components/AddressInput.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/app/app/components/AddressInput.tsx b/apps/web/src/app/app/components/AddressInput.tsx index 0d7d12bc..996140d3 100644 --- a/apps/web/src/app/app/components/AddressInput.tsx +++ b/apps/web/src/app/app/components/AddressInput.tsx @@ -97,7 +97,7 @@ export default function AddressInput({ )} type="text" placeholder={placeholder} - value={value} + value={value ?? ""} onChange={(e) => { setValue(e.target.value); if (receivingWalletAddress) { From ebdf70fb47604481482f9a1b8ad44a933ed5118f Mon Sep 17 00:00:00 2001 From: nattadex Date: Thu, 9 May 2024 11:58:29 +0800 Subject: [PATCH 002/200] skeleton --- .../components/ComplimentarySection.tsx | 37 +++++ apps/web/src/app/app/withdraw/page.tsx | 131 ++++++++++++++++++ apps/web/src/components/button/CTAButton.tsx | 10 +- apps/web/src/globals.css | 4 + 4 files changed, 179 insertions(+), 3 deletions(-) create mode 100644 apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx create mode 100644 apps/web/src/app/app/withdraw/page.tsx diff --git a/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx b/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx new file mode 100644 index 00000000..c5667af0 --- /dev/null +++ b/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx @@ -0,0 +1,37 @@ +import React from "react"; +import clsx from "clsx"; +import { CTAButton } from "@/components/button/CTAButton"; + +export default function ComplimentarySection({ + customStyle, +}: { + customStyle?: string; +}) { + return ( +
+
+ + Withdrawal process + + + Claims for withdrawals approximately take 7 processing days. Once your + claim is processed, you can submit your claim to receive your DFI. + Make sure to regularly check your wallet for your withdrawal claims. + +
+
+ +
+
+ ); +} diff --git a/apps/web/src/app/app/withdraw/page.tsx b/apps/web/src/app/app/withdraw/page.tsx new file mode 100644 index 00000000..4eafccef --- /dev/null +++ b/apps/web/src/app/app/withdraw/page.tsx @@ -0,0 +1,131 @@ +"use client"; + +import { useBalance, useAccount } from "wagmi"; +import React, { useState } from "react"; +import { ConnectKitButton } from "connectkit"; +import { CTAButton } from "@/components/button/CTAButton"; +import Panel from "@/app/app/stake/components/Panel"; +import AddressInput from "@/app/app/components/AddressInput"; +import clsx from "clsx"; +import BigNumber from "bignumber.js"; +import ComplimentarySection from "@/app/app/withdraw/components/ComplimentarySection"; + +export default function Withdraw() { + const { address, isConnected } = useAccount(); + + const { data: walletBalance } = useBalance({ + address, + }); + + const [stakeAmount, setStakeAmount] = useState(""); + const maxStakeAmount = new BigNumber(walletBalance?.formatted ?? "0"); + const [receivingWalletAddress, setReceivingWalletAddress] = + useState(""); + + // TODO + async function submitStake() { + // additional checks to ensure that the user's wallet balance is sufficient to cover the deposit amount + // ensure that the entered amount meets the min. deposit req defined by the contract's minDeposit Variable + } + + function getActionBtnLabel() { + switch (true) { + // case isSuccess: + // return "Return to Main Page"; + + case isConnected: + return "Stake DFI"; + + default: + return "Connect wallet"; + } + } + + return ( + +
+
+

Withdraw DFI

+
+
+
+
+ + How much do you want to withdraw? + + +
+ +
+
+ +
+
+
+ + + +
+
+ + {({ show }) => ( + submitStake()} + /> + )} + +
+ +
+
+ ); +} + +function TransactionRow({ label, value }: { label: string; value: string }) { + return ( +
+ {label} + {value} +
+ ); +} + +function WalletDetails({ + isWalletConnected, + style, +}: { + isWalletConnected: boolean; + style?: string; +}) { + return ( +
+ {isWalletConnected ? ( +

+ Available: + walletAmount +

+ ) : ( + + Connect wallet to get started + + )} +
+ ); +} diff --git a/apps/web/src/components/button/CTAButton.tsx b/apps/web/src/components/button/CTAButton.tsx index ddbc38a8..68d48610 100644 --- a/apps/web/src/components/button/CTAButton.tsx +++ b/apps/web/src/components/button/CTAButton.tsx @@ -6,7 +6,7 @@ export function CTAButton({ label, testID, customStyle, - customTextStyle = "text-light-00", + customTextStyle, onClick, isDisabled, isLoading = false, @@ -29,13 +29,17 @@ export function CTAButton({ className={clsx( "accent-1 rounded-[30px] px-9 py-5 md:py-4", !isDisabled && "hover:bg-opacity-60", - customTextStyle, isDisabled ? "opacity-30" : "", customStyle ?? "w-fit", )} >
- + {label} {isLoading ? : null} diff --git a/apps/web/src/globals.css b/apps/web/src/globals.css index 1528dcb5..a9f25d16 100644 --- a/apps/web/src/globals.css +++ b/apps/web/src/globals.css @@ -262,3 +262,7 @@ input[type="number"] { border-radius: 30px; background: var(--UI-Component-BG-4); } + +.faq-button-bg { + background: linear-gradient(180deg, rgba(206, 219, 245, 0.15) 0%, rgba(150, 178, 232, 0.15) 100%); +} \ No newline at end of file From 263e92b621b39e08c13c71877701b92761a3b5ee Mon Sep 17 00:00:00 2001 From: nattadex Date: Thu, 9 May 2024 13:58:39 +0800 Subject: [PATCH 003/200] responsive design --- .../app/withdraw/components/ComplimentarySection.tsx | 11 +++++------ apps/web/src/components/button/CTAButton.tsx | 5 ++++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx b/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx index c5667af0..a5c284c5 100644 --- a/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx +++ b/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx @@ -10,26 +10,25 @@ export default function ComplimentarySection({ return (
- - Withdrawal process - + Withdrawal process Claims for withdrawals approximately take 7 processing days. Once your claim is processed, you can submit your claim to receive your DFI. Make sure to regularly check your wallet for your withdrawal claims.
-
+
diff --git a/apps/web/src/components/button/CTAButton.tsx b/apps/web/src/components/button/CTAButton.tsx index 68d48610..5fcd4a2c 100644 --- a/apps/web/src/components/button/CTAButton.tsx +++ b/apps/web/src/components/button/CTAButton.tsx @@ -7,6 +7,7 @@ export function CTAButton({ testID, customStyle, customTextStyle, + customBgColor, onClick, isDisabled, isLoading = false, @@ -18,6 +19,7 @@ export function CTAButton({ onClick?: (e: any) => void; customStyle?: string; customTextStyle?: string; + customBgColor?: string; isLoading?: boolean; navigateTo?: string; }) { @@ -27,7 +29,8 @@ export function CTAButton({ onClick={onClick} data-testid={`cta-button-${testID}`} className={clsx( - "accent-1 rounded-[30px] px-9 py-5 md:py-4", + "rounded-[30px] px-9 py-5 md:py-4", + customBgColor ?? "accent-1", !isDisabled && "hover:bg-opacity-60", isDisabled ? "opacity-30" : "", customStyle ?? "w-fit", From 0d80447da307df151902d225060ed85dbbf15497 Mon Sep 17 00:00:00 2001 From: nattadex Date: Thu, 9 May 2024 14:48:03 +0800 Subject: [PATCH 004/200] moved connect wallet text for mobile --- apps/web/src/app/app/withdraw/page.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/web/src/app/app/withdraw/page.tsx b/apps/web/src/app/app/withdraw/page.tsx index 4eafccef..2e34d69d 100644 --- a/apps/web/src/app/app/withdraw/page.tsx +++ b/apps/web/src/app/app/withdraw/page.tsx @@ -58,10 +58,6 @@ export default function Withdraw() { style="md:block hidden" />
-
+
From 8c2b163f643860e0dc343b68c26b6aff19066c6e Mon Sep 17 00:00:00 2001 From: nattadex Date: Thu, 9 May 2024 14:49:53 +0800 Subject: [PATCH 005/200] removed unnecessary code --- apps/web/src/app/app/withdraw/page.tsx | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/apps/web/src/app/app/withdraw/page.tsx b/apps/web/src/app/app/withdraw/page.tsx index 2e34d69d..b29dc680 100644 --- a/apps/web/src/app/app/withdraw/page.tsx +++ b/apps/web/src/app/app/withdraw/page.tsx @@ -1,40 +1,27 @@ "use client"; -import { useBalance, useAccount } from "wagmi"; +import { useAccount } from "wagmi"; import React, { useState } from "react"; import { ConnectKitButton } from "connectkit"; import { CTAButton } from "@/components/button/CTAButton"; import Panel from "@/app/app/stake/components/Panel"; import AddressInput from "@/app/app/components/AddressInput"; import clsx from "clsx"; -import BigNumber from "bignumber.js"; import ComplimentarySection from "@/app/app/withdraw/components/ComplimentarySection"; export default function Withdraw() { - const { address, isConnected } = useAccount(); + const { isConnected } = useAccount(); - const { data: walletBalance } = useBalance({ - address, - }); - - const [stakeAmount, setStakeAmount] = useState(""); - const maxStakeAmount = new BigNumber(walletBalance?.formatted ?? "0"); const [receivingWalletAddress, setReceivingWalletAddress] = useState(""); - // TODO - async function submitStake() { - // additional checks to ensure that the user's wallet balance is sufficient to cover the deposit amount - // ensure that the entered amount meets the min. deposit req defined by the contract's minDeposit Variable - } - function getActionBtnLabel() { switch (true) { // case isSuccess: // return "Return to Main Page"; case isConnected: - return "Stake DFI"; + return "Withdraw mDFI"; default: return "Connect wallet"; @@ -84,7 +71,6 @@ export default function Withdraw() { testID="instant-transfer-btn" label={getActionBtnLabel()} customStyle="w-full md:py-5" - onClick={!isConnected ? show : () => submitStake()} /> )} From 45766e1856c1cff33b2235b9b517056c93a57810 Mon Sep 17 00:00:00 2001 From: nattadex Date: Fri, 10 May 2024 09:28:41 +0800 Subject: [PATCH 006/200] removed unnecessary class --- .../src/app/app/withdraw/components/ComplimentarySection.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx b/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx index a5c284c5..96c6ae86 100644 --- a/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx +++ b/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx @@ -10,7 +10,7 @@ export default function ComplimentarySection({ return (
From 723417db6a54826632946ef21ee2e8906584a3f1 Mon Sep 17 00:00:00 2001 From: nattadex Date: Fri, 10 May 2024 13:33:40 +0800 Subject: [PATCH 007/200] updated to take in Icon for InputCard.tsx --- apps/web/public/icons/mdfi-icon.svg | 50 +++++++++++++++++++ apps/web/src/app/app/components/InputCard.tsx | 21 ++++---- apps/web/src/app/app/stake/page.tsx | 12 +++++ 3 files changed, 71 insertions(+), 12 deletions(-) create mode 100644 apps/web/public/icons/mdfi-icon.svg diff --git a/apps/web/public/icons/mdfi-icon.svg b/apps/web/public/icons/mdfi-icon.svg new file mode 100644 index 00000000..d4580cf1 --- /dev/null +++ b/apps/web/public/icons/mdfi-icon.svg @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/web/src/app/app/components/InputCard.tsx b/apps/web/src/app/app/components/InputCard.tsx index c2c4bb6a..68558729 100644 --- a/apps/web/src/app/app/components/InputCard.tsx +++ b/apps/web/src/app/app/components/InputCard.tsx @@ -1,4 +1,3 @@ -import Image from "next/image"; import { useState } from "react"; import clsx from "clsx"; import BigNumber from "bignumber.js"; @@ -10,12 +9,14 @@ export function InputCard({ usdAmount, setAmount, onChange, + Icon, }: { maxAmount: BigNumber; // to calculate amount value: string; // to display amount in UI setAmount: (amount: string) => void; - usdAmount: string; + usdAmount?: string; onChange: (amount: string) => void; + Icon: JSX.Element; }) { const [focus, setFocus] = useState(false); const [errorMsg, setErrorMsg] = useState(null); @@ -45,15 +46,7 @@ export function InputCard({
- DFI icon + {Icon}
- ${usdAmount} + {usdAmount && ( + + ${usdAmount} + + )}
{/* Display only when wallet is connected*/} diff --git a/apps/web/src/app/app/stake/page.tsx b/apps/web/src/app/app/stake/page.tsx index 96f6bf27..6126a985 100644 --- a/apps/web/src/app/app/stake/page.tsx +++ b/apps/web/src/app/app/stake/page.tsx @@ -1,5 +1,6 @@ "use client"; +import Image from "next/image"; import { useBalance, useAccount } from "wagmi"; import { useEffect, useRef, useState } from "react"; import { ConnectKitButton } from "connectkit"; @@ -106,6 +107,17 @@ export default function Stake() { : new BigNumber(stakeAmount) ).toFixed(2)} // TODO use USDT price to calculate DFI amount onChange={(value) => setStakeAmount(value)} + Icon={ + DFI icon + } />
Date: Mon, 13 May 2024 13:08:09 +0800 Subject: [PATCH 008/200] added connected wallet designs --- apps/web/next.config.js | 2 +- apps/web/src/app/app/components/Tooltip.tsx | 79 +++++++++++++++ apps/web/src/app/app/withdraw/page.tsx | 106 ++++++++++++++++---- 3 files changed, 164 insertions(+), 23 deletions(-) create mode 100644 apps/web/src/app/app/components/Tooltip.tsx diff --git a/apps/web/next.config.js b/apps/web/next.config.js index 8ee87759..0c192d8e 100644 --- a/apps/web/next.config.js +++ b/apps/web/next.config.js @@ -15,7 +15,7 @@ const securityHeaders = [ };` + `style-src 'self' fonts.googleapis.com 'unsafe-inline';` + `font-src 'self' fonts.gstatic.com;` + - `connect-src 'self' ${process.env.NEXT_PUBLIC_SERVER_URL} rpc.ankr.com rpc.sepolia.org mainnet.infura.io cloudflare-eth.com *.ocean.jellyfishsdk.com ${ + `connect-src 'self' ${process.env.NEXT_PUBLIC_SERVER_URL} wss://www.walletlink.org/rpc rpc.ankr.com rpc.sepolia.org mainnet.infura.io cloudflare-eth.com *.ocean.jellyfishsdk.com ${ process.env.NODE_ENV === "development" ? `localhost:* 127.0.0.1:* ws://localhost:3000/_next/webpack-hmr` : "" diff --git a/apps/web/src/app/app/components/Tooltip.tsx b/apps/web/src/app/app/components/Tooltip.tsx new file mode 100644 index 00000000..726a06db --- /dev/null +++ b/apps/web/src/app/app/components/Tooltip.tsx @@ -0,0 +1,79 @@ +import clsx from "clsx"; +import React, { PropsWithChildren, useState } from "react"; + +interface Props { + content: string; + title?: string; + containerClass?: string; + disableTooltip?: boolean; + defaultStyle?: string; + customStyle?: string; +} + +export default function Tooltip({ + content, + title, + children, + containerClass, + defaultStyle = "w-fit bottom-[150%]", + customStyle, + disableTooltip = false, +}: PropsWithChildren): JSX.Element { + let timeout: NodeJS.Timeout; + const [active, setActive] = useState(false); + const timeoutTime = 300; + + const showTooltip = () => { + timeout = setTimeout(() => { + setActive(true); + }, 300); + }; + + const hideTooltip = () => { + timeout = setTimeout(() => { + setActive(false); + clearInterval(timeout); + }, timeoutTime); + }; + + return ( +
{ + if (active) { + hideTooltip(); + } else { + showTooltip(); + timeout = setTimeout(() => { + hideTooltip(); + }, timeoutTime); + } + }} + onMouseLeave={hideTooltip} + onMouseDown={hideTooltip} + onKeyDown={() => {}} + tabIndex={0} + > + {children} + {!disableTooltip && active && ( +
+ {title &&

{title}

} + {content} +
+ )} +
+ ); +} diff --git a/apps/web/src/app/app/withdraw/page.tsx b/apps/web/src/app/app/withdraw/page.tsx index b29dc680..2b911a1d 100644 --- a/apps/web/src/app/app/withdraw/page.tsx +++ b/apps/web/src/app/app/withdraw/page.tsx @@ -1,19 +1,29 @@ "use client"; -import { useAccount } from "wagmi"; -import React, { useState } from "react"; +import Image from "next/image"; +import { useAccount, useBalance } from "wagmi"; +import React, { useEffect, useState } from "react"; import { ConnectKitButton } from "connectkit"; import { CTAButton } from "@/components/button/CTAButton"; import Panel from "@/app/app/stake/components/Panel"; -import AddressInput from "@/app/app/components/AddressInput"; import clsx from "clsx"; import ComplimentarySection from "@/app/app/withdraw/components/ComplimentarySection"; +import BigNumber from "bignumber.js"; +import { InputCard } from "@/app/app/components/InputCard"; +import { FiHelpCircle } from "react-icons/fi"; +import Tooltip from "@/app/app/components/Tooltip"; export default function Withdraw() { - const { isConnected } = useAccount(); + const { address, isConnected, status, chainId } = useAccount(); - const [receivingWalletAddress, setReceivingWalletAddress] = - useState(""); + const { data: walletBalance } = useBalance({ + address, + chainId, + }); + + const [withdrawAmount, setWithdrawAmount] = useState(""); + const [walletBalanceAmount, setWalletBalanceAmount] = useState("NA"); + const maxWithdrawAmount = new BigNumber(walletBalance?.formatted ?? "0"); function getActionBtnLabel() { switch (true) { @@ -28,6 +38,10 @@ export default function Withdraw() { } } + useEffect(() => { + setWalletBalanceAmount(walletBalance?.formatted ?? "NA"); // set wallet balance + }, [address, status, walletBalance]); + return (
@@ -35,23 +49,35 @@ export default function Withdraw() {

Withdraw DFI

-
-
+
+
How much do you want to withdraw?
- setWithdrawAmount(value)} + Icon={ + MDFI icon + } />
- - - +
+ + + +
+ +
+ + +
@@ -81,11 +119,33 @@ export default function Withdraw() { ); } -function TransactionRow({ label, value }: { label: string; value: string }) { +function TransactionRow({ + label, + value, + secondaryValue, + tooltipText, +}: { + label: string; + value: string; + secondaryValue?: string; + tooltipText?: string; +}) { return (
- {label} - {value} +
+ {label} + {tooltipText && ( + + + + )} +
+
+ {value} + {secondaryValue && ( + {secondaryValue} + )} +
); } @@ -93,9 +153,11 @@ function TransactionRow({ label, value }: { label: string; value: string }) { function WalletDetails({ isWalletConnected, style, + walletBalanceAmount, }: { isWalletConnected: boolean; style?: string; + walletBalanceAmount?: string; }) { return (
{isWalletConnected ? ( -

- Available: - walletAmount +

+ Available: + {walletBalanceAmount} mDFI

) : ( From 4bfb58eaf034466652e2910169cf3d632b0c0029 Mon Sep 17 00:00:00 2001 From: nattadex Date: Mon, 13 May 2024 14:25:14 +0800 Subject: [PATCH 009/200] passed in balance amt for mobile --- apps/web/src/app/app/withdraw/page.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/web/src/app/app/withdraw/page.tsx b/apps/web/src/app/app/withdraw/page.tsx index 2b911a1d..861bcddd 100644 --- a/apps/web/src/app/app/withdraw/page.tsx +++ b/apps/web/src/app/app/withdraw/page.tsx @@ -80,6 +80,7 @@ export default function Withdraw() { } /> From 2e39de63de957b2fe61b981b12129822f9627fff Mon Sep 17 00:00:00 2001 From: nattadex Date: Mon, 13 May 2024 17:18:26 +0800 Subject: [PATCH 010/200] allowed input card to be reusable --- apps/web/public/icons/mdfi-icon.svg | 50 +++++++++++++++++ apps/web/src/app/app/components/InputCard.tsx | 21 +++---- .../src/app/app/components/WalletDetails.tsx | 30 ++++++++++ apps/web/src/app/app/stake/page.tsx | 42 +++++--------- apps/web/src/app/app/withdraw/page.tsx | 56 +++++++------------ 5 files changed, 123 insertions(+), 76 deletions(-) create mode 100644 apps/web/public/icons/mdfi-icon.svg create mode 100644 apps/web/src/app/app/components/WalletDetails.tsx diff --git a/apps/web/public/icons/mdfi-icon.svg b/apps/web/public/icons/mdfi-icon.svg new file mode 100644 index 00000000..cd39ed09 --- /dev/null +++ b/apps/web/public/icons/mdfi-icon.svg @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/apps/web/src/app/app/components/InputCard.tsx b/apps/web/src/app/app/components/InputCard.tsx index c2c4bb6a..68558729 100644 --- a/apps/web/src/app/app/components/InputCard.tsx +++ b/apps/web/src/app/app/components/InputCard.tsx @@ -1,4 +1,3 @@ -import Image from "next/image"; import { useState } from "react"; import clsx from "clsx"; import BigNumber from "bignumber.js"; @@ -10,12 +9,14 @@ export function InputCard({ usdAmount, setAmount, onChange, + Icon, }: { maxAmount: BigNumber; // to calculate amount value: string; // to display amount in UI setAmount: (amount: string) => void; - usdAmount: string; + usdAmount?: string; onChange: (amount: string) => void; + Icon: JSX.Element; }) { const [focus, setFocus] = useState(false); const [errorMsg, setErrorMsg] = useState(null); @@ -45,15 +46,7 @@ export function InputCard({
- DFI icon + {Icon}
- ${usdAmount} + {usdAmount && ( + + ${usdAmount} + + )}
{/* Display only when wallet is connected*/} diff --git a/apps/web/src/app/app/components/WalletDetails.tsx b/apps/web/src/app/app/components/WalletDetails.tsx new file mode 100644 index 00000000..f42eb195 --- /dev/null +++ b/apps/web/src/app/app/components/WalletDetails.tsx @@ -0,0 +1,30 @@ +import clsx from "clsx"; +import React from "react"; + +export default function WalletDetails({ + isWalletConnected, + style, + walletBalanceAmount, +}: { + isWalletConnected: boolean; + style?: string; + walletBalanceAmount?: string; +}) { + return ( +
+ {isWalletConnected ? ( +

+ Available: + {walletBalanceAmount} DFI +

+ ) : ( + + Connect wallet to get started + + )} +
+ ); +} diff --git a/apps/web/src/app/app/stake/page.tsx b/apps/web/src/app/app/stake/page.tsx index 96f6bf27..f735539c 100644 --- a/apps/web/src/app/app/stake/page.tsx +++ b/apps/web/src/app/app/stake/page.tsx @@ -1,5 +1,6 @@ "use client"; +import Image from "next/image"; import { useBalance, useAccount } from "wagmi"; import { useEffect, useRef, useState } from "react"; import { ConnectKitButton } from "connectkit"; @@ -7,7 +8,7 @@ import { InputCard } from "@/app/app/components/InputCard"; import { CTAButton } from "@/components/button/CTAButton"; import Panel from "@/app/app/stake/components/Panel"; import AddressInput from "@/app/app/components/AddressInput"; -import clsx from "clsx"; +import WalletDetails from "@/app/app/components/WalletDetails"; import BigNumber from "bignumber.js"; import ConnectedWalletSwitch from "@/app/app/stake/components/ConnectedWalletSwitch"; @@ -106,6 +107,17 @@ export default function Stake() { : new BigNumber(stakeAmount) ).toFixed(2)} // TODO use USDT price to calculate DFI amount onChange={(value) => setStakeAmount(value)} + Icon={ + DFI icon + } />
); } - -function WalletDetails({ - isWalletConnected, - style, - walletBalanceAmount, -}: { - isWalletConnected: boolean; - style?: string; - walletBalanceAmount?: string; -}) { - return ( -
- {isWalletConnected ? ( -

- Available: - {walletBalanceAmount} DFI -

- ) : ( - - Connect wallet to get started - - )} -
- ); -} diff --git a/apps/web/src/app/app/withdraw/page.tsx b/apps/web/src/app/app/withdraw/page.tsx index b29dc680..56aaec27 100644 --- a/apps/web/src/app/app/withdraw/page.tsx +++ b/apps/web/src/app/app/withdraw/page.tsx @@ -1,19 +1,20 @@ "use client"; +import Image from "next/image"; import { useAccount } from "wagmi"; import React, { useState } from "react"; import { ConnectKitButton } from "connectkit"; import { CTAButton } from "@/components/button/CTAButton"; import Panel from "@/app/app/stake/components/Panel"; -import AddressInput from "@/app/app/components/AddressInput"; -import clsx from "clsx"; +import { InputCard } from "@/app/app/components/InputCard"; +import WalletDetails from "@/app/app/components/WalletDetails"; import ComplimentarySection from "@/app/app/withdraw/components/ComplimentarySection"; +import BigNumber from "bignumber.js"; export default function Withdraw() { const { isConnected } = useAccount(); - const [receivingWalletAddress, setReceivingWalletAddress] = - useState(""); + const [withdrawAmount, setWithdrawAmount] = useState(""); function getActionBtnLabel() { switch (true) { @@ -47,11 +48,22 @@ export default function Withdraw() {
- setWithdrawAmount(value)} + Icon={ + MDFI icon + } /> ); } - -function WalletDetails({ - isWalletConnected, - style, -}: { - isWalletConnected: boolean; - style?: string; -}) { - return ( -
- {isWalletConnected ? ( -

- Available: - walletAmount -

- ) : ( - - Connect wallet to get started - - )} -
- ); -} From 40ba858053606acae77dd5e7ad2bd44eaefc9e60 Mon Sep 17 00:00:00 2001 From: nattadex Date: Wed, 15 May 2024 14:28:40 +0800 Subject: [PATCH 011/200] update pnpm lock --- pnpm-lock.yaml | 619 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 461 insertions(+), 158 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 577f0e40..2015300d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -324,6 +324,10 @@ packages: resolution: {integrity: sha512-Xd6+v6SnjWVx/nus+y0l1sxMOTOMBkyL4+BIdbALyatQnAe/SRVjANeDPSCYaX+i1iJmuGSKf3Z+E+V/va1Hvw==} engines: {node: '>=6.9.0'} + '@babel/generator@7.24.5': + resolution: {integrity: sha512-x32i4hEXvr+iI0NEoEfDKzlemF8AmtOP8CcrRaEcpzysWuoEb1KknpcvMsHKPONoKZiDuItklgWhB18xEhr9PA==} + engines: {node: '>=6.9.0'} + '@babel/helper-annotate-as-pure@7.22.5': resolution: {integrity: sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==} engines: {node: '>=6.9.0'} @@ -342,6 +346,12 @@ packages: peerDependencies: '@babel/core': ^7.0.0 + '@babel/helper-create-class-features-plugin@7.24.5': + resolution: {integrity: sha512-uRc4Cv8UQWnE4NXlYTIIdM7wfFkOqlFztcC/gVXDKohKoVB3OyonfelUBaJzSwpBntZ2KYGF/9S7asCHsXwW6g==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + '@babel/helper-create-regexp-features-plugin@7.22.15': resolution: {integrity: sha512-29FkPLFjn4TPEa3RE7GpW+qbE8tlsu3jntNYNfcGsc49LphF1PQIiD+vMZ1z1xVOKt+93khA9tc2JBs3kBjA7w==} engines: {node: '>=6.9.0'} @@ -353,6 +363,11 @@ packages: peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + '@babel/helper-define-polyfill-provider@0.6.2': + resolution: {integrity: sha512-LV76g+C502biUK6AyZ3LK10vDpDyCzZnhZFXkH1L75zHPj68+qc8Zfpx2th+gzwA2MzyK+1g/3EPl62yFnVttQ==} + peerDependencies: + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + '@babel/helper-environment-visitor@7.22.20': resolution: {integrity: sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==} engines: {node: '>=6.9.0'} @@ -369,6 +384,10 @@ packages: resolution: {integrity: sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA==} engines: {node: '>=6.9.0'} + '@babel/helper-member-expression-to-functions@7.24.5': + resolution: {integrity: sha512-4owRteeihKWKamtqg4JmWSsEZU445xpFRXPEwp44HbgbxdWlUV1b4Agg4lkA806Lil5XM/e+FJyS0vj5T6vmcA==} + engines: {node: '>=6.9.0'} + '@babel/helper-module-imports@7.24.3': resolution: {integrity: sha512-viKb0F9f2s0BCS22QSF308z/+1YWKV/76mwt61NBzS5izMzDPwdq1pTrzf+Li3npBWX9KdQbkeCt1jSAM7lZqg==} engines: {node: '>=6.9.0'} @@ -387,6 +406,10 @@ packages: resolution: {integrity: sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==} engines: {node: '>=6.9.0'} + '@babel/helper-plugin-utils@7.24.5': + resolution: {integrity: sha512-xjNLDopRzW2o6ba0gKbkZq5YWEBaK3PCyTOY1K2P/O07LGMhMqlMXPxwN4S5/RhWuCobT8z0jrlKGlYmeR1OhQ==} + engines: {node: '>=6.9.0'} + '@babel/helper-remap-async-to-generator@7.22.20': resolution: {integrity: sha512-pBGyV4uBqOns+0UvhsTO8qgl8hO89PmiDYv+/COyp1aeMcmfrfruz+/nCMFiYyFF/Knn0yfrC85ZzNFjembFTw==} engines: {node: '>=6.9.0'} @@ -411,6 +434,10 @@ packages: resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} engines: {node: '>=6.9.0'} + '@babel/helper-split-export-declaration@7.24.5': + resolution: {integrity: sha512-5CHncttXohrHk8GWOFCcCl4oRD9fKosWlIRgWm4ql9VYioKm52Mk2xsmoohvm7f3JoiLSM5ZgJuRaf5QZZYd3Q==} + engines: {node: '>=6.9.0'} + '@babel/helper-string-parser@7.24.1': resolution: {integrity: sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==} engines: {node: '>=6.9.0'} @@ -419,6 +446,10 @@ packages: resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} engines: {node: '>=6.9.0'} + '@babel/helper-validator-identifier@7.24.5': + resolution: {integrity: sha512-3q93SSKX2TWCG30M2G2kwaKeTYgEUp5Snjuj8qm729SObL6nbtUldAi37qbxkD5gg3xnBio+f9nqpSepGZMvxA==} + engines: {node: '>=6.9.0'} + '@babel/helper-validator-option@7.23.5': resolution: {integrity: sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==} engines: {node: '>=6.9.0'} @@ -440,6 +471,11 @@ packages: engines: {node: '>=6.0.0'} hasBin: true + '@babel/parser@7.24.5': + resolution: {integrity: sha512-EOv5IK8arwh3LI47dz1b0tKUb/1uhHAnHJOrjgtQMIpu1uXd9mlFrJg9IUgGUgZ41Ch0K8REPTYpO7B76b4vJg==} + engines: {node: '>=6.0.0'} + hasBin: true + '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.24.4': resolution: {integrity: sha512-qpl6vOOEEzTLLcsuqYYo8yDtrTocmu2xkGvgNebvPjT9DTtfFYGmgDqY+rBYXNlqL4s9qLDn6xkrJv4RxAPiTA==} engines: {node: '>=6.9.0'} @@ -687,6 +723,12 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-block-scoping@7.24.5': + resolution: {integrity: sha512-sMfBc3OxghjC95BkYrYocHL3NaOplrcaunblzwXhGmlPwpmfsxr4vK+mBBt49r+S240vahmv+kUxkeKgs+haCw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-class-properties@7.24.1': resolution: {integrity: sha512-OMLCXi0NqvJfORTaPQBwqLXHhb93wkBKZ4aNwMl6WtehO7ar+cmp+89iPEQPqxAnxsOKTaMcs3POz3rKayJ72g==} engines: {node: '>=6.9.0'} @@ -705,6 +747,12 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-classes@7.24.5': + resolution: {integrity: sha512-gWkLP25DFj2dwe9Ck8uwMOpko4YsqyfZJrOmqqcegeDYEbp7rmn4U6UQZNj08UF6MaX39XenSpKRCvpDRBtZ7Q==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-computed-properties@7.24.1': resolution: {integrity: sha512-5pJGVIUfJpOS+pAqBQd+QMaTD2vCL/HcePooON6pDpHgRp4gNRmzyHTPIkXntwKsq3ayUFVfJaIKPw2pOkOcTw==} engines: {node: '>=6.9.0'} @@ -717,6 +765,12 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-destructuring@7.24.5': + resolution: {integrity: sha512-SZuuLyfxvsm+Ah57I/i1HVjveBENYK9ue8MJ7qkc7ndoNjqquJiElzA7f5yaAXjyW2hKojosOTAQQRX50bPSVg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-dotall-regex@7.24.1': resolution: {integrity: sha512-p7uUxgSoZwZ2lPNMzUkqCts3xlp8n+o05ikjy7gbtFJSt9gdU88jAmtfmOxHM14noQXBxfgzf2yRWECiNVhTCw==} engines: {node: '>=6.9.0'} @@ -867,6 +921,12 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-parameters@7.24.5': + resolution: {integrity: sha512-9Co00MqZ2aoky+4j2jhofErthm6QVLKbpQrvz20c3CH9KQCLHyNB+t2ya4/UrRpQGR+Wrwjg9foopoeSdnHOkA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-private-methods@7.24.1': resolution: {integrity: sha512-tGvisebwBO5em4PaYNqt4fkw56K2VALsAbAakY0FjTYqJp7gfdrgr7YX76Or8/cpik0W6+tj3rZ0uHU9Oil4tw==} engines: {node: '>=6.9.0'} @@ -879,6 +939,12 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-private-property-in-object@7.24.5': + resolution: {integrity: sha512-JM4MHZqnWR04jPMujQDTBVRnqxpLLpx2tkn7iPn+Hmsc0Gnb79yvRWOkvqFOx3Z7P7VxiRIR22c4eGSNj87OBQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-property-literals@7.24.1': resolution: {integrity: sha512-LetvD7CrHmEx0G442gOomRr66d7q8HzzGGr4PMHGr+5YIm6++Yke+jxj246rpvsbyhJwCLxcTn6zW1P1BSenqA==} engines: {node: '>=6.9.0'} @@ -891,8 +957,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-react-jsx-self@7.24.1': - resolution: {integrity: sha512-kDJgnPujTmAZ/9q2CN4m2/lRsUUPDvsG3+tSHWUJIzMGTt5U/b/fwWd3RO3n+5mjLrsBrVa5eKFRVSQbi3dF1w==} + '@babel/plugin-transform-react-jsx-self@7.24.5': + resolution: {integrity: sha512-RtCJoUO2oYrYwFPtR1/jkoBEcFuI1ae9a9IMxeyAVa3a1Ap4AnxmyIKG2b2FaJKqkidw/0cxRbWN+HOs6ZWd1w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -957,8 +1023,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-typescript@7.24.4': - resolution: {integrity: sha512-79t3CQ8+oBGk/80SQ8MN3Bs3obf83zJ0YZjDmDaEZN8MqhMI760apl5z6a20kFeMXBwJX99VpKT8CKxEBp5H1g==} + '@babel/plugin-transform-typescript@7.24.5': + resolution: {integrity: sha512-E0VWu/hk83BIFUWnsKZ4D81KXjN5L3MobvevOHErASk9IPwKHOkTgvqzvNo1yP/ePJWqqK2SpUR5z+KQbl6NVw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -1023,6 +1089,10 @@ packages: resolution: {integrity: sha512-dkxf7+hn8mFBwKjs9bvBlArzLVxVbS8usaPUDd5p2a9JCL9tB8OaOVN1isD4+Xyk4ns89/xeOmbQvgdK7IIVdA==} engines: {node: '>=6.9.0'} + '@babel/runtime@7.24.5': + resolution: {integrity: sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==} + engines: {node: '>=6.9.0'} + '@babel/template@7.24.0': resolution: {integrity: sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==} engines: {node: '>=6.9.0'} @@ -1031,10 +1101,18 @@ packages: resolution: {integrity: sha512-xuU6o9m68KeqZbQuDt2TcKSxUw/mrsvavlEqQ1leZ/B+C9tk6E4sRWy97WaXgvq5E+nU3cXMxv3WKOCanVMCmQ==} engines: {node: '>=6.9.0'} + '@babel/traverse@7.24.5': + resolution: {integrity: sha512-7aaBLeDQ4zYcUFDUD41lJc1fG8+5IU9DaNSJAgal866FGvmD5EbWQgnEC6kO1gGLsX0esNkfnJSndbTXA3r7UA==} + engines: {node: '>=6.9.0'} + '@babel/types@7.24.0': resolution: {integrity: sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==} engines: {node: '>=6.9.0'} + '@babel/types@7.24.5': + resolution: {integrity: sha512-6mQNsaLeXTw0nxYUYu+NSa4Hx4BlF1x1x8/PMFbiR+GBSr+2DkECc69b8hgy2frEodNcvPffeH8YfWd3LI6jhQ==} + engines: {node: '>=6.9.0'} + '@balena/dockerignore@1.0.2': resolution: {integrity: sha512-wMue2Sy4GAVTk6Ic4tJVcnfdau+gx2EnG7S+uAEe+TWJFqE4YoWN4/H8MSLj4eYJKxGg26lZwboEniNiNwZQ6Q==} @@ -2995,6 +3073,9 @@ packages: '@types/node@20.10.8': resolution: {integrity: sha512-f8nQs3cLxbAFc00vEU59yf9UyGUftkPaLGfvbVOIDdx2i1b8epBqj2aNGyP19fiyXWvlmZ7qC1XLjAzw/OKIeA==} + '@types/node@20.12.12': + resolution: {integrity: sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==} + '@types/node@20.12.7': resolution: {integrity: sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==} @@ -3534,6 +3615,9 @@ packages: ajv@8.12.0: resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==} + ajv@8.13.0: + resolution: {integrity: sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==} + amdefine@1.0.1: resolution: {integrity: sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg==} engines: {node: '>=0.4.2'} @@ -3854,6 +3938,11 @@ packages: peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + babel-plugin-polyfill-corejs2@0.4.11: + resolution: {integrity: sha512-sMEJ27L0gRHShOh5G54uAAPaiCOygY/5ratXuiyb2G46FmlSpc9eFCzYVyDiPxfNbwzA7mYahmjQc5q+CZQ09Q==} + peerDependencies: + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + babel-plugin-polyfill-corejs3@0.10.4: resolution: {integrity: sha512-25J6I8NGfa5YkCDogHRID3fVCadIR8/pGl1/spvCkzb6lVn6SR3ojpx9nOn9iEBcUsjY24AmdKm5khcfKdylcg==} peerDependencies: @@ -3864,6 +3953,11 @@ packages: peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + babel-plugin-polyfill-regenerator@0.6.2: + resolution: {integrity: sha512-2R25rQZWP63nGwaAswvDazbPXfrM3HwVoBXK6HcqeKrSrL/JqcC/rDcf95l4r7LXLyxDXc8uQDa064GubtCABg==} + peerDependencies: + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + babel-plugin-styled-components@2.1.4: resolution: {integrity: sha512-Xgp9g+A/cG47sUyRwwYxGM4bR/jDRg5N6it/8+HxCnbT5XNKSKDT9xm4oag/osgqjC2It/vH0yXsomOG6k558g==} peerDependencies: @@ -4696,6 +4790,9 @@ packages: dayjs@1.11.10: resolution: {integrity: sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==} + dayjs@1.11.11: + resolution: {integrity: sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg==} + death@1.1.0: resolution: {integrity: sha512-vsV6S4KVHvTGxbEcij7hkWRv0It+sGGWVOM67dQde/o5Xjnr+KmLjxWJii2uEObIrt1CcM9w0Yaovx+iOlIL+w==} @@ -5040,6 +5137,11 @@ packages: engines: {node: '>=4'} hasBin: true + envinfo@7.13.0: + resolution: {integrity: sha512-cvcaMr7KqXVh4nyzGTVqTum+gAiL265x5jUWQIDLq//zOGbW+gSW/C+OWLleY/rs9Qole6AZLMXPbtIFQbqu+Q==} + engines: {node: '>=4'} + hasBin: true + error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} @@ -6795,8 +6897,8 @@ packages: joi@17.12.2: resolution: {integrity: sha512-RonXAIzCiHLc8ss3Ibuz45u28GOsWE1UpfDXLbN/9NKbL4tCJf8TWYVKsoYuuh+sAUt7fsSNpA+r2+TBA6Wjmw==} - joi@17.12.3: - resolution: {integrity: sha512-2RRziagf555owrm9IRVtdKynOBeITiDpuZqIpgwqXShPncPKNiRQoiGsl/T8SQdq+8ugRzH2LqY67irr2y/d+g==} + joi@17.13.1: + resolution: {integrity: sha512-vaBlIKCyo4FCUtCm7Eu4QZd/q02bWcxfUO6YSXAZOWF6gzcLBeba8kwotUdYJjDLW8Cz8RywsSOqiNJZW0mNvg==} joycon@3.1.1: resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} @@ -7305,61 +7407,61 @@ packages: resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} engines: {node: '>= 0.6'} - metro-babel-transformer@0.80.8: - resolution: {integrity: sha512-TTzNwRZb2xxyv4J/+yqgtDAP2qVqH3sahsnFu6Xv4SkLqzrivtlnyUbaeTdJ9JjtADJUEjCbgbFgUVafrXdR9Q==} + metro-babel-transformer@0.80.9: + resolution: {integrity: sha512-d76BSm64KZam1nifRZlNJmtwIgAeZhZG3fi3K+EmPOlrR8rDtBxQHDSN3fSGeNB9CirdTyabTMQCkCup6BXFSQ==} engines: {node: '>=18'} - metro-cache-key@0.80.8: - resolution: {integrity: sha512-qWKzxrLsRQK5m3oH8ePecqCc+7PEhR03cJE6Z6AxAj0idi99dHOSitTmY0dclXVB9vP2tQIAE8uTd8xkYGk8fA==} + metro-cache-key@0.80.9: + resolution: {integrity: sha512-hRcYGhEiWIdM87hU0fBlcGr+tHDEAT+7LYNCW89p5JhErFt/QaAkVx4fb5bW3YtXGv5BTV7AspWPERoIb99CXg==} engines: {node: '>=18'} - metro-cache@0.80.8: - resolution: {integrity: sha512-5svz+89wSyLo7BxdiPDlwDTgcB9kwhNMfNhiBZPNQQs1vLFXxOkILwQiV5F2EwYT9DEr6OPZ0hnJkZfRQ8lDYQ==} + metro-cache@0.80.9: + resolution: {integrity: sha512-ujEdSI43QwI+Dj2xuNax8LMo8UgKuXJEdxJkzGPU6iIx42nYa1byQ+aADv/iPh5sh5a//h5FopraW5voXSgm2w==} engines: {node: '>=18'} - metro-config@0.80.8: - resolution: {integrity: sha512-VGQJpfJawtwRzGzGXVUoohpIkB0iPom4DmSbAppKfumdhtLA8uVeEPp2GM61kL9hRvdbMhdWA7T+hZFDlo4mJA==} + metro-config@0.80.9: + resolution: {integrity: sha512-28wW7CqS3eJrunRGnsibWldqgwRP9ywBEf7kg+uzUHkSFJNKPM1K3UNSngHmH0EZjomizqQA2Zi6/y6VdZMolg==} engines: {node: '>=18'} - metro-core@0.80.8: - resolution: {integrity: sha512-g6lud55TXeISRTleW6SHuPFZHtYrpwNqbyFIVd9j9Ofrb5IReiHp9Zl8xkAfZQp8v6ZVgyXD7c130QTsCz+vBw==} + metro-core@0.80.9: + resolution: {integrity: sha512-tbltWQn+XTdULkGdzHIxlxk4SdnKxttvQQV3wpqqFbHDteR4gwCyTR2RyYJvxgU7HELfHtrVbqgqAdlPByUSbg==} engines: {node: '>=18'} - metro-file-map@0.80.8: - resolution: {integrity: sha512-eQXMFM9ogTfDs2POq7DT2dnG7rayZcoEgRbHPXvhUWkVwiKkro2ngcBE++ck/7A36Cj5Ljo79SOkYwHaWUDYDw==} + metro-file-map@0.80.9: + resolution: {integrity: sha512-sBUjVtQMHagItJH/wGU9sn3k2u0nrCl0CdR4SFMO1tksXLKbkigyQx4cbpcyPVOAmGTVuy3jyvBlELaGCAhplQ==} engines: {node: '>=18'} - metro-minify-terser@0.80.8: - resolution: {integrity: sha512-y8sUFjVvdeUIINDuW1sejnIjkZfEF+7SmQo0EIpYbWmwh+kq/WMj74yVaBWuqNjirmUp1YNfi3alT67wlbBWBQ==} + metro-minify-terser@0.80.9: + resolution: {integrity: sha512-FEeCeFbkvvPuhjixZ1FYrXtO0araTpV6UbcnGgDUpH7s7eR5FG/PiJz3TsuuPP/HwCK19cZtQydcA2QrCw446A==} engines: {node: '>=18'} - metro-resolver@0.80.8: - resolution: {integrity: sha512-JdtoJkP27GGoZ2HJlEsxs+zO7jnDUCRrmwXJozTlIuzLHMRrxgIRRby9fTCbMhaxq+iA9c+wzm3iFb4NhPmLbQ==} + metro-resolver@0.80.9: + resolution: {integrity: sha512-wAPIjkN59BQN6gocVsAvvpZ1+LQkkqUaswlT++cJafE/e54GoVkMNCmrR4BsgQHr9DknZ5Um/nKueeN7kaEz9w==} engines: {node: '>=18'} - metro-runtime@0.80.8: - resolution: {integrity: sha512-2oScjfv6Yb79PelU1+p8SVrCMW9ZjgEiipxq7jMRn8mbbtWzyv3g8Mkwr+KwOoDFI/61hYPUbY8cUnu278+x1g==} + metro-runtime@0.80.9: + resolution: {integrity: sha512-8PTVIgrVcyU+X/rVCy/9yxNlvXsBCk5JwwkbAm/Dm+Abo6NBGtNjWF0M1Xo/NWCb4phamNWcD7cHdR91HhbJvg==} engines: {node: '>=18'} - metro-source-map@0.80.8: - resolution: {integrity: sha512-+OVISBkPNxjD4eEKhblRpBf463nTMk3KMEeYS8Z4xM/z3qujGJGSsWUGRtH27+c6zElaSGtZFiDMshEb8mMKQg==} + metro-source-map@0.80.9: + resolution: {integrity: sha512-RMn+XS4VTJIwMPOUSj61xlxgBvPeY4G6s5uIn6kt6HB6A/k9ekhr65UkkDD7WzHYs3a9o869qU8tvOZvqeQzgw==} engines: {node: '>=18'} - metro-symbolicate@0.80.8: - resolution: {integrity: sha512-nwhYySk79jQhwjL9QmOUo4wS+/0Au9joEryDWw7uj4kz2yvw1uBjwmlql3BprQCBzRdB3fcqOP8kO8Es+vE31g==} + metro-symbolicate@0.80.9: + resolution: {integrity: sha512-Ykae12rdqSs98hg41RKEToojuIW85wNdmSe/eHUgMkzbvCFNVgcC0w3dKZEhSsqQOXapXRlLtHkaHLil0UD/EA==} engines: {node: '>=18'} hasBin: true - metro-transform-plugins@0.80.8: - resolution: {integrity: sha512-sSu8VPL9Od7w98MftCOkQ1UDeySWbsIAS5I54rW22BVpPnI3fQ42srvqMLaJUQPjLehUanq8St6OMBCBgH/UWw==} + metro-transform-plugins@0.80.9: + resolution: {integrity: sha512-UlDk/uc8UdfLNJhPbF3tvwajyuuygBcyp+yBuS/q0z3QSuN/EbLllY3rK8OTD9n4h00qZ/qgxGv/lMFJkwP4vg==} engines: {node: '>=18'} - metro-transform-worker@0.80.8: - resolution: {integrity: sha512-+4FG3TQk3BTbNqGkFb2uCaxYTfsbuFOCKMMURbwu0ehCP8ZJuTUramkaNZoATS49NSAkRgUltgmBa4YaKZ5mqw==} + metro-transform-worker@0.80.9: + resolution: {integrity: sha512-c/IrzMUVnI0hSVVit4TXzt3A1GiUltGVlzCmLJWxNrBGHGrJhvgePj38+GXl1Xf4Fd4vx6qLUkKMQ3ux73bFLQ==} engines: {node: '>=18'} - metro@0.80.8: - resolution: {integrity: sha512-in7S0W11mg+RNmcXw+2d9S3zBGmCARDxIwoXJAmLUQOQoYsRP3cpGzyJtc7WOw8+FXfpgXvceD0u+PZIHXEL7g==} + metro@0.80.9: + resolution: {integrity: sha512-Bc57Xf3GO2Xe4UWQsBj/oW6YfLPABEu8jfDVDiNmJvoQW4CO34oDPuYKe4KlXzXhcuNsqOtSxpbjCRRVjhhREg==} engines: {node: '>=18'} hasBin: true @@ -7758,8 +7860,8 @@ packages: engines: {node: '>=8.9'} hasBin: true - ob1@0.80.8: - resolution: {integrity: sha512-QHJQk/lXMmAW8I7AIM3in1MSlwe1umR72Chhi8B7Xnq6mzjhBKkA6Fy/zAhQnGkA4S912EPCEvTij5yh+EQTAA==} + ob1@0.80.9: + resolution: {integrity: sha512-v9yOxowkZbxWhKOaaTyLjIm1aLy4ebMNcSn4NYJKOAI/Qv+SkfEfszpLr2GIxsccmb2Y2HA9qtsqiIJ80ucpVA==} engines: {node: '>=18'} obj-multiplex@1.0.0: @@ -8123,6 +8225,9 @@ packages: pino-abstract-transport@1.1.0: resolution: {integrity: sha512-lsleG3/2a/JIWUtf9Q5gUNErBqwIu1tUKTT3dUzaf5DySw9ra1wcqKjJjLX1VTY64Wk1eEOYsVGSaGfCK85ekA==} + pino-abstract-transport@1.2.0: + resolution: {integrity: sha512-Guhh8EZfPCfH+PMXAb6rKOjGQEoy0xlAIn+irODG5kgfYV+BQ0rGYYWTIel3P5mmyXqkYkPmdIkywsn6QKUR1Q==} + pino-http@8.6.1: resolution: {integrity: sha512-J0hiJgUExtBXP2BjrK4VB305tHXS31sCmWJ9XJo2wPkLHa1NFPuW4V9wjG27PAc2fmBCigiNhQKpvrx+kntBPA==} @@ -8144,6 +8249,10 @@ packages: resolution: {integrity: sha512-uhIfMj5TVp+WynVASaVEJFTncTUe4dHBq6CWplu/vBgvGHhvBvQfxz+vcOrnnBQdORH3izaGEurLfNlq3YxdFQ==} hasBin: true + pino@8.21.0: + resolution: {integrity: sha512-ip4qdzjkAyDDZklUaZkcRFb2iA118H9SgRh8yzTkSQK8HilsOJF7rSY8HoW5+I0M46AZgX/pxbprf2vvzQCE0Q==} + hasBin: true + pirates@4.0.6: resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} engines: {node: '>= 6'} @@ -8544,8 +8653,8 @@ packages: redux: optional: true - react-refresh@0.14.0: - resolution: {integrity: sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ==} + react-refresh@0.14.2: + resolution: {integrity: sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==} engines: {node: '>=0.10.0'} react-responsive@9.0.2: @@ -8968,6 +9077,11 @@ packages: engines: {node: '>=10'} hasBin: true + semver@7.6.2: + resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} + engines: {node: '>=10'} + hasBin: true + send@0.18.0: resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} engines: {node: '>= 0.8.0'} @@ -9543,6 +9657,11 @@ packages: engines: {node: '>=10'} hasBin: true + terser@5.31.0: + resolution: {integrity: sha512-Q1JFAoUKE5IMfI4Z/lkE/E6+SwgzO+x4tq4v1AyBLRj8VSYvRO6A/rQrPg1yud4g0En9EKI1TvFRF2tQFcoUkg==} + engines: {node: '>=10'} + hasBin: true + test-exclude@6.0.0: resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} engines: {node: '>=8'} @@ -9574,6 +9693,9 @@ packages: thread-stream@2.4.1: resolution: {integrity: sha512-d/Ex2iWd1whipbT681JmTINKw0ZwOUBZm7+Gjs64DHuX34mmw8vJL2bFAaNacaW72zYiTJxSHi5abUuOi5nsfg==} + thread-stream@2.7.0: + resolution: {integrity: sha512-qQiRWsU/wvNolI6tbbCKd9iKaTnCXsTwVxhhKM6nctPdujTyztjlbUkUTUymidWcMnZ5pWR0ej4a0tjsW021vw==} + throat@5.0.0: resolution: {integrity: sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==} @@ -10545,6 +10667,11 @@ packages: engines: {node: '>= 14'} hasBin: true + yaml@2.4.2: + resolution: {integrity: sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA==} + engines: {node: '>= 14'} + hasBin: true + yargs-parser@18.1.3: resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} engines: {node: '>=6'} @@ -10717,6 +10844,13 @@ snapshots: '@jridgewell/trace-mapping': 0.3.25 jsesc: 2.5.2 + '@babel/generator@7.24.5': + dependencies: + '@babel/types': 7.24.5 + '@jridgewell/gen-mapping': 0.3.5 + '@jridgewell/trace-mapping': 0.3.25 + jsesc: 2.5.2 + '@babel/helper-annotate-as-pure@7.22.5': dependencies: '@babel/types': 7.24.0 @@ -10746,6 +10880,19 @@ snapshots: '@babel/helper-split-export-declaration': 7.22.6 semver: 6.3.1 + '@babel/helper-create-class-features-plugin@7.24.5(@babel/core@7.24.4)': + dependencies: + '@babel/core': 7.24.4 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-member-expression-to-functions': 7.24.5 + '@babel/helper-optimise-call-expression': 7.22.5 + '@babel/helper-replace-supers': 7.24.1(@babel/core@7.24.4) + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + '@babel/helper-split-export-declaration': 7.24.5 + semver: 6.3.1 + '@babel/helper-create-regexp-features-plugin@7.22.15(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 @@ -10764,6 +10911,17 @@ snapshots: transitivePeerDependencies: - supports-color + '@babel/helper-define-polyfill-provider@0.6.2(@babel/core@7.24.4)': + dependencies: + '@babel/core': 7.24.4 + '@babel/helper-compilation-targets': 7.23.6 + '@babel/helper-plugin-utils': 7.24.5 + debug: 4.3.4(supports-color@5.5.0) + lodash.debounce: 4.0.8 + resolve: 1.22.8 + transitivePeerDependencies: + - supports-color + '@babel/helper-environment-visitor@7.22.20': {} '@babel/helper-function-name@7.23.0': @@ -10779,6 +10937,10 @@ snapshots: dependencies: '@babel/types': 7.24.0 + '@babel/helper-member-expression-to-functions@7.24.5': + dependencies: + '@babel/types': 7.24.5 + '@babel/helper-module-imports@7.24.3': dependencies: '@babel/types': 7.24.0 @@ -10798,6 +10960,8 @@ snapshots: '@babel/helper-plugin-utils@7.24.0': {} + '@babel/helper-plugin-utils@7.24.5': {} + '@babel/helper-remap-async-to-generator@7.22.20(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 @@ -10824,10 +10988,16 @@ snapshots: dependencies: '@babel/types': 7.24.0 + '@babel/helper-split-export-declaration@7.24.5': + dependencies: + '@babel/types': 7.24.5 + '@babel/helper-string-parser@7.24.1': {} '@babel/helper-validator-identifier@7.22.20': {} + '@babel/helper-validator-identifier@7.24.5': {} + '@babel/helper-validator-option@7.23.5': {} '@babel/helper-wrap-function@7.22.20': @@ -10855,6 +11025,10 @@ snapshots: dependencies: '@babel/types': 7.24.0 + '@babel/parser@7.24.5': + dependencies: + '@babel/types': 7.24.5 + '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.24.4(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 @@ -10883,32 +11057,32 @@ snapshots: dependencies: '@babel/core': 7.24.4 '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.5 '@babel/helper-remap-async-to-generator': 7.22.20(@babel/core@7.24.4) '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.24.4) '@babel/plugin-proposal-class-properties@7.18.6(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 - '@babel/helper-create-class-features-plugin': 7.24.4(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-create-class-features-plugin': 7.24.5(@babel/core@7.24.4) + '@babel/helper-plugin-utils': 7.24.5 '@babel/plugin-proposal-export-default-from@7.24.1(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.5 '@babel/plugin-syntax-export-default-from': 7.24.1(@babel/core@7.24.4) '@babel/plugin-proposal-nullish-coalescing-operator@7.18.6(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.5 '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.24.4) '@babel/plugin-proposal-numeric-separator@7.18.6(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.5 '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.24.4) '@babel/plugin-proposal-object-rest-spread@7.20.7(@babel/core@7.24.4)': @@ -10916,20 +11090,20 @@ snapshots: '@babel/compat-data': 7.24.4 '@babel/core': 7.24.4 '@babel/helper-compilation-targets': 7.23.6 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.5 '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.24.4) - '@babel/plugin-transform-parameters': 7.24.1(@babel/core@7.24.4) + '@babel/plugin-transform-parameters': 7.24.5(@babel/core@7.24.4) '@babel/plugin-proposal-optional-catch-binding@7.18.6(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.5 '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.24.4) '@babel/plugin-proposal-optional-chaining@7.21.0(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.5 '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.4) @@ -10971,7 +11145,7 @@ snapshots: '@babel/plugin-syntax-export-default-from@7.24.1(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.5 '@babel/plugin-syntax-export-namespace-from@7.8.3(@babel/core@7.24.4)': dependencies: @@ -10981,7 +11155,7 @@ snapshots: '@babel/plugin-syntax-flow@7.24.1(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.5 '@babel/plugin-syntax-import-assertions@7.24.1(@babel/core@7.24.4)': dependencies: @@ -11089,6 +11263,11 @@ snapshots: '@babel/core': 7.24.4 '@babel/helper-plugin-utils': 7.24.0 + '@babel/plugin-transform-block-scoping@7.24.5(@babel/core@7.24.4)': + dependencies: + '@babel/core': 7.24.4 + '@babel/helper-plugin-utils': 7.24.5 + '@babel/plugin-transform-class-properties@7.24.1(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 @@ -11114,6 +11293,18 @@ snapshots: '@babel/helper-split-export-declaration': 7.22.6 globals: 11.12.0 + '@babel/plugin-transform-classes@7.24.5(@babel/core@7.24.4)': + dependencies: + '@babel/core': 7.24.4 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-compilation-targets': 7.23.6 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-plugin-utils': 7.24.5 + '@babel/helper-replace-supers': 7.24.1(@babel/core@7.24.4) + '@babel/helper-split-export-declaration': 7.24.5 + globals: 11.12.0 + '@babel/plugin-transform-computed-properties@7.24.1(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 @@ -11125,6 +11316,11 @@ snapshots: '@babel/core': 7.24.4 '@babel/helper-plugin-utils': 7.24.0 + '@babel/plugin-transform-destructuring@7.24.5(@babel/core@7.24.4)': + dependencies: + '@babel/core': 7.24.4 + '@babel/helper-plugin-utils': 7.24.5 + '@babel/plugin-transform-dotall-regex@7.24.1(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 @@ -11157,7 +11353,7 @@ snapshots: '@babel/plugin-transform-flow-strip-types@7.24.1(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.5 '@babel/plugin-syntax-flow': 7.24.1(@babel/core@7.24.4) '@babel/plugin-transform-for-of@7.24.1(@babel/core@7.24.4)': @@ -11277,6 +11473,11 @@ snapshots: '@babel/core': 7.24.4 '@babel/helper-plugin-utils': 7.24.0 + '@babel/plugin-transform-parameters@7.24.5(@babel/core@7.24.4)': + dependencies: + '@babel/core': 7.24.4 + '@babel/helper-plugin-utils': 7.24.5 + '@babel/plugin-transform-private-methods@7.24.1(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 @@ -11291,6 +11492,14 @@ snapshots: '@babel/helper-plugin-utils': 7.24.0 '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.24.4) + '@babel/plugin-transform-private-property-in-object@7.24.5(@babel/core@7.24.4)': + dependencies: + '@babel/core': 7.24.4 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-create-class-features-plugin': 7.24.5(@babel/core@7.24.4) + '@babel/helper-plugin-utils': 7.24.5 + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.24.4) + '@babel/plugin-transform-property-literals@7.24.1(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 @@ -11299,26 +11508,26 @@ snapshots: '@babel/plugin-transform-react-display-name@7.24.1(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.5 - '@babel/plugin-transform-react-jsx-self@7.24.1(@babel/core@7.24.4)': + '@babel/plugin-transform-react-jsx-self@7.24.5(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.5 '@babel/plugin-transform-react-jsx-source@7.24.1(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.5 '@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 '@babel/helper-annotate-as-pure': 7.22.5 '@babel/helper-module-imports': 7.24.3 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.5 '@babel/plugin-syntax-jsx': 7.24.1(@babel/core@7.24.4) - '@babel/types': 7.24.0 + '@babel/types': 7.24.5 '@babel/plugin-transform-regenerator@7.24.1(@babel/core@7.24.4)': dependencies: @@ -11335,10 +11544,10 @@ snapshots: dependencies: '@babel/core': 7.24.4 '@babel/helper-module-imports': 7.24.3 - '@babel/helper-plugin-utils': 7.24.0 - babel-plugin-polyfill-corejs2: 0.4.10(@babel/core@7.24.4) + '@babel/helper-plugin-utils': 7.24.5 + babel-plugin-polyfill-corejs2: 0.4.11(@babel/core@7.24.4) babel-plugin-polyfill-corejs3: 0.10.4(@babel/core@7.24.4) - babel-plugin-polyfill-regenerator: 0.6.1(@babel/core@7.24.4) + babel-plugin-polyfill-regenerator: 0.6.2(@babel/core@7.24.4) semver: 6.3.1 transitivePeerDependencies: - supports-color @@ -11369,12 +11578,12 @@ snapshots: '@babel/core': 7.24.4 '@babel/helper-plugin-utils': 7.24.0 - '@babel/plugin-transform-typescript@7.24.4(@babel/core@7.24.4)': + '@babel/plugin-transform-typescript@7.24.5(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 '@babel/helper-annotate-as-pure': 7.22.5 - '@babel/helper-create-class-features-plugin': 7.24.4(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-create-class-features-plugin': 7.24.5(@babel/core@7.24.4) + '@babel/helper-plugin-utils': 7.24.5 '@babel/plugin-syntax-typescript': 7.24.1(@babel/core@7.24.4) '@babel/plugin-transform-unicode-escapes@7.24.1(@babel/core@7.24.4)': @@ -11490,7 +11699,7 @@ snapshots: '@babel/preset-flow@7.24.1(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.5 '@babel/helper-validator-option': 7.23.5 '@babel/plugin-transform-flow-strip-types': 7.24.1(@babel/core@7.24.4) @@ -11504,11 +11713,11 @@ snapshots: '@babel/preset-typescript@7.24.1(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.5 '@babel/helper-validator-option': 7.23.5 '@babel/plugin-syntax-jsx': 7.24.1(@babel/core@7.24.4) '@babel/plugin-transform-modules-commonjs': 7.24.1(@babel/core@7.24.4) - '@babel/plugin-transform-typescript': 7.24.4(@babel/core@7.24.4) + '@babel/plugin-transform-typescript': 7.24.5(@babel/core@7.24.4) '@babel/register@7.23.7(@babel/core@7.24.4)': dependencies: @@ -11525,6 +11734,10 @@ snapshots: dependencies: regenerator-runtime: 0.14.1 + '@babel/runtime@7.24.5': + dependencies: + regenerator-runtime: 0.14.1 + '@babel/template@7.24.0': dependencies: '@babel/code-frame': 7.24.2 @@ -11546,12 +11759,33 @@ snapshots: transitivePeerDependencies: - supports-color + '@babel/traverse@7.24.5': + dependencies: + '@babel/code-frame': 7.24.2 + '@babel/generator': 7.24.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-hoist-variables': 7.22.5 + '@babel/helper-split-export-declaration': 7.24.5 + '@babel/parser': 7.24.5 + '@babel/types': 7.24.5 + debug: 4.3.4(supports-color@5.5.0) + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + '@babel/types@7.24.0': dependencies: '@babel/helper-string-parser': 7.24.1 '@babel/helper-validator-identifier': 7.22.20 to-fast-properties: 2.0.0 + '@babel/types@7.24.5': + dependencies: + '@babel/helper-string-parser': 7.24.1 + '@babel/helper-validator-identifier': 7.24.5 + to-fast-properties: 2.0.0 + '@balena/dockerignore@1.0.2': {} '@bcoe/v8-coverage@0.2.3': {} @@ -12676,7 +12910,7 @@ snapshots: dependencies: '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 20.12.7 + '@types/node': 20.12.12 '@types/yargs': 15.0.19 chalk: 4.1.2 @@ -13531,7 +13765,7 @@ snapshots: cosmiconfig: 5.2.1 deepmerge: 4.3.1 glob: 7.2.3 - joi: 17.12.3 + joi: 17.13.1 transitivePeerDependencies: - encoding @@ -13550,15 +13784,15 @@ snapshots: chalk: 4.1.2 command-exists: 1.2.9 deepmerge: 4.3.1 - envinfo: 7.12.0 + envinfo: 7.13.0 execa: 5.1.1 hermes-profile-transformer: 0.0.6 node-stream-zip: 1.15.0 ora: 5.4.1 - semver: 7.6.0 + semver: 7.6.2 strip-ansi: 5.2.0 wcwidth: 1.0.1 - yaml: 2.4.1 + yaml: 2.4.2 transitivePeerDependencies: - encoding @@ -13621,7 +13855,7 @@ snapshots: node-fetch: 2.7.0 open: 6.4.0 ora: 5.4.1 - semver: 7.6.0 + semver: 7.6.2 shell-quote: 1.8.1 sudo-prompt: 9.2.1 transitivePeerDependencies: @@ -13629,7 +13863,7 @@ snapshots: '@react-native-community/cli-types@12.3.6': dependencies: - joi: 17.12.3 + joi: 17.13.1 '@react-native-community/cli@12.3.6(bufferutil@4.0.8)(utf-8-validate@6.0.3)': dependencies: @@ -13650,7 +13884,7 @@ snapshots: fs-extra: 8.1.0 graceful-fs: 4.2.11 prompts: 2.4.2 - semver: 7.6.0 + semver: 7.6.2 transitivePeerDependencies: - bufferutil - encoding @@ -13684,39 +13918,39 @@ snapshots: '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.4) '@babel/plugin-transform-arrow-functions': 7.24.1(@babel/core@7.24.4) '@babel/plugin-transform-async-to-generator': 7.24.1(@babel/core@7.24.4) - '@babel/plugin-transform-block-scoping': 7.24.4(@babel/core@7.24.4) - '@babel/plugin-transform-classes': 7.24.1(@babel/core@7.24.4) + '@babel/plugin-transform-block-scoping': 7.24.5(@babel/core@7.24.4) + '@babel/plugin-transform-classes': 7.24.5(@babel/core@7.24.4) '@babel/plugin-transform-computed-properties': 7.24.1(@babel/core@7.24.4) - '@babel/plugin-transform-destructuring': 7.24.1(@babel/core@7.24.4) + '@babel/plugin-transform-destructuring': 7.24.5(@babel/core@7.24.4) '@babel/plugin-transform-flow-strip-types': 7.24.1(@babel/core@7.24.4) '@babel/plugin-transform-function-name': 7.24.1(@babel/core@7.24.4) '@babel/plugin-transform-literals': 7.24.1(@babel/core@7.24.4) '@babel/plugin-transform-modules-commonjs': 7.24.1(@babel/core@7.24.4) '@babel/plugin-transform-named-capturing-groups-regex': 7.22.5(@babel/core@7.24.4) - '@babel/plugin-transform-parameters': 7.24.1(@babel/core@7.24.4) + '@babel/plugin-transform-parameters': 7.24.5(@babel/core@7.24.4) '@babel/plugin-transform-private-methods': 7.24.1(@babel/core@7.24.4) - '@babel/plugin-transform-private-property-in-object': 7.24.1(@babel/core@7.24.4) + '@babel/plugin-transform-private-property-in-object': 7.24.5(@babel/core@7.24.4) '@babel/plugin-transform-react-display-name': 7.24.1(@babel/core@7.24.4) '@babel/plugin-transform-react-jsx': 7.23.4(@babel/core@7.24.4) - '@babel/plugin-transform-react-jsx-self': 7.24.1(@babel/core@7.24.4) + '@babel/plugin-transform-react-jsx-self': 7.24.5(@babel/core@7.24.4) '@babel/plugin-transform-react-jsx-source': 7.24.1(@babel/core@7.24.4) '@babel/plugin-transform-runtime': 7.24.3(@babel/core@7.24.4) '@babel/plugin-transform-shorthand-properties': 7.24.1(@babel/core@7.24.4) '@babel/plugin-transform-spread': 7.24.1(@babel/core@7.24.4) '@babel/plugin-transform-sticky-regex': 7.24.1(@babel/core@7.24.4) - '@babel/plugin-transform-typescript': 7.24.4(@babel/core@7.24.4) + '@babel/plugin-transform-typescript': 7.24.5(@babel/core@7.24.4) '@babel/plugin-transform-unicode-regex': 7.24.1(@babel/core@7.24.4) '@babel/template': 7.24.0 '@react-native/babel-plugin-codegen': 0.73.4(@babel/preset-env@7.24.4(@babel/core@7.24.4)) babel-plugin-transform-flow-enums: 0.0.2(@babel/core@7.24.4) - react-refresh: 0.14.0 + react-refresh: 0.14.2 transitivePeerDependencies: - '@babel/preset-env' - supports-color '@react-native/codegen@0.73.3(@babel/preset-env@7.24.4(@babel/core@7.24.4))': dependencies: - '@babel/parser': 7.24.4 + '@babel/parser': 7.24.5 '@babel/preset-env': 7.24.4(@babel/core@7.24.4) flow-parser: 0.206.0 glob: 7.2.3 @@ -13735,9 +13969,9 @@ snapshots: '@react-native/metro-babel-transformer': 0.73.15(@babel/core@7.24.4)(@babel/preset-env@7.24.4(@babel/core@7.24.4)) chalk: 4.1.2 execa: 5.1.1 - metro: 0.80.8(bufferutil@4.0.8)(utf-8-validate@6.0.3) - metro-config: 0.80.8(bufferutil@4.0.8)(utf-8-validate@6.0.3) - metro-core: 0.80.8 + metro: 0.80.9(bufferutil@4.0.8)(utf-8-validate@6.0.3) + metro-config: 0.80.9(bufferutil@4.0.8)(utf-8-validate@6.0.3) + metro-core: 0.80.9 node-fetch: 2.7.0 readline: 1.3.0 transitivePeerDependencies: @@ -14497,6 +14731,10 @@ snapshots: dependencies: undici-types: 5.26.5 + '@types/node@20.12.12': + dependencies: + undici-types: 5.26.5 + '@types/node@20.12.7': dependencies: undici-types: 5.26.5 @@ -14586,12 +14824,12 @@ snapshots: '@types/tar-fs@2.0.4': dependencies: - '@types/node': 20.12.7 + '@types/node': 20.12.12 '@types/tar-stream': 3.1.3 '@types/tar-stream@3.1.3': dependencies: - '@types/node': 20.12.7 + '@types/node': 20.12.12 '@types/trusted-types@2.0.7': {} @@ -15628,6 +15866,10 @@ snapshots: optionalDependencies: ajv: 8.12.0 + ajv-formats@2.1.1(ajv@8.13.0): + optionalDependencies: + ajv: 8.13.0 + ajv-formats@3.0.1(ajv@8.12.0): optionalDependencies: ajv: 8.12.0 @@ -15636,9 +15878,9 @@ snapshots: dependencies: ajv: 6.12.6 - ajv-keywords@5.1.0(ajv@8.12.0): + ajv-keywords@5.1.0(ajv@8.13.0): dependencies: - ajv: 8.12.0 + ajv: 8.13.0 fast-deep-equal: 3.1.3 ajv@6.12.6: @@ -15662,6 +15904,13 @@ snapshots: require-from-string: 2.0.2 uri-js: 4.4.1 + ajv@8.13.0: + dependencies: + fast-deep-equal: 3.1.3 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + uri-js: 4.4.1 + amdefine@1.0.1: optional: true @@ -16022,6 +16271,15 @@ snapshots: transitivePeerDependencies: - supports-color + babel-plugin-polyfill-corejs2@0.4.11(@babel/core@7.24.4): + dependencies: + '@babel/compat-data': 7.24.4 + '@babel/core': 7.24.4 + '@babel/helper-define-polyfill-provider': 0.6.2(@babel/core@7.24.4) + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + babel-plugin-polyfill-corejs3@0.10.4(@babel/core@7.24.4): dependencies: '@babel/core': 7.24.4 @@ -16037,6 +16295,13 @@ snapshots: transitivePeerDependencies: - supports-color + babel-plugin-polyfill-regenerator@0.6.2(@babel/core@7.24.4): + dependencies: + '@babel/core': 7.24.4 + '@babel/helper-define-polyfill-provider': 0.6.2(@babel/core@7.24.4) + transitivePeerDependencies: + - supports-color + babel-plugin-styled-components@2.1.4(@babel/core@7.24.4)(styled-components@5.3.11(@babel/core@7.24.4)(react-dom@18.2.0(react@18.2.0))(react-is@18.2.0)(react@18.2.0)): dependencies: '@babel/helper-annotate-as-pure': 7.22.5 @@ -16487,7 +16752,7 @@ snapshots: chromium-edge-launcher@1.0.0: dependencies: - '@types/node': 20.12.7 + '@types/node': 20.12.12 escape-string-regexp: 4.0.0 is-wsl: 2.2.0 lighthouse-logger: 1.4.2 @@ -17067,6 +17332,8 @@ snapshots: dayjs@1.11.10: {} + dayjs@1.11.11: {} + death@1.1.0: {} debounce@1.2.1: {} @@ -17406,6 +17673,8 @@ snapshots: envinfo@7.12.0: {} + envinfo@7.13.0: {} + error-ex@1.3.2: dependencies: is-arrayish: 0.2.1 @@ -20106,7 +20375,7 @@ snapshots: '@sideway/formula': 3.0.1 '@sideway/pinpoint': 2.0.0 - joi@17.12.3: + joi@17.13.1: dependencies: '@hapi/hoek': 9.3.0 '@hapi/topo': 5.1.0 @@ -20142,7 +20411,7 @@ snapshots: jscodeshift@0.14.0(@babel/preset-env@7.24.4(@babel/core@7.24.4)): dependencies: '@babel/core': 7.24.4 - '@babel/parser': 7.24.4 + '@babel/parser': 7.24.5 '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.24.4) '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6(@babel/core@7.24.4) '@babel/plugin-proposal-optional-chaining': 7.21.0(@babel/core@7.24.4) @@ -20542,7 +20811,7 @@ snapshots: logkitty@0.7.1: dependencies: ansi-fragments: 0.2.1 - dayjs: 1.11.10 + dayjs: 1.11.11 yargs: 15.4.1 loglevel-plugin-prefix@0.8.4: {} @@ -20676,7 +20945,7 @@ snapshots: methods@1.1.2: {} - metro-babel-transformer@0.80.8: + metro-babel-transformer@0.80.9: dependencies: '@babel/core': 7.24.4 hermes-parser: 0.20.1 @@ -20684,34 +20953,34 @@ snapshots: transitivePeerDependencies: - supports-color - metro-cache-key@0.80.8: {} + metro-cache-key@0.80.9: {} - metro-cache@0.80.8: + metro-cache@0.80.9: dependencies: - metro-core: 0.80.8 + metro-core: 0.80.9 rimraf: 3.0.2 - metro-config@0.80.8(bufferutil@4.0.8)(utf-8-validate@6.0.3): + metro-config@0.80.9(bufferutil@4.0.8)(utf-8-validate@6.0.3): dependencies: connect: 3.7.0 cosmiconfig: 5.2.1 jest-validate: 29.7.0 - metro: 0.80.8(bufferutil@4.0.8)(utf-8-validate@6.0.3) - metro-cache: 0.80.8 - metro-core: 0.80.8 - metro-runtime: 0.80.8 + metro: 0.80.9(bufferutil@4.0.8)(utf-8-validate@6.0.3) + metro-cache: 0.80.9 + metro-core: 0.80.9 + metro-runtime: 0.80.9 transitivePeerDependencies: - bufferutil - encoding - supports-color - utf-8-validate - metro-core@0.80.8: + metro-core@0.80.9: dependencies: lodash.throttle: 4.1.1 - metro-resolver: 0.80.8 + metro-resolver: 0.80.9 - metro-file-map@0.80.8: + metro-file-map@0.80.9: dependencies: anymatch: 3.1.3 debug: 2.6.9 @@ -20728,33 +20997,33 @@ snapshots: transitivePeerDependencies: - supports-color - metro-minify-terser@0.80.8: + metro-minify-terser@0.80.9: dependencies: - terser: 5.30.3 + terser: 5.31.0 - metro-resolver@0.80.8: {} + metro-resolver@0.80.9: {} - metro-runtime@0.80.8: + metro-runtime@0.80.9: dependencies: - '@babel/runtime': 7.24.4 + '@babel/runtime': 7.24.5 - metro-source-map@0.80.8: + metro-source-map@0.80.9: dependencies: - '@babel/traverse': 7.24.1(supports-color@5.5.0) - '@babel/types': 7.24.0 + '@babel/traverse': 7.24.5 + '@babel/types': 7.24.5 invariant: 2.2.4 - metro-symbolicate: 0.80.8 + metro-symbolicate: 0.80.9 nullthrows: 1.1.1 - ob1: 0.80.8 + ob1: 0.80.9 source-map: 0.5.7 vlq: 1.0.1 transitivePeerDependencies: - supports-color - metro-symbolicate@0.80.8: + metro-symbolicate@0.80.9: dependencies: invariant: 2.2.4 - metro-source-map: 0.80.8 + metro-source-map: 0.80.9 nullthrows: 1.1.1 source-map: 0.5.7 through2: 2.0.5 @@ -20762,29 +21031,29 @@ snapshots: transitivePeerDependencies: - supports-color - metro-transform-plugins@0.80.8: + metro-transform-plugins@0.80.9: dependencies: '@babel/core': 7.24.4 - '@babel/generator': 7.24.4 + '@babel/generator': 7.24.5 '@babel/template': 7.24.0 - '@babel/traverse': 7.24.1(supports-color@5.5.0) + '@babel/traverse': 7.24.5 nullthrows: 1.1.1 transitivePeerDependencies: - supports-color - metro-transform-worker@0.80.8(bufferutil@4.0.8)(utf-8-validate@6.0.3): + metro-transform-worker@0.80.9(bufferutil@4.0.8)(utf-8-validate@6.0.3): dependencies: '@babel/core': 7.24.4 - '@babel/generator': 7.24.4 - '@babel/parser': 7.24.4 - '@babel/types': 7.24.0 - metro: 0.80.8(bufferutil@4.0.8)(utf-8-validate@6.0.3) - metro-babel-transformer: 0.80.8 - metro-cache: 0.80.8 - metro-cache-key: 0.80.8 - metro-minify-terser: 0.80.8 - metro-source-map: 0.80.8 - metro-transform-plugins: 0.80.8 + '@babel/generator': 7.24.5 + '@babel/parser': 7.24.5 + '@babel/types': 7.24.5 + metro: 0.80.9(bufferutil@4.0.8)(utf-8-validate@6.0.3) + metro-babel-transformer: 0.80.9 + metro-cache: 0.80.9 + metro-cache-key: 0.80.9 + metro-minify-terser: 0.80.9 + metro-source-map: 0.80.9 + metro-transform-plugins: 0.80.9 nullthrows: 1.1.1 transitivePeerDependencies: - bufferutil @@ -20792,15 +21061,15 @@ snapshots: - supports-color - utf-8-validate - metro@0.80.8(bufferutil@4.0.8)(utf-8-validate@6.0.3): + metro@0.80.9(bufferutil@4.0.8)(utf-8-validate@6.0.3): dependencies: '@babel/code-frame': 7.24.2 '@babel/core': 7.24.4 - '@babel/generator': 7.24.4 - '@babel/parser': 7.24.4 + '@babel/generator': 7.24.5 + '@babel/parser': 7.24.5 '@babel/template': 7.24.0 - '@babel/traverse': 7.24.1(supports-color@5.5.0) - '@babel/types': 7.24.0 + '@babel/traverse': 7.24.5 + '@babel/types': 7.24.5 accepts: 1.3.8 chalk: 4.1.2 ci-info: 2.0.0 @@ -20815,18 +21084,18 @@ snapshots: jest-worker: 29.7.0 jsc-safe-url: 0.2.4 lodash.throttle: 4.1.1 - metro-babel-transformer: 0.80.8 - metro-cache: 0.80.8 - metro-cache-key: 0.80.8 - metro-config: 0.80.8(bufferutil@4.0.8)(utf-8-validate@6.0.3) - metro-core: 0.80.8 - metro-file-map: 0.80.8 - metro-resolver: 0.80.8 - metro-runtime: 0.80.8 - metro-source-map: 0.80.8 - metro-symbolicate: 0.80.8 - metro-transform-plugins: 0.80.8 - metro-transform-worker: 0.80.8(bufferutil@4.0.8)(utf-8-validate@6.0.3) + metro-babel-transformer: 0.80.9 + metro-cache: 0.80.9 + metro-cache-key: 0.80.9 + metro-config: 0.80.9(bufferutil@4.0.8)(utf-8-validate@6.0.3) + metro-core: 0.80.9 + metro-file-map: 0.80.9 + metro-resolver: 0.80.9 + metro-runtime: 0.80.9 + metro-source-map: 0.80.9 + metro-symbolicate: 0.80.9 + metro-transform-plugins: 0.80.9 + metro-transform-worker: 0.80.9(bufferutil@4.0.8)(utf-8-validate@6.0.3) mime-types: 2.1.35 node-fetch: 2.7.0 nullthrows: 1.1.1 @@ -21258,7 +21527,7 @@ snapshots: transitivePeerDependencies: - supports-color - ob1@0.80.8: {} + ob1@0.80.9: {} obj-multiplex@1.0.0: dependencies: @@ -21611,10 +21880,15 @@ snapshots: readable-stream: 4.5.2 split2: 4.2.0 + pino-abstract-transport@1.2.0: + dependencies: + readable-stream: 4.5.2 + split2: 4.2.0 + pino-http@8.6.1: dependencies: get-caller-file: 2.0.5 - pino: 8.20.0 + pino: 8.21.0 pino-std-serializers: 6.2.2 process-warning: 3.0.0 @@ -21667,6 +21941,20 @@ snapshots: sonic-boom: 3.8.1 thread-stream: 2.4.1 + pino@8.21.0: + dependencies: + atomic-sleep: 1.0.0 + fast-redact: 3.5.0 + on-exit-leak-free: 2.1.2 + pino-abstract-transport: 1.2.0 + pino-std-serializers: 6.2.2 + process-warning: 3.0.0 + quick-format-unescaped: 4.0.4 + real-require: 0.2.0 + safe-stable-stringify: 2.4.3 + sonic-boom: 3.8.1 + thread-stream: 2.7.0 + pirates@4.0.6: {} pkg-dir@3.0.0: @@ -22090,15 +22378,15 @@ snapshots: jest-environment-node: 29.7.0 jsc-android: 250231.0.0 memoize-one: 5.2.1 - metro-runtime: 0.80.8 - metro-source-map: 0.80.8 + metro-runtime: 0.80.9 + metro-source-map: 0.80.9 mkdirp: 0.5.6 nullthrows: 1.1.1 pretty-format: 26.6.2 promise: 8.3.0 react: 18.2.0 react-devtools-core: 4.28.5(bufferutil@4.0.8)(utf-8-validate@6.0.3) - react-refresh: 0.14.0 + react-refresh: 0.14.2 react-shallow-renderer: 16.15.0(react@18.2.0) regenerator-runtime: 0.13.11 scheduler: 0.24.0-canary-efb381bbf-20230505 @@ -22146,7 +22434,7 @@ snapshots: react-native: 0.73.7(@babel/core@7.24.4)(@babel/preset-env@7.24.4(@babel/core@7.24.4))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@6.0.3) redux: 4.2.1 - react-refresh@0.14.0: {} + react-refresh@0.14.2: {} react-responsive@9.0.2(react@18.2.0): dependencies: @@ -22550,9 +22838,9 @@ snapshots: schema-utils@4.2.0: dependencies: '@types/json-schema': 7.0.15 - ajv: 8.12.0 - ajv-formats: 2.1.1(ajv@8.12.0) - ajv-keywords: 5.1.0(ajv@8.12.0) + ajv: 8.13.0 + ajv-formats: 2.1.1(ajv@8.13.0) + ajv-keywords: 5.1.0(ajv@8.13.0) scrypt-js@3.0.1: {} @@ -22588,6 +22876,8 @@ snapshots: dependencies: lru-cache: 6.0.0 + semver@7.6.2: {} + send@0.18.0: dependencies: debug: 2.6.9 @@ -23326,6 +23616,13 @@ snapshots: commander: 2.20.3 source-map-support: 0.5.21 + terser@5.31.0: + dependencies: + '@jridgewell/source-map': 0.3.6 + acorn: 8.11.3 + commander: 2.20.3 + source-map-support: 0.5.21 + test-exclude@6.0.0: dependencies: '@istanbuljs/schema': 0.1.3 @@ -23388,6 +23685,10 @@ snapshots: dependencies: real-require: 0.2.0 + thread-stream@2.7.0: + dependencies: + real-require: 0.2.0 + throat@5.0.0: {} throttleit@1.0.1: {} @@ -24425,6 +24726,8 @@ snapshots: yaml@2.4.1: {} + yaml@2.4.2: {} + yargs-parser@18.1.3: dependencies: camelcase: 5.3.1 From 9bba9d7c116849f6b514ba1038374a8c1cfd7acf Mon Sep 17 00:00:00 2001 From: nattadex Date: Wed, 15 May 2024 14:36:36 +0800 Subject: [PATCH 012/200] update responsive designs --- apps/web/src/app/app/withdraw/page.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web/src/app/app/withdraw/page.tsx b/apps/web/src/app/app/withdraw/page.tsx index 9b288d4a..3d659f33 100644 --- a/apps/web/src/app/app/withdraw/page.tsx +++ b/apps/web/src/app/app/withdraw/page.tsx @@ -52,9 +52,9 @@ export default function Withdraw() {

Withdraw DFI

-
+
-
+
How much do you want to withdraw? @@ -93,7 +93,7 @@ export default function Withdraw() { />
-
+
From 77f809869170495b79b04118bdd355ae396a7574 Mon Sep 17 00:00:00 2001 From: nattadex Date: Wed, 15 May 2024 15:18:55 +0800 Subject: [PATCH 013/200] update tooltip --- apps/web/src/app/app/components/Tooltip.tsx | 9 ++------- apps/web/src/app/app/withdraw/page.tsx | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/apps/web/src/app/app/components/Tooltip.tsx b/apps/web/src/app/app/components/Tooltip.tsx index 726a06db..ddd0d09d 100644 --- a/apps/web/src/app/app/components/Tooltip.tsx +++ b/apps/web/src/app/app/components/Tooltip.tsx @@ -3,7 +3,6 @@ import React, { PropsWithChildren, useState } from "react"; interface Props { content: string; - title?: string; containerClass?: string; disableTooltip?: boolean; defaultStyle?: string; @@ -12,10 +11,9 @@ interface Props { export default function Tooltip({ content, - title, children, containerClass, - defaultStyle = "w-fit bottom-[150%]", + defaultStyle = "bottom-[100%]", customStyle, disableTooltip = false, }: PropsWithChildren): JSX.Element { @@ -64,13 +62,10 @@ export default function Tooltip({ {!disableTooltip && active && (
- {title &&

{title}

} {content}
)} diff --git a/apps/web/src/app/app/withdraw/page.tsx b/apps/web/src/app/app/withdraw/page.tsx index 4d59d3e4..4ea679e7 100644 --- a/apps/web/src/app/app/withdraw/page.tsx +++ b/apps/web/src/app/app/withdraw/page.tsx @@ -105,7 +105,7 @@ export default function Withdraw() {
From 5fed0526190a31e4c46ad506c1f1cdb271ed4360 Mon Sep 17 00:00:00 2001 From: nattadex Date: Thu, 16 May 2024 13:55:19 +0800 Subject: [PATCH 014/200] used reusable TransactionRows.tsx --- .../app/stake/components/TransactionRows.tsx | 40 ++++++++--- apps/web/src/app/app/stake/page.tsx | 10 +-- apps/web/src/app/app/withdraw/page.tsx | 70 ++++++++----------- 3 files changed, 66 insertions(+), 54 deletions(-) diff --git a/apps/web/src/app/app/stake/components/TransactionRows.tsx b/apps/web/src/app/app/stake/components/TransactionRows.tsx index 9c8af3fe..5c076774 100644 --- a/apps/web/src/app/app/stake/components/TransactionRows.tsx +++ b/apps/web/src/app/app/stake/components/TransactionRows.tsx @@ -5,6 +5,9 @@ import { Interface, formatEther } from "ethers"; import { useGetTxnCost } from "@/hooks/useGetTxnCost"; import { getDecimalPlace, toWei } from "@/lib/textHelper"; import { useGetReadContractConfigs } from "@/hooks/useGetReadContractConfigs"; +import Tooltip from "@/app/app/components/Tooltip"; +import { FiHelpCircle } from "react-icons/fi"; +import React from "react"; export default function TransactionRows({ stakeAmount, @@ -37,7 +40,7 @@ export default function TransactionRows({ ).toString(); return ( -
+
-
- {label} - {comment && ( - - {comment} - +
+
+ {label} + {comment && ( + + {comment} + + )} +
+ {tooltipText && ( + + + + )} +
+
+ + {secondaryValue && ( + )}
-
); } diff --git a/apps/web/src/app/app/stake/page.tsx b/apps/web/src/app/app/stake/page.tsx index b96c5e62..a840be05 100644 --- a/apps/web/src/app/app/stake/page.tsx +++ b/apps/web/src/app/app/stake/page.tsx @@ -192,10 +192,12 @@ export default function Stake() { )}
- +
+ +
{isConnected ? ( (""); const balance = formatEther(walletBalance?.value.toString() ?? "0"); + // to avoid multiple contract fetch + const debounceWithdrawAmount = useDebounce(withdrawAmount, 200); function getActionBtnLabel() { switch (true) { @@ -96,20 +101,34 @@ export default function Withdraw() {
-
- - - -
+
+ -
@@ -128,34 +147,3 @@ export default function Withdraw() { ); } - -function TransactionRow({ - label, - value, - secondaryValue, - tooltipText, -}: { - label: string; - value: string; - secondaryValue?: string; - tooltipText?: string; -}) { - return ( -
-
- {label} - {tooltipText && ( - - - - )} -
-
- {value} - {secondaryValue && ( - {secondaryValue} - )} -
-
- ); -} From 647b69eeef175a24dced66af736ad8e6997f5c42 Mon Sep 17 00:00:00 2001 From: nattadex Date: Fri, 17 May 2024 16:20:18 +0800 Subject: [PATCH 015/200] update the ComplimentarySection.tsx --- .../components/ComplimentarySection.tsx | 121 +++++++++++++++++- apps/web/src/components/button/CTAButton.tsx | 5 +- apps/web/src/globals.css | 2 +- 3 files changed, 120 insertions(+), 8 deletions(-) diff --git a/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx b/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx index 96c6ae86..3fb621b8 100644 --- a/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx +++ b/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx @@ -1,12 +1,18 @@ import React from "react"; import clsx from "clsx"; +import Image from "next/image"; import { CTAButton } from "@/components/button/CTAButton"; +import { useAccount } from "wagmi"; +import { MdAccessTimeFilled } from "react-icons/md"; +import { FaCircleCheck } from "react-icons/fa6"; -export default function ComplimentarySection({ - customStyle, -}: { - customStyle?: string; -}) { +export default function ComplimentarySection() { + const { isConnected } = useAccount(); + + return
{isConnected ? : }
; +} + +function WithdrawalsFaq({ customStyle }: { customStyle?: string }) { return (
); } + +function WithdrawalDetails({ customStyle }: { customStyle?: string }) { + return ( +
+
+
+
+ Withdrawals +
+ } + /> + } + /> +
+
+ +
+ Total available +
+ 0 DFI + $0.0 +
+
+
+
+
+ + Withdrawals + +
+
+ Pending + +
+ 0 +
+ +
+
+ Available + +
+ 0 +
+ +
+ Total available +
+ + 0 DFI + + $0.0 +
+
+
+
+
+ + } + /> +
+
+ + Claims for withdrawals approximately take 7 processing days. Once + processed, you can submit claim to receive your DFI in your wallet. Make + sure to regularly check your wallet. + +
+ ); +} diff --git a/apps/web/src/components/button/CTAButton.tsx b/apps/web/src/components/button/CTAButton.tsx index 5fcd4a2c..79b5c1d2 100644 --- a/apps/web/src/components/button/CTAButton.tsx +++ b/apps/web/src/components/button/CTAButton.tsx @@ -12,6 +12,7 @@ export function CTAButton({ isDisabled, isLoading = false, navigateTo = "", + Icon, }: { label: string; testID: string; @@ -22,6 +23,7 @@ export function CTAButton({ customBgColor?: string; isLoading?: boolean; navigateTo?: string; + Icon?: JSX.Element; }) { const Button = (
diff --git a/apps/web/src/globals.css b/apps/web/src/globals.css index a9f25d16..e9182e8a 100644 --- a/apps/web/src/globals.css +++ b/apps/web/src/globals.css @@ -263,6 +263,6 @@ input[type="number"] { background: var(--UI-Component-BG-4); } -.faq-button-bg { +.withdraw-button-bg { background: linear-gradient(180deg, rgba(206, 219, 245, 0.15) 0%, rgba(150, 178, 232, 0.15) 100%); } \ No newline at end of file From 4ef6fc682cee4d3c1ad0b07832813d82c298652b Mon Sep 17 00:00:00 2001 From: nattadex Date: Fri, 24 May 2024 13:59:39 +0800 Subject: [PATCH 023/200] switched to inline if else for action btn label --- apps/web/src/app/app/withdraw/page.tsx | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/apps/web/src/app/app/withdraw/page.tsx b/apps/web/src/app/app/withdraw/page.tsx index 2491da18..9aeda612 100644 --- a/apps/web/src/app/app/withdraw/page.tsx +++ b/apps/web/src/app/app/withdraw/page.tsx @@ -29,19 +29,6 @@ export default function Withdraw() { const balance = formatEther(walletBalance?.value.toString() ?? "0"); - function getActionBtnLabel() { - switch (true) { - // case isSuccess: - // return "Return to Main Page"; - - case isConnected: - return "Withdraw mDFI"; - - default: - return "Connect wallet"; - } - } - useEffect(() => { setWalletBalanceAmount(balance); // set wallet balance }, [address, status, walletBalance]); @@ -103,7 +90,7 @@ export default function Withdraw() { {({ show }) => ( )} From 3f1b8ed8260c7d6c57e44bf7b370bc9d5690e518 Mon Sep 17 00:00:00 2001 From: nattadex Date: Fri, 24 May 2024 14:09:40 +0800 Subject: [PATCH 024/200] standardized to use NumericTransactionRow --- .../src/app/app/components/TransactionRow.tsx | 16 -------- apps/web/src/app/app/withdraw/page.tsx | 40 +++++++++++++------ 2 files changed, 28 insertions(+), 28 deletions(-) delete mode 100644 apps/web/src/app/app/components/TransactionRow.tsx diff --git a/apps/web/src/app/app/components/TransactionRow.tsx b/apps/web/src/app/app/components/TransactionRow.tsx deleted file mode 100644 index e24752ae..00000000 --- a/apps/web/src/app/app/components/TransactionRow.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import React from "react"; - -export default function TransactionRow({ - label, - value, -}: { - label: string; - value: string; -}) { - return ( -
- {label} - {value} -
- ); -} diff --git a/apps/web/src/app/app/withdraw/page.tsx b/apps/web/src/app/app/withdraw/page.tsx index 9aeda612..6d7780be 100644 --- a/apps/web/src/app/app/withdraw/page.tsx +++ b/apps/web/src/app/app/withdraw/page.tsx @@ -12,6 +12,8 @@ import ComplimentarySection from "@/app/app/withdraw/components/ComplimentarySec import BigNumber from "bignumber.js"; import { formatEther } from "ethers"; import { useGetReadContractConfigs } from "@/hooks/useGetReadContractConfigs"; +import { NumericTransactionRow } from "@/app/app/components/NumericTransactionRow"; +import { getDecimalPlace } from "@/lib/textHelper"; export default function Withdraw() { const { address, isConnected, status, chainId } = useAccount(); @@ -81,9 +83,32 @@ export default function Withdraw() {
- - - + + +
@@ -101,12 +126,3 @@ export default function Withdraw() { ); } - -function TransactionRow({ label, value }: { label: string; value: string }) { - return ( -
- {label} - {value} -
- ); -} From 6b7adaab09a06c2acfb1861a71ac0e2b44c3e460 Mon Sep 17 00:00:00 2001 From: nattadex Date: Fri, 24 May 2024 14:21:03 +0800 Subject: [PATCH 025/200] changed Icon to be passed as children --- apps/web/src/app/app/components/InputCard.tsx | 6 ++--- .../app/app/stake/components/StakePage.tsx | 23 +++++++++---------- apps/web/src/app/app/withdraw/page.tsx | 23 +++++++++---------- 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/apps/web/src/app/app/components/InputCard.tsx b/apps/web/src/app/app/components/InputCard.tsx index 87c66ee5..a03a5344 100644 --- a/apps/web/src/app/app/components/InputCard.tsx +++ b/apps/web/src/app/app/components/InputCard.tsx @@ -14,7 +14,7 @@ export function InputCard({ error, setError, isConnected, - Icon, + children, }: { maxAmount: BigNumber; // to calculate amount minAmount: BigNumber; @@ -23,7 +23,7 @@ export function InputCard({ error: string | null; setError: (msg: string | null) => void; isConnected: boolean; - Icon: JSX.Element; + children: JSX.Element; }) { const dfiPrice = useDfiPrice(); @@ -69,7 +69,7 @@ export function InputCard({ >
- {Icon} + {children}
- } - /> + > + DFI icon +
- } - /> + > + MDFI icon + Date: Fri, 24 May 2024 15:05:02 +0800 Subject: [PATCH 026/200] update changes that got overwritten --- .../app/components/NumericTransactionRow.tsx | 42 ++++++---- .../app/app/stake/components/StakePage.tsx | 4 +- .../app/stake/components/TransactionRows.tsx | 2 +- apps/web/src/app/app/withdraw/page.tsx | 77 +++++++++++-------- apps/web/src/components/button/CTAButton.tsx | 5 +- 5 files changed, 84 insertions(+), 46 deletions(-) diff --git a/apps/web/src/app/app/components/NumericTransactionRow.tsx b/apps/web/src/app/app/components/NumericTransactionRow.tsx index 544efcb7..2f67329c 100644 --- a/apps/web/src/app/app/components/NumericTransactionRow.tsx +++ b/apps/web/src/app/app/components/NumericTransactionRow.tsx @@ -2,34 +2,50 @@ import NumericFormat, { NumericFormatProps, } from "../../../components/NumericFormat"; import clsx from "clsx"; +import Tooltip from "@/app/app/components/Tooltip"; +import { FiHelpCircle } from "react-icons/fi"; export function NumericTransactionRow({ label, comment, value, customStyle, + secondaryValue, + tooltipText, }: { label: string; comment?: string; value: NumericFormatProps; customStyle?: string; + secondaryValue?: NumericFormatProps; + tooltipText?: string; }) { return ( -
-
- {label} - {comment && ( - - {comment} - +
+
+
+ {label} + {comment && ( + + {comment} + + )} +
+ {tooltipText && ( + + + + )} +
+
+ + {secondaryValue && ( + )}
-
); } diff --git a/apps/web/src/app/app/stake/components/StakePage.tsx b/apps/web/src/app/app/stake/components/StakePage.tsx index 110d90dc..21123219 100644 --- a/apps/web/src/app/app/stake/components/StakePage.tsx +++ b/apps/web/src/app/app/stake/components/StakePage.tsx @@ -150,7 +150,9 @@ export default function StakePage({ )}
- +
+ +
{isConnected ? ( +
(""); const [walletBalanceAmount, setWalletBalanceAmount] = useState(""); + const { data: previewDepositData } = useReadContract({ + address: MarbleLsdProxy.address, + abi: MarbleLsdProxy.abi, + functionName: "previewDeposit", + args: [toWei(withdrawAmount !== "" ? withdrawAmount : "0")], + query: { + enabled: isConnected, + }, + }); + + const previewDeposit = useMemo(() => { + return formatEther((previewDepositData as number) ?? 0).toString(); + }, [previewDepositData]); + const balance = formatEther(walletBalance?.value.toString() ?? "0"); useEffect(() => { @@ -81,33 +98,33 @@ export default function Withdraw() { />
-
- - - +
+ + +
+ + +
diff --git a/apps/web/src/components/button/CTAButton.tsx b/apps/web/src/components/button/CTAButton.tsx index d8f23084..5eb0fe78 100644 --- a/apps/web/src/components/button/CTAButton.tsx +++ b/apps/web/src/components/button/CTAButton.tsx @@ -12,6 +12,7 @@ export function CTAButton({ isDisabled, isLoading = false, navigateTo = "", + children, }: { label: string; testId: string; @@ -22,6 +23,7 @@ export function CTAButton({ customBgColor?: string; isLoading?: boolean; navigateTo?: string; + children?: JSX.Element; }) { const Button = (
@@ -121,18 +134,17 @@ function WithdrawalDetails({ customStyle }: { customStyle?: string }) { customStyle="w-full md:!px-3 md:!py-2" customTextStyle="whitespace-nowrap text-xs font-medium" customBgColor="button-bg" - Icon={ - DFI icon - } - /> + > + DFI icon + From bbbf29c2387a5edd078fd51d28bf563bca6b26b9 Mon Sep 17 00:00:00 2001 From: nattadex Date: Fri, 24 May 2024 15:18:02 +0800 Subject: [PATCH 028/200] update class name --- .../app/withdraw/components/ComplimentarySection.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx b/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx index 221471a9..2344cd66 100644 --- a/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx +++ b/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx @@ -34,7 +34,7 @@ function WithdrawalsFaq({ customStyle }: { customStyle?: string }) { testId="pending-withdrawals-button" customStyle="!px-3 !py-3 md:!py-1" customTextStyle="font-semibold leading-5 text-light-1000/30" - customBgColor="button-bg" + customBgColor="withdraw-button-bg" > @@ -43,7 +43,7 @@ function WithdrawalsFaq({ customStyle }: { customStyle?: string }) { testId="confirmed-withdrawals-button" customStyle="!px-3 !py-3 md:!py-1" customTextStyle="font-semibold leading-5 text-light-1000/30" - customBgColor="button-bg" + customBgColor="withdraw-button-bg" > @@ -70,7 +70,7 @@ function WithdrawalDetails({ customStyle }: { customStyle?: string }) { testId="pending-withdrawals-button" customStyle="!px-3 !py-3 md:!py-1" customTextStyle="font-semibold leading-5 text-light-1000/30" - customBgColor="button-bg" + customBgColor="withdraw-button-bg" > @@ -79,7 +79,7 @@ function WithdrawalDetails({ customStyle }: { customStyle?: string }) { testId="confirmed-withdrawals-button" customStyle="!px-3 !py-3 md:!py-1" customTextStyle="font-semibold leading-5 text-light-1000/30" - customBgColor="button-bg" + customBgColor="withdraw-button-bg" > @@ -133,7 +133,7 @@ function WithdrawalDetails({ customStyle }: { customStyle?: string }) { testId="claim-dfi-button" customStyle="w-full md:!px-3 md:!py-2" customTextStyle="whitespace-nowrap text-xs font-medium" - customBgColor="button-bg" + customBgColor="withdraw-button-bg" > Date: Fri, 24 May 2024 15:22:34 +0800 Subject: [PATCH 029/200] update to show second portion only after wallet is connected --- apps/web/src/app/app/withdraw/page.tsx | 54 ++++++++++++++------------ 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/apps/web/src/app/app/withdraw/page.tsx b/apps/web/src/app/app/withdraw/page.tsx index 47c600e3..f1982982 100644 --- a/apps/web/src/app/app/withdraw/page.tsx +++ b/apps/web/src/app/app/withdraw/page.tsx @@ -100,31 +100,35 @@ export default function Withdraw() {
- -
- - -
+ {isConnected && ( + <> + +
+ + +
+ + )}
From 459a33bdc64fe194757360dbf5894ed9479493ca Mon Sep 17 00:00:00 2001 From: nattadex Date: Mon, 27 May 2024 17:01:43 +0800 Subject: [PATCH 030/200] added paused withdrawal page --- .../components/PausedWithdrawalsPage.tsx | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 apps/web/src/app/app/withdraw/components/PausedWithdrawalsPage.tsx diff --git a/apps/web/src/app/app/withdraw/components/PausedWithdrawalsPage.tsx b/apps/web/src/app/app/withdraw/components/PausedWithdrawalsPage.tsx new file mode 100644 index 00000000..91947be6 --- /dev/null +++ b/apps/web/src/app/app/withdraw/components/PausedWithdrawalsPage.tsx @@ -0,0 +1,34 @@ +import Image from "next/image"; +import Panel from "@/app/app/stake/components/Panel"; + +export default function PausedWithdrawalsPage() { + return ( + +
+ staking paused logo +
+
+ + Staking paused + + + Staking has been paused temporarily for necessary precautions. + Please check again after a few hours or visit our Twitter for any + new updates. + +
+ + For any immediate concerns, you can report concerns{" "} + here. + +
+
+
+ ); +} From f9fabaadf8d9cf33d0983eb3e2073d697b7a293d Mon Sep 17 00:00:00 2001 From: nattadex Date: Mon, 27 May 2024 17:10:42 +0800 Subject: [PATCH 031/200] integrated the is withdrawals paused page --- .../components/PausedWithdrawalsPage.tsx | 47 +++-- apps/web/src/app/app/withdraw/page.tsx | 167 ++++++++++-------- 2 files changed, 115 insertions(+), 99 deletions(-) diff --git a/apps/web/src/app/app/withdraw/components/PausedWithdrawalsPage.tsx b/apps/web/src/app/app/withdraw/components/PausedWithdrawalsPage.tsx index 91947be6..ae37864d 100644 --- a/apps/web/src/app/app/withdraw/components/PausedWithdrawalsPage.tsx +++ b/apps/web/src/app/app/withdraw/components/PausedWithdrawalsPage.tsx @@ -1,34 +1,31 @@ import Image from "next/image"; -import Panel from "@/app/app/stake/components/Panel"; export default function PausedWithdrawalsPage() { return ( - -
- staking paused logo -
-
- - Staking paused - - - Staking has been paused temporarily for necessary precautions. - Please check again after a few hours or visit our Twitter for any - new updates. - -
- - For any immediate concerns, you can report concerns{" "} - here. +
+ withdrawals paused logo +
+
+ + Withdrawals paused + + + Withdrawals are paused temporarily for necessary precautions. Please + check again after a few hours or visit our Twitter for any new + updates.
+ + For any immediate concerns, you can report concerns{" "} + here. +
- +
); } diff --git a/apps/web/src/app/app/withdraw/page.tsx b/apps/web/src/app/app/withdraw/page.tsx index 4c60cb39..0f382d5b 100644 --- a/apps/web/src/app/app/withdraw/page.tsx +++ b/apps/web/src/app/app/withdraw/page.tsx @@ -1,8 +1,8 @@ "use client"; import Image from "next/image"; -import { useAccount, useBalance } from "wagmi"; -import React, { useEffect, useState } from "react"; +import { useAccount, useBalance, useReadContract } from "wagmi"; +import React, { useEffect, useMemo, useState } from "react"; import { ConnectKitButton } from "connectkit"; import { CTAButton } from "@/components/button/CTAButton"; import Panel from "@/app/app/stake/components/Panel"; @@ -14,9 +14,12 @@ import { formatEther } from "ethers"; import { useGetReadContractConfigs } from "@/hooks/useGetReadContractConfigs"; import { NumericTransactionRow } from "@/app/app/components/NumericTransactionRow"; import { getDecimalPlace } from "@/lib/textHelper"; +import { useContractContext } from "@/context/ContractContext"; +import PausedWithdrawalsPage from "@/app/app/withdraw/components/PausedWithdrawalsPage"; export default function Withdraw() { const { address, isConnected, status, chainId } = useAccount(); + const { MarbleLsdProxy } = useContractContext(); const { data: walletBalance } = useBalance({ address, @@ -31,6 +34,18 @@ export default function Withdraw() { const balance = formatEther(walletBalance?.value.toString() ?? "0"); + const { data: isWithdrawalPausedData } = useReadContract({ + address: MarbleLsdProxy.address, + abi: MarbleLsdProxy.abi, + functionName: "isWithdrawalPaused", + query: { + enabled: isConnected, + }, + }); + const isWithdrawalPaused = useMemo(() => { + return (isWithdrawalPausedData as boolean) ?? false; + }, [isWithdrawalPausedData]); + useEffect(() => { setWalletBalanceAmount(balance); // set wallet balance }, [address, status, walletBalance]); @@ -38,88 +53,92 @@ export default function Withdraw() { return (
-
-

Withdraw DFI

-
-
-
-
- - How much do you want to withdraw? - + {!isWithdrawalPaused ? ( +
+

Withdraw DFI

+
+
+
+
+ + How much do you want to withdraw? + + +
+
+
+ + MDFI icon +
-
- - MDFI icon - - + + +
-
- - - -
+ + {({ show }) => ( + + )} +
- - {({ show }) => ( - - )} - -
+ ) : ( + + )}
From 22dbcf6d1e32a90a3702fa5f51a0823c25508014 Mon Sep 17 00:00:00 2001 From: Chloe <44501120+chloezxyy@users.noreply.github.com> Date: Tue, 28 May 2024 14:45:43 +0800 Subject: [PATCH 032/200] refactor: withdraw page --- .../withdraw/components/TransactionRow.tsx | 34 +++++ .../app/withdraw/components/WithdrawPage.tsx | 120 +++++++++++++++++ apps/web/src/app/app/withdraw/page.tsx | 122 +++--------------- apps/web/src/types/index.ts | 2 +- apps/web/src/types/stake.ts | 5 - apps/web/src/types/steps.ts | 11 ++ 6 files changed, 185 insertions(+), 109 deletions(-) create mode 100644 apps/web/src/app/app/withdraw/components/TransactionRow.tsx create mode 100644 apps/web/src/app/app/withdraw/components/WithdrawPage.tsx delete mode 100644 apps/web/src/types/stake.ts create mode 100644 apps/web/src/types/steps.ts diff --git a/apps/web/src/app/app/withdraw/components/TransactionRow.tsx b/apps/web/src/app/app/withdraw/components/TransactionRow.tsx new file mode 100644 index 00000000..448bd424 --- /dev/null +++ b/apps/web/src/app/app/withdraw/components/TransactionRow.tsx @@ -0,0 +1,34 @@ +import Tooltip from "@/app/app/components/Tooltip"; +import { FiHelpCircle } from "react-icons/fi"; +import React from "react"; + +export default function TransactionRow({ + label, + value, + secondaryValue, + tooltipText, +}: { + label: string; + value: string; + secondaryValue?: string; + tooltipText?: string; +}) { + return ( +
+
+ {label} + {tooltipText && ( + + + + )} +
+
+ {value} + {secondaryValue && ( + {secondaryValue} + )} +
+
+ ); +} diff --git a/apps/web/src/app/app/withdraw/components/WithdrawPage.tsx b/apps/web/src/app/app/withdraw/components/WithdrawPage.tsx new file mode 100644 index 00000000..74e67b2f --- /dev/null +++ b/apps/web/src/app/app/withdraw/components/WithdrawPage.tsx @@ -0,0 +1,120 @@ +import Panel from "@/app/app/stake/components/Panel"; +import { InputCard } from "@/app/app/components/InputCard"; +import BigNumber from "bignumber.js"; +import TransactionRow from "@/app/app/withdraw/components/TransactionRow"; +import { ConnectKitButton } from "connectkit"; +import React from "react"; +import { useAccount } from "wagmi"; +import Image from "next/image"; +import ComplimentarySection from "@/app/app/withdraw/components/ComplimentarySection"; +import WalletDetails from "@/app/app/components/WalletDetails"; +import { CTAButton } from "@/components/button/CTAButton"; + +export default function WithdrawPage({ + walletBalanceAmount, + amountError, + setAmountError, + minDepositAmount, + withdrawAmount, + setWithdrawAmount, +}: { + walletBalanceAmount: string; + amountError: string | null; + setAmountError: React.Dispatch>; + minDepositAmount: string; + withdrawAmount: string; + setWithdrawAmount: React.Dispatch>; +}) { + const { isConnected } = useAccount(); + + function getActionBtnLabel() { + switch (true) { + // case isSuccess: previewWithdrawal + // return "Return to Main Page"; + + case isConnected: + return "Withdraw mDFI"; + + default: + return "Connect wallet"; + } + } + return ( + +
+
+

Withdraw DFI

+
+
+
+
+ + How much do you want to withdraw? + + +
+
+
+ + MDFI icon + + +
+
+
+
+ + + +
+ +
+ + +
+
+
+ + {({ show }) => ( + + )} + +
+ +
+
+ ); +} diff --git a/apps/web/src/app/app/withdraw/page.tsx b/apps/web/src/app/app/withdraw/page.tsx index f1982982..9bcc038c 100644 --- a/apps/web/src/app/app/withdraw/page.tsx +++ b/apps/web/src/app/app/withdraw/page.tsx @@ -1,21 +1,13 @@ "use client"; -import Image from "next/image"; import { useAccount, useBalance, useReadContract } from "wagmi"; import React, { useEffect, useMemo, useState } from "react"; -import { ConnectKitButton } from "connectkit"; -import { CTAButton } from "@/components/button/CTAButton"; -import Panel from "@/app/app/stake/components/Panel"; -import { InputCard } from "@/app/app/components/InputCard"; -import WalletDetails from "@/app/app/components/WalletDetails"; -import ComplimentarySection from "@/app/app/withdraw/components/ComplimentarySection"; -import BigNumber from "bignumber.js"; import { formatEther } from "ethers"; import { useGetReadContractConfigs } from "@/hooks/useGetReadContractConfigs"; -import { NumericTransactionRow } from "@/app/app/components/NumericTransactionRow"; -import { getDecimalPlace, toWei } from "@/lib/textHelper"; -import TransactionRows from "@/app/app/stake/components/TransactionRows"; +import { toWei } from "@/lib/textHelper"; import { useContractContext } from "@/context/ContractContext"; +import { WithdrawStep } from "@/types"; +import WithdrawPage from "@/app/app/withdraw/components/WithdrawPage"; export default function Withdraw() { const { address, isConnected, status, chainId } = useAccount(); @@ -31,7 +23,10 @@ export default function Withdraw() { const [amountError, setAmountError] = useState(null); const [withdrawAmount, setWithdrawAmount] = useState(""); const [walletBalanceAmount, setWalletBalanceAmount] = useState(""); - + // To display /withdraw pages based on the current step + const [currentStep, setCurrentStep] = useState( + WithdrawStep.WithdrawPage, + ); const { data: previewDepositData } = useReadContract({ address: MarbleLsdProxy.address, abi: MarbleLsdProxy.abi, @@ -53,96 +48,17 @@ export default function Withdraw() { }, [address, status, walletBalance]); return ( - -
-
-

Withdraw DFI

-
-
-
-
- - How much do you want to withdraw? - - -
-
-
- - MDFI icon - - -
-
-
- - {isConnected && ( - <> - -
- - -
- - )} -
-
- - {({ show }) => ( - - )} - -
- -
-
+
+ {currentStep === WithdrawStep.WithdrawPage ? ( + + ) : null} +
); } diff --git a/apps/web/src/types/index.ts b/apps/web/src/types/index.ts index 24d58d64..e2914366 100644 --- a/apps/web/src/types/index.ts +++ b/apps/web/src/types/index.ts @@ -1,2 +1,2 @@ -export * from "./stake"; +export * from "./steps"; export * from "./user"; diff --git a/apps/web/src/types/stake.ts b/apps/web/src/types/stake.ts deleted file mode 100644 index 50022fba..00000000 --- a/apps/web/src/types/stake.ts +++ /dev/null @@ -1,5 +0,0 @@ -export enum StakeStep { - StakePage, - StakeConfirmingPage, - StakeConfirmationPage, -} diff --git a/apps/web/src/types/steps.ts b/apps/web/src/types/steps.ts new file mode 100644 index 00000000..45d65ed8 --- /dev/null +++ b/apps/web/src/types/steps.ts @@ -0,0 +1,11 @@ +export enum StakeStep { + StakePage, + StakeConfirmingPage, + StakeConfirmationPage, +} + +export enum WithdrawStep { + WithdrawPage, + WithdrawConfirmingPage, + WithdrawConfirmationPage, +} From 8144d658eae744a2d9d515db3e9583a0368fa711 Mon Sep 17 00:00:00 2001 From: nattadex Date: Wed, 29 May 2024 12:59:35 +0800 Subject: [PATCH 033/200] pr comments --- .../src/app/app/withdraw/components/ComplimentarySection.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx b/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx index 2344cd66..7dd3699b 100644 --- a/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx +++ b/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx @@ -131,7 +131,7 @@ function WithdrawalDetails({ customStyle }: { customStyle?: string }) { isDisabled={true} label="Claim DFI" testId="claim-dfi-button" - customStyle="w-full md:!px-3 md:!py-2" + customStyle="w-full md:!px-3 md:!py-2 disabled:opacity-50" customTextStyle="whitespace-nowrap text-xs font-medium" customBgColor="withdraw-button-bg" > From 294db5b842a9fa49224b8d200b50d1e819812a50 Mon Sep 17 00:00:00 2001 From: nattadex Date: Wed, 29 May 2024 16:19:30 +0800 Subject: [PATCH 034/200] update to use contract functions --- .../src/app/app/components/WalletDetails.tsx | 4 +++- apps/web/src/app/app/withdraw/page.tsx | 21 ++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/apps/web/src/app/app/components/WalletDetails.tsx b/apps/web/src/app/app/components/WalletDetails.tsx index 8f2336bd..71e0615d 100644 --- a/apps/web/src/app/app/components/WalletDetails.tsx +++ b/apps/web/src/app/app/components/WalletDetails.tsx @@ -8,10 +8,12 @@ export default function WalletDetails({ isWalletConnected, style, walletBalanceAmount, + isMdfi, }: { isWalletConnected: boolean; style?: string; walletBalanceAmount?: string; + isMdfi?: boolean; }) { const decimalScale = getDecimalPlace(walletBalanceAmount ?? 0); return ( @@ -24,7 +26,7 @@ export default function WalletDetails({ Available: { + return formatEther((totalAssetsData as number) ?? 0).toString(); + }, [totalAssetsData]); + const balance = formatEther(walletBalance?.value.toString() ?? "0"); useEffect(() => { @@ -68,6 +82,7 @@ export default function Withdraw() { walletBalanceAmount={walletBalanceAmount} isWalletConnected={isConnected} style="md:block hidden" + isMdfi />
@@ -108,9 +123,9 @@ export default function Withdraw() { label="Total liquidity" tooltipText="Total amount available for withdrawal." value={{ - value: 133939, + value: totalAssets, suffix: " DFI", - decimalScale: 0, + decimalScale: getDecimalPlace(totalAssets), }} secondaryValue={{ value: 3.23, From ac6c1f7498e4c7481f52082c35493e9615d9136f Mon Sep 17 00:00:00 2001 From: nattadex Date: Wed, 29 May 2024 16:24:12 +0800 Subject: [PATCH 035/200] update to use contract functions for total liquidity --- apps/web/src/app/app/withdraw/page.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/web/src/app/app/withdraw/page.tsx b/apps/web/src/app/app/withdraw/page.tsx index b5c564bf..613770ac 100644 --- a/apps/web/src/app/app/withdraw/page.tsx +++ b/apps/web/src/app/app/withdraw/page.tsx @@ -16,10 +16,12 @@ import { NumericTransactionRow } from "@/app/app/components/NumericTransactionRo import { getDecimalPlace, toWei } from "@/lib/textHelper"; import TransactionRows from "@/app/app/stake/components/TransactionRows"; import { useContractContext } from "@/context/ContractContext"; +import { useDfiPrice } from "@/hooks/useDfiPrice"; export default function Withdraw() { const { address, isConnected, status, chainId } = useAccount(); const { MarbleLsdProxy, mDFI } = useContractContext(); + const dfiPrice = useDfiPrice(); const { data: walletBalance } = useBalance({ address, @@ -60,6 +62,10 @@ export default function Withdraw() { return formatEther((totalAssetsData as number) ?? 0).toString(); }, [totalAssetsData]); + const totalAssetsUsdAmount = new BigNumber(totalAssets).isNaN() + ? new BigNumber(0) + : new BigNumber(totalAssets ?? 0).multipliedBy(dfiPrice); + const balance = formatEther(walletBalance?.value.toString() ?? "0"); useEffect(() => { @@ -128,8 +134,8 @@ export default function Withdraw() { decimalScale: getDecimalPlace(totalAssets), }} secondaryValue={{ - value: 3.23, - decimalScale: getDecimalPlace(3.23), + value: totalAssetsUsdAmount, + decimalScale: getDecimalPlace(totalAssetsUsdAmount), prefix: "$", }} /> From c7d16dbeb6da61dadd0747d9b4be651aac24c212 Mon Sep 17 00:00:00 2001 From: nattadex Date: Thu, 30 May 2024 14:09:02 +0800 Subject: [PATCH 036/200] replace tooltip with hover popover --- apps/web/package.json | 1 + .../src/app/app/components/HoverPopover.tsx | 61 +++++++++++++++ .../app/components/NumericTransactionRow.tsx | 9 +-- apps/web/src/app/app/components/Tooltip.tsx | 74 ------------------- pnpm-lock.yaml | 36 +++++++++ 5 files changed, 101 insertions(+), 80 deletions(-) create mode 100644 apps/web/src/app/app/components/HoverPopover.tsx delete mode 100644 apps/web/src/app/app/components/Tooltip.tsx diff --git a/apps/web/package.json b/apps/web/package.json index b9809912..c45444f2 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -12,6 +12,7 @@ }, "dependencies": { "@defichain/whale-api-client": "^4.0.7", + "@floating-ui/react-dom": "^1.3.0", "@headlessui/react": "^1.7.18", "@reduxjs/toolkit": "^2.2.1", "@tailwindcss/typography": "^0.5.10", diff --git a/apps/web/src/app/app/components/HoverPopover.tsx b/apps/web/src/app/app/components/HoverPopover.tsx new file mode 100644 index 00000000..0ac7a278 --- /dev/null +++ b/apps/web/src/app/app/components/HoverPopover.tsx @@ -0,0 +1,61 @@ +import { PropsWithChildren, ReactNode, useState } from "react"; +import { Placement, useFloating, shift } from "@floating-ui/react-dom"; +import clsx from "clsx"; + +interface IconPopoverProps { + popover: string | ReactNode; + placement?: Placement; + className?: string; +} + +export function HoverPopover( + props: PropsWithChildren, +): JSX.Element { + const [isHover, setIsHover] = useState(false); + + const { x, y, reference, floating, strategy } = useFloating({ + placement: props.placement ?? "bottom", + middleware: [shift()], + strategy: "fixed", + }); + + return ( + <> +
setIsHover(true)} + onMouseLeave={() => setIsHover(false)} + onTouchCancel={() => setIsHover(false)} + className={clsx(props.className)} + > + {props.children} +
+ + {(() => { + if (!isHover) { + return null; + } + + return ( +
+ {typeof props.popover === "string" ? ( +
+ {props.popover} +
+ ) : ( + props.popover + )} +
+ ); + })()} + + ); +} diff --git a/apps/web/src/app/app/components/NumericTransactionRow.tsx b/apps/web/src/app/app/components/NumericTransactionRow.tsx index 2f67329c..6f09440f 100644 --- a/apps/web/src/app/app/components/NumericTransactionRow.tsx +++ b/apps/web/src/app/app/components/NumericTransactionRow.tsx @@ -1,22 +1,19 @@ import NumericFormat, { NumericFormatProps, } from "../../../components/NumericFormat"; -import clsx from "clsx"; -import Tooltip from "@/app/app/components/Tooltip"; import { FiHelpCircle } from "react-icons/fi"; +import { HoverPopover } from "@/app/app/components/HoverPopover"; export function NumericTransactionRow({ label, comment, value, - customStyle, secondaryValue, tooltipText, }: { label: string; comment?: string; value: NumericFormatProps; - customStyle?: string; secondaryValue?: NumericFormatProps; tooltipText?: string; }) { @@ -32,9 +29,9 @@ export function NumericTransactionRow({ )}
{tooltipText && ( - + - + )}
diff --git a/apps/web/src/app/app/components/Tooltip.tsx b/apps/web/src/app/app/components/Tooltip.tsx deleted file mode 100644 index 41a9872a..00000000 --- a/apps/web/src/app/app/components/Tooltip.tsx +++ /dev/null @@ -1,74 +0,0 @@ -import clsx from "clsx"; -import React, { PropsWithChildren, useState } from "react"; - -interface Props { - content: string; - containerClass?: string; - disableTooltip?: boolean; - defaultStyle?: string; - customStyle?: string; -} - -export default function Tooltip({ - content, - children, - containerClass, - defaultStyle = "bottom-[100%]", - customStyle, - disableTooltip = false, -}: PropsWithChildren): JSX.Element { - let timeout: NodeJS.Timeout; - const [active, setActive] = useState(false); - const timeoutTime = 300; - - const showTooltip = () => { - timeout = setTimeout(() => { - setActive(true); - }, 300); - }; - - const hideTooltip = () => { - timeout = setTimeout(() => { - setActive(false); - clearInterval(timeout); - }, timeoutTime); - }; - - return ( -
{ - if (active) { - hideTooltip(); - } else { - showTooltip(); - timeout = setTimeout(() => { - hideTooltip(); - }, timeoutTime); - } - }} - onMouseLeave={hideTooltip} - onMouseDown={hideTooltip} - onKeyDown={() => {}} - tabIndex={0} - > - {children} - {!disableTooltip && active && ( -
- {content} -
- )} -
- ); -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2015300d..1a0b851a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -84,6 +84,9 @@ importers: '@defichain/whale-api-client': specifier: ^4.0.7 version: 4.0.7(defichain@4.0.0-beta.14.1) + '@floating-ui/react-dom': + specifier: ^1.3.0 + version: 1.3.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) '@headlessui/react': specifier: ^1.7.18 version: 1.7.18(react-dom@18.2.0(react@18.2.0))(react@18.2.0) @@ -1520,6 +1523,21 @@ packages: '@fastify/middie@8.3.0': resolution: {integrity: sha512-h+zBxCzMlkEkh4fM7pZaSGzqS7P9M0Z6rXnWPdUEPfe7x1BCj++wEk/pQ5jpyYY4pF8AknFqb77n7uwh8HdxEA==} + '@floating-ui/core@1.6.2': + resolution: {integrity: sha512-+2XpQV9LLZeanU4ZevzRnGFg2neDeKHgFLjP6YLW+tly0IvrhqT4u8enLGjLH3qeh85g19xY5rsAusfwTdn5lg==} + + '@floating-ui/dom@1.6.5': + resolution: {integrity: sha512-Nsdud2X65Dz+1RHjAIP0t8z5e2ff/IRbei6BqFrl1urT8sDVzM1HMQ+R0XcU5ceRfyO3I6ayeqIfh+6Wb8LGTw==} + + '@floating-ui/react-dom@1.3.0': + resolution: {integrity: sha512-htwHm67Ji5E/pROEAr7f8IKFShuiCKHwUC/UY4vC3I5jiSvGFAYnSYiZO5MlGmads+QqvUkR9ANHEguGrDv72g==} + peerDependencies: + react: '>=16.8.0' + react-dom: '>=16.8.0' + + '@floating-ui/utils@0.2.2': + resolution: {integrity: sha512-J4yDIIthosAsRZ5CPYP/jQvUAQtlZTTD/4suA08/FEnlxqW3sKS9iAhgsa9VYLZ6vDHn/ixJgIqRQPotoBjxIw==} + '@foliojs-fork/fontkit@1.9.2': resolution: {integrity: sha512-IfB5EiIb+GZk+77TRB86AHroVaqfq8JRFlUbz0WEwsInyCG0epX2tCPOy+UfaWPju30DeVoUAXfzWXmhn753KA==} @@ -8935,6 +8953,7 @@ packages: rimraf@2.6.3: resolution: {integrity: sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==} + deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true rimraf@2.7.1: @@ -12606,6 +12625,23 @@ snapshots: path-to-regexp: 6.2.2 reusify: 1.0.4 + '@floating-ui/core@1.6.2': + dependencies: + '@floating-ui/utils': 0.2.2 + + '@floating-ui/dom@1.6.5': + dependencies: + '@floating-ui/core': 1.6.2 + '@floating-ui/utils': 0.2.2 + + '@floating-ui/react-dom@1.3.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': + dependencies: + '@floating-ui/dom': 1.6.5 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + + '@floating-ui/utils@0.2.2': {} + '@foliojs-fork/fontkit@1.9.2': dependencies: '@foliojs-fork/restructure': 2.0.2 From 792f8629540aefe3877c36172afcab22c1e7b636 Mon Sep 17 00:00:00 2001 From: nattadex Date: Thu, 30 May 2024 14:12:16 +0800 Subject: [PATCH 037/200] added customStyle option --- .../src/app/app/components/NumericTransactionRow.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/web/src/app/app/components/NumericTransactionRow.tsx b/apps/web/src/app/app/components/NumericTransactionRow.tsx index 6f09440f..5a7cb679 100644 --- a/apps/web/src/app/app/components/NumericTransactionRow.tsx +++ b/apps/web/src/app/app/components/NumericTransactionRow.tsx @@ -3,22 +3,30 @@ import NumericFormat, { } from "../../../components/NumericFormat"; import { FiHelpCircle } from "react-icons/fi"; import { HoverPopover } from "@/app/app/components/HoverPopover"; +import clsx from "clsx"; export function NumericTransactionRow({ label, comment, value, + customStyle, secondaryValue, tooltipText, }: { label: string; comment?: string; value: NumericFormatProps; + customStyle?: string; secondaryValue?: NumericFormatProps; tooltipText?: string; }) { return ( -
+
{label} From be5126a018fb126ffc4075672281b5d527e92d9f Mon Sep 17 00:00:00 2001 From: Chloe <44501120+chloezxyy@users.noreply.github.com> Date: Thu, 30 May 2024 14:48:44 +0800 Subject: [PATCH 038/200] WIP request withdrawal page --- .../src/app/app/components/ConfirmScreen.tsx | 1 - .../web/src/app/app/components/DetailsRow.tsx | 46 +++++++----- .../app/components/NumericTransactionRow.tsx | 5 +- .../app/app/components/icons/PendingIcon.tsx | 19 +++++ .../withdraw/components/PreviewWithdrawal.tsx | 74 +++++++++++++++++++ .../app/withdraw/components/WithdrawPage.tsx | 1 + apps/web/src/app/app/withdraw/page.tsx | 22 ++++++ apps/web/src/types/steps.ts | 2 +- 8 files changed, 144 insertions(+), 26 deletions(-) create mode 100644 apps/web/src/app/app/components/icons/PendingIcon.tsx create mode 100644 apps/web/src/app/app/withdraw/components/PreviewWithdrawal.tsx diff --git a/apps/web/src/app/app/components/ConfirmScreen.tsx b/apps/web/src/app/app/components/ConfirmScreen.tsx index ef13729e..02f350ee 100644 --- a/apps/web/src/app/app/components/ConfirmScreen.tsx +++ b/apps/web/src/app/app/components/ConfirmScreen.tsx @@ -60,7 +60,6 @@ export default function ConfirmScreen({ key={item.label} label={item.label} value={item.value} - customStyle="py-[18px]" /> ))} diff --git a/apps/web/src/app/app/components/DetailsRow.tsx b/apps/web/src/app/app/components/DetailsRow.tsx index fc61cf11..4ef8e71e 100644 --- a/apps/web/src/app/app/components/DetailsRow.tsx +++ b/apps/web/src/app/app/components/DetailsRow.tsx @@ -2,6 +2,7 @@ import clsx from "clsx"; import { FiCopy, FiExternalLink } from "react-icons/fi"; import { useContractContext } from "@/context/ContractContext"; import Link from "next/link"; +import PendingIcon from "@/app/app/components/icons/PendingIcon"; export default function DetailsRow({ label, @@ -21,31 +22,36 @@ export default function DetailsRow({
- {value} + {linkType === "status" && } + + {value} +
{/* Copy and external link icon */} -
- - - - -
+ {linkType === "tx" && ( +
+ + + + +
+ )}
); diff --git a/apps/web/src/app/app/components/NumericTransactionRow.tsx b/apps/web/src/app/app/components/NumericTransactionRow.tsx index 2f67329c..a3b0ab0b 100644 --- a/apps/web/src/app/app/components/NumericTransactionRow.tsx +++ b/apps/web/src/app/app/components/NumericTransactionRow.tsx @@ -1,7 +1,6 @@ import NumericFormat, { NumericFormatProps, } from "../../../components/NumericFormat"; -import clsx from "clsx"; import Tooltip from "@/app/app/components/Tooltip"; import { FiHelpCircle } from "react-icons/fi"; @@ -9,19 +8,17 @@ export function NumericTransactionRow({ label, comment, value, - customStyle, secondaryValue, tooltipText, }: { label: string; comment?: string; value: NumericFormatProps; - customStyle?: string; secondaryValue?: NumericFormatProps; tooltipText?: string; }) { return ( -
+
{label} diff --git a/apps/web/src/app/app/components/icons/PendingIcon.tsx b/apps/web/src/app/app/components/icons/PendingIcon.tsx new file mode 100644 index 00000000..6d0e6d97 --- /dev/null +++ b/apps/web/src/app/app/components/icons/PendingIcon.tsx @@ -0,0 +1,19 @@ +export default function PendingIcon({ className }: { className: string }) { + return ( + + + + ); +} diff --git a/apps/web/src/app/app/withdraw/components/PreviewWithdrawal.tsx b/apps/web/src/app/app/withdraw/components/PreviewWithdrawal.tsx new file mode 100644 index 00000000..3e0b6b7a --- /dev/null +++ b/apps/web/src/app/app/withdraw/components/PreviewWithdrawal.tsx @@ -0,0 +1,74 @@ +import ConfirmScreen from "@/app/app/components/ConfirmScreen"; +import { getDecimalPlace } from "@/lib/textHelper"; +import { CTAButton } from "@/components/button/CTAButton"; +import { WithdrawStep } from "@/types"; + +export default function PreviewWithdrawal({ + withdrawAmount, + previewDeposit, + setCurrentStep, + hash, + receivingWalletAddress, + resetFields, +}: { + withdrawAmount: string; + previewDeposit: string; + setCurrentStep: (step: WithdrawStep) => void; + hash: string; + receivingWalletAddress: string; + resetFields: () => void; +}) { + return ( + { + resetFields(); + setCurrentStep(WithdrawStep.WithdrawPage); + }} + /> + } + /> + ); +} diff --git a/apps/web/src/app/app/withdraw/components/WithdrawPage.tsx b/apps/web/src/app/app/withdraw/components/WithdrawPage.tsx index 74e67b2f..86d33c56 100644 --- a/apps/web/src/app/app/withdraw/components/WithdrawPage.tsx +++ b/apps/web/src/app/app/withdraw/components/WithdrawPage.tsx @@ -109,6 +109,7 @@ export default function WithdrawPage({ testId="instant-transfer-btn" label={isConnected ? "Withdraw mDFI" : "Connect wallet"} customStyle="w-full md:py-5" + onClick={show} /> )} diff --git a/apps/web/src/app/app/withdraw/page.tsx b/apps/web/src/app/app/withdraw/page.tsx index 9bcc038c..d923aeb1 100644 --- a/apps/web/src/app/app/withdraw/page.tsx +++ b/apps/web/src/app/app/withdraw/page.tsx @@ -1,3 +1,5 @@ +// @ts-ignore + "use client"; import { useAccount, useBalance, useReadContract } from "wagmi"; @@ -8,8 +10,10 @@ import { toWei } from "@/lib/textHelper"; import { useContractContext } from "@/context/ContractContext"; import { WithdrawStep } from "@/types"; import WithdrawPage from "@/app/app/withdraw/components/WithdrawPage"; +import PreviewWithdrawal from "@/app/app/withdraw/components/PreviewWithdrawal"; export default function Withdraw() { + const mainContentRef = React.useRef(null); const { address, isConnected, status, chainId } = useAccount(); const { MarbleLsdProxy } = useContractContext(); @@ -43,6 +47,13 @@ export default function Withdraw() { const balance = formatEther(walletBalance?.value.toString() ?? "0"); + const setCurrentStepAndScroll = (step: WithdrawStep) => { + setCurrentStep(step); + if (mainContentRef.current) { + window.scrollTo({ top: 0, behavior: "smooth" }); + } + }; + useEffect(() => { setWalletBalanceAmount(balance); // set wallet balance }, [address, status, walletBalance]); @@ -59,6 +70,17 @@ export default function Withdraw() { setWithdrawAmount={setWithdrawAmount} /> ) : null} + + {currentStep === WithdrawStep.PreviewWithdrawal ? ( + {}} + /> + ) : null}
); } diff --git a/apps/web/src/types/steps.ts b/apps/web/src/types/steps.ts index 45d65ed8..0ba6d41a 100644 --- a/apps/web/src/types/steps.ts +++ b/apps/web/src/types/steps.ts @@ -6,6 +6,6 @@ export enum StakeStep { export enum WithdrawStep { WithdrawPage, - WithdrawConfirmingPage, + PreviewWithdrawal, WithdrawConfirmationPage, } From 4cf95139c0207cd2caf33d6fc6bfb013075d7657 Mon Sep 17 00:00:00 2001 From: nattadex Date: Thu, 30 May 2024 16:30:49 +0800 Subject: [PATCH 039/200] gave the ComplimentarySection.tsx background --- .../app/withdraw/components/ComplimentarySection.tsx | 10 +++++++--- apps/web/src/app/app/withdraw/page.tsx | 2 +- apps/web/src/globals.css | 4 ++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx b/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx index 7dd3699b..1e365677 100644 --- a/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx +++ b/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx @@ -9,14 +9,18 @@ import { FaCircleCheck } from "react-icons/fa6"; export default function ComplimentarySection() { const { isConnected } = useAccount(); - return
{isConnected ? : }
; + return ( +
+ {isConnected ? : } +
+ ); } function WithdrawalsFaq({ customStyle }: { customStyle?: string }) { return (
@@ -54,7 +58,7 @@ function WithdrawalsFaq({ customStyle }: { customStyle?: string }) { function WithdrawalDetails({ customStyle }: { customStyle?: string }) { return ( -
+
+

Withdraw DFI

diff --git a/apps/web/src/globals.css b/apps/web/src/globals.css index e9182e8a..e6d253e8 100644 --- a/apps/web/src/globals.css +++ b/apps/web/src/globals.css @@ -265,4 +265,8 @@ input[type="number"] { .withdraw-button-bg { background: linear-gradient(180deg, rgba(206, 219, 245, 0.15) 0%, rgba(150, 178, 232, 0.15) 100%); +} + +.complimentary-bg { + background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.15) 100%); } \ No newline at end of file From 9bc02ebe5b6054cba99aaeacdea3c5675139d1d8 Mon Sep 17 00:00:00 2001 From: nattadex Date: Fri, 31 May 2024 13:41:49 +0800 Subject: [PATCH 040/200] added max width --- apps/web/src/app/app/components/InputCard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/app/app/components/InputCard.tsx b/apps/web/src/app/app/components/InputCard.tsx index a03a5344..f9a7ef70 100644 --- a/apps/web/src/app/app/components/InputCard.tsx +++ b/apps/web/src/app/app/components/InputCard.tsx @@ -67,7 +67,7 @@ export function InputCard({ "gap-y-3 gap-x-6 bg-white p-4 md:pl-6 rounded-md md:items-center", )} > -
+
{children}
From c6baa99444a4d60b7d1a582ce7e29c968b94132d Mon Sep 17 00:00:00 2001 From: nattadex Date: Fri, 31 May 2024 13:52:09 +0800 Subject: [PATCH 041/200] added space --- .../src/app/app/withdraw/components/PausedWithdrawalsPage.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/src/app/app/withdraw/components/PausedWithdrawalsPage.tsx b/apps/web/src/app/app/withdraw/components/PausedWithdrawalsPage.tsx index ae37864d..0382800b 100644 --- a/apps/web/src/app/app/withdraw/components/PausedWithdrawalsPage.tsx +++ b/apps/web/src/app/app/withdraw/components/PausedWithdrawalsPage.tsx @@ -22,8 +22,8 @@ export default function PausedWithdrawalsPage() {
- For any immediate concerns, you can report concerns{" "} - here. + For any immediate concerns, you can report concerns + here.
From 883ebd1ddaef5ad7c79e7353e7a3e048e820aa9a Mon Sep 17 00:00:00 2001 From: nattadex Date: Fri, 31 May 2024 16:47:22 +0800 Subject: [PATCH 042/200] update to previewWithdraw --- apps/web/src/app/app/withdraw/page.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/web/src/app/app/withdraw/page.tsx b/apps/web/src/app/app/withdraw/page.tsx index 613770ac..25e1fe50 100644 --- a/apps/web/src/app/app/withdraw/page.tsx +++ b/apps/web/src/app/app/withdraw/page.tsx @@ -35,19 +35,19 @@ export default function Withdraw() { const [withdrawAmount, setWithdrawAmount] = useState(""); const [walletBalanceAmount, setWalletBalanceAmount] = useState(""); - const { data: previewDepositData } = useReadContract({ + const { data: previewWithdrawData } = useReadContract({ address: MarbleLsdProxy.address, abi: MarbleLsdProxy.abi, - functionName: "previewDeposit", + functionName: "previewWithdraw", args: [toWei(withdrawAmount !== "" ? withdrawAmount : "0")], query: { enabled: isConnected, }, }); - const previewDeposit = useMemo(() => { - return formatEther((previewDepositData as number) ?? 0).toString(); - }, [previewDepositData]); + const previewWithdraw = useMemo(() => { + return formatEther((previewWithdrawData as number) ?? 0).toString(); + }, [previewWithdrawData]); const { data: totalAssetsData } = useReadContract({ address: MarbleLsdProxy.address, @@ -120,7 +120,7 @@ export default function Withdraw() {
- + {isConnected && ( <> From 5bd98015dd257c420a7d6b161acb27a53edd1fe3 Mon Sep 17 00:00:00 2001 From: nattadex Date: Fri, 31 May 2024 16:51:28 +0800 Subject: [PATCH 043/200] revert --- apps/web/src/app/app/withdraw/page.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/web/src/app/app/withdraw/page.tsx b/apps/web/src/app/app/withdraw/page.tsx index 25e1fe50..613770ac 100644 --- a/apps/web/src/app/app/withdraw/page.tsx +++ b/apps/web/src/app/app/withdraw/page.tsx @@ -35,19 +35,19 @@ export default function Withdraw() { const [withdrawAmount, setWithdrawAmount] = useState(""); const [walletBalanceAmount, setWalletBalanceAmount] = useState(""); - const { data: previewWithdrawData } = useReadContract({ + const { data: previewDepositData } = useReadContract({ address: MarbleLsdProxy.address, abi: MarbleLsdProxy.abi, - functionName: "previewWithdraw", + functionName: "previewDeposit", args: [toWei(withdrawAmount !== "" ? withdrawAmount : "0")], query: { enabled: isConnected, }, }); - const previewWithdraw = useMemo(() => { - return formatEther((previewWithdrawData as number) ?? 0).toString(); - }, [previewWithdrawData]); + const previewDeposit = useMemo(() => { + return formatEther((previewDepositData as number) ?? 0).toString(); + }, [previewDepositData]); const { data: totalAssetsData } = useReadContract({ address: MarbleLsdProxy.address, @@ -120,7 +120,7 @@ export default function Withdraw() {
- + {isConnected && ( <> From 77b54be5d1192325391fc24ce43110823d171554 Mon Sep 17 00:00:00 2001 From: Chloe <44501120+chloezxyy@users.noreply.github.com> Date: Mon, 3 Jun 2024 22:10:25 +0800 Subject: [PATCH 044/200] WIP integrate SC with withdraw flow --- .../app/app/stake/components/StakePage.tsx | 2 +- .../app/stake/components/TransactionRows.tsx | 8 +- apps/web/src/app/app/stake/page.tsx | 3 +- .../withdraw/components/PreviewWithdrawal.tsx | 8 +- .../app/withdraw/components/WithdrawPage.tsx | 64 +++++----- apps/web/src/app/app/withdraw/page.tsx | 111 +++++++++++++----- 6 files changed, 123 insertions(+), 73 deletions(-) diff --git a/apps/web/src/app/app/stake/components/StakePage.tsx b/apps/web/src/app/app/stake/components/StakePage.tsx index 21123219..1cb21c65 100644 --- a/apps/web/src/app/app/stake/components/StakePage.tsx +++ b/apps/web/src/app/app/stake/components/StakePage.tsx @@ -151,7 +151,7 @@ export default function StakePage({
- +
{isConnected ? ( diff --git a/apps/web/src/app/app/stake/components/TransactionRows.tsx b/apps/web/src/app/app/stake/components/TransactionRows.tsx index e36fd939..09b40133 100644 --- a/apps/web/src/app/app/stake/components/TransactionRows.tsx +++ b/apps/web/src/app/app/stake/components/TransactionRows.tsx @@ -6,9 +6,9 @@ import { useGetReadContractConfigs } from "@/hooks/useGetReadContractConfigs"; import { NumericTransactionRow } from "@/app/app/components/NumericTransactionRow"; export default function TransactionRows({ - previewDeposit, + previewDetails, }: { - previewDeposit: string; + previewDetails: string; }) { const { mDfiToDfiConversion } = useGetReadContractConfigs(); const { MarbleLsdProxy } = useContractContext(); @@ -25,8 +25,8 @@ export default function TransactionRows({ label="You will receive" comment="(after fees)" value={{ - value: previewDeposit, - decimalScale: getDecimalPlace(previewDeposit), + value: previewDetails, + decimalScale: getDecimalPlace(previewDetails), suffix: ` mDFI`, }} /> diff --git a/apps/web/src/app/app/stake/page.tsx b/apps/web/src/app/app/stake/page.tsx index 9c4b05e4..3ccbb96c 100644 --- a/apps/web/src/app/app/stake/page.tsx +++ b/apps/web/src/app/app/stake/page.tsx @@ -88,6 +88,7 @@ export default function Stake() { enabled: isConnected, }, }); + console.log({ previewDepositData }); const previewDeposit = useMemo(() => { return formatEther((previewDepositData as number) ?? 0).toString(); @@ -166,7 +167,7 @@ export default function Stake() { return (
- {/* First step: Stake poge */} + {/* First step: Stake page */} {currentStep === StakeStep.StakePage && ( void; hash: string; receivingWalletAddress: string; @@ -35,9 +35,9 @@ export default function PreviewWithdrawal({ { label: "You will receive", value: { - value: previewDeposit, + value: previewWithdrawal, suffix: " DFI", - decimalScale: getDecimalPlace(previewDeposit), + decimalScale: getDecimalPlace(previewWithdrawal), }, }, ]} diff --git a/apps/web/src/app/app/withdraw/components/WithdrawPage.tsx b/apps/web/src/app/app/withdraw/components/WithdrawPage.tsx index ee9b2608..52e47754 100644 --- a/apps/web/src/app/app/withdraw/components/WithdrawPage.tsx +++ b/apps/web/src/app/app/withdraw/components/WithdrawPage.tsx @@ -1,8 +1,6 @@ -"use client"; - import Image from "next/image"; import { useAccount, useBalance, useReadContract } from "wagmi"; -import React, { useEffect, useMemo, useState } from "react"; +import React, { useEffect, useMemo } from "react"; import { ConnectKitButton } from "connectkit"; import { CTAButton } from "@/components/button/CTAButton"; import Panel from "@/app/app/stake/components/Panel"; @@ -11,7 +9,6 @@ import WalletDetails from "@/app/app/components/WalletDetails"; import ComplimentarySection from "@/app/app/withdraw/components/ComplimentarySection"; import BigNumber from "bignumber.js"; import { formatEther } from "ethers"; -import { useGetReadContractConfigs } from "@/hooks/useGetReadContractConfigs"; import { NumericTransactionRow } from "@/app/app/components/NumericTransactionRow"; import { getDecimalPlace, toWei } from "@/lib/textHelper"; import TransactionRows from "@/app/app/stake/components/TransactionRows"; @@ -26,6 +23,9 @@ export default function WithdrawPage({ withdrawAmount, setWithdrawAmount, setWalletBalanceAmount, + isPending, + submitWithdraw, + previewWithdrawal, }: { walletBalanceAmount: string; amountError: string | null; @@ -34,6 +34,9 @@ export default function WithdrawPage({ withdrawAmount: string; setWithdrawAmount: React.Dispatch>; setWalletBalanceAmount: React.Dispatch>; + isPending: boolean; + submitWithdraw: () => void; + previewWithdrawal: string; }) { const { address, isConnected, status, chainId } = useAccount(); const { MarbleLsdProxy, mDFI } = useContractContext(); @@ -42,23 +45,9 @@ export default function WithdrawPage({ const { data: walletBalance } = useBalance({ address, chainId, - token: mDFI.address, + // token: mDFI.address, }); - const { data: previewDepositData } = useReadContract({ - address: MarbleLsdProxy.address, - abi: MarbleLsdProxy.abi, - functionName: "previewDeposit", - args: [toWei(withdrawAmount !== "" ? withdrawAmount : "0")], - query: { - enabled: isConnected, - }, - }); - - const previewDeposit = useMemo(() => { - return formatEther((previewDepositData as number) ?? 0).toString(); - }, [previewDepositData]); - const { data: totalAssetsData } = useReadContract({ address: MarbleLsdProxy.address, abi: MarbleLsdProxy.abi, @@ -68,16 +57,18 @@ export default function WithdrawPage({ }, }); + // To calculate and display the USD amount of total assets const totalAssets = useMemo(() => { return formatEther((totalAssetsData as number) ?? 0).toString(); }, [totalAssetsData]); - const totalAssetsUsdAmount = new BigNumber(totalAssets).isNaN() ? new BigNumber(0) : new BigNumber(totalAssets ?? 0).multipliedBy(dfiPrice); const balance = formatEther(walletBalance?.value.toString() ?? "0"); + const isDisabled = isPending || !withdrawAmount || !!amountError; + useEffect(() => { setWalletBalanceAmount(balance); // set wallet balance }, [address, status, walletBalance]); @@ -130,7 +121,7 @@ export default function WithdrawPage({
- + {isConnected && ( <> @@ -162,16 +153,27 @@ export default function WithdrawPage({ )}
- - {({ show }) => ( - - )} - + {isConnected ? ( + + ) : ( + + {({ show }) => ( + + )} + + )}
diff --git a/apps/web/src/app/app/withdraw/page.tsx b/apps/web/src/app/app/withdraw/page.tsx index 2b60195a..c4540e23 100644 --- a/apps/web/src/app/app/withdraw/page.tsx +++ b/apps/web/src/app/app/withdraw/page.tsx @@ -1,6 +1,11 @@ "use client"; -import { useAccount, useBalance, useReadContract } from "wagmi"; +import { + useAccount, + useBalance, + useReadContract, + useWriteContract, +} from "wagmi"; import React, { useEffect, useMemo, useState } from "react"; import { formatEther } from "ethers"; import { useGetReadContractConfigs } from "@/hooks/useGetReadContractConfigs"; @@ -9,17 +14,15 @@ import { useContractContext } from "@/context/ContractContext"; import { WithdrawStep } from "@/types"; import WithdrawPage from "@/app/app/withdraw/components/WithdrawPage"; import PreviewWithdrawal from "@/app/app/withdraw/components/PreviewWithdrawal"; +import toast from "react-hot-toast"; +import { CgSpinner } from "react-icons/cg"; +import { parseEther } from "viem"; export default function Withdraw() { const mainContentRef = React.useRef(null); - const { address, isConnected, status, chainId } = useAccount(); + const { address, isConnected, chainId } = useAccount(); const { MarbleLsdProxy } = useContractContext(); - const { data: walletBalance } = useBalance({ - address, - chainId, - }); - const { minDepositAmount } = useGetReadContractConfigs(); const [amountError, setAmountError] = useState(null); @@ -29,21 +32,27 @@ export default function Withdraw() { const [currentStep, setCurrentStep] = useState( WithdrawStep.WithdrawPage, ); - const { data: previewDepositData } = useReadContract({ + const { data: previewWithdrawalData } = useReadContract({ address: MarbleLsdProxy.address, abi: MarbleLsdProxy.abi, - functionName: "previewDeposit", + functionName: "previewRedeem", args: [toWei(withdrawAmount !== "" ? withdrawAmount : "0")], query: { enabled: isConnected, }, }); - const previewDeposit = useMemo(() => { - return formatEther((previewDepositData as number) ?? 0).toString(); - }, [previewDepositData]); + const { + data: hash, + isPending, + writeContract, + status: writeStatus, + } = useWriteContract(); - const balance = formatEther(walletBalance?.value.toString() ?? "0"); + const previewWithdrawal = useMemo(() => { + return formatEther((previewWithdrawalData as number) ?? 0).toString(); + }, [previewWithdrawalData]); + console.log({ previewWithdrawalData }); const setCurrentStepAndScroll = (step: WithdrawStep) => { setCurrentStep(step); @@ -52,6 +61,48 @@ export default function Withdraw() { } }; + const resetFields = () => { + setWithdrawAmount(""); + setAmountError(null); + }; + + function submitWithdraw() { + if (!amountError) { + writeContract( + { + abi: MarbleLsdProxy.abi, + address: MarbleLsdProxy.address, + functionName: "requestRedeem", + args: [parseEther(withdrawAmount), address as string], + }, + { + onSuccess: (hash) => { + if (hash) { + setCurrentStepAndScroll(WithdrawStep.PreviewWithdrawal); + } + }, + onError: (error) => { + console.log({ error }); + }, + }, + ); + } + } + useEffect(() => { + if (writeStatus === "pending") { + toast("Confirm transaction on your wallet.", { + icon: , + duration: Infinity, + className: + "bg-green px-2 py-1 !text-sm !text-light-00 !bg-dark-00 mt-10 !px-6 !py-4 !rounded-md", + id: "withdraw", + }); + } + + // cleanup + return () => toast.remove("withdraw"); + }, [writeStatus]); + console.log({ withdrawAmount }); return (
{currentStep === WithdrawStep.WithdrawPage ? ( @@ -63,28 +114,24 @@ export default function Withdraw() { withdrawAmount={withdrawAmount} setWithdrawAmount={setWithdrawAmount} setWalletBalanceAmount={setWalletBalanceAmount} + isPending={isPending} + submitWithdraw={submitWithdraw} /> ) : null} - {currentStep === WithdrawStep.PreviewWithdrawal ? ( - {}} - /> - ) : null} - - {}} - /> + {currentStep === WithdrawStep.PreviewWithdrawal + ? address && + hash && ( + + ) + : null}
); } From d38cc3836b58a209e1bf0c724f0b9c453722367c Mon Sep 17 00:00:00 2001 From: nattadex Date: Tue, 4 Jun 2024 13:14:32 +0800 Subject: [PATCH 045/200] added email link --- apps/web/src/app/app/stake/components/PausedStakingPage.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/web/src/app/app/stake/components/PausedStakingPage.tsx b/apps/web/src/app/app/stake/components/PausedStakingPage.tsx index cb7f2a78..c97a20f4 100644 --- a/apps/web/src/app/app/stake/components/PausedStakingPage.tsx +++ b/apps/web/src/app/app/stake/components/PausedStakingPage.tsx @@ -25,7 +25,9 @@ export default function PausedStakingPage() {
For any immediate concerns, you can report concerns{" "} - here. + + here. +
From f8c2ee9f4eca397817c126357873473321beb5b5 Mon Sep 17 00:00:00 2001 From: nattadex Date: Tue, 4 Jun 2024 13:27:31 +0800 Subject: [PATCH 046/200] changed to 30px border radius --- .../src/app/app/withdraw/components/ComplimentarySection.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx b/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx index 1e365677..fa3be84c 100644 --- a/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx +++ b/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx @@ -10,7 +10,7 @@ export default function ComplimentarySection() { const { isConnected } = useAccount(); return ( -
+
{isConnected ? : }
); From 9e7a9cf0633f623e2d37802884ddc6c17782c5a5 Mon Sep 17 00:00:00 2001 From: elocin Date: Tue, 4 Jun 2024 13:28:13 +0800 Subject: [PATCH 047/200] Update apps/web/src/app/app/components/AppFooter.tsx Co-authored-by: Harsh R <53080940+fullstackninja864@users.noreply.github.com> --- apps/web/src/app/app/components/AppFooter.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/app/app/components/AppFooter.tsx b/apps/web/src/app/app/components/AppFooter.tsx index 078089ce..5d565258 100644 --- a/apps/web/src/app/app/components/AppFooter.tsx +++ b/apps/web/src/app/app/components/AppFooter.tsx @@ -40,7 +40,7 @@ export default function AppFooter() {
{/* TODO fetch this from api */} From 102746973eb39ca12a83c4c537b4ab12c45bde6a Mon Sep 17 00:00:00 2001 From: elocin Date: Tue, 4 Jun 2024 13:28:39 +0800 Subject: [PATCH 048/200] Update apps/web/src/app/app/stake/components/StakePage.tsx Co-authored-by: Harsh R <53080940+fullstackninja864@users.noreply.github.com> --- apps/web/src/app/app/stake/components/StakePage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/app/app/stake/components/StakePage.tsx b/apps/web/src/app/app/stake/components/StakePage.tsx index 21123219..984c3c14 100644 --- a/apps/web/src/app/app/stake/components/StakePage.tsx +++ b/apps/web/src/app/app/stake/components/StakePage.tsx @@ -159,7 +159,7 @@ export default function StakePage({ isDisabled={isDisabled} isLoading={isPending} testId="instant-transfer-btn" - label={"Stake DFI"} + label="Stake DFI" customStyle="w-full md:py-5" onClick={submitStake} /> From 11cd6f36c9c928e67a9142346b201d9bc4b7b1e3 Mon Sep 17 00:00:00 2001 From: elocin Date: Tue, 4 Jun 2024 13:28:56 +0800 Subject: [PATCH 049/200] Update apps/web/src/app/app/stake/components/StakePage.tsx Co-authored-by: Harsh R <53080940+fullstackninja864@users.noreply.github.com> --- apps/web/src/app/app/stake/components/StakePage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/app/app/stake/components/StakePage.tsx b/apps/web/src/app/app/stake/components/StakePage.tsx index 984c3c14..60c8113c 100644 --- a/apps/web/src/app/app/stake/components/StakePage.tsx +++ b/apps/web/src/app/app/stake/components/StakePage.tsx @@ -168,7 +168,7 @@ export default function StakePage({ {({ show }) => ( From 7f452550b9efa56c25971a581af2feacb9675609 Mon Sep 17 00:00:00 2001 From: nattadex Date: Tue, 4 Jun 2024 13:50:24 +0800 Subject: [PATCH 050/200] changed to button-bg-gradient-1 --- .../src/app/app/withdraw/components/ComplimentarySection.tsx | 2 +- apps/web/src/globals.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx b/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx index d1a28bca..7305d12f 100644 --- a/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx +++ b/apps/web/src/app/app/withdraw/components/ComplimentarySection.tsx @@ -28,7 +28,7 @@ export default function ComplimentarySection({ testId="faq-button-complimentary-section" customStyle="!px-3 !py-3 md:!py-2" customTextStyle="whitespace-nowrap text-xs font-medium" - customBgColor="withdraw-button-bg" + customBgColor="button-bg-gradient-1" />
diff --git a/apps/web/src/globals.css b/apps/web/src/globals.css index e9182e8a..46295f2b 100644 --- a/apps/web/src/globals.css +++ b/apps/web/src/globals.css @@ -263,6 +263,6 @@ input[type="number"] { background: var(--UI-Component-BG-4); } -.withdraw-button-bg { +.button-bg-gradient-1 { background: linear-gradient(180deg, rgba(206, 219, 245, 0.15) 0%, rgba(150, 178, 232, 0.15) 100%); } \ No newline at end of file From d5b416b147a4d478d4b5b9453fa8761dadeb8df5 Mon Sep 17 00:00:00 2001 From: nattadex Date: Tue, 4 Jun 2024 14:30:54 +0800 Subject: [PATCH 051/200] updated to previewRedeem --- apps/web/src/app/app/stake/components/StakePage.tsx | 2 +- .../src/app/app/stake/components/TransactionRows.tsx | 8 ++++---- apps/web/src/app/app/withdraw/page.tsx | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/web/src/app/app/stake/components/StakePage.tsx b/apps/web/src/app/app/stake/components/StakePage.tsx index 60c8113c..4e5b877a 100644 --- a/apps/web/src/app/app/stake/components/StakePage.tsx +++ b/apps/web/src/app/app/stake/components/StakePage.tsx @@ -151,7 +151,7 @@ export default function StakePage({
- +
{isConnected ? ( diff --git a/apps/web/src/app/app/stake/components/TransactionRows.tsx b/apps/web/src/app/app/stake/components/TransactionRows.tsx index e36fd939..3de72a1a 100644 --- a/apps/web/src/app/app/stake/components/TransactionRows.tsx +++ b/apps/web/src/app/app/stake/components/TransactionRows.tsx @@ -6,9 +6,9 @@ import { useGetReadContractConfigs } from "@/hooks/useGetReadContractConfigs"; import { NumericTransactionRow } from "@/app/app/components/NumericTransactionRow"; export default function TransactionRows({ - previewDeposit, + previewAmount, }: { - previewDeposit: string; + previewAmount: string; }) { const { mDfiToDfiConversion } = useGetReadContractConfigs(); const { MarbleLsdProxy } = useContractContext(); @@ -25,8 +25,8 @@ export default function TransactionRows({ label="You will receive" comment="(after fees)" value={{ - value: previewDeposit, - decimalScale: getDecimalPlace(previewDeposit), + value: previewAmount, + decimalScale: getDecimalPlace(previewAmount), suffix: ` mDFI`, }} /> diff --git a/apps/web/src/app/app/withdraw/page.tsx b/apps/web/src/app/app/withdraw/page.tsx index e945c08f..004343f2 100644 --- a/apps/web/src/app/app/withdraw/page.tsx +++ b/apps/web/src/app/app/withdraw/page.tsx @@ -36,19 +36,19 @@ export default function Withdraw() { const [withdrawAmount, setWithdrawAmount] = useState(""); const [walletBalanceAmount, setWalletBalanceAmount] = useState(""); - const { data: previewDepositData } = useReadContract({ + const { data: previewRedeemData } = useReadContract({ address: MarbleLsdProxy.address, abi: MarbleLsdProxy.abi, - functionName: "previewDeposit", + functionName: "previewRedeem", args: [toWei(withdrawAmount !== "" ? withdrawAmount : "0")], query: { enabled: isConnected, }, }); - const previewDeposit = useMemo(() => { - return formatEther((previewDepositData as number) ?? 0).toString(); - }, [previewDepositData]); + const previewRedeem = useMemo(() => { + return formatEther((previewRedeemData as number) ?? 0).toString(); + }, [previewRedeemData]); const { data: totalAssetsData } = useReadContract({ address: MarbleLsdProxy.address, @@ -123,7 +123,7 @@ export default function Withdraw() {
- + {isConnected && ( <> From 129115033eb5d90c01faba3ba9a5ea5f65eec9f5 Mon Sep 17 00:00:00 2001 From: nattadex Date: Tue, 4 Jun 2024 14:38:50 +0800 Subject: [PATCH 052/200] moved totalAssets & totalAssetsUsdAmount to useGetReadContractConfigs --- apps/web/src/app/app/withdraw/page.tsx | 25 ++--------------- .../src/hooks/useGetReadContractConfigs.ts | 27 ++++++++++++++++++- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/apps/web/src/app/app/withdraw/page.tsx b/apps/web/src/app/app/withdraw/page.tsx index 004343f2..3d54949b 100644 --- a/apps/web/src/app/app/withdraw/page.tsx +++ b/apps/web/src/app/app/withdraw/page.tsx @@ -12,17 +12,14 @@ import ComplimentarySection from "@/app/app/withdraw/components/ComplimentarySec import BigNumber from "bignumber.js"; import TransactionRows from "@/app/app/stake/components/TransactionRows"; import { NumericTransactionRow } from "@/app/app/components/NumericTransactionRow"; -import useDebounce from "@/hooks/useDebounce"; import { formatEther } from "ethers"; import { useGetReadContractConfigs } from "@/hooks/useGetReadContractConfigs"; import { getDecimalPlace, toWei } from "@/lib/textHelper"; import { useContractContext } from "@/context/ContractContext"; -import { useDfiPrice } from "@/hooks/useDfiPrice"; export default function Withdraw() { const { address, isConnected, status, chainId } = useAccount(); const { MarbleLsdProxy, mDFI } = useContractContext(); - const dfiPrice = useDfiPrice(); const { data: walletBalance } = useBalance({ address, @@ -30,7 +27,8 @@ export default function Withdraw() { token: mDFI.address, }); - const { minDepositAmount } = useGetReadContractConfigs(); + const { minDepositAmount, totalAssets, totalAssetsUsdAmount } = + useGetReadContractConfigs(); const [amountError, setAmountError] = useState(null); const [withdrawAmount, setWithdrawAmount] = useState(""); @@ -50,26 +48,7 @@ export default function Withdraw() { return formatEther((previewRedeemData as number) ?? 0).toString(); }, [previewRedeemData]); - const { data: totalAssetsData } = useReadContract({ - address: MarbleLsdProxy.address, - abi: MarbleLsdProxy.abi, - functionName: "totalAssets", - query: { - enabled: isConnected, - }, - }); - - const totalAssets = useMemo(() => { - return formatEther((totalAssetsData as number) ?? 0).toString(); - }, [totalAssetsData]); - - const totalAssetsUsdAmount = new BigNumber(totalAssets).isNaN() - ? new BigNumber(0) - : new BigNumber(totalAssets ?? 0).multipliedBy(dfiPrice); - const balance = formatEther(walletBalance?.value.toString() ?? "0"); - // to avoid multiple contract fetch - const debounceWithdrawAmount = useDebounce(withdrawAmount, 200); useEffect(() => { setWalletBalanceAmount(balance); // set wallet balance diff --git a/apps/web/src/hooks/useGetReadContractConfigs.ts b/apps/web/src/hooks/useGetReadContractConfigs.ts index 34330fa6..d200bc70 100644 --- a/apps/web/src/hooks/useGetReadContractConfigs.ts +++ b/apps/web/src/hooks/useGetReadContractConfigs.ts @@ -1,14 +1,20 @@ import { useContractContext } from "@/context/ContractContext"; -import { useAccount, useReadContracts } from "wagmi"; +import { useAccount, useReadContract, useReadContracts } from "wagmi"; import { formatEther, parseEther } from "ethers"; +import { useMemo } from "react"; +import BigNumber from "bignumber.js"; +import { useDfiPrice } from "@/hooks/useDfiPrice"; export function useGetReadContractConfigs(): { mDfiToDfiConversion: string; isDepositPaused: boolean; minDepositAmount: string; + totalAssets: string; + totalAssetsUsdAmount: BigNumber; } { const { isConnected } = useAccount(); const { MarbleLsdProxy } = useContractContext(); + const dfiPrice = useDfiPrice(); const { data: contractResponse } = useReadContracts({ contracts: [ @@ -44,9 +50,28 @@ export function useGetReadContractConfigs(): { const minDepositAmount = formatEther( (minDepositData?.result as number) ?? 0, ).toString(); + + const { data: totalAssetsData } = useReadContract({ + address: MarbleLsdProxy.address, + abi: MarbleLsdProxy.abi, + functionName: "totalAssets", + query: { + enabled: isConnected, + }, + }); + + const totalAssets = useMemo(() => { + return formatEther((totalAssetsData as number) ?? 0).toString(); + }, [totalAssetsData]); + + const totalAssetsUsdAmount = new BigNumber(totalAssets).isNaN() + ? new BigNumber(0) + : new BigNumber(totalAssets ?? 0).multipliedBy(dfiPrice); return { mDfiToDfiConversion, isDepositPaused, minDepositAmount, + totalAssets, + totalAssetsUsdAmount, }; } From 608f8e8e03714949b2673fe6393875fa03c73fe2 Mon Sep 17 00:00:00 2001 From: chloe <44501120+chloezxyy@users.noreply.github.com> Date: Tue, 4 Jun 2024 15:18:34 +0800 Subject: [PATCH 053/200] fix(ui-ux): handle invalid input amount --- apps/web/src/app/app/stake/page.tsx | 7 +++++-- apps/web/src/app/app/withdraw/page.tsx | 10 +++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/apps/web/src/app/app/stake/page.tsx b/apps/web/src/app/app/stake/page.tsx index 3ccbb96c..acc9fe64 100644 --- a/apps/web/src/app/app/stake/page.tsx +++ b/apps/web/src/app/app/stake/page.tsx @@ -79,16 +79,19 @@ export default function Stake() { const [enableConnectedWallet, setEnableConnectedWallet] = useState(isConnected); + // To prevent submitting invalid number (too large or too small) + const validAmount = stakeAmount !== "" && !amountError; + const stakeAmountString = validAmount ? stakeAmount : "0"; + const { data: previewDepositData } = useReadContract({ address: MarbleLsdProxy.address, abi: MarbleLsdProxy.abi, functionName: "previewDeposit", - args: [toWei(stakeAmount !== "" ? stakeAmount : "0")], + args: [toWei(stakeAmountString)], query: { enabled: isConnected, }, }); - console.log({ previewDepositData }); const previewDeposit = useMemo(() => { return formatEther((previewDepositData as number) ?? 0).toString(); diff --git a/apps/web/src/app/app/withdraw/page.tsx b/apps/web/src/app/app/withdraw/page.tsx index c4540e23..6ffd18e3 100644 --- a/apps/web/src/app/app/withdraw/page.tsx +++ b/apps/web/src/app/app/withdraw/page.tsx @@ -32,11 +32,16 @@ export default function Withdraw() { const [currentStep, setCurrentStep] = useState( WithdrawStep.WithdrawPage, ); + + // To prevent submitting invalid number (too large or too small) + const validAmount = withdrawAmount !== "" && !amountError; + const withdrawAmountString = validAmount ? withdrawAmount : "0"; + const { data: previewWithdrawalData } = useReadContract({ address: MarbleLsdProxy.address, abi: MarbleLsdProxy.abi, functionName: "previewRedeem", - args: [toWei(withdrawAmount !== "" ? withdrawAmount : "0")], + args: [toWei(withdrawAmountString)], query: { enabled: isConnected, }, @@ -52,7 +57,6 @@ export default function Withdraw() { const previewWithdrawal = useMemo(() => { return formatEther((previewWithdrawalData as number) ?? 0).toString(); }, [previewWithdrawalData]); - console.log({ previewWithdrawalData }); const setCurrentStepAndScroll = (step: WithdrawStep) => { setCurrentStep(step); @@ -102,7 +106,6 @@ export default function Withdraw() { // cleanup return () => toast.remove("withdraw"); }, [writeStatus]); - console.log({ withdrawAmount }); return (
{currentStep === WithdrawStep.WithdrawPage ? ( @@ -116,6 +119,7 @@ export default function Withdraw() { setWalletBalanceAmount={setWalletBalanceAmount} isPending={isPending} submitWithdraw={submitWithdraw} + previewWithdrawal={previewWithdrawal} /> ) : null} From 117d771c73e33aeb10b58bf763caad950ea9cd74 Mon Sep 17 00:00:00 2001 From: chloe <44501120+chloezxyy@users.noreply.github.com> Date: Tue, 4 Jun 2024 15:55:51 +0800 Subject: [PATCH 054/200] code cleanup --- apps/web/src/app/app/stake/page.tsx | 2 +- .../app/withdraw/components/WithdrawPage.tsx | 15 ++++---- apps/web/src/app/app/withdraw/page.tsx | 36 +++++++------------ 3 files changed, 21 insertions(+), 32 deletions(-) diff --git a/apps/web/src/app/app/stake/page.tsx b/apps/web/src/app/app/stake/page.tsx index acc9fe64..c8c8bc9a 100644 --- a/apps/web/src/app/app/stake/page.tsx +++ b/apps/web/src/app/app/stake/page.tsx @@ -79,7 +79,7 @@ export default function Stake() { const [enableConnectedWallet, setEnableConnectedWallet] = useState(isConnected); - // To prevent submitting invalid number (too large or too small) + // To prevent calling contract with invalid number (too large or too small) const validAmount = stakeAmount !== "" && !amountError; const stakeAmountString = validAmount ? stakeAmount : "0"; diff --git a/apps/web/src/app/app/withdraw/components/WithdrawPage.tsx b/apps/web/src/app/app/withdraw/components/WithdrawPage.tsx index 52e47754..427ed0c4 100644 --- a/apps/web/src/app/app/withdraw/components/WithdrawPage.tsx +++ b/apps/web/src/app/app/withdraw/components/WithdrawPage.tsx @@ -10,42 +10,43 @@ import ComplimentarySection from "@/app/app/withdraw/components/ComplimentarySec import BigNumber from "bignumber.js"; import { formatEther } from "ethers"; import { NumericTransactionRow } from "@/app/app/components/NumericTransactionRow"; -import { getDecimalPlace, toWei } from "@/lib/textHelper"; +import { getDecimalPlace } from "@/lib/textHelper"; import TransactionRows from "@/app/app/stake/components/TransactionRows"; import { useContractContext } from "@/context/ContractContext"; import { useDfiPrice } from "@/hooks/useDfiPrice"; +import { useGetReadContractConfigs } from "@/hooks/useGetReadContractConfigs"; export default function WithdrawPage({ walletBalanceAmount, amountError, setAmountError, - minDepositAmount, withdrawAmount, setWithdrawAmount, setWalletBalanceAmount, isPending, submitWithdraw, - previewWithdrawal, + previewRedeem, }: { walletBalanceAmount: string; amountError: string | null; setAmountError: React.Dispatch>; - minDepositAmount: string; withdrawAmount: string; setWithdrawAmount: React.Dispatch>; setWalletBalanceAmount: React.Dispatch>; isPending: boolean; submitWithdraw: () => void; - previewWithdrawal: string; + previewRedeem: string; }) { const { address, isConnected, status, chainId } = useAccount(); const { MarbleLsdProxy, mDFI } = useContractContext(); const dfiPrice = useDfiPrice(); + const { minDepositAmount } = useGetReadContractConfigs(); + const { data: walletBalance } = useBalance({ address, chainId, - // token: mDFI.address, + token: mDFI.address, }); const { data: totalAssetsData } = useReadContract({ @@ -121,7 +122,7 @@ export default function WithdrawPage({
- + {isConnected && ( <> diff --git a/apps/web/src/app/app/withdraw/page.tsx b/apps/web/src/app/app/withdraw/page.tsx index 9a2e7cda..30d70b47 100644 --- a/apps/web/src/app/app/withdraw/page.tsx +++ b/apps/web/src/app/app/withdraw/page.tsx @@ -1,15 +1,9 @@ "use client"; -import { - useAccount, - useBalance, - useReadContract, - useWriteContract, -} from "wagmi"; +import { useAccount, useReadContract, useWriteContract } from "wagmi"; import React, { useEffect, useMemo, useState } from "react"; import { formatEther } from "ethers"; -import { useGetReadContractConfigs } from "@/hooks/useGetReadContractConfigs"; -import { getDecimalPlace, toWei } from "@/lib/textHelper"; +import { toWei } from "@/lib/textHelper"; import { useContractContext } from "@/context/ContractContext"; import { WithdrawStep } from "@/types"; import WithdrawPage from "@/app/app/withdraw/components/WithdrawPage"; @@ -18,19 +12,16 @@ import toast from "react-hot-toast"; import { CgSpinner } from "react-icons/cg"; import { parseEther } from "viem"; +/* + * Withdrawal flow + * The term 'redeem' is used for withdrawing mDFI shares from the vault + * Future: The term 'withdraw' is used for withdrawing DFI assets from the vault + */ + export default function Withdraw() { const mainContentRef = React.useRef(null); - const { address, isConnected, chainId, status } = useAccount(); - const { MarbleLsdProxy, mDFI } = useContractContext(); - - const { data: walletBalance } = useBalance({ - address, - chainId, - token: mDFI.address, - }); - - const { minDepositAmount, totalAssets, totalAssetsUsdAmount } = - useGetReadContractConfigs(); + const { address, isConnected } = useAccount(); + const { MarbleLsdProxy } = useContractContext(); const [amountError, setAmountError] = useState(null); const [withdrawAmount, setWithdrawAmount] = useState(""); @@ -40,7 +31,7 @@ export default function Withdraw() { WithdrawStep.WithdrawPage, ); - // To prevent submitting invalid number (too large or too small) + // To prevent calling contract with invalid number (too large or too small) const validAmount = withdrawAmount !== "" && !amountError; const withdrawAmountString = validAmount ? withdrawAmount : "0"; @@ -65,8 +56,6 @@ export default function Withdraw() { return formatEther((previewRedeemData as number) ?? 0).toString(); }, [previewRedeemData]); - const balance = formatEther(walletBalance?.value.toString() ?? "0"); - const setCurrentStepAndScroll = (step: WithdrawStep) => { setCurrentStep(step); if (mainContentRef.current) { @@ -122,13 +111,12 @@ export default function Withdraw() { walletBalanceAmount={walletBalanceAmount} amountError={amountError} setAmountError={setAmountError} - minDepositAmount={minDepositAmount} withdrawAmount={withdrawAmount} setWithdrawAmount={setWithdrawAmount} setWalletBalanceAmount={setWalletBalanceAmount} isPending={isPending} submitWithdraw={submitWithdraw} - previewWithdrawal={previewRedeem} + previewRedeem={previewRedeem} /> ) : null} From 2647f2e9c2a971dca63ca6447a08d490bb412e8a Mon Sep 17 00:00:00 2001 From: nattadex Date: Tue, 4 Jun 2024 16:03:18 +0800 Subject: [PATCH 055/200] HoverPopover.tsx comments --- .../src/app/app/components/HoverPopover.tsx | 67 +++++++++---------- 1 file changed, 31 insertions(+), 36 deletions(-) diff --git a/apps/web/src/app/app/components/HoverPopover.tsx b/apps/web/src/app/app/components/HoverPopover.tsx index 0ac7a278..9e87477e 100644 --- a/apps/web/src/app/app/components/HoverPopover.tsx +++ b/apps/web/src/app/app/components/HoverPopover.tsx @@ -1,20 +1,22 @@ -import { PropsWithChildren, ReactNode, useState } from "react"; +import { ReactElement, ReactNode, useState } from "react"; import { Placement, useFloating, shift } from "@floating-ui/react-dom"; import clsx from "clsx"; -interface IconPopoverProps { +export function HoverPopover({ + popover, + placement, + className, + children, +}: { popover: string | ReactNode; placement?: Placement; className?: string; -} - -export function HoverPopover( - props: PropsWithChildren, -): JSX.Element { + children?: ReactElement; +}): JSX.Element { const [isHover, setIsHover] = useState(false); const { x, y, reference, floating, strategy } = useFloating({ - placement: props.placement ?? "bottom", + placement: placement ?? "bottom", middleware: [shift()], strategy: "fixed", }); @@ -26,36 +28,29 @@ export function HoverPopover( onMouseOver={() => setIsHover(true)} onMouseLeave={() => setIsHover(false)} onTouchCancel={() => setIsHover(false)} - className={clsx(props.className)} + className={clsx(className)} > - {props.children} + {children}
- - {(() => { - if (!isHover) { - return null; - } - - return ( -
- {typeof props.popover === "string" ? ( -
- {props.popover} -
- ) : ( - props.popover - )} -
- ); - })()} + {isHover ? ( +
+ {typeof popover === "string" ? ( +
+ {popover} +
+ ) : ( + popover + )} +
+ ) : null} ); } From d7d8ea16457751c6e91108f7f86d1168260d33bd Mon Sep 17 00:00:00 2001 From: nattadex Date: Tue, 4 Jun 2024 16:13:04 +0800 Subject: [PATCH 056/200] passed in suffix instead --- apps/web/src/app/app/components/HoverPopover.tsx | 4 ++-- apps/web/src/app/app/components/WalletDetails.tsx | 6 +++--- apps/web/src/app/app/stake/components/StakePage.tsx | 2 ++ apps/web/src/app/app/withdraw/page.tsx | 3 ++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/apps/web/src/app/app/components/HoverPopover.tsx b/apps/web/src/app/app/components/HoverPopover.tsx index 9e87477e..f0d930e7 100644 --- a/apps/web/src/app/app/components/HoverPopover.tsx +++ b/apps/web/src/app/app/components/HoverPopover.tsx @@ -1,4 +1,4 @@ -import { ReactElement, ReactNode, useState } from "react"; +import React, { ReactNode, useState } from "react"; import { Placement, useFloating, shift } from "@floating-ui/react-dom"; import clsx from "clsx"; @@ -11,7 +11,7 @@ export function HoverPopover({ popover: string | ReactNode; placement?: Placement; className?: string; - children?: ReactElement; + children?: React.ReactNode; }): JSX.Element { const [isHover, setIsHover] = useState(false); diff --git a/apps/web/src/app/app/components/WalletDetails.tsx b/apps/web/src/app/app/components/WalletDetails.tsx index 71e0615d..44979bf2 100644 --- a/apps/web/src/app/app/components/WalletDetails.tsx +++ b/apps/web/src/app/app/components/WalletDetails.tsx @@ -6,14 +6,14 @@ import BigNumber from "bignumber.js"; export default function WalletDetails({ isWalletConnected, + suffix, style, walletBalanceAmount, - isMdfi, }: { isWalletConnected: boolean; + suffix?: string; style?: string; walletBalanceAmount?: string; - isMdfi?: boolean; }) { const decimalScale = getDecimalPlace(walletBalanceAmount ?? 0); return ( @@ -26,7 +26,7 @@ export default function WalletDetails({ Available:
@@ -105,6 +106,7 @@ export default function StakePage({ walletBalanceAmount={walletBalanceAmount} isWalletConnected={isConnected} style="block md:hidden" + suffix=" DFI" />
diff --git a/apps/web/src/app/app/withdraw/page.tsx b/apps/web/src/app/app/withdraw/page.tsx index 3d54949b..18283459 100644 --- a/apps/web/src/app/app/withdraw/page.tsx +++ b/apps/web/src/app/app/withdraw/page.tsx @@ -70,7 +70,7 @@ export default function Withdraw() { walletBalanceAmount={walletBalanceAmount} isWalletConnected={isConnected} style="md:block hidden" - isMdfi + suffix=" mDFI" />
@@ -98,6 +98,7 @@ export default function Withdraw() { walletBalanceAmount={walletBalanceAmount} isWalletConnected={isConnected} style="block md:hidden" + suffix=" mDFI" /> From c0587d57d0ced64f5204fa67c0d38d3762e222a0 Mon Sep 17 00:00:00 2001 From: nattadex Date: Tue, 4 Jun 2024 16:15:29 +0800 Subject: [PATCH 057/200] hide hardcoded annual rewards --- apps/web/src/app/app/withdraw/page.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/apps/web/src/app/app/withdraw/page.tsx b/apps/web/src/app/app/withdraw/page.tsx index 18283459..02262858 100644 --- a/apps/web/src/app/app/withdraw/page.tsx +++ b/apps/web/src/app/app/withdraw/page.tsx @@ -122,14 +122,15 @@ export default function Withdraw() { prefix: "$", }} /> - + {/*TODO to update when api is ready*/} + {/**/} )} From 1e61a5ba062ea4242a37e90e210216199c340211 Mon Sep 17 00:00:00 2001 From: nattadex Date: Tue, 4 Jun 2024 16:40:50 +0800 Subject: [PATCH 058/200] fixed NaN bug --- apps/web/src/app/app/components/WalletDetails.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/apps/web/src/app/app/components/WalletDetails.tsx b/apps/web/src/app/app/components/WalletDetails.tsx index 44979bf2..ca9d1908 100644 --- a/apps/web/src/app/app/components/WalletDetails.tsx +++ b/apps/web/src/app/app/components/WalletDetails.tsx @@ -27,10 +27,7 @@ export default function WalletDetails({

From a05712e96ae9dbd40bca324ea16cf1ba591dc131 Mon Sep 17 00:00:00 2001 From: nattadex Date: Wed, 5 Jun 2024 13:34:58 +0800 Subject: [PATCH 059/200] update configs --- .../src/hooks/useGetReadContractConfigs.ts | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/web/src/hooks/useGetReadContractConfigs.ts b/apps/web/src/hooks/useGetReadContractConfigs.ts index d200bc70..2073fd37 100644 --- a/apps/web/src/hooks/useGetReadContractConfigs.ts +++ b/apps/web/src/hooks/useGetReadContractConfigs.ts @@ -1,5 +1,5 @@ import { useContractContext } from "@/context/ContractContext"; -import { useAccount, useReadContract, useReadContracts } from "wagmi"; +import { useAccount, useReadContracts } from "wagmi"; import { formatEther, parseEther } from "ethers"; import { useMemo } from "react"; import BigNumber from "bignumber.js"; @@ -35,14 +35,23 @@ export function useGetReadContractConfigs(): { functionName: "minDeposit", args: [], }, + { + address: MarbleLsdProxy.address, + abi: MarbleLsdProxy.abi, + functionName: "totalAssets", + }, ], query: { enabled: isConnected, }, }); - const [depositPausedData, convertToAssetsData, minDepositData] = - contractResponse ?? []; + const [ + depositPausedData, + convertToAssetsData, + minDepositData, + totalAssetsData, + ] = contractResponse ?? []; const mDfiToDfiConversion = formatEther( (convertToAssetsData?.result as number) ?? 0, ).toString(); @@ -51,17 +60,8 @@ export function useGetReadContractConfigs(): { (minDepositData?.result as number) ?? 0, ).toString(); - const { data: totalAssetsData } = useReadContract({ - address: MarbleLsdProxy.address, - abi: MarbleLsdProxy.abi, - functionName: "totalAssets", - query: { - enabled: isConnected, - }, - }); - const totalAssets = useMemo(() => { - return formatEther((totalAssetsData as number) ?? 0).toString(); + return formatEther((totalAssetsData?.result as number) ?? 0).toString(); }, [totalAssetsData]); const totalAssetsUsdAmount = new BigNumber(totalAssets).isNaN() From 98d1632172299f69945c5afdf59e972394ab6b6e Mon Sep 17 00:00:00 2001 From: nattadex Date: Wed, 5 Jun 2024 14:35:32 +0800 Subject: [PATCH 060/200] use version api --- apps/web/src/app/app/components/AppFooter.tsx | 17 +++++++++++++++-- apps/web/src/lib/types.ts | 4 ++++ apps/web/src/store/marbleFiApi.ts | 9 ++++++++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/apps/web/src/app/app/components/AppFooter.tsx b/apps/web/src/app/app/components/AppFooter.tsx index 5d565258..123719b8 100644 --- a/apps/web/src/app/app/components/AppFooter.tsx +++ b/apps/web/src/app/app/components/AppFooter.tsx @@ -4,6 +4,8 @@ import clsx from "clsx"; import { FaReddit } from "react-icons/fa"; import { FaXTwitter } from "react-icons/fa6"; import Link from "next/link"; +import { useGetVersionMutation } from "@/store/marbleFiApi"; +import { useEffect, useState } from "react"; const footerLinks = [ // { @@ -27,6 +29,18 @@ const footerLinks = [ ]; export default function AppFooter() { + const [version, setVersion] = useState("0.0.0"); + const [getVersion] = useGetVersionMutation(); + + const getVer = async () => { + const ver = await getVersion({}).unwrap(); + setVersion(ver?.v); + }; + + useEffect(() => { + getVer(); + }, []); + return (