diff options
| author | Adam Soltys <[email protected]> | 2026-03-17 01:34:24 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-03-17 01:34:28 -0700 |
| commit | ab47682bf20e79931bdb3a4b65196c41c1c81275 (patch) | |
| tree | eb10ade24273b653e71bc9c9093995cf2412c18f | |
| parent | 136ba2a12e87178f6d83fba2874abf4c9ad32915 (diff) | |
| download | coinos-server-ab47682bf20e79931bdb3a4b65196c41c1c81275.tar.gz coinos-server-ab47682bf20e79931bdb3a4b65196c41c1c81275.zip | |
handle ark dust
| -rw-r--r-- | bun.lock | 4 | ||||
| -rw-r--r-- | lib/ark.ts | 5 | ||||
| -rw-r--r-- | package.json | 2 |
3 files changed, 6 insertions, 5 deletions
@@ -5,7 +5,7 @@ "": { "name": "coinos", "dependencies": { - "@arkade-os/sdk": "0.4.6", + "@arkade-os/sdk": "0.4.7", "@asoltys/clightning-client": "^0.2.0", "@aws-sdk/client-ses": "^3.997.0", "@cashu/cashu-ts": "^2.9.0", @@ -81,7 +81,7 @@ "@apimatic/schema": ["@apimatic/[email protected]", "", { "dependencies": { "tslib": "^2.8.1" } }, "sha512-RCke4toXjA7fBRxQVa1GR+Lj9utVOEJ3voDI26dhk+bZuAac4UXPzkTEaIO3AIe/o8pcKCOkpNIzhzm57Cv2Qg=="], - "@arkade-os/sdk": ["@arkade-os/[email protected]", "", { "dependencies": { "@kukks/bitcoin-descriptors": "3.1.0", "@marcbachmann/cel-js": "7.3.1", "@noble/curves": "2.0.0", "@noble/secp256k1": "3.0.0", "@scure/base": "2.0.0", "@scure/bip32": "2.0.0", "@scure/bip39": "2.0.1", "@scure/btc-signer": "2.0.1", "bip68": "1.0.4" }, "peerDependencies": { "@react-native-async-storage/async-storage": ">=1.0.0", "expo": ">=54.0.0", "expo-background-task": "~1.0.10", "expo-sqlite": "~16.0.10", "expo-task-manager": "~14.0.9" }, "optionalPeers": ["@react-native-async-storage/async-storage", "expo", "expo-background-task", "expo-sqlite", "expo-task-manager"] }, "sha512-bbkuZpD9aPZkwde+F9VFidIm3MLBFdrjWpweew4M+S9CACVoaa6BqSl6aj9A0YVxG6y1oZ6LVitDS4W3veVG4A=="], + "@arkade-os/sdk": ["@arkade-os/[email protected]", "", { "dependencies": { "@kukks/bitcoin-descriptors": "3.1.0", "@marcbachmann/cel-js": "7.3.1", "@noble/curves": "2.0.0", "@noble/secp256k1": "3.0.0", "@scure/base": "2.0.0", "@scure/bip32": "2.0.0", "@scure/bip39": "2.0.1", "@scure/btc-signer": "2.0.1", "bip68": "1.0.4" }, "peerDependencies": { "@react-native-async-storage/async-storage": ">=1.0.0", "expo": ">=54.0.0", "expo-background-task": "~1.0.10", "expo-sqlite": "~16.0.10", "expo-task-manager": "~14.0.9" }, "optionalPeers": ["@react-native-async-storage/async-storage", "expo", "expo-background-task", "expo-sqlite", "expo-task-manager"] }, "sha512-T4C2wr6Tm43hT7I7gAFC5MC+FMeTXo0u31bbC17Km/OCb1qsLyCiO6c+NBFcJxFiKysxMEdGCoBNb+r8iWgV8Q=="], "@asoltys/clightning-client": ["@asoltys/[email protected]", "", { "dependencies": { "debug": "^4.1.1" } }, "sha512-CYbkyGoS0X1ha/YcFk3sTiI7aRHpPMnib/26WODucfJNrTbWl/9FJ4bpod9a6t9Jbv5OXCa0dYspcPK3kZ71pg=="], @@ -67,7 +67,7 @@ export const refreshArkWallet = async (force = false) => { const w = await getWallet(); const balance = await w.getBalance(); cachedArkBalance = balance; - const manager = new VtxoManager(w); + const manager = new VtxoManager(w, undefined, false); const provider = new RestArkProvider(config.ark.arkServerUrl); const info = await provider.getInfo(); const dust = Number(info.dust); @@ -114,7 +114,8 @@ export const refreshArkWallet = async (force = false) => { try { const allExpiring = await manager.getExpiringVtxos(RENEWAL_THRESHOLD_MS); const expiring = allExpiring.filter((v: any) => v.value > Number(info.dust)); - if (expiring.length > 0) { + const allTotal = allExpiring.reduce((s: number, v: any) => s + v.value, 0); + if (expiring.length > 0 && allTotal > dust) { const expiringTotal = expiring.reduce((s: number, v: any) => s + v.value, 0); l("ark renewing", expiring.length, "expiring vtxos, total:", expiringTotal, "sats (skipped", allExpiring.length - expiring.length, "dust)"); const txid = await withTimeout(manager.renewVtxos(), 60_000, "ark renewal"); diff --git a/package.json b/package.json index 790dbb18..adad0760 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "format": "oxfmt ." }, "dependencies": { - "@arkade-os/sdk": "0.4.6", + "@arkade-os/sdk": "0.4.7", "@asoltys/clightning-client": "^0.2.0", "@aws-sdk/client-ses": "^3.997.0", "@cashu/cashu-ts": "^2.9.0", |
