This opens live network watchers (an onchain address subscription plus the
wallet's indexer stream) and keeps them open until it settles. Cancel it
if you are not going to await it to completion — pass a signal or a
timeoutMs. Racing an uncancelled call against a timer (Promise.race)
abandons the loser without stopping its watchers, and repeating that in a
loop stacks subscriptions until the process exits.
A promise that resolves the next new coins received by the wallet's address
Throws
If cancelled via signal or timeoutMs
Example
// Wake early on a deposit, but give up after 30s and release the watchers. try { constfunds = awaitwaitForIncomingFunds(wallet, { timeoutMs:30_000 }) } catch (e) { if ((easError).name !== "AbortError") throwe }
Wait for incoming funds to the wallet.
This opens live network watchers (an onchain address subscription plus the wallet's indexer stream) and keeps them open until it settles. Cancel it if you are not going to await it to completion — pass a
signalor atimeoutMs. Racing an uncancelled call against a timer (Promise.race) abandons the loser without stopping its watchers, and repeating that in a loop stacks subscriptions until the process exits.