Skip to content

Commit

Permalink
Updating key display logic for advanced mode
Browse files Browse the repository at this point in the history
  • Loading branch information
aaroncox committed Dec 5, 2024
1 parent cc867b3 commit 4bb4cf9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/lib/state/metamask.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export class MetaMaskState {
public isInstalled = $state(false);
public error = $state<Error | null>(null);
public installedSnap = $state<Snap | null>(null);
public publicKey = $state<PublicKey | null>(null);
public publicKey = $state<PublicKey | null>(null); // active
public ownerKey = $state<PublicKey | null>(null); // owner

public snapsDetected = $derived(this.snapProvider !== null);

Expand Down
19 changes: 15 additions & 4 deletions src/routes/[network]/(homepage)/(wallets)/metamask/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@
if (isInstalled) {
connect();
accountCreationPluginMetamask
.retrievePublicKey(data.network.chain.id)
.retrievePublicKeys(data.network.chain.id)
.then((publicKey) => {
metaMaskState.publicKey = publicKey;
metaMaskState.publicKey = publicKey.activePublicKey;
metaMaskState.ownerKey = publicKey.ownerPublicKey;
});
}
});
Expand Down Expand Up @@ -221,8 +222,18 @@
{/if}
{#if context.settings.data.advancedMode}
<Stack class="mb-1 gap-2">
<p>EOS Wallet Public Key</p>
<p class="text-xs">{metaMaskState.publicKey}</p>
<p>EOS Wallet Public Key (Active)</p>
<p class="font-mono text-xs">
<a href={`/${data.network}/key/${metaMaskState.publicKey}`}>
{metaMaskState.publicKey}
</a>
</p>
<p>EOS Wallet Public Key (Owner)</p>
<p class="font-mono text-xs">
<a href={`/${data.network}/key/${metaMaskState.ownerKey}`}>
{metaMaskState.ownerKey}
</a>
</p>
</Stack>
{/if}
{/if}
Expand Down

0 comments on commit 4bb4cf9

Please sign in to comment.