bump banani version to fix bug; seed confirm page

This commit is contained in:
stjet
2025-01-16 20:46:00 +00:00
parent 44d1b9defd
commit b76e9c09fd
7 changed files with 62 additions and 28 deletions

View File

@@ -0,0 +1,31 @@
<script lang="ts">
import { Progress } from "$lib/types";
let { bsf_seed, progress = $bindable() } = $props();
let user_seed: String = $state("");
function continue_to_payment() {
if (user_seed.trim() === bsf_seed) {
progress = Progress.Payment;
} else {
alert(`Seed doesn't match! Your seed is ${bsf_seed}`);
}
}
</script>
<p>Confirm the seed you just saved:</p>
<input type="text" bind:value={user_seed}/>
<br>
<br>
<button class="button" onclick={continue_to_payment}>Continue</button>
<style>
p {
margin-bottom: 15px;
}
input {
min-width: 50vw;
}
</style>

View File

@@ -3,14 +3,14 @@
let { bsf_seed, progress = $bindable() } = $props();
function continue_to_payment() {
progress = Progress.Payment;
function continue_to_confirm() {
progress = Progress.ConfirmSeed;
}
</script>
<p>Save the seed and continue.</p>
<p>Seed (in BNS Seed Format): <code>{bsf_seed}</code></p>
<button class="button" onclick={continue_to_payment}>Continue</button>
<button class="button" onclick={continue_to_confirm}>Continue</button>
<style>
p {
@@ -18,4 +18,3 @@
}
</style>

View File

@@ -1,5 +1,6 @@
export enum Progress {
Seed = "seed",
ConfirmSeed = "confirm_seed",
Payment = "payment",
Declare = "declare",
Done = "done",

View File

@@ -30,7 +30,7 @@ export const POST: RequestHandler = async ({ request }) => {
const receive_wallet = new Wallet(rpc, found.receive_seed);
await receive_wallet.receive_all();
await sleep(1500);
const balance = Number(raw_to_whole((await rpc.get_account_balance(receive_wallet.address)).balance));
const balance = Number(raw_to_whole(BigInt((await rpc.get_account_balance(receive_wallet.address)).balance)));
if (balance < found.price) {
return error(500, `Need to be sent ${found.price}, only got ${balance}`);
}

View File

@@ -4,6 +4,7 @@
import { Progress } from "$lib/types";
import Seed from "$lib/Seed.svelte";
import ConfirmSeed from "$lib/ConfirmSeed.svelte";
import Payment from "$lib/Payment.svelte";
import Declare from "$lib/Declare.svelte";
@@ -40,6 +41,8 @@
<div class="middle">
{#if progress === Progress.Seed}
<Seed bind:progress {bsf_seed}/>
{:else if progress === Progress.ConfirmSeed}
<ConfirmSeed bind:progress {bsf_seed}/>
{:else if progress === Progress.Payment}
<Payment bind:progress {domain} {payment_address} {send_to_pub_key}/>
{:else if progress === Progress.Declare}