@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,8 +1,8 @@
1
- import { Transaction } from "../utils/transaction";
2
- import { SignerSession } from "../tree/signingSession";
3
- import type { SerializedSigningIdentity, SerializedReadonlyIdentity } from "./serialize";
4
- import { DescriptorSigningRequest } from "./descriptorProvider";
5
- import { HDCapableIdentity, ReadonlyHDCapableIdentity } from "./hdCapableIdentity";
1
+ import { Transaction } from "../utils/transaction.js";
2
+ import { SignerSession } from "../tree/signingSession.js";
3
+ import type { SerializedSigningIdentity, SerializedReadonlyIdentity } from "./serialize.js";
4
+ import { DescriptorSigningRequest } from "./descriptorProvider.js";
5
+ import { HDCapableIdentity, ReadonlyHDCapableIdentity } from "./hdCapableIdentity.js";
6
6
  /** Used for default BIP86 derivation with network selection. */
7
7
  export interface NetworkOptions {
8
8
  /**
@@ -1,4 +1,4 @@
1
- import type { Identity, ReadonlyIdentity } from ".";
1
+ import type { Identity, ReadonlyIdentity } from "./index.js";
2
2
  /**
3
3
  * Tagged envelope for a signing identity transported across the
4
4
  * service-worker boundary. All variants are structured-clone safe
@@ -1,6 +1,6 @@
1
- import { Identity, ReadonlyIdentity } from ".";
2
- import { Transaction } from "../utils/transaction";
3
- import { SignerSession } from "../tree/signingSession";
1
+ import { Identity, ReadonlyIdentity } from "./index.js";
2
+ import { Transaction } from "../utils/transaction.js";
3
+ import { SignerSession } from "../tree/signingSession.js";
4
4
  /**
5
5
  * In-memory single key implementation for Bitcoin transaction signing.
6
6
  *
@@ -1,6 +1,6 @@
1
- import { Identity } from ".";
2
- import { DescriptorProvider, DescriptorSigningRequest } from "./descriptorProvider";
3
- import { Transaction } from "../utils/transaction";
1
+ import { Identity } from "./index.js";
2
+ import { DescriptorProvider, DescriptorSigningRequest } from "./descriptorProvider.js";
3
+ import { Transaction } from "../utils/transaction.js";
4
4
  /**
5
5
  * Wraps a legacy Identity (single-key) as a DescriptorProvider.
6
6
  * The descriptor is always a simple tr(pubkey) format.
@@ -1,59 +1,59 @@
1
- import { Transaction } from "./utils/transaction";
2
- import { SingleKey, ReadonlySingleKey } from "./identity/singleKey";
3
- import { SeedIdentity, MnemonicIdentity, ReadonlyDescriptorIdentity } from "./identity/seedIdentity";
4
- import type { SeedIdentityOptions, MnemonicOptions, NetworkOptions, DescriptorOptions } from "./identity/seedIdentity";
5
- import { Identity, ReadonlyIdentity, BatchSignableIdentity, SignRequest, isBatchSignable } from "./identity";
6
- import { ArkAddress } from "./script/address";
7
- import { VHTLC } from "./script/vhtlc";
8
- import { DefaultVtxo } from "./script/default";
9
- import { DelegateVtxo } from "./script/delegate";
10
- import { MessageHandler, RequestEnvelope, ResponseEnvelope, MessageBus } from "./worker/messageBus";
11
- import { VtxoScript, EncodedVtxoScript, TapLeafScript, TapTreeCoder, getSequence } from "./script/base";
12
- import { TxType, IWallet, IReadonlyWallet, BaseWalletConfig, WalletConfig, ReadonlyWalletConfig, ProviderClass, ArkTransaction, Coin, ExtendedCoin, ExtendedVirtualCoin, WalletBalance, SendBitcoinParams, SettleParams, Status, VirtualStatus, Outpoint, VirtualCoin, TxKey, GetVtxosFilter, TapLeaves, StorageConfig, isSpendable, isSubdust, isRecoverable, isExpired, Asset, Recipient, IssuanceParams, IssuanceResult, ReissuanceParams, BurnParams, AssetDetails, AssetMetadata, KnownMetadata } from "./wallet";
13
- import { Batch } from "./wallet/batch";
14
- import { Wallet, ReadonlyWallet, waitForIncomingFunds, IncomingFunds } from "./wallet/wallet";
15
- import { TxTree, TxTreeNode } from "./tree/txTree";
16
- import { SignerSession, TreeNonces, TreePartialSigs } from "./tree/signingSession";
17
- import { Ramps } from "./wallet/ramps";
18
- import { HDDescriptorProvider } from "./wallet/hdDescriptorProvider";
19
- import { isVtxoExpiringSoon, VtxoManager } from "./wallet/vtxo-manager";
20
- import type { IVtxoManager, SettlementConfig } from "./wallet/vtxo-manager";
21
- import { ServiceWorkerWallet, ServiceWorkerReadonlyWallet, DEFAULT_MESSAGE_TIMEOUTS } from "./wallet/serviceWorker/wallet";
22
- import type { MessageTimeouts } from "./wallet/serviceWorker/wallet";
23
- import { OnchainWallet } from "./wallet/onchain";
24
- import { setupServiceWorker } from "./worker/browser/utils";
25
- import { ESPLORA_URL, EsploraProvider, OnchainProvider, ExplorerTransaction } from "./providers/onchain";
26
- import { ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, ElectrumOnchainProvider, WsElectrumChainSource } from "./providers/electrum";
27
- import type { TransactionHistory as ElectrumTransactionHistory, BlockHeader as ElectrumBlockHeader, Unspent as ElectrumUnspent } from "./providers/electrum";
28
- import { RestArkProvider, ArkProvider, SettlementEvent, SettlementEventType, ArkInfo, SignedIntent, Output, TxNotification, BatchFinalizationEvent, BatchFinalizedEvent, BatchFailedEvent, TreeSigningStartedEvent, TreeNoncesEvent, BatchStartedEvent, TreeTxEvent, TreeSignatureEvent, ScheduledSession, FeeInfo } from "./providers/ark";
29
- import { DelegatorProvider, DelegateInfo, DelegateOptions, RestDelegatorProvider } from "./providers/delegator";
30
- import { CLTVMultisigTapscript, ConditionCSVMultisigTapscript, ConditionMultisigTapscript, CSVMultisigTapscript, decodeTapscript, MultisigTapscript, TapscriptType, ArkTapscript, RelativeTimelock } from "./script/tapscript";
31
- import { hasBoardingTxExpired, buildOffchainTx, verifyTapscriptSignatures, ArkTxInput, OffchainTx, combineTapscriptSigs, isValidArkAddress } from "./utils/arkTransaction";
32
- import { VtxoTaprootTree, ConditionWitness, getArkPsbtFields, setArkPsbtField, ArkPsbtFieldCoder, ArkPsbtFieldKey, ArkPsbtFieldKeyType, CosignerPublicKey, VtxoTreeExpiry } from "./utils/unknownFields";
33
- import { Intent } from "./intent";
34
- import { BIP322 } from "./bip322";
35
- import { ArkNote } from "./arknote";
36
- import { networks, Network, NetworkName } from "./networks";
37
- import { RestIndexerProvider, IndexerProvider, IndexerTxType, ChainTxType, PageResponse, BatchInfo, ChainTx, CommitmentTx, TxHistoryRecord, VtxoChain, Tx, Vtxo, PaginationOptions, SubscriptionResponse, SubscriptionHeartbeat, SubscriptionEvent } from "./providers/indexer";
38
- import { Nonces } from "./musig2/nonces";
39
- import { PartialSig } from "./musig2/sign";
40
- import { AnchorBumper, P2A } from "./utils/anchor";
41
- import { TxWeightEstimator, type VSize } from "./utils/txSizeEstimator";
42
- import { Unroll } from "./wallet/unroll";
43
- import { ArkError, maybeArkError } from "./providers/errors";
44
- import { validateVtxoTxGraph, validateConnectorsTxGraph } from "./tree/validation";
45
- import { buildForfeitTx } from "./forfeit";
46
- import { IndexedDBWalletRepository, IndexedDBContractRepository, InMemoryWalletRepository, InMemoryContractRepository, MIGRATION_KEY, migrateWalletRepository, requiresMigration, getMigrationStatus, rollbackMigration, WalletRepositoryImpl, ContractRepositoryImpl, WalletRepository, ContractRepository } from "./repositories";
47
- import type { MigrationStatus } from "./repositories";
48
- import { DelegatorManagerImpl, IDelegatorManager } from "./wallet/delegator";
49
- export * from "./arkfee";
50
- export * as asset from "./extension/asset";
51
- import { ContractManager, ContractWatcher, contractHandlers, DefaultContractHandler, DelegateContractHandler, VHTLCContractHandler, encodeArkContract, decodeArkContract, contractFromArkContract, contractFromArkContractWithAddress, isArkContract } from "./contracts";
52
- import type { Contract, ContractVtxo, ContractState, ContractEvent, ContractEventCallback, ContractBalance, ContractWithVtxos, ContractHandler, PathSelection, PathContext, ContractManagerConfig, CreateContractParams, ContractWatcherConfig, ParsedArkContract, DefaultContractParams, DelegateContractParams, VHTLCContractParams } from "./contracts";
53
- import { IContractManager } from "./contracts/contractManager";
54
- import { timelockToSequence, sequenceToTimelock } from "./utils/timelock";
55
- import { closeDatabase, openDatabase } from "./repositories/indexedDB/manager";
56
- import { WalletMessageHandler, WalletNotInitializedError, ReadonlyWalletError, DelegatorNotConfiguredError } from "./wallet/serviceWorker/wallet-message-handler";
57
- import { MESSAGE_BUS_NOT_INITIALIZED, MessageBusNotInitializedError, ServiceWorkerTimeoutError } from "./worker/errors";
1
+ import { Transaction } from "./utils/transaction.js";
2
+ import { SingleKey, ReadonlySingleKey } from "./identity/singleKey.js";
3
+ import { SeedIdentity, MnemonicIdentity, ReadonlyDescriptorIdentity } from "./identity/seedIdentity.js";
4
+ import type { SeedIdentityOptions, MnemonicOptions, NetworkOptions, DescriptorOptions } from "./identity/seedIdentity.js";
5
+ import { Identity, ReadonlyIdentity, BatchSignableIdentity, SignRequest, isBatchSignable } from "./identity/index.js";
6
+ import { ArkAddress } from "./script/address.js";
7
+ import { VHTLC } from "./script/vhtlc.js";
8
+ import { DefaultVtxo } from "./script/default.js";
9
+ import { DelegateVtxo } from "./script/delegate.js";
10
+ import { MessageHandler, RequestEnvelope, ResponseEnvelope, MessageBus } from "./worker/messageBus.js";
11
+ import { VtxoScript, EncodedVtxoScript, TapLeafScript, TapTreeCoder, getSequence } from "./script/base.js";
12
+ import { TxType, IWallet, IReadonlyWallet, BaseWalletConfig, WalletConfig, ReadonlyWalletConfig, ProviderClass, ArkTransaction, Coin, ExtendedCoin, ExtendedVirtualCoin, WalletBalance, SendBitcoinParams, SettleParams, Status, VirtualStatus, Outpoint, VirtualCoin, TxKey, GetVtxosFilter, TapLeaves, StorageConfig, isSpendable, isSubdust, isRecoverable, isExpired, Asset, Recipient, IssuanceParams, IssuanceResult, ReissuanceParams, BurnParams, AssetDetails, AssetMetadata, KnownMetadata } from "./wallet/index.js";
13
+ import { Batch } from "./wallet/batch.js";
14
+ import { Wallet, ReadonlyWallet, waitForIncomingFunds, IncomingFunds } from "./wallet/wallet.js";
15
+ import { TxTree, TxTreeNode } from "./tree/txTree.js";
16
+ import { SignerSession, TreeNonces, TreePartialSigs } from "./tree/signingSession.js";
17
+ import { Ramps } from "./wallet/ramps.js";
18
+ import { HDDescriptorProvider } from "./wallet/hdDescriptorProvider.js";
19
+ import { isVtxoExpiringSoon, VtxoManager } from "./wallet/vtxo-manager.js";
20
+ import type { IVtxoManager, SettlementConfig } from "./wallet/vtxo-manager.js";
21
+ import { ServiceWorkerWallet, ServiceWorkerReadonlyWallet, DEFAULT_MESSAGE_TIMEOUTS } from "./wallet/serviceWorker/wallet.js";
22
+ import type { MessageTimeouts } from "./wallet/serviceWorker/wallet.js";
23
+ import { OnchainWallet } from "./wallet/onchain.js";
24
+ import { setupServiceWorker } from "./worker/browser/utils.js";
25
+ import { ESPLORA_URL, EsploraProvider, OnchainProvider, ExplorerTransaction } from "./providers/onchain.js";
26
+ import { ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, ElectrumOnchainProvider, WsElectrumChainSource } from "./providers/electrum.js";
27
+ import type { TransactionHistory as ElectrumTransactionHistory, BlockHeader as ElectrumBlockHeader, Unspent as ElectrumUnspent } from "./providers/electrum.js";
28
+ import { RestArkProvider, ArkProvider, SettlementEvent, SettlementEventType, ArkInfo, SignedIntent, Output, TxNotification, BatchFinalizationEvent, BatchFinalizedEvent, BatchFailedEvent, TreeSigningStartedEvent, TreeNoncesEvent, BatchStartedEvent, TreeTxEvent, TreeSignatureEvent, ScheduledSession, FeeInfo } from "./providers/ark.js";
29
+ import { DelegatorProvider, DelegateInfo, DelegateOptions, RestDelegatorProvider } from "./providers/delegator.js";
30
+ import { CLTVMultisigTapscript, ConditionCSVMultisigTapscript, ConditionMultisigTapscript, CSVMultisigTapscript, decodeTapscript, MultisigTapscript, TapscriptType, ArkTapscript, RelativeTimelock } from "./script/tapscript.js";
31
+ import { hasBoardingTxExpired, buildOffchainTx, verifyTapscriptSignatures, ArkTxInput, OffchainTx, combineTapscriptSigs, isValidArkAddress } from "./utils/arkTransaction.js";
32
+ import { VtxoTaprootTree, ConditionWitness, getArkPsbtFields, setArkPsbtField, ArkPsbtFieldCoder, ArkPsbtFieldKey, ArkPsbtFieldKeyType, CosignerPublicKey, VtxoTreeExpiry } from "./utils/unknownFields.js";
33
+ import { Intent } from "./intent/index.js";
34
+ import { BIP322 } from "./bip322/index.js";
35
+ import { ArkNote } from "./arknote/index.js";
36
+ import { networks, Network, NetworkName } from "./networks.js";
37
+ import { RestIndexerProvider, IndexerProvider, IndexerTxType, ChainTxType, PageResponse, BatchInfo, ChainTx, CommitmentTx, TxHistoryRecord, VtxoChain, Tx, Vtxo, PaginationOptions, SubscriptionResponse, SubscriptionHeartbeat, SubscriptionEvent } from "./providers/indexer.js";
38
+ import { Nonces } from "./musig2/nonces.js";
39
+ import { PartialSig } from "./musig2/sign.js";
40
+ import { AnchorBumper, P2A } from "./utils/anchor.js";
41
+ import { TxWeightEstimator, type VSize } from "./utils/txSizeEstimator.js";
42
+ import { Unroll } from "./wallet/unroll.js";
43
+ import { ArkError, maybeArkError } from "./providers/errors.js";
44
+ import { validateVtxoTxGraph, validateConnectorsTxGraph } from "./tree/validation.js";
45
+ import { buildForfeitTx } from "./forfeit.js";
46
+ import { IndexedDBWalletRepository, IndexedDBContractRepository, InMemoryWalletRepository, InMemoryContractRepository, MIGRATION_KEY, migrateWalletRepository, requiresMigration, getMigrationStatus, rollbackMigration, WalletRepositoryImpl, ContractRepositoryImpl, WalletRepository, ContractRepository } from "./repositories/index.js";
47
+ import type { MigrationStatus } from "./repositories/index.js";
48
+ import { DelegatorManagerImpl, IDelegatorManager } from "./wallet/delegator.js";
49
+ export * from "./arkfee/index.js";
50
+ export * as asset from "./extension/asset/index.js";
51
+ import { ContractManager, ContractWatcher, contractHandlers, DefaultContractHandler, DelegateContractHandler, VHTLCContractHandler, encodeArkContract, decodeArkContract, contractFromArkContract, contractFromArkContractWithAddress, isArkContract } from "./contracts/index.js";
52
+ import type { Contract, ContractVtxo, ContractState, ContractEvent, ContractEventCallback, ContractBalance, ContractWithVtxos, ContractHandler, PathSelection, PathContext, ContractManagerConfig, CreateContractParams, ContractWatcherConfig, ParsedArkContract, DefaultContractParams, DelegateContractParams, VHTLCContractParams } from "./contracts/index.js";
53
+ import { IContractManager } from "./contracts/contractManager.js";
54
+ import { timelockToSequence, sequenceToTimelock } from "./utils/timelock.js";
55
+ import { closeDatabase, openDatabase } from "./repositories/indexedDB/manager.js";
56
+ import { WalletMessageHandler, WalletNotInitializedError, ReadonlyWalletError, DelegatorNotConfiguredError } from "./wallet/serviceWorker/wallet-message-handler.js";
57
+ import { MESSAGE_BUS_NOT_INITIALIZED, MessageBusNotInitializedError, ServiceWorkerTimeoutError } from "./worker/errors.js";
58
58
  export { Wallet, ReadonlyWallet, SingleKey, ReadonlySingleKey, SeedIdentity, MnemonicIdentity, ReadonlyDescriptorIdentity, isBatchSignable, OnchainWallet, Ramps, VtxoManager, HDDescriptorProvider, DelegatorManagerImpl, RestDelegatorProvider, ESPLORA_URL, EsploraProvider, ELECTRUM_WS_URL, ELECTRUM_TCP_HOST, ElectrumOnchainProvider, WsElectrumChainSource, RestArkProvider, RestIndexerProvider, ArkAddress, DefaultVtxo, DelegateVtxo, VtxoScript, VHTLC, TxType, IndexerTxType, ChainTxType, SettlementEventType, setupServiceWorker, MessageBus, WalletMessageHandler, WalletNotInitializedError, ReadonlyWalletError, DelegatorNotConfiguredError, MESSAGE_BUS_NOT_INITIALIZED, MessageBusNotInitializedError, ServiceWorkerTimeoutError, ServiceWorkerWallet, ServiceWorkerReadonlyWallet, DEFAULT_MESSAGE_TIMEOUTS, decodeTapscript, MultisigTapscript, CSVMultisigTapscript, ConditionCSVMultisigTapscript, ConditionMultisigTapscript, CLTVMultisigTapscript, TapTreeCoder, ArkPsbtFieldKey, ArkPsbtFieldKeyType, setArkPsbtField, getArkPsbtFields, CosignerPublicKey, VtxoTreeExpiry, VtxoTaprootTree, ConditionWitness, buildOffchainTx, verifyTapscriptSignatures, waitForIncomingFunds, hasBoardingTxExpired, combineTapscriptSigs, isVtxoExpiringSoon, isValidArkAddress, ArkNote, networks, closeDatabase, openDatabase, IndexedDBWalletRepository, IndexedDBContractRepository, InMemoryWalletRepository, InMemoryContractRepository, MIGRATION_KEY, migrateWalletRepository, requiresMigration, getMigrationStatus, rollbackMigration, WalletRepositoryImpl, ContractRepositoryImpl, Intent, BIP322, TxTree, P2A, Unroll, Transaction, TxWeightEstimator, timelockToSequence, sequenceToTimelock, ArkError, maybeArkError, Batch, validateVtxoTxGraph, validateConnectorsTxGraph, buildForfeitTx, isRecoverable, isSpendable, isSubdust, isExpired, getSequence, ContractManager, ContractWatcher, contractHandlers, DefaultContractHandler, DelegateContractHandler, VHTLCContractHandler, encodeArkContract, decodeArkContract, contractFromArkContract, contractFromArkContractWithAddress, isArkContract, };
59
59
  export type { Identity, ReadonlyIdentity, BatchSignableIdentity, SignRequest, IWallet, IReadonlyWallet, BaseWalletConfig, WalletConfig, ReadonlyWalletConfig, ProviderClass, ArkTransaction, Coin, ExtendedCoin, ExtendedVirtualCoin, WalletBalance, SendBitcoinParams, SettleParams, Status, VirtualStatus, Outpoint, VirtualCoin, TxKey, TapscriptType, ArkTxInput, OffchainTx, TapLeaves, IncomingFunds, SeedIdentityOptions, MnemonicOptions, NetworkOptions, DescriptorOptions, IndexerProvider, PageResponse, BatchInfo, ChainTx, CommitmentTx, TxHistoryRecord, Vtxo, VtxoChain, Tx, OnchainProvider, ArkProvider, SettlementEvent, FeeInfo, ArkInfo, SignedIntent, Output, TxNotification, ExplorerTransaction, ElectrumTransactionHistory, ElectrumBlockHeader, ElectrumUnspent, BatchFinalizationEvent, BatchFinalizedEvent, BatchFailedEvent, TreeSigningStartedEvent, TreeNoncesEvent, BatchStartedEvent, TreeTxEvent, TreeSignatureEvent, ScheduledSession, PaginationOptions, SubscriptionResponse, SubscriptionHeartbeat, SubscriptionEvent, Network, NetworkName, ArkTapscript, RelativeTimelock, EncodedVtxoScript, TapLeafScript, SignerSession, TreeNonces, TreePartialSigs, GetVtxosFilter, SettlementConfig, IVtxoManager, Asset, Recipient, IssuanceParams, IssuanceResult, ReissuanceParams, BurnParams, AssetDetails, AssetMetadata, KnownMetadata, Nonces, PartialSig, ArkPsbtFieldCoder, TxTreeNode, AnchorBumper, VSize, StorageConfig, Contract, ContractVtxo, ContractState, ContractEvent, ContractEventCallback, ContractBalance, ContractWithVtxos, ContractHandler, IContractManager, PathSelection, PathContext, ContractManagerConfig, CreateContractParams, ContractWatcherConfig, ParsedArkContract, DefaultContractParams, DelegateContractParams, VHTLCContractParams, MessageHandler, RequestEnvelope, ResponseEnvelope, MessageTimeouts, IDelegatorManager, DelegatorProvider, DelegateInfo, DelegateOptions, WalletRepository, ContractRepository, MigrationStatus, };
@@ -1,6 +1,6 @@
1
1
  import { TransactionInput, TransactionOutput } from "@scure/btc-signer/psbt.js";
2
- import { Transaction } from "../utils/transaction";
3
- import { ExtendedCoin } from "../wallet";
2
+ import { Transaction } from "../utils/transaction.js";
3
+ import { ExtendedCoin } from "../wallet/index.js";
4
4
  /**
5
5
  * Intent proof implementation for Bitcoin message signing.
6
6
  *
@@ -1,4 +1,4 @@
1
- export type { Nonces } from "./nonces";
2
- export { generateNonces, aggregateNonces } from "./nonces";
3
- export { PartialSig, sign } from "./sign";
4
- export { aggregateKeys } from "./keys";
1
+ export type { Nonces } from "./nonces.js";
2
+ export { generateNonces, aggregateNonces } from "./nonces.js";
3
+ export { PartialSig, sign } from "./sign.js";
4
+ export { aggregateKeys } from "./keys.js";
@@ -1,8 +1,8 @@
1
- import { TxTreeNode } from "../tree/txTree";
2
- import { TreeNonces, TreePartialSigs } from "../tree/signingSession";
3
- import { Vtxo } from "./indexer";
4
- import type { IntentFeeConfig } from "../arkfee";
5
- import { Intent } from "../intent";
1
+ import { TxTreeNode } from "../tree/txTree.js";
2
+ import { TreeNonces, TreePartialSigs } from "../tree/signingSession.js";
3
+ import { Vtxo } from "./indexer.js";
4
+ import type { IntentFeeConfig } from "../arkfee/index.js";
5
+ import { Intent } from "../intent/index.js";
6
6
  /** Output requested during settlement or transaction submission. */
7
7
  export type Output = {
8
8
  /** Destination address, either onchain or Arkade (offchain). */
@@ -1,5 +1,5 @@
1
- import { Intent } from "../intent";
2
- import { SignedIntent } from "./ark";
1
+ import { Intent } from "../intent/index.js";
2
+ import { SignedIntent } from "./ark.js";
3
3
  /**
4
4
  * Delegate identity and fee information returned by `getDelegateInfo`.
5
5
  */
@@ -1,7 +1,7 @@
1
1
  import type { ElectrumWS } from "ws-electrumx-client";
2
- import type { Network, NetworkName } from "../networks";
3
- import type { Coin } from "../wallet";
4
- import type { ExplorerTransaction, OnchainProvider } from "./onchain";
2
+ import type { Network, NetworkName } from "../networks.js";
3
+ import type { Coin } from "../wallet/index.js";
4
+ import type { ExplorerTransaction, OnchainProvider } from "./onchain.js";
5
5
  /**
6
6
  * Default WebSocket Electrum endpoints. Mainnet, mutinynet, and signet
7
7
  * point at Ark Labs–operated Fulcrum 2.1 deployments (which support
@@ -86,8 +86,8 @@ type HeaderSubscribeResult = {
86
86
  * @example
87
87
  * ```typescript
88
88
  * import { ElectrumWS } from "ws-electrumx-client";
89
- * import { WsElectrumChainSource } from "./providers/electrum";
90
- * import { networks } from "./networks";
89
+ * import { WsElectrumChainSource } from "./providers/electrum.js";
90
+ * import { networks } from "./networks.js";
91
91
  *
92
92
  * const ws = new ElectrumWS("wss://electrum.blockstream.info:50004");
93
93
  * const chain = new WsElectrumChainSource(ws, networks.bitcoin);
@@ -1,4 +1,4 @@
1
- import { RestArkProvider, SettlementEvent, TxNotification } from "./ark";
1
+ import { RestArkProvider, SettlementEvent, TxNotification } from "./ark.js";
2
2
  /**
3
3
  * Expo-compatible Arkade provider implementation using expo/fetch for SSE support.
4
4
  * This provider works specifically in React Native/Expo environments where
@@ -1,4 +1,4 @@
1
- import { RestIndexerProvider, SubscriptionResponse } from "./indexer";
1
+ import { RestIndexerProvider, SubscriptionResponse } from "./indexer.js";
2
2
  /**
3
3
  * Expo-compatible Indexer provider implementation using expo/fetch for streaming support.
4
4
  * This provider works specifically in React Native/Expo environments where
@@ -1,4 +1,4 @@
1
- import { AssetDetails, Outpoint, VirtualCoin } from "../wallet";
1
+ import { AssetDetails, Outpoint, VirtualCoin } from "../wallet/index.js";
2
2
  export type PaginationOptions = {
3
3
  pageIndex?: number;
4
4
  pageSize?: number;
@@ -1,5 +1,5 @@
1
- import type { NetworkName } from "../networks";
2
- import { Coin } from "../wallet";
1
+ import type { NetworkName } from "../networks.js";
2
+ import { Coin } from "../wallet/index.js";
3
3
  /**
4
4
  * The default base URLs for esplora API providers.
5
5
  *
@@ -1,4 +1,4 @@
1
- import { Contract, ContractState } from "../contracts/types";
1
+ import { Contract, ContractState } from "../contracts/types.js";
2
2
  /**
3
3
  * Filter options for querying contracts.
4
4
  */
@@ -1,5 +1,5 @@
1
- import { ContractFilter, ContractRepository } from "../contractRepository";
2
- import { Contract } from "../../contracts";
1
+ import { ContractFilter, ContractRepository } from "../contractRepository.js";
2
+ import { Contract } from "../../contracts/index.js";
3
3
  /**
4
4
  * In-memory implementation of ContractRepository.
5
5
  * Data is ephemeral and scoped to the instance.
@@ -1,5 +1,5 @@
1
- import { ArkTransaction, ExtendedCoin, ExtendedVirtualCoin } from "../../wallet";
2
- import { WalletRepository, WalletState } from "../walletRepository";
1
+ import { ArkTransaction, ExtendedCoin, ExtendedVirtualCoin } from "../../wallet/index.js";
2
+ import { WalletRepository, WalletState, VtxoRepositoryKey } from "../walletRepository.js";
3
3
  /**
4
4
  * In-memory implementation of WalletRepository.
5
5
  * Data is ephemeral and scoped to the instance.
@@ -13,6 +13,9 @@ export declare class InMemoryWalletRepository implements WalletRepository {
13
13
  getVtxos(address: string): Promise<ExtendedVirtualCoin[]>;
14
14
  saveVtxos(address: string, vtxos: ExtendedVirtualCoin[]): Promise<void>;
15
15
  deleteVtxos(address: string): Promise<void>;
16
+ getVtxosForScript(script: string): Promise<ExtendedVirtualCoin[]>;
17
+ saveVtxosForScript(key: VtxoRepositoryKey, vtxos: ExtendedVirtualCoin[]): Promise<void>;
18
+ deleteVtxosForScript(script: string): Promise<void>;
16
19
  getUtxos(address: string): Promise<ExtendedCoin[]>;
17
20
  saveUtxos(address: string, utxos: ExtendedCoin[]): Promise<void>;
18
21
  deleteUtxos(address: string): Promise<void>;
@@ -1,9 +1,9 @@
1
- export * from "./walletRepository";
2
- export * from "./contractRepository";
3
- export * from "./inMemory/walletRepository";
4
- export * from "./inMemory/contractRepository";
5
- export * from "./indexedDB/contractRepository";
6
- export * from "./indexedDB/walletRepository";
7
- export { MIGRATION_KEY, migrateWalletRepository, requiresMigration, getMigrationStatus, rollbackMigration, type MigrationStatus, } from "./migrations/fromStorageAdapter";
8
- export { WalletRepositoryImpl } from "./migrations/walletRepositoryImpl";
9
- export { ContractRepositoryImpl } from "./migrations/contractRepositoryImpl";
1
+ export * from "./walletRepository.js";
2
+ export * from "./contractRepository.js";
3
+ export * from "./inMemory/walletRepository.js";
4
+ export * from "./inMemory/contractRepository.js";
5
+ export * from "./indexedDB/contractRepository.js";
6
+ export * from "./indexedDB/walletRepository.js";
7
+ export { MIGRATION_KEY, migrateWalletRepository, requiresMigration, getMigrationStatus, rollbackMigration, type MigrationStatus, } from "./migrations/fromStorageAdapter.js";
8
+ export { WalletRepositoryImpl } from "./migrations/walletRepositoryImpl.js";
9
+ export { ContractRepositoryImpl } from "./migrations/contractRepositoryImpl.js";
@@ -1,5 +1,5 @@
1
- import { Contract } from "../../contracts";
2
- import { ContractFilter, ContractRepository } from "../contractRepository";
1
+ import { Contract } from "../../contracts/index.js";
2
+ import { ContractFilter, ContractRepository } from "../contractRepository.js";
3
3
  /**
4
4
  * IndexedDB-based implementation of ContractRepository.
5
5
  *
@@ -1,4 +1,4 @@
1
- import { DB_VERSION, STORE_CONTRACTS, LEGACY_STORE_CONTRACT_COLLECTIONS, STORE_TRANSACTIONS, STORE_UTXOS, STORE_VTXOS, STORE_WALLET_STATE } from "./schema";
1
+ import { DB_VERSION, STORE_CONTRACTS, LEGACY_STORE_CONTRACT_COLLECTIONS, STORE_TRANSACTIONS, STORE_UTXOS, STORE_VTXOS, STORE_WALLET_STATE } from "./schema.js";
2
2
  export { STORE_VTXOS, STORE_UTXOS, STORE_TRANSACTIONS, STORE_WALLET_STATE, STORE_CONTRACTS, LEGACY_STORE_CONTRACT_COLLECTIONS, DB_VERSION, };
3
- export { serializeTapLeaf, serializeVtxo, serializeUtxo, deserializeTapLeaf, deserializeVtxo, deserializeUtxo, } from "../serialization";
4
- export type { SerializedTapLeaf, SerializedVtxo, SerializedUtxo, } from "../serialization";
3
+ export { serializeTapLeaf, serializeVtxo, serializeUtxo, deserializeTapLeaf, deserializeVtxo, deserializeUtxo, } from "../serialization.js";
4
+ export type { SerializedTapLeaf, SerializedVtxo, SerializedUtxo, } from "../serialization.js";
@@ -1,5 +1,5 @@
1
- import { ExtendedCoin, ExtendedVirtualCoin, ArkTransaction } from "../../wallet";
2
- import { WalletRepository, WalletState } from "../walletRepository";
1
+ import { ExtendedCoin, ExtendedVirtualCoin, ArkTransaction } from "../../wallet/index.js";
2
+ import { WalletRepository, WalletState, VtxoRepositoryKey } from "../walletRepository.js";
3
3
  /**
4
4
  * IndexedDB-based implementation of WalletRepository.
5
5
  */
@@ -13,6 +13,9 @@ export declare class IndexedDBWalletRepository implements WalletRepository {
13
13
  getVtxos(address: string): Promise<ExtendedVirtualCoin[]>;
14
14
  saveVtxos(address: string, vtxos: ExtendedVirtualCoin[]): Promise<void>;
15
15
  deleteVtxos(address: string): Promise<void>;
16
+ getVtxosForScript(script: string): Promise<ExtendedVirtualCoin[]>;
17
+ saveVtxosForScript(key: VtxoRepositoryKey, vtxos: ExtendedVirtualCoin[]): Promise<void>;
18
+ deleteVtxosForScript(script: string): Promise<void>;
16
19
  getUtxos(address: string): Promise<ExtendedCoin[]>;
17
20
  saveUtxos(address: string, utxos: ExtendedCoin[]): Promise<void>;
18
21
  deleteUtxos(address: string): Promise<void>;
@@ -1,6 +1,6 @@
1
- import { StorageAdapter } from "../../storage";
2
- import { ContractFilter, ContractRepository } from "../contractRepository";
3
- import { Contract } from "../../contracts/types";
1
+ import { StorageAdapter } from "../../storage/index.js";
2
+ import { ContractFilter, ContractRepository } from "../contractRepository.js";
3
+ import { Contract } from "../../contracts/types.js";
4
4
  export declare const getContractStorageKey: (id: string, key: string) => string;
5
5
  export declare const getCollectionStorageKey: (type: string) => string;
6
6
  /**
@@ -1,5 +1,5 @@
1
- import { StorageAdapter } from "../../storage";
2
- import { WalletRepository } from "../walletRepository";
1
+ import { StorageAdapter } from "../../storage/index.js";
2
+ import { WalletRepository } from "../walletRepository.js";
3
3
  export declare const MIGRATION_KEY: (repoType: "wallet" | "contract") => string;
4
4
  export type MigrationStatus = "pending" | "in-progress" | "done" | "not-needed";
5
5
  export declare function getMigrationStatus(repoType: "wallet" | "contract", storageAdapter: StorageAdapter): Promise<MigrationStatus>;
@@ -1,6 +1,6 @@
1
- import { WalletRepository, WalletState } from "../walletRepository";
2
- import { StorageAdapter } from "../../storage";
3
- import { ArkTransaction, ExtendedCoin, ExtendedVirtualCoin } from "../../wallet";
1
+ import { WalletRepository, WalletState } from "../walletRepository.js";
2
+ import { StorageAdapter } from "../../storage/index.js";
3
+ import { ArkTransaction, ExtendedCoin, ExtendedVirtualCoin } from "../../wallet/index.js";
4
4
  /**
5
5
  * @deprecated This is only to be used in migration from storage V1
6
6
  */
@@ -1,6 +1,6 @@
1
- import { Contract } from "../../contracts/types";
2
- import { ContractFilter, ContractRepository } from "../contractRepository";
3
- import { RealmLike } from "./types";
1
+ import { Contract } from "../../contracts/types.js";
2
+ import { ContractFilter, ContractRepository } from "../contractRepository.js";
3
+ import { RealmLike } from "./types.js";
4
4
  /**
5
5
  * Realm-based implementation of ContractRepository.
6
6
  *
@@ -1,4 +1,4 @@
1
- export { RealmWalletRepository } from "./walletRepository";
2
- export { RealmContractRepository } from "./contractRepository";
3
- export { ArkRealmSchemas, ARK_REALM_SCHEMA_VERSION, runArkRealmMigrations, } from "./schemas";
4
- export type { RealmLike, RealmResults } from "./types";
1
+ export { RealmWalletRepository } from "./walletRepository.js";
2
+ export { RealmContractRepository } from "./contractRepository.js";
3
+ export { ArkRealmSchemas, ARK_REALM_SCHEMA_VERSION, runArkRealmMigrations, } from "./schemas.js";
4
+ export type { RealmLike, RealmResults } from "./types.js";
@@ -1,6 +1,6 @@
1
- import { ArkTransaction, ExtendedCoin, ExtendedVirtualCoin } from "../../wallet";
2
- import { WalletRepository, WalletState } from "../walletRepository";
3
- import { RealmLike } from "./types";
1
+ import { ArkTransaction, ExtendedCoin, ExtendedVirtualCoin } from "../../wallet/index.js";
2
+ import { WalletRepository, WalletState, VtxoRepositoryKey } from "../walletRepository.js";
3
+ import { RealmLike } from "./types.js";
4
4
  /**
5
5
  * Realm-based implementation of WalletRepository.
6
6
  *
@@ -20,6 +20,9 @@ export declare class RealmWalletRepository implements WalletRepository {
20
20
  getVtxos(address: string): Promise<ExtendedVirtualCoin[]>;
21
21
  saveVtxos(address: string, vtxos: ExtendedVirtualCoin[]): Promise<void>;
22
22
  deleteVtxos(address: string): Promise<void>;
23
+ getVtxosForScript(script: string): Promise<ExtendedVirtualCoin[]>;
24
+ saveVtxosForScript(key: VtxoRepositoryKey, vtxos: ExtendedVirtualCoin[]): Promise<void>;
25
+ deleteVtxosForScript(script: string): Promise<void>;
23
26
  getUtxos(address: string): Promise<ExtendedCoin[]>;
24
27
  saveUtxos(address: string, utxos: ExtendedCoin[]): Promise<void>;
25
28
  deleteUtxos(address: string): Promise<void>;
@@ -1,5 +1,5 @@
1
- import { TapLeafScript } from "../script/base";
2
- import { ArkTransaction, Asset, ExtendedCoin, ExtendedVirtualCoin } from "../wallet";
1
+ import { TapLeafScript } from "../script/base.js";
2
+ import { ArkTransaction, Asset, ExtendedCoin, ExtendedVirtualCoin } from "../wallet/index.js";
3
3
  export type SerializedTapLeaf = {
4
4
  cb: string;
5
5
  s: string;
@@ -28,16 +28,16 @@ export declare const serializeVtxo: (v: ExtendedVirtualCoin) => {
28
28
  intentTapLeafScript: SerializedTapLeaf;
29
29
  extraWitness: string[] | undefined;
30
30
  assets: SerializedAsset[] | undefined;
31
- virtualStatus: import("../wallet").VirtualStatus;
32
- spentBy?: string;
33
- settledBy?: string;
34
- arkTxId?: string;
35
31
  createdAt: Date;
32
+ script: string;
36
33
  isUnrolled: boolean;
37
34
  isSpent?: boolean;
38
- script: string;
35
+ settledBy?: string;
36
+ spentBy?: string;
37
+ arkTxId?: string;
38
+ virtualStatus: import("../wallet/index.js").VirtualStatus;
39
39
  value: number;
40
- status: import("../wallet").Status;
40
+ status: import("../wallet/index.js").Status;
41
41
  txid: string;
42
42
  vout: number;
43
43
  };
@@ -47,14 +47,14 @@ export declare const serializeUtxo: (u: ExtendedCoin) => {
47
47
  intentTapLeafScript: SerializedTapLeaf;
48
48
  extraWitness: string[] | undefined;
49
49
  value: number;
50
- status: import("../wallet").Status;
50
+ status: import("../wallet/index.js").Status;
51
51
  txid: string;
52
52
  vout: number;
53
53
  };
54
54
  export declare const serializeTransaction: (t: ArkTransaction) => {
55
55
  assets: SerializedAsset[] | undefined;
56
- key: import("../wallet").TxKey;
57
- type: import("../wallet").TxType;
56
+ key: import("../wallet/index.js").TxKey;
57
+ type: import("../wallet/index.js").TxType;
58
58
  amount: number;
59
59
  settled: boolean;
60
60
  createdAt: number;
@@ -1,6 +1,6 @@
1
- import { Contract } from "../../contracts/types";
2
- import { ContractFilter, ContractRepository } from "../contractRepository";
3
- import { SQLExecutor } from "./types";
1
+ import { Contract } from "../../contracts/types.js";
2
+ import { ContractFilter, ContractRepository } from "../contractRepository.js";
3
+ import { SQLExecutor } from "./types.js";
4
4
  interface SQLiteContractRepositoryOptions {
5
5
  /** Table name prefix (default: "ark_") */
6
6
  prefix?: string;
@@ -1,3 +1,3 @@
1
- export { SQLiteWalletRepository } from "./walletRepository";
2
- export { SQLiteContractRepository } from "./contractRepository";
3
- export type { SQLExecutor } from "./types";
1
+ export { SQLiteWalletRepository } from "./walletRepository.js";
2
+ export { SQLiteContractRepository } from "./contractRepository.js";
3
+ export type { SQLExecutor } from "./types.js";
@@ -1,6 +1,6 @@
1
- import { ArkTransaction, ExtendedCoin, ExtendedVirtualCoin } from "../../wallet";
2
- import { WalletRepository, WalletState } from "../walletRepository";
3
- import { SQLExecutor } from "./types";
1
+ import { ArkTransaction, ExtendedCoin, ExtendedVirtualCoin } from "../../wallet/index.js";
2
+ import { WalletRepository, WalletState, VtxoRepositoryKey } from "../walletRepository.js";
3
+ import { SQLExecutor } from "./types.js";
4
4
  interface SQLiteWalletRepositoryOptions {
5
5
  /** Table name prefix (default: "ark_") */
6
6
  prefix?: string;
@@ -50,6 +50,9 @@ export declare class SQLiteWalletRepository implements WalletRepository {
50
50
  getVtxos(address: string): Promise<ExtendedVirtualCoin[]>;
51
51
  saveVtxos(address: string, vtxos: ExtendedVirtualCoin[]): Promise<void>;
52
52
  deleteVtxos(address: string): Promise<void>;
53
+ getVtxosForScript(script: string): Promise<ExtendedVirtualCoin[]>;
54
+ saveVtxosForScript(key: VtxoRepositoryKey, vtxos: ExtendedVirtualCoin[]): Promise<void>;
55
+ deleteVtxosForScript(script: string): Promise<void>;
53
56
  getUtxos(address: string): Promise<ExtendedCoin[]>;
54
57
  saveUtxos(address: string, utxos: ExtendedCoin[]): Promise<void>;
55
58
  deleteUtxos(address: string): Promise<void>;
@@ -1,4 +1,4 @@
1
- import { ArkTransaction, ExtendedCoin, ExtendedVirtualCoin } from "../wallet";
1
+ import { ArkTransaction, ExtendedCoin, ExtendedVirtualCoin } from "../wallet/index.js";
2
2
  export interface WalletState {
3
3
  /** Arbitrary stored wallet settings. */
4
4
  settings?: Record<string, any>;
@@ -20,6 +20,12 @@ export type CommitmentTxRecord = {
20
20
  /** Creation timestamp in milliseconds. */
21
21
  createdAt: number;
22
22
  };
23
+ export interface VtxoRepositoryKey {
24
+ /** Authoritative ownership key. */
25
+ script: string;
26
+ /** Legacy storage bucket. Required by all current backends; throw if absent. */
27
+ address?: string;
28
+ }
23
29
  export interface WalletRepository extends AsyncDisposable {
24
30
  readonly version: 1;
25
31
  /**
@@ -32,6 +38,21 @@ export interface WalletRepository extends AsyncDisposable {
32
38
  saveVtxos(address: string, vtxos: ExtendedVirtualCoin[]): Promise<void>;
33
39
  /** Delete stored virtual outputs for an address. */
34
40
  deleteVtxos(address: string): Promise<void>;
41
+ /**
42
+ * Fetch stored virtual outputs for a script.
43
+ * @optional SDK backends implement this; custom backends fall back to Tier 1.
44
+ */
45
+ getVtxosForScript?(script: string): Promise<ExtendedVirtualCoin[]>;
46
+ /**
47
+ * Save virtual outputs for a script.
48
+ * @optional SDK backends implement this; custom backends fall back to Tier 1.
49
+ */
50
+ saveVtxosForScript?(key: VtxoRepositoryKey, vtxos: ExtendedVirtualCoin[]): Promise<void>;
51
+ /**
52
+ * Delete stored virtual outputs for a script.
53
+ * @optional SDK backends implement this; custom backends fall back to Tier 1.
54
+ */
55
+ deleteVtxosForScript?(script: string): Promise<void>;
35
56
  /** Fetch stored boarding inputs for an address. */
36
57
  getUtxos(address: string): Promise<ExtendedCoin[]>;
37
58
  /** Save boarding inputs for an address. */
@@ -34,10 +34,10 @@ export declare class ArkAddress {
34
34
  readonly hrp: string;
35
35
  readonly version: number;
36
36
  /**
37
- * Create an Arkade address from its server key, vtxo taproot public key, and prefix.
37
+ * Create an Arkade address from its server public key, Taproot output key, and prefix.
38
38
  *
39
39
  * @param serverPubKey - 32-byte Arkade server public key
40
- * @param vtxoTaprootKey - 32-byte tweaked vtxo taproot public key
40
+ * @param vtxoTaprootKey - 32-byte Taproot output key (a.k.a. tweaked public key)
41
41
  * @param hrp - Bech32 human-readable prefix
42
42
  * @param version - Address version byte
43
43
  * @defaultValue `version = 0`
@@ -1,8 +1,8 @@
1
1
  import { NETWORK } from "@scure/btc-signer";
2
2
  import { PSBTOutput } from "@scure/btc-signer/psbt.js";
3
3
  import { Bytes } from "@scure/btc-signer/utils.js";
4
- import { ArkAddress } from "./address";
5
- import { ConditionCSVMultisigTapscript, CSVMultisigTapscript } from "./tapscript";
4
+ import { ArkAddress } from "./address.js";
5
+ import { ConditionCSVMultisigTapscript, CSVMultisigTapscript } from "./tapscript.js";
6
6
  export type TapLeafScript = [
7
7
  {
8
8
  version: number;