diff --git a/package.json b/package.json index 47e3ec7..5d1e870 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "@kobalte/core": "^0.9.8", "@kobalte/tailwindcss": "^0.5.0", "@modular-forms/solid": "^0.18.1", - "@mutinywallet/mutiny-wasm": "0.4.39", + "@mutinywallet/mutiny-wasm": "0.5.0-rc1", "@mutinywallet/waila-wasm": "^0.2.6", "@solid-primitives/upload": "^0.0.111", "@solid-primitives/websocket": "^1.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4a5dd76..af48356 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -54,8 +54,8 @@ importers: specifier: ^0.18.1 version: 0.18.1(solid-js@1.8.5) '@mutinywallet/mutiny-wasm': - specifier: 0.4.39 - version: 0.4.39 + specifier: 0.5.0-rc1 + version: 0.5.0-rc1 '@mutinywallet/waila-wasm': specifier: ^0.2.6 version: 0.2.6 @@ -2584,8 +2584,8 @@ packages: solid-js: 1.8.5 dev: false - /@mutinywallet/mutiny-wasm@0.4.39: - resolution: {integrity: sha512-7vMgwteU0lCzMdX/INIIlsrq5jvEJA2aXuJmqHzGb6Bgty2jOfuWVvW54c2SZ3HQvuFHDPxjrrDB2QHabdBhMw==} + /@mutinywallet/mutiny-wasm@0.5.0-rc1: + resolution: {integrity: sha512-UTkLbJ+Hux79IoJqRwVVSxZng94ALkx89NXtYU69WzplPOHoIk/jFrjAXzLQK9MXu1dqsePu/yeAOwCumRkMPw==} dev: false /@mutinywallet/waila-wasm@0.2.6: diff --git a/src/components/KitchenSink.tsx b/src/components/KitchenSink.tsx index 639770e..6349fdb 100644 --- a/src/components/KitchenSink.tsx +++ b/src/components/KitchenSink.tsx @@ -39,19 +39,10 @@ function PeerItem(props: { peer: MutinyPeer }) { const [state, _] = useMegaStore(); const handleDisconnectPeer = async () => { - const nodes = await state.mutiny_wallet?.list_nodes(); - const firstNode = (nodes[0] as string) || ""; - if (props.peer.is_connected) { - await state.mutiny_wallet?.disconnect_peer( - firstNode, - props.peer.pubkey - ); + await state.mutiny_wallet?.disconnect_peer(props.peer.pubkey); } else { - await state.mutiny_wallet?.delete_peer( - firstNode, - props.peer.pubkey - ); + await state.mutiny_wallet?.delete_peer(props.peer.pubkey); } }; @@ -132,13 +123,8 @@ function ConnectPeer(props: { refetchPeers: RefetchPeersType }) { e.preventDefault(); const peerConnectString = value().trim(); - const nodes = await state.mutiny_wallet?.list_nodes(); - const firstNode = (nodes[0] as string) || ""; - await state.mutiny_wallet?.connect_to_peer( - firstNode, - peerConnectString - ); + await state.mutiny_wallet?.connect_to_peer(peerConnectString); await props.refetchPeers(); @@ -353,11 +339,7 @@ function OpenChannel(props: { refetchChannels: RefetchChannelsListType }) { const pubkey = peerPubkey().trim(); const bigAmount = BigInt(amount()); - const nodes = await state.mutiny_wallet?.list_nodes(); - const firstNode = (nodes[0] as string) || ""; - const new_channel = await state.mutiny_wallet?.open_channel( - firstNode, pubkey, bigAmount ); diff --git a/src/components/PendingNwc.tsx b/src/components/PendingNwc.tsx index a1adea1..e1a0980 100644 --- a/src/components/PendingNwc.tsx +++ b/src/components/PendingNwc.tsx @@ -75,8 +75,7 @@ export function PendingNwc() { async function payItem(item: PendingItem) { try { setPaying(item.id); - const nodes = await state.mutiny_wallet?.list_nodes(); - await state.mutiny_wallet?.approve_invoice(item.id, nodes[0]); + await state.mutiny_wallet?.approve_invoice(item.id); await vibrateSuccess(); } catch (e) { setError(eify(e)); diff --git a/src/logic/mutinyWalletSetup.ts b/src/logic/mutinyWalletSetup.ts index 75a0d56..da98b7e 100644 --- a/src/logic/mutinyWalletSetup.ts +++ b/src/logic/mutinyWalletSetup.ts @@ -258,6 +258,10 @@ export async function setupMutinyWallet( esplora, rgs, lsp, + // LSPS connection string + undefined, + // LSPS token + undefined, auth, subscriptions, storage, diff --git a/src/routes/Send.tsx b/src/routes/Send.tsx index fa20fac..5f42247 100644 --- a/src/routes/Send.tsx +++ b/src/routes/Send.tsx @@ -573,13 +573,10 @@ export function Send() { const tags = await processContacts(selectedContacts()); if (source() === "lightning" && invoice() && bolt11) { - const nodes = await state.mutiny_wallet?.list_nodes(); - const firstNode = (nodes[0] as string) || ""; sentDetails.destination = bolt11; // If the invoice has sats use that, otherwise we pass the user-defined amount if (invoice()?.amount_sats) { const payment = await state.mutiny_wallet?.pay_invoice( - firstNode, bolt11, undefined, tags @@ -589,7 +586,6 @@ export function Send() { sentDetails.fee_estimate = payment?.fees_paid || 0; } else { const payment = await state.mutiny_wallet?.pay_invoice( - firstNode, bolt11, amountSats(), tags @@ -599,10 +595,7 @@ export function Send() { sentDetails.fee_estimate = payment?.fees_paid || 0; } } else if (source() === "lightning" && nodePubkey()) { - const nodes = await state.mutiny_wallet?.list_nodes(); - const firstNode = (nodes[0] as string) || ""; const payment = await state.mutiny_wallet?.keysend( - firstNode, nodePubkey()!, amountSats(), undefined, // todo add optional keysend message @@ -618,10 +611,7 @@ export function Send() { sentDetails.fee_estimate = payment?.fees_paid || 0; } } else if (source() === "lightning" && lnurlp()) { - const nodes = await state.mutiny_wallet?.list_nodes(); - const firstNode = (nodes[0] as string) || ""; const payment = await state.mutiny_wallet?.lnurl_pay( - firstNode, lnurlp()!, amountSats(), undefined, // zap_npub diff --git a/src/routes/Swap.tsx b/src/routes/Swap.tsx index 434349f..97b1444 100644 --- a/src/routes/Swap.tsx +++ b/src/routes/Swap.tsx @@ -116,13 +116,8 @@ export function Swap() { setIsConnecting(true); try { const peerConnectString = values.peer.trim(); - const nodes = await state.mutiny_wallet?.list_nodes(); - const firstNode = (nodes[0] as string) || ""; - await state.mutiny_wallet?.connect_to_peer( - firstNode, - peerConnectString - ); + await state.mutiny_wallet?.connect_to_peer(peerConnectString); await refetch(); @@ -156,8 +151,6 @@ export function Swap() { if (canSwap()) { try { setLoading(true); - const nodes = await state.mutiny_wallet?.list_nodes(); - const firstNode = (nodes[0] as string) || ""; let peer = undefined; @@ -167,15 +160,11 @@ export function Swap() { if (isMax()) { const new_channel = - await state.mutiny_wallet?.sweep_all_to_channel( - firstNode, - peer - ); + await state.mutiny_wallet?.sweep_all_to_channel(peer); setChannelOpenResult({ channel: new_channel }); } else { const new_channel = await state.mutiny_wallet?.open_channel( - firstNode, peer, amountSats() );