@johngalt5/bsv-overlay 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.ts +3 -5
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -78,9 +78,9 @@ async function startAutoImport(env, cliPath, logger) {
|
|
|
78
78
|
const network = env.BSV_NETWORK === 'testnet' ? 'test' : 'main';
|
|
79
79
|
const controller = new AbortController();
|
|
80
80
|
const timeout = setTimeout(() => controller.abort(), 15000);
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
const resp = await fetch(`https://api.whatsonchain.com/v1/bsv/${network}/address/${address}/unspent`, { signal: controller.signal });
|
|
82
|
+
clearTimeout(timeout);
|
|
83
|
+
if (!resp.ok) return;
|
|
84
84
|
const utxos = await resp.json();
|
|
85
85
|
|
|
86
86
|
for (const utxo of utxos) {
|
|
@@ -118,8 +118,6 @@ async function startAutoImport(env, cliPath, logger) {
|
|
|
118
118
|
}
|
|
119
119
|
} catch (err) {
|
|
120
120
|
// WoC API error — just skip this cycle
|
|
121
|
-
} finally {
|
|
122
|
-
clearTimeout(timeout);
|
|
123
121
|
}
|
|
124
122
|
}, 60000); // Check every 60 seconds
|
|
125
123
|
} catch (err) {
|