Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade deps #428

Merged
merged 7 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ module.exports = {
ecmaVersion: 2020,
sourceType: "module",
},
plugins: ["prettier", "@typescript-eslint", "react-hooks", "jsx-a11y"],
plugins: ["prettier", "@typescript-eslint", "react-hooks"],
extends: [
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended",
],
rules: {
"@typescript-eslint/no-use-before-define": [
Expand All @@ -30,8 +29,6 @@ module.exports = {
"react/prop-types": "off",
"react/display-name": "off",
"react/react-in-jsx-scope": "off",
"jsx-a11y/no-autofocus": "off",
"jsx-a11y/anchor-has-content": "off",
},
settings: {
react: {
Expand Down
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
2 changes: 1 addition & 1 deletion .ncurc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
reject: ["@tippyjs/react", "nanoid"],
reject: ["@tippyjs/react", "nanoid", "eslint"],
};
150 changes: 76 additions & 74 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,28 @@
"lint": "eslint src --ext .js,.mjs,.jsx,.ts,.tsx --color",
"ts": "tsc --pretty",
"generate-types": "typechain --target=ethers-v6 --out-dir src/abi-types src/abi/*.json > /dev/null 2>&1",
"postinstall": "husky install; yarn generate-types",
"postinstall": "husky; yarn generate-types",
"format-all": "prettier --write .",
"npm-audit": "npx synp --source-file yarn.lock && npm audit; rm package-lock.json",
"check-updates": "npx npm-check-updates"
},
"dependencies": {
"@amplitude/analytics-core": "2.1.3",
"@amplitude/analytics-types": "2.3.1",
"@amplitude/analytics-core": "2.2.8",
"@amplitude/analytics-types": "2.5.1",
"@amplitude/ua-parser-js": "0.7.33",
"@dicebear/avataaars": "7.0.1",
"@dicebear/core": "7.0.1",
"@dicebear/personas": "7.0.1",
"@emotion/is-prop-valid": "1.2.1",
"@ensdomains/ens-avatar": "1.0.0-alpha.0.ethers.6",
"@ledgerhq/hw-app-eth": "6.35.2",
"@ledgerhq/hw-transport": "6.30.1",
"@dicebear/avataaars": "8.0.2",
"@dicebear/core": "8.0.2",
"@dicebear/personas": "8.0.2",
"@emotion/is-prop-valid": "1.2.2",
"@ensdomains/ens-avatar": "1.0.0-alpha.2.ethers.6",
"@ledgerhq/hw-app-eth": "6.36.1",
"@ledgerhq/hw-transport": "6.30.6",
"@ledgerhq/hw-transport-webauthn": "5.36.0-deprecated",
"@ledgerhq/hw-transport-webhid": "6.28.1",
"@metamask/eth-sig-util": "7.0.1",
"@metamask/safe-event-emitter": "3.0.0",
"@ledgerhq/hw-transport-webhid": "6.28.6",
"@metamask/eth-sig-util": "7.0.2",
"@metamask/safe-event-emitter": "3.1.1",
"@microlink/react-json-view": "1.23.0",
"@noble/hashes": "1.3.3",
"@noble/hashes": "1.4.0",
"@radix-ui/react-accordion": "1.1.2",
"@radix-ui/react-avatar": "1.0.4",
"@radix-ui/react-checkbox": "1.0.4",
Expand All @@ -48,131 +48,133 @@
"@radix-ui/react-tabs": "1.0.4",
"@radix-ui/react-toast": "1.1.5",
"@radix-ui/react-toggle-group": "1.0.4",
"@scure/bip39": "1.2.2",
"@tanstack/react-virtual": "3.2.0",
"@scure/bip39": "1.3.0",
"@tanstack/react-virtual": "3.5.1",
"@tippyjs/react": "4.2.5",
"@toruslabs/openlogin": "6.2.1",
"async-retry": "1.3.3",
"axios": "1.6.5",
"axios": "1.7.2",
"axios-fetch-adapter": "./.vendor/axios-fetch-adapter",
"bignumber.js": "9.1.2",
"boring-avatars": "1.10.1",
"boring-avatars": "1.10.2",
"buffer": "6.0.3",
"canvas-txt": "4.1.1",
"clsx": "2.1.0",
"clsx": "2.1.1",
"cmdk": "1.0.0",
"date-fns": "3.2.0",
"date-fns": "3.6.0",
"dequal": "2.0.3",
"dexie": "3.2.4",
"dexie-export-import": "4.0.7",
"effector": "23.1.0",
"dexie": "4.0.7",
"dexie-export-import": "4.1.2",
"effector": "23.2.2",
"eth-phishing-detect": "1.2.0",
"eth-rpc-errors": "4.0.3",
"ethers": "6.10.0",
"ethers": "6.13.0",
"expiry-map": "2.0.0",
"final-form": "4.20.10",
"final-form-focus": "1.1.2",
"flux": "./.vendor/flux",
"fontfaceobserver": "2.3.0",
"fuse.js": "7.0.0",
"hashids": "2.3.0",
"inter-ui": "4.0.1",
"jotai": "2.6.1",
"inter-ui": "4.0.2",
"jotai": "2.8.3",
"kdbxweb": "2.1.1",
"mem": "9.0.2",
"memoize-one": "6.0.0",
"multiformats": "13.0.1",
"multiformats": "13.1.1",
"nanoid": "3.3.4",
"pako": "2.1.0",
"qrcode.react": "3.1.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-error-boundary": "4.0.12",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-error-boundary": "4.0.13",
"react-final-form": "6.5.9",
"react-merge-refs": "2.1.1",
"react-number-format": "5.3.1",
"react-number-format": "5.4.0",
"react-transition-group": "4.4.5",
"spacingjs": "1.0.7",
"superstruct": "1.0.3",
"spacingjs": "1.0.8",
"superstruct": "1.0.4",
"threads": "1.7.0",
"ts-pattern": "5.0.6",
"use-debounce": "10.0.0",
"ts-pattern": "5.2.0",
"use-debounce": "10.0.1",
"use-force-update": "1.0.11",
"use-resize-observer": "9.1.0",
"webextension-polyfill": "0.10.0"
"webextension-polyfill": "0.12.0"
},
"devDependencies": {
"@babel/core": "7.23.7",
"@babel/runtime": "7.23.8",
"@babel/core": "7.24.7",
"@babel/runtime": "7.24.7",
"@svgr/webpack": "8.1.0",
"@swc/core": "1.3.102",
"@swc/core": "1.5.29",
"@swc/jest": "./.vendor/swc-jest",
"@tailwindcss/typography": "0.5.10",
"@testing-library/jest-dom": "6.2.0",
"@tailwindcss/typography": "0.5.13",
"@testing-library/jest-dom": "6.4.6",
"@typechain/ethers-v6": "0.5.1",
"@types/async-retry": "1.4.8",
"@types/chrome": "0.0.256",
"@types/chrome": "0.0.268",
"@types/final-form-focus": "1.1.7",
"@types/fontfaceobserver": "2.1.3",
"@types/jest": "29.5.11",
"@types/jest": "29.5.12",
"@types/pako": "2.0.3",
"@types/react": "18.2.47",
"@types/react-dom": "18.2.18",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"@types/react-transition-group": "4.4.10",
"@types/webextension-polyfill": "0.10.7",
"@types/webpack-env": "1.18.4",
"@typescript-eslint/eslint-plugin": "6.18.1",
"@typescript-eslint/parser": "6.18.1",
"autoprefixer": "10.4.16",
"@types/webpack-env": "1.18.5",
"@typescript-eslint/eslint-plugin": "7.13.0",
"@typescript-eslint/parser": "7.13.0",
"autoprefixer": "10.4.19",
"case-sensitive-paths-webpack-plugin": "2.4.0",
"clean-webpack-plugin": "4.0.0",
"copy-webpack-plugin": "12.0.1",
"copy-webpack-plugin": "12.0.2",
"cross-env": "7.0.3",
"css-loader": "6.9.0",
"css-minimizer-webpack-plugin": "5.0.1",
"dotenv": "16.3.1",
"eslint": "8.56.0",
"css-loader": "7.1.2",
"css-minimizer-webpack-plugin": "7.0.0",
"dotenv": "16.4.5",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-jsx-a11y": "6.8.0",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-webpack-plugin": "4.0.1",
"fake-indexeddb": "5.0.2",
"eslint-plugin-react": "7.34.2",
"eslint-plugin-react-hooks": "4.6.2",
"eslint-webpack-plugin": "4.2.0",
"fake-indexeddb": "6.0.0",
"file-loader": "6.2.0",
"fork-ts-checker-webpack-plugin": "9.0.2",
"html-webpack-plugin": "5.6.0",
"husky": "8.0.3",
"husky": "9.0.11",
"identity-obj-proxy": "3.0.0",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"jest-webextension-mock": "3.8.9",
"lint-staged": "15.2.0",
"mini-css-extract-plugin": "2.7.7",
"postcss": "8.4.33",
"postcss-loader": "7.3.4",
"prettier": "3.2.2",
"jest-webextension-mock": "3.9.0",
"lint-staged": "15.2.7",
"mini-css-extract-plugin": "2.9.0",
"postcss": "8.4.38",
"postcss-loader": "8.1.1",
"prettier": "3.3.2",
"react-error-guard": "1.1.4",
"string-hash": "1.1.3",
"swc-loader": "0.2.3",
"tailwindcss": "3.4.1",
"swc-loader": "0.2.6",
"tailwindcss": "3.4.4",
"terser-webpack-plugin": "5.3.10",
"typechain": "8.3.2",
"typescript": "5.3.3",
"typescript": "5.4.5",
"url-loader": "4.1.1",
"webpack": "5.89.0",
"webpack-bundle-analyzer": "4.10.1",
"webpack": "5.92.0",
"webpack-bundle-analyzer": "4.10.2",
"webpack-cli": "5.1.4",
"webpack-sources": "3.2.3",
"webpackbar": "6.0.0",
"webpackbar": "6.0.1",
"zip-webpack-plugin": "4.0.1"
},
"workspaces": [
"packages/lifi-widget"
],
"resolutions": {
"flux": "./.vendor/flux",
"axios": ">=1.6.4"
"axios": ">=1.6.4",
"braces": ">=3.0.3",
"@solana/web3.js": ">=1.87.7",
"react": ">=18.3.1",
"react-dom": ">=18.3.1"
},
"engines": {
"node": ">=18.12.0"
Expand Down
83 changes: 48 additions & 35 deletions packages/lifi-widget/components/SendToWallet/SendToWallet.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import { isAddress } from '@ethersproject/address';
import type { BoxProps } from '@mui/material';
import { Collapse, FormHelperText } from '@mui/material';
import { forwardRef, useEffect, useRef } from 'react';
import { useController, useFormContext, useFormState } from 'react-hook-form';
import { useTranslation } from 'react-i18next';
import { FormKey, useWallet, useWidgetConfig } from '../../providers';
import { useSendToWalletStore, useSettings } from '../../stores';
import { DisabledUI, HiddenUI, RequiredUI } from '../../types';
import { Card, CardTitle } from '../Card';
import { FormControl, Input } from './SendToWallet.style';
import { isAddress } from "@ethersproject/address";
import type { BoxProps } from "@mui/material";
import { Collapse, FormHelperText } from "@mui/material";
import { forwardRef, useEffect, useRef } from "react";
import { useController, useFormContext, useFormState } from "react-hook-form";
import { useTranslation } from "react-i18next";
import { FormKey, useWallet, useWidgetConfig } from "../../providers";
import { useSendToWalletStore, useSettings } from "../../stores";
import { DisabledUI, HiddenUI, RequiredUI } from "../../types";
import { Card, CardTitle } from "../Card";
import { FormControl, Input } from "./SendToWallet.style";

export const SendToWallet: React.FC<BoxProps> = forwardRef((props, ref) => {
export const SendToWallet = forwardRef((props: BoxProps, ref) => {
const { t } = useTranslation();
const { trigger, getValues, setValue, clearErrors } = useFormContext();
const { account } = useWallet();
const { disabledUI, hiddenUI, requiredUI, toAddress } = useWidgetConfig();
const { showSendToWallet, showSendToWalletDirty, setSendToWallet } =
useSendToWalletStore();
const { showDestinationWallet } = useSettings(['showDestinationWallet']);
const { showDestinationWallet } = useSettings(["showDestinationWallet"]);

const hiddenToAddress = hiddenUI?.includes(HiddenUI.ToAddress);
const disabledToAddress = disabledUI?.includes(DisabledUI.ToAddress);
Expand All @@ -30,7 +30,7 @@ export const SendToWallet: React.FC<BoxProps> = forwardRef((props, ref) => {
name: FormKey.ToAddress,
rules: {
required:
requiredToAddress && (t('error.title.walletAddressRequired') as string),
requiredToAddress && (t("error.title.walletAddressRequired") as string),
onChange: (e) => {
setValue(FormKey.ToAddress, e.target.value.trim());
},
Expand All @@ -42,10 +42,10 @@ export const SendToWallet: React.FC<BoxProps> = forwardRef((props, ref) => {
const address = await account.signer?.provider?.resolveName(value);
return (
isAddress(address || value) ||
(t('error.title.walletAddressInvalid') as string)
(t("error.title.walletAddressInvalid") as string)
);
} catch {
return t('error.title.walletEnsAddressInvalid') as string;
return t("error.title.walletEnsAddressInvalid") as string;
}
},
onBlur: () => trigger(FormKey.ToAddress),
Expand Down Expand Up @@ -89,27 +89,40 @@ export const SendToWallet: React.FC<BoxProps> = forwardRef((props, ref) => {
mountOnEnter
unmountOnExit
>
<Card {...props} ref={ref} sx={{border: 'none', background: 'none', marginBottom: '24px'}}>
<CardTitle required={requiredToAddress} sx={{paddingTop: '0px', paddingLeft: '0px', fontSize: '16px'}}>
<Card
{...props}
ref={ref}
sx={{ border: "none", background: "none", marginBottom: "24px" }}
>
<CardTitle
required={requiredToAddress}
sx={{ paddingTop: "0px", paddingLeft: "0px", fontSize: "16px" }}
>
Recipient
</CardTitle>
<div style={{background: '#22262A', borderRadius: '10px', marginTop: '8px'}}>
<FormControl fullWidth sx={{padding: '6px 16px 6px 0px' }}>
<Input
size="small"
autoComplete="off"
autoCorrect="off"
autoCapitalize="off"
spellCheck="false"
onChange={onChange}
onBlur={onBlur}
name={name}
value={value}
placeholder={t('main.walletAddressOrEns') as string}
disabled={Boolean(toAddress && disabledToAddress)}
/>
<SendToWalletFormHelperText />
</FormControl>
<div
style={{
background: "#22262A",
borderRadius: "10px",
marginTop: "8px",
}}
>
<FormControl fullWidth sx={{ padding: "6px 16px 6px 0px" }}>
<Input
size="small"
autoComplete="off"
autoCorrect="off"
autoCapitalize="off"
spellCheck="false"
onChange={onChange}
onBlur={onBlur}
name={name}
value={value}
placeholder={t("main.walletAddressOrEns") as string}
disabled={Boolean(toAddress && disabledToAddress)}
/>
<SendToWalletFormHelperText />
</FormControl>
</div>
</Card>
</Collapse>
Expand Down
4 changes: 2 additions & 2 deletions src/_dev/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ declare module "*.svg" {
}

declare module "*.module.css" {
const classes: { readonly [key: string]: string };
export default classes;
const classes: { [key: string]: string };
export = classes;
}
Loading
Loading