diff --git a/src/app/(defi)/page.tsx b/src/app/(defi)/page.tsx index 5a4b654..8a82921 100644 --- a/src/app/(defi)/page.tsx +++ b/src/app/(defi)/page.tsx @@ -15,7 +15,7 @@ import { ChainId } from '@/types/chains'; import MigrationPopover from '@/components/migration-popover'; // TODO: add chain id into array when rolling out V2 in the chain -export const v2ChainId: ChainId[] = [ChainId.KOI] +const v2ChainId: ChainId[] = [ChainId.KOI] const Stake = dynamic(() => import('@/components/stake'), { ssr: false, diff --git a/src/components/migrate.tsx b/src/components/migrate.tsx index efd2d06..61de6f1 100644 --- a/src/components/migrate.tsx +++ b/src/components/migrate.tsx @@ -1,17 +1,19 @@ +import { useAccount } from "wagmi"; +import { useEffect } from "react"; + import { useBigIntContractQuery } from "@/hooks/useBigIntContractQuery"; import { useChain } from "@/hooks/useChain"; import { ActionProps } from "@/types/action"; -import { useAccount } from "wagmi"; import { abi } from '@/config/abi/KTONStakingRewards'; import { usePoolAmount } from "@/hooks/usePoolAmount"; import { useMigrate } from "@/hooks/useMigrate"; import { useMigrateState } from "@/hooks/useMigrateState"; import { formatNumericValue } from "@/utils"; -import { useEffect } from "react"; -import Loading from "./loading"; import { Button } from '@/components/ui/button'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'; +import Loading from "./loading"; + const newPoolButtonText = "Stake in new pool"; const newPoolUrl = "https://kton-staking-v2.darwinia.network" diff --git a/src/components/migration-popover.tsx b/src/components/migration-popover.tsx index 0e1927f..11435f4 100644 --- a/src/components/migration-popover.tsx +++ b/src/components/migration-popover.tsx @@ -1,8 +1,10 @@ "use client"; import { useState } from 'react'; -import { Button } from './ui/button'; + import { cn } from '@/lib/utils'; +import { Button } from './ui/button'; + const title = "We are migrating"; const instruction = "Please migrate to new KTON Pool and get your gKTON reward. To migrate, please follow steps below:" const stepContents = [`Step 1:Click \"Unstake\" button to unstake your KTON`, `Step 2:Click \"Stake in new pool\" button to stake your KTON`]; diff --git a/src/components/stake.tsx b/src/components/stake.tsx index 71d7da8..28703ce 100644 --- a/src/components/stake.tsx +++ b/src/components/stake.tsx @@ -13,12 +13,12 @@ import { useTokenAllowanceAndApprove } from '@/hooks/useTokenAllowanceAndApprove import { useStake } from '@/hooks/useStake'; import { usePoolAmount } from '@/hooks/usePoolAmount'; import { useStakeState } from '@/hooks/useStakeState'; +import { ActionProps } from '@/types/action'; import AmountInputForm from './amount-input-form'; import KTONBalance from './kton-balance'; import type { Form, SubmitData } from './amount-input-form'; -import { ActionProps } from '@/types/action'; const Stake = ({ onTransactionActiveChange }: ActionProps) => { const formRef: MutableRefObject
= useRef(null); diff --git a/src/components/unstake.tsx b/src/components/unstake.tsx index a80f60e..db49abd 100644 --- a/src/components/unstake.tsx +++ b/src/components/unstake.tsx @@ -11,11 +11,11 @@ import { usePoolAmount } from '@/hooks/usePoolAmount'; import { useUnStake } from '@/hooks/useUnStake'; import { useUnStakeState } from '@/hooks/useUnstakeState'; import { cn } from '@/lib/utils'; +import { ActionProps } from '@/types/action'; import AmountInputForm from './amount-input-form'; import KTONBalance from './kton-balance'; -import { ActionProps } from '@/types/action'; import type { Form, SubmitData } from './amount-input-form'; const UnStake = ({ onTransactionActiveChange }: ActionProps) => { diff --git a/src/hooks/useMigrate.ts b/src/hooks/useMigrate.ts index 911fde0..272c19b 100644 --- a/src/hooks/useMigrate.ts +++ b/src/hooks/useMigrate.ts @@ -1,15 +1,17 @@ import { useWriteContract } from "wagmi"; import { useCallback, useRef } from "react"; import { parseEther, WriteContractReturnType } from "viem"; +import { toast } from "sonner"; + +import { abi } from "@/config/abi/KTONStakingRewards"; import { getOperationStatus, useAppState } from "./useAppState"; import { useChain } from "./useChain"; import { useLatestCallback } from "./useLatestCallback"; import { ErrorType, SuccessType, useTransactionStatus, UseTransactionStatusProps } from "./useTransactionStatus"; -import { abi } from "@/config/abi/KTONStakingRewards"; import { useWalletInteractionToast } from "./useWalletInteractionToast"; import { useInstructionToast } from "./useInstructionToast"; -import { toast } from "sonner"; + interface UseMigrateProps extends Pick { ownerAddress: `0x${string}`;