@arkade-os/sdk 0.4.24 → 0.4.26

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 (212) hide show
  1. package/dist/cjs/contracts/contractManager.js +44 -8
  2. package/dist/cjs/contracts/contractWatcher.js +2 -2
  3. package/dist/cjs/contracts/vtxoOwnership.js +18 -0
  4. package/dist/cjs/repositories/inMemory/walletRepository.js +35 -0
  5. package/dist/cjs/repositories/indexedDB/walletRepository.js +117 -0
  6. package/dist/cjs/repositories/realm/walletRepository.js +28 -0
  7. package/dist/cjs/repositories/sqlite/walletRepository.js +23 -0
  8. package/dist/cjs/script/address.js +2 -2
  9. package/dist/cjs/wallet/serviceWorker/wallet-message-handler.js +14 -3
  10. package/dist/cjs/wallet/serviceWorker/wallet.js +10 -0
  11. package/dist/cjs/wallet/vtxo-manager.js +112 -16
  12. package/dist/cjs/wallet/wallet.js +3 -17
  13. package/dist/cjs/worker/expo/processors/contractPollProcessor.js +1 -1
  14. package/dist/esm/adapters/asyncStorage.js +1 -1
  15. package/dist/esm/adapters/expo.js +2 -2
  16. package/dist/esm/adapters/fileSystem.js +1 -1
  17. package/dist/esm/adapters/indexedDB.js +1 -1
  18. package/dist/esm/adapters/localStorage.js +1 -1
  19. package/dist/esm/arkfee/index.js +1 -1
  20. package/dist/esm/arknote/index.js +1 -1
  21. package/dist/esm/bip322/index.js +2 -2
  22. package/dist/esm/contracts/arkcontract.js +2 -2
  23. package/dist/esm/contracts/contractManager.js +49 -13
  24. package/dist/esm/contracts/contractWatcher.js +5 -5
  25. package/dist/esm/contracts/handlers/default.js +4 -4
  26. package/dist/esm/contracts/handlers/delegate.js +4 -4
  27. package/dist/esm/contracts/handlers/helpers.js +2 -2
  28. package/dist/esm/contracts/handlers/index.js +8 -8
  29. package/dist/esm/contracts/handlers/vhtlc.js +3 -3
  30. package/dist/esm/contracts/index.js +8 -8
  31. package/dist/esm/contracts/vtxoOwnership.js +16 -0
  32. package/dist/esm/extension/asset/assetGroup.js +7 -7
  33. package/dist/esm/extension/asset/assetId.js +2 -2
  34. package/dist/esm/extension/asset/assetInput.js +2 -2
  35. package/dist/esm/extension/asset/assetOutput.js +1 -1
  36. package/dist/esm/extension/asset/assetRef.js +3 -3
  37. package/dist/esm/extension/asset/index.js +8 -8
  38. package/dist/esm/extension/asset/metadata.js +1 -1
  39. package/dist/esm/extension/asset/packet.js +3 -3
  40. package/dist/esm/extension/index.js +4 -4
  41. package/dist/esm/forfeit.js +2 -2
  42. package/dist/esm/identity/index.js +5 -5
  43. package/dist/esm/identity/seedIdentity.js +2 -2
  44. package/dist/esm/identity/serialize.js +2 -2
  45. package/dist/esm/identity/singleKey.js +1 -1
  46. package/dist/esm/identity/staticDescriptorProvider.js +2 -2
  47. package/dist/esm/index.js +47 -47
  48. package/dist/esm/intent/index.js +3 -3
  49. package/dist/esm/musig2/index.js +3 -3
  50. package/dist/esm/musig2/sign.js +1 -1
  51. package/dist/esm/providers/ark.js +3 -3
  52. package/dist/esm/providers/delegator.js +1 -1
  53. package/dist/esm/providers/electrum.js +2 -2
  54. package/dist/esm/providers/expoArk.js +2 -2
  55. package/dist/esm/providers/expoIndexer.js +3 -3
  56. package/dist/esm/providers/indexer.js +3 -3
  57. package/dist/esm/repositories/inMemory/walletRepository.js +35 -0
  58. package/dist/esm/repositories/index.js +9 -9
  59. package/dist/esm/repositories/indexedDB/contractRepository.js +4 -4
  60. package/dist/esm/repositories/indexedDB/db.js +2 -2
  61. package/dist/esm/repositories/indexedDB/schema.js +1 -1
  62. package/dist/esm/repositories/indexedDB/walletRepository.js +122 -5
  63. package/dist/esm/repositories/migrations/fromStorageAdapter.js +1 -1
  64. package/dist/esm/repositories/migrations/walletRepositoryImpl.js +1 -1
  65. package/dist/esm/repositories/realm/index.js +3 -3
  66. package/dist/esm/repositories/realm/schemas.js +1 -1
  67. package/dist/esm/repositories/realm/walletRepository.js +30 -2
  68. package/dist/esm/repositories/scriptFromAddress.js +1 -1
  69. package/dist/esm/repositories/sqlite/index.js +2 -2
  70. package/dist/esm/repositories/sqlite/walletRepository.js +25 -2
  71. package/dist/esm/script/address.js +3 -3
  72. package/dist/esm/script/base.js +3 -3
  73. package/dist/esm/script/default.js +2 -2
  74. package/dist/esm/script/delegate.js +3 -3
  75. package/dist/esm/script/tapscript.js +1 -1
  76. package/dist/esm/script/vhtlc.js +2 -2
  77. package/dist/esm/storage/indexedDB.js +1 -1
  78. package/dist/esm/tree/signingSession.js +2 -2
  79. package/dist/esm/tree/validation.js +2 -2
  80. package/dist/esm/utils/arkTransaction.js +7 -7
  81. package/dist/esm/utils/transactionHistory.js +1 -1
  82. package/dist/esm/utils/unknownFields.js +1 -1
  83. package/dist/esm/wallet/asset-manager.js +5 -5
  84. package/dist/esm/wallet/asset.js +1 -1
  85. package/dist/esm/wallet/batch.js +2 -2
  86. package/dist/esm/wallet/delegator.js +6 -6
  87. package/dist/esm/wallet/expo/background.js +5 -5
  88. package/dist/esm/wallet/expo/index.js +2 -2
  89. package/dist/esm/wallet/expo/wallet.js +8 -8
  90. package/dist/esm/wallet/hdDescriptorProvider.js +2 -2
  91. package/dist/esm/wallet/onchain.js +7 -7
  92. package/dist/esm/wallet/ramps.js +3 -3
  93. package/dist/esm/wallet/serviceWorker/wallet-message-handler.js +20 -9
  94. package/dist/esm/wallet/serviceWorker/wallet.js +17 -7
  95. package/dist/esm/wallet/unroll.js +7 -7
  96. package/dist/esm/wallet/utils.js +2 -2
  97. package/dist/esm/wallet/validation.js +2 -2
  98. package/dist/esm/wallet/vtxo-manager.js +120 -24
  99. package/dist/esm/wallet/wallet.js +36 -50
  100. package/dist/esm/worker/expo/index.js +4 -4
  101. package/dist/esm/worker/expo/processors/contractPollProcessor.js +2 -2
  102. package/dist/esm/worker/expo/processors/index.js +1 -1
  103. package/dist/esm/worker/expo/taskRunner.js +1 -1
  104. package/dist/esm/worker/messageBus.js +6 -6
  105. package/dist/types/adapters/asyncStorage.d.ts +2 -2
  106. package/dist/types/adapters/expo.d.ts +4 -4
  107. package/dist/types/adapters/fileSystem.d.ts +2 -2
  108. package/dist/types/adapters/indexedDB.d.ts +2 -2
  109. package/dist/types/adapters/localStorage.d.ts +2 -2
  110. package/dist/types/arkfee/index.d.ts +2 -2
  111. package/dist/types/arknote/index.d.ts +2 -2
  112. package/dist/types/bip322/index.d.ts +1 -1
  113. package/dist/types/contracts/arkcontract.d.ts +1 -1
  114. package/dist/types/contracts/contractManager.d.ts +22 -6
  115. package/dist/types/contracts/contractWatcher.d.ts +3 -3
  116. package/dist/types/contracts/handlers/default.d.ts +3 -3
  117. package/dist/types/contracts/handlers/delegate.d.ts +3 -3
  118. package/dist/types/contracts/handlers/helpers.d.ts +1 -1
  119. package/dist/types/contracts/handlers/index.d.ts +7 -7
  120. package/dist/types/contracts/handlers/registry.d.ts +1 -1
  121. package/dist/types/contracts/handlers/vhtlc.d.ts +3 -3
  122. package/dist/types/contracts/index.d.ts +14 -14
  123. package/dist/types/contracts/types.d.ts +3 -3
  124. package/dist/types/contracts/vtxoOwnership.d.ts +9 -1
  125. package/dist/types/extension/asset/assetGroup.d.ts +6 -6
  126. package/dist/types/extension/asset/assetId.d.ts +1 -1
  127. package/dist/types/extension/asset/assetInput.d.ts +2 -2
  128. package/dist/types/extension/asset/assetOutput.d.ts +1 -1
  129. package/dist/types/extension/asset/assetRef.d.ts +3 -3
  130. package/dist/types/extension/asset/index.d.ts +8 -8
  131. package/dist/types/extension/asset/metadata.d.ts +1 -1
  132. package/dist/types/extension/asset/packet.d.ts +2 -2
  133. package/dist/types/extension/index.d.ts +6 -6
  134. package/dist/types/forfeit.d.ts +1 -1
  135. package/dist/types/identity/descriptorProvider.d.ts +1 -1
  136. package/dist/types/identity/hdCapableIdentity.d.ts +3 -3
  137. package/dist/types/identity/index.d.ts +11 -11
  138. package/dist/types/identity/seedIdentity.d.ts +5 -5
  139. package/dist/types/identity/serialize.d.ts +1 -1
  140. package/dist/types/identity/singleKey.d.ts +3 -3
  141. package/dist/types/identity/staticDescriptorProvider.d.ts +3 -3
  142. package/dist/types/index.d.ts +57 -57
  143. package/dist/types/intent/index.d.ts +2 -2
  144. package/dist/types/musig2/index.d.ts +4 -4
  145. package/dist/types/providers/ark.d.ts +5 -5
  146. package/dist/types/providers/delegator.d.ts +2 -2
  147. package/dist/types/providers/electrum.d.ts +5 -5
  148. package/dist/types/providers/expoArk.d.ts +1 -1
  149. package/dist/types/providers/expoIndexer.d.ts +1 -1
  150. package/dist/types/providers/indexer.d.ts +1 -1
  151. package/dist/types/providers/onchain.d.ts +2 -2
  152. package/dist/types/repositories/contractRepository.d.ts +1 -1
  153. package/dist/types/repositories/inMemory/contractRepository.d.ts +2 -2
  154. package/dist/types/repositories/inMemory/walletRepository.d.ts +5 -2
  155. package/dist/types/repositories/index.d.ts +9 -9
  156. package/dist/types/repositories/indexedDB/contractRepository.d.ts +2 -2
  157. package/dist/types/repositories/indexedDB/db.d.ts +3 -3
  158. package/dist/types/repositories/indexedDB/walletRepository.d.ts +5 -2
  159. package/dist/types/repositories/migrations/contractRepositoryImpl.d.ts +3 -3
  160. package/dist/types/repositories/migrations/fromStorageAdapter.d.ts +2 -2
  161. package/dist/types/repositories/migrations/walletRepositoryImpl.d.ts +3 -3
  162. package/dist/types/repositories/realm/contractRepository.d.ts +3 -3
  163. package/dist/types/repositories/realm/index.d.ts +4 -4
  164. package/dist/types/repositories/realm/walletRepository.d.ts +6 -3
  165. package/dist/types/repositories/serialization.d.ts +11 -11
  166. package/dist/types/repositories/sqlite/contractRepository.d.ts +3 -3
  167. package/dist/types/repositories/sqlite/index.d.ts +3 -3
  168. package/dist/types/repositories/sqlite/walletRepository.d.ts +6 -3
  169. package/dist/types/repositories/walletRepository.d.ts +22 -1
  170. package/dist/types/script/address.d.ts +2 -2
  171. package/dist/types/script/base.d.ts +2 -2
  172. package/dist/types/script/default.d.ts +2 -2
  173. package/dist/types/script/delegate.d.ts +3 -3
  174. package/dist/types/script/vhtlc.d.ts +2 -2
  175. package/dist/types/storage/asyncStorage.d.ts +1 -1
  176. package/dist/types/storage/fileSystem.d.ts +1 -1
  177. package/dist/types/storage/inMemory.d.ts +1 -1
  178. package/dist/types/storage/indexedDB.d.ts +1 -1
  179. package/dist/types/storage/localStorage.d.ts +1 -1
  180. package/dist/types/tree/signingSession.d.ts +2 -2
  181. package/dist/types/tree/validation.d.ts +1 -1
  182. package/dist/types/utils/arkTransaction.d.ts +5 -5
  183. package/dist/types/utils/syncCursors.d.ts +1 -1
  184. package/dist/types/utils/timelock.d.ts +1 -1
  185. package/dist/types/utils/transaction.d.ts +2 -2
  186. package/dist/types/utils/transactionHistory.d.ts +1 -1
  187. package/dist/types/utils/txSizeEstimator.d.ts +1 -1
  188. package/dist/types/wallet/asset-manager.d.ts +3 -3
  189. package/dist/types/wallet/asset.d.ts +2 -2
  190. package/dist/types/wallet/batch.d.ts +2 -2
  191. package/dist/types/wallet/delegator.d.ts +5 -5
  192. package/dist/types/wallet/expo/background.d.ts +4 -4
  193. package/dist/types/wallet/expo/index.d.ts +4 -4
  194. package/dist/types/wallet/expo/wallet.d.ts +8 -8
  195. package/dist/types/wallet/hdDescriptorProvider.d.ts +4 -4
  196. package/dist/types/wallet/index.d.ts +29 -26
  197. package/dist/types/wallet/onchain.d.ts +6 -6
  198. package/dist/types/wallet/ramps.d.ts +2 -2
  199. package/dist/types/wallet/serviceWorker/wallet-message-handler.d.ts +21 -9
  200. package/dist/types/wallet/serviceWorker/wallet.d.ts +10 -10
  201. package/dist/types/wallet/unroll.d.ts +6 -6
  202. package/dist/types/wallet/utils.d.ts +5 -5
  203. package/dist/types/wallet/validation.d.ts +3 -3
  204. package/dist/types/wallet/vtxo-manager.d.ts +34 -7
  205. package/dist/types/wallet/wallet.d.ts +20 -20
  206. package/dist/types/worker/expo/asyncStorageTaskQueue.d.ts +1 -1
  207. package/dist/types/worker/expo/index.d.ts +7 -7
  208. package/dist/types/worker/expo/processors/contractPollProcessor.d.ts +1 -1
  209. package/dist/types/worker/expo/processors/index.d.ts +1 -1
  210. package/dist/types/worker/expo/taskRunner.d.ts +7 -7
  211. package/dist/types/worker/messageBus.d.ts +6 -6
  212. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  import { Bytes } from "@scure/btc-signer/utils.js";
2
- import { TapLeafScript, VtxoScript } from "./base";
3
- import { RelativeTimelock } from "./tapscript";
2
+ import { TapLeafScript, VtxoScript } from "./base.js";
3
+ import { RelativeTimelock } from "./tapscript.js";
4
4
  /**
5
5
  * DefaultVtxo is the default implementation of a VtxoScript.
6
6
  * It contains 1 forfeit path and 1 exit path.
@@ -1,6 +1,6 @@
1
- import { Bytes } from "@scure/btc-signer/utils";
2
- import { DefaultVtxo } from "./default";
3
- import { TapLeafScript, VtxoScript } from "./base";
1
+ import { Bytes } from "@scure/btc-signer/utils.js";
2
+ import { DefaultVtxo } from "./default.js";
3
+ import { TapLeafScript, VtxoScript } from "./base.js";
4
4
  /**
5
5
  * DelegateVtxo extends DefaultVtxo with an extra delegator path
6
6
  */
@@ -1,6 +1,6 @@
1
1
  import { Bytes } from "@scure/btc-signer/utils.js";
2
- import { RelativeTimelock } from "./tapscript";
3
- import { TapLeafScript, VtxoScript } from "./base";
2
+ import { RelativeTimelock } from "./tapscript.js";
3
+ import { TapLeafScript, VtxoScript } from "./base.js";
4
4
  /** Virtual Hash Time Lock Contract (VHTLC) namespace. */
5
5
  export declare namespace VHTLC {
6
6
  interface Options {
@@ -1,4 +1,4 @@
1
- import type { StorageAdapter } from "./index";
1
+ import type { StorageAdapter } from "./index.js";
2
2
  /**
3
3
  * @deprecated Use repositories instead
4
4
  * Note: This requires @react-native-async-storage/async-storage to be installed
@@ -1,4 +1,4 @@
1
- import type { StorageAdapter } from "./index";
1
+ import type { StorageAdapter } from "./index.js";
2
2
  /**
3
3
  * @deprecated Use repository implementations via `StorageConfig` instead.
4
4
  */
@@ -1,4 +1,4 @@
1
- import type { StorageAdapter } from "./index";
1
+ import type { StorageAdapter } from "./index.js";
2
2
  /**
3
3
  * @deprecated Use repository implementations via `StorageConfig` instead.
4
4
  */
@@ -1,4 +1,4 @@
1
- import type { StorageAdapter } from "./index";
1
+ import type { StorageAdapter } from "./index.js";
2
2
  /**
3
3
  * @deprecated Use repository implementations via `StorageConfig` instead.
4
4
  */
@@ -1,4 +1,4 @@
1
- import type { StorageAdapter } from "./index";
1
+ import type { StorageAdapter } from "./index.js";
2
2
  /**
3
3
  * @deprecated Use repository implementations via `StorageConfig` instead.
4
4
  */
@@ -1,5 +1,5 @@
1
- import * as musig2 from "../musig2";
2
- import { TxTree } from "./txTree";
1
+ import * as musig2 from "../musig2/index.js";
2
+ import { TxTree } from "./txTree.js";
3
3
  export declare const ErrMissingVtxoGraph: Error;
4
4
  export declare const ErrMissingAggregateKey: Error;
5
5
  export type Musig2PublicNonce = Pick<musig2.Nonces, "pubNonce">;
@@ -1,5 +1,5 @@
1
1
  import { Transaction } from "@scure/btc-signer/transaction.js";
2
- import { TxTree } from "./txTree";
2
+ import { TxTree } from "./txTree.js";
3
3
  export declare const ErrInvalidSettlementTx: (tx: string) => Error;
4
4
  export declare const ErrInvalidSettlementTxOutputs: Error;
5
5
  export declare const ErrEmptyTree: Error;
@@ -1,9 +1,9 @@
1
1
  import { TransactionOutput } from "@scure/btc-signer/psbt.js";
2
- import { ExtendedCoin, VirtualCoin } from "../wallet";
3
- import { RelativeTimelock } from "../script/tapscript";
4
- import { EncodedVtxoScript, TapLeafScript } from "../script/base";
5
- import { CSVMultisigTapscript } from "../script/tapscript";
6
- import { Transaction } from "./transaction";
2
+ import { ExtendedCoin, VirtualCoin } from "../wallet/index.js";
3
+ import { RelativeTimelock } from "../script/tapscript.js";
4
+ import { EncodedVtxoScript, TapLeafScript } from "../script/base.js";
5
+ import { CSVMultisigTapscript } from "../script/tapscript.js";
6
+ import { Transaction } from "./transaction.js";
7
7
  export type ArkTxInput = {
8
8
  tapLeafScript: TapLeafScript;
9
9
  } & EncodedVtxoScript & Pick<VirtualCoin, "txid" | "vout" | "value">;
@@ -1,4 +1,4 @@
1
- import { WalletRepository, WalletState } from "../repositories/walletRepository";
1
+ import { WalletRepository, WalletState } from "../repositories/walletRepository.js";
2
2
  /** Lag behind real-time to avoid racing with indexer writes. */
3
3
  export declare const SAFETY_LAG_MS = 30000;
4
4
  /** Overlap window so boundary virtual outputs are never missed. */
@@ -1,4 +1,4 @@
1
- import type { RelativeTimelock } from "../script/tapscript";
1
+ import type { RelativeTimelock } from "../script/tapscript.js";
2
2
  /**
3
3
  * Convert RelativeTimelock to BIP68 sequence number.
4
4
  */
@@ -1,6 +1,6 @@
1
1
  import { Transaction as BtcSignerTransaction } from "@scure/btc-signer";
2
- import { TxOpts } from "@scure/btc-signer/transaction";
3
- import { Bytes } from "@scure/btc-signer/utils";
2
+ import { TxOpts } from "@scure/btc-signer/transaction.js";
3
+ import { Bytes } from "@scure/btc-signer/utils.js";
4
4
  /**
5
5
  * Transaction is a wrapper around the @scure/btc-signer Transaction class.
6
6
  * It adds the Arkade protocol specific options to the transaction.
@@ -1,4 +1,4 @@
1
- import { ArkTransaction, VirtualCoin } from "../wallet";
1
+ import { ArkTransaction, VirtualCoin } from "../wallet/index.js";
2
2
  type ExtendedArkTransaction = ArkTransaction & {
3
3
  tag: "offchain" | "boarding" | "exit" | "batch";
4
4
  };
@@ -1,4 +1,4 @@
1
- import { Network } from "../networks";
1
+ import { Network } from "../networks.js";
2
2
  export type VSize = {
3
3
  value: bigint;
4
4
  fee(feeRate: bigint): bigint;
@@ -1,6 +1,6 @@
1
- import { AssetDetails, BurnParams, IAssetManager, IReadonlyAssetManager, IssuanceParams, IssuanceResult, ReissuanceParams } from ".";
2
- import { IndexerProvider } from "../providers/indexer";
3
- import { Wallet } from "./wallet";
1
+ import { AssetDetails, BurnParams, IAssetManager, IReadonlyAssetManager, IssuanceParams, IssuanceResult, ReissuanceParams } from "./index.js";
2
+ import { IndexerProvider } from "../providers/indexer.js";
3
+ import { Wallet } from "./wallet.js";
4
4
  export declare class ReadonlyAssetManager implements IReadonlyAssetManager {
5
5
  readonly indexer: IndexerProvider;
6
6
  constructor(indexer: IndexerProvider);
@@ -1,5 +1,5 @@
1
- import { Packet } from "../extension/asset";
2
- import { Asset, ExtendedVirtualCoin, Recipient, VirtualCoin } from "./index";
1
+ import { Packet } from "../extension/asset/index.js";
2
+ import { Asset, ExtendedVirtualCoin, Recipient, VirtualCoin } from "./index.js";
3
3
  /**
4
4
  * Creates an asset packet from asset inputs and receivers.
5
5
  * Groups inputs and outputs by asset ID and creates the Packet object
@@ -1,5 +1,5 @@
1
- import type { BatchStartedEvent, BatchFinalizedEvent, BatchFailedEvent, TreeTxEvent, TreeSignatureEvent, TreeSigningStartedEvent, TreeNoncesEvent, BatchFinalizationEvent, SettlementEvent } from "../providers/ark";
2
- import { TxTree } from "../tree/txTree";
1
+ import type { BatchStartedEvent, BatchFinalizedEvent, BatchFailedEvent, TreeTxEvent, TreeSignatureEvent, TreeSigningStartedEvent, TreeNoncesEvent, BatchFinalizationEvent, SettlementEvent } from "../providers/ark.js";
2
+ import { TxTree } from "../tree/txTree.js";
3
3
  /**
4
4
  * Batch namespace provides utilities for joining and processing batch session.
5
5
  * The batch settlement process involves multiple events, this namespace provides abstractions and types to handle them.
@@ -1,8 +1,8 @@
1
- import { TransactionOutput } from "@scure/btc-signer/psbt";
2
- import { ArkProvider, DelegateInfo, Identity, Outpoint } from "..";
3
- import { ContractVtxo } from "../contracts/types";
4
- import { DelegatorProvider } from "../providers/delegator";
5
- import { Bytes } from "@scure/btc-signer/utils";
1
+ import { TransactionOutput } from "@scure/btc-signer/psbt.js";
2
+ import { ArkProvider, DelegateInfo, Identity, Outpoint } from "../index.js";
3
+ import { ContractVtxo } from "../contracts/types.js";
4
+ import { DelegatorProvider } from "../providers/delegator.js";
5
+ import { Bytes } from "@scure/btc-signer/utils.js";
6
6
  export interface IDelegatorManager {
7
7
  /**
8
8
  * Delegate virtual outputs to the remote delegation service.
@@ -1,7 +1,7 @@
1
- import type { WalletRepository } from "../../repositories/walletRepository";
2
- import type { ContractRepository } from "../../repositories/contractRepository";
3
- import type { AsyncStorageTaskQueue } from "../../worker/expo/asyncStorageTaskQueue";
4
- import type { TaskProcessor } from "../../worker/expo/taskRunner";
1
+ import type { WalletRepository } from "../../repositories/walletRepository.js";
2
+ import type { ContractRepository } from "../../repositories/contractRepository.js";
3
+ import type { AsyncStorageTaskQueue } from "../../worker/expo/asyncStorageTaskQueue.js";
4
+ import type { TaskProcessor } from "../../worker/expo/taskRunner.js";
5
5
  /**
6
6
  * Wallet parameters persisted by @see ExpoWallet.setup and read
7
7
  * by the background handler to reconstruct providers and `extendVtxo`
@@ -1,4 +1,4 @@
1
- export { ExpoWallet } from "./wallet";
2
- export type { ExpoWalletConfig, ExpoBackgroundConfig } from "./wallet";
3
- export { defineExpoBackgroundTask, registerExpoBackgroundTask, unregisterExpoBackgroundTask, } from "./background";
4
- export type { DefineBackgroundTaskOptions, PersistedBackgroundConfig, } from "./background";
1
+ export { ExpoWallet } from "./wallet.js";
2
+ export type { ExpoWalletConfig, ExpoBackgroundConfig } from "./wallet.js";
3
+ export { defineExpoBackgroundTask, registerExpoBackgroundTask, unregisterExpoBackgroundTask, } from "./background.js";
4
+ export type { DefineBackgroundTaskOptions, PersistedBackgroundConfig, } from "./background.js";
@@ -1,11 +1,11 @@
1
- import { Wallet } from "../wallet";
2
- import type { IWallet, IAssetManager, WalletBalance, WalletConfig, SendBitcoinParams, SettleParams, GetVtxosFilter, ArkTransaction, ExtendedCoin, ExtendedVirtualCoin, Recipient } from "..";
3
- import type { SettlementEvent } from "../../providers/ark";
4
- import type { Identity } from "../../identity";
5
- import type { IContractManager } from "../../contracts/contractManager";
6
- import type { IDelegatorManager } from "../delegator";
7
- import type { TaskQueue } from "../../worker/expo/taskQueue";
8
- import type { TaskProcessor } from "../../worker/expo/taskRunner";
1
+ import { Wallet } from "../wallet.js";
2
+ import type { IWallet, IAssetManager, WalletBalance, WalletConfig, SendBitcoinParams, SettleParams, GetVtxosFilter, ArkTransaction, ExtendedCoin, ExtendedVirtualCoin, Recipient } from "../index.js";
3
+ import type { SettlementEvent } from "../../providers/ark.js";
4
+ import type { Identity } from "../../identity/index.js";
5
+ import type { IContractManager } from "../../contracts/contractManager.js";
6
+ import type { IDelegatorManager } from "../delegator.js";
7
+ import type { TaskQueue } from "../../worker/expo/taskQueue.js";
8
+ import type { TaskProcessor } from "../../worker/expo/taskRunner.js";
9
9
  /**
10
10
  * Background processing configuration for @see ExpoWallet.
11
11
  */
@@ -1,7 +1,7 @@
1
- import { DescriptorProvider, DescriptorSigningRequest } from "../identity/descriptorProvider";
2
- import { HDCapableIdentity } from "../identity/hdCapableIdentity";
3
- import { WalletRepository } from "../repositories/walletRepository";
4
- import { Transaction } from "../utils/transaction";
1
+ import { DescriptorProvider, DescriptorSigningRequest } from "../identity/descriptorProvider.js";
2
+ import { HDCapableIdentity } from "../identity/hdCapableIdentity.js";
3
+ import { WalletRepository } from "../repositories/walletRepository.js";
4
+ import { Transaction } from "../utils/transaction.js";
5
5
  /**
6
6
  * HD-wallet {@link DescriptorProvider} that allocates a fresh signing
7
7
  * descriptor on every call. The provider holds no notion of "current" — it
@@ -1,20 +1,20 @@
1
1
  import { Bytes } from "@scure/btc-signer/utils.js";
2
- import { ArkProvider, Output, SettlementEvent } from "../providers/ark";
3
- import { Identity, ReadonlyIdentity } from "../identity";
4
- import { RelativeTimelock } from "../script/tapscript";
5
- import { EncodedVtxoScript, TapLeafScript } from "../script/base";
6
- import { RenewalConfig, SettlementConfig } from "./vtxo-manager";
7
- import { IndexerProvider } from "../providers/indexer";
8
- import { OnchainProvider } from "../providers/onchain";
9
- import { ContractWatcherConfig } from "../contracts/contractWatcher";
10
- import { ContractRepository, WalletRepository } from "../repositories";
11
- import { IContractManager } from "../contracts/contractManager";
12
- import { IDelegatorManager } from "./delegator";
13
- import { DelegatorProvider } from "../providers/delegator";
2
+ import { ArkProvider, Output, SettlementEvent } from "../providers/ark.js";
3
+ import { Identity, ReadonlyIdentity } from "../identity/index.js";
4
+ import { RelativeTimelock } from "../script/tapscript.js";
5
+ import { EncodedVtxoScript, TapLeafScript } from "../script/base.js";
6
+ import { RenewalConfig, SettlementConfig } from "./vtxo-manager.js";
7
+ import { IndexerProvider } from "../providers/indexer.js";
8
+ import { OnchainProvider } from "../providers/onchain.js";
9
+ import { ContractWatcherConfig } from "../contracts/contractWatcher.js";
10
+ import { ContractRepository, WalletRepository } from "../repositories/index.js";
11
+ import { IContractManager } from "../contracts/contractManager.js";
12
+ import { IDelegatorManager } from "./delegator.js";
13
+ import { DelegatorProvider } from "../providers/delegator.js";
14
14
  /** Defaults */
15
15
  export declare const DEFAULT_ARKADE_SERVER_URL: "https://arkade.computer";
16
- export declare const DEFAULT_ARKADE_HRP = "ark";
17
- export declare const DEFAULT_NETWORK_NAME = "bitcoin";
16
+ export declare const DEFAULT_ARKADE_HRP: "ark";
17
+ export declare const DEFAULT_NETWORK_NAME: "bitcoin";
18
18
  /**
19
19
  * Base configuration options shared by all wallet types.
20
20
  *
@@ -472,24 +472,27 @@ export interface Coin extends Outpoint {
472
472
  * @see VirtualStatus
473
473
  */
474
474
  export interface VirtualCoin extends Coin {
475
- /** Virtual output status */
476
- virtualStatus: VirtualStatus;
477
- /** Transaction id that spent this virtual output, when known. */
478
- spentBy?: string;
479
- /** Settlement transaction associated with this virtual output, when known. */
480
- settledBy?: string;
481
- /** Arkade transaction id that created or spent this virtual output, when known. */
482
- arkTxId?: string;
483
475
  /** Creation time of the virtual output. */
484
476
  createdAt: Date;
485
- /** Whether this virtual output has been unrolled to onchain outputs. */
477
+ /** The scriptPubKey (hex) locking this virtual output, as returned by the indexer. */
478
+ script: string;
479
+ /** Whether this virtual output has been broadcasted onchain via an unroll (unilateral exit). */
486
480
  isUnrolled: boolean;
487
- /** Whether this virtual output is already spent. */
481
+ /**
482
+ * Whether this virtual output is already spent (boolean helper for `spentBy`).
483
+ * This is not set to true if the virtual output is unrolled or swept, only when it's spent offchain.
484
+ */
488
485
  isSpent?: boolean;
486
+ /** ID of the onchain commitment transaction that settled this output, if applicable. */
487
+ settledBy?: string;
488
+ /** ID of the offchain checkpoint transaction that spent this output, if applicable. */
489
+ spentBy?: string;
490
+ /** ID of the offchain Arkade transaction that spent the above checkpoint output, if applicable. */
491
+ arkTxId?: string;
492
+ /** Virtual output status */
493
+ virtualStatus: VirtualStatus;
489
494
  /** Assets carried by this virtual output, if any. */
490
495
  assets?: Asset[];
491
- /** The scriptPubKey (hex) locking this virtual output, as returned by the indexer. */
492
- script: string;
493
496
  }
494
497
  /** Wallet transaction direction. */
495
498
  export declare enum TxType {
@@ -1,10 +1,10 @@
1
1
  import { P2TR } from "@scure/btc-signer/payment.js";
2
- import { Coin, SendBitcoinParams } from ".";
3
- import { Identity } from "../identity";
4
- import { Network, NetworkName } from "../networks";
5
- import { OnchainProvider } from "../providers/onchain";
6
- import { AnchorBumper } from "../utils/anchor";
7
- import { Transaction } from "../utils/transaction";
2
+ import { Coin, SendBitcoinParams } from "./index.js";
3
+ import { Identity } from "../identity/index.js";
4
+ import { Network, NetworkName } from "../networks.js";
5
+ import { OnchainProvider } from "../providers/onchain.js";
6
+ import { AnchorBumper } from "../utils/anchor.js";
7
+ import { Transaction } from "../utils/transaction.js";
8
8
  /**
9
9
  * Onchain Bitcoin wallet implementation for traditional Bitcoin transactions.
10
10
  *
@@ -1,5 +1,5 @@
1
- import { ExtendedCoin, IWallet } from ".";
2
- import { FeeInfo, SettlementEvent } from "../providers/ark";
1
+ import { ExtendedCoin, IWallet } from "./index.js";
2
+ import { FeeInfo, SettlementEvent } from "../providers/ark.js";
3
3
  /**
4
4
  * Ramps is a class wrapping `settle` method to provide a more convenient interface for onboarding and offboarding operations.
5
5
  *
@@ -1,10 +1,10 @@
1
- import { SettlementEvent } from "../../providers/ark";
2
- import type { Contract, ContractEvent, ContractWithVtxos, GetContractsFilter, PathSelection } from "../../contracts";
3
- import type { CreateContractParams, GetAllSpendingPathsOptions, GetSpendablePathsOptions } from "../../contracts/contractManager";
4
- import { ArkTransaction, AssetDetails, BurnParams, ExtendedCoin, ExtendedVirtualCoin, GetVtxosFilter, IssuanceParams, IssuanceResult, IWallet, Recipient, ReissuanceParams, SendBitcoinParams, SettleParams, VirtualCoin, WalletBalance } from "../index";
5
- import { DelegateInfo } from "../../providers/delegator";
6
- import { MessageHandler, RequestEnvelope, ResponseEnvelope } from "../../worker/messageBus";
7
- import { Transaction } from "../../utils/transaction";
1
+ import { SettlementEvent } from "../../providers/ark.js";
2
+ import type { Contract, ContractEvent, ContractWithVtxos, GetContractsFilter, PathSelection } from "../../contracts/index.js";
3
+ import type { CreateContractParams, GetAllSpendingPathsOptions, GetSpendablePathsOptions } from "../../contracts/contractManager.js";
4
+ import { ArkTransaction, AssetDetails, BurnParams, ExtendedCoin, ExtendedVirtualCoin, GetVtxosFilter, IssuanceParams, IssuanceResult, IWallet, Recipient, ReissuanceParams, SendBitcoinParams, SettleParams, VirtualCoin, WalletBalance } from "../index.js";
5
+ import { DelegateInfo } from "../../providers/delegator.js";
6
+ import { MessageHandler, RequestEnvelope, ResponseEnvelope } from "../../worker/messageBus.js";
7
+ import { Transaction } from "../../utils/transaction.js";
8
8
  export declare class WalletNotInitializedError extends Error {
9
9
  constructor();
10
10
  }
@@ -259,6 +259,18 @@ export type RequestRefreshVtxos = RequestEnvelope & {
259
259
  export type ResponseRefreshVtxos = ResponseEnvelope & {
260
260
  type: "REFRESH_VTXOS_SUCCESS";
261
261
  };
262
+ export type RequestRefreshOutpoints = RequestEnvelope & {
263
+ type: "REFRESH_OUTPOINTS";
264
+ payload: {
265
+ outpoints: {
266
+ txid: string;
267
+ vout: number;
268
+ }[];
269
+ };
270
+ };
271
+ export type ResponseRefreshOutpoints = ResponseEnvelope & {
272
+ type: "REFRESH_OUTPOINTS_SUCCESS";
273
+ };
262
274
  export type RequestGetAllSpendingPaths = RequestEnvelope & {
263
275
  type: "GET_ALL_SPENDING_PATHS";
264
276
  payload: {
@@ -463,8 +475,8 @@ export type ResponseSweepExpiredBoardingUtxos = ResponseEnvelope & {
463
475
  txid: string;
464
476
  };
465
477
  };
466
- export type WalletUpdaterRequest = RequestInitWallet | RequestSettle | RequestSendBitcoin | RequestGetAddress | RequestGetBoardingAddress | RequestGetBalance | RequestGetVtxos | RequestGetBoardingUtxos | RequestGetTransactionHistory | RequestGetStatus | RequestClear | RequestReloadWallet | RequestSignTransaction | RequestCreateContract | RequestGetContracts | RequestGetContractsWithVtxos | RequestAnnotateVtxos | RequestUpdateContract | RequestDeleteContract | RequestGetSpendablePaths | RequestGetAllSpendingPaths | RequestIsContractManagerWatching | RequestRefreshVtxos | RequestSend | RequestGetAssetDetails | RequestIssue | RequestReissue | RequestBurn | RequestDelegate | RequestGetDelegateInfo | RequestRecoverVtxos | RequestGetRecoverableBalance | RequestGetExpiringVtxos | RequestRenewVtxos | RequestGetExpiredBoardingUtxos | RequestSweepExpiredBoardingUtxos;
467
- export type WalletUpdaterResponse = ResponseEnvelope & (ResponseInitWallet | ResponseSettle | ResponseSettleEvent | ResponseSendBitcoin | ResponseGetAddress | ResponseGetBoardingAddress | ResponseGetBalance | ResponseGetVtxos | ResponseGetBoardingUtxos | ResponseGetTransactionHistory | ResponseGetStatus | ResponseClear | ResponseReloadWallet | ResponseUtxoUpdate | ResponseVtxoUpdate | ResponseSignTransaction | ResponseCreateContract | ResponseGetContracts | ResponseGetContractsWithVtxos | ResponseAnnotateVtxos | ResponseUpdateContract | ResponseDeleteContract | ResponseGetSpendablePaths | ResponseGetAllSpendingPaths | ResponseIsContractManagerWatching | ResponseRefreshVtxos | ResponseContractEvent | ResponseSend | ResponseGetAssetDetails | ResponseIssue | ResponseReissue | ResponseBurn | ResponseDelegate | ResponseGetDelegateInfo | ResponseRecoverVtxos | ResponseRecoverVtxosEvent | ResponseGetRecoverableBalance | ResponseGetExpiringVtxos | ResponseRenewVtxos | ResponseRenewVtxosEvent | ResponseGetExpiredBoardingUtxos | ResponseSweepExpiredBoardingUtxos);
478
+ export type WalletUpdaterRequest = RequestInitWallet | RequestSettle | RequestSendBitcoin | RequestGetAddress | RequestGetBoardingAddress | RequestGetBalance | RequestGetVtxos | RequestGetBoardingUtxos | RequestGetTransactionHistory | RequestGetStatus | RequestClear | RequestReloadWallet | RequestSignTransaction | RequestCreateContract | RequestGetContracts | RequestGetContractsWithVtxos | RequestAnnotateVtxos | RequestUpdateContract | RequestDeleteContract | RequestGetSpendablePaths | RequestGetAllSpendingPaths | RequestIsContractManagerWatching | RequestRefreshVtxos | RequestRefreshOutpoints | RequestSend | RequestGetAssetDetails | RequestIssue | RequestReissue | RequestBurn | RequestDelegate | RequestGetDelegateInfo | RequestRecoverVtxos | RequestGetRecoverableBalance | RequestGetExpiringVtxos | RequestRenewVtxos | RequestGetExpiredBoardingUtxos | RequestSweepExpiredBoardingUtxos;
479
+ export type WalletUpdaterResponse = ResponseEnvelope & (ResponseInitWallet | ResponseSettle | ResponseSettleEvent | ResponseSendBitcoin | ResponseGetAddress | ResponseGetBoardingAddress | ResponseGetBalance | ResponseGetVtxos | ResponseGetBoardingUtxos | ResponseGetTransactionHistory | ResponseGetStatus | ResponseClear | ResponseReloadWallet | ResponseUtxoUpdate | ResponseVtxoUpdate | ResponseSignTransaction | ResponseCreateContract | ResponseGetContracts | ResponseGetContractsWithVtxos | ResponseAnnotateVtxos | ResponseUpdateContract | ResponseDeleteContract | ResponseGetSpendablePaths | ResponseGetAllSpendingPaths | ResponseIsContractManagerWatching | ResponseRefreshVtxos | ResponseRefreshOutpoints | ResponseContractEvent | ResponseSend | ResponseGetAssetDetails | ResponseIssue | ResponseReissue | ResponseBurn | ResponseDelegate | ResponseGetDelegateInfo | ResponseRecoverVtxos | ResponseRecoverVtxosEvent | ResponseGetRecoverableBalance | ResponseGetExpiringVtxos | ResponseRenewVtxos | ResponseRenewVtxosEvent | ResponseGetExpiredBoardingUtxos | ResponseSweepExpiredBoardingUtxos);
468
480
  export declare class WalletMessageHandler implements MessageHandler<WalletUpdaterRequest, WalletUpdaterResponse> {
469
481
  readonly messageTag: string;
470
482
  private wallet;
@@ -1,13 +1,13 @@
1
- import { IWallet, WalletBalance, SendBitcoinParams, SettleParams, ArkTransaction, ExtendedCoin, ExtendedVirtualCoin, GetVtxosFilter, StorageConfig, IReadonlyWallet, IReadonlyAssetManager, IAssetManager, Recipient } from "..";
2
- import { SettlementEvent } from "../../providers/ark";
3
- import { Identity, ReadonlyIdentity, type SerializedIdentity, type LegacySerializedIdentity } from "../../identity";
4
- import { WalletRepository } from "../../repositories/walletRepository";
5
- import { ContractRepository } from "../../repositories/contractRepository";
6
- import { RequestInitWallet, ResponseGetStatus, WalletUpdaterRequest, WalletUpdaterResponse } from "./wallet-message-handler";
7
- import type { IContractManager } from "../../contracts/contractManager";
8
- import type { IDelegatorManager } from "../delegator";
9
- import type { IVtxoManager, SettlementConfig } from "../vtxo-manager";
10
- import type { ContractWatcherConfig } from "../../contracts/contractWatcher";
1
+ import { IWallet, WalletBalance, SendBitcoinParams, SettleParams, ArkTransaction, ExtendedCoin, ExtendedVirtualCoin, GetVtxosFilter, StorageConfig, IReadonlyWallet, IReadonlyAssetManager, IAssetManager, Recipient } from "../index.js";
2
+ import { SettlementEvent } from "../../providers/ark.js";
3
+ import { Identity, ReadonlyIdentity, type SerializedIdentity, type LegacySerializedIdentity } from "../../identity/index.js";
4
+ import { WalletRepository } from "../../repositories/walletRepository.js";
5
+ import { ContractRepository } from "../../repositories/contractRepository.js";
6
+ import { RequestInitWallet, ResponseGetStatus, WalletUpdaterRequest, WalletUpdaterResponse } from "./wallet-message-handler.js";
7
+ import type { IContractManager } from "../../contracts/contractManager.js";
8
+ import type { IDelegatorManager } from "../delegator.js";
9
+ import type { IVtxoManager, SettlementConfig } from "../vtxo-manager.js";
10
+ import type { ContractWatcherConfig } from "../../contracts/contractWatcher.js";
11
11
  type RequestType = WalletUpdaterRequest["type"];
12
12
  export type MessageTimeouts = Partial<Record<RequestType, number>>;
13
13
  export declare const DEFAULT_MESSAGE_TIMEOUTS: Readonly<Record<RequestType, number>>;
@@ -1,9 +1,9 @@
1
- import { ChainTx, IndexerProvider } from "../providers/indexer";
2
- import { AnchorBumper } from "../utils/anchor";
3
- import { OnchainProvider } from "../providers/onchain";
4
- import { Outpoint } from ".";
5
- import { Wallet } from "./wallet";
6
- import { Transaction } from "../utils/transaction";
1
+ import { ChainTx, IndexerProvider } from "../providers/indexer.js";
2
+ import { AnchorBumper } from "../utils/anchor.js";
3
+ import { OnchainProvider } from "../providers/onchain.js";
4
+ import { Outpoint } from "./index.js";
5
+ import { Wallet } from "./wallet.js";
6
+ import { Transaction } from "../utils/transaction.js";
7
7
  export declare namespace Unroll {
8
8
  enum StepType {
9
9
  UNROLL = 0,
@@ -1,8 +1,8 @@
1
- import { Recipient } from ".";
2
- import { type Coin, type ExtendedCoin, type ExtendedVirtualCoin, type VirtualCoin } from "..";
3
- import type { Contract } from "../contracts/types";
4
- import { ReadonlyWallet } from "./wallet";
5
- import { Bytes } from "@scure/btc-signer/utils";
1
+ import { Recipient } from "./index.js";
2
+ import { type Coin, type ExtendedCoin, type ExtendedVirtualCoin, type VirtualCoin } from "../index.js";
3
+ import type { Contract } from "../contracts/types.js";
4
+ import { ReadonlyWallet } from "./wallet.js";
5
+ import { Bytes } from "@scure/btc-signer/utils.js";
6
6
  export declare const DUST_AMOUNT = 546;
7
7
  export declare function extendCoin(wallet: {
8
8
  boardingTapscript: ReadonlyWallet["boardingTapscript"];
@@ -1,6 +1,6 @@
1
- import { Recipient } from ".";
2
- import { Transaction } from "../utils/transaction";
3
- import type { Network } from "../networks";
1
+ import { Recipient } from "./index.js";
2
+ import { Transaction } from "../utils/transaction.js";
3
+ import type { Network } from "../networks.js";
4
4
  export declare const ErrOffchainOutputNotFound: (address: string) => Error;
5
5
  export declare const ErrInvalidAssetOutputAmount: (got: bigint, want: bigint, assetId: string) => Error;
6
6
  export declare const ErrAssetGroupNotFound: (assetId: string) => Error;
@@ -1,5 +1,5 @@
1
- import { ExtendedCoin, ExtendedVirtualCoin, IWallet } from ".";
2
- import { SettlementEvent } from "../providers/ark";
1
+ import { ExtendedCoin, ExtendedVirtualCoin, IWallet } from "./index.js";
2
+ import { SettlementEvent } from "../providers/ark.js";
3
3
  /** Default renewal threshold in seconds (3 days). */
4
4
  export declare const DEFAULT_THRESHOLD_SECONDS: number;
5
5
  /**
@@ -410,13 +410,40 @@ export declare class VtxoManager implements AsyncDisposable, IVtxoManager {
410
410
  /**
411
411
  * VTXO_ALREADY_SPENT means the server's authoritative view of VTXO state
412
412
  * is ahead of ours — cross-instance race, pre-lock snapshot drift, or an
413
- * SSE gap left stale data in the local cache. Silent-swallowing guarantees
414
- * the same error on the next cycle because nothing reconciles the cache,
415
- * so instead we trigger a full refreshVtxos() to advance the global sync
416
- * cursor. Throttled to prevent a buggy indexer from causing a refresh
417
- * storm.
413
+ * SSE gap left stale data in the local cache. Silent-swallowing
414
+ * guarantees the same error on the next cycle because nothing
415
+ * reconciles the cache.
416
+ *
417
+ * The cursor-derived delta sync filters by `created_at`, so a VTXO that
418
+ * was created before the cursor but spent recently can never be
419
+ * reconciled by `refreshVtxos()`. Use `refreshOutpoints` for surgical
420
+ * recovery: query the indexer for the specific stale outpoint and
421
+ * upsert its authoritative state into the wallet repository.
422
+ *
423
+ * Throttled because the same VTXO can fire repeatedly before the
424
+ * upsert observably propagates through the renewal selector.
418
425
  */
419
426
  private maybeRefreshAfterVtxoSpent;
427
+ /**
428
+ * Extract the offending VTXO outpoint from a `VTXO_ALREADY_SPENT` error,
429
+ * if the server attached one in `metadata.vtxo_outpoint`. Returns
430
+ * `undefined` when the error isn't a parsed ArkError, isn't this code,
431
+ * or doesn't carry the metadata.
432
+ */
433
+ private extractSpentOutpoint;
434
+ /**
435
+ * Reconcile the chosen VTXOs with the indexer's authoritative state
436
+ * before submitting a settle intent. Pulls the canonical record for
437
+ * each candidate outpoint via {@link IContractManager.refreshOutpoints}
438
+ * (which upserts the result into the wallet repository), then
439
+ * re-selects through the standard expiring-vtxo filter so anything
440
+ * the refresh flagged as spent is dropped.
441
+ *
442
+ * Best-effort: a failed refresh just falls back to the original
443
+ * candidates and lets the post-submit `VTXO_ALREADY_SPENT` recovery
444
+ * handle whatever slipped through.
445
+ */
446
+ private revalidateBeforeSettle;
420
447
  /** Computes the next poll delay, applying exponential backoff on failures. */
421
448
  private getNextPollDelay;
422
449
  /**
@@ -1,24 +1,24 @@
1
1
  import { TransactionOutput } from "@scure/btc-signer/psbt.js";
2
2
  import { Bytes } from "@scure/btc-signer/utils.js";
3
- import { ArkAddress } from "../script/address";
4
- import { DefaultVtxo } from "../script/default";
5
- import { Network, NetworkName } from "../networks";
6
- import { OnchainProvider } from "../providers/onchain";
7
- import { ArkProvider, SettlementEvent, SignedIntent } from "../providers/ark";
8
- import { SignerSession } from "../tree/signingSession";
9
- import { Identity, ReadonlyIdentity } from "../identity";
10
- import { ArkTransaction, Coin, ExtendedCoin, ExtendedVirtualCoin, GetVtxosFilter, IAssetManager, IReadonlyAssetManager, IReadonlyWallet, IWallet, ReadonlyWalletConfig, Recipient, SendBitcoinParams, SettleParams, WalletBalance, WalletConfig } from ".";
11
- import { CSVMultisigTapscript, RelativeTimelock } from "../script/tapscript";
12
- import { SettlementConfig, VtxoManager } from "./vtxo-manager";
13
- import { Intent } from "../intent";
14
- import { IndexerProvider } from "../providers/indexer";
15
- import { WalletRepository } from "../repositories/walletRepository";
16
- import { ContractRepository } from "../repositories/contractRepository";
17
- import { Batch } from "./batch";
18
- import { DelegatorProvider } from "../providers/delegator";
19
- import { DelegateVtxo } from "../script/delegate";
20
- import { IDelegatorManager } from "./delegator";
21
- import { ContractManager } from "../contracts/contractManager";
3
+ import { ArkAddress } from "../script/address.js";
4
+ import { DefaultVtxo } from "../script/default.js";
5
+ import { Network, NetworkName } from "../networks.js";
6
+ import { OnchainProvider } from "../providers/onchain.js";
7
+ import { ArkProvider, SettlementEvent, SignedIntent } from "../providers/ark.js";
8
+ import { SignerSession } from "../tree/signingSession.js";
9
+ import { Identity, ReadonlyIdentity } from "../identity/index.js";
10
+ import { ArkTransaction, Coin, ExtendedCoin, ExtendedVirtualCoin, GetVtxosFilter, IAssetManager, IReadonlyAssetManager, IReadonlyWallet, IWallet, ReadonlyWalletConfig, Recipient, SendBitcoinParams, SettleParams, WalletBalance, WalletConfig } from "./index.js";
11
+ import { CSVMultisigTapscript, RelativeTimelock } from "../script/tapscript.js";
12
+ import { SettlementConfig, VtxoManager } from "./vtxo-manager.js";
13
+ import { Intent } from "../intent/index.js";
14
+ import { IndexerProvider } from "../providers/indexer.js";
15
+ import { WalletRepository } from "../repositories/walletRepository.js";
16
+ import { ContractRepository } from "../repositories/contractRepository.js";
17
+ import { Batch } from "./batch.js";
18
+ import { DelegatorProvider } from "../providers/delegator.js";
19
+ import { DelegateVtxo } from "../script/delegate.js";
20
+ import { IDelegatorManager } from "./delegator.js";
21
+ import { ContractManager } from "../contracts/contractManager.js";
22
22
  export declare const getArkadeServerUrl: ({ arkServerUrl, }: {
23
23
  arkServerUrl?: string;
24
24
  }) => string;
@@ -67,7 +67,7 @@ export declare class ReadonlyWallet implements IReadonlyWallet {
67
67
  dustAmount: bigint;
68
68
  walletRepository: WalletRepository;
69
69
  contractRepository: ContractRepository;
70
- info: import("../providers/ark").ArkInfo;
70
+ info: import("../providers/ark.js").ArkInfo;
71
71
  delegatorProvider: DelegatorProvider | undefined;
72
72
  walletContractTimelocks: RelativeTimelock[];
73
73
  }>;
@@ -1,4 +1,4 @@
1
- import type { TaskItem, TaskResult, TaskQueue } from "./taskQueue";
1
+ import type { TaskItem, TaskResult, TaskQueue } from "./taskQueue.js";
2
2
  /**
3
3
  * Minimal async key-value storage interface.
4
4
  *
@@ -1,7 +1,7 @@
1
- export type { TaskItem, TaskResult, TaskQueue } from "./taskQueue";
2
- export { InMemoryTaskQueue } from "./taskQueue";
3
- export type { AsyncStorageLike } from "./asyncStorageTaskQueue";
4
- export { AsyncStorageTaskQueue } from "./asyncStorageTaskQueue";
5
- export type { TaskProcessor, TaskDependencies, CreateTaskDependenciesOptions, } from "./taskRunner";
6
- export { runTasks, createTaskDependencies } from "./taskRunner";
7
- export { contractPollProcessor, CONTRACT_POLL_TASK_TYPE } from "./processors";
1
+ export type { TaskItem, TaskResult, TaskQueue } from "./taskQueue.js";
2
+ export { InMemoryTaskQueue } from "./taskQueue.js";
3
+ export type { AsyncStorageLike } from "./asyncStorageTaskQueue.js";
4
+ export { AsyncStorageTaskQueue } from "./asyncStorageTaskQueue.js";
5
+ export type { TaskProcessor, TaskDependencies, CreateTaskDependenciesOptions, } from "./taskRunner.js";
6
+ export { runTasks, createTaskDependencies } from "./taskRunner.js";
7
+ export { contractPollProcessor, CONTRACT_POLL_TASK_TYPE } from "./processors/index.js";