@arkade-os/sdk 0.4.41 → 0.4.43

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 (69) hide show
  1. package/dist/adapters/expo.cjs +4 -4
  2. package/dist/adapters/expo.d.cts +2 -2
  3. package/dist/adapters/expo.d.ts +2 -2
  4. package/dist/adapters/expo.js +2 -2
  5. package/dist/adapters/indexedDB.cjs +3 -3
  6. package/dist/adapters/indexedDB.js +2 -2
  7. package/dist/{ark-CSqMJczW.d.cts → ark-I8jfe5VE.d.cts} +157 -2
  8. package/dist/{ark-CSqMJczW.d.ts → ark-I8jfe5VE.d.ts} +157 -2
  9. package/dist/{asyncStorageTaskQueue-SZPrhw23.d.ts → asyncStorageTaskQueue-CjoL-35w.d.ts} +1 -1
  10. package/dist/{asyncStorageTaskQueue-79XdGsdW.d.cts → asyncStorageTaskQueue-D1FfHfgK.d.cts} +1 -1
  11. package/dist/{chunk-ALISWEQ5.cjs → chunk-3AQNLQPM.cjs} +39 -4
  12. package/dist/chunk-3AQNLQPM.cjs.map +1 -0
  13. package/dist/{chunk-5XAYUPK4.js → chunk-763XHDAJ.js} +39 -5
  14. package/dist/chunk-763XHDAJ.js.map +1 -0
  15. package/dist/{chunk-D5MQYYYF.js → chunk-B4R36PRN.js} +1106 -357
  16. package/dist/chunk-B4R36PRN.js.map +1 -0
  17. package/dist/{chunk-KNASU3QI.cjs → chunk-JIWCE2IK.cjs} +7 -7
  18. package/dist/{chunk-KNASU3QI.cjs.map → chunk-JIWCE2IK.cjs.map} +1 -1
  19. package/dist/{chunk-WBF3FNS3.cjs → chunk-PLJZRIFZ.cjs} +11 -11
  20. package/dist/{chunk-WBF3FNS3.cjs.map → chunk-PLJZRIFZ.cjs.map} +1 -1
  21. package/dist/{chunk-3MPXMLP4.cjs → chunk-QGNTDGMN.cjs} +1190 -430
  22. package/dist/chunk-QGNTDGMN.cjs.map +1 -0
  23. package/dist/{chunk-MYI333YH.js → chunk-US274KZO.js} +3 -3
  24. package/dist/{chunk-MYI333YH.js.map → chunk-US274KZO.js.map} +1 -1
  25. package/dist/{chunk-DDG4RE5F.js → chunk-VKKLOT2E.js} +3 -3
  26. package/dist/{chunk-DDG4RE5F.js.map → chunk-VKKLOT2E.js.map} +1 -1
  27. package/dist/contracts/handlers/index.d.cts +3 -3
  28. package/dist/contracts/handlers/index.d.ts +3 -3
  29. package/dist/{delegate-Bqwe-kbj.d.cts → delegate-BRqbh2fW.d.cts} +1 -1
  30. package/dist/{delegate-BTn9BK8E.d.ts → delegate-CgjVjYOP.d.ts} +1 -1
  31. package/dist/{index-aYiHTMkX.d.cts → index-DHuXlDEg.d.cts} +2 -2
  32. package/dist/{index-kITujXlS.d.ts → index-DvWNB_rl.d.ts} +2 -2
  33. package/dist/index.cjs +150 -118
  34. package/dist/index.d.cts +113 -9
  35. package/dist/index.d.ts +113 -9
  36. package/dist/index.js +2 -2
  37. package/dist/repositories/realm/index.cjs +268 -12
  38. package/dist/repositories/realm/index.cjs.map +1 -1
  39. package/dist/repositories/realm/index.d.cts +101 -3
  40. package/dist/repositories/realm/index.d.ts +101 -3
  41. package/dist/repositories/realm/index.js +254 -4
  42. package/dist/repositories/realm/index.js.map +1 -1
  43. package/dist/repositories/sqlite/index.cjs +366 -40
  44. package/dist/repositories/sqlite/index.cjs.map +1 -1
  45. package/dist/repositories/sqlite/index.d.cts +52 -6
  46. package/dist/repositories/sqlite/index.d.ts +52 -6
  47. package/dist/repositories/sqlite/index.js +353 -32
  48. package/dist/repositories/sqlite/index.js.map +1 -1
  49. package/dist/{taskRunner-DRHElPMG.d.cts → taskRunner-BSnslNmq.d.cts} +1 -1
  50. package/dist/{taskRunner-BuBAZQwB.d.ts → taskRunner-Djlhfgi1.d.ts} +1 -1
  51. package/dist/wallet/expo/background.cjs +12 -12
  52. package/dist/wallet/expo/background.d.cts +3 -3
  53. package/dist/wallet/expo/background.d.ts +3 -3
  54. package/dist/wallet/expo/background.js +4 -4
  55. package/dist/wallet/expo/index.cjs +12 -12
  56. package/dist/wallet/expo/index.d.cts +4 -4
  57. package/dist/wallet/expo/index.d.ts +4 -4
  58. package/dist/wallet/expo/index.js +3 -3
  59. package/dist/{wallet-CTEQpKG9.d.ts → wallet-BsqRU8KM.d.cts} +29 -5
  60. package/dist/{wallet-BZgRfnAE.d.cts → wallet-D9z7wssl.d.ts} +29 -5
  61. package/dist/worker/expo/index.cjs +7 -7
  62. package/dist/worker/expo/index.d.cts +4 -4
  63. package/dist/worker/expo/index.d.ts +4 -4
  64. package/dist/worker/expo/index.js +3 -3
  65. package/package.json +2 -2
  66. package/dist/chunk-3MPXMLP4.cjs.map +0 -1
  67. package/dist/chunk-5XAYUPK4.js.map +0 -1
  68. package/dist/chunk-ALISWEQ5.cjs.map +0 -1
  69. package/dist/chunk-D5MQYYYF.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkWBF3FNS3_cjs = require('../chunk-WBF3FNS3.cjs');
4
- require('../chunk-ALISWEQ5.cjs');
3
+ var chunkPLJZRIFZ_cjs = require('../chunk-PLJZRIFZ.cjs');
4
+ require('../chunk-3AQNLQPM.cjs');
5
5
  require('../chunk-HXDZ2QTW.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 chunkWBF3FNS3_cjs.ExpoArkProvider; }
12
+ get: function () { return chunkPLJZRIFZ_cjs.ExpoArkProvider; }
13
13
  });
14
14
  Object.defineProperty(exports, "ExpoIndexerProvider", {
15
15
  enumerable: true,
16
- get: function () { return chunkWBF3FNS3_cjs.ExpoIndexerProvider; }
16
+ get: function () { return chunkPLJZRIFZ_cjs.ExpoIndexerProvider; }
17
17
  });
18
18
  //# sourceMappingURL=expo.cjs.map
19
19
  //# sourceMappingURL=expo.cjs.map
@@ -1,5 +1,5 @@
1
- import { l as RestArkProvider, j as SettlementEvent, T as TxNotification, m as RestIndexerProvider, n as SubscriptionResponse } from '../ark-CSqMJczW.cjs';
2
- export { o as ArkProvider, p as IndexerProvider } from '../ark-CSqMJczW.cjs';
1
+ import { l as RestArkProvider, j as SettlementEvent, T as TxNotification, m as RestIndexerProvider, n as SubscriptionResponse } from '../ark-I8jfe5VE.cjs';
2
+ export { o as ArkProvider, p as IndexerProvider } from '../ark-I8jfe5VE.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 { l as RestArkProvider, j as SettlementEvent, T as TxNotification, m as RestIndexerProvider, n as SubscriptionResponse } from '../ark-CSqMJczW.js';
2
- export { o as ArkProvider, p as IndexerProvider } from '../ark-CSqMJczW.js';
1
+ import { l as RestArkProvider, j as SettlementEvent, T as TxNotification, m as RestIndexerProvider, n as SubscriptionResponse } from '../ark-I8jfe5VE.js';
2
+ export { o as ArkProvider, p as IndexerProvider } from '../ark-I8jfe5VE.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-DDG4RE5F.js';
2
- import '../chunk-5XAYUPK4.js';
1
+ export { ExpoArkProvider, ExpoIndexerProvider } from '../chunk-VKKLOT2E.js';
2
+ import '../chunk-763XHDAJ.js';
3
3
  import '../chunk-BE5MUB7T.js';
4
4
  import '../chunk-NSBPE2FW.js';
5
5
  //# sourceMappingURL=expo.js.map
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunk3MPXMLP4_cjs = require('../chunk-3MPXMLP4.cjs');
4
- require('../chunk-ALISWEQ5.cjs');
3
+ var chunkQGNTDGMN_cjs = require('../chunk-QGNTDGMN.cjs');
4
+ require('../chunk-3AQNLQPM.cjs');
5
5
  require('../chunk-32YKLQPS.cjs');
6
6
  require('../chunk-HXDZ2QTW.cjs');
7
7
  require('../chunk-5BLDMQED.cjs');
@@ -11,7 +11,7 @@ var IndexedDBStorageAdapter = class {
11
11
  dbName;
12
12
  version;
13
13
  db = null;
14
- constructor(dbName, version = chunk3MPXMLP4_cjs.DB_VERSION) {
14
+ constructor(dbName, version = chunkQGNTDGMN_cjs.DB_VERSION) {
15
15
  this.dbName = dbName;
16
16
  this.version = version;
17
17
  }
@@ -1,5 +1,5 @@
1
- import { DB_VERSION } from '../chunk-D5MQYYYF.js';
2
- import '../chunk-5XAYUPK4.js';
1
+ import { DB_VERSION } from '../chunk-B4R36PRN.js';
2
+ import '../chunk-763XHDAJ.js';
3
3
  import '../chunk-YNEDJTX2.js';
4
4
  import '../chunk-BE5MUB7T.js';
5
5
  import '../chunk-NSBPE2FW.js';
@@ -965,6 +965,11 @@ interface IVtxoManager {
965
965
  * Available regardless of the `deprecatedSignerMigration` config flag (that
966
966
  * flag only gates the automatic poll-loop pass).
967
967
  *
968
+ * As a side effect, refreshes the wallet's cached deprecated-signer set from
969
+ * fresh server info, so a subsequent `settle()` correctly excludes EXPIRED
970
+ * deprecated-signer inputs. To refresh that filter without migrating, call
971
+ * `wallet.refreshDeprecatedSigners(await wallet.arkProvider.getInfo())` instead.
972
+ *
968
973
  * @returns A report of what was migrated, skipped, expired, or failed.
969
974
  */
970
975
  migrateDeprecatedSignerVtxos(options?: MigrateDeprecatedSignerOptions): Promise<DeprecatedSignerMigrationReport>;
@@ -1650,6 +1655,120 @@ interface ContractRepository extends AsyncDisposable {
1650
1655
  deleteContract(script: string): Promise<void>;
1651
1656
  }
1652
1657
 
1658
+ type ArkIntentState = "waiting_to_submit" | "waiting_for_batch" | "batch_in_progress" | "batch_failed" | "batch_succeeded" | "cancelled";
1659
+ declare const INTENT_TERMINAL_STATES: ReadonlySet<ArkIntentState>;
1660
+ declare function isTerminalIntentState(s: ArkIntentState): boolean;
1661
+ interface ArkIntent {
1662
+ /** Intent proof tx id. Primary key. */
1663
+ intentTxId: string;
1664
+ /**
1665
+ * Server-assigned batch intent id. Unique when present: saving a *different*
1666
+ * intentTxId that reuses a live intentId is rejected (NArk parity). Absent
1667
+ * until the intent is registered with arkd.
1668
+ */
1669
+ intentId?: string;
1670
+ state: ArkIntentState;
1671
+ validFrom?: number;
1672
+ validUntil?: number;
1673
+ createdAt: number;
1674
+ updatedAt: number;
1675
+ /** hex PSBT. */
1676
+ registerProof: string;
1677
+ /** canonical JSON signed by the register proof. */
1678
+ registerProofMessage: string;
1679
+ /** hex PSBT. */
1680
+ deleteProof: string;
1681
+ deleteProofMessage: string;
1682
+ batchId?: string;
1683
+ commitmentTransactionId?: string;
1684
+ cancellationReason?: string;
1685
+ partialForfeits: string[];
1686
+ signerDescriptor?: string;
1687
+ /** Input VTXOs locked by this intent. */
1688
+ intentVtxos: Outpoint[];
1689
+ }
1690
+ interface IntentFilter {
1691
+ intentTxIds?: string[];
1692
+ intentIds?: string[];
1693
+ /** Intents whose `intentVtxos` intersect any of these outpoints. */
1694
+ containingInputs?: Outpoint[];
1695
+ states?: ArkIntentState[];
1696
+ /** Intents valid at this ms-epoch instant (null bounds = open). */
1697
+ validAt?: number;
1698
+ /** Substring match over intentId, batchId, commitmentTransactionId. */
1699
+ searchText?: string;
1700
+ skip?: number;
1701
+ take?: number;
1702
+ }
1703
+ interface IntentRepository extends AsyncDisposable {
1704
+ readonly version: 1;
1705
+ clear(): Promise<void>;
1706
+ /** Upsert by `intentTxId`; implementation sets `updatedAt = Date.now()`. */
1707
+ saveIntent(intent: ArkIntent): Promise<void>;
1708
+ getIntents(filter?: IntentFilter): Promise<ArkIntent[]>;
1709
+ /**
1710
+ * Outpoints held by NON-terminal intents — `waiting_to_submit`,
1711
+ * `waiting_for_batch`, and `batch_in_progress` — to exclude from spendable
1712
+ * balance. Terminal states never lock.
1713
+ *
1714
+ * Deliberate divergence from NArk EF storage, whose `GetLockedVtxoOutpoints`
1715
+ * locks only `WaitingToSubmit`/`WaitingForBatch`: the TS wallet balance is
1716
+ * offline-first and reads this set as its single source of coin locking, so
1717
+ * it must also hold inputs already committed to an in-progress batch. NArk
1718
+ * excludes `BatchInProgress` here but protects those inputs through its
1719
+ * active-intent services instead.
1720
+ */
1721
+ getLockedVtxoOutpoints(): Promise<Outpoint[]>;
1722
+ }
1723
+
1724
+ /**
1725
+ * Type of a tx inside a VTXO's chain (commitment → leaf), as reported by
1726
+ * arkd's chain indexer. Values pinned verbatim from NArk `ChainedTxType.cs`.
1727
+ */
1728
+ declare enum ChainedTxType {
1729
+ Unspecified = 0,
1730
+ Commitment = 1,
1731
+ Ark = 2,
1732
+ Tree = 3,
1733
+ Checkpoint = 4
1734
+ }
1735
+ /** A single virtual transaction in the VTXO tree. */
1736
+ interface VirtualTx {
1737
+ /** Transaction id (hex). Primary key. */
1738
+ txid: string;
1739
+ /** Base64-encoded PSBT body; null when only metadata has been cached. */
1740
+ psbt: string | null;
1741
+ /** Operator pre-signature expiry, ms epoch; null if not applicable. */
1742
+ expiresAt: number | null;
1743
+ /** Tx type as reported by arkd's chain indexer. */
1744
+ type: ChainedTxType;
1745
+ }
1746
+ /**
1747
+ * Links a VTXO to one virtual tx in its exit branch, ordered.
1748
+ * `position` 0 = closest to commitment (tree root); higher = closer to leaf.
1749
+ */
1750
+ interface VtxoBranch {
1751
+ vtxoTxid: string;
1752
+ vtxoVout: number;
1753
+ virtualTxid: string;
1754
+ position: number;
1755
+ }
1756
+ interface VirtualTxRepository extends AsyncDisposable {
1757
+ readonly version: 1;
1758
+ clear(): Promise<void>;
1759
+ /** Upsert: non-null incoming fields overwrite; null (or, for `type`,
1760
+ * `Unspecified`) is treated as absent and preserves the stored value. */
1761
+ upsertVirtualTxs(txs: VirtualTx[]): Promise<void>;
1762
+ getVirtualTx(txid: string): Promise<VirtualTx | null>;
1763
+ /** Replace the entire stored branch for a VTXO. */
1764
+ setBranch(vtxo: Outpoint, branch: VtxoBranch[]): Promise<void>;
1765
+ /** Resolved virtual txs in the VTXO's branch, ordered by position asc. */
1766
+ getBranch(vtxo: Outpoint): Promise<VirtualTx[]>;
1767
+ hasBranch(vtxo: Outpoint): Promise<boolean>;
1768
+ /** Drop branch rows for a spent VTXO, then delete now-orphaned VirtualTx rows. */
1769
+ pruneForSpentVtxo(vtxo: Outpoint): Promise<void>;
1770
+ }
1771
+
1653
1772
  type RefreshVtxosOptions = {
1654
1773
  scripts?: string[];
1655
1774
  after?: number;
@@ -1877,6 +1996,13 @@ interface ContractManagerConfig {
1877
1996
  contractRepository: ContractRepository;
1878
1997
  /** The wallet repository for virtual output storage (single source of truth) */
1879
1998
  walletRepository: WalletRepository;
1999
+ /**
2000
+ * Optional intent store. When present, the online sync path reconciles
2001
+ * persisted non-terminal settlement intents against authoritative indexer
2002
+ * state (crash recovery) on boot and reconnect — see
2003
+ * {@link reconcileIntents}. Absent ⇒ no-op.
2004
+ */
2005
+ intentRepository?: IntentRepository;
1880
2006
  /** Watcher configuration */
1881
2007
  watcherConfig?: Partial<ContractWatcherConfig>;
1882
2008
  }
@@ -1963,6 +2089,15 @@ declare class ContractManager implements IContractManager {
1963
2089
  * outputs that could sit outside any delta window.
1964
2090
  */
1965
2091
  private reconcileWatched;
2092
+ /**
2093
+ * Crash-recovery for persisted settlement intents: reconcile any
2094
+ * non-terminal intent left behind by a mid-settle crash against
2095
+ * authoritative indexer state (see {@link reconcileIntents}). Runs on the
2096
+ * online sync path only — boot and subscription reconnect — never from a
2097
+ * wallet read API. Best-effort: intent recovery is not a sync invariant, so
2098
+ * a failure is logged and sync continues. No-op without an intent store.
2099
+ */
2100
+ private reconcileStaleIntents;
1966
2101
  /**
1967
2102
  * Create and register a new contract.
1968
2103
  *
@@ -3195,6 +3330,22 @@ type StorageConfig = {
3195
3330
  walletRepository: WalletRepository;
3196
3331
  /** Contract-state repository implementation. */
3197
3332
  contractRepository: ContractRepository;
3333
+ /**
3334
+ * Optional intent-lifecycle repository. Opt-in: when present, the wallet
3335
+ * persists settlement intents and excludes intent-locked VTXOs from
3336
+ * spendable balance. Absent ⇒ those code paths are no-ops.
3337
+ */
3338
+ intentRepository?: IntentRepository;
3339
+ /**
3340
+ * **Experimental / inert.** Optional virtual-tx (exit-branch) repository.
3341
+ * Today it is only a best-effort raw-PSBT cache that unilateral exit
3342
+ * ({@link Unroll}) reads and writes when a caller passes it to
3343
+ * `Unroll.Session.create`. Normal wallet/contract sync does NOT populate,
3344
+ * maintain, or prune it, and {@link ContractManager} is never given it —
3345
+ * branch/full-mode persistence is out of scope for this release. Treat this
3346
+ * option as experimental until those paths land. Absent ⇒ no-op.
3347
+ */
3348
+ virtualTxRepository?: VirtualTxRepository;
3198
3349
  };
3199
3350
  /**
3200
3351
  * Provider class constructor interface for dependency injection.
@@ -3233,7 +3384,11 @@ interface WalletBalance {
3233
3384
  settled: number;
3234
3385
  /** Spendable preconfirmed (unfinalized) balance. */
3235
3386
  preconfirmed: number;
3236
- /** Spendable offchain balance (`settled + preconfirmed`). */
3387
+ /**
3388
+ * Immediately spendable offchain balance: the `settled + preconfirmed`
3389
+ * rule applied only to VTXOs not locked by an in-flight (non-terminal)
3390
+ * intent. Equals `settled + preconfirmed` when nothing is intent-locked.
3391
+ */
3237
3392
  available: number;
3238
3393
  /** Recoverable balance from subdust or expired (swept) virtual outputs. */
3239
3394
  recoverable: number;
@@ -4539,4 +4694,4 @@ declare namespace ProtoTypes {
4539
4694
  export { };
4540
4695
  }
4541
4696
 
4542
- export { type Coin as $, type ArkTransaction as A, type BatchStartedEvent as B, type ContractRepository as C, type BatchFinalizationEvent as D, type ExtendedVirtualCoin as E, type BatchFinalizedEvent as F, type GetVtxosFilter as G, type BatchFailedEvent as H, type IWallet as I, type TreeTxEvent as J, type TreeSignatureEvent as K, type DescriptorProvider as L, type IReadonlyWallet as M, type ReadonlyIdentity as N, type Network as O, type OnchainProvider as P, type DelegateProvider as Q, type Recipient as R, type SendBitcoinParams as S, type TxNotification as T, type ReadonlyWalletConfig as U, VtxoScript as V, type WalletRepository as W, type IReadonlyAssetManager as X, type NetworkName as Y, type ArkInfo as Z, ArkAddress as _, type Identity as a, DelegatorManagerImpl as a$, ContractManager as a0, CSVMultisigTapscript as a1, type SettlementConfig as a2, VtxoManager as a3, type SignerSession as a4, type SignedIntent as a5, Intent as a6, type DescriptorSigningRequest as a7, Transaction as a8, type IntentFeeConfig as a9, type EncodedVtxoScript as aA, type Status as aB, type Outpoint as aC, type ChainTx as aD, type PathContext as aE, type ActivityIntent as aF, type ActivityResolver as aG, type ArkTapscript as aH, type Asset as aI, type AssetMetadata as aJ, type BaseWalletConfig as aK, type BatchInfo as aL, type BatchSignableIdentity as aM, CLTVMultisigTapscript as aN, ChainTxType as aO, type CommitmentTx as aP, ConditionCSVMultisigTapscript as aQ, ConditionMultisigTapscript as aR, type ContractBalance as aS, type ContractEventCallback as aT, type ContractHandler as aU, type ContractManagerConfig as aV, type ContractState as aW, type ContractVtxo as aX, ContractWatcher as aY, DelegateManagerImpl as aZ, type DelegateOptions as a_, type OffchainInput as aa, FeeAmount as ab, type OnchainInput as ac, type FeeOutput as ad, type ContractWatcherConfig as ae, type FeeInfo as af, type CreateContractParams as ag, type GetContractsFilter as ah, type GetSpendablePathsOptions as ai, type GetAllSpendingPathsOptions as aj, type IssuanceParams as ak, type ReissuanceParams as al, type BurnParams as am, type RenewVtxosOptions as an, type ContractWithVtxos as ao, type PathSelection as ap, type ContractEvent as aq, type AssetDetails as ar, type IssuanceResult as as, type DelegateInfo as at, type MigrationGlobalSkipReason as au, type MigrationLegSkipReason as av, type SignerStatus as aw, type StorageConfig as ax, type IVtxoManager as ay, type ExplorerTransaction as az, type WalletConfig as b, isSpendable as b$, type DelegatorProvider as b0, type DeprecatedSignerMigrationReport as b1, type DeprecatedSignerReport as b2, DigestMismatchError as b3, type Discoverable as b4, type DiscoveredContract as b5, type DiscoveryDeps as b6, ESPLORA_URL as b7, EsploraProvider as b8, type ExtendedContractVtxo as b9, type TapLeaves as bA, TapTreeCoder as bB, TapscriptType as bC, type TreeNonces as bD, type TreePartialSigs as bE, type Tx as bF, type TxHistoryRecord as bG, type TxKey as bH, type TxTreeNode as bI, TxType as bJ, type VirtualStatus as bK, type Vtxo as bL, type VtxoChain as bM, type VtxoType as bN, type WalletMode as bO, boardingResolver as bP, classifyAgainstSignerSet as bQ, classifyContractSigner as bR, createDefaultActivityRegistry as bS, decodeTapscript as bT, getNetwork as bU, getSequence as bV, isBatchSignable as bW, isCooperativelyMigratable as bX, isDiscoverable as bY, isExpired as bZ, isRecoverable as b_, type GroupMembership as ba, type HandlerError as bb, type IDelegatorManager as bc, IndexerTxType as bd, type KnownMetadata as be, type MigrateDeprecatedSignerOptions as bf, type MigrationLegReport as bg, type MigrationVtxoRef as bh, MultisigTapscript as bi, type Nonces as bj, type Output as bk, type PageResponse as bl, type PaginationOptions as bm, PartialSig as bn, type ProviderClass as bo, RestDelegateProvider as bp, RestDelegatorProvider as bq, type ScanContractsOptions as br, type ScanResult as bs, type ScheduledSession as bt, SettlementEventType as bu, type SignRequest as bv, type SignerClassification as bw, type SignerSet as bx, type SubscriptionEvent as by, type SubscriptionHeartbeat as bz, type WalletBalance as c, isSubdust as c0, isVtxoExpiringSoon as c1, networks as c2, signerSetFromInfo as c3, toXOnlySignerHex as c4, type ExtendedCoin as d, ActivityRegistry as e, type Activity as f, type IContractManager as g, type IDelegateManager as h, type SettleParams as i, type SettlementEvent as j, type IAssetManager as k, RestArkProvider as l, RestIndexerProvider as m, type SubscriptionResponse as n, type ArkProvider as o, type IndexerProvider as p, type RelativeTimelock as q, type TapLeafScript as r, type VirtualCoin as s, type Contract as t, type VtxoRepositoryKey as u, type WalletState as v, type ContractFilter as w, type TreeSigningStartedEvent as x, TxTree as y, type TreeNoncesEvent as z };
4697
+ export { ContractManager as $, type ArkTransaction as A, type BatchStartedEvent as B, type ContractRepository as C, type TreeTxEvent as D, type ExtendedVirtualCoin 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 DelegateProvider as L, type ReadonlyWalletConfig as M, type Network as N, type OnchainProvider as O, type IntentRepository as P, type VirtualTxRepository as Q, type Recipient as R, type SendBitcoinParams as S, type TxNotification as T, type IReadonlyAssetManager as U, VtxoScript as V, type WalletRepository as W, type NetworkName as X, type ArkInfo as Y, ArkAddress as Z, type Coin as _, type Identity as a, type ContractEventCallback as a$, CSVMultisigTapscript as a0, type SettlementConfig as a1, VtxoManager as a2, type SignerSession as a3, type SignedIntent as a4, Intent as a5, type VtxoRepositoryKey as a6, type WalletState as a7, type ContractFilter as a8, type ArkIntent as a9, type IssuanceResult as aA, type DelegateInfo as aB, type MigrationGlobalSkipReason as aC, type MigrationLegSkipReason as aD, type SignerStatus as aE, type StorageConfig as aF, type IVtxoManager as aG, type ExplorerTransaction as aH, type EncodedVtxoScript as aI, type Status as aJ, type ChainTx as aK, type PathContext as aL, type ActivityIntent as aM, type ActivityResolver as aN, type ArkIntentState as aO, type ArkTapscript as aP, type Asset as aQ, type AssetMetadata as aR, type BaseWalletConfig as aS, type BatchInfo as aT, type BatchSignableIdentity as aU, CLTVMultisigTapscript as aV, ChainTxType as aW, type CommitmentTx as aX, ConditionCSVMultisigTapscript as aY, ConditionMultisigTapscript as aZ, type ContractBalance as a_, type IntentFilter as aa, type Outpoint as ab, type VirtualTx as ac, type VtxoBranch as ad, ChainedTxType as ae, type DescriptorSigningRequest as af, Transaction as ag, type IntentFeeConfig as ah, type OffchainInput as ai, FeeAmount as aj, type OnchainInput as ak, type FeeOutput as al, type ContractWatcherConfig as am, type FeeInfo as an, type CreateContractParams as ao, type GetContractsFilter as ap, type GetSpendablePathsOptions as aq, type GetAllSpendingPathsOptions as ar, type IssuanceParams as as, type ReissuanceParams as at, type BurnParams as au, type RenewVtxosOptions as av, type ContractWithVtxos as aw, type PathSelection as ax, type ContractEvent as ay, type AssetDetails as az, type WalletConfig as b, createDefaultActivityRegistry as b$, type ContractHandler as b0, type ContractManagerConfig as b1, type ContractState as b2, type ContractVtxo as b3, ContractWatcher as b4, DelegateManagerImpl as b5, type DelegateOptions as b6, DelegatorManagerImpl as b7, type DelegatorProvider as b8, type DeprecatedSignerMigrationReport as b9, type ScanContractsOptions as bA, type ScanResult as bB, type ScheduledSession as bC, SettlementEventType as bD, type SignRequest as bE, type SignerClassification as bF, type SignerSet as bG, type SubscriptionEvent as bH, type SubscriptionHeartbeat as bI, type TapLeaves as bJ, TapTreeCoder as bK, TapscriptType as bL, type TreeNonces as bM, type TreePartialSigs as bN, type Tx as bO, type TxHistoryRecord as bP, type TxKey as bQ, type TxTreeNode as bR, TxType as bS, type VirtualStatus as bT, type Vtxo as bU, type VtxoChain as bV, type VtxoType as bW, type WalletMode as bX, boardingResolver as bY, classifyAgainstSignerSet as bZ, classifyContractSigner as b_, type DeprecatedSignerReport as ba, DigestMismatchError as bb, type Discoverable as bc, type DiscoveredContract as bd, type DiscoveryDeps as be, ESPLORA_URL as bf, EsploraProvider as bg, type ExtendedContractVtxo as bh, type GroupMembership as bi, type HandlerError as bj, type IDelegatorManager as bk, INTENT_TERMINAL_STATES as bl, IndexerTxType as bm, type KnownMetadata as bn, type MigrateDeprecatedSignerOptions as bo, type MigrationLegReport as bp, type MigrationVtxoRef as bq, MultisigTapscript as br, type Nonces as bs, type Output as bt, type PageResponse as bu, type PaginationOptions as bv, PartialSig as bw, type ProviderClass as bx, RestDelegateProvider as by, RestDelegatorProvider as bz, type WalletBalance as c, decodeTapscript as c0, getNetwork as c1, getSequence as c2, isBatchSignable as c3, isCooperativelyMigratable as c4, isDiscoverable as c5, isExpired as c6, isRecoverable as c7, isSpendable as c8, isSubdust as c9, isTerminalIntentState as ca, isVtxoExpiringSoon as cb, networks as cc, signerSetFromInfo as cd, toXOnlySignerHex as ce, type ExtendedCoin as d, ActivityRegistry as e, type Activity as f, type IContractManager as g, type IDelegateManager as h, type SettleParams as i, type SettlementEvent as j, type IAssetManager as k, RestArkProvider as l, RestIndexerProvider as m, type SubscriptionResponse as n, type ArkProvider as o, type IndexerProvider as p, type RelativeTimelock as q, type TapLeafScript as r, type VirtualCoin as s, type Contract 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 };
@@ -965,6 +965,11 @@ interface IVtxoManager {
965
965
  * Available regardless of the `deprecatedSignerMigration` config flag (that
966
966
  * flag only gates the automatic poll-loop pass).
967
967
  *
968
+ * As a side effect, refreshes the wallet's cached deprecated-signer set from
969
+ * fresh server info, so a subsequent `settle()` correctly excludes EXPIRED
970
+ * deprecated-signer inputs. To refresh that filter without migrating, call
971
+ * `wallet.refreshDeprecatedSigners(await wallet.arkProvider.getInfo())` instead.
972
+ *
968
973
  * @returns A report of what was migrated, skipped, expired, or failed.
969
974
  */
970
975
  migrateDeprecatedSignerVtxos(options?: MigrateDeprecatedSignerOptions): Promise<DeprecatedSignerMigrationReport>;
@@ -1650,6 +1655,120 @@ interface ContractRepository extends AsyncDisposable {
1650
1655
  deleteContract(script: string): Promise<void>;
1651
1656
  }
1652
1657
 
1658
+ type ArkIntentState = "waiting_to_submit" | "waiting_for_batch" | "batch_in_progress" | "batch_failed" | "batch_succeeded" | "cancelled";
1659
+ declare const INTENT_TERMINAL_STATES: ReadonlySet<ArkIntentState>;
1660
+ declare function isTerminalIntentState(s: ArkIntentState): boolean;
1661
+ interface ArkIntent {
1662
+ /** Intent proof tx id. Primary key. */
1663
+ intentTxId: string;
1664
+ /**
1665
+ * Server-assigned batch intent id. Unique when present: saving a *different*
1666
+ * intentTxId that reuses a live intentId is rejected (NArk parity). Absent
1667
+ * until the intent is registered with arkd.
1668
+ */
1669
+ intentId?: string;
1670
+ state: ArkIntentState;
1671
+ validFrom?: number;
1672
+ validUntil?: number;
1673
+ createdAt: number;
1674
+ updatedAt: number;
1675
+ /** hex PSBT. */
1676
+ registerProof: string;
1677
+ /** canonical JSON signed by the register proof. */
1678
+ registerProofMessage: string;
1679
+ /** hex PSBT. */
1680
+ deleteProof: string;
1681
+ deleteProofMessage: string;
1682
+ batchId?: string;
1683
+ commitmentTransactionId?: string;
1684
+ cancellationReason?: string;
1685
+ partialForfeits: string[];
1686
+ signerDescriptor?: string;
1687
+ /** Input VTXOs locked by this intent. */
1688
+ intentVtxos: Outpoint[];
1689
+ }
1690
+ interface IntentFilter {
1691
+ intentTxIds?: string[];
1692
+ intentIds?: string[];
1693
+ /** Intents whose `intentVtxos` intersect any of these outpoints. */
1694
+ containingInputs?: Outpoint[];
1695
+ states?: ArkIntentState[];
1696
+ /** Intents valid at this ms-epoch instant (null bounds = open). */
1697
+ validAt?: number;
1698
+ /** Substring match over intentId, batchId, commitmentTransactionId. */
1699
+ searchText?: string;
1700
+ skip?: number;
1701
+ take?: number;
1702
+ }
1703
+ interface IntentRepository extends AsyncDisposable {
1704
+ readonly version: 1;
1705
+ clear(): Promise<void>;
1706
+ /** Upsert by `intentTxId`; implementation sets `updatedAt = Date.now()`. */
1707
+ saveIntent(intent: ArkIntent): Promise<void>;
1708
+ getIntents(filter?: IntentFilter): Promise<ArkIntent[]>;
1709
+ /**
1710
+ * Outpoints held by NON-terminal intents — `waiting_to_submit`,
1711
+ * `waiting_for_batch`, and `batch_in_progress` — to exclude from spendable
1712
+ * balance. Terminal states never lock.
1713
+ *
1714
+ * Deliberate divergence from NArk EF storage, whose `GetLockedVtxoOutpoints`
1715
+ * locks only `WaitingToSubmit`/`WaitingForBatch`: the TS wallet balance is
1716
+ * offline-first and reads this set as its single source of coin locking, so
1717
+ * it must also hold inputs already committed to an in-progress batch. NArk
1718
+ * excludes `BatchInProgress` here but protects those inputs through its
1719
+ * active-intent services instead.
1720
+ */
1721
+ getLockedVtxoOutpoints(): Promise<Outpoint[]>;
1722
+ }
1723
+
1724
+ /**
1725
+ * Type of a tx inside a VTXO's chain (commitment → leaf), as reported by
1726
+ * arkd's chain indexer. Values pinned verbatim from NArk `ChainedTxType.cs`.
1727
+ */
1728
+ declare enum ChainedTxType {
1729
+ Unspecified = 0,
1730
+ Commitment = 1,
1731
+ Ark = 2,
1732
+ Tree = 3,
1733
+ Checkpoint = 4
1734
+ }
1735
+ /** A single virtual transaction in the VTXO tree. */
1736
+ interface VirtualTx {
1737
+ /** Transaction id (hex). Primary key. */
1738
+ txid: string;
1739
+ /** Base64-encoded PSBT body; null when only metadata has been cached. */
1740
+ psbt: string | null;
1741
+ /** Operator pre-signature expiry, ms epoch; null if not applicable. */
1742
+ expiresAt: number | null;
1743
+ /** Tx type as reported by arkd's chain indexer. */
1744
+ type: ChainedTxType;
1745
+ }
1746
+ /**
1747
+ * Links a VTXO to one virtual tx in its exit branch, ordered.
1748
+ * `position` 0 = closest to commitment (tree root); higher = closer to leaf.
1749
+ */
1750
+ interface VtxoBranch {
1751
+ vtxoTxid: string;
1752
+ vtxoVout: number;
1753
+ virtualTxid: string;
1754
+ position: number;
1755
+ }
1756
+ interface VirtualTxRepository extends AsyncDisposable {
1757
+ readonly version: 1;
1758
+ clear(): Promise<void>;
1759
+ /** Upsert: non-null incoming fields overwrite; null (or, for `type`,
1760
+ * `Unspecified`) is treated as absent and preserves the stored value. */
1761
+ upsertVirtualTxs(txs: VirtualTx[]): Promise<void>;
1762
+ getVirtualTx(txid: string): Promise<VirtualTx | null>;
1763
+ /** Replace the entire stored branch for a VTXO. */
1764
+ setBranch(vtxo: Outpoint, branch: VtxoBranch[]): Promise<void>;
1765
+ /** Resolved virtual txs in the VTXO's branch, ordered by position asc. */
1766
+ getBranch(vtxo: Outpoint): Promise<VirtualTx[]>;
1767
+ hasBranch(vtxo: Outpoint): Promise<boolean>;
1768
+ /** Drop branch rows for a spent VTXO, then delete now-orphaned VirtualTx rows. */
1769
+ pruneForSpentVtxo(vtxo: Outpoint): Promise<void>;
1770
+ }
1771
+
1653
1772
  type RefreshVtxosOptions = {
1654
1773
  scripts?: string[];
1655
1774
  after?: number;
@@ -1877,6 +1996,13 @@ interface ContractManagerConfig {
1877
1996
  contractRepository: ContractRepository;
1878
1997
  /** The wallet repository for virtual output storage (single source of truth) */
1879
1998
  walletRepository: WalletRepository;
1999
+ /**
2000
+ * Optional intent store. When present, the online sync path reconciles
2001
+ * persisted non-terminal settlement intents against authoritative indexer
2002
+ * state (crash recovery) on boot and reconnect — see
2003
+ * {@link reconcileIntents}. Absent ⇒ no-op.
2004
+ */
2005
+ intentRepository?: IntentRepository;
1880
2006
  /** Watcher configuration */
1881
2007
  watcherConfig?: Partial<ContractWatcherConfig>;
1882
2008
  }
@@ -1963,6 +2089,15 @@ declare class ContractManager implements IContractManager {
1963
2089
  * outputs that could sit outside any delta window.
1964
2090
  */
1965
2091
  private reconcileWatched;
2092
+ /**
2093
+ * Crash-recovery for persisted settlement intents: reconcile any
2094
+ * non-terminal intent left behind by a mid-settle crash against
2095
+ * authoritative indexer state (see {@link reconcileIntents}). Runs on the
2096
+ * online sync path only — boot and subscription reconnect — never from a
2097
+ * wallet read API. Best-effort: intent recovery is not a sync invariant, so
2098
+ * a failure is logged and sync continues. No-op without an intent store.
2099
+ */
2100
+ private reconcileStaleIntents;
1966
2101
  /**
1967
2102
  * Create and register a new contract.
1968
2103
  *
@@ -3195,6 +3330,22 @@ type StorageConfig = {
3195
3330
  walletRepository: WalletRepository;
3196
3331
  /** Contract-state repository implementation. */
3197
3332
  contractRepository: ContractRepository;
3333
+ /**
3334
+ * Optional intent-lifecycle repository. Opt-in: when present, the wallet
3335
+ * persists settlement intents and excludes intent-locked VTXOs from
3336
+ * spendable balance. Absent ⇒ those code paths are no-ops.
3337
+ */
3338
+ intentRepository?: IntentRepository;
3339
+ /**
3340
+ * **Experimental / inert.** Optional virtual-tx (exit-branch) repository.
3341
+ * Today it is only a best-effort raw-PSBT cache that unilateral exit
3342
+ * ({@link Unroll}) reads and writes when a caller passes it to
3343
+ * `Unroll.Session.create`. Normal wallet/contract sync does NOT populate,
3344
+ * maintain, or prune it, and {@link ContractManager} is never given it —
3345
+ * branch/full-mode persistence is out of scope for this release. Treat this
3346
+ * option as experimental until those paths land. Absent ⇒ no-op.
3347
+ */
3348
+ virtualTxRepository?: VirtualTxRepository;
3198
3349
  };
3199
3350
  /**
3200
3351
  * Provider class constructor interface for dependency injection.
@@ -3233,7 +3384,11 @@ interface WalletBalance {
3233
3384
  settled: number;
3234
3385
  /** Spendable preconfirmed (unfinalized) balance. */
3235
3386
  preconfirmed: number;
3236
- /** Spendable offchain balance (`settled + preconfirmed`). */
3387
+ /**
3388
+ * Immediately spendable offchain balance: the `settled + preconfirmed`
3389
+ * rule applied only to VTXOs not locked by an in-flight (non-terminal)
3390
+ * intent. Equals `settled + preconfirmed` when nothing is intent-locked.
3391
+ */
3237
3392
  available: number;
3238
3393
  /** Recoverable balance from subdust or expired (swept) virtual outputs. */
3239
3394
  recoverable: number;
@@ -4539,4 +4694,4 @@ declare namespace ProtoTypes {
4539
4694
  export { };
4540
4695
  }
4541
4696
 
4542
- export { type Coin as $, type ArkTransaction as A, type BatchStartedEvent as B, type ContractRepository as C, type BatchFinalizationEvent as D, type ExtendedVirtualCoin as E, type BatchFinalizedEvent as F, type GetVtxosFilter as G, type BatchFailedEvent as H, type IWallet as I, type TreeTxEvent as J, type TreeSignatureEvent as K, type DescriptorProvider as L, type IReadonlyWallet as M, type ReadonlyIdentity as N, type Network as O, type OnchainProvider as P, type DelegateProvider as Q, type Recipient as R, type SendBitcoinParams as S, type TxNotification as T, type ReadonlyWalletConfig as U, VtxoScript as V, type WalletRepository as W, type IReadonlyAssetManager as X, type NetworkName as Y, type ArkInfo as Z, ArkAddress as _, type Identity as a, DelegatorManagerImpl as a$, ContractManager as a0, CSVMultisigTapscript as a1, type SettlementConfig as a2, VtxoManager as a3, type SignerSession as a4, type SignedIntent as a5, Intent as a6, type DescriptorSigningRequest as a7, Transaction as a8, type IntentFeeConfig as a9, type EncodedVtxoScript as aA, type Status as aB, type Outpoint as aC, type ChainTx as aD, type PathContext as aE, type ActivityIntent as aF, type ActivityResolver as aG, type ArkTapscript as aH, type Asset as aI, type AssetMetadata as aJ, type BaseWalletConfig as aK, type BatchInfo as aL, type BatchSignableIdentity as aM, CLTVMultisigTapscript as aN, ChainTxType as aO, type CommitmentTx as aP, ConditionCSVMultisigTapscript as aQ, ConditionMultisigTapscript as aR, type ContractBalance as aS, type ContractEventCallback as aT, type ContractHandler as aU, type ContractManagerConfig as aV, type ContractState as aW, type ContractVtxo as aX, ContractWatcher as aY, DelegateManagerImpl as aZ, type DelegateOptions as a_, type OffchainInput as aa, FeeAmount as ab, type OnchainInput as ac, type FeeOutput as ad, type ContractWatcherConfig as ae, type FeeInfo as af, type CreateContractParams as ag, type GetContractsFilter as ah, type GetSpendablePathsOptions as ai, type GetAllSpendingPathsOptions as aj, type IssuanceParams as ak, type ReissuanceParams as al, type BurnParams as am, type RenewVtxosOptions as an, type ContractWithVtxos as ao, type PathSelection as ap, type ContractEvent as aq, type AssetDetails as ar, type IssuanceResult as as, type DelegateInfo as at, type MigrationGlobalSkipReason as au, type MigrationLegSkipReason as av, type SignerStatus as aw, type StorageConfig as ax, type IVtxoManager as ay, type ExplorerTransaction as az, type WalletConfig as b, isSpendable as b$, type DelegatorProvider as b0, type DeprecatedSignerMigrationReport as b1, type DeprecatedSignerReport as b2, DigestMismatchError as b3, type Discoverable as b4, type DiscoveredContract as b5, type DiscoveryDeps as b6, ESPLORA_URL as b7, EsploraProvider as b8, type ExtendedContractVtxo as b9, type TapLeaves as bA, TapTreeCoder as bB, TapscriptType as bC, type TreeNonces as bD, type TreePartialSigs as bE, type Tx as bF, type TxHistoryRecord as bG, type TxKey as bH, type TxTreeNode as bI, TxType as bJ, type VirtualStatus as bK, type Vtxo as bL, type VtxoChain as bM, type VtxoType as bN, type WalletMode as bO, boardingResolver as bP, classifyAgainstSignerSet as bQ, classifyContractSigner as bR, createDefaultActivityRegistry as bS, decodeTapscript as bT, getNetwork as bU, getSequence as bV, isBatchSignable as bW, isCooperativelyMigratable as bX, isDiscoverable as bY, isExpired as bZ, isRecoverable as b_, type GroupMembership as ba, type HandlerError as bb, type IDelegatorManager as bc, IndexerTxType as bd, type KnownMetadata as be, type MigrateDeprecatedSignerOptions as bf, type MigrationLegReport as bg, type MigrationVtxoRef as bh, MultisigTapscript as bi, type Nonces as bj, type Output as bk, type PageResponse as bl, type PaginationOptions as bm, PartialSig as bn, type ProviderClass as bo, RestDelegateProvider as bp, RestDelegatorProvider as bq, type ScanContractsOptions as br, type ScanResult as bs, type ScheduledSession as bt, SettlementEventType as bu, type SignRequest as bv, type SignerClassification as bw, type SignerSet as bx, type SubscriptionEvent as by, type SubscriptionHeartbeat as bz, type WalletBalance as c, isSubdust as c0, isVtxoExpiringSoon as c1, networks as c2, signerSetFromInfo as c3, toXOnlySignerHex as c4, type ExtendedCoin as d, ActivityRegistry as e, type Activity as f, type IContractManager as g, type IDelegateManager as h, type SettleParams as i, type SettlementEvent as j, type IAssetManager as k, RestArkProvider as l, RestIndexerProvider as m, type SubscriptionResponse as n, type ArkProvider as o, type IndexerProvider as p, type RelativeTimelock as q, type TapLeafScript as r, type VirtualCoin as s, type Contract as t, type VtxoRepositoryKey as u, type WalletState as v, type ContractFilter as w, type TreeSigningStartedEvent as x, TxTree as y, type TreeNoncesEvent as z };
4697
+ export { ContractManager as $, type ArkTransaction as A, type BatchStartedEvent as B, type ContractRepository as C, type TreeTxEvent as D, type ExtendedVirtualCoin 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 DelegateProvider as L, type ReadonlyWalletConfig as M, type Network as N, type OnchainProvider as O, type IntentRepository as P, type VirtualTxRepository as Q, type Recipient as R, type SendBitcoinParams as S, type TxNotification as T, type IReadonlyAssetManager as U, VtxoScript as V, type WalletRepository as W, type NetworkName as X, type ArkInfo as Y, ArkAddress as Z, type Coin as _, type Identity as a, type ContractEventCallback as a$, CSVMultisigTapscript as a0, type SettlementConfig as a1, VtxoManager as a2, type SignerSession as a3, type SignedIntent as a4, Intent as a5, type VtxoRepositoryKey as a6, type WalletState as a7, type ContractFilter as a8, type ArkIntent as a9, type IssuanceResult as aA, type DelegateInfo as aB, type MigrationGlobalSkipReason as aC, type MigrationLegSkipReason as aD, type SignerStatus as aE, type StorageConfig as aF, type IVtxoManager as aG, type ExplorerTransaction as aH, type EncodedVtxoScript as aI, type Status as aJ, type ChainTx as aK, type PathContext as aL, type ActivityIntent as aM, type ActivityResolver as aN, type ArkIntentState as aO, type ArkTapscript as aP, type Asset as aQ, type AssetMetadata as aR, type BaseWalletConfig as aS, type BatchInfo as aT, type BatchSignableIdentity as aU, CLTVMultisigTapscript as aV, ChainTxType as aW, type CommitmentTx as aX, ConditionCSVMultisigTapscript as aY, ConditionMultisigTapscript as aZ, type ContractBalance as a_, type IntentFilter as aa, type Outpoint as ab, type VirtualTx as ac, type VtxoBranch as ad, ChainedTxType as ae, type DescriptorSigningRequest as af, Transaction as ag, type IntentFeeConfig as ah, type OffchainInput as ai, FeeAmount as aj, type OnchainInput as ak, type FeeOutput as al, type ContractWatcherConfig as am, type FeeInfo as an, type CreateContractParams as ao, type GetContractsFilter as ap, type GetSpendablePathsOptions as aq, type GetAllSpendingPathsOptions as ar, type IssuanceParams as as, type ReissuanceParams as at, type BurnParams as au, type RenewVtxosOptions as av, type ContractWithVtxos as aw, type PathSelection as ax, type ContractEvent as ay, type AssetDetails as az, type WalletConfig as b, createDefaultActivityRegistry as b$, type ContractHandler as b0, type ContractManagerConfig as b1, type ContractState as b2, type ContractVtxo as b3, ContractWatcher as b4, DelegateManagerImpl as b5, type DelegateOptions as b6, DelegatorManagerImpl as b7, type DelegatorProvider as b8, type DeprecatedSignerMigrationReport as b9, type ScanContractsOptions as bA, type ScanResult as bB, type ScheduledSession as bC, SettlementEventType as bD, type SignRequest as bE, type SignerClassification as bF, type SignerSet as bG, type SubscriptionEvent as bH, type SubscriptionHeartbeat as bI, type TapLeaves as bJ, TapTreeCoder as bK, TapscriptType as bL, type TreeNonces as bM, type TreePartialSigs as bN, type Tx as bO, type TxHistoryRecord as bP, type TxKey as bQ, type TxTreeNode as bR, TxType as bS, type VirtualStatus as bT, type Vtxo as bU, type VtxoChain as bV, type VtxoType as bW, type WalletMode as bX, boardingResolver as bY, classifyAgainstSignerSet as bZ, classifyContractSigner as b_, type DeprecatedSignerReport as ba, DigestMismatchError as bb, type Discoverable as bc, type DiscoveredContract as bd, type DiscoveryDeps as be, ESPLORA_URL as bf, EsploraProvider as bg, type ExtendedContractVtxo as bh, type GroupMembership as bi, type HandlerError as bj, type IDelegatorManager as bk, INTENT_TERMINAL_STATES as bl, IndexerTxType as bm, type KnownMetadata as bn, type MigrateDeprecatedSignerOptions as bo, type MigrationLegReport as bp, type MigrationVtxoRef as bq, MultisigTapscript as br, type Nonces as bs, type Output as bt, type PageResponse as bu, type PaginationOptions as bv, PartialSig as bw, type ProviderClass as bx, RestDelegateProvider as by, RestDelegatorProvider as bz, type WalletBalance as c, decodeTapscript as c0, getNetwork as c1, getSequence as c2, isBatchSignable as c3, isCooperativelyMigratable as c4, isDiscoverable as c5, isExpired as c6, isRecoverable as c7, isSpendable as c8, isSubdust as c9, isTerminalIntentState as ca, isVtxoExpiringSoon as cb, networks as cc, signerSetFromInfo as cd, toXOnlySignerHex as ce, type ExtendedCoin as d, ActivityRegistry as e, type Activity as f, type IContractManager as g, type IDelegateManager as h, type SettleParams as i, type SettlementEvent as j, type IAssetManager as k, RestArkProvider as l, RestIndexerProvider as m, type SubscriptionResponse as n, type ArkProvider as o, type IndexerProvider as p, type RelativeTimelock as q, type TapLeafScript as r, type VirtualCoin as s, type Contract 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-BuBAZQwB.js';
1
+ import { a as TaskQueue, c as TaskItem, d as TaskResult } from './taskRunner-Djlhfgi1.js';
2
2
 
3
3
  /**
4
4
  * Minimal async key-value storage interface.
@@ -1,4 +1,4 @@
1
- import { a as TaskQueue, c as TaskItem, d as TaskResult } from './taskRunner-DRHElPMG.cjs';
1
+ import { a as TaskQueue, c as TaskItem, d as TaskResult } from './taskRunner-BSnslNmq.cjs';
2
2
 
3
3
  /**
4
4
  * Minimal async key-value storage interface.
@@ -351,16 +351,31 @@ function prepareCoinAsIntentProofInput(coin) {
351
351
  }
352
352
 
353
353
  // package.json
354
- var version = "0.4.41";
354
+ var version = "0.4.43";
355
355
 
356
356
  // src/utils/fetch.ts
357
357
  var buildVersion = "0.9.9";
358
358
  var sdkVersion = `ts-sdk/${version}`;
359
+ var FetchError = class extends Error {
360
+ /** The request URL that failed, when derivable from the `fetch` input. */
361
+ url;
362
+ /** The HTTP method of the failed request (defaults to `"GET"`). */
363
+ method;
364
+ constructor(message, options) {
365
+ super(message, { cause: options.cause });
366
+ this.name = "FetchError";
367
+ this.url = options.url;
368
+ this.method = options.method;
369
+ }
370
+ };
359
371
  function baseFetch(input, init) {
360
372
  if (typeof globalThis.fetch !== "function") {
361
373
  throw new Error("Fetch API is not available in this environment.");
362
374
  }
363
- return globalThis.fetch(input, init);
375
+ return globalThis.fetch(input, init).catch((cause) => {
376
+ const { url, method } = describeRequest(input, init);
377
+ throw new FetchError(`Network request failed: ${method} ${url}`, { url, method, cause });
378
+ });
364
379
  }
365
380
  function fetch(input, init) {
366
381
  const headers = new Headers(init?.headers);
@@ -368,6 +383,25 @@ function fetch(input, init) {
368
383
  headers.set("X-SDK-VERSION", sdkVersion);
369
384
  return baseFetch(input, { ...init, headers });
370
385
  }
386
+ function describeRequest(input, init) {
387
+ let url;
388
+ if (typeof input === "string") {
389
+ url = input;
390
+ } else if (input instanceof URL) {
391
+ url = input.href;
392
+ } else {
393
+ url = input.url;
394
+ }
395
+ let method;
396
+ if (init?.method !== void 0) {
397
+ method = init.method;
398
+ } else if (input instanceof Request) {
399
+ method = input.method;
400
+ } else {
401
+ method = "GET";
402
+ }
403
+ return { url, method };
404
+ }
371
405
 
372
406
  // src/providers/utils.ts
373
407
  function createAbortError() {
@@ -2788,6 +2822,7 @@ exports.ChainTxType = ChainTxType;
2788
2822
  exports.ConditionWitness = ConditionWitness;
2789
2823
  exports.CosignerPublicKey = CosignerPublicKey;
2790
2824
  exports.DigestMismatchError = DigestMismatchError;
2825
+ exports.FetchError = FetchError;
2791
2826
  exports.IndexerTxType = IndexerTxType;
2792
2827
  exports.Metadata = Metadata;
2793
2828
  exports.OP_RETURN_EMPTY_PKSCRIPT = OP_RETURN_EMPTY_PKSCRIPT;
@@ -2809,5 +2844,5 @@ exports.isFetchTimeoutError = isFetchTimeoutError;
2809
2844
  exports.maybeArkError = maybeArkError;
2810
2845
  exports.sdkVersion = sdkVersion;
2811
2846
  exports.setArkPsbtField = setArkPsbtField;
2812
- //# sourceMappingURL=chunk-ALISWEQ5.cjs.map
2813
- //# sourceMappingURL=chunk-ALISWEQ5.cjs.map
2847
+ //# sourceMappingURL=chunk-3AQNLQPM.cjs.map
2848
+ //# sourceMappingURL=chunk-3AQNLQPM.cjs.map