Skip to content

Commit

Permalink
feat(site): add sepolia faucet
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiserKarel authored and cor committed Oct 18, 2023
1 parent 5fc6336 commit 6301325
Showing 1 changed file with 34 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1 +1,34 @@
<div class="bg-black">Show link to sepolia faucet</div>
<script>
import { ethereumAddress } from '$lib/stores/wallets'
import { get } from "svelte/store";
import TerminalContainer from "$lib/TerminalContainer.svelte";
import DemoButton from '$lib/DemoButton.svelte';
let message = "Copy address";
const faucetAddress ="https://sepoliafaucet.com/"
function copy() {
let address = get(ethereumAddress);
if (address == null) {
return
}
navigator.clipboard.writeText(address);
message = "Copied"
}
function goToFaucet() {
window.open(faucetAddress, "_blank");
}
</script>

<TerminalContainer>
{#if !$ethereumAddress == null}
Connect Metamask to continue
{:else}
<div>Ethereum Address: <span class="text-accent">{$ethereumAddress}</span></div>
<DemoButton on:click={copy}>
{message}
</DemoButton>
<DemoButton on:click={goToFaucet}>Open Sepolia faucet</DemoButton>
{/if}
</TerminalContainer>

0 comments on commit 6301325

Please sign in to comment.