From f8eb86e72488791bccd8423e1b1bc8984281d2e4 Mon Sep 17 00:00:00 2001 From: 0xward Date: Mon, 29 Sep 2025 04:26:44 +0700 Subject: [PATCH 1/3] Create WalletConnectButton.tsx --- components/WalletConnectButton.tsx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 components/WalletConnectButton.tsx diff --git a/components/WalletConnectButton.tsx b/components/WalletConnectButton.tsx new file mode 100644 index 0000000..1022779 --- /dev/null +++ b/components/WalletConnectButton.tsx @@ -0,0 +1,19 @@ +import React, { useState } from "react"; +import { connectWallet } from "../lib/reownClient"; + +const WalletConnectButton = () => { + const [connected, setConnected] = useState(false); + + const handleConnect = async () => { + const session = await connectWallet(); + if (session) setConnected(true); + }; + + return ( + + ); +}; + +export default WalletConnectButton; From bfdb6d003147063fe24f7623740aa0188090c56c Mon Sep 17 00:00:00 2001 From: 0xward Date: Mon, 29 Sep 2025 04:28:59 +0700 Subject: [PATCH 2/3] Create reownClient.ts --- lib/reownClient.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lib/reownClient.ts diff --git a/lib/reownClient.ts b/lib/reownClient.ts new file mode 100644 index 0000000..32f8d10 --- /dev/null +++ b/lib/reownClient.ts @@ -0,0 +1,17 @@ +import { CoreClient, AppKit } from "@reown/appkit"; + +export const initializeReown = async () => { + await CoreClient.initialize({ projectId: "180a7164cfa9e5388daf1160841f65a0" }); + await AppKit.initialize({ init: CoreClient }); +}; + +export const connectWallet = async () => { + try { + const session = await AppKit.Modal.open(); + console.log("Wallet connected:", session); + return session; + } catch (err) { + console.error(err); + return null; + } +}; From 9b7c52422da41f0be4489ac0424453382f8b3a05 Mon Sep 17 00:00:00 2001 From: 0xward Date: Mon, 29 Sep 2025 04:30:46 +0700 Subject: [PATCH 3/3] Create index.tsx --- index.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 index.tsx diff --git a/index.tsx b/index.tsx new file mode 100644 index 0000000..e39225c --- /dev/null +++ b/index.tsx @@ -0,0 +1,10 @@ +import WalletConnectButton from "./components/WalletConnectButton"; + +function App() { + return ( +
+

Minswap Wallet Connect Integration

+ +
+ ); +}