Skip to content

Commit 42deb93

Browse files
authored
Update App.svelte
1 parent d57b15b commit 42deb93

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

src/App.svelte

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,40 @@
1010
Span,
1111
} from 'flowbite-svelte';
1212
13+
//PROBANDO WALLET KIT
14+
//npm i @reown/walletkit @walletconnect/utils @walletconnect/core
15+
16+
import { Core } from '@walletconnect/core'
17+
import { WalletKit } from '@reown/walletkit'
18+
19+
const core = new Core({
20+
projectId: '718db8dd3bdd8a270d49ea62522c0805'
21+
})
22+
23+
const metadata = {
24+
name: 'Wallet Paxapos',
25+
description: 'AppKit Example',
26+
url: 'http://localhost:5173/', // origin must match your domain & subdomain
27+
icons: ['https://assets.reown.com/reown-profile-pic.png']
28+
}
29+
30+
const walletKit = WalletKit.init({
31+
core, // <- pass the shared 'core' instance
32+
metadata
33+
})
34+
35+
36+
37+
async function connectWallet() {
38+
try {
39+
const session = await walletKit;
40+
console.log('Conectado:', session);
41+
// Aquí puedes almacenar la dirección de la wallet o cualquier otra información necesaria
42+
} catch (error) {
43+
console.error('Error al conectar:', error);
44+
}
45+
}
46+
1347
// cargar pubKey de stellar
1448
let addr: string = localStorage.getItem('addr') || '';
1549
@@ -77,5 +111,8 @@
77111
>
78112
<Wallet address={addr} pasword={priv} />
79113
</Card>
114+
<button on:click={connectWallet} class="btn">
115+
Conectar Wallet connect
116+
</button>
80117
</div>
81118
</main>

0 commit comments

Comments
 (0)