update to 0.5.0-rc1

This commit is contained in:
Paul Miller
2023-12-21 12:53:37 -06:00
parent dc18a38d22
commit 4b785b4eef
7 changed files with 15 additions and 51 deletions

View File

@@ -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
);

View File

@@ -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));