upgrade mutiny-wasm

This commit is contained in:
Paul Miller
2023-04-26 11:27:03 -05:00
parent d5acdf3a82
commit cb11f0d1b7
4 changed files with 104 additions and 104 deletions

View File

@@ -6,7 +6,7 @@ type Choices = { value: string, label: string, caption: string }[]
// TODO: how could would it be if we could just pass the estimated fees in here?
export function StyledRadioGroup(props: { value: string, choices: Choices, onValueChange: (value: string) => void, small?: boolean, }) {
return (
<RadioGroup.Root value={props.value} onValueChange={(e) => props.onValueChange(e)} class={`grid w-full gap-${props.small ? 2 : 4} grid-cols-${props.choices.length}`}>
<RadioGroup.Root value={props.value} onValueChange={(e) => props.onValueChange(e)} class={`grid w-full gap-${props.small ? "2" : "4"} grid-cols-${props.choices.length.toString()}`}>
<For each={props.choices}>
{choice =>
<RadioGroup.Item value={choice.value} class="ui-checked:bg-neutral-950 bg-white/10 rounded outline outline-black/50 ui-checked:outline-m-blue ui-checked:outline-2">

View File

@@ -15,6 +15,7 @@ import { FullscreenModal } from "~/components/layout/FullscreenModal";
import { BackButton } from "~/components/layout/BackButton";
import { TagEditor, TagItem } from "~/components/TagEditor";
import { StyledRadioGroup } from "~/components/layout/Radio";
import { showToast } from "~/components/Toaster";
type OnChainTx = {
transaction: {
@@ -136,18 +137,23 @@ export default function Receive() {
async function getUnifiedQr(amount: string) {
const bigAmount = BigInt(amount);
const raw = await state.node_manager?.create_bip21(bigAmount, "TODO DELETE ME");
try {
const raw = await state.node_manager?.create_bip21(bigAmount, "TODO DELETE ME");
// Save the raw info so we can watch the address and invoice
setBip21Raw(raw);
// Save the raw info so we can watch the address and invoice
setBip21Raw(raw);
const params = objectToSearchParams({
amount: raw?.btc_amount,
label: raw?.description,
lightning: raw?.invoice
})
const params = objectToSearchParams({
amount: raw?.btc_amount,
label: raw?.description,
lightning: raw?.invoice
})
return `bitcoin:${raw?.address}?${params}`
return `bitcoin:${raw?.address}?${params}`
} catch (e) {
showToast(new Error("Couldn't create invoice. Are you asking for enough?"))
console.error(e)
}
}
async function onSubmit(e: Event) {
@@ -155,7 +161,7 @@ export default function Receive() {
const unifiedQr = await getUnifiedQr(amount())
setUnified(unifiedQr)
setUnified(unifiedQr || "")
setReceiveState("show")
}
@@ -194,9 +200,6 @@ export default function Receive() {
});
});
return (
<NodeManagerGuard>
<SafeArea>