@arkade-os/sdk Documentation - v0.5.0-rc.11
    Preparing search index...

    Function waitForIncomingFunds

    • 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 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.

      Parameters

      Returns Promise<IncomingFunds>

      A promise that resolves the next new coins received by the wallet's address

      If cancelled via signal or timeoutMs

      // Wake early on a deposit, but give up after 30s and release the watchers.
      try {
      const funds = await waitForIncomingFunds(wallet, { timeoutMs: 30_000 })
      } catch (e) {
      if ((e as Error).name !== "AbortError") throw e
      }