import { useMemo } from "react"; import { ConnectionProvider, WalletProvider, } from "@solana/wallet-adapter-react"; import { WalletAdapterNetwork } from "@solana/wallet-adapter-base"; import { BloctoWalletAdapter, PhantomWalletAdapter, SolflareWalletAdapter, SolletWalletAdapter, SolongWalletAdapter, Coin98WalletAdapter, CloverWalletAdapter, TorusWalletAdapter, MathWalletAdapter, SlopeWalletAdapter, } from "@solana/wallet-adapter-wallets"; import { ToastContainer, toast } from "react-toastify"; import Footer from "./components/navigation-frame/Footer"; import TopBar from "./components/navigation-frame/TopBar"; import { RPC_URL, RPC_WSS } from "./settings/rpc"; import { JupiterApiProvider } from "./contexts"; import { Buffer } from "buffer"; import JupiterForm from "./components/Jupiter"; import { useLocalStorageState } from "ahooks"; import { tokenAuthFetchMiddleware } from "@strata-foundation/web3-token-auth"; import { getToken } from "@stream-swap/ui"; import { Warning } from "./components/Warning"; import "react-toastify/dist/ReactToastify.css"; // Override @solana/wallet-adapter-react-ui/styles.css import "./wallet.css"; window.Buffer = Buffer; const App = () => { const [customRpc, setCustomRpc] = useLocalStorageState("customRpc"); const [visible, setVisible] = useLocalStorageState("warning", { defaultValue: true, }); const network = WalletAdapterNetwork.Mainnet; const wallets = useMemo( () => [ new PhantomWalletAdapter(), new SlopeWalletAdapter(), new SolletWalletAdapter({ network }), new SolflareWalletAdapter(), new TorusWalletAdapter(), new SolongWalletAdapter(), new MathWalletAdapter(), new Coin98WalletAdapter(), new CloverWalletAdapter(), new BloctoWalletAdapter({ network }), ], [network] ); const endpoint = useMemo(() => customRpc || (RPC_URL as string), [customRpc]); const jwt = endpoint?.includes("quiknode"); return (
); }; export default App;