@arkade-os/sdk 0.4.50 → 0.4.52

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.
Files changed (72) hide show
  1. package/README.md +35 -8
  2. package/dist/adapters/expo.cjs +4 -4
  3. package/dist/adapters/expo.d.cts +2 -2
  4. package/dist/adapters/expo.d.ts +2 -2
  5. package/dist/adapters/expo.js +2 -2
  6. package/dist/adapters/indexedDB.cjs +4 -4
  7. package/dist/adapters/indexedDB.js +3 -3
  8. package/dist/{ark-ApoclKQZ.d.cts → ark-B69ugeJw.d.cts} +133 -1
  9. package/dist/{ark-ApoclKQZ.d.ts → ark-B69ugeJw.d.ts} +133 -1
  10. package/dist/{asyncStorageTaskQueue-BCWmdVg8.d.ts → asyncStorageTaskQueue-BImF14sj.d.ts} +2 -2
  11. package/dist/{asyncStorageTaskQueue-CIjgv1co.d.cts → asyncStorageTaskQueue-DScPdQAy.d.cts} +2 -2
  12. package/dist/{chunk-Q4K2RSMY.cjs → chunk-3Z5HK35D.cjs} +7 -7
  13. package/dist/{chunk-Q4K2RSMY.cjs.map → chunk-3Z5HK35D.cjs.map} +1 -1
  14. package/dist/{chunk-7WSVP7DK.js → chunk-3ZGANANS.js} +3 -3
  15. package/dist/{chunk-7WSVP7DK.js.map → chunk-3ZGANANS.js.map} +1 -1
  16. package/dist/{chunk-SNTSB6M2.js → chunk-AXCKRS2D.js} +354 -60
  17. package/dist/chunk-AXCKRS2D.js.map +1 -0
  18. package/dist/{chunk-TO3SR7TY.cjs → chunk-E6RT5XYB.cjs} +11 -11
  19. package/dist/{chunk-TO3SR7TY.cjs.map → chunk-E6RT5XYB.cjs.map} +1 -1
  20. package/dist/{chunk-SIAVTHMZ.cjs → chunk-FZPYPEWN.cjs} +3 -3
  21. package/dist/{chunk-SIAVTHMZ.cjs.map → chunk-FZPYPEWN.cjs.map} +1 -1
  22. package/dist/{chunk-LJQ2VQBE.cjs → chunk-IEMPH7J6.cjs} +52 -44
  23. package/dist/chunk-IEMPH7J6.cjs.map +1 -0
  24. package/dist/{chunk-6BQTROB4.cjs → chunk-ML33GFCH.cjs} +538 -243
  25. package/dist/chunk-ML33GFCH.cjs.map +1 -0
  26. package/dist/{chunk-MBSYQ3WX.js → chunk-UZLQUWYP.js} +52 -45
  27. package/dist/chunk-UZLQUWYP.js.map +1 -0
  28. package/dist/{chunk-ZXRSSBCF.js → chunk-WIVQWYPZ.js} +3 -3
  29. package/dist/{chunk-ZXRSSBCF.js.map → chunk-WIVQWYPZ.js.map} +1 -1
  30. package/dist/{chunk-AA4Q2J57.js → chunk-ZK3JITHP.js} +3 -3
  31. package/dist/{chunk-AA4Q2J57.js.map → chunk-ZK3JITHP.js.map} +1 -1
  32. package/dist/contracts/handlers/index.cjs +7 -7
  33. package/dist/contracts/handlers/index.d.cts +3 -3
  34. package/dist/contracts/handlers/index.d.ts +3 -3
  35. package/dist/contracts/handlers/index.js +1 -1
  36. package/dist/{delegate-hJYMZN1D.d.ts → delegate-BU-Cpyjw.d.ts} +1 -1
  37. package/dist/{delegate-CCHPwQft.d.cts → delegate-C_Y2YrXC.d.cts} +1 -1
  38. package/dist/{index-5Y9h9OnO.d.ts → index-BWF-C9eh.d.ts} +2 -2
  39. package/dist/{index-8jE1XJpT.d.cts → index-tzAInyiX.d.cts} +2 -2
  40. package/dist/index.cjs +161 -157
  41. package/dist/index.d.cts +24 -8
  42. package/dist/index.d.ts +24 -8
  43. package/dist/index.js +3 -3
  44. package/dist/repositories/realm/index.cjs +18 -18
  45. package/dist/repositories/realm/index.d.cts +2 -2
  46. package/dist/repositories/realm/index.d.ts +2 -2
  47. package/dist/repositories/realm/index.js +4 -4
  48. package/dist/repositories/sqlite/index.cjs +17 -17
  49. package/dist/repositories/sqlite/index.d.cts +2 -2
  50. package/dist/repositories/sqlite/index.d.ts +2 -2
  51. package/dist/repositories/sqlite/index.js +4 -4
  52. package/dist/{taskRunner-ChvV6Xrh.d.ts → taskRunner-Cf80BqSy.d.ts} +2 -2
  53. package/dist/{taskRunner-C3YLaM2x.d.cts → taskRunner-ClwI8jU8.d.cts} +2 -2
  54. package/dist/wallet/expo/background.cjs +13 -13
  55. package/dist/wallet/expo/background.d.cts +3 -3
  56. package/dist/wallet/expo/background.d.ts +3 -3
  57. package/dist/wallet/expo/background.js +5 -5
  58. package/dist/wallet/expo/index.cjs +13 -13
  59. package/dist/wallet/expo/index.d.cts +4 -4
  60. package/dist/wallet/expo/index.d.ts +4 -4
  61. package/dist/wallet/expo/index.js +4 -4
  62. package/dist/{wallet-DIH0gVfW.d.ts → wallet-B6Xiferv.d.cts} +33 -3
  63. package/dist/{wallet-B260BTJs.d.cts → wallet-CuHAI-eW.d.ts} +33 -3
  64. package/dist/worker/expo/index.cjs +8 -8
  65. package/dist/worker/expo/index.d.cts +4 -4
  66. package/dist/worker/expo/index.d.ts +4 -4
  67. package/dist/worker/expo/index.js +4 -4
  68. package/package.json +1 -1
  69. package/dist/chunk-6BQTROB4.cjs.map +0 -1
  70. package/dist/chunk-LJQ2VQBE.cjs.map +0 -1
  71. package/dist/chunk-MBSYQ3WX.js.map +0 -1
  72. package/dist/chunk-SNTSB6M2.js.map +0 -1
package/README.md CHANGED
@@ -1247,9 +1247,35 @@ This is required for MuSig2 settlements and cryptographic operations.
1247
1247
 
1248
1248
  ### Contract Management
1249
1249
 
1250
- Both `Wallet` and `ServiceWorkerWallet` use a `ContractManager` internally to watch for virtual outputs. This provides resilient connection handling with automatic reconnection and failsafe polling - for your wallet's default address and any external contracts you register (Boltz swaps, HTLCs, etc.).
1250
+ Both `Wallet` and `ServiceWorkerWallet` use a `ContractManager` internally to watch for virtual outputs and persist them into repositories. This provides resilient connection handling with automatic reconnection and failsafe polling - for your wallet's default address and any external contracts you register (Boltz swaps, HTLCs, etc.).
1251
1251
 
1252
- When you call `wallet.notifyIncomingFunds()` or use `waitForIncomingFunds()`, it uses the ContractManager under the hood, giving you automatic reconnection and failsafe polling for free - no code changes needed.
1252
+ When you call `wallet.notifyIncomingFunds()` or use `waitForIncomingFunds()`, it uses the ContractManager under the hood, giving you automatic reconnection and repository-backed event replay for free - no code changes needed.
1253
+
1254
+ `watcherConfig.failsafePollIntervalMs` (default `20_000`) controls how often the watcher replays repository changes into contract events; it does not fetch fresh VTXOs from the indexer.
1255
+
1256
+ #### HD look-ahead window
1257
+
1258
+ HD wallets (`walletMode: 'hd'`, or an explicit HD `DescriptorProvider`) also watch a band of *unused* offchain receive scripts around their allocation watermark, so a payment to an address that some other party issued from the same seed — a merchant backend such as BTCPay Server, or the .NET SDK driving the same wallet — arrives without the user calling `restore()`. `lookAheadWindow` (default `20`) is the per-side width of that band: the wallet watches `[watermark - N, watermark + N]`. Speculative entries are subscription-only; they become contract rows, and enter balances, only once funded.
1259
+
1260
+ The issuer, not the wallet, picks the contract shape, so each index is watched at *every* variant the wallet could own there: `default` and `delegate`, crossed with the unilateral-exit timelock matrix and the operator's current plus deprecated signers. That is the candidate set `restore()` probes too, so watching and restoring cover identical scripts.
1261
+
1262
+ ```typescript
1263
+ const wallet = await Wallet.create({
1264
+ identity,
1265
+ walletMode: 'hd',
1266
+ lookAheadWindow: 50, // issuer hands out long runs of unpaid invoices
1267
+ })
1268
+
1269
+ // Same option on the service-worker wallet; it is forwarded to the worker's inner wallet.
1270
+ const swWallet = await ServiceWorkerWallet.setup({
1271
+ serviceWorkerPath: '/service-worker.js',
1272
+ identity,
1273
+ walletMode: 'hd',
1274
+ lookAheadWindow: 50,
1275
+ })
1276
+ ```
1277
+
1278
+ Raise it when the external issuer is expected to burn more than `N` consecutive addresses without any of them being paid — every index in such a run is a miss, and the funded one sits past the band. When that happens the funds are invisible until a `restore()` whose `gapLimit` is large enough to cross the run (`wallet.restore({ gapLimit: 200 })`); a default restore closes its gap window before reaching the funded index. Keep the value modest: the band adds up to `2N + 1` indices × the candidate matrix (typically 1-4 scripts each) to the wallet's subscription.
1253
1279
 
1254
1280
  For advanced use cases, you can access the ContractManager directly to register external contracts:
1255
1281
 
@@ -1312,21 +1338,22 @@ const allPaths = await manager.getAllSpendingPaths({
1312
1338
  // Fetch contracts together with their current virtual outputs
1313
1339
  const contractsWithVtxos = await manager.getContractsWithVtxos()
1314
1340
 
1315
- // Force a full refresh from the indexer when needed
1341
+ // Force an indexer refresh of the watched contracts when needed
1316
1342
  await manager.refreshVtxos()
1317
1343
 
1318
1344
  // Stop watching
1319
1345
  unsubscribe()
1320
1346
  ```
1321
1347
 
1322
- The watcher features:
1323
- - **Automatic reconnection** with exponential backoff (1s → 30s max)
1324
- - **Failsafe polling** every 60 seconds to catch missed events
1325
- - **Immediate sync** on connection and after failures
1348
+ Contract freshness behavior:
1349
+ - **Automatic reconnection** with exponential backoff (1s → 5s max)
1350
+ - **Immediate sync** on manager initialization, subscription reconnect, and contract events
1351
+ - **Failsafe polling** every 20 seconds by default to catch missed events, configurable via `watcherConfig.failsafePollIntervalMs`
1352
+ - **Manual refresh** through `manager.refreshVtxos()`; pass `{ includeInactive: true }` to sweep every repository contract
1326
1353
 
1327
1354
  ### Repository Pattern
1328
1355
 
1329
- Most users don't need to touch repositories directly — `Wallet` and `ContractManager` already read and write through them. They are documented here for advanced integrations (custom storage backends, offline-first apps, repository inspection).
1356
+ Most users don't need to touch repositories directly — `Wallet` reads through them and `ContractManager` owns VTXO/contract synchronization into them. They are documented here for advanced integrations (custom storage backends, offline-first apps, repository inspection).
1330
1357
 
1331
1358
  ```typescript
1332
1359
  // Wallet repository — VTXOs, UTXOs, transaction history, settings
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkTO3SR7TY_cjs = require('../chunk-TO3SR7TY.cjs');
4
- require('../chunk-SIAVTHMZ.cjs');
3
+ var chunkE6RT5XYB_cjs = require('../chunk-E6RT5XYB.cjs');
4
+ require('../chunk-FZPYPEWN.cjs');
5
5
  require('../chunk-E7HB3GKK.cjs');
6
6
  require('../chunk-5BLDMQED.cjs');
7
7
 
@@ -9,11 +9,11 @@ require('../chunk-5BLDMQED.cjs');
9
9
 
10
10
  Object.defineProperty(exports, "ExpoArkProvider", {
11
11
  enumerable: true,
12
- get: function () { return chunkTO3SR7TY_cjs.ExpoArkProvider; }
12
+ get: function () { return chunkE6RT5XYB_cjs.ExpoArkProvider; }
13
13
  });
14
14
  Object.defineProperty(exports, "ExpoIndexerProvider", {
15
15
  enumerable: true,
16
- get: function () { return chunkTO3SR7TY_cjs.ExpoIndexerProvider; }
16
+ get: function () { return chunkE6RT5XYB_cjs.ExpoIndexerProvider; }
17
17
  });
18
18
  //# sourceMappingURL=expo.cjs.map
19
19
  //# sourceMappingURL=expo.cjs.map
@@ -1,5 +1,5 @@
1
- import { k as RestArkProvider, i as SettlementEvent, T as TxNotification, l as RestIndexerProvider, m as SubscriptionResponse } from '../ark-ApoclKQZ.cjs';
2
- export { n as ArkProvider, o as IndexerProvider } from '../ark-ApoclKQZ.cjs';
1
+ import { k as RestArkProvider, i as SettlementEvent, T as TxNotification, l as RestIndexerProvider, m as SubscriptionResponse } from '../ark-B69ugeJw.cjs';
2
+ export { n as ArkProvider, o as IndexerProvider } from '../ark-B69ugeJw.cjs';
3
3
  import '@scure/btc-signer/transaction.js';
4
4
  import '@scure/btc-signer/utils.js';
5
5
  import '@scure/btc-signer/psbt.js';
@@ -1,5 +1,5 @@
1
- import { k as RestArkProvider, i as SettlementEvent, T as TxNotification, l as RestIndexerProvider, m as SubscriptionResponse } from '../ark-ApoclKQZ.js';
2
- export { n as ArkProvider, o as IndexerProvider } from '../ark-ApoclKQZ.js';
1
+ import { k as RestArkProvider, i as SettlementEvent, T as TxNotification, l as RestIndexerProvider, m as SubscriptionResponse } from '../ark-B69ugeJw.js';
2
+ export { n as ArkProvider, o as IndexerProvider } from '../ark-B69ugeJw.js';
3
3
  import '@scure/btc-signer/transaction.js';
4
4
  import '@scure/btc-signer/utils.js';
5
5
  import '@scure/btc-signer/psbt.js';
@@ -1,5 +1,5 @@
1
- export { ExpoArkProvider, ExpoIndexerProvider } from '../chunk-ZXRSSBCF.js';
2
- import '../chunk-AA4Q2J57.js';
1
+ export { ExpoArkProvider, ExpoIndexerProvider } from '../chunk-WIVQWYPZ.js';
2
+ import '../chunk-ZK3JITHP.js';
3
3
  import '../chunk-EFNLTS6Q.js';
4
4
  import '../chunk-NSBPE2FW.js';
5
5
  //# sourceMappingURL=expo.js.map
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunk6BQTROB4_cjs = require('../chunk-6BQTROB4.cjs');
4
- require('../chunk-SIAVTHMZ.cjs');
5
- require('../chunk-LJQ2VQBE.cjs');
3
+ var chunkML33GFCH_cjs = require('../chunk-ML33GFCH.cjs');
4
+ require('../chunk-FZPYPEWN.cjs');
5
+ require('../chunk-IEMPH7J6.cjs');
6
6
  require('../chunk-E7HB3GKK.cjs');
7
7
  require('../chunk-5BLDMQED.cjs');
8
8
 
@@ -11,7 +11,7 @@ var IndexedDBStorageAdapter = class {
11
11
  dbName;
12
12
  version;
13
13
  db = null;
14
- constructor(dbName, version = chunk6BQTROB4_cjs.DB_VERSION) {
14
+ constructor(dbName, version = chunkML33GFCH_cjs.DB_VERSION) {
15
15
  this.dbName = dbName;
16
16
  this.version = version;
17
17
  }
@@ -1,6 +1,6 @@
1
- import { DB_VERSION } from '../chunk-SNTSB6M2.js';
2
- import '../chunk-AA4Q2J57.js';
3
- import '../chunk-MBSYQ3WX.js';
1
+ import { DB_VERSION } from '../chunk-AXCKRS2D.js';
2
+ import '../chunk-ZK3JITHP.js';
3
+ import '../chunk-UZLQUWYP.js';
4
4
  import '../chunk-EFNLTS6Q.js';
5
5
  import '../chunk-NSBPE2FW.js';
6
6
 
@@ -2102,6 +2102,15 @@ interface IContractManager extends Disposable {
2102
2102
  * Outpoints not owned by any tracked contract are silently dropped.
2103
2103
  */
2104
2104
  refreshOutpoints(outpoints: Outpoint[]): Promise<void>;
2105
+ /**
2106
+ * Rebuild the HD look-ahead watch window around the current allocation
2107
+ * watermark. No-op when the manager was configured without `lookAhead`.
2108
+ *
2109
+ * Call after anything that moves the watermark (restore, boarding
2110
+ * allocation, receive rotation, server-signer rotation). Concurrent calls
2111
+ * coalesce into a single drain.
2112
+ */
2113
+ refillLookAhead(): Promise<void>;
2105
2114
  /**
2106
2115
  * Explicit, gap-limit contract discovery used by `wallet.restore()`.
2107
2116
  *
@@ -2192,6 +2201,33 @@ interface ContractManagerConfig {
2192
2201
  onVtxosSpent?: (vtxos: Outpoint[]) => Promise<void>;
2193
2202
  /** Watcher configuration */
2194
2203
  watcherConfig?: Partial<ContractWatcherConfig>;
2204
+ /**
2205
+ * Enables the HD look-ahead watch window. Absent ⇒ feature off (static /
2206
+ * non-HD wallets, third-party embedders). See
2207
+ * {@link ContractManager.refillLookAhead}.
2208
+ */
2209
+ lookAhead?: LookAheadConfig;
2210
+ }
2211
+ /**
2212
+ * Wallet-injected surface backing the HD look-ahead window. Kept as a
2213
+ * callback bundle so the contracts layer never learns what an HD descriptor
2214
+ * is (mirrors {@link ScanContractsOptions.materialize}).
2215
+ */
2216
+ interface LookAheadConfig {
2217
+ /** Per-side band bound: the window spans `[max(0, w - size), w + size]`. */
2218
+ size: number;
2219
+ /** Current allocation watermark (`lastIndexUsed ?? -1`). */
2220
+ currentWatermark(): Promise<number>;
2221
+ /** Signing descriptor at an HD index. Pure derivation. */
2222
+ materialize(index: number): string;
2223
+ /**
2224
+ * Key and timelock axes an externally issued receive script could be
2225
+ * anchored to. Read once per refill, so a band rebuilt after
2226
+ * `rotateServerSigner` fans the new signer set.
2227
+ */
2228
+ candidateDeps(): CandidateDeps;
2229
+ /** Fired after a speculative entry at `index` is promoted to a real row. */
2230
+ onPromoted?(index: number): Promise<void>;
2195
2231
  }
2196
2232
  /**
2197
2233
  * Parameters for creating a new contract.
@@ -2257,6 +2293,12 @@ declare class ContractManager implements IContractManager {
2257
2293
  private syncDegradedReason?;
2258
2294
  /** Epoch-ms of the last successful provider sync, if any. */
2259
2295
  private lastSyncedAt?;
2296
+ /** Speculative look-ahead scripts, keyed by script. @see LookAheadEntry */
2297
+ private lookAheadEntries;
2298
+ /** In-flight look-ahead drain, if any. @see scheduleLookAheadDrain */
2299
+ private lookAheadDrain?;
2300
+ /** A refill was requested while a drain was running. */
2301
+ private lookAheadDirty;
2260
2302
  private constructor();
2261
2303
  /**
2262
2304
  * Static factory method for creating a new ContractManager.
@@ -2298,6 +2340,63 @@ declare class ContractManager implements IContractManager {
2298
2340
  * a failure is logged and sync continues. No-op without an intent store.
2299
2341
  */
2300
2342
  private reconcileStaleIntents;
2343
+ /** @see IContractManager.refillLookAhead */
2344
+ refillLookAhead(): Promise<void>;
2345
+ /**
2346
+ * Serialized drain of the look-ahead band: concurrent callers join the
2347
+ * active drain and mark it dirty, an idle call starts a new one. Promotion
2348
+ * can uncover more funded indices, and boot / SSE / rotate / reconnect can
2349
+ * all request a refill at once, so the loop coalesces them instead of
2350
+ * recursing.
2351
+ */
2352
+ private scheduleLookAheadDrain;
2353
+ /**
2354
+ * Request a drain without awaiting it. Used from inside a sync (promotion),
2355
+ * where awaiting the drain that the sync itself is part of would deadlock.
2356
+ */
2357
+ private requestLookAheadDrain;
2358
+ /**
2359
+ * Rebuild the speculative watch band around the allocation watermark.
2360
+ *
2361
+ * NArk needs no analogue because it *is* the address issuer: it persists a
2362
+ * contract row at derivation time, so its watched set is a superset of
2363
+ * every address it ever advertised. This SDK, when a third party issues
2364
+ * addresses from the shared seed, cannot observe those allocations at all —
2365
+ * the window is how a non-issuer compensates.
2366
+ *
2367
+ * Entries are registered with the watcher but NOT persisted: they become
2368
+ * repository rows only once funded (see {@link promoteLookAheadHits}).
2369
+ *
2370
+ * Each index contributes every {@link Discoverable.candidatesAt} candidate —
2371
+ * the same set `restore()`'s gap scan probes, since the wallet cannot know
2372
+ * which variant a third-party issuer handed out.
2373
+ */
2374
+ private ensureLookAhead;
2375
+ /**
2376
+ * One-time full-history sync for speculative entries the manager has not
2377
+ * successfully caught up on yet.
2378
+ *
2379
+ * Every normal sync uses the cursor-derived delta window and SSE only
2380
+ * delivers events after a script is subscribed, so a script first
2381
+ * registered after its funding time would otherwise be skipped forever
2382
+ * (upgrade migration, or a band that slid over an already-funded index).
2383
+ * The entries are passed as in-memory contracts because `refreshVtxos`
2384
+ * resolves scripts through the repository, where they deliberately do not
2385
+ * exist. Targeted + explicitly windowed, so the global cursor stays put.
2386
+ */
2387
+ private runLookAheadCatchUp;
2388
+ /**
2389
+ * Promote every look-ahead entry funded by `vtxos` into a real repository
2390
+ * row, returning the persisted rows keyed by script.
2391
+ *
2392
+ * MUST run on each raw indexer fetch before `annotateVtxos`:
2393
+ * `extendVirtualCoinForContract` throws when a VTXO's script has no
2394
+ * contract row, so a funded window entry has to be persisted before its
2395
+ * VTXOs are annotated and saved. Callers also swap the returned rows into
2396
+ * the local contract maps they built pre-promotion, so `saveVtxosForContract`
2397
+ * and `onVtxosPersisted` never see the synthetic watcher object.
2398
+ */
2399
+ private promoteLookAheadHits;
2301
2400
  /**
2302
2401
  * Create and register a new contract.
2303
2402
  *
@@ -2324,6 +2423,7 @@ declare class ContractManager implements IContractManager {
2324
2423
  * `persisted` is `true`.
2325
2424
  */
2326
2425
  private upsertContract;
2426
+ private upsertContractRow;
2327
2427
  /**
2328
2428
  * Explicit, gap-limit contract discovery (see {@link IContractManager.scanContracts}).
2329
2429
  *
@@ -2787,6 +2887,12 @@ interface DiscoveryDeps {
2787
2887
  /** Present only for delegate wallets. */
2788
2888
  delegatePubKey?: Uint8Array;
2789
2889
  }
2890
+ /**
2891
+ * The I/O-free subset of {@link DiscoveryDeps}: the axes a receive script can
2892
+ * be anchored to. `DiscoveryDeps` satisfies it structurally, so one
2893
+ * {@link Discoverable.candidatesAt} serves the scan and the look-ahead band.
2894
+ */
2895
+ type CandidateDeps = Pick<DiscoveryDeps, "network" | "serverPubKey" | "csvTimelocks"> & Pick<Partial<DiscoveryDeps>, "deprecatedSignerPubKeys" | "delegatePubKey">;
2790
2896
  /**
2791
2897
  * Optional capability a {@link ContractHandler} implements to participate
2792
2898
  * in `wallet.restore()`'s gap-limit scan. The scanner owns the index
@@ -2818,7 +2924,19 @@ interface Discoverable {
2818
2924
  index: number;
2819
2925
  descriptor: string;
2820
2926
  }[], deps: DiscoveryDeps): Promise<Map<number, DiscoveredContract[]>>;
2927
+ /**
2928
+ * Optional: every unverified contract this handler could own at one HD
2929
+ * index — pure derivation, no I/O, no metadata. `discoverRange` probes
2930
+ * these scripts and the look-ahead band subscribes to them, so the two
2931
+ * cannot cover different sets.
2932
+ *
2933
+ * `boarding` omits it: its probe is an on-chain address lookup, and that
2934
+ * keeps it out of the band (deposits are watched on their own channel).
2935
+ */
2936
+ candidatesAt?(index: number, descriptor: string, deps: CandidateDeps): DiscoveredContract[];
2821
2937
  }
2938
+ /** Duck-typed guard for the pure candidate surface. @see Discoverable.candidatesAt */
2939
+ declare function hasCandidates(handler: ContractHandler<unknown> | undefined): handler is ContractHandler<unknown> & Required<Pick<Discoverable, "candidatesAt">>;
2822
2940
  /** Duck-typed guard (mirrors `hasReceiveRotatorFactory`). */
2823
2941
  declare function isDiscoverable(handler: ContractHandler<unknown> | undefined): handler is ContractHandler<unknown> & Discoverable;
2824
2942
  /**
@@ -3624,6 +3742,20 @@ interface WalletConfig extends ReadonlyWalletConfig {
3624
3742
  * @defaultValue `'auto'`
3625
3743
  */
3626
3744
  walletMode?: WalletMode;
3745
+ /**
3746
+ * Per-side width of the HD look-ahead watch window: the wallet watches
3747
+ * missing offchain receive scripts across `[watermark - N, watermark + N]`
3748
+ * so funds paid to an address issued by an external party (a merchant
3749
+ * backend sharing the seed) arrive without an explicit `restore()`.
3750
+ *
3751
+ * Only meaningful for HD wallets (`walletMode: 'hd'` or an HD
3752
+ * {@link DescriptorProvider}); ignored otherwise. Raise it when the issuer
3753
+ * is expected to hand out more than `N` consecutive addresses without any
3754
+ * of them being paid. Must be a positive integer.
3755
+ *
3756
+ * @defaultValue `20`
3757
+ */
3758
+ lookAheadWindow?: number;
3627
3759
  }
3628
3760
  /**
3629
3761
  * Repository implementations used to store wallet and contract state.
@@ -5034,4 +5166,4 @@ declare namespace ProtoTypes {
5034
5166
  export { };
5035
5167
  }
5036
5168
 
5037
- export { type NetworkName as $, type ArkTransaction as A, type BatchStartedEvent as B, type ContractRepository as C, type TreeTxEvent as D, type ExtendedCoin as E, type TreeSignatureEvent as F, type GetVtxosFilter as G, type DescriptorProvider as H, type IWallet as I, type IReadonlyWallet as J, type ReadonlyIdentity as K, type Network as L, type DelegateProvider as M, type NormalizedExtendedVirtualCoin as N, type OnchainProvider as O, type ReadonlyWalletConfig as P, type IntentRepository as Q, type Recipient as R, type SendBitcoinParams as S, type TxNotification as T, type VirtualTxRepository as U, VtxoScript as V, type WalletRepository as W, type ExitCaptureMode as X, type ExitDataSource as Y, type IReadonlyAssetManager as Z, type ContractSyncState as _, type Identity as a, ChainTxType as a$, type ArkInfo as a0, ArkAddress as a1, type Coin as a2, ContractManager as a3, CSVMultisigTapscript as a4, type SettlementConfig as a5, VtxoManager as a6, type SignerSession as a7, type SignedIntent as a8, Intent as a9, type BurnParams as aA, type RenewVtxosOptions as aB, type ContractWithVtxos as aC, type PathSelection as aD, type ContractEvent as aE, type AssetDetails as aF, type IssuanceResult as aG, type DelegateInfo as aH, type MigrationGlobalSkipReason as aI, type MigrationLegSkipReason as aJ, type SignerStatus as aK, type StorageConfig as aL, type IVtxoManager as aM, type ExplorerTransaction as aN, type EncodedVtxoScript as aO, type Status as aP, type ChainTx as aQ, type PathContext as aR, type ActivityIntent as aS, type ActivityResolver as aT, type ArkIntentState as aU, type ArkTapscript as aV, type AssetMetadata as aW, type BaseWalletConfig as aX, type BatchInfo as aY, type BatchSignableIdentity as aZ, CLTVMultisigTapscript as a_, type TimeHeight as aa, type VtxoRepositoryKey as ab, type WalletState as ac, type ContractFilter as ad, type ArkIntent as ae, type IntentFilter as af, type Outpoint as ag, type VirtualTx as ah, type VtxoBranch as ai, ChainedTxType as aj, type DescriptorSigningRequest as ak, Transaction as al, type IntentFeeConfig as am, type OffchainInput as an, FeeAmount as ao, type OnchainInput as ap, type FeeOutput as aq, type ContractWatcherConfig as ar, type Asset as as, type FeeInfo as at, type CreateContractParams as au, type GetContractsFilter as av, type GetSpendablePathsOptions as aw, type GetAllSpendingPathsOptions as ax, type IssuanceParams as ay, type ReissuanceParams as az, type WalletConfig as b, type VtxoChain as b$, type CommitmentTx as b0, ConditionCSVMultisigTapscript as b1, ConditionMultisigTapscript as b2, type ContractBalance as b3, type ContractEventCallback as b4, type ContractHandler as b5, type ContractManagerConfig as b6, type ContractState as b7, type ContractVtxo as b8, ContractWatcher as b9, type PageResponse as bA, type PaginationOptions as bB, PartialSig as bC, type ProviderClass as bD, RestDelegateProvider as bE, RestDelegatorProvider as bF, type ScanContractsOptions as bG, type ScanResult as bH, type ScheduledSession as bI, SettlementEventType as bJ, type SignRequest as bK, type SignerClassification as bL, type SignerSet as bM, type SubscriptionEvent as bN, type SubscriptionHeartbeat as bO, type TapLeaves as bP, TapTreeCoder as bQ, TapscriptType as bR, type TreeNonces as bS, type TreePartialSigs as bT, type Tx as bU, type TxHistoryRecord as bV, type TxKey as bW, type TxTreeNode as bX, TxType as bY, type VirtualStatus as bZ, type Vtxo as b_, DelegateManagerImpl as ba, type DelegateOptions as bb, DelegatorManagerImpl as bc, type DelegatorProvider as bd, type DeprecatedSignerMigrationReport as be, type DeprecatedSignerReport as bf, DigestMismatchError as bg, type Discoverable as bh, type DiscoveredContract as bi, type DiscoveryDeps as bj, ESPLORA_URL as bk, EsploraProvider as bl, type ExitChainResolver as bm, type ExtendedContractVtxo as bn, type GroupMembership as bo, type HandlerError as bp, type IDelegatorManager as bq, INTENT_TERMINAL_STATES as br, IndexerTxType as bs, type KnownMetadata as bt, type MigrateDeprecatedSignerOptions as bu, type MigrationLegReport as bv, type MigrationVtxoRef as bw, MultisigTapscript as bx, type Nonces as by, type Output as bz, type WalletBalance as c, type VtxoType as c0, type WalletMode as c1, boardingResolver as c2, canRecoverOnchain as c3, canSpendOffchain as c4, classifyAgainstSignerSet as c5, classifyContractSigner as c6, createDefaultActivityRegistry as c7, createExitChainResolver as c8, decodeTapscript as c9, getNetwork as ca, getSequence as cb, hasTerminalSpend as cc, isBatchSignable as cd, isCooperativelyMigratable as ce, isDiscoverable as cf, isExpired as cg, isPastExpiry as ch, isRecoverable as ci, isSpendable as cj, isSubdust as ck, isTerminalIntentState as cl, isVirtualCoin as cm, isVtxoExpiringSoon as cn, networks as co, signerSetFromInfo as cp, toXOnlySignerHex as cq, type TapscriptDeriving as cr, ActivityRegistry as d, type Activity as e, type IContractManager as f, type IDelegateManager as g, type SettleParams as h, type SettlementEvent as i, type IAssetManager as j, RestArkProvider as k, RestIndexerProvider as l, type SubscriptionResponse as m, type ArkProvider as n, type IndexerProvider as o, type RelativeTimelock as p, type TapLeafScript as q, type VirtualCoin as r, type Contract as s, type ExtendedVirtualCoin as t, type TreeSigningStartedEvent as u, TxTree as v, type TreeNoncesEvent as w, type BatchFinalizationEvent as x, type BatchFinalizedEvent as y, type BatchFailedEvent as z };
5169
+ export { type NetworkName as $, type ArkTransaction as A, type BatchStartedEvent as B, type ContractRepository as C, type TreeTxEvent as D, type ExtendedCoin as E, type TreeSignatureEvent as F, type GetVtxosFilter as G, type DescriptorProvider as H, type IWallet as I, type IReadonlyWallet as J, type ReadonlyIdentity as K, type Network as L, type DelegateProvider as M, type NormalizedExtendedVirtualCoin as N, type OnchainProvider as O, type ReadonlyWalletConfig as P, type IntentRepository as Q, type Recipient as R, type SendBitcoinParams as S, type TxNotification as T, type VirtualTxRepository as U, VtxoScript as V, type WalletRepository as W, type ExitCaptureMode as X, type ExitDataSource as Y, type IReadonlyAssetManager as Z, type ContractSyncState as _, type Identity as a, CLTVMultisigTapscript as a$, type ArkInfo as a0, ArkAddress as a1, type Coin as a2, ContractManager as a3, type ContractManagerConfig as a4, CSVMultisigTapscript as a5, type SettlementConfig as a6, VtxoManager as a7, type SignerSession as a8, type SignedIntent as a9, type ReissuanceParams as aA, type BurnParams as aB, type RenewVtxosOptions as aC, type ContractWithVtxos as aD, type PathSelection as aE, type ContractEvent as aF, type AssetDetails as aG, type IssuanceResult as aH, type DelegateInfo as aI, type MigrationGlobalSkipReason as aJ, type MigrationLegSkipReason as aK, type SignerStatus as aL, type StorageConfig as aM, type IVtxoManager as aN, type ExplorerTransaction as aO, type EncodedVtxoScript as aP, type Status as aQ, type ChainTx as aR, type PathContext as aS, type ActivityIntent as aT, type ActivityResolver as aU, type ArkIntentState as aV, type ArkTapscript as aW, type AssetMetadata as aX, type BaseWalletConfig as aY, type BatchInfo as aZ, type BatchSignableIdentity as a_, Intent as aa, type TimeHeight as ab, type VtxoRepositoryKey as ac, type WalletState as ad, type ContractFilter as ae, type ArkIntent as af, type IntentFilter as ag, type Outpoint as ah, type VirtualTx as ai, type VtxoBranch as aj, ChainedTxType as ak, type DescriptorSigningRequest as al, Transaction as am, type IntentFeeConfig as an, type OffchainInput as ao, FeeAmount as ap, type OnchainInput as aq, type FeeOutput as ar, type ContractWatcherConfig as as, type Asset as at, type FeeInfo as au, type CreateContractParams as av, type GetContractsFilter as aw, type GetSpendablePathsOptions as ax, type GetAllSpendingPathsOptions as ay, type IssuanceParams as az, type WalletConfig as b, type Vtxo as b$, type CandidateDeps as b0, ChainTxType as b1, type CommitmentTx as b2, ConditionCSVMultisigTapscript as b3, ConditionMultisigTapscript as b4, type ContractBalance as b5, type ContractEventCallback as b6, type ContractHandler as b7, type ContractState as b8, type ContractVtxo as b9, type Output as bA, type PageResponse as bB, type PaginationOptions as bC, PartialSig as bD, type ProviderClass as bE, RestDelegateProvider as bF, RestDelegatorProvider as bG, type ScanContractsOptions as bH, type ScanResult as bI, type ScheduledSession as bJ, SettlementEventType as bK, type SignRequest as bL, type SignerClassification as bM, type SignerSet as bN, type SubscriptionEvent as bO, type SubscriptionHeartbeat as bP, type TapLeaves as bQ, TapTreeCoder as bR, TapscriptType as bS, type TreeNonces as bT, type TreePartialSigs as bU, type Tx as bV, type TxHistoryRecord as bW, type TxKey as bX, type TxTreeNode as bY, TxType as bZ, type VirtualStatus as b_, ContractWatcher as ba, DelegateManagerImpl as bb, type DelegateOptions as bc, DelegatorManagerImpl as bd, type DelegatorProvider as be, type DeprecatedSignerMigrationReport as bf, type DeprecatedSignerReport as bg, DigestMismatchError as bh, type Discoverable as bi, type DiscoveredContract as bj, type DiscoveryDeps as bk, ESPLORA_URL as bl, EsploraProvider as bm, type ExitChainResolver as bn, type ExtendedContractVtxo as bo, type GroupMembership as bp, type HandlerError as bq, type IDelegatorManager as br, INTENT_TERMINAL_STATES as bs, IndexerTxType as bt, type KnownMetadata as bu, type MigrateDeprecatedSignerOptions as bv, type MigrationLegReport as bw, type MigrationVtxoRef as bx, MultisigTapscript as by, type Nonces as bz, type WalletBalance as c, type VtxoChain as c0, type VtxoType as c1, type WalletMode as c2, boardingResolver as c3, canRecoverOnchain as c4, canSpendOffchain as c5, classifyAgainstSignerSet as c6, classifyContractSigner as c7, createDefaultActivityRegistry as c8, createExitChainResolver as c9, decodeTapscript as ca, getNetwork as cb, getSequence as cc, hasCandidates as cd, hasTerminalSpend as ce, isBatchSignable as cf, isCooperativelyMigratable as cg, isDiscoverable as ch, isExpired as ci, isPastExpiry as cj, isRecoverable as ck, isSpendable as cl, isSubdust as cm, isTerminalIntentState as cn, isVirtualCoin as co, isVtxoExpiringSoon as cp, networks as cq, signerSetFromInfo as cr, toXOnlySignerHex as cs, type TapscriptDeriving as ct, ActivityRegistry as d, type Activity as e, type IContractManager as f, type IDelegateManager as g, type SettleParams as h, type SettlementEvent as i, type IAssetManager as j, RestArkProvider as k, RestIndexerProvider as l, type SubscriptionResponse as m, type ArkProvider as n, type IndexerProvider as o, type RelativeTimelock as p, type TapLeafScript as q, type VirtualCoin as r, type Contract as s, type ExtendedVirtualCoin as t, type TreeSigningStartedEvent as u, TxTree as v, type TreeNoncesEvent as w, type BatchFinalizationEvent as x, type BatchFinalizedEvent as y, type BatchFailedEvent as z };
@@ -2102,6 +2102,15 @@ interface IContractManager extends Disposable {
2102
2102
  * Outpoints not owned by any tracked contract are silently dropped.
2103
2103
  */
2104
2104
  refreshOutpoints(outpoints: Outpoint[]): Promise<void>;
2105
+ /**
2106
+ * Rebuild the HD look-ahead watch window around the current allocation
2107
+ * watermark. No-op when the manager was configured without `lookAhead`.
2108
+ *
2109
+ * Call after anything that moves the watermark (restore, boarding
2110
+ * allocation, receive rotation, server-signer rotation). Concurrent calls
2111
+ * coalesce into a single drain.
2112
+ */
2113
+ refillLookAhead(): Promise<void>;
2105
2114
  /**
2106
2115
  * Explicit, gap-limit contract discovery used by `wallet.restore()`.
2107
2116
  *
@@ -2192,6 +2201,33 @@ interface ContractManagerConfig {
2192
2201
  onVtxosSpent?: (vtxos: Outpoint[]) => Promise<void>;
2193
2202
  /** Watcher configuration */
2194
2203
  watcherConfig?: Partial<ContractWatcherConfig>;
2204
+ /**
2205
+ * Enables the HD look-ahead watch window. Absent ⇒ feature off (static /
2206
+ * non-HD wallets, third-party embedders). See
2207
+ * {@link ContractManager.refillLookAhead}.
2208
+ */
2209
+ lookAhead?: LookAheadConfig;
2210
+ }
2211
+ /**
2212
+ * Wallet-injected surface backing the HD look-ahead window. Kept as a
2213
+ * callback bundle so the contracts layer never learns what an HD descriptor
2214
+ * is (mirrors {@link ScanContractsOptions.materialize}).
2215
+ */
2216
+ interface LookAheadConfig {
2217
+ /** Per-side band bound: the window spans `[max(0, w - size), w + size]`. */
2218
+ size: number;
2219
+ /** Current allocation watermark (`lastIndexUsed ?? -1`). */
2220
+ currentWatermark(): Promise<number>;
2221
+ /** Signing descriptor at an HD index. Pure derivation. */
2222
+ materialize(index: number): string;
2223
+ /**
2224
+ * Key and timelock axes an externally issued receive script could be
2225
+ * anchored to. Read once per refill, so a band rebuilt after
2226
+ * `rotateServerSigner` fans the new signer set.
2227
+ */
2228
+ candidateDeps(): CandidateDeps;
2229
+ /** Fired after a speculative entry at `index` is promoted to a real row. */
2230
+ onPromoted?(index: number): Promise<void>;
2195
2231
  }
2196
2232
  /**
2197
2233
  * Parameters for creating a new contract.
@@ -2257,6 +2293,12 @@ declare class ContractManager implements IContractManager {
2257
2293
  private syncDegradedReason?;
2258
2294
  /** Epoch-ms of the last successful provider sync, if any. */
2259
2295
  private lastSyncedAt?;
2296
+ /** Speculative look-ahead scripts, keyed by script. @see LookAheadEntry */
2297
+ private lookAheadEntries;
2298
+ /** In-flight look-ahead drain, if any. @see scheduleLookAheadDrain */
2299
+ private lookAheadDrain?;
2300
+ /** A refill was requested while a drain was running. */
2301
+ private lookAheadDirty;
2260
2302
  private constructor();
2261
2303
  /**
2262
2304
  * Static factory method for creating a new ContractManager.
@@ -2298,6 +2340,63 @@ declare class ContractManager implements IContractManager {
2298
2340
  * a failure is logged and sync continues. No-op without an intent store.
2299
2341
  */
2300
2342
  private reconcileStaleIntents;
2343
+ /** @see IContractManager.refillLookAhead */
2344
+ refillLookAhead(): Promise<void>;
2345
+ /**
2346
+ * Serialized drain of the look-ahead band: concurrent callers join the
2347
+ * active drain and mark it dirty, an idle call starts a new one. Promotion
2348
+ * can uncover more funded indices, and boot / SSE / rotate / reconnect can
2349
+ * all request a refill at once, so the loop coalesces them instead of
2350
+ * recursing.
2351
+ */
2352
+ private scheduleLookAheadDrain;
2353
+ /**
2354
+ * Request a drain without awaiting it. Used from inside a sync (promotion),
2355
+ * where awaiting the drain that the sync itself is part of would deadlock.
2356
+ */
2357
+ private requestLookAheadDrain;
2358
+ /**
2359
+ * Rebuild the speculative watch band around the allocation watermark.
2360
+ *
2361
+ * NArk needs no analogue because it *is* the address issuer: it persists a
2362
+ * contract row at derivation time, so its watched set is a superset of
2363
+ * every address it ever advertised. This SDK, when a third party issues
2364
+ * addresses from the shared seed, cannot observe those allocations at all —
2365
+ * the window is how a non-issuer compensates.
2366
+ *
2367
+ * Entries are registered with the watcher but NOT persisted: they become
2368
+ * repository rows only once funded (see {@link promoteLookAheadHits}).
2369
+ *
2370
+ * Each index contributes every {@link Discoverable.candidatesAt} candidate —
2371
+ * the same set `restore()`'s gap scan probes, since the wallet cannot know
2372
+ * which variant a third-party issuer handed out.
2373
+ */
2374
+ private ensureLookAhead;
2375
+ /**
2376
+ * One-time full-history sync for speculative entries the manager has not
2377
+ * successfully caught up on yet.
2378
+ *
2379
+ * Every normal sync uses the cursor-derived delta window and SSE only
2380
+ * delivers events after a script is subscribed, so a script first
2381
+ * registered after its funding time would otherwise be skipped forever
2382
+ * (upgrade migration, or a band that slid over an already-funded index).
2383
+ * The entries are passed as in-memory contracts because `refreshVtxos`
2384
+ * resolves scripts through the repository, where they deliberately do not
2385
+ * exist. Targeted + explicitly windowed, so the global cursor stays put.
2386
+ */
2387
+ private runLookAheadCatchUp;
2388
+ /**
2389
+ * Promote every look-ahead entry funded by `vtxos` into a real repository
2390
+ * row, returning the persisted rows keyed by script.
2391
+ *
2392
+ * MUST run on each raw indexer fetch before `annotateVtxos`:
2393
+ * `extendVirtualCoinForContract` throws when a VTXO's script has no
2394
+ * contract row, so a funded window entry has to be persisted before its
2395
+ * VTXOs are annotated and saved. Callers also swap the returned rows into
2396
+ * the local contract maps they built pre-promotion, so `saveVtxosForContract`
2397
+ * and `onVtxosPersisted` never see the synthetic watcher object.
2398
+ */
2399
+ private promoteLookAheadHits;
2301
2400
  /**
2302
2401
  * Create and register a new contract.
2303
2402
  *
@@ -2324,6 +2423,7 @@ declare class ContractManager implements IContractManager {
2324
2423
  * `persisted` is `true`.
2325
2424
  */
2326
2425
  private upsertContract;
2426
+ private upsertContractRow;
2327
2427
  /**
2328
2428
  * Explicit, gap-limit contract discovery (see {@link IContractManager.scanContracts}).
2329
2429
  *
@@ -2787,6 +2887,12 @@ interface DiscoveryDeps {
2787
2887
  /** Present only for delegate wallets. */
2788
2888
  delegatePubKey?: Uint8Array;
2789
2889
  }
2890
+ /**
2891
+ * The I/O-free subset of {@link DiscoveryDeps}: the axes a receive script can
2892
+ * be anchored to. `DiscoveryDeps` satisfies it structurally, so one
2893
+ * {@link Discoverable.candidatesAt} serves the scan and the look-ahead band.
2894
+ */
2895
+ type CandidateDeps = Pick<DiscoveryDeps, "network" | "serverPubKey" | "csvTimelocks"> & Pick<Partial<DiscoveryDeps>, "deprecatedSignerPubKeys" | "delegatePubKey">;
2790
2896
  /**
2791
2897
  * Optional capability a {@link ContractHandler} implements to participate
2792
2898
  * in `wallet.restore()`'s gap-limit scan. The scanner owns the index
@@ -2818,7 +2924,19 @@ interface Discoverable {
2818
2924
  index: number;
2819
2925
  descriptor: string;
2820
2926
  }[], deps: DiscoveryDeps): Promise<Map<number, DiscoveredContract[]>>;
2927
+ /**
2928
+ * Optional: every unverified contract this handler could own at one HD
2929
+ * index — pure derivation, no I/O, no metadata. `discoverRange` probes
2930
+ * these scripts and the look-ahead band subscribes to them, so the two
2931
+ * cannot cover different sets.
2932
+ *
2933
+ * `boarding` omits it: its probe is an on-chain address lookup, and that
2934
+ * keeps it out of the band (deposits are watched on their own channel).
2935
+ */
2936
+ candidatesAt?(index: number, descriptor: string, deps: CandidateDeps): DiscoveredContract[];
2821
2937
  }
2938
+ /** Duck-typed guard for the pure candidate surface. @see Discoverable.candidatesAt */
2939
+ declare function hasCandidates(handler: ContractHandler<unknown> | undefined): handler is ContractHandler<unknown> & Required<Pick<Discoverable, "candidatesAt">>;
2822
2940
  /** Duck-typed guard (mirrors `hasReceiveRotatorFactory`). */
2823
2941
  declare function isDiscoverable(handler: ContractHandler<unknown> | undefined): handler is ContractHandler<unknown> & Discoverable;
2824
2942
  /**
@@ -3624,6 +3742,20 @@ interface WalletConfig extends ReadonlyWalletConfig {
3624
3742
  * @defaultValue `'auto'`
3625
3743
  */
3626
3744
  walletMode?: WalletMode;
3745
+ /**
3746
+ * Per-side width of the HD look-ahead watch window: the wallet watches
3747
+ * missing offchain receive scripts across `[watermark - N, watermark + N]`
3748
+ * so funds paid to an address issued by an external party (a merchant
3749
+ * backend sharing the seed) arrive without an explicit `restore()`.
3750
+ *
3751
+ * Only meaningful for HD wallets (`walletMode: 'hd'` or an HD
3752
+ * {@link DescriptorProvider}); ignored otherwise. Raise it when the issuer
3753
+ * is expected to hand out more than `N` consecutive addresses without any
3754
+ * of them being paid. Must be a positive integer.
3755
+ *
3756
+ * @defaultValue `20`
3757
+ */
3758
+ lookAheadWindow?: number;
3627
3759
  }
3628
3760
  /**
3629
3761
  * Repository implementations used to store wallet and contract state.
@@ -5034,4 +5166,4 @@ declare namespace ProtoTypes {
5034
5166
  export { };
5035
5167
  }
5036
5168
 
5037
- export { type NetworkName as $, type ArkTransaction as A, type BatchStartedEvent as B, type ContractRepository as C, type TreeTxEvent as D, type ExtendedCoin as E, type TreeSignatureEvent as F, type GetVtxosFilter as G, type DescriptorProvider as H, type IWallet as I, type IReadonlyWallet as J, type ReadonlyIdentity as K, type Network as L, type DelegateProvider as M, type NormalizedExtendedVirtualCoin as N, type OnchainProvider as O, type ReadonlyWalletConfig as P, type IntentRepository as Q, type Recipient as R, type SendBitcoinParams as S, type TxNotification as T, type VirtualTxRepository as U, VtxoScript as V, type WalletRepository as W, type ExitCaptureMode as X, type ExitDataSource as Y, type IReadonlyAssetManager as Z, type ContractSyncState as _, type Identity as a, ChainTxType as a$, type ArkInfo as a0, ArkAddress as a1, type Coin as a2, ContractManager as a3, CSVMultisigTapscript as a4, type SettlementConfig as a5, VtxoManager as a6, type SignerSession as a7, type SignedIntent as a8, Intent as a9, type BurnParams as aA, type RenewVtxosOptions as aB, type ContractWithVtxos as aC, type PathSelection as aD, type ContractEvent as aE, type AssetDetails as aF, type IssuanceResult as aG, type DelegateInfo as aH, type MigrationGlobalSkipReason as aI, type MigrationLegSkipReason as aJ, type SignerStatus as aK, type StorageConfig as aL, type IVtxoManager as aM, type ExplorerTransaction as aN, type EncodedVtxoScript as aO, type Status as aP, type ChainTx as aQ, type PathContext as aR, type ActivityIntent as aS, type ActivityResolver as aT, type ArkIntentState as aU, type ArkTapscript as aV, type AssetMetadata as aW, type BaseWalletConfig as aX, type BatchInfo as aY, type BatchSignableIdentity as aZ, CLTVMultisigTapscript as a_, type TimeHeight as aa, type VtxoRepositoryKey as ab, type WalletState as ac, type ContractFilter as ad, type ArkIntent as ae, type IntentFilter as af, type Outpoint as ag, type VirtualTx as ah, type VtxoBranch as ai, ChainedTxType as aj, type DescriptorSigningRequest as ak, Transaction as al, type IntentFeeConfig as am, type OffchainInput as an, FeeAmount as ao, type OnchainInput as ap, type FeeOutput as aq, type ContractWatcherConfig as ar, type Asset as as, type FeeInfo as at, type CreateContractParams as au, type GetContractsFilter as av, type GetSpendablePathsOptions as aw, type GetAllSpendingPathsOptions as ax, type IssuanceParams as ay, type ReissuanceParams as az, type WalletConfig as b, type VtxoChain as b$, type CommitmentTx as b0, ConditionCSVMultisigTapscript as b1, ConditionMultisigTapscript as b2, type ContractBalance as b3, type ContractEventCallback as b4, type ContractHandler as b5, type ContractManagerConfig as b6, type ContractState as b7, type ContractVtxo as b8, ContractWatcher as b9, type PageResponse as bA, type PaginationOptions as bB, PartialSig as bC, type ProviderClass as bD, RestDelegateProvider as bE, RestDelegatorProvider as bF, type ScanContractsOptions as bG, type ScanResult as bH, type ScheduledSession as bI, SettlementEventType as bJ, type SignRequest as bK, type SignerClassification as bL, type SignerSet as bM, type SubscriptionEvent as bN, type SubscriptionHeartbeat as bO, type TapLeaves as bP, TapTreeCoder as bQ, TapscriptType as bR, type TreeNonces as bS, type TreePartialSigs as bT, type Tx as bU, type TxHistoryRecord as bV, type TxKey as bW, type TxTreeNode as bX, TxType as bY, type VirtualStatus as bZ, type Vtxo as b_, DelegateManagerImpl as ba, type DelegateOptions as bb, DelegatorManagerImpl as bc, type DelegatorProvider as bd, type DeprecatedSignerMigrationReport as be, type DeprecatedSignerReport as bf, DigestMismatchError as bg, type Discoverable as bh, type DiscoveredContract as bi, type DiscoveryDeps as bj, ESPLORA_URL as bk, EsploraProvider as bl, type ExitChainResolver as bm, type ExtendedContractVtxo as bn, type GroupMembership as bo, type HandlerError as bp, type IDelegatorManager as bq, INTENT_TERMINAL_STATES as br, IndexerTxType as bs, type KnownMetadata as bt, type MigrateDeprecatedSignerOptions as bu, type MigrationLegReport as bv, type MigrationVtxoRef as bw, MultisigTapscript as bx, type Nonces as by, type Output as bz, type WalletBalance as c, type VtxoType as c0, type WalletMode as c1, boardingResolver as c2, canRecoverOnchain as c3, canSpendOffchain as c4, classifyAgainstSignerSet as c5, classifyContractSigner as c6, createDefaultActivityRegistry as c7, createExitChainResolver as c8, decodeTapscript as c9, getNetwork as ca, getSequence as cb, hasTerminalSpend as cc, isBatchSignable as cd, isCooperativelyMigratable as ce, isDiscoverable as cf, isExpired as cg, isPastExpiry as ch, isRecoverable as ci, isSpendable as cj, isSubdust as ck, isTerminalIntentState as cl, isVirtualCoin as cm, isVtxoExpiringSoon as cn, networks as co, signerSetFromInfo as cp, toXOnlySignerHex as cq, type TapscriptDeriving as cr, ActivityRegistry as d, type Activity as e, type IContractManager as f, type IDelegateManager as g, type SettleParams as h, type SettlementEvent as i, type IAssetManager as j, RestArkProvider as k, RestIndexerProvider as l, type SubscriptionResponse as m, type ArkProvider as n, type IndexerProvider as o, type RelativeTimelock as p, type TapLeafScript as q, type VirtualCoin as r, type Contract as s, type ExtendedVirtualCoin as t, type TreeSigningStartedEvent as u, TxTree as v, type TreeNoncesEvent as w, type BatchFinalizationEvent as x, type BatchFinalizedEvent as y, type BatchFailedEvent as z };
5169
+ export { type NetworkName as $, type ArkTransaction as A, type BatchStartedEvent as B, type ContractRepository as C, type TreeTxEvent as D, type ExtendedCoin as E, type TreeSignatureEvent as F, type GetVtxosFilter as G, type DescriptorProvider as H, type IWallet as I, type IReadonlyWallet as J, type ReadonlyIdentity as K, type Network as L, type DelegateProvider as M, type NormalizedExtendedVirtualCoin as N, type OnchainProvider as O, type ReadonlyWalletConfig as P, type IntentRepository as Q, type Recipient as R, type SendBitcoinParams as S, type TxNotification as T, type VirtualTxRepository as U, VtxoScript as V, type WalletRepository as W, type ExitCaptureMode as X, type ExitDataSource as Y, type IReadonlyAssetManager as Z, type ContractSyncState as _, type Identity as a, CLTVMultisigTapscript as a$, type ArkInfo as a0, ArkAddress as a1, type Coin as a2, ContractManager as a3, type ContractManagerConfig as a4, CSVMultisigTapscript as a5, type SettlementConfig as a6, VtxoManager as a7, type SignerSession as a8, type SignedIntent as a9, type ReissuanceParams as aA, type BurnParams as aB, type RenewVtxosOptions as aC, type ContractWithVtxos as aD, type PathSelection as aE, type ContractEvent as aF, type AssetDetails as aG, type IssuanceResult as aH, type DelegateInfo as aI, type MigrationGlobalSkipReason as aJ, type MigrationLegSkipReason as aK, type SignerStatus as aL, type StorageConfig as aM, type IVtxoManager as aN, type ExplorerTransaction as aO, type EncodedVtxoScript as aP, type Status as aQ, type ChainTx as aR, type PathContext as aS, type ActivityIntent as aT, type ActivityResolver as aU, type ArkIntentState as aV, type ArkTapscript as aW, type AssetMetadata as aX, type BaseWalletConfig as aY, type BatchInfo as aZ, type BatchSignableIdentity as a_, Intent as aa, type TimeHeight as ab, type VtxoRepositoryKey as ac, type WalletState as ad, type ContractFilter as ae, type ArkIntent as af, type IntentFilter as ag, type Outpoint as ah, type VirtualTx as ai, type VtxoBranch as aj, ChainedTxType as ak, type DescriptorSigningRequest as al, Transaction as am, type IntentFeeConfig as an, type OffchainInput as ao, FeeAmount as ap, type OnchainInput as aq, type FeeOutput as ar, type ContractWatcherConfig as as, type Asset as at, type FeeInfo as au, type CreateContractParams as av, type GetContractsFilter as aw, type GetSpendablePathsOptions as ax, type GetAllSpendingPathsOptions as ay, type IssuanceParams as az, type WalletConfig as b, type Vtxo as b$, type CandidateDeps as b0, ChainTxType as b1, type CommitmentTx as b2, ConditionCSVMultisigTapscript as b3, ConditionMultisigTapscript as b4, type ContractBalance as b5, type ContractEventCallback as b6, type ContractHandler as b7, type ContractState as b8, type ContractVtxo as b9, type Output as bA, type PageResponse as bB, type PaginationOptions as bC, PartialSig as bD, type ProviderClass as bE, RestDelegateProvider as bF, RestDelegatorProvider as bG, type ScanContractsOptions as bH, type ScanResult as bI, type ScheduledSession as bJ, SettlementEventType as bK, type SignRequest as bL, type SignerClassification as bM, type SignerSet as bN, type SubscriptionEvent as bO, type SubscriptionHeartbeat as bP, type TapLeaves as bQ, TapTreeCoder as bR, TapscriptType as bS, type TreeNonces as bT, type TreePartialSigs as bU, type Tx as bV, type TxHistoryRecord as bW, type TxKey as bX, type TxTreeNode as bY, TxType as bZ, type VirtualStatus as b_, ContractWatcher as ba, DelegateManagerImpl as bb, type DelegateOptions as bc, DelegatorManagerImpl as bd, type DelegatorProvider as be, type DeprecatedSignerMigrationReport as bf, type DeprecatedSignerReport as bg, DigestMismatchError as bh, type Discoverable as bi, type DiscoveredContract as bj, type DiscoveryDeps as bk, ESPLORA_URL as bl, EsploraProvider as bm, type ExitChainResolver as bn, type ExtendedContractVtxo as bo, type GroupMembership as bp, type HandlerError as bq, type IDelegatorManager as br, INTENT_TERMINAL_STATES as bs, IndexerTxType as bt, type KnownMetadata as bu, type MigrateDeprecatedSignerOptions as bv, type MigrationLegReport as bw, type MigrationVtxoRef as bx, MultisigTapscript as by, type Nonces as bz, type WalletBalance as c, type VtxoChain as c0, type VtxoType as c1, type WalletMode as c2, boardingResolver as c3, canRecoverOnchain as c4, canSpendOffchain as c5, classifyAgainstSignerSet as c6, classifyContractSigner as c7, createDefaultActivityRegistry as c8, createExitChainResolver as c9, decodeTapscript as ca, getNetwork as cb, getSequence as cc, hasCandidates as cd, hasTerminalSpend as ce, isBatchSignable as cf, isCooperativelyMigratable as cg, isDiscoverable as ch, isExpired as ci, isPastExpiry as cj, isRecoverable as ck, isSpendable as cl, isSubdust as cm, isTerminalIntentState as cn, isVirtualCoin as co, isVtxoExpiringSoon as cp, networks as cq, signerSetFromInfo as cr, toXOnlySignerHex as cs, type TapscriptDeriving as ct, ActivityRegistry as d, type Activity as e, type IContractManager as f, type IDelegateManager as g, type SettleParams as h, type SettlementEvent as i, type IAssetManager as j, RestArkProvider as k, RestIndexerProvider as l, type SubscriptionResponse as m, type ArkProvider as n, type IndexerProvider as o, type RelativeTimelock as p, type TapLeafScript as q, type VirtualCoin as r, type Contract as s, type ExtendedVirtualCoin as t, type TreeSigningStartedEvent as u, TxTree as v, type TreeNoncesEvent as w, type BatchFinalizationEvent as x, type BatchFinalizedEvent as y, type BatchFailedEvent as z };
@@ -1,4 +1,4 @@
1
- import { a as TaskQueue, c as TaskItem, d as TaskResult } from './taskRunner-ChvV6Xrh.js';
1
+ import { c as TaskQueue, b as TaskItem, d as TaskResult } from './taskRunner-Cf80BqSy.js';
2
2
 
3
3
  /**
4
4
  * Minimal async key-value storage interface.
@@ -46,4 +46,4 @@ declare class AsyncStorageTaskQueue implements TaskQueue {
46
46
  private writeList;
47
47
  }
48
48
 
49
- export { AsyncStorageTaskQueue as A, type AsyncStorageLike as a };
49
+ export { type AsyncStorageLike as A, AsyncStorageTaskQueue as a };
@@ -1,4 +1,4 @@
1
- import { a as TaskQueue, c as TaskItem, d as TaskResult } from './taskRunner-C3YLaM2x.cjs';
1
+ import { c as TaskQueue, b as TaskItem, d as TaskResult } from './taskRunner-ClwI8jU8.cjs';
2
2
 
3
3
  /**
4
4
  * Minimal async key-value storage interface.
@@ -46,4 +46,4 @@ declare class AsyncStorageTaskQueue implements TaskQueue {
46
46
  private writeList;
47
47
  }
48
48
 
49
- export { AsyncStorageTaskQueue as A, type AsyncStorageLike as a };
49
+ export { type AsyncStorageLike as A, AsyncStorageTaskQueue as a };