@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
package/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
1
- import { N as ReadonlyIdentity, a as Identity, a7 as DescriptorSigningRequest, a8 as Transaction, a4 as SignerSession, W as WalletRepository, E as ExtendedVirtualCoin, u as VtxoRepositoryKey, d as ExtendedCoin, A as ArkTransaction, v as WalletState, t as Contract, C as ContractRepository, w as ContractFilter, a9 as IntentFeeConfig, aa as OffchainInput, ab as FeeAmount, ac as OnchainInput, ad as FeeOutput, o as ArkProvider, a2 as SettlementConfig, ae as ContractWatcherConfig, I as IWallet, af as FeeInfo, j as SettlementEvent, L as DescriptorProvider, i as SettleParams, S as SendBitcoinParams, G as GetVtxosFilter, ag as CreateContractParams, ah as GetContractsFilter, s as VirtualCoin, ai as GetSpendablePathsOptions, aj as GetAllSpendingPathsOptions, R as Recipient, ak as IssuanceParams, al as ReissuanceParams, am as BurnParams, an as RenewVtxosOptions, c as WalletBalance, ao as ContractWithVtxos, ap as PathSelection, aq as ContractEvent, ar as AssetDetails, as as IssuanceResult, at as DelegateInfo, au as MigrationGlobalSkipReason, av as MigrationLegSkipReason, aw as SignerStatus, M as IReadonlyWallet, e as ActivityRegistry, X as IReadonlyAssetManager, ax as StorageConfig, f as Activity, g as IContractManager, k as IAssetManager, h as IDelegateManager, ay as IVtxoManager, P as OnchainProvider, O as Network, Y as NetworkName, $ as Coin, az as ExplorerTransaction, r as TapLeafScript, aA as EncodedVtxoScript, a1 as CSVMultisigTapscript, q as RelativeTimelock, V as VtxoScript, aB as Status, aC as Outpoint, aD as ChainTx, p as IndexerProvider, y as TxTree, aE as PathContext } from './ark-CSqMJczW.cjs';
2
- export { aF as ActivityIntent, aG as ActivityResolver, _ as ArkAddress, Z as ArkInfo, aH as ArkTapscript, aI as Asset, aJ as AssetMetadata, aK as BaseWalletConfig, H as BatchFailedEvent, D as BatchFinalizationEvent, F as BatchFinalizedEvent, aL as BatchInfo, aM as BatchSignableIdentity, B as BatchStartedEvent, aN as CLTVMultisigTapscript, aO as ChainTxType, aP as CommitmentTx, aQ as ConditionCSVMultisigTapscript, aR as ConditionMultisigTapscript, aS as ContractBalance, aT as ContractEventCallback, aU as ContractHandler, a0 as ContractManager, aV as ContractManagerConfig, aW as ContractState, aX as ContractVtxo, aY as ContractWatcher, aZ as DelegateManagerImpl, a_ as DelegateOptions, Q as DelegateProvider, a$ as DelegatorManagerImpl, b0 as DelegatorProvider, b1 as DeprecatedSignerMigrationReport, b2 as DeprecatedSignerReport, b3 as DigestMismatchError, b4 as Discoverable, b5 as DiscoveredContract, b6 as DiscoveryDeps, b7 as ESPLORA_URL, b8 as EsploraProvider, b9 as ExtendedContractVtxo, ba as GroupMembership, bb as HandlerError, bc as IDelegatorManager, bd as IndexerTxType, a6 as Intent, be as KnownMetadata, bf as MigrateDeprecatedSignerOptions, bg as MigrationLegReport, bh as MigrationVtxoRef, bi as MultisigTapscript, bj as Nonces, bk as Output, bl as PageResponse, bm as PaginationOptions, bn as PartialSig, bo as ProviderClass, U as ReadonlyWalletConfig, l as RestArkProvider, bp as RestDelegateProvider, bq as RestDelegatorProvider, m as RestIndexerProvider, br as ScanContractsOptions, bs as ScanResult, bt as ScheduledSession, bu as SettlementEventType, bv as SignRequest, a5 as SignedIntent, bw as SignerClassification, bx as SignerSet, by as SubscriptionEvent, bz as SubscriptionHeartbeat, n as SubscriptionResponse, bA as TapLeaves, bB as TapTreeCoder, bC as TapscriptType, bD as TreeNonces, z as TreeNoncesEvent, bE as TreePartialSigs, K as TreeSignatureEvent, x as TreeSigningStartedEvent, J as TreeTxEvent, bF as Tx, bG as TxHistoryRecord, bH as TxKey, T as TxNotification, bI as TxTreeNode, bJ as TxType, bK as VirtualStatus, bL as Vtxo, bM as VtxoChain, a3 as VtxoManager, bN as VtxoType, b as WalletConfig, bO as WalletMode, bP as boardingResolver, bQ as classifyAgainstSignerSet, bR as classifyContractSigner, bS as createDefaultActivityRegistry, bT as decodeTapscript, bU as getNetwork, bV as getSequence, bW as isBatchSignable, bX as isCooperativelyMigratable, bY as isDiscoverable, bZ as isExpired, b_ as isRecoverable, b$ as isSpendable, c0 as isSubdust, c1 as isVtxoExpiringSoon, c2 as networks, c3 as signerSetFromInfo, c4 as toXOnlySignerHex } from './ark-CSqMJczW.cjs';
3
- export { B as BoardingContractHandler, a as BoardingContractParams, D as DefaultContractHandler, b as DefaultContractParams, c as DelegateContractHandler, d as DelegateContractParams, V as VHTLC, e as VHTLCContractHandler, f as VHTLCContractParams, g as contractHandlers } from './index-aYiHTMkX.cjs';
4
- export { D as DefaultVtxo, a as DelegateVtxo } from './delegate-Bqwe-kbj.cjs';
5
- import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot } from './wallet-BZgRfnAE.cjs';
6
- export { B as Batch, d as BoardingUtxoGroup, I as IncomingFunds, w as waitForIncomingFunds } from './wallet-BZgRfnAE.cjs';
1
+ import { K as ReadonlyIdentity, a as Identity, af as DescriptorSigningRequest, ag as Transaction, a3 as SignerSession, P as IntentRepository, a9 as ArkIntent, aa as IntentFilter, ab as Outpoint, Q as VirtualTxRepository, ac as VirtualTx, ad as VtxoBranch, W as WalletRepository, E as ExtendedVirtualCoin, a6 as VtxoRepositoryKey, d as ExtendedCoin, A as ArkTransaction, a7 as WalletState, t as Contract, C as ContractRepository, a8 as ContractFilter, ah as IntentFeeConfig, ai as OffchainInput, aj as FeeAmount, ak as OnchainInput, al as FeeOutput, o as ArkProvider, a1 as SettlementConfig, am as ContractWatcherConfig, I as IWallet, an as FeeInfo, j as SettlementEvent, H as DescriptorProvider, i as SettleParams, S as SendBitcoinParams, G as GetVtxosFilter, ao as CreateContractParams, ap as GetContractsFilter, s as VirtualCoin, aq as GetSpendablePathsOptions, ar as GetAllSpendingPathsOptions, R as Recipient, as as IssuanceParams, at as ReissuanceParams, au as BurnParams, av as RenewVtxosOptions, c as WalletBalance, aw as ContractWithVtxos, ax as PathSelection, ay as ContractEvent, az as AssetDetails, aA as IssuanceResult, aB as DelegateInfo, aC as MigrationGlobalSkipReason, aD as MigrationLegSkipReason, aE as SignerStatus, J as IReadonlyWallet, e as ActivityRegistry, U as IReadonlyAssetManager, aF as StorageConfig, f as Activity, g as IContractManager, k as IAssetManager, h as IDelegateManager, aG as IVtxoManager, O as OnchainProvider, N as Network, X as NetworkName, _ as Coin, aH as ExplorerTransaction, r as TapLeafScript, aI as EncodedVtxoScript, a0 as CSVMultisigTapscript, q as RelativeTimelock, V as VtxoScript, aJ as Status, aK as ChainTx, p as IndexerProvider, v as TxTree, aL as PathContext } from './ark-I8jfe5VE.cjs';
2
+ export { aM as ActivityIntent, aN as ActivityResolver, Z as ArkAddress, Y as ArkInfo, aO as ArkIntentState, aP as ArkTapscript, aQ as Asset, aR as AssetMetadata, aS as BaseWalletConfig, z as BatchFailedEvent, x as BatchFinalizationEvent, y as BatchFinalizedEvent, aT as BatchInfo, aU as BatchSignableIdentity, B as BatchStartedEvent, aV as CLTVMultisigTapscript, aW as ChainTxType, ae as ChainedTxType, aX as CommitmentTx, aY as ConditionCSVMultisigTapscript, aZ as ConditionMultisigTapscript, a_ as ContractBalance, a$ as ContractEventCallback, b0 as ContractHandler, $ as ContractManager, b1 as ContractManagerConfig, b2 as ContractState, b3 as ContractVtxo, b4 as ContractWatcher, b5 as DelegateManagerImpl, b6 as DelegateOptions, L as DelegateProvider, b7 as DelegatorManagerImpl, b8 as DelegatorProvider, b9 as DeprecatedSignerMigrationReport, ba as DeprecatedSignerReport, bb as DigestMismatchError, bc as Discoverable, bd as DiscoveredContract, be as DiscoveryDeps, bf as ESPLORA_URL, bg as EsploraProvider, bh as ExtendedContractVtxo, bi as GroupMembership, bj as HandlerError, bk as IDelegatorManager, bl as INTENT_TERMINAL_STATES, bm as IndexerTxType, a5 as Intent, bn as KnownMetadata, bo as MigrateDeprecatedSignerOptions, bp as MigrationLegReport, bq as MigrationVtxoRef, br as MultisigTapscript, bs as Nonces, bt as Output, bu as PageResponse, bv as PaginationOptions, bw as PartialSig, bx as ProviderClass, M as ReadonlyWalletConfig, l as RestArkProvider, by as RestDelegateProvider, bz as RestDelegatorProvider, m as RestIndexerProvider, bA as ScanContractsOptions, bB as ScanResult, bC as ScheduledSession, bD as SettlementEventType, bE as SignRequest, a4 as SignedIntent, bF as SignerClassification, bG as SignerSet, bH as SubscriptionEvent, bI as SubscriptionHeartbeat, n as SubscriptionResponse, bJ as TapLeaves, bK as TapTreeCoder, bL as TapscriptType, bM as TreeNonces, w as TreeNoncesEvent, bN as TreePartialSigs, F as TreeSignatureEvent, u as TreeSigningStartedEvent, D as TreeTxEvent, bO as Tx, bP as TxHistoryRecord, bQ as TxKey, T as TxNotification, bR as TxTreeNode, bS as TxType, bT as VirtualStatus, bU as Vtxo, bV as VtxoChain, a2 as VtxoManager, bW as VtxoType, b as WalletConfig, bX as WalletMode, bY as boardingResolver, bZ as classifyAgainstSignerSet, b_ as classifyContractSigner, b$ as createDefaultActivityRegistry, c0 as decodeTapscript, c1 as getNetwork, c2 as getSequence, c3 as isBatchSignable, c4 as isCooperativelyMigratable, c5 as isDiscoverable, c6 as isExpired, c7 as isRecoverable, c8 as isSpendable, c9 as isSubdust, ca as isTerminalIntentState, cb as isVtxoExpiringSoon, cc as networks, cd as signerSetFromInfo, ce as toXOnlySignerHex } from './ark-I8jfe5VE.cjs';
3
+ export { B as BoardingContractHandler, a as BoardingContractParams, D as DefaultContractHandler, b as DefaultContractParams, c as DelegateContractHandler, d as DelegateContractParams, V as VHTLC, e as VHTLCContractHandler, f as VHTLCContractParams, g as contractHandlers } from './index-DHuXlDEg.cjs';
4
+ export { D as DefaultVtxo, a as DelegateVtxo } from './delegate-BRqbh2fW.cjs';
5
+ import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot } from './wallet-BsqRU8KM.cjs';
6
+ export { B as Batch, d as BoardingUtxoGroup, I as IncomingFunds, w as waitForIncomingFunds } from './wallet-BsqRU8KM.cjs';
7
7
  import { Bytes, BTC_NETWORK } from '@scure/btc-signer/utils.js';
8
8
  import { P2TR } from '@scure/btc-signer/payment.js';
9
9
  import { Transaction as Transaction$1 } from '@scure/btc-signer';
@@ -414,6 +414,73 @@ declare class ReadonlySingleKey implements ReadonlyIdentity {
414
414
  compressedPublicKey(): Promise<Uint8Array>;
415
415
  }
416
416
 
417
+ declare class InMemoryIntentRepository implements IntentRepository {
418
+ readonly version: 1;
419
+ private byId;
420
+ clear(): Promise<void>;
421
+ saveIntent(intent: ArkIntent): Promise<void>;
422
+ getIntents(filter?: IntentFilter): Promise<ArkIntent[]>;
423
+ getLockedVtxoOutpoints(): Promise<Outpoint[]>;
424
+ [Symbol.asyncDispose](): Promise<void>;
425
+ }
426
+
427
+ declare class InMemoryVirtualTxRepository implements VirtualTxRepository {
428
+ readonly version: 1;
429
+ private txs;
430
+ private branches;
431
+ clear(): Promise<void>;
432
+ upsertVirtualTxs(txs: VirtualTx[]): Promise<void>;
433
+ getVirtualTx(txid: string): Promise<VirtualTx | null>;
434
+ setBranch(vtxo: Outpoint, branch: VtxoBranch[]): Promise<void>;
435
+ getBranch(vtxo: Outpoint): Promise<VirtualTx[]>;
436
+ hasBranch(vtxo: Outpoint): Promise<boolean>;
437
+ pruneForSpentVtxo(vtxo: Outpoint): Promise<void>;
438
+ [Symbol.asyncDispose](): Promise<void>;
439
+ }
440
+
441
+ /**
442
+ * @experimental Virtual-tx persistence is inert by default. This repository
443
+ * opens its DB at {@link INTENT_DB_VERSION} and creates the virtualtx stores,
444
+ * so it must be given a *dedicated* `dbName` distinct from the wallet/contract
445
+ * DB until this persistence is activated in the shared schema — otherwise the
446
+ * shared DB's version-conflict guard rejects the mismatched open.
447
+ */
448
+ declare class IndexedDBVirtualTxRepository implements VirtualTxRepository {
449
+ private readonly dbName;
450
+ readonly version: 1;
451
+ private db;
452
+ constructor(dbName?: string);
453
+ private getDB;
454
+ clear(): Promise<void>;
455
+ upsertVirtualTxs(txs: VirtualTx[]): Promise<void>;
456
+ getVirtualTx(txid: string): Promise<VirtualTx | null>;
457
+ setBranch(vtxo: Outpoint, branch: VtxoBranch[]): Promise<void>;
458
+ getBranch(vtxo: Outpoint): Promise<VirtualTx[]>;
459
+ hasBranch(vtxo: Outpoint): Promise<boolean>;
460
+ pruneForSpentVtxo(vtxo: Outpoint): Promise<void>;
461
+ [Symbol.asyncDispose](): Promise<void>;
462
+ }
463
+
464
+ /**
465
+ * @experimental Intent persistence is inert by default. This repository opens
466
+ * its DB at {@link INTENT_DB_VERSION} and creates the intent stores, so it must
467
+ * be given a *dedicated* `dbName` distinct from the wallet/contract DB until
468
+ * intent persistence is activated in the shared schema — otherwise the shared
469
+ * DB's version-conflict guard rejects the mismatched open.
470
+ */
471
+ declare class IndexedDBIntentRepository implements IntentRepository {
472
+ private readonly dbName;
473
+ readonly version: 1;
474
+ private db;
475
+ constructor(dbName?: string);
476
+ private getDB;
477
+ clear(): Promise<void>;
478
+ saveIntent(intent: ArkIntent): Promise<void>;
479
+ getIntents(filter?: IntentFilter): Promise<ArkIntent[]>;
480
+ getLockedVtxoOutpoints(): Promise<Outpoint[]>;
481
+ [Symbol.asyncDispose](): Promise<void>;
482
+ }
483
+
417
484
  /**
418
485
  * In-memory implementation of WalletRepository.
419
486
  * Data is ephemeral and scoped to the instance.
@@ -2895,12 +2962,33 @@ declare namespace Unroll {
2895
2962
  readonly bumper: AnchorBumper;
2896
2963
  readonly explorer: OnchainProvider;
2897
2964
  readonly indexer: IndexerProvider;
2965
+ /**
2966
+ * Optional virtual-tx repository. When provided, each step's raw
2967
+ * tx is read from the repo first and fetched from the indexer on a
2968
+ * miss, then cached best-effort for later exits. Omitted ⇒ exact
2969
+ * previous behaviour (indexer only).
2970
+ */
2971
+ readonly virtualTxRepository?: VirtualTxRepository | undefined;
2898
2972
  /** Create an unroll session from a virtual output outpoint and its dependency chain. */
2899
2973
  constructor(toUnroll: Outpoint & {
2900
2974
  chain: ChainTx[];
2901
- }, bumper: AnchorBumper, explorer: OnchainProvider, indexer: IndexerProvider);
2975
+ }, bumper: AnchorBumper, explorer: OnchainProvider, indexer: IndexerProvider,
2976
+ /**
2977
+ * Optional virtual-tx repository. When provided, each step's raw
2978
+ * tx is read from the repo first and fetched from the indexer on a
2979
+ * miss, then cached best-effort for later exits. Omitted ⇒ exact
2980
+ * previous behaviour (indexer only).
2981
+ */
2982
+ virtualTxRepository?: VirtualTxRepository | undefined);
2902
2983
  /** Create an unroll session by loading the virtual output chain from the indexer. */
2903
- static create(toUnroll: Outpoint, bumper: AnchorBumper, explorer: OnchainProvider, indexer: IndexerProvider): Promise<Session>;
2984
+ static create(toUnroll: Outpoint, bumper: AnchorBumper, explorer: OnchainProvider, indexer: IndexerProvider, virtualTxRepository?: VirtualTxRepository): Promise<Session>;
2985
+ /**
2986
+ * Resolve a chain tx's raw PSBT (base64). Repo first when configured;
2987
+ * indexer on a miss, then best-effort cached so a later exit doesn't
2988
+ * re-fetch. Never throws from the cache
2989
+ * write — exit correctness must not depend on persistence.
2990
+ */
2991
+ private resolveVirtualTxBase64;
2904
2992
  /**
2905
2993
  * Get the next step to be executed
2906
2994
  * @returns The next step to be executed + the function to execute it
@@ -3543,6 +3631,22 @@ declare const buildVersion = "0.9.9";
3543
3631
  * The SDK's own version string, sourced from package.json
3544
3632
  */
3545
3633
  declare const sdkVersion: string;
3634
+ /**
3635
+ * Wraps a transport-level `fetch` rejection (DNS failure, connection refused,
3636
+ * TLS or CORS error) with the request method and URL, preserving the original
3637
+ * as {@link Error.cause}.
3638
+ */
3639
+ declare class FetchError extends Error {
3640
+ /** The request URL that failed, when derivable from the `fetch` input. */
3641
+ readonly url?: string;
3642
+ /** The HTTP method of the failed request (defaults to `"GET"`). */
3643
+ readonly method?: string;
3644
+ constructor(message: string, options: {
3645
+ url?: string;
3646
+ method?: string;
3647
+ cause?: unknown;
3648
+ });
3649
+ }
3546
3650
 
3547
3651
  /**
3548
3652
  * Opens an IndexedDB database and increments the reference count.
@@ -3651,4 +3755,4 @@ declare class AssetManager extends ReadonlyAssetManager implements IAssetManager
3651
3755
  burn(params: BurnParams): Promise<string>;
3652
3756
  }
3653
3757
 
3654
- export { Activity, ActivityRegistry, type AnchorBumper, ArkError, ArkNote, ArkProvider, type ArkPsbtFieldCoder, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ArkTransaction, type ArkTxInput, AssetDetails, AssetManager, BIP322, BurnParams, CSVMultisigTapscript, ChainTx, Coin, ConditionWitness, Contract, ContractEvent, ContractRepository, ContractRepositoryImpl, ContractWatcherConfig, ContractWithVtxos, CosignerPublicKey, CreateContractParams, DEFAULT_MESSAGE_TIMEOUTS, DelegateInfo, DelegateNotConfiguredError, DelegatorNotConfiguredError, type DescriptorOptions, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, type BlockHeader as ElectrumBlockHeader, ElectrumOnchainProvider, type TransactionHistory as ElectrumTransactionHistory, type Unspent as ElectrumUnspent, EncodedVtxoScript, Estimator, ExplorerTransaction, ExtendedCoin, ExtendedVirtualCoin, FeeAmount, FeeInfo, FeeOutput, GetVtxosFilter, HDDescriptorProvider, IAssetManager, IContractManager, IDelegateManager, IReadonlyAssetManager, IReadonlyWallet, IVtxoManager, IWallet, Identity, InMemoryContractRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBWalletRepository, IndexerProvider, IntentFeeConfig, IssuanceParams, IssuanceResult, MESSAGE_BUS_INITIALIZING, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MessageBus, MessageBusInitializingError, MessageBusNotInitializedError, type MessageHandler, type MessageTimeouts, MigrationGlobalSkipReason, MigrationLegSkipReason, type MigrationStatus, MissingSigningDescriptorError, MnemonicIdentity, type MnemonicOptions, Network, NetworkName, type NetworkOptions, OffchainInput, type OffchainTx, OnchainInput, OnchainProvider, OnchainWallet, Outpoint, P2A, type ParsedArkContract, PathContext, PathSelection, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlyIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, Recipient, ReissuanceParams, RelativeTimelock, RenewVtxosOptions, type RequestEnvelope, type ResponseEnvelope, SeedIdentity, type SeedIdentityOptions, SendBitcoinParams, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, type ServiceWorkerWalletMode, SettleParams, SettlementConfig, SettlementEvent, SignerSession, SignerStatus, SingleKey, Status, StorageConfig, TapLeafScript, Transaction, TxTree, TxWeightEstimator, Unroll, type VSize, VirtualCoin, VtxoScript, VtxoTaprootTree, VtxoTreeExpiry, Wallet, WalletBalance, WalletMessageHandler, WalletNotInitializedError, WalletRepository, WalletRepositoryImpl, WsElectrumChainSource, assembleBtcdTaprootTree, index as asset, buildForfeitTx, buildOffchainTx, buildVersion, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, decodeArkContract, encodeArkContract, getArkPsbtFields, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isCltvSatisfied, isCsvSpendable, isValidArkAddress, maybeArkError, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, sdkVersion, sequenceToTimelock, setArkPsbtField, setupServiceWorker, timelockToSequence, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures };
3758
+ export { Activity, ActivityRegistry, type AnchorBumper, ArkError, ArkIntent, ArkNote, ArkProvider, type ArkPsbtFieldCoder, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ArkTransaction, type ArkTxInput, AssetDetails, AssetManager, BIP322, BurnParams, CSVMultisigTapscript, ChainTx, Coin, ConditionWitness, Contract, ContractEvent, ContractRepository, ContractRepositoryImpl, ContractWatcherConfig, ContractWithVtxos, CosignerPublicKey, CreateContractParams, DEFAULT_MESSAGE_TIMEOUTS, DelegateInfo, DelegateNotConfiguredError, DelegatorNotConfiguredError, type DescriptorOptions, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, type BlockHeader as ElectrumBlockHeader, ElectrumOnchainProvider, type TransactionHistory as ElectrumTransactionHistory, type Unspent as ElectrumUnspent, EncodedVtxoScript, Estimator, ExplorerTransaction, ExtendedCoin, ExtendedVirtualCoin, FeeAmount, FeeInfo, FeeOutput, FetchError, GetVtxosFilter, HDDescriptorProvider, IAssetManager, IContractManager, IDelegateManager, IReadonlyAssetManager, IReadonlyWallet, IVtxoManager, IWallet, Identity, InMemoryContractRepository, InMemoryIntentRepository, InMemoryVirtualTxRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBIntentRepository, IndexedDBVirtualTxRepository, IndexedDBWalletRepository, IndexerProvider, IntentFeeConfig, IntentFilter, IntentRepository, IssuanceParams, IssuanceResult, MESSAGE_BUS_INITIALIZING, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MessageBus, MessageBusInitializingError, MessageBusNotInitializedError, type MessageHandler, type MessageTimeouts, MigrationGlobalSkipReason, MigrationLegSkipReason, type MigrationStatus, MissingSigningDescriptorError, MnemonicIdentity, type MnemonicOptions, Network, NetworkName, type NetworkOptions, OffchainInput, type OffchainTx, OnchainInput, OnchainProvider, OnchainWallet, Outpoint, P2A, type ParsedArkContract, PathContext, PathSelection, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlyIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, Recipient, ReissuanceParams, RelativeTimelock, RenewVtxosOptions, type RequestEnvelope, type ResponseEnvelope, SeedIdentity, type SeedIdentityOptions, SendBitcoinParams, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, type ServiceWorkerWalletMode, SettleParams, SettlementConfig, SettlementEvent, SignerSession, SignerStatus, SingleKey, Status, StorageConfig, TapLeafScript, Transaction, TxTree, TxWeightEstimator, Unroll, type VSize, VirtualCoin, VirtualTx, VirtualTxRepository, VtxoBranch, VtxoScript, VtxoTaprootTree, VtxoTreeExpiry, Wallet, WalletBalance, WalletMessageHandler, WalletNotInitializedError, WalletRepository, WalletRepositoryImpl, WsElectrumChainSource, assembleBtcdTaprootTree, index as asset, buildForfeitTx, buildOffchainTx, buildVersion, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, decodeArkContract, encodeArkContract, getArkPsbtFields, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isCltvSatisfied, isCsvSpendable, isValidArkAddress, maybeArkError, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, sdkVersion, sequenceToTimelock, setArkPsbtField, setupServiceWorker, timelockToSequence, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { N as ReadonlyIdentity, a as Identity, a7 as DescriptorSigningRequest, a8 as Transaction, a4 as SignerSession, W as WalletRepository, E as ExtendedVirtualCoin, u as VtxoRepositoryKey, d as ExtendedCoin, A as ArkTransaction, v as WalletState, t as Contract, C as ContractRepository, w as ContractFilter, a9 as IntentFeeConfig, aa as OffchainInput, ab as FeeAmount, ac as OnchainInput, ad as FeeOutput, o as ArkProvider, a2 as SettlementConfig, ae as ContractWatcherConfig, I as IWallet, af as FeeInfo, j as SettlementEvent, L as DescriptorProvider, i as SettleParams, S as SendBitcoinParams, G as GetVtxosFilter, ag as CreateContractParams, ah as GetContractsFilter, s as VirtualCoin, ai as GetSpendablePathsOptions, aj as GetAllSpendingPathsOptions, R as Recipient, ak as IssuanceParams, al as ReissuanceParams, am as BurnParams, an as RenewVtxosOptions, c as WalletBalance, ao as ContractWithVtxos, ap as PathSelection, aq as ContractEvent, ar as AssetDetails, as as IssuanceResult, at as DelegateInfo, au as MigrationGlobalSkipReason, av as MigrationLegSkipReason, aw as SignerStatus, M as IReadonlyWallet, e as ActivityRegistry, X as IReadonlyAssetManager, ax as StorageConfig, f as Activity, g as IContractManager, k as IAssetManager, h as IDelegateManager, ay as IVtxoManager, P as OnchainProvider, O as Network, Y as NetworkName, $ as Coin, az as ExplorerTransaction, r as TapLeafScript, aA as EncodedVtxoScript, a1 as CSVMultisigTapscript, q as RelativeTimelock, V as VtxoScript, aB as Status, aC as Outpoint, aD as ChainTx, p as IndexerProvider, y as TxTree, aE as PathContext } from './ark-CSqMJczW.js';
2
- export { aF as ActivityIntent, aG as ActivityResolver, _ as ArkAddress, Z as ArkInfo, aH as ArkTapscript, aI as Asset, aJ as AssetMetadata, aK as BaseWalletConfig, H as BatchFailedEvent, D as BatchFinalizationEvent, F as BatchFinalizedEvent, aL as BatchInfo, aM as BatchSignableIdentity, B as BatchStartedEvent, aN as CLTVMultisigTapscript, aO as ChainTxType, aP as CommitmentTx, aQ as ConditionCSVMultisigTapscript, aR as ConditionMultisigTapscript, aS as ContractBalance, aT as ContractEventCallback, aU as ContractHandler, a0 as ContractManager, aV as ContractManagerConfig, aW as ContractState, aX as ContractVtxo, aY as ContractWatcher, aZ as DelegateManagerImpl, a_ as DelegateOptions, Q as DelegateProvider, a$ as DelegatorManagerImpl, b0 as DelegatorProvider, b1 as DeprecatedSignerMigrationReport, b2 as DeprecatedSignerReport, b3 as DigestMismatchError, b4 as Discoverable, b5 as DiscoveredContract, b6 as DiscoveryDeps, b7 as ESPLORA_URL, b8 as EsploraProvider, b9 as ExtendedContractVtxo, ba as GroupMembership, bb as HandlerError, bc as IDelegatorManager, bd as IndexerTxType, a6 as Intent, be as KnownMetadata, bf as MigrateDeprecatedSignerOptions, bg as MigrationLegReport, bh as MigrationVtxoRef, bi as MultisigTapscript, bj as Nonces, bk as Output, bl as PageResponse, bm as PaginationOptions, bn as PartialSig, bo as ProviderClass, U as ReadonlyWalletConfig, l as RestArkProvider, bp as RestDelegateProvider, bq as RestDelegatorProvider, m as RestIndexerProvider, br as ScanContractsOptions, bs as ScanResult, bt as ScheduledSession, bu as SettlementEventType, bv as SignRequest, a5 as SignedIntent, bw as SignerClassification, bx as SignerSet, by as SubscriptionEvent, bz as SubscriptionHeartbeat, n as SubscriptionResponse, bA as TapLeaves, bB as TapTreeCoder, bC as TapscriptType, bD as TreeNonces, z as TreeNoncesEvent, bE as TreePartialSigs, K as TreeSignatureEvent, x as TreeSigningStartedEvent, J as TreeTxEvent, bF as Tx, bG as TxHistoryRecord, bH as TxKey, T as TxNotification, bI as TxTreeNode, bJ as TxType, bK as VirtualStatus, bL as Vtxo, bM as VtxoChain, a3 as VtxoManager, bN as VtxoType, b as WalletConfig, bO as WalletMode, bP as boardingResolver, bQ as classifyAgainstSignerSet, bR as classifyContractSigner, bS as createDefaultActivityRegistry, bT as decodeTapscript, bU as getNetwork, bV as getSequence, bW as isBatchSignable, bX as isCooperativelyMigratable, bY as isDiscoverable, bZ as isExpired, b_ as isRecoverable, b$ as isSpendable, c0 as isSubdust, c1 as isVtxoExpiringSoon, c2 as networks, c3 as signerSetFromInfo, c4 as toXOnlySignerHex } from './ark-CSqMJczW.js';
3
- export { B as BoardingContractHandler, a as BoardingContractParams, D as DefaultContractHandler, b as DefaultContractParams, c as DelegateContractHandler, d as DelegateContractParams, V as VHTLC, e as VHTLCContractHandler, f as VHTLCContractParams, g as contractHandlers } from './index-kITujXlS.js';
4
- export { D as DefaultVtxo, a as DelegateVtxo } from './delegate-BTn9BK8E.js';
5
- import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot } from './wallet-CTEQpKG9.js';
6
- export { B as Batch, d as BoardingUtxoGroup, I as IncomingFunds, w as waitForIncomingFunds } from './wallet-CTEQpKG9.js';
1
+ import { K as ReadonlyIdentity, a as Identity, af as DescriptorSigningRequest, ag as Transaction, a3 as SignerSession, P as IntentRepository, a9 as ArkIntent, aa as IntentFilter, ab as Outpoint, Q as VirtualTxRepository, ac as VirtualTx, ad as VtxoBranch, W as WalletRepository, E as ExtendedVirtualCoin, a6 as VtxoRepositoryKey, d as ExtendedCoin, A as ArkTransaction, a7 as WalletState, t as Contract, C as ContractRepository, a8 as ContractFilter, ah as IntentFeeConfig, ai as OffchainInput, aj as FeeAmount, ak as OnchainInput, al as FeeOutput, o as ArkProvider, a1 as SettlementConfig, am as ContractWatcherConfig, I as IWallet, an as FeeInfo, j as SettlementEvent, H as DescriptorProvider, i as SettleParams, S as SendBitcoinParams, G as GetVtxosFilter, ao as CreateContractParams, ap as GetContractsFilter, s as VirtualCoin, aq as GetSpendablePathsOptions, ar as GetAllSpendingPathsOptions, R as Recipient, as as IssuanceParams, at as ReissuanceParams, au as BurnParams, av as RenewVtxosOptions, c as WalletBalance, aw as ContractWithVtxos, ax as PathSelection, ay as ContractEvent, az as AssetDetails, aA as IssuanceResult, aB as DelegateInfo, aC as MigrationGlobalSkipReason, aD as MigrationLegSkipReason, aE as SignerStatus, J as IReadonlyWallet, e as ActivityRegistry, U as IReadonlyAssetManager, aF as StorageConfig, f as Activity, g as IContractManager, k as IAssetManager, h as IDelegateManager, aG as IVtxoManager, O as OnchainProvider, N as Network, X as NetworkName, _ as Coin, aH as ExplorerTransaction, r as TapLeafScript, aI as EncodedVtxoScript, a0 as CSVMultisigTapscript, q as RelativeTimelock, V as VtxoScript, aJ as Status, aK as ChainTx, p as IndexerProvider, v as TxTree, aL as PathContext } from './ark-I8jfe5VE.js';
2
+ export { aM as ActivityIntent, aN as ActivityResolver, Z as ArkAddress, Y as ArkInfo, aO as ArkIntentState, aP as ArkTapscript, aQ as Asset, aR as AssetMetadata, aS as BaseWalletConfig, z as BatchFailedEvent, x as BatchFinalizationEvent, y as BatchFinalizedEvent, aT as BatchInfo, aU as BatchSignableIdentity, B as BatchStartedEvent, aV as CLTVMultisigTapscript, aW as ChainTxType, ae as ChainedTxType, aX as CommitmentTx, aY as ConditionCSVMultisigTapscript, aZ as ConditionMultisigTapscript, a_ as ContractBalance, a$ as ContractEventCallback, b0 as ContractHandler, $ as ContractManager, b1 as ContractManagerConfig, b2 as ContractState, b3 as ContractVtxo, b4 as ContractWatcher, b5 as DelegateManagerImpl, b6 as DelegateOptions, L as DelegateProvider, b7 as DelegatorManagerImpl, b8 as DelegatorProvider, b9 as DeprecatedSignerMigrationReport, ba as DeprecatedSignerReport, bb as DigestMismatchError, bc as Discoverable, bd as DiscoveredContract, be as DiscoveryDeps, bf as ESPLORA_URL, bg as EsploraProvider, bh as ExtendedContractVtxo, bi as GroupMembership, bj as HandlerError, bk as IDelegatorManager, bl as INTENT_TERMINAL_STATES, bm as IndexerTxType, a5 as Intent, bn as KnownMetadata, bo as MigrateDeprecatedSignerOptions, bp as MigrationLegReport, bq as MigrationVtxoRef, br as MultisigTapscript, bs as Nonces, bt as Output, bu as PageResponse, bv as PaginationOptions, bw as PartialSig, bx as ProviderClass, M as ReadonlyWalletConfig, l as RestArkProvider, by as RestDelegateProvider, bz as RestDelegatorProvider, m as RestIndexerProvider, bA as ScanContractsOptions, bB as ScanResult, bC as ScheduledSession, bD as SettlementEventType, bE as SignRequest, a4 as SignedIntent, bF as SignerClassification, bG as SignerSet, bH as SubscriptionEvent, bI as SubscriptionHeartbeat, n as SubscriptionResponse, bJ as TapLeaves, bK as TapTreeCoder, bL as TapscriptType, bM as TreeNonces, w as TreeNoncesEvent, bN as TreePartialSigs, F as TreeSignatureEvent, u as TreeSigningStartedEvent, D as TreeTxEvent, bO as Tx, bP as TxHistoryRecord, bQ as TxKey, T as TxNotification, bR as TxTreeNode, bS as TxType, bT as VirtualStatus, bU as Vtxo, bV as VtxoChain, a2 as VtxoManager, bW as VtxoType, b as WalletConfig, bX as WalletMode, bY as boardingResolver, bZ as classifyAgainstSignerSet, b_ as classifyContractSigner, b$ as createDefaultActivityRegistry, c0 as decodeTapscript, c1 as getNetwork, c2 as getSequence, c3 as isBatchSignable, c4 as isCooperativelyMigratable, c5 as isDiscoverable, c6 as isExpired, c7 as isRecoverable, c8 as isSpendable, c9 as isSubdust, ca as isTerminalIntentState, cb as isVtxoExpiringSoon, cc as networks, cd as signerSetFromInfo, ce as toXOnlySignerHex } from './ark-I8jfe5VE.js';
3
+ export { B as BoardingContractHandler, a as BoardingContractParams, D as DefaultContractHandler, b as DefaultContractParams, c as DelegateContractHandler, d as DelegateContractParams, V as VHTLC, e as VHTLCContractHandler, f as VHTLCContractParams, g as contractHandlers } from './index-DvWNB_rl.js';
4
+ export { D as DefaultVtxo, a as DelegateVtxo } from './delegate-CgjVjYOP.js';
5
+ import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot } from './wallet-D9z7wssl.js';
6
+ export { B as Batch, d as BoardingUtxoGroup, I as IncomingFunds, w as waitForIncomingFunds } from './wallet-D9z7wssl.js';
7
7
  import { Bytes, BTC_NETWORK } from '@scure/btc-signer/utils.js';
8
8
  import { P2TR } from '@scure/btc-signer/payment.js';
9
9
  import { Transaction as Transaction$1 } from '@scure/btc-signer';
@@ -414,6 +414,73 @@ declare class ReadonlySingleKey implements ReadonlyIdentity {
414
414
  compressedPublicKey(): Promise<Uint8Array>;
415
415
  }
416
416
 
417
+ declare class InMemoryIntentRepository implements IntentRepository {
418
+ readonly version: 1;
419
+ private byId;
420
+ clear(): Promise<void>;
421
+ saveIntent(intent: ArkIntent): Promise<void>;
422
+ getIntents(filter?: IntentFilter): Promise<ArkIntent[]>;
423
+ getLockedVtxoOutpoints(): Promise<Outpoint[]>;
424
+ [Symbol.asyncDispose](): Promise<void>;
425
+ }
426
+
427
+ declare class InMemoryVirtualTxRepository implements VirtualTxRepository {
428
+ readonly version: 1;
429
+ private txs;
430
+ private branches;
431
+ clear(): Promise<void>;
432
+ upsertVirtualTxs(txs: VirtualTx[]): Promise<void>;
433
+ getVirtualTx(txid: string): Promise<VirtualTx | null>;
434
+ setBranch(vtxo: Outpoint, branch: VtxoBranch[]): Promise<void>;
435
+ getBranch(vtxo: Outpoint): Promise<VirtualTx[]>;
436
+ hasBranch(vtxo: Outpoint): Promise<boolean>;
437
+ pruneForSpentVtxo(vtxo: Outpoint): Promise<void>;
438
+ [Symbol.asyncDispose](): Promise<void>;
439
+ }
440
+
441
+ /**
442
+ * @experimental Virtual-tx persistence is inert by default. This repository
443
+ * opens its DB at {@link INTENT_DB_VERSION} and creates the virtualtx stores,
444
+ * so it must be given a *dedicated* `dbName` distinct from the wallet/contract
445
+ * DB until this persistence is activated in the shared schema — otherwise the
446
+ * shared DB's version-conflict guard rejects the mismatched open.
447
+ */
448
+ declare class IndexedDBVirtualTxRepository implements VirtualTxRepository {
449
+ private readonly dbName;
450
+ readonly version: 1;
451
+ private db;
452
+ constructor(dbName?: string);
453
+ private getDB;
454
+ clear(): Promise<void>;
455
+ upsertVirtualTxs(txs: VirtualTx[]): Promise<void>;
456
+ getVirtualTx(txid: string): Promise<VirtualTx | null>;
457
+ setBranch(vtxo: Outpoint, branch: VtxoBranch[]): Promise<void>;
458
+ getBranch(vtxo: Outpoint): Promise<VirtualTx[]>;
459
+ hasBranch(vtxo: Outpoint): Promise<boolean>;
460
+ pruneForSpentVtxo(vtxo: Outpoint): Promise<void>;
461
+ [Symbol.asyncDispose](): Promise<void>;
462
+ }
463
+
464
+ /**
465
+ * @experimental Intent persistence is inert by default. This repository opens
466
+ * its DB at {@link INTENT_DB_VERSION} and creates the intent stores, so it must
467
+ * be given a *dedicated* `dbName` distinct from the wallet/contract DB until
468
+ * intent persistence is activated in the shared schema — otherwise the shared
469
+ * DB's version-conflict guard rejects the mismatched open.
470
+ */
471
+ declare class IndexedDBIntentRepository implements IntentRepository {
472
+ private readonly dbName;
473
+ readonly version: 1;
474
+ private db;
475
+ constructor(dbName?: string);
476
+ private getDB;
477
+ clear(): Promise<void>;
478
+ saveIntent(intent: ArkIntent): Promise<void>;
479
+ getIntents(filter?: IntentFilter): Promise<ArkIntent[]>;
480
+ getLockedVtxoOutpoints(): Promise<Outpoint[]>;
481
+ [Symbol.asyncDispose](): Promise<void>;
482
+ }
483
+
417
484
  /**
418
485
  * In-memory implementation of WalletRepository.
419
486
  * Data is ephemeral and scoped to the instance.
@@ -2895,12 +2962,33 @@ declare namespace Unroll {
2895
2962
  readonly bumper: AnchorBumper;
2896
2963
  readonly explorer: OnchainProvider;
2897
2964
  readonly indexer: IndexerProvider;
2965
+ /**
2966
+ * Optional virtual-tx repository. When provided, each step's raw
2967
+ * tx is read from the repo first and fetched from the indexer on a
2968
+ * miss, then cached best-effort for later exits. Omitted ⇒ exact
2969
+ * previous behaviour (indexer only).
2970
+ */
2971
+ readonly virtualTxRepository?: VirtualTxRepository | undefined;
2898
2972
  /** Create an unroll session from a virtual output outpoint and its dependency chain. */
2899
2973
  constructor(toUnroll: Outpoint & {
2900
2974
  chain: ChainTx[];
2901
- }, bumper: AnchorBumper, explorer: OnchainProvider, indexer: IndexerProvider);
2975
+ }, bumper: AnchorBumper, explorer: OnchainProvider, indexer: IndexerProvider,
2976
+ /**
2977
+ * Optional virtual-tx repository. When provided, each step's raw
2978
+ * tx is read from the repo first and fetched from the indexer on a
2979
+ * miss, then cached best-effort for later exits. Omitted ⇒ exact
2980
+ * previous behaviour (indexer only).
2981
+ */
2982
+ virtualTxRepository?: VirtualTxRepository | undefined);
2902
2983
  /** Create an unroll session by loading the virtual output chain from the indexer. */
2903
- static create(toUnroll: Outpoint, bumper: AnchorBumper, explorer: OnchainProvider, indexer: IndexerProvider): Promise<Session>;
2984
+ static create(toUnroll: Outpoint, bumper: AnchorBumper, explorer: OnchainProvider, indexer: IndexerProvider, virtualTxRepository?: VirtualTxRepository): Promise<Session>;
2985
+ /**
2986
+ * Resolve a chain tx's raw PSBT (base64). Repo first when configured;
2987
+ * indexer on a miss, then best-effort cached so a later exit doesn't
2988
+ * re-fetch. Never throws from the cache
2989
+ * write — exit correctness must not depend on persistence.
2990
+ */
2991
+ private resolveVirtualTxBase64;
2904
2992
  /**
2905
2993
  * Get the next step to be executed
2906
2994
  * @returns The next step to be executed + the function to execute it
@@ -3543,6 +3631,22 @@ declare const buildVersion = "0.9.9";
3543
3631
  * The SDK's own version string, sourced from package.json
3544
3632
  */
3545
3633
  declare const sdkVersion: string;
3634
+ /**
3635
+ * Wraps a transport-level `fetch` rejection (DNS failure, connection refused,
3636
+ * TLS or CORS error) with the request method and URL, preserving the original
3637
+ * as {@link Error.cause}.
3638
+ */
3639
+ declare class FetchError extends Error {
3640
+ /** The request URL that failed, when derivable from the `fetch` input. */
3641
+ readonly url?: string;
3642
+ /** The HTTP method of the failed request (defaults to `"GET"`). */
3643
+ readonly method?: string;
3644
+ constructor(message: string, options: {
3645
+ url?: string;
3646
+ method?: string;
3647
+ cause?: unknown;
3648
+ });
3649
+ }
3546
3650
 
3547
3651
  /**
3548
3652
  * Opens an IndexedDB database and increments the reference count.
@@ -3651,4 +3755,4 @@ declare class AssetManager extends ReadonlyAssetManager implements IAssetManager
3651
3755
  burn(params: BurnParams): Promise<string>;
3652
3756
  }
3653
3757
 
3654
- export { Activity, ActivityRegistry, type AnchorBumper, ArkError, ArkNote, ArkProvider, type ArkPsbtFieldCoder, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ArkTransaction, type ArkTxInput, AssetDetails, AssetManager, BIP322, BurnParams, CSVMultisigTapscript, ChainTx, Coin, ConditionWitness, Contract, ContractEvent, ContractRepository, ContractRepositoryImpl, ContractWatcherConfig, ContractWithVtxos, CosignerPublicKey, CreateContractParams, DEFAULT_MESSAGE_TIMEOUTS, DelegateInfo, DelegateNotConfiguredError, DelegatorNotConfiguredError, type DescriptorOptions, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, type BlockHeader as ElectrumBlockHeader, ElectrumOnchainProvider, type TransactionHistory as ElectrumTransactionHistory, type Unspent as ElectrumUnspent, EncodedVtxoScript, Estimator, ExplorerTransaction, ExtendedCoin, ExtendedVirtualCoin, FeeAmount, FeeInfo, FeeOutput, GetVtxosFilter, HDDescriptorProvider, IAssetManager, IContractManager, IDelegateManager, IReadonlyAssetManager, IReadonlyWallet, IVtxoManager, IWallet, Identity, InMemoryContractRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBWalletRepository, IndexerProvider, IntentFeeConfig, IssuanceParams, IssuanceResult, MESSAGE_BUS_INITIALIZING, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MessageBus, MessageBusInitializingError, MessageBusNotInitializedError, type MessageHandler, type MessageTimeouts, MigrationGlobalSkipReason, MigrationLegSkipReason, type MigrationStatus, MissingSigningDescriptorError, MnemonicIdentity, type MnemonicOptions, Network, NetworkName, type NetworkOptions, OffchainInput, type OffchainTx, OnchainInput, OnchainProvider, OnchainWallet, Outpoint, P2A, type ParsedArkContract, PathContext, PathSelection, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlyIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, Recipient, ReissuanceParams, RelativeTimelock, RenewVtxosOptions, type RequestEnvelope, type ResponseEnvelope, SeedIdentity, type SeedIdentityOptions, SendBitcoinParams, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, type ServiceWorkerWalletMode, SettleParams, SettlementConfig, SettlementEvent, SignerSession, SignerStatus, SingleKey, Status, StorageConfig, TapLeafScript, Transaction, TxTree, TxWeightEstimator, Unroll, type VSize, VirtualCoin, VtxoScript, VtxoTaprootTree, VtxoTreeExpiry, Wallet, WalletBalance, WalletMessageHandler, WalletNotInitializedError, WalletRepository, WalletRepositoryImpl, WsElectrumChainSource, assembleBtcdTaprootTree, index as asset, buildForfeitTx, buildOffchainTx, buildVersion, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, decodeArkContract, encodeArkContract, getArkPsbtFields, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isCltvSatisfied, isCsvSpendable, isValidArkAddress, maybeArkError, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, sdkVersion, sequenceToTimelock, setArkPsbtField, setupServiceWorker, timelockToSequence, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures };
3758
+ export { Activity, ActivityRegistry, type AnchorBumper, ArkError, ArkIntent, ArkNote, ArkProvider, type ArkPsbtFieldCoder, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ArkTransaction, type ArkTxInput, AssetDetails, AssetManager, BIP322, BurnParams, CSVMultisigTapscript, ChainTx, Coin, ConditionWitness, Contract, ContractEvent, ContractRepository, ContractRepositoryImpl, ContractWatcherConfig, ContractWithVtxos, CosignerPublicKey, CreateContractParams, DEFAULT_MESSAGE_TIMEOUTS, DelegateInfo, DelegateNotConfiguredError, DelegatorNotConfiguredError, type DescriptorOptions, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, type BlockHeader as ElectrumBlockHeader, ElectrumOnchainProvider, type TransactionHistory as ElectrumTransactionHistory, type Unspent as ElectrumUnspent, EncodedVtxoScript, Estimator, ExplorerTransaction, ExtendedCoin, ExtendedVirtualCoin, FeeAmount, FeeInfo, FeeOutput, FetchError, GetVtxosFilter, HDDescriptorProvider, IAssetManager, IContractManager, IDelegateManager, IReadonlyAssetManager, IReadonlyWallet, IVtxoManager, IWallet, Identity, InMemoryContractRepository, InMemoryIntentRepository, InMemoryVirtualTxRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBIntentRepository, IndexedDBVirtualTxRepository, IndexedDBWalletRepository, IndexerProvider, IntentFeeConfig, IntentFilter, IntentRepository, IssuanceParams, IssuanceResult, MESSAGE_BUS_INITIALIZING, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MessageBus, MessageBusInitializingError, MessageBusNotInitializedError, type MessageHandler, type MessageTimeouts, MigrationGlobalSkipReason, MigrationLegSkipReason, type MigrationStatus, MissingSigningDescriptorError, MnemonicIdentity, type MnemonicOptions, Network, NetworkName, type NetworkOptions, OffchainInput, type OffchainTx, OnchainInput, OnchainProvider, OnchainWallet, Outpoint, P2A, type ParsedArkContract, PathContext, PathSelection, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlyIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, Recipient, ReissuanceParams, RelativeTimelock, RenewVtxosOptions, type RequestEnvelope, type ResponseEnvelope, SeedIdentity, type SeedIdentityOptions, SendBitcoinParams, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, type ServiceWorkerWalletMode, SettleParams, SettlementConfig, SettlementEvent, SignerSession, SignerStatus, SingleKey, Status, StorageConfig, TapLeafScript, Transaction, TxTree, TxWeightEstimator, Unroll, type VSize, VirtualCoin, VirtualTx, VirtualTxRepository, VtxoBranch, VtxoScript, VtxoTaprootTree, VtxoTreeExpiry, Wallet, WalletBalance, WalletMessageHandler, WalletNotInitializedError, WalletRepository, WalletRepositoryImpl, WsElectrumChainSource, assembleBtcdTaprootTree, index as asset, buildForfeitTx, buildOffchainTx, buildVersion, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, decodeArkContract, encodeArkContract, getArkPsbtFields, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isCltvSatisfied, isCsvSpendable, isValidArkAddress, maybeArkError, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, sdkVersion, sequenceToTimelock, setArkPsbtField, setupServiceWorker, timelockToSequence, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- export { ActivityRegistry, ArkNote, AssetManager, BIP322, Batch, ContractManager, ContractRepositoryImpl, ContractWatcher, DEFAULT_MESSAGE_TIMEOUTS, DelegateManagerImpl, DelegateNotConfiguredError, DelegatorManagerImpl, DelegatorNotConfiguredError, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, ESPLORA_URL, ElectrumOnchainProvider, EsploraProvider, Estimator, HDDescriptorProvider, InMemoryContractRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBWalletRepository, MESSAGE_BUS_INITIALIZING, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MessageBus, MessageBusInitializingError, MessageBusNotInitializedError, MissingSigningDescriptorError, MnemonicIdentity, OnchainWallet, P2A, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, RestDelegateProvider, RestDelegatorProvider, SeedIdentity, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, SingleKey, TxTree, TxType, TxWeightEstimator, Unroll, VtxoManager, Wallet, WalletMessageHandler, WalletNotInitializedError, WalletRepositoryImpl, WsElectrumChainSource, boardingResolver, buildForfeitTx, buildOffchainTx, classifyAgainstSignerSet, classifyContractSigner, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, createDefaultActivityRegistry, decodeArkContract, encodeArkContract, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isBatchSignable, isCooperativelyMigratable, isDiscoverable, isExpired, isRecoverable, isSpendable, isSubdust, isValidArkAddress, isVtxoExpiringSoon, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, setupServiceWorker, signerSetFromInfo, toXOnlySignerHex, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures, waitForIncomingFunds } from './chunk-D5MQYYYF.js';
2
- export { ArkError, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ChainTxType, ConditionWitness, CosignerPublicKey, DigestMismatchError, IndexerTxType, Intent, RestArkProvider, RestIndexerProvider, SettlementEventType, Transaction, VtxoTaprootTree, VtxoTreeExpiry, asset_exports as asset, buildVersion, getArkPsbtFields, maybeArkError, sdkVersion, setArkPsbtField } from './chunk-5XAYUPK4.js';
1
+ export { ActivityRegistry, ArkNote, AssetManager, BIP322, Batch, ChainedTxType, ContractManager, ContractRepositoryImpl, ContractWatcher, DEFAULT_MESSAGE_TIMEOUTS, DelegateManagerImpl, DelegateNotConfiguredError, DelegatorManagerImpl, DelegatorNotConfiguredError, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, ESPLORA_URL, ElectrumOnchainProvider, EsploraProvider, Estimator, HDDescriptorProvider, INTENT_TERMINAL_STATES, InMemoryContractRepository, InMemoryIntentRepository, InMemoryVirtualTxRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBIntentRepository, IndexedDBVirtualTxRepository, IndexedDBWalletRepository, MESSAGE_BUS_INITIALIZING, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MessageBus, MessageBusInitializingError, MessageBusNotInitializedError, MissingSigningDescriptorError, MnemonicIdentity, OnchainWallet, P2A, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, RestDelegateProvider, RestDelegatorProvider, SeedIdentity, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, SingleKey, TxTree, TxType, TxWeightEstimator, Unroll, VtxoManager, Wallet, WalletMessageHandler, WalletNotInitializedError, WalletRepositoryImpl, WsElectrumChainSource, boardingResolver, buildForfeitTx, buildOffchainTx, classifyAgainstSignerSet, classifyContractSigner, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, createDefaultActivityRegistry, decodeArkContract, encodeArkContract, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isBatchSignable, isCooperativelyMigratable, isDiscoverable, isExpired, isRecoverable, isSpendable, isSubdust, isTerminalIntentState, isValidArkAddress, isVtxoExpiringSoon, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, setupServiceWorker, signerSetFromInfo, toXOnlySignerHex, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures, waitForIncomingFunds } from './chunk-B4R36PRN.js';
2
+ export { ArkError, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ChainTxType, ConditionWitness, CosignerPublicKey, DigestMismatchError, FetchError, IndexerTxType, Intent, RestArkProvider, RestIndexerProvider, SettlementEventType, Transaction, VtxoTaprootTree, VtxoTreeExpiry, asset_exports as asset, buildVersion, getArkPsbtFields, maybeArkError, sdkVersion, setArkPsbtField } from './chunk-763XHDAJ.js';
3
3
  export { BoardingContractHandler, DefaultContractHandler, DefaultVtxo, DelegateContractHandler, DelegateVtxo, VHTLC, VHTLCContractHandler, contractHandlers, isCltvSatisfied, isCsvSpendable } from './chunk-YNEDJTX2.js';
4
4
  export { ArkAddress, CLTVMultisigTapscript, CSVMultisigTapscript, ConditionCSVMultisigTapscript, ConditionMultisigTapscript, MultisigTapscript, TapTreeCoder, VtxoScript, assembleBtcdTaprootTree, decodeTapscript, getNetwork, getSequence, networks, sequenceToTimelock, timelockToSequence } from './chunk-BE5MUB7T.js';
5
5
  import './chunk-NSBPE2FW.js';