Files
auth.andert.me/src/lib/components/Wallet/Wallet.svelte
Samuel Andert e12f6bcf05 feat(components): Initialize component state and enable property mapping
- Ensure every component has an initialized state, defaulting to empty.
- Implement property mapping to synchronize states between parent and child components.
2023-07-24 15:00:05 +02:00

23 lines
528 B
Svelte

<script>
import { onMount } from 'svelte';
import { connectWallet } from '$lib/services/wallet/wallet';
import { getComponentStore } from '$lib/stores/componentStores.ts';
// please abstract this.
export let id;
const store = getComponentStore(id);
let pkpWallet = null;
onMount(async () => {
pkpWallet = await connectWallet($store.pkpPubKey, $store.rpcURL);
});
</script>
{#if pkpWallet}
<div class="mb-4 text-lg font-medium">
PKP Wallet: <span class="text-blue-600">{pkpWallet.address}</span>
</div>
{/if}