<script>
	import { onMount } from 'svelte';
	import { connectWallet } from '$lib/services/wallet/wallet';
	import WalletConnect from '$lib/WalletConnect.svelte';
	import Send from '$lib/Send.svelte';

	export let me;

	onMount(async () => {
		$me.context.pkpWallet = await connectWallet($me.context.pkpPubKey, $me.context.rpcURL);
	});
</script>

<div>
	<div class="mb-4 text-lg font-medium">
		PKP Wallet:
		{#if $me.context.pkpWallet}
			<span class="text-blue-600">{$me.context.pkpWallet.address}</span>
		{/if}
	</div>
	<Send pkpWallet={$me.context.pkpWallet} />
	<WalletConnect />
</div>
