From ad7b09b43323d0ffc0a8ddabb43e4838a184c697 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 24 Feb 2026 13:18:42 -0800 Subject: formatting --- lib/ark.ts | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) (limited to 'lib/ark.ts') diff --git a/lib/ark.ts b/lib/ark.ts index ad708b7f..6558a74a 100644 --- a/lib/ark.ts +++ b/lib/ark.ts @@ -2,13 +2,7 @@ import { EventSource } from "eventsource"; if (!globalThis.EventSource) globalThis.EventSource = EventSource; import config from "$config"; -import { - SingleKey, - Wallet, - Ramps, - RestArkProvider, - VtxoManager, -} from "@arkade-os/sdk"; +import { SingleKey, Wallet, Ramps, RestArkProvider, VtxoManager } from "@arkade-os/sdk"; import { l, warn } from "$lib/logging"; let wallet: any; @@ -31,9 +25,7 @@ const failedBoardingOutpoints = new Set(); const withTimeout = (promise: Promise, ms: number, label: string) => Promise.race([ promise, - new Promise((_, reject) => - setTimeout(() => reject(new Error(`${label} timed out`)), ms), - ), + new Promise((_, reject) => setTimeout(() => reject(new Error(`${label} timed out`)), ms)), ]); export const refreshArkWallet = async (force = false) => { @@ -58,11 +50,7 @@ export const refreshArkWallet = async (force = false) => { // Recover swept/expired VTXOs if (balance.recoverable > 0) { try { - const txid = await withTimeout( - manager.recoverVtxos(), - 60_000, - "ark recovery", - ); + const txid = await withTimeout(manager.recoverVtxos(), 60_000, "ark recovery"); l("ark recovered swept vtxos, txid:", txid); } catch (e: any) { warn("ark vtxo recovery failed:", e.message); @@ -74,11 +62,7 @@ export const refreshArkWallet = async (force = false) => { const expiring = await manager.getExpiringVtxos(); if (expiring.length > 0) { l("ark renewing", expiring.length, "expiring vtxos"); - const txid = await withTimeout( - manager.renewVtxos(), - 60_000, - "ark renewal", - ); + const txid = await withTimeout(manager.renewVtxos(), 60_000, "ark renewal"); l("ark renewed vtxos, txid:", txid); } } catch (e: any) { @@ -98,10 +82,7 @@ export const refreshArkWallet = async (force = false) => { const outpointKey = (u: any) => `${u.txid}:${u.vout}`; const sorted = [...confirmed] .filter((u: any) => !failedBoardingOutpoints.has(outpointKey(u))) - .sort( - (a: any, b: any) => - (b.status?.block_height || 0) - (a.status?.block_height || 0), - ); + .sort((a: any, b: any) => (b.status?.block_height || 0) - (a.status?.block_height || 0)); for (const utxo of sorted) { try { -- cgit v1.2.3