mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2026-01-06 07:44:27 +01:00
lengthen interval, set mainnet channel size to 50k
This commit is contained in:
committed by
Tony Giorgio
parent
bc85263c30
commit
2dfbcf96ee
@@ -79,7 +79,7 @@ function OnChainItem(props: {
|
||||
}
|
||||
|
||||
function InvoiceItem(props: { item: MutinyInvoice; labels: MutinyTagItem[] }) {
|
||||
const isSend = createMemo(() => props.item.is_send)
|
||||
const isSend = createMemo(() => !props.item.inbound);
|
||||
|
||||
const [open, setOpen] = createSignal(false)
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import pencil from "~/assets/icons/pencil.svg";
|
||||
import { InlineAmount } from "./AmountCard";
|
||||
import { DIALOG_CONTENT, DIALOG_POSITIONER } from "~/styles/dialogs";
|
||||
import { InfoBox } from "./InfoBox";
|
||||
import { Network } from "~/logic/mutinyWalletSetup";
|
||||
|
||||
const CHARACTERS = ["1", "2", "3", "4", "5", "6", "7", "8", "9", ".", "0", "DEL"];
|
||||
|
||||
@@ -59,8 +60,13 @@ export const AmountEditable: ParentComponent<{
|
||||
|
||||
const warningText = () => {
|
||||
if ((store.balance?.lightning || 0n) === 0n) {
|
||||
const network = state.mutiny_wallet?.get_network() as Network;
|
||||
if (network === "bitcoin") {
|
||||
return "Your first lightning receive needs to be 50,000 sats or greater.";
|
||||
} else {
|
||||
return "Your first lightning receive needs to be 10,000 sats or greater.";
|
||||
}
|
||||
}
|
||||
|
||||
const parsed = Number(displayAmount());
|
||||
if (isNaN(parsed)) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Show } from "solid-js";
|
||||
import { Button, FancyCard, Indicator } from "~/components/layout";
|
||||
import { Button, FancyCard } from "~/components/layout";
|
||||
import { useMegaStore } from "~/state/megaStore";
|
||||
import { Amount } from "./Amount";
|
||||
import { A, useNavigate } from "solid-start";
|
||||
|
||||
@@ -53,25 +53,28 @@ function LightningHeader(props: { info: MutinyInvoice }) {
|
||||
<img src={bolt} alt="lightning bolt" class="w-8 h-8" />
|
||||
</div>
|
||||
<h1 class="uppercase font-semibold">
|
||||
{props.info.is_send ? "Lightning send" : "Lightning receive"}
|
||||
{props.info.inbound ? "Lightning receive" : "Lightning send"}
|
||||
</h1>
|
||||
<ActivityAmount
|
||||
center
|
||||
amount={props.info.amount_sats?.toString() ?? "0"}
|
||||
price={state.price}
|
||||
positive={!props.info.is_send}
|
||||
positive={props.info.inbound}
|
||||
/>
|
||||
<For each={tags()}>
|
||||
{(tag) => (
|
||||
<TinyButton tag={tag} onClick={() => {
|
||||
<TinyButton
|
||||
tag={tag}
|
||||
onClick={() => {
|
||||
// noop
|
||||
}}>
|
||||
}}
|
||||
>
|
||||
{tag.name}
|
||||
</TinyButton>
|
||||
)}
|
||||
</For>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
function OnchainHeader(props: { info: OnChainTx }) {
|
||||
|
||||
@@ -147,10 +147,22 @@ export default function Swap() {
|
||||
|
||||
const canSwap = () => {
|
||||
const balance = (state.balance?.confirmed || 0n) + (state.balance?.unconfirmed || 0n);
|
||||
const network = state.mutiny_wallet?.get_network() as Network;
|
||||
|
||||
if (network === "bitcoin") {
|
||||
return (!!selectedPeer() || !!hasLsp()) && amountSats() >= 50000n && amountSats() <= balance;
|
||||
} else {
|
||||
return (!!selectedPeer() || !!hasLsp()) && amountSats() >= 10000n && amountSats() <= balance;
|
||||
}
|
||||
};
|
||||
|
||||
const amountWarning = () => {
|
||||
const network = state.mutiny_wallet?.get_network() as Network;
|
||||
|
||||
if (network === "bitcoin" && amountSats() < 50000n) {
|
||||
return "It's just silly to make a channel smaller than 50,000 sats";
|
||||
}
|
||||
|
||||
if (amountSats() < 10000n) {
|
||||
return "It's just silly to make a channel smaller than 10,000 sats";
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ export const Provider: ParentComponent = (props) => {
|
||||
createEffect(() => {
|
||||
const interval = setInterval(async () => {
|
||||
await actions.sync();
|
||||
}, 3 * 1000); // Poll every 3 seconds
|
||||
}, 30 * 1000); // Poll every 30 seconds
|
||||
|
||||
onCleanup(() => {
|
||||
clearInterval(interval);
|
||||
|
||||
Reference in New Issue
Block a user