From 4a2263286520aab755fedd852bffaf3663d5eba4 Mon Sep 17 00:00:00 2001 From: daniel-vahn Date: Tue, 16 Apr 2024 13:48:16 +0200 Subject: [PATCH] test message signing --- src/App.tsx | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 55b1ea6..142ea6a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect } from 'react'; +import { useState, useEffect, ChangeEvent } from 'react'; // import { useTonWallet } from '@tonconnect/ui-react'; import WebApp from '@twa-dev/sdk'; import axios from 'axios'; @@ -134,7 +134,7 @@ function App() { WebApp.openLink('https://metamask.app.link/'); axios .post(BRIDGE_URL + '/sign', { - message: 'This is a test message to sign in the wallet.', + message: testMessage, account: account, }) .then((response) => { @@ -142,10 +142,16 @@ function App() { }); }; - const triggerTestMessageToChat = () => { - // Trigger Test Message to Chat + const [testMessage, setTestMessage] = useState(''); + + const handleTestMessageChange = (e: ChangeEvent) => { + setTestMessage(e.target.value); }; + // const triggerTestMessageToChat = () => { + // // Trigger Test Message to Chat + // }; + // Transaction Functions const sendFunds = () => { // Send Funds @@ -211,10 +217,6 @@ function App() { {account}

CONNECT

-
+

HORRAY!

@@ -306,15 +309,26 @@ function App() { valueFiat={150} />
+ + {signedMessage && ( +
+

Signed Message:

+

{signedMessage}

+
+ )}
- + /> */}