wallet
This commit is contained in:
parent
a91baa6388
commit
079fa8826c
19
app/page.tsx
19
app/page.tsx
|
|
@ -8,7 +8,7 @@ const Home: React.FC = () => {
|
|||
const { login, ready, user } = usePrivy();
|
||||
|
||||
useEffect(() => {
|
||||
const setResult = async (result: string) => {
|
||||
const setResult = async (result: string, wallet:string) => {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const requestIdFromUrl = params.get('request_id');
|
||||
try {
|
||||
|
|
@ -21,6 +21,15 @@ const Home: React.FC = () => {
|
|||
result: result
|
||||
},
|
||||
});
|
||||
await axios({
|
||||
method: 'get',
|
||||
url: `https://vps.playpoolstudios.com/metahunt/api/launcher/set_wallet.php`,
|
||||
withCredentials: false,
|
||||
params: {
|
||||
id: result,
|
||||
result: wallet
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Error making GET request:', error);
|
||||
}
|
||||
|
|
@ -28,14 +37,18 @@ const Home: React.FC = () => {
|
|||
|
||||
const requestIdFromUrl = new URLSearchParams(window.location.search).get('request_id');
|
||||
if (requestIdFromUrl) {
|
||||
setResult('some_result'); // Replace 'some_result' with the actual result you want to send
|
||||
setResult(user?.id ?? "", user?.wallet?.address ?? ""); // Replace 'some_result' with the actual result you want to send
|
||||
}
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className='flex flex-col items-center justify-center h-full'>
|
||||
{user && ready ? (
|
||||
<h1 className='neon-text mb-4 text-3xl'>Logged in</h1>
|
||||
<div>
|
||||
<h1 className='neon-text mb-4 text-3xl'>Login Success. You may close this now.</h1>
|
||||
<h1>{ user.wallet?.address }</h1>
|
||||
</div>
|
||||
|
||||
) : (
|
||||
<>
|
||||
<h1 className='neon-text mb-4 text-3xl'>Complete W3B Wallet Login</h1>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user