diff --git a/cfg/cspell-dictionary.txt b/cfg/cspell-dictionary.txt index 5f7d2f0e2..1742e73b6 100644 --- a/cfg/cspell-dictionary.txt +++ b/cfg/cspell-dictionary.txt @@ -42,6 +42,7 @@ merperson moai mybuilder nazar +nextjs nohup octa oden diff --git a/src/typescript/.env.example b/src/typescript/.env.example new file mode 100644 index 000000000..414cbe68f --- /dev/null +++ b/src/typescript/.env.example @@ -0,0 +1,18 @@ + +# To run your own local node for e2e testing, set this to "false" +START_LOCAL_NODE_FOR_TEST="true" + +# The Aptos network to use +NEXT_PUBLIC_APTOS_NETWORK="local" + +# Randomly generated private key for tests +PUBLISHER_PK="29479e9e5fe47ba9a8af509dd6da1f907510bcf8917bfb19b7079d8c63c0b720" + +# The address of the main `emojicoin_dot_fun` contract module +NEXT_PUBLIC_MODULE_ADDRESS="0x4bab58978ec1b1bef032eeb285ad47a6a9b997d646c19b598c35f46b26ff9ece" + +# The default URL for a local inbox deployment. Do not add a slash to the end +INBOX_URL="http://localhost:3000" + +## A `nextjs` setting to determine the query revalidation length +SHORT_REVALIDATE="true" diff --git a/src/typescript/.env.test b/src/typescript/.env.test new file mode 100644 index 000000000..b222753b0 --- /dev/null +++ b/src/typescript/.env.test @@ -0,0 +1,10 @@ +START_LOCAL_NODE_FOR_TEST="false" +SHORT_REVALIDATE="true" + +NEXT_PUBLIC_APTOS_NETWORK="local" +NEXT_PUBLIC_INTEGRATOR_ADDRESS="0x4bab58978ec1b1bef032eeb285ad47a6a9b997d646c19b598c35f46b26ff9ece" +NEXT_PUBLIC_MODULE_ADDRESS="0x4bab58978ec1b1bef032eeb285ad47a6a9b997d646c19b598c35f46b26ff9ece" + +PUBLISHER_PK="29479e9e5fe47ba9a8af509dd6da1f907510bcf8917bfb19b7079d8c63c0b720" + +INBOX_URL="http://localhost:3000" diff --git a/src/typescript/.gitignore b/src/typescript/.gitignore index 4daaa5fe2..e09713661 100644 --- a/src/typescript/.gitignore +++ b/src/typescript/.gitignore @@ -3,3 +3,6 @@ build/** dist/** .next/** node_modules/ +.env*.local +**/*.env*.local +.env diff --git a/src/typescript/README.md b/src/typescript/README.md new file mode 100644 index 000000000..86827d2bf --- /dev/null +++ b/src/typescript/README.md @@ -0,0 +1,65 @@ +# How to build and deploy this application + +## Ensure the environment variables are loaded + +This repository loads environment variables in multiple ways. + +To load environment variables while running test scripts, each `package.json` +file in the `sdk` folder specifies how to load these environment variables. Most +scripts run the `dotenv-cli` package as a wrapper, like so: + +```shell +# In sdk/package.json: +"test": "dotenv -e ../.env.test -- pnpm jest", + +# I run this command +pnpm run test + +# Which loads the env variables in `../.env.test` and runs `jest` +``` + +Where `../.env.test` is the environment file located in the `typescript` parent +directory. + +To avoid having to define environment variables in multiple places, we've +intentionally omitted environment variables from the `frontend` directory to +enforce that the project be built and run in a certain order. + +## Copy the `.env.example` file to an `.env` or `.env.local` file + +Most commands load `.env.local` first then `.env`, so copy the environment +example file to your own file. + +```shell +# With the highest precedence. +cp .env.example .env.local +# or just `.env.`, which will be superseded by `.env.local` in loading order +cp .env.example .env +``` + +## Run the `frontend` application + +```shell +cd src/typescript +pnpm i + +# to rebuild everything and run +pnpm run build +pnpm run start + +# or, for hot reloads (does not rebuild) +pnpm run dev +``` + +Sometimes, `turbo` and `next` have build caches that persist and cause errors. +This can be avoided with a clever build process, however, you can also just +delete the `.next` and `.turbo` folders in each directory. + +You can also run: + +```shell +pnpm run full-clean +``` + +Note this remove's each project's `node_modules`, although it does not remove +the `pnpm-lock.yaml` file. diff --git a/src/typescript/frontend/.env.example b/src/typescript/frontend/.env.example deleted file mode 100644 index aa0790176..000000000 --- a/src/typescript/frontend/.env.example +++ /dev/null @@ -1,12 +0,0 @@ -# The Aptos network to use. -NEXT_PUBLIC_APTOS_NETWORK="local" - -# Whether or not revalidation times should be short. This should be set to "true" for local development -# and "false" for production. -NEXT_PUBLIC_SHORT_REVALIDATE="true" - -# Whether or not to fetch static JSON files, likely in a staging environment. -NEXT_PUBLIC_FORCE_STATIC_FETCH="true" - -# The address of the main `emojicoin_dot_fun` contract module. -NEXT_PUBLIC_MODULE_ADDRESS="4bab58978ec1b1bef032eeb285ad47a6a9b997d646c19b598c35f46b26ff9ece" diff --git a/src/typescript/frontend/.env.production b/src/typescript/frontend/.env.production deleted file mode 100644 index 0b66d76d8..000000000 --- a/src/typescript/frontend/.env.production +++ /dev/null @@ -1,4 +0,0 @@ -NEXT_PUBLIC_APTOS_NETWORK="local" -NEXT_PUBLIC_SHORT_REVALIDATE="false" -NEXT_PUBLIC_FORCE_STATIC_FETCH="true" -NEXT_PUBLIC_MODULE_ADDRESS="4bab58978ec1b1bef032eeb285ad47a6a9b997d646c19b598c35f46b26ff9ece" diff --git a/src/typescript/frontend/next.config.mjs b/src/typescript/frontend/next.config.mjs index c6d41c7eb..183696617 100644 --- a/src/typescript/frontend/next.config.mjs +++ b/src/typescript/frontend/next.config.mjs @@ -25,9 +25,6 @@ const debugConfigOptions = { /** @type {import('next').NextConfig} */ const nextConfig = { - env: { - "INBOX_URL": process.env.INBOX_URL ?? "http://localhost:3000", - }, crossOrigin: "use-credentials", typescript: { tsconfigPath: "tsconfig.json", @@ -41,7 +38,7 @@ const nextConfig = { return [ { source: "/emojicoin", - destination: "/emojicoin/0", + destination: "/emojicoin/1", permanent: true, }, ]; diff --git a/src/typescript/frontend/package.json b/src/typescript/frontend/package.json index d7510ad76..bb44a6dac 100644 --- a/src/typescript/frontend/package.json +++ b/src/typescript/frontend/package.json @@ -12,7 +12,7 @@ ] }, "dependencies": { - "@aptos-labs/wallet-adapter-react": "^2.5.1", + "@aptos-labs/wallet-adapter-react": "^3.0.2", "@econia-labs/emojicoin-sdk": "workspace:*", "@emotion/is-prop-valid": "^1.2.2", "@headlessui/react": "^2.0.4", @@ -37,6 +37,7 @@ "react-toastify": "^9.1.3", "redux": "^5.0.1", "redux-logger": "^3.0.6", + "server-only": "^0.0.1", "socket.io-client": "^4.7.2", "styled-components": "^6.1.8", "styled-system": "^5.1.5", @@ -70,8 +71,8 @@ "scripts": { "_format": "prettier './**/*.{js,jsx,ts,tsx,css,md}' --config ./.prettierrc.js", "build": "next build", - "build:debug": "BUILD_DEBUG=true && pnpm clean && next build --no-lint --no-mangling --debug", - "clean": "rm -rf .next", + "build:debug": "BUILD_DEBUG=true && pnpm clean && pnpm i && next build --no-lint --no-mangling --debug", + "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist && rm -rf .next", "dev": "NODE_OPTIONS='--inspect' next dev --turbo", "format": "pnpm _format --write", "format:check": "pnpm _format --check", diff --git a/src/typescript/frontend/src/app/connect-wallet/page.tsx b/src/typescript/frontend/src/app/connect-wallet/page.tsx deleted file mode 100644 index cf366bfa6..000000000 --- a/src/typescript/frontend/src/app/connect-wallet/page.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import ConnectWallet from "components/pages/connect-wallet"; - -export default function ConnectWalletPage() { - return ; -} diff --git a/src/typescript/frontend/src/app/emojicoin/[market]/page.tsx b/src/typescript/frontend/src/app/emojicoin/[market]/page.tsx index a34312900..a1c1e9f79 100644 --- a/src/typescript/frontend/src/app/emojicoin/[market]/page.tsx +++ b/src/typescript/frontend/src/app/emojicoin/[market]/page.tsx @@ -1,12 +1,11 @@ -import Emojicoin from "components/pages/emojicoin"; -import { SHORT_REVALIDATE } from "lib/env"; import getInitialChatData from "lib/queries/initial/chats"; import { fetchTopMarkets } from "lib/queries/initial/markets"; import { fetchLastMarketState } from "lib/queries/initial/state"; import getInitialSwapData from "lib/queries/initial/swaps"; +import ClientEmojicoinPage from "components/pages/emojicoin/ClientEmojicoinPage"; // We will revalidate the data cache every hour. This can be adjusted later based on how much data is fetched. -export const revalidate = SHORT_REVALIDATE ? 10 : 3600; +export const revalidate = process.env.SHORT_REVALIDATE === "true" ? 10 : 3600; type StaticParams = { market: string; @@ -33,7 +32,7 @@ const EmojicoinPage = async (params: EmojicoinPageProps) => { const swapData = await getInitialSwapData(marketID); return ( - { ); } - return ; + return ; }; export default EmojicoinPage; diff --git a/src/typescript/frontend/src/app/global.css b/src/typescript/frontend/src/app/global.css index 2dd9dc934..1fec15f3a 100644 --- a/src/typescript/frontend/src/app/global.css +++ b/src/typescript/frontend/src/app/global.css @@ -4,6 +4,13 @@ @tailwind components; @tailwind utilities; +:root { + .Toastify__toast-container > * { + font-family: var(--font-forma) !important; + line-height: 1.4rem; + } +} + .med-pixel-text { font-size: 20px; line-height: 25px; diff --git a/src/typescript/frontend/src/app/home/page.tsx b/src/typescript/frontend/src/app/home/page.tsx index 7d62a94b9..97ffc2d55 100644 --- a/src/typescript/frontend/src/app/home/page.tsx +++ b/src/typescript/frontend/src/app/home/page.tsx @@ -1,8 +1,8 @@ -import Home from "components/pages/home"; +import ClientHomePage from "components/pages/home/ClientHomePage"; import { fetchTopMarkets } from "lib/queries/initial/markets"; export default async function HomePage() { const data = await fetchTopMarkets(); - return ; + return ; } diff --git a/src/typescript/frontend/src/app/launch-emojicoin/page.tsx b/src/typescript/frontend/src/app/launch-emojicoin/page.tsx index 81935a20f..e7c1981d7 100644 --- a/src/typescript/frontend/src/app/launch-emojicoin/page.tsx +++ b/src/typescript/frontend/src/app/launch-emojicoin/page.tsx @@ -1,5 +1,5 @@ -import LaunchEmojicoin from "components/pages/launch-emojicoin"; +import ClientLaunchEmojicoinPage from "../../components/pages/launch-emojicoin/ClientLaunchEmojicoinPage"; export default function LaunchEmojicoinPage() { - return ; + return ; } diff --git a/src/typescript/frontend/src/app/pools/page.tsx b/src/typescript/frontend/src/app/pools/page.tsx index 025b3d3a9..6c89647ed 100644 --- a/src/typescript/frontend/src/app/pools/page.tsx +++ b/src/typescript/frontend/src/app/pools/page.tsx @@ -1,5 +1,5 @@ -import Pools from "components/pages/pools"; +import ClientPoolsPage from "components/pages/pools/ClientPoolsPage"; export default function PoolsPage() { - return ; + return ; } diff --git a/src/typescript/frontend/src/components/header/components/mobile-menu/index.tsx b/src/typescript/frontend/src/components/header/components/mobile-menu/index.tsx index 5d43d30c8..4e9c869b6 100644 --- a/src/typescript/frontend/src/components/header/components/mobile-menu/index.tsx +++ b/src/typescript/frontend/src/components/header/components/mobile-menu/index.tsx @@ -11,7 +11,7 @@ import { MobileMenuItem } from "../index"; import { type MobileMenuProps } from "./types"; import { slideVariants } from "./animations"; -import ConnectWalletButton from "components/header/wallet-button/ConnectWalletButton"; +import ButtonWithConnectWalletFallback from "components/header/wallet-button/ConnectWalletButton"; export const MobileMenu: React.FC = ({ isOpen, @@ -42,7 +42,7 @@ export const MobileMenu: React.FC = ({ ); })} - + diff --git a/src/typescript/frontend/src/components/header/index.tsx b/src/typescript/frontend/src/components/header/index.tsx index 10076d6ec..b28c0419a 100644 --- a/src/typescript/frontend/src/components/header/index.tsx +++ b/src/typescript/frontend/src/components/header/index.tsx @@ -19,7 +19,7 @@ import { slideTopVariants } from "./animations"; import { type HeaderProps } from "./types"; import { translationFunction } from "context/language-context"; -import ConnectWalletButton from "./wallet-button/ConnectWalletButton"; +import ButtonWithConnectWalletFallback from "./wallet-button/ConnectWalletButton"; const Header: React.FC = ({ isOpen, setIsOpen }) => { const { isDesktop } = useMatchBreakpoints(); @@ -68,7 +68,7 @@ const Header: React.FC = ({ isOpen, setIsOpen }) => { ); })} - + )} diff --git a/src/typescript/frontend/src/components/header/wallet-button/ConnectWalletButton.tsx b/src/typescript/frontend/src/components/header/wallet-button/ConnectWalletButton.tsx index 55b654e9e..07a64f8cf 100644 --- a/src/typescript/frontend/src/components/header/wallet-button/ConnectWalletButton.tsx +++ b/src/typescript/frontend/src/components/header/wallet-button/ConnectWalletButton.tsx @@ -12,7 +12,7 @@ export interface ConnectWalletProps extends PropsWithChildren<{ className?: stri const DEFAULT_TEXT = "Connect Wallet"; -export const ConnectWalletButton: React.FC = ({ +export const ButtonWithConnectWalletFallback: React.FC = ({ mobile, children, className, @@ -98,4 +98,4 @@ export const ConnectWalletButton: React.FC = ({ ); }; -export default ConnectWalletButton; +export default ButtonWithConnectWalletFallback; diff --git a/src/typescript/frontend/src/components/pages/connect-wallet/index.tsx b/src/typescript/frontend/src/components/pages/connect-wallet/index.tsx deleted file mode 100644 index f05bd8710..000000000 --- a/src/typescript/frontend/src/components/pages/connect-wallet/index.tsx +++ /dev/null @@ -1,18 +0,0 @@ -"use client"; - -import React from "react"; - -import Heading from "components/heading"; -import { Page } from "components/layout/components/page"; - -const ConnectWallet: React.FC = () => { - return ( - - - Connect wallet page - - - ); -}; - -export default ConnectWallet; diff --git a/src/typescript/frontend/src/components/pages/emojicoin/index.tsx b/src/typescript/frontend/src/components/pages/emojicoin/ClientEmojicoinPage.tsx similarity index 89% rename from src/typescript/frontend/src/components/pages/emojicoin/index.tsx rename to src/typescript/frontend/src/components/pages/emojicoin/ClientEmojicoinPage.tsx index cc758e9e2..04657b670 100644 --- a/src/typescript/frontend/src/components/pages/emojicoin/index.tsx +++ b/src/typescript/frontend/src/components/pages/emojicoin/ClientEmojicoinPage.tsx @@ -13,7 +13,7 @@ import MobileGrid from "./components/mobile-grid"; import { type EmojicoinProps } from "./types"; import { EmojiNotFound } from "./components/emoji-not-found"; -const Emojicoin = (props: EmojicoinProps) => { +const ClientEmojicoinPage = (props: EmojicoinProps) => { const { isLaptopL } = useMatchBreakpoints(); return ( @@ -32,4 +32,4 @@ const Emojicoin = (props: EmojicoinProps) => { ); }; -export default Emojicoin; +export default ClientEmojicoinPage; diff --git a/src/typescript/frontend/src/components/pages/home/index.tsx b/src/typescript/frontend/src/components/pages/home/ClientHomePage.tsx similarity index 83% rename from src/typescript/frontend/src/components/pages/home/index.tsx rename to src/typescript/frontend/src/components/pages/home/ClientHomePage.tsx index bfe72ad36..63a5b802d 100644 --- a/src/typescript/frontend/src/components/pages/home/index.tsx +++ b/src/typescript/frontend/src/components/pages/home/ClientHomePage.tsx @@ -5,11 +5,11 @@ import MainCard from "./components/main-card"; import { type MarketStateProps } from "./types"; export interface HomeProps { - data: Array; + data?: Array; } -const Home = async (props: HomeProps) => { - const data = props.data; +const ClientHomePage = async (props: HomeProps) => { + const data = props.data ?? []; const featured = data.toReversed().pop(); const gridMarkets = data.slice(1); @@ -37,4 +37,4 @@ const Home = async (props: HomeProps) => { ); }; -export default Home; +export default ClientHomePage; diff --git a/src/typescript/frontend/src/components/pages/index.ts b/src/typescript/frontend/src/components/pages/index.ts index 1a4a42d33..2a792a64c 100644 --- a/src/typescript/frontend/src/components/pages/index.ts +++ b/src/typescript/frontend/src/components/pages/index.ts @@ -1,5 +1,4 @@ export * from "./not-found"; -export * from "./connect-wallet"; -export * from "./emojicoin"; -export * from "./launch-emojicoin"; +export * from "./emojicoin/ClientEmojicoinPage"; +export * from "./launch-emojicoin/ClientLaunchEmojicoinPage"; export * from "./pools/components"; diff --git a/src/typescript/frontend/src/components/pages/launch-emojicoin/index.tsx b/src/typescript/frontend/src/components/pages/launch-emojicoin/ClientLaunchEmojicoinPage.tsx similarity index 93% rename from src/typescript/frontend/src/components/pages/launch-emojicoin/index.tsx rename to src/typescript/frontend/src/components/pages/launch-emojicoin/ClientLaunchEmojicoinPage.tsx index 718ec5be2..9b1fa7a5d 100644 --- a/src/typescript/frontend/src/components/pages/launch-emojicoin/index.tsx +++ b/src/typescript/frontend/src/components/pages/launch-emojicoin/ClientLaunchEmojicoinPage.tsx @@ -13,12 +13,13 @@ import Prompt from "components/prompt"; import { Input } from "components/inputs/input"; import { InputGroup } from "components/inputs/input-group"; import { Text } from "components/text"; -import Button from "components/button"; import ClientsSlider from "components/clients-slider"; import { Column, Flex, FlexGap } from "@containers"; import { StyledFieldName } from "./styled"; +import { LaunchEmojicoinButton } from "./components/LaunchEmojicoinButton"; +import { SYMBOL_DATA } from "@sdk/emoji_data/symbol-data"; -const LaunchEmojicoin: React.FC = () => { +const ClientLaunchEmojicoinPage: React.FC = () => { const { t } = translationFunction(); const { validationSchema, initialValues } = useValidationSchema(); @@ -164,7 +165,9 @@ const LaunchEmojicoin: React.FC = () => { - + SYMBOL_DATA.byEmoji(e.emoji)!.hex)} + /> @@ -172,4 +175,4 @@ const LaunchEmojicoin: React.FC = () => { ); }; -export default LaunchEmojicoin; +export default ClientLaunchEmojicoinPage; diff --git a/src/typescript/frontend/src/components/pages/launch-emojicoin/components/LaunchEmojicoinButton.tsx b/src/typescript/frontend/src/components/pages/launch-emojicoin/components/LaunchEmojicoinButton.tsx new file mode 100644 index 000000000..30506fde5 --- /dev/null +++ b/src/typescript/frontend/src/components/pages/launch-emojicoin/components/LaunchEmojicoinButton.tsx @@ -0,0 +1,68 @@ +import ButtonWithConnectWalletFallback from "components/header/wallet-button/ConnectWalletButton"; +import Button from "components/button"; +import { translationFunction } from "context/language-context"; +import { RegisterMarket, RegistryView } from "@sdk/emojicoin_dot_fun/emojicoin-dot-fun"; +import { useAptos } from "context/wallet-context/AptosContextProvider"; +import { + type PendingTransactionResponse, + type UserTransactionResponse, + type HexInput, +} from "@aptos-labs/ts-sdk"; +import { INTEGRATOR_ADDRESS } from "lib/env"; +import { DEFAULT_REGISTER_MARKET_GAS_OPTIONS } from "@sdk/const"; +import { toRegistryView } from "@sdk/types"; + +export const LaunchEmojicoinButton = ({ emojis }: { emojis: Array }) => { + const { t } = translationFunction(); + const { aptos, account, submit, signThenSubmit } = useAptos(); + + const handleClick = async () => { + if (!account) { + return; + } + let _res: PendingTransactionResponse | UserTransactionResponse | null = null; + let _txFlowError: unknown; + const builderArgs = { + aptosConfig: aptos.config, + registrant: account.address, + emojis, + integrator: INTEGRATOR_ADDRESS, + }; + try { + const builderLambda = () => RegisterMarket.builder(builderArgs); + await submit(builderLambda).then((r) => { + _res = r?.response ?? null; + _txFlowError = r?.error; + }); + } catch (e) { + // TODO: Check if this works. + // If the market registration fails, it's possibly because it's the first market and the gas limit + // needs to be set very high. We'll check if the registry has 0 markets, and then try to manually + // set the gas limits and submit again. + const registryView = await RegistryView.view({ + aptos, + }).then((r) => toRegistryView(r)); + + const builderLambda = () => + RegisterMarket.builder({ + ...builderArgs, + options: DEFAULT_REGISTER_MARKET_GAS_OPTIONS, + }); + + if (registryView.numMarkets === 0n) { + await signThenSubmit(builderLambda).then((r) => { + _res = r?.response ?? null; + _txFlowError = r?.error; + }); + } + } + }; + + return ( + + + + ); +}; diff --git a/src/typescript/frontend/src/components/pages/launch-emojicoin/hooks/use-validation-schema.ts b/src/typescript/frontend/src/components/pages/launch-emojicoin/hooks/use-validation-schema.ts index 67048f42e..900aa3c2e 100644 --- a/src/typescript/frontend/src/components/pages/launch-emojicoin/hooks/use-validation-schema.ts +++ b/src/typescript/frontend/src/components/pages/launch-emojicoin/hooks/use-validation-schema.ts @@ -2,6 +2,7 @@ import * as yup from "yup"; import { type InitialValues } from "./types"; import { translationFunction } from "context/language-context"; +import { SYMBOL_DATA } from "@sdk/emoji_data"; const useValidationSchema = () => { const initialValues: InitialValues = { @@ -15,7 +16,7 @@ const useValidationSchema = () => { emoji: yup.string().test("emoji", `${t("Byte limit reached")}`, (value) => { const encoder = new TextEncoder(); const bytes = encoder.encode(value); - return bytes.length <= 10; + return bytes.length <= 10 && SYMBOL_DATA.hasHex(bytes); }), }); diff --git a/src/typescript/frontend/src/components/pages/pools/index.tsx b/src/typescript/frontend/src/components/pages/pools/ClientPoolsPage.tsx similarity index 97% rename from src/typescript/frontend/src/components/pages/pools/index.tsx rename to src/typescript/frontend/src/components/pages/pools/ClientPoolsPage.tsx index 4e59eeb04..59967e740 100644 --- a/src/typescript/frontend/src/components/pages/pools/index.tsx +++ b/src/typescript/frontend/src/components/pages/pools/ClientPoolsPage.tsx @@ -18,7 +18,7 @@ import { } from "components/pages/pools/styled"; import { isDisallowedEventKey } from "utils"; -export const Pools = () => { +export const ClientPoolsPage = () => { const { isMobile } = useMatchBreakpoints(); const { targetRef, tooltip } = useEmojicoinPicker({ @@ -97,4 +97,4 @@ export const Pools = () => { ); }; -export default Pools; +export default ClientPoolsPage; diff --git a/src/typescript/frontend/src/context/providers.tsx b/src/typescript/frontend/src/context/providers.tsx index 268bb0f56..25ab4223c 100644 --- a/src/typescript/frontend/src/context/providers.tsx +++ b/src/typescript/frontend/src/context/providers.tsx @@ -5,7 +5,7 @@ import React, { Suspense, useEffect, useMemo, useState } from "react"; import { Provider } from "react-redux"; import { ThemeProvider } from "styled-components"; -import { GlobalStyle, StyledToastContainer } from "styles"; +import { GlobalStyle } from "styles"; import ThemeContextProvider, { useThemeContext } from "./theme-context"; import store from "store/store"; import Loader from "components/loader"; @@ -18,6 +18,8 @@ import { ConnectWalletContextProvider } from "./wallet-context/ConnectWalletCont import { PontemWallet } from "@pontem/wallet-adapter-plugin"; import { RiseWallet } from "@rise-wallet/wallet-adapter"; import { MartianWallet } from "@martianwallet/aptos-wallet-adapter"; +import { AptosContextProvider } from "./wallet-context/AptosContextProvider"; +import StyledToaster from "styles/StyledToaster"; const ThemedApp: React.FC<{ children: React.ReactNode }> = ({ children }) => { const { theme } = useThemeContext(); @@ -33,17 +35,19 @@ const ThemedApp: React.FC<{ children: React.ReactNode }> = ({ children }) => { - - }> - - - -
- {children} -