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

Refactor remove v1 code #42

Merged
merged 2 commits into from
Dec 21, 2023
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
8 changes: 7 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"extends": "next/core-web-vitals"
"extends": "next/core-web-vitals",
"plugins": ["unused-imports"],
"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "off",
"unused-imports/no-unused-imports": "error"
}
}
4 changes: 3 additions & 1 deletion .github/workflows/ci-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
- name: Install Yarn
run: npm install -g yarn
- name: Install Dependencies
run: yarn
run: yarn
- name: Lint Code
run: yarn lint
- name: Build Application
run: yarn build
3 changes: 1 addition & 2 deletions components/Admin/ConnectAdmin.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useNEVM } from "@contexts/ConnectedWallet/NEVMProvider";
import { usePaliWalletV2 } from "@contexts/PaliWallet/usePaliWallet";
import { Button, Typography } from "@mui/material";
import { useAdmin } from "./Provider";
import { Button } from "@mui/material";

const ConnectAdmin = () => {
const { account, connect } = useNEVM();
Expand Down
3 changes: 0 additions & 3 deletions components/Admin/Provider.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { useNEVM } from "@contexts/ConnectedWallet/NEVMProvider";
import { usePaliWalletV2 } from "@contexts/PaliWallet/usePaliWallet";
import { Button, Container, Typography } from "@mui/material";
import { IAdmin } from "models/admin";
import { NextPage } from "next";
import { createContext, useContext, useMemo } from "react";
import { useQuery } from "react-query";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ type Props = {
transferId: string;
};

type FormValues = {
txId: string;
clearAll: boolean;
};

const AddBurnSysTransaction: React.FC<Props> = ({ onClose, transferId }) => {
return (
<AddUTXOTransactionModal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ import {
} from "@mui/material";
import AddLogModalContainer from "./ModalContainer";
import { useForm } from "react-hook-form";
import { useUtxoTransaction } from "components/Bridge/v3/hooks/useUtxoTransaction";
import { useNEVM } from "@contexts/ConnectedWallet/NEVMProvider";
import {
AddNEVMLogRequestPayload,
AddUTXOLogRequestPayload,
} from "api/types/admin/transfer/add-log";
import { useState } from "react";
import { useNevmTransaction } from "components/Bridge/v3/hooks/useNevmTransaction";
Expand Down
4 changes: 2 additions & 2 deletions components/Admin/Transfer/Filters.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box, Button, TextField } from "@mui/material";
import { useRouter, useSearchParams } from "next/navigation";
import { FormEventHandler, useState } from "react";
import { useSearchParams } from "next/navigation";
import { useState } from "react";

const AdminTransferFilters: React.FC = () => {
const { get } = useSearchParams();
Expand Down
2 changes: 0 additions & 2 deletions components/Bridge/Stepper.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { Alert, Step, StepLabel, Stepper } from "@mui/material";
import { TransferStatus } from "contexts/Transfer/types";
import { useTransfer } from "contexts/Transfer/useTransfer";
import { useMemo } from "react";

const BridgeTransferStepper: React.FC = () => {
const {
Expand Down
2 changes: 0 additions & 2 deletions components/Bridge/Transfer/StepSwitch/PaliSwitchNetwork.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { useNEVM } from "@contexts/ConnectedWallet/NEVMProvider";
import { IPaliWalletV2Context } from "@contexts/PaliWallet/V2Provider";
import {
usePaliWallet,
usePaliWalletV2,
} from "@contexts/PaliWallet/usePaliWallet";
import { useTransfer } from "@contexts/Transfer/useTransfer";
Expand Down
1 change: 0 additions & 1 deletion components/Bridge/Transfer/StepSwitch/WaitNEVMSign.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useConnectedWallet } from "@contexts/ConnectedWallet/useConnectedWallet";
import { usePaliWalletV2 } from "@contexts/PaliWallet/usePaliWallet";
import { useTransfer } from "@contexts/Transfer/useTransfer";
import { Alert, AlertColor, Button } from "@mui/material";

Expand Down
137 changes: 0 additions & 137 deletions components/Bridge/WalletInfo.tsx

This file was deleted.

68 changes: 0 additions & 68 deletions components/Bridge/WalletSwitch.tsx

This file was deleted.

1 change: 0 additions & 1 deletion components/Bridge/v3/Stepper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
ETH_TO_SYS_TRANSFER_STATUS,
SYS_TO_ETH_TRANSFER_STATUS,
} from "@contexts/Transfer/types";
import { Close } from "@mui/icons-material";

const NEVMToSYSStepper: React.FC<{ activeStep: number }> = ({ activeStep }) => (
<Stepper activeStep={activeStep}>
Expand Down
2 changes: 1 addition & 1 deletion components/Bridge/v3/Steps/ConfirmNEVMTransaction.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ITransferLog, TransferStatus } from "@contexts/Transfer/types";
import { useTransfer } from "../context/TransferContext";
import { Alert, CircularProgress, Link, Typography } from "@mui/material";
import { Alert, CircularProgress, Link } from "@mui/material";
import { useNevmTransaction } from "../hooks/useNevmTransaction";
import { useEffect } from "react";
import { NEVM_TX_BLOCKCHAIN_URL } from "@constants";
Expand Down
2 changes: 1 addition & 1 deletion components/Bridge/v3/Steps/ConfirmUTXOTransaction.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Alert, Box, CircularProgress, Link } from "@mui/material";
import { Alert, CircularProgress, Link } from "@mui/material";
import { useTransfer } from "../context/TransferContext";
import { useUtxoTransaction } from "components/Bridge/v3/hooks/useUtxoTransaction";
import { ITransferLog, TransferStatus } from "@contexts/Transfer/types";
Expand Down
1 change: 0 additions & 1 deletion components/Bridge/v3/Steps/ConnectValidate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
SYS_TO_ETH_TRANSFER_STATUS,
TransferStatus,
} from "@contexts/Transfer/types";
import { CloseOutlined } from "@mui/icons-material";
import { Box, Typography } from "@mui/material";

import { useTransfer } from "../context/TransferContext";
Expand Down
2 changes: 0 additions & 2 deletions components/Bridge/v3/Steps/ConnectValidate/AmountField.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { ITransfer } from "@contexts/Transfer/types";
import { QuestionMarkOutlined } from "@mui/icons-material";
import {
Alert,
Box,
InputAdornment,
TextField,
Tooltip,
Typography,
} from "@mui/material";
import { useFormContext } from "react-hook-form";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { MIN_AMOUNT } from "@constants";
import { SYSX_ASSET_GUID } from "@contexts/Transfer/constants";
import { ITransfer } from "@contexts/Transfer/types";
import { CheckCircleOutline, CloseOutlined } from "@mui/icons-material";
import { CheckCircleOutline } from "@mui/icons-material";
import { Box, Button, Typography } from "@mui/material";
import {
isValidEthereumAddress,
Expand Down
2 changes: 1 addition & 1 deletion components/Bridge/v3/Steps/SubmitProofs.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Alert, Box, Button, Divider, Typography } from "@mui/material";
import { Alert, Box, Button, Typography } from "@mui/material";
import { useTransfer } from "../context/TransferContext";
import {
ITransferLog,
Expand Down
1 change: 0 additions & 1 deletion components/Bridge/v3/hooks/useBurnSysx.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import burnSysToSysx from "@contexts/Transfer/functions/burnSysToSysx";
import { ITransfer } from "@contexts/Transfer/types";
import { useMutation } from "react-query";
import { useSyscoin } from "../context/Syscoin";
Expand Down
1 change: 0 additions & 1 deletion components/Bridge/v3/hooks/useSyscoinSubmitProofs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { ITransfer } from "@contexts/Transfer/types";
import { useMutation } from "react-query";
import { useWeb3 } from "../context/Web";
import { ISponsorWalletTransaction } from "models/sponsor-wallet-transactions";
import { rejects } from "assert";

const useSyscoinSubmitProofs = (
transfer: ITransfer,
Expand Down
1 change: 0 additions & 1 deletion components/Home/FAQ.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
Accordion,
AccordionDetails,
AccordionSummary,
Box,
Container,
Link,
Typography,
Expand Down
1 change: 0 additions & 1 deletion components/Navigation/Navigation.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useConnectedWallet } from "@contexts/ConnectedWallet/useConnectedWallet";
import { List } from "@mui/material";
import NavigationItem, { INavigationItem } from "./Item";

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"bitcoin-proof": "^2.0.0",
"bitcoinjs-lib": "^6.0.1",
"date-fns": "^2.30.0",
"eslint-plugin-unused-imports": "^3.0.0",
"firebase": "^9.22.1",
"firebase-admin": "^10.2.0",
"iron-session": "^6.3.1",
Expand Down
2 changes: 1 addition & 1 deletion pages/admin/login.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ADMIN_LOGIN_MESSAGE } from "@constants";
import { useNEVM } from "@contexts/ConnectedWallet/NEVMProvider";
import { Button, Container, Typography } from "@mui/material";
import { Button, Container } from "@mui/material";
import ConnectAdmin from "components/Admin/ConnectAdmin";
import { GetServerSideProps, NextPage } from "next";
import { useRouter } from "next/router";
Expand Down
Loading