diff --git a/bun.lockb b/bun.lockb index 32d25b9..2f5b9fd 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 737a793..9fe459e 100644 --- a/package.json +++ b/package.json @@ -1,81 +1,81 @@ { - "name": "yearnx", - "private": true, - "workspaces": [ - "packages/*" - ], - "scripts": { - "prettier-format": "prettier --config .prettierrc ./packages/**/**/*.{json,js,ts,tsx,css} --write", - "lint": "eslint . --ext .js,.jsx,.ts,.tsx" - }, - "dependencies": { - "@builtbymom/web3": "0.0.215", - "@closeio/use-abortable-effect": "^1.0.0", - "@generationsoftware/hyperstructure-client-js": "^1.12.6", - "@generationsoftware/hyperstructure-react-hooks": "^1.16.8", - "@headlessui/react": "^2.0.3", - "@rainbow-me/rainbowkit": "^2.1.3", - "@react-hookz/web": "^24.0.4", - "@tailwindcss/forms": "^0.5.7", - "@tailwindcss/typography": "^0.5.13", - "@tanstack/react-query": "^5.51.21", - "@wagmi/core": "^2.13.1", - "axios": "^1.6.8", - "framer-motion": "^11.1.9", - "next": "14.0.4", - "next-plausible": "^3.12.1", - "next-pwa": "^5.6.0", - "rc-input-number": "^9.0.0", - "react": "^18.3.1", - "react-dom": "^18.3.1", - "react-hot-toast": "^2.4.1", - "react-paginate": "^8.2.0", - "swr": "^2.2.5", - "tailwindcss": "^3.4.3", - "tailwindcss-animate": "^1.0.7", - "usehooks-ts": "^3.1.0", - "vaul": "^0.9.1", - "viem": "^2.18.8", - "wagmi": "^2.12.2", - "web3-eth-abi": "1.10.0", - "xxhashjs": "^0.2.2", - "zod": "^3.23.8" - }, - "devDependencies": { - "@commitlint/cli": "^19.3.0", - "@commitlint/config-conventional": "^19.2.2", - "@total-typescript/ts-reset": "^0.5.1", - "@types/node": "^20.12.11", - "@types/nprogress": "^0.2.3", - "@types/react": "^18.3.2", - "@types/react-dom": "^18.3.0", - "@typescript-eslint/eslint-plugin": "^7.8.0", - "@typescript-eslint/parser": "^7.8.0", - "autoprefixer": "^10.4.19", - "babel-loader": "^9.1.3", - "bun-types": "^1.1.8", - "eslint": "8.57.0", - "eslint-config-next": "^14.2.3", - "eslint-config-prettier": "^9.1.0", - "eslint-import-resolver-typescript": "^3.6.1", - "eslint-plugin-brackets": "^0.1.3", - "eslint-plugin-import": "^2.29.1", - "eslint-plugin-react": "^7.34.1", - "eslint-plugin-react-hooks": "^4.6.2", - "eslint-plugin-simple-import-sort": "^12.1.0", - "eslint-plugin-tailwindcss": "^3.15.1", - "eslint-plugin-unused-imports": "^3.2.0", - "lint-staged": "^15.2.2", - "next-transpile-modules": "^10.0.1", - "postcss": "^8.4.38", - "postcss-import": "^16.1.0", - "postcss-nesting": "^12.1.3", - "prettier": "^3.2.5", - "sass": "^1.77.1", - "sharp": "^0.33.3", - "stylelint": "^16.5.0", - "stylelint-config-standard": "^36.0.0", - "ts-loader": "^9.5.1", - "typescript": "^5.4.5" - } + "name": "yearnx", + "private": true, + "workspaces": [ + "packages/*" + ], + "scripts": { + "prettier-format": "prettier --config .prettierrc ./packages/**/**/*.{json,js,ts,tsx,css} --write", + "lint": "eslint . --ext .js,.jsx,.ts,.tsx" + }, + "dependencies": { + "@builtbymom/web3": "0.0.218", + "@closeio/use-abortable-effect": "^1.0.0", + "@generationsoftware/hyperstructure-client-js": "^1.12.6", + "@generationsoftware/hyperstructure-react-hooks": "^1.16.8", + "@headlessui/react": "^2.0.3", + "@rainbow-me/rainbowkit": "^2.1.3", + "@react-hookz/web": "^24.0.4", + "@tailwindcss/forms": "^0.5.7", + "@tailwindcss/typography": "^0.5.13", + "@tanstack/react-query": "^5.51.21", + "@wagmi/core": "^2.13.1", + "axios": "^1.6.8", + "framer-motion": "^11.1.9", + "next": "14.0.4", + "next-plausible": "^3.12.1", + "next-pwa": "^5.6.0", + "rc-input-number": "^9.0.0", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "react-hot-toast": "^2.4.1", + "react-paginate": "^8.2.0", + "swr": "^2.2.5", + "tailwindcss": "^3.4.3", + "tailwindcss-animate": "^1.0.7", + "usehooks-ts": "^3.1.0", + "vaul": "^0.9.1", + "viem": "^2.18.8", + "wagmi": "^2.12.2", + "web3-eth-abi": "1.10.0", + "xxhashjs": "^0.2.2", + "zod": "^3.23.8" + }, + "devDependencies": { + "@commitlint/cli": "^19.3.0", + "@commitlint/config-conventional": "^19.2.2", + "@total-typescript/ts-reset": "^0.5.1", + "@types/node": "^20.12.11", + "@types/nprogress": "^0.2.3", + "@types/react": "^18.3.2", + "@types/react-dom": "^18.3.0", + "@typescript-eslint/eslint-plugin": "^7.8.0", + "@typescript-eslint/parser": "^7.8.0", + "autoprefixer": "^10.4.19", + "babel-loader": "^9.1.3", + "bun-types": "^1.1.8", + "eslint": "8.57.0", + "eslint-config-next": "^14.2.3", + "eslint-config-prettier": "^9.1.0", + "eslint-import-resolver-typescript": "^3.6.1", + "eslint-plugin-brackets": "^0.1.3", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-react": "^7.34.1", + "eslint-plugin-react-hooks": "^4.6.2", + "eslint-plugin-simple-import-sort": "^12.1.0", + "eslint-plugin-tailwindcss": "^3.15.1", + "eslint-plugin-unused-imports": "^3.2.0", + "lint-staged": "^15.2.2", + "next-transpile-modules": "^10.0.1", + "postcss": "^8.4.38", + "postcss-import": "^16.1.0", + "postcss-nesting": "^12.1.3", + "prettier": "^3.2.5", + "sass": "^1.77.1", + "sharp": "^0.33.3", + "stylelint": "^16.5.0", + "stylelint-config-standard": "^36.0.0", + "ts-loader": "^9.5.1", + "typescript": "^5.4.5" + } } diff --git a/packages/lib/components/common/DepositModal.tsx b/packages/lib/components/common/DepositModal.tsx index 22ebe8c..0590446 100644 --- a/packages/lib/components/common/DepositModal.tsx +++ b/packages/lib/components/common/DepositModal.tsx @@ -76,7 +76,7 @@ export function DepositModalContent(props: TDepositModalProps): ReactElement { openAccountModal?.(); } if (canDeposit) { - const isSuccess = await onDeposit(); + const isSuccess = await onDeposit(receipt => console.info('receipt: ', receipt)); if (isSuccess) { plausible(PLAUSIBLE_EVENTS.DEPOSIT, { props: { @@ -92,10 +92,10 @@ export function DepositModalContent(props: TDepositModalProps): ReactElement { props.openSuccessModal({ isOpen: true, description: ( -
-

{'Successfully deposited'}

- -
+ + {'Successfully deposited'} +   + {!isZapNeededForDeposit ? configuration?.tokenToSpend.amount?.display.slice(0, 7) : formatBigIntForDisplay( @@ -103,13 +103,14 @@ export function DepositModalContent(props: TDepositModalProps): ReactElement { configuration?.tokenToSpend.token?.decimals ?? 18, {maximumFractionDigits: 6} )} -

{configuration?.tokenToSpend?.token?.symbol}

+   + {configuration?.tokenToSpend?.token?.symbol} {'to'} {configuration?.vault?.name} -
-
+ + ) }); } diff --git a/packages/lib/components/common/WithdrawModal.tsx b/packages/lib/components/common/WithdrawModal.tsx index e5c77ba..147c9b1 100644 --- a/packages/lib/components/common/WithdrawModal.tsx +++ b/packages/lib/components/common/WithdrawModal.tsx @@ -334,7 +334,9 @@ function ButtonComponent(props: { onApprove?.(); return; } - const isSuccess = await onWithdraw(); + + const isSuccess = await onWithdraw(receipt => console.info('receipt: ', receipt)); + if (isSuccess) { plausible(PLAUSIBLE_EVENTS.WITHDRAW, { props: { @@ -350,11 +352,11 @@ function ButtonComponent(props: { props.openSuccessModal({ isOpen: true, description: ( -
-

{'Successfully withdrawn'}

- -
-
+ + {'Successfully withdrawn'} +   + + {!isZapNeededForWithdraw ? configuration?.tokenToSpend.amount?.display.slice(0, 7) : formatBigIntForDisplay( @@ -362,13 +364,13 @@ function ButtonComponent(props: { quote?.outputTokenDecimals ?? 18, {maximumFractionDigits: 6} )} -

{configuration?.tokenToReceive?.token?.symbol}

-
+ {configuration?.tokenToReceive?.token?.symbol} + {'to your wallet'} -
-
+ + ) }); } @@ -413,7 +415,7 @@ function ButtonComponent(props: { return 'Withdraw'; }, [address, canZap, isFetchingQuote, isWalletSafe, isApproved, isZapNeededForWithdraw]); - const isWithdrawDisable = + const isWithdrawDisabled = !props.isReady || !configuration?.tokenToSpend.amount || configuration?.tokenToSpend.amount.raw === 0n || @@ -423,7 +425,7 @@ function ButtonComponent(props: {