@arkade-os/sdk 0.4.32 → 0.4.34

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 (82) hide show
  1. package/README.md +1 -1
  2. package/dist/adapters/expo.cjs +5 -5
  3. package/dist/adapters/expo.d.cts +2 -2
  4. package/dist/adapters/expo.d.ts +2 -2
  5. package/dist/adapters/expo.js +3 -3
  6. package/dist/adapters/indexedDB.cjs +5 -5
  7. package/dist/adapters/indexedDB.js +4 -4
  8. package/dist/{ark-ibLW4Hte.d.cts → ark-Dsv5Jq4E.d.cts} +81 -10
  9. package/dist/{ark-ibLW4Hte.d.ts → ark-Dsv5Jq4E.d.ts} +81 -10
  10. package/dist/{asyncStorageTaskQueue-BEOFPNc0.d.ts → asyncStorageTaskQueue-BH-zuth5.d.ts} +1 -1
  11. package/dist/{asyncStorageTaskQueue-VGHXWR9F.d.cts → asyncStorageTaskQueue-D92ch8yI.d.cts} +1 -1
  12. package/dist/{chunk-ABWRLTX5.js → chunk-5WDBHWX3.js} +4 -4
  13. package/dist/{chunk-ABWRLTX5.js.map → chunk-5WDBHWX3.js.map} +1 -1
  14. package/dist/{chunk-GIGILVVP.cjs → chunk-CCLNFHJ5.cjs} +11 -11
  15. package/dist/{chunk-GIGILVVP.cjs.map → chunk-CCLNFHJ5.cjs.map} +1 -1
  16. package/dist/{chunk-WMIPYZSB.cjs → chunk-CMPJR3HS.cjs} +42 -9
  17. package/dist/chunk-CMPJR3HS.cjs.map +1 -0
  18. package/dist/{chunk-YA4G7RFB.js → chunk-CUSABEUQ.js} +166 -38
  19. package/dist/chunk-CUSABEUQ.js.map +1 -0
  20. package/dist/{chunk-6FLL2Q36.cjs → chunk-FSAXPBGP.cjs} +9 -9
  21. package/dist/chunk-FSAXPBGP.cjs.map +1 -0
  22. package/dist/{chunk-6NWNOLL3.js → chunk-FXFBPXV3.js} +4 -4
  23. package/dist/chunk-FXFBPXV3.js.map +1 -0
  24. package/dist/{chunk-IEO3XDKI.cjs → chunk-GUTKJMSF.cjs} +190 -58
  25. package/dist/chunk-GUTKJMSF.cjs.map +1 -0
  26. package/dist/{chunk-XROGFOPX.js → chunk-HFXEUW55.js} +740 -175
  27. package/dist/chunk-HFXEUW55.js.map +1 -0
  28. package/dist/{chunk-TU3LVAPX.js → chunk-OUVTG72A.js} +43 -11
  29. package/dist/chunk-OUVTG72A.js.map +1 -0
  30. package/dist/{chunk-SHEBNWOQ.js → chunk-VVGD3JIP.js} +3 -3
  31. package/dist/{chunk-SHEBNWOQ.js.map → chunk-VVGD3JIP.js.map} +1 -1
  32. package/dist/{chunk-KQK4PP6L.cjs → chunk-XCHBQVMK.cjs} +879 -314
  33. package/dist/chunk-XCHBQVMK.cjs.map +1 -0
  34. package/dist/{chunk-I2UIKZM5.cjs → chunk-ZS3OZHC7.cjs} +7 -7
  35. package/dist/{chunk-I2UIKZM5.cjs.map → chunk-ZS3OZHC7.cjs.map} +1 -1
  36. package/dist/contracts/handlers/index.cjs +10 -6
  37. package/dist/contracts/handlers/index.d.cts +3 -3
  38. package/dist/contracts/handlers/index.d.ts +3 -3
  39. package/dist/contracts/handlers/index.js +2 -2
  40. package/dist/{delegate-BvNTw44a.d.cts → delegate-BaS5SCIW.d.cts} +10 -2
  41. package/dist/{delegate-BXaR1RNG.d.ts → delegate-Baz_hb83.d.ts} +10 -2
  42. package/dist/{index-BusKawmy.d.ts → index-FwXZveaX.d.ts} +63 -3
  43. package/dist/{index-C-5Tw7VA.d.cts → index-lNZ6qaO3.d.cts} +63 -3
  44. package/dist/index.cjs +143 -127
  45. package/dist/index.d.cts +89 -16
  46. package/dist/index.d.ts +89 -16
  47. package/dist/index.js +4 -4
  48. package/dist/repositories/realm/index.cjs +13 -13
  49. package/dist/repositories/realm/index.d.cts +1 -1
  50. package/dist/repositories/realm/index.d.ts +1 -1
  51. package/dist/repositories/realm/index.js +4 -4
  52. package/dist/repositories/sqlite/index.cjs +13 -13
  53. package/dist/repositories/sqlite/index.d.cts +1 -1
  54. package/dist/repositories/sqlite/index.d.ts +1 -1
  55. package/dist/repositories/sqlite/index.js +4 -4
  56. package/dist/{taskRunner-B1igKGAo.d.ts → taskRunner-B1NUWyWR.d.ts} +1 -1
  57. package/dist/{taskRunner-By92TQ1m.d.cts → taskRunner-vFRA3F9b.d.cts} +1 -1
  58. package/dist/wallet/expo/background.cjs +14 -14
  59. package/dist/wallet/expo/background.d.cts +3 -3
  60. package/dist/wallet/expo/background.d.ts +3 -3
  61. package/dist/wallet/expo/background.js +6 -6
  62. package/dist/wallet/expo/index.cjs +14 -14
  63. package/dist/wallet/expo/index.cjs.map +1 -1
  64. package/dist/wallet/expo/index.d.cts +5 -5
  65. package/dist/wallet/expo/index.d.ts +5 -5
  66. package/dist/wallet/expo/index.js +6 -6
  67. package/dist/wallet/expo/index.js.map +1 -1
  68. package/dist/{wallet-B_rxgQTu.d.cts → wallet-By9HIo0Q.d.cts} +160 -5
  69. package/dist/{wallet-CyM4F7Bs.d.ts → wallet-D6uoBLmS.d.ts} +160 -5
  70. package/dist/worker/expo/index.cjs +9 -9
  71. package/dist/worker/expo/index.d.cts +4 -4
  72. package/dist/worker/expo/index.d.ts +4 -4
  73. package/dist/worker/expo/index.js +5 -5
  74. package/package.json +4 -4
  75. package/dist/chunk-6FLL2Q36.cjs.map +0 -1
  76. package/dist/chunk-6NWNOLL3.js.map +0 -1
  77. package/dist/chunk-IEO3XDKI.cjs.map +0 -1
  78. package/dist/chunk-KQK4PP6L.cjs.map +0 -1
  79. package/dist/chunk-TU3LVAPX.js.map +0 -1
  80. package/dist/chunk-WMIPYZSB.cjs.map +0 -1
  81. package/dist/chunk-XROGFOPX.js.map +0 -1
  82. package/dist/chunk-YA4G7RFB.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -1,14 +1,14 @@
1
- import { L as ReadonlyIdentity, a as Identity, a5 as DescriptorSigningRequest, a6 as Transaction, a2 as SignerSession, W as WalletRepository, E as ExtendedVirtualCoin, s as VtxoRepositoryKey, d as ExtendedCoin, A as ArkTransaction, t as WalletState, r as Contract, C as ContractRepository, u as ContractFilter, a7 as IntentFeeConfig, a8 as OffchainInput, a9 as FeeAmount, aa as OnchainInput, ab as FeeOutput, m as ArkProvider, a0 as SettlementConfig, ac as ContractWatcherConfig, I as IWallet, ad as FeeInfo, h as SettlementEvent, J as DescriptorProvider, g as SettleParams, S as SendBitcoinParams, G as GetVtxosFilter, ae as CreateContractParams, af as GetContractsFilter, q as VirtualCoin, ag as GetSpendablePathsOptions, ah as GetAllSpendingPathsOptions, R as Recipient, ai as IssuanceParams, aj as ReissuanceParams, ak as BurnParams, al as RenewVtxosOptions, c as WalletBalance, am as ContractWithVtxos, an as PathSelection, ao as ContractEvent, ap as AssetDetails, aq as IssuanceResult, ar as DelegateInfo, K as IReadonlyWallet, Q as IReadonlyAssetManager, as as StorageConfig, e as IContractManager, i as IAssetManager, f as IDelegateManager, at as IVtxoManager, O as OnchainProvider, N as Network, U as NetworkName, Z as Coin, au as ExplorerTransaction, p as TapLeafScript, av as EncodedVtxoScript, $ as CSVMultisigTapscript, o as RelativeTimelock, V as VtxoScript, aw as Status, ax as Outpoint, ay as ChainTx, n as IndexerProvider, w as TxTree } from './ark-ibLW4Hte.cjs';
2
- export { Y as ArkAddress, X as ArkInfo, az as ArkTapscript, aA as Asset, aB as AssetMetadata, aC as BaseWalletConfig, D as BatchFailedEvent, y as BatchFinalizationEvent, z as BatchFinalizedEvent, aD as BatchInfo, aE as BatchSignableIdentity, B as BatchStartedEvent, aF as CLTVMultisigTapscript, aG as ChainTxType, aH as CommitmentTx, aI as ConditionCSVMultisigTapscript, aJ as ConditionMultisigTapscript, aK as ContractBalance, aL as ContractEventCallback, aM as ContractHandler, _ as ContractManager, aN as ContractManagerConfig, aO as ContractState, aP as ContractVtxo, aQ as ContractWatcher, aR as DelegateManagerImpl, aS as DelegateOptions, M as DelegateProvider, aT as DelegatorManagerImpl, aU as DelegatorProvider, aV as Discoverable, aW as DiscoveredContract, aX as DiscoveryDeps, aY as ESPLORA_URL, aZ as EsploraProvider, a_ as ExtendedContractVtxo, a$ as HandlerError, b0 as IDelegatorManager, b1 as IndexerTxType, a4 as Intent, b2 as KnownMetadata, b3 as MultisigTapscript, b4 as Nonces, b5 as Output, b6 as PageResponse, b7 as PaginationOptions, b8 as PartialSig, b9 as PathContext, ba as ProviderClass, P as ReadonlyWalletConfig, j as RestArkProvider, bb as RestDelegateProvider, bc as RestDelegatorProvider, k as RestIndexerProvider, bd as ScanContractsOptions, be as ScanResult, bf as ScheduledSession, bg as SettlementEventType, bh as SignRequest, a3 as SignedIntent, bi as SubscriptionEvent, bj as SubscriptionHeartbeat, l as SubscriptionResponse, bk as TapLeaves, bl as TapTreeCoder, bm as TapscriptType, bn as TreeNonces, x as TreeNoncesEvent, bo as TreePartialSigs, H as TreeSignatureEvent, v as TreeSigningStartedEvent, F as TreeTxEvent, bp as Tx, bq as TxHistoryRecord, br as TxKey, T as TxNotification, bs as TxTreeNode, bt as TxType, bu as VirtualStatus, bv as Vtxo, bw as VtxoChain, a1 as VtxoManager, bx as VtxoType, b as WalletConfig, by as WalletMode, bz as decodeTapscript, bA as getSequence, bB as isBatchSignable, bC as isDiscoverable, bD as isExpired, bE as isRecoverable, bF as isSpendable, bG as isSubdust, bH as isVtxoExpiringSoon, bI as networks } from './ark-ibLW4Hte.cjs';
3
- export { D as DefaultContractHandler, a as DefaultContractParams, b as DelegateContractHandler, c as DelegateContractParams, V as VHTLC, d as VHTLCContractHandler, e as VHTLCContractParams, f as contractHandlers } from './index-C-5Tw7VA.cjs';
4
- export { D as DefaultVtxo, a as DelegateVtxo } from './delegate-BvNTw44a.cjs';
5
- import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot } from './wallet-B_rxgQTu.cjs';
6
- export { B as Batch, I as IncomingFunds, w as waitForIncomingFunds } from './wallet-B_rxgQTu.cjs';
1
+ import { H as ReadonlyIdentity, a as Identity, a5 as DescriptorSigningRequest, a6 as Transaction, $ as SignerSession, W as WalletRepository, E as ExtendedVirtualCoin, a2 as VtxoRepositoryKey, d as ExtendedCoin, A as ArkTransaction, a3 as WalletState, r as Contract, C as ContractRepository, a4 as ContractFilter, a7 as IntentFeeConfig, a8 as OffchainInput, a9 as FeeAmount, aa as OnchainInput, ab as FeeOutput, m as ArkProvider, Z as SettlementConfig, ac as ContractWatcherConfig, I as IWallet, ad as FeeInfo, h as SettlementEvent, D as DescriptorProvider, g as SettleParams, S as SendBitcoinParams, G as GetVtxosFilter, ae as CreateContractParams, af as GetContractsFilter, q as VirtualCoin, ag as GetSpendablePathsOptions, ah as GetAllSpendingPathsOptions, R as Recipient, ai as IssuanceParams, aj as ReissuanceParams, ak as BurnParams, al as RenewVtxosOptions, c as WalletBalance, am as ContractWithVtxos, an as PathSelection, ao as ContractEvent, ap as AssetDetails, aq as IssuanceResult, ar as DelegateInfo, F as IReadonlyWallet, L as IReadonlyAssetManager, as as StorageConfig, e as IContractManager, i as IAssetManager, f as IDelegateManager, at as IVtxoManager, O as OnchainProvider, N as Network, M as NetworkName, U as Coin, au as ExplorerTransaction, p as TapLeafScript, av as EncodedVtxoScript, Y as CSVMultisigTapscript, o as RelativeTimelock, V as VtxoScript, aw as Status, ax as Outpoint, ay as ChainTx, n as IndexerProvider, t as TxTree, az as PathContext } from './ark-Dsv5Jq4E.cjs';
2
+ export { Q as ArkAddress, P as ArkInfo, aA as ArkTapscript, aB as Asset, aC as AssetMetadata, aD as BaseWalletConfig, x as BatchFailedEvent, v as BatchFinalizationEvent, w as BatchFinalizedEvent, aE as BatchInfo, aF as BatchSignableIdentity, B as BatchStartedEvent, aG as CLTVMultisigTapscript, aH as ChainTxType, aI as CommitmentTx, aJ as ConditionCSVMultisigTapscript, aK as ConditionMultisigTapscript, aL as ContractBalance, aM as ContractEventCallback, aN as ContractHandler, X as ContractManager, aO as ContractManagerConfig, aP as ContractState, aQ as ContractVtxo, aR as ContractWatcher, aS as DelegateManagerImpl, aT as DelegateOptions, J as DelegateProvider, aU as DelegatorManagerImpl, aV as DelegatorProvider, aW as Discoverable, aX as DiscoveredContract, aY as DiscoveryDeps, aZ as ESPLORA_URL, a_ as EsploraProvider, a$ as ExtendedContractVtxo, b0 as HandlerError, b1 as IDelegatorManager, b2 as IndexerTxType, a1 as Intent, b3 as KnownMetadata, b4 as MultisigTapscript, b5 as Nonces, b6 as Output, b7 as PageResponse, b8 as PaginationOptions, b9 as PartialSig, ba as ProviderClass, K as ReadonlyWalletConfig, j as RestArkProvider, bb as RestDelegateProvider, bc as RestDelegatorProvider, k as RestIndexerProvider, bd as ScanContractsOptions, be as ScanResult, bf as ScheduledSession, bg as SettlementEventType, bh as SignRequest, a0 as SignedIntent, bi as SubscriptionEvent, bj as SubscriptionHeartbeat, l as SubscriptionResponse, bk as TapLeaves, bl as TapTreeCoder, bm as TapscriptType, bn as TreeNonces, u as TreeNoncesEvent, bo as TreePartialSigs, z as TreeSignatureEvent, s as TreeSigningStartedEvent, y as TreeTxEvent, bp as Tx, bq as TxHistoryRecord, br as TxKey, T as TxNotification, bs as TxTreeNode, bt as TxType, bu as VirtualStatus, bv as Vtxo, bw as VtxoChain, _ as VtxoManager, bx as VtxoType, b as WalletConfig, by as WalletMode, bz as decodeTapscript, bA as getSequence, bB as isBatchSignable, bC as isDiscoverable, bD as isExpired, bE as isRecoverable, bF as isSpendable, bG as isSubdust, bH as isVtxoExpiringSoon, bI as networks } from './ark-Dsv5Jq4E.cjs';
3
+ export { B as BoardingContractHandler, a as BoardingContractParams, D as DefaultContractHandler, b as DefaultContractParams, c as DelegateContractHandler, d as DelegateContractParams, V as VHTLC, e as VHTLCContractHandler, f as VHTLCContractParams, g as contractHandlers } from './index-lNZ6qaO3.cjs';
4
+ export { D as DefaultVtxo, a as DelegateVtxo } from './delegate-BaS5SCIW.cjs';
5
+ import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot } from './wallet-By9HIo0Q.cjs';
6
+ export { B as Batch, I as IncomingFunds, w as waitForIncomingFunds } from './wallet-By9HIo0Q.cjs';
7
+ import { Bytes, BTC_NETWORK } from '@scure/btc-signer/utils.js';
7
8
  import { P2TR } from '@scure/btc-signer/payment.js';
8
9
  import { Transaction as Transaction$1 } from '@scure/btc-signer';
9
10
  import { ElectrumWS } from 'ws-electrumx-client';
10
11
  import { TransactionOutput, TransactionInputUpdate } from '@scure/btc-signer/psbt.js';
11
- import { BTC_NETWORK, Bytes } from '@scure/btc-signer/utils.js';
12
12
  import { Transaction as Transaction$2 } from '@scure/btc-signer/transaction.js';
13
13
  import { S as StorageAdapter } from './index-C0IanN1m.cjs';
14
14
 
@@ -717,15 +717,15 @@ declare class Estimator {
717
717
  }
718
718
 
719
719
  /**
720
- * Thrown when a rotated contract (default or delegate) is missing the
721
- * metadata.signingDescriptor required to route it to a descriptor-aware
720
+ * Thrown when a rotated contract (default, delegate, or boarding) is missing
721
+ * the metadata.signingDescriptor required to route it to a descriptor-aware
722
722
  * signer.
723
723
  */
724
724
  declare class MissingSigningDescriptorError extends Error {
725
725
  readonly contractScript: string;
726
- readonly contractType: "default" | "delegate";
726
+ readonly contractType: "default" | "delegate" | "boarding";
727
727
  readonly name = "MissingSigningDescriptorError";
728
- constructor(contractScript: string, contractType: "default" | "delegate");
728
+ constructor(contractScript: string, contractType: "default" | "delegate" | "boarding");
729
729
  }
730
730
  /**
731
731
  * Thrown when an input needs descriptor-aware signing but no
@@ -921,6 +921,55 @@ declare class MessageBus {
921
921
  static setup(path: string): Promise<ServiceWorker>;
922
922
  }
923
923
 
924
+ /**
925
+ * A leaf node in the Taproot script tree, as consumed by
926
+ * `@scure/btc-signer`'s `p2tr(internalKey, tree, ...)`.
927
+ */
928
+ interface TaprootLeaf {
929
+ script: Bytes;
930
+ leafVersion: number;
931
+ }
932
+ /**
933
+ * Internal tree node shape consumed by `@scure/btc-signer`'s `p2tr`:
934
+ * - A leaf is `{ script, leafVersion }`
935
+ * - A branch is a 2-element tuple `[leftNode, rightNode]` of nodes
936
+ */
937
+ type TaprootTreeNode = TaprootLeaf | [TaprootTreeNode, TaprootTreeNode];
938
+ /**
939
+ * Assemble a Taproot script tree from a flat list of scripts using the
940
+ * exact algorithm arkd's btcd dependency uses
941
+ * (`txscript.AssembleTaprootScriptTree`, see
942
+ * https://github.com/btcsuite/btcd/blob/master/txscript/taproot.go).
943
+ *
944
+ * The algorithm:
945
+ *
946
+ * Phase 1 — pair leaves left-to-right:
947
+ * for i := 0; i < len(leaves); i += 2:
948
+ * if i is the last index (odd leaf at end):
949
+ * merge with the LAST branch built so far (do NOT pair as a fresh leaf)
950
+ * else:
951
+ * create a new branch from (leaves[i], leaves[i+1])
952
+ *
953
+ * Phase 2 — FIFO-queue merge branches:
954
+ * while branches has ≥ 2 items:
955
+ * take front two, combine into a new branch, push to back of queue
956
+ *
957
+ * This matters because `@scure/btc-signer`'s `taprootListToTree` builds a
958
+ * Huffman tree (weight-1 leaves combine by smallest-weight pairs). For
959
+ * power-of-2 leaf counts both algorithms happen to produce the same
960
+ * perfectly-balanced binary tree and agree. For any other count they
961
+ * produce DIFFERENT shapes → different merkle roots → different taproot
962
+ * output keys → arkd rejects spends with `INVALID_PSBT_INPUT`.
963
+ *
964
+ * Reproducing btcd's algorithm here lets the SDK construct taptrees that
965
+ * arkd accepts for arbitrary leaf counts.
966
+ *
967
+ * @param scripts - Raw tapscript bytes for each leaf, in the order they
968
+ * should be encoded in the TapTree PSBT field.
969
+ * @returns The nested-tuple form `p2tr` accepts.
970
+ */
971
+ declare function assembleBtcdTaprootTree(scripts: Bytes[]): TaprootTreeNode;
972
+
924
973
  /**
925
974
  * Thrown when a collaborative-exit / offboard would leave a change VTXO below
926
975
  * the dust threshold. Lets callers (e.g. wallet UI) react with appropriate UX
@@ -2065,8 +2114,8 @@ declare function setupServiceWorker(pathOrOptions: string | SetupServiceWorkerOp
2065
2114
  * `blockchain.transaction.broadcast_package` for atomic 1P1C TRUC
2066
2115
  * relay; see `ElectrumOnchainProvider.broadcastTransaction`). Testnet
2067
2116
  * defaults to Blockstream's public Fulcrum because Ark doesn't host
2068
- * it. Regtest assumes the `electrum-ws` websocat bridge from
2069
- * `vulpemventures/nigiri`.
2117
+ * it. Regtest assumes the Fulcrum WebSocket endpoint exposed by the
2118
+ * local `arkade-regtest` stack.
2070
2119
  *
2071
2120
  * @example
2072
2121
  * ```typescript
@@ -2399,9 +2448,18 @@ declare function hasBoardingTxExpired(coin: ExtendedCoin, boardingTimelock: Rela
2399
2448
  */
2400
2449
  declare function verifyTapscriptSignatures(tx: Transaction, inputIndex: number, requiredSigners: string[], excludePubkeys?: string[], allowedSighashTypes?: number[]): void;
2401
2450
  /**
2402
- * Merges the signed transaction with the original transaction
2451
+ * Merges the tapscript signatures of `signedTx` onto `originalTx`, in place.
2452
+ *
2453
+ * Invariant: both transactions must have the same number of inputs and BOTH
2454
+ * must carry a `tapScriptSig` on every input — the result is the per-input
2455
+ * concatenation `originalTx.tapScriptSig ++ signedTx.tapScriptSig`. A missing
2456
+ * signature on either side is rejected with an input-indexed error rather than
2457
+ * silently corrupting the witness (the previous code appended `undefined` when
2458
+ * `signedTx` was unsigned). Callers that partially sign must merge only fully
2459
+ * co-signed inputs.
2460
+ *
2403
2461
  * @param signedTx signed transaction
2404
- * @param originalTx original transaction
2462
+ * @param originalTx original transaction (mutated and returned)
2405
2463
  */
2406
2464
  declare function combineTapscriptSigs(signedTx: Transaction, originalTx: Transaction): Transaction;
2407
2465
  /**
@@ -3360,6 +3418,21 @@ declare namespace index {
3360
3418
  export { index_AssetGroup as AssetGroup, index_AssetId as AssetId, index_AssetInput as AssetInput, index_AssetInputType as AssetInputType, index_AssetInputs as AssetInputs, index_AssetOutput as AssetOutput, index_AssetOutputs as AssetOutputs, index_AssetRef as AssetRef, index_AssetRefType as AssetRefType, index_Metadata as Metadata, index_MetadataList as MetadataList, index_Packet as Packet };
3361
3419
  }
3362
3420
 
3421
+ /**
3422
+ * Check if an absolute (CLTV) locktime is currently satisfied.
3423
+ *
3424
+ * Following the BIP65 convention:
3425
+ * - locktime < 500_000_000 → interpreted as a block height; compared against `context.blockHeight`
3426
+ * - locktime >= 500_000_000 → interpreted as a Unix timestamp (seconds); compared against `context.currentTime`
3427
+ *
3428
+ * Returns false if the relevant context field is missing.
3429
+ */
3430
+ declare function isCltvSatisfied(context: PathContext, locktime: bigint): boolean;
3431
+ /**
3432
+ * Check if a CSV timelock is currently satisfied for the given context/virtual output.
3433
+ */
3434
+ declare function isCsvSpendable(context: PathContext, sequence?: number): boolean;
3435
+
3363
3436
  /**
3364
3437
  * Convert RelativeTimelock to BIP68 sequence number.
3365
3438
  */
@@ -3467,4 +3540,4 @@ declare class AssetManager extends ReadonlyAssetManager implements IAssetManager
3467
3540
  burn(params: BurnParams): Promise<string>;
3468
3541
  }
3469
3542
 
3470
- export { type AnchorBumper, ArkError, ArkNote, ArkProvider, type ArkPsbtFieldCoder, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ArkTransaction, type ArkTxInput, AssetDetails, AssetManager, BIP322, BurnParams, CSVMultisigTapscript, ChainTx, Coin, ConditionWitness, Contract, ContractEvent, ContractRepository, ContractRepositoryImpl, ContractWatcherConfig, ContractWithVtxos, CosignerPublicKey, CreateContractParams, DEFAULT_MESSAGE_TIMEOUTS, DelegateInfo, DelegateNotConfiguredError, DelegatorNotConfiguredError, type DescriptorOptions, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, type BlockHeader as ElectrumBlockHeader, ElectrumOnchainProvider, type TransactionHistory as ElectrumTransactionHistory, type Unspent as ElectrumUnspent, EncodedVtxoScript, Estimator, ExplorerTransaction, ExtendedCoin, ExtendedVirtualCoin, FeeAmount, FeeInfo, FeeOutput, GetVtxosFilter, HDDescriptorProvider, IAssetManager, IContractManager, IDelegateManager, IReadonlyAssetManager, IReadonlyWallet, IVtxoManager, IWallet, Identity, InMemoryContractRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBWalletRepository, IndexerProvider, IntentFeeConfig, IssuanceParams, IssuanceResult, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MessageBus, MessageBusNotInitializedError, type MessageHandler, type MessageTimeouts, type MigrationStatus, MissingSigningDescriptorError, MnemonicIdentity, type MnemonicOptions, Network, NetworkName, type NetworkOptions, OffchainInput, type OffchainTx, OnchainInput, OnchainProvider, OnchainWallet, Outpoint, P2A, type ParsedArkContract, PathSelection, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlyIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, Recipient, ReissuanceParams, RelativeTimelock, RenewVtxosOptions, type RequestEnvelope, type ResponseEnvelope, SeedIdentity, type SeedIdentityOptions, SendBitcoinParams, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, type ServiceWorkerWalletMode, SettleParams, SettlementConfig, SettlementEvent, SignerSession, SingleKey, Status, StorageConfig, TapLeafScript, Transaction, TxTree, TxWeightEstimator, Unroll, type VSize, VirtualCoin, VtxoScript, VtxoTaprootTree, VtxoTreeExpiry, Wallet, WalletBalance, WalletMessageHandler, WalletNotInitializedError, WalletRepository, WalletRepositoryImpl, WsElectrumChainSource, index as asset, buildForfeitTx, buildOffchainTx, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, decodeArkContract, encodeArkContract, getArkPsbtFields, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isValidArkAddress, maybeArkError, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, sequenceToTimelock, setArkPsbtField, setupServiceWorker, timelockToSequence, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures };
3543
+ export { type AnchorBumper, ArkError, ArkNote, ArkProvider, type ArkPsbtFieldCoder, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ArkTransaction, type ArkTxInput, AssetDetails, AssetManager, BIP322, BurnParams, CSVMultisigTapscript, ChainTx, Coin, ConditionWitness, Contract, ContractEvent, ContractRepository, ContractRepositoryImpl, ContractWatcherConfig, ContractWithVtxos, CosignerPublicKey, CreateContractParams, DEFAULT_MESSAGE_TIMEOUTS, DelegateInfo, DelegateNotConfiguredError, DelegatorNotConfiguredError, type DescriptorOptions, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, type BlockHeader as ElectrumBlockHeader, ElectrumOnchainProvider, type TransactionHistory as ElectrumTransactionHistory, type Unspent as ElectrumUnspent, EncodedVtxoScript, Estimator, ExplorerTransaction, ExtendedCoin, ExtendedVirtualCoin, FeeAmount, FeeInfo, FeeOutput, GetVtxosFilter, HDDescriptorProvider, IAssetManager, IContractManager, IDelegateManager, IReadonlyAssetManager, IReadonlyWallet, IVtxoManager, IWallet, Identity, InMemoryContractRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBWalletRepository, IndexerProvider, IntentFeeConfig, IssuanceParams, IssuanceResult, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MessageBus, MessageBusNotInitializedError, type MessageHandler, type MessageTimeouts, type MigrationStatus, MissingSigningDescriptorError, MnemonicIdentity, type MnemonicOptions, Network, NetworkName, type NetworkOptions, OffchainInput, type OffchainTx, OnchainInput, OnchainProvider, OnchainWallet, Outpoint, P2A, type ParsedArkContract, PathContext, PathSelection, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlyIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, Recipient, ReissuanceParams, RelativeTimelock, RenewVtxosOptions, type RequestEnvelope, type ResponseEnvelope, SeedIdentity, type SeedIdentityOptions, SendBitcoinParams, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, type ServiceWorkerWalletMode, SettleParams, SettlementConfig, SettlementEvent, SignerSession, SingleKey, Status, StorageConfig, TapLeafScript, Transaction, TxTree, TxWeightEstimator, Unroll, type VSize, VirtualCoin, VtxoScript, VtxoTaprootTree, VtxoTreeExpiry, Wallet, WalletBalance, WalletMessageHandler, WalletNotInitializedError, WalletRepository, WalletRepositoryImpl, WsElectrumChainSource, assembleBtcdTaprootTree, index as asset, buildForfeitTx, buildOffchainTx, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, decodeArkContract, encodeArkContract, getArkPsbtFields, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isCltvSatisfied, isCsvSpendable, isValidArkAddress, maybeArkError, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, sequenceToTimelock, setArkPsbtField, setupServiceWorker, timelockToSequence, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures };
package/dist/index.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- import { L as ReadonlyIdentity, a as Identity, a5 as DescriptorSigningRequest, a6 as Transaction, a2 as SignerSession, W as WalletRepository, E as ExtendedVirtualCoin, s as VtxoRepositoryKey, d as ExtendedCoin, A as ArkTransaction, t as WalletState, r as Contract, C as ContractRepository, u as ContractFilter, a7 as IntentFeeConfig, a8 as OffchainInput, a9 as FeeAmount, aa as OnchainInput, ab as FeeOutput, m as ArkProvider, a0 as SettlementConfig, ac as ContractWatcherConfig, I as IWallet, ad as FeeInfo, h as SettlementEvent, J as DescriptorProvider, g as SettleParams, S as SendBitcoinParams, G as GetVtxosFilter, ae as CreateContractParams, af as GetContractsFilter, q as VirtualCoin, ag as GetSpendablePathsOptions, ah as GetAllSpendingPathsOptions, R as Recipient, ai as IssuanceParams, aj as ReissuanceParams, ak as BurnParams, al as RenewVtxosOptions, c as WalletBalance, am as ContractWithVtxos, an as PathSelection, ao as ContractEvent, ap as AssetDetails, aq as IssuanceResult, ar as DelegateInfo, K as IReadonlyWallet, Q as IReadonlyAssetManager, as as StorageConfig, e as IContractManager, i as IAssetManager, f as IDelegateManager, at as IVtxoManager, O as OnchainProvider, N as Network, U as NetworkName, Z as Coin, au as ExplorerTransaction, p as TapLeafScript, av as EncodedVtxoScript, $ as CSVMultisigTapscript, o as RelativeTimelock, V as VtxoScript, aw as Status, ax as Outpoint, ay as ChainTx, n as IndexerProvider, w as TxTree } from './ark-ibLW4Hte.js';
2
- export { Y as ArkAddress, X as ArkInfo, az as ArkTapscript, aA as Asset, aB as AssetMetadata, aC as BaseWalletConfig, D as BatchFailedEvent, y as BatchFinalizationEvent, z as BatchFinalizedEvent, aD as BatchInfo, aE as BatchSignableIdentity, B as BatchStartedEvent, aF as CLTVMultisigTapscript, aG as ChainTxType, aH as CommitmentTx, aI as ConditionCSVMultisigTapscript, aJ as ConditionMultisigTapscript, aK as ContractBalance, aL as ContractEventCallback, aM as ContractHandler, _ as ContractManager, aN as ContractManagerConfig, aO as ContractState, aP as ContractVtxo, aQ as ContractWatcher, aR as DelegateManagerImpl, aS as DelegateOptions, M as DelegateProvider, aT as DelegatorManagerImpl, aU as DelegatorProvider, aV as Discoverable, aW as DiscoveredContract, aX as DiscoveryDeps, aY as ESPLORA_URL, aZ as EsploraProvider, a_ as ExtendedContractVtxo, a$ as HandlerError, b0 as IDelegatorManager, b1 as IndexerTxType, a4 as Intent, b2 as KnownMetadata, b3 as MultisigTapscript, b4 as Nonces, b5 as Output, b6 as PageResponse, b7 as PaginationOptions, b8 as PartialSig, b9 as PathContext, ba as ProviderClass, P as ReadonlyWalletConfig, j as RestArkProvider, bb as RestDelegateProvider, bc as RestDelegatorProvider, k as RestIndexerProvider, bd as ScanContractsOptions, be as ScanResult, bf as ScheduledSession, bg as SettlementEventType, bh as SignRequest, a3 as SignedIntent, bi as SubscriptionEvent, bj as SubscriptionHeartbeat, l as SubscriptionResponse, bk as TapLeaves, bl as TapTreeCoder, bm as TapscriptType, bn as TreeNonces, x as TreeNoncesEvent, bo as TreePartialSigs, H as TreeSignatureEvent, v as TreeSigningStartedEvent, F as TreeTxEvent, bp as Tx, bq as TxHistoryRecord, br as TxKey, T as TxNotification, bs as TxTreeNode, bt as TxType, bu as VirtualStatus, bv as Vtxo, bw as VtxoChain, a1 as VtxoManager, bx as VtxoType, b as WalletConfig, by as WalletMode, bz as decodeTapscript, bA as getSequence, bB as isBatchSignable, bC as isDiscoverable, bD as isExpired, bE as isRecoverable, bF as isSpendable, bG as isSubdust, bH as isVtxoExpiringSoon, bI as networks } from './ark-ibLW4Hte.js';
3
- export { D as DefaultContractHandler, a as DefaultContractParams, b as DelegateContractHandler, c as DelegateContractParams, V as VHTLC, d as VHTLCContractHandler, e as VHTLCContractParams, f as contractHandlers } from './index-BusKawmy.js';
4
- export { D as DefaultVtxo, a as DelegateVtxo } from './delegate-BXaR1RNG.js';
5
- import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot } from './wallet-CyM4F7Bs.js';
6
- export { B as Batch, I as IncomingFunds, w as waitForIncomingFunds } from './wallet-CyM4F7Bs.js';
1
+ import { H as ReadonlyIdentity, a as Identity, a5 as DescriptorSigningRequest, a6 as Transaction, $ as SignerSession, W as WalletRepository, E as ExtendedVirtualCoin, a2 as VtxoRepositoryKey, d as ExtendedCoin, A as ArkTransaction, a3 as WalletState, r as Contract, C as ContractRepository, a4 as ContractFilter, a7 as IntentFeeConfig, a8 as OffchainInput, a9 as FeeAmount, aa as OnchainInput, ab as FeeOutput, m as ArkProvider, Z as SettlementConfig, ac as ContractWatcherConfig, I as IWallet, ad as FeeInfo, h as SettlementEvent, D as DescriptorProvider, g as SettleParams, S as SendBitcoinParams, G as GetVtxosFilter, ae as CreateContractParams, af as GetContractsFilter, q as VirtualCoin, ag as GetSpendablePathsOptions, ah as GetAllSpendingPathsOptions, R as Recipient, ai as IssuanceParams, aj as ReissuanceParams, ak as BurnParams, al as RenewVtxosOptions, c as WalletBalance, am as ContractWithVtxos, an as PathSelection, ao as ContractEvent, ap as AssetDetails, aq as IssuanceResult, ar as DelegateInfo, F as IReadonlyWallet, L as IReadonlyAssetManager, as as StorageConfig, e as IContractManager, i as IAssetManager, f as IDelegateManager, at as IVtxoManager, O as OnchainProvider, N as Network, M as NetworkName, U as Coin, au as ExplorerTransaction, p as TapLeafScript, av as EncodedVtxoScript, Y as CSVMultisigTapscript, o as RelativeTimelock, V as VtxoScript, aw as Status, ax as Outpoint, ay as ChainTx, n as IndexerProvider, t as TxTree, az as PathContext } from './ark-Dsv5Jq4E.js';
2
+ export { Q as ArkAddress, P as ArkInfo, aA as ArkTapscript, aB as Asset, aC as AssetMetadata, aD as BaseWalletConfig, x as BatchFailedEvent, v as BatchFinalizationEvent, w as BatchFinalizedEvent, aE as BatchInfo, aF as BatchSignableIdentity, B as BatchStartedEvent, aG as CLTVMultisigTapscript, aH as ChainTxType, aI as CommitmentTx, aJ as ConditionCSVMultisigTapscript, aK as ConditionMultisigTapscript, aL as ContractBalance, aM as ContractEventCallback, aN as ContractHandler, X as ContractManager, aO as ContractManagerConfig, aP as ContractState, aQ as ContractVtxo, aR as ContractWatcher, aS as DelegateManagerImpl, aT as DelegateOptions, J as DelegateProvider, aU as DelegatorManagerImpl, aV as DelegatorProvider, aW as Discoverable, aX as DiscoveredContract, aY as DiscoveryDeps, aZ as ESPLORA_URL, a_ as EsploraProvider, a$ as ExtendedContractVtxo, b0 as HandlerError, b1 as IDelegatorManager, b2 as IndexerTxType, a1 as Intent, b3 as KnownMetadata, b4 as MultisigTapscript, b5 as Nonces, b6 as Output, b7 as PageResponse, b8 as PaginationOptions, b9 as PartialSig, ba as ProviderClass, K as ReadonlyWalletConfig, j as RestArkProvider, bb as RestDelegateProvider, bc as RestDelegatorProvider, k as RestIndexerProvider, bd as ScanContractsOptions, be as ScanResult, bf as ScheduledSession, bg as SettlementEventType, bh as SignRequest, a0 as SignedIntent, bi as SubscriptionEvent, bj as SubscriptionHeartbeat, l as SubscriptionResponse, bk as TapLeaves, bl as TapTreeCoder, bm as TapscriptType, bn as TreeNonces, u as TreeNoncesEvent, bo as TreePartialSigs, z as TreeSignatureEvent, s as TreeSigningStartedEvent, y as TreeTxEvent, bp as Tx, bq as TxHistoryRecord, br as TxKey, T as TxNotification, bs as TxTreeNode, bt as TxType, bu as VirtualStatus, bv as Vtxo, bw as VtxoChain, _ as VtxoManager, bx as VtxoType, b as WalletConfig, by as WalletMode, bz as decodeTapscript, bA as getSequence, bB as isBatchSignable, bC as isDiscoverable, bD as isExpired, bE as isRecoverable, bF as isSpendable, bG as isSubdust, bH as isVtxoExpiringSoon, bI as networks } from './ark-Dsv5Jq4E.js';
3
+ export { B as BoardingContractHandler, a as BoardingContractParams, D as DefaultContractHandler, b as DefaultContractParams, c as DelegateContractHandler, d as DelegateContractParams, V as VHTLC, e as VHTLCContractHandler, f as VHTLCContractParams, g as contractHandlers } from './index-FwXZveaX.js';
4
+ export { D as DefaultVtxo, a as DelegateVtxo } from './delegate-Baz_hb83.js';
5
+ import { W as Wallet, R as ReadonlyWallet, a as ReceiveRotatorFactory, b as ReceiveRotatorBootOpts, c as ReceiveRotatorBoot } from './wallet-D6uoBLmS.js';
6
+ export { B as Batch, I as IncomingFunds, w as waitForIncomingFunds } from './wallet-D6uoBLmS.js';
7
+ import { Bytes, BTC_NETWORK } from '@scure/btc-signer/utils.js';
7
8
  import { P2TR } from '@scure/btc-signer/payment.js';
8
9
  import { Transaction as Transaction$1 } from '@scure/btc-signer';
9
10
  import { ElectrumWS } from 'ws-electrumx-client';
10
11
  import { TransactionOutput, TransactionInputUpdate } from '@scure/btc-signer/psbt.js';
11
- import { BTC_NETWORK, Bytes } from '@scure/btc-signer/utils.js';
12
12
  import { Transaction as Transaction$2 } from '@scure/btc-signer/transaction.js';
13
13
  import { S as StorageAdapter } from './index-C0IanN1m.js';
14
14
 
@@ -717,15 +717,15 @@ declare class Estimator {
717
717
  }
718
718
 
719
719
  /**
720
- * Thrown when a rotated contract (default or delegate) is missing the
721
- * metadata.signingDescriptor required to route it to a descriptor-aware
720
+ * Thrown when a rotated contract (default, delegate, or boarding) is missing
721
+ * the metadata.signingDescriptor required to route it to a descriptor-aware
722
722
  * signer.
723
723
  */
724
724
  declare class MissingSigningDescriptorError extends Error {
725
725
  readonly contractScript: string;
726
- readonly contractType: "default" | "delegate";
726
+ readonly contractType: "default" | "delegate" | "boarding";
727
727
  readonly name = "MissingSigningDescriptorError";
728
- constructor(contractScript: string, contractType: "default" | "delegate");
728
+ constructor(contractScript: string, contractType: "default" | "delegate" | "boarding");
729
729
  }
730
730
  /**
731
731
  * Thrown when an input needs descriptor-aware signing but no
@@ -921,6 +921,55 @@ declare class MessageBus {
921
921
  static setup(path: string): Promise<ServiceWorker>;
922
922
  }
923
923
 
924
+ /**
925
+ * A leaf node in the Taproot script tree, as consumed by
926
+ * `@scure/btc-signer`'s `p2tr(internalKey, tree, ...)`.
927
+ */
928
+ interface TaprootLeaf {
929
+ script: Bytes;
930
+ leafVersion: number;
931
+ }
932
+ /**
933
+ * Internal tree node shape consumed by `@scure/btc-signer`'s `p2tr`:
934
+ * - A leaf is `{ script, leafVersion }`
935
+ * - A branch is a 2-element tuple `[leftNode, rightNode]` of nodes
936
+ */
937
+ type TaprootTreeNode = TaprootLeaf | [TaprootTreeNode, TaprootTreeNode];
938
+ /**
939
+ * Assemble a Taproot script tree from a flat list of scripts using the
940
+ * exact algorithm arkd's btcd dependency uses
941
+ * (`txscript.AssembleTaprootScriptTree`, see
942
+ * https://github.com/btcsuite/btcd/blob/master/txscript/taproot.go).
943
+ *
944
+ * The algorithm:
945
+ *
946
+ * Phase 1 — pair leaves left-to-right:
947
+ * for i := 0; i < len(leaves); i += 2:
948
+ * if i is the last index (odd leaf at end):
949
+ * merge with the LAST branch built so far (do NOT pair as a fresh leaf)
950
+ * else:
951
+ * create a new branch from (leaves[i], leaves[i+1])
952
+ *
953
+ * Phase 2 — FIFO-queue merge branches:
954
+ * while branches has ≥ 2 items:
955
+ * take front two, combine into a new branch, push to back of queue
956
+ *
957
+ * This matters because `@scure/btc-signer`'s `taprootListToTree` builds a
958
+ * Huffman tree (weight-1 leaves combine by smallest-weight pairs). For
959
+ * power-of-2 leaf counts both algorithms happen to produce the same
960
+ * perfectly-balanced binary tree and agree. For any other count they
961
+ * produce DIFFERENT shapes → different merkle roots → different taproot
962
+ * output keys → arkd rejects spends with `INVALID_PSBT_INPUT`.
963
+ *
964
+ * Reproducing btcd's algorithm here lets the SDK construct taptrees that
965
+ * arkd accepts for arbitrary leaf counts.
966
+ *
967
+ * @param scripts - Raw tapscript bytes for each leaf, in the order they
968
+ * should be encoded in the TapTree PSBT field.
969
+ * @returns The nested-tuple form `p2tr` accepts.
970
+ */
971
+ declare function assembleBtcdTaprootTree(scripts: Bytes[]): TaprootTreeNode;
972
+
924
973
  /**
925
974
  * Thrown when a collaborative-exit / offboard would leave a change VTXO below
926
975
  * the dust threshold. Lets callers (e.g. wallet UI) react with appropriate UX
@@ -2065,8 +2114,8 @@ declare function setupServiceWorker(pathOrOptions: string | SetupServiceWorkerOp
2065
2114
  * `blockchain.transaction.broadcast_package` for atomic 1P1C TRUC
2066
2115
  * relay; see `ElectrumOnchainProvider.broadcastTransaction`). Testnet
2067
2116
  * defaults to Blockstream's public Fulcrum because Ark doesn't host
2068
- * it. Regtest assumes the `electrum-ws` websocat bridge from
2069
- * `vulpemventures/nigiri`.
2117
+ * it. Regtest assumes the Fulcrum WebSocket endpoint exposed by the
2118
+ * local `arkade-regtest` stack.
2070
2119
  *
2071
2120
  * @example
2072
2121
  * ```typescript
@@ -2399,9 +2448,18 @@ declare function hasBoardingTxExpired(coin: ExtendedCoin, boardingTimelock: Rela
2399
2448
  */
2400
2449
  declare function verifyTapscriptSignatures(tx: Transaction, inputIndex: number, requiredSigners: string[], excludePubkeys?: string[], allowedSighashTypes?: number[]): void;
2401
2450
  /**
2402
- * Merges the signed transaction with the original transaction
2451
+ * Merges the tapscript signatures of `signedTx` onto `originalTx`, in place.
2452
+ *
2453
+ * Invariant: both transactions must have the same number of inputs and BOTH
2454
+ * must carry a `tapScriptSig` on every input — the result is the per-input
2455
+ * concatenation `originalTx.tapScriptSig ++ signedTx.tapScriptSig`. A missing
2456
+ * signature on either side is rejected with an input-indexed error rather than
2457
+ * silently corrupting the witness (the previous code appended `undefined` when
2458
+ * `signedTx` was unsigned). Callers that partially sign must merge only fully
2459
+ * co-signed inputs.
2460
+ *
2403
2461
  * @param signedTx signed transaction
2404
- * @param originalTx original transaction
2462
+ * @param originalTx original transaction (mutated and returned)
2405
2463
  */
2406
2464
  declare function combineTapscriptSigs(signedTx: Transaction, originalTx: Transaction): Transaction;
2407
2465
  /**
@@ -3360,6 +3418,21 @@ declare namespace index {
3360
3418
  export { index_AssetGroup as AssetGroup, index_AssetId as AssetId, index_AssetInput as AssetInput, index_AssetInputType as AssetInputType, index_AssetInputs as AssetInputs, index_AssetOutput as AssetOutput, index_AssetOutputs as AssetOutputs, index_AssetRef as AssetRef, index_AssetRefType as AssetRefType, index_Metadata as Metadata, index_MetadataList as MetadataList, index_Packet as Packet };
3361
3419
  }
3362
3420
 
3421
+ /**
3422
+ * Check if an absolute (CLTV) locktime is currently satisfied.
3423
+ *
3424
+ * Following the BIP65 convention:
3425
+ * - locktime < 500_000_000 → interpreted as a block height; compared against `context.blockHeight`
3426
+ * - locktime >= 500_000_000 → interpreted as a Unix timestamp (seconds); compared against `context.currentTime`
3427
+ *
3428
+ * Returns false if the relevant context field is missing.
3429
+ */
3430
+ declare function isCltvSatisfied(context: PathContext, locktime: bigint): boolean;
3431
+ /**
3432
+ * Check if a CSV timelock is currently satisfied for the given context/virtual output.
3433
+ */
3434
+ declare function isCsvSpendable(context: PathContext, sequence?: number): boolean;
3435
+
3363
3436
  /**
3364
3437
  * Convert RelativeTimelock to BIP68 sequence number.
3365
3438
  */
@@ -3467,4 +3540,4 @@ declare class AssetManager extends ReadonlyAssetManager implements IAssetManager
3467
3540
  burn(params: BurnParams): Promise<string>;
3468
3541
  }
3469
3542
 
3470
- export { type AnchorBumper, ArkError, ArkNote, ArkProvider, type ArkPsbtFieldCoder, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ArkTransaction, type ArkTxInput, AssetDetails, AssetManager, BIP322, BurnParams, CSVMultisigTapscript, ChainTx, Coin, ConditionWitness, Contract, ContractEvent, ContractRepository, ContractRepositoryImpl, ContractWatcherConfig, ContractWithVtxos, CosignerPublicKey, CreateContractParams, DEFAULT_MESSAGE_TIMEOUTS, DelegateInfo, DelegateNotConfiguredError, DelegatorNotConfiguredError, type DescriptorOptions, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, type BlockHeader as ElectrumBlockHeader, ElectrumOnchainProvider, type TransactionHistory as ElectrumTransactionHistory, type Unspent as ElectrumUnspent, EncodedVtxoScript, Estimator, ExplorerTransaction, ExtendedCoin, ExtendedVirtualCoin, FeeAmount, FeeInfo, FeeOutput, GetVtxosFilter, HDDescriptorProvider, IAssetManager, IContractManager, IDelegateManager, IReadonlyAssetManager, IReadonlyWallet, IVtxoManager, IWallet, Identity, InMemoryContractRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBWalletRepository, IndexerProvider, IntentFeeConfig, IssuanceParams, IssuanceResult, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MessageBus, MessageBusNotInitializedError, type MessageHandler, type MessageTimeouts, type MigrationStatus, MissingSigningDescriptorError, MnemonicIdentity, type MnemonicOptions, Network, NetworkName, type NetworkOptions, OffchainInput, type OffchainTx, OnchainInput, OnchainProvider, OnchainWallet, Outpoint, P2A, type ParsedArkContract, PathSelection, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlyIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, Recipient, ReissuanceParams, RelativeTimelock, RenewVtxosOptions, type RequestEnvelope, type ResponseEnvelope, SeedIdentity, type SeedIdentityOptions, SendBitcoinParams, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, type ServiceWorkerWalletMode, SettleParams, SettlementConfig, SettlementEvent, SignerSession, SingleKey, Status, StorageConfig, TapLeafScript, Transaction, TxTree, TxWeightEstimator, Unroll, type VSize, VirtualCoin, VtxoScript, VtxoTaprootTree, VtxoTreeExpiry, Wallet, WalletBalance, WalletMessageHandler, WalletNotInitializedError, WalletRepository, WalletRepositoryImpl, WsElectrumChainSource, index as asset, buildForfeitTx, buildOffchainTx, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, decodeArkContract, encodeArkContract, getArkPsbtFields, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isValidArkAddress, maybeArkError, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, sequenceToTimelock, setArkPsbtField, setupServiceWorker, timelockToSequence, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures };
3543
+ export { type AnchorBumper, ArkError, ArkNote, ArkProvider, type ArkPsbtFieldCoder, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ArkTransaction, type ArkTxInput, AssetDetails, AssetManager, BIP322, BurnParams, CSVMultisigTapscript, ChainTx, Coin, ConditionWitness, Contract, ContractEvent, ContractRepository, ContractRepositoryImpl, ContractWatcherConfig, ContractWithVtxos, CosignerPublicKey, CreateContractParams, DEFAULT_MESSAGE_TIMEOUTS, DelegateInfo, DelegateNotConfiguredError, DelegatorNotConfiguredError, type DescriptorOptions, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, type BlockHeader as ElectrumBlockHeader, ElectrumOnchainProvider, type TransactionHistory as ElectrumTransactionHistory, type Unspent as ElectrumUnspent, EncodedVtxoScript, Estimator, ExplorerTransaction, ExtendedCoin, ExtendedVirtualCoin, FeeAmount, FeeInfo, FeeOutput, GetVtxosFilter, HDDescriptorProvider, IAssetManager, IContractManager, IDelegateManager, IReadonlyAssetManager, IReadonlyWallet, IVtxoManager, IWallet, Identity, InMemoryContractRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBWalletRepository, IndexerProvider, IntentFeeConfig, IssuanceParams, IssuanceResult, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MessageBus, MessageBusNotInitializedError, type MessageHandler, type MessageTimeouts, type MigrationStatus, MissingSigningDescriptorError, MnemonicIdentity, type MnemonicOptions, Network, NetworkName, type NetworkOptions, OffchainInput, type OffchainTx, OnchainInput, OnchainProvider, OnchainWallet, Outpoint, P2A, type ParsedArkContract, PathContext, PathSelection, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlyIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, Recipient, ReissuanceParams, RelativeTimelock, RenewVtxosOptions, type RequestEnvelope, type ResponseEnvelope, SeedIdentity, type SeedIdentityOptions, SendBitcoinParams, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, type ServiceWorkerWalletMode, SettleParams, SettlementConfig, SettlementEvent, SignerSession, SingleKey, Status, StorageConfig, TapLeafScript, Transaction, TxTree, TxWeightEstimator, Unroll, type VSize, VirtualCoin, VtxoScript, VtxoTaprootTree, VtxoTreeExpiry, Wallet, WalletBalance, WalletMessageHandler, WalletNotInitializedError, WalletRepository, WalletRepositoryImpl, WsElectrumChainSource, assembleBtcdTaprootTree, index as asset, buildForfeitTx, buildOffchainTx, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, decodeArkContract, encodeArkContract, getArkPsbtFields, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isCltvSatisfied, isCsvSpendable, isValidArkAddress, maybeArkError, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, sequenceToTimelock, setArkPsbtField, setupServiceWorker, timelockToSequence, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures };
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- export { ArkNote, AssetManager, BIP322, Batch, ContractManager, ContractRepositoryImpl, ContractWatcher, DEFAULT_MESSAGE_TIMEOUTS, DelegateManagerImpl, DelegateNotConfiguredError, DelegatorManagerImpl, DelegatorNotConfiguredError, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, ESPLORA_URL, ElectrumOnchainProvider, EsploraProvider, Estimator, HDDescriptorProvider, InMemoryContractRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBWalletRepository, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MessageBus, MessageBusNotInitializedError, MissingSigningDescriptorError, MnemonicIdentity, OnchainWallet, P2A, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, RestDelegateProvider, RestDelegatorProvider, SeedIdentity, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, SingleKey, TxTree, TxType, TxWeightEstimator, Unroll, VtxoManager, Wallet, WalletMessageHandler, WalletNotInitializedError, WalletRepositoryImpl, WsElectrumChainSource, buildForfeitTx, buildOffchainTx, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, decodeArkContract, encodeArkContract, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isBatchSignable, isDiscoverable, isExpired, isRecoverable, isSpendable, isSubdust, isValidArkAddress, isVtxoExpiringSoon, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, setupServiceWorker, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures, waitForIncomingFunds } from './chunk-XROGFOPX.js';
2
- export { ArkError, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ChainTxType, ConditionWitness, CosignerPublicKey, IndexerTxType, Intent, RestArkProvider, RestIndexerProvider, SettlementEventType, Transaction, VtxoTaprootTree, VtxoTreeExpiry, asset_exports as asset, getArkPsbtFields, maybeArkError, setArkPsbtField } from './chunk-6NWNOLL3.js';
3
- export { DefaultContractHandler, DefaultVtxo, DelegateContractHandler, DelegateVtxo, VHTLC, VHTLCContractHandler, contractHandlers } from './chunk-YA4G7RFB.js';
4
- export { ArkAddress, CLTVMultisigTapscript, CSVMultisigTapscript, ConditionCSVMultisigTapscript, ConditionMultisigTapscript, MultisigTapscript, TapTreeCoder, VtxoScript, decodeTapscript, getSequence, networks, sequenceToTimelock, timelockToSequence } from './chunk-TU3LVAPX.js';
1
+ export { ArkNote, AssetManager, BIP322, Batch, ContractManager, ContractRepositoryImpl, ContractWatcher, DEFAULT_MESSAGE_TIMEOUTS, DelegateManagerImpl, DelegateNotConfiguredError, DelegatorManagerImpl, DelegatorNotConfiguredError, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, ESPLORA_URL, ElectrumOnchainProvider, EsploraProvider, Estimator, HDDescriptorProvider, InMemoryContractRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBWalletRepository, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MessageBus, MessageBusNotInitializedError, MissingSigningDescriptorError, MnemonicIdentity, OnchainWallet, P2A, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, RestDelegateProvider, RestDelegatorProvider, SeedIdentity, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, SingleKey, TxTree, TxType, TxWeightEstimator, Unroll, VtxoManager, Wallet, WalletMessageHandler, WalletNotInitializedError, WalletRepositoryImpl, WsElectrumChainSource, buildForfeitTx, buildOffchainTx, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, decodeArkContract, encodeArkContract, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isBatchSignable, isDiscoverable, isExpired, isRecoverable, isSpendable, isSubdust, isValidArkAddress, isVtxoExpiringSoon, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, setupServiceWorker, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures, waitForIncomingFunds } from './chunk-HFXEUW55.js';
2
+ export { ArkError, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ChainTxType, ConditionWitness, CosignerPublicKey, IndexerTxType, Intent, RestArkProvider, RestIndexerProvider, SettlementEventType, Transaction, VtxoTaprootTree, VtxoTreeExpiry, asset_exports as asset, getArkPsbtFields, maybeArkError, setArkPsbtField } from './chunk-FXFBPXV3.js';
3
+ export { BoardingContractHandler, DefaultContractHandler, DefaultVtxo, DelegateContractHandler, DelegateVtxo, VHTLC, VHTLCContractHandler, contractHandlers, isCltvSatisfied, isCsvSpendable } from './chunk-CUSABEUQ.js';
4
+ export { ArkAddress, CLTVMultisigTapscript, CSVMultisigTapscript, ConditionCSVMultisigTapscript, ConditionMultisigTapscript, MultisigTapscript, TapTreeCoder, VtxoScript, assembleBtcdTaprootTree, decodeTapscript, getSequence, networks, sequenceToTimelock, timelockToSequence } from './chunk-OUVTG72A.js';
5
5
  import './chunk-NSBPE2FW.js';
6
6
  //# sourceMappingURL=index.js.map
7
7
  //# sourceMappingURL=index.js.map
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkKQK4PP6L_cjs = require('../../chunk-KQK4PP6L.cjs');
4
- require('../../chunk-6FLL2Q36.cjs');
5
- require('../../chunk-IEO3XDKI.cjs');
6
- require('../../chunk-WMIPYZSB.cjs');
3
+ var chunkXCHBQVMK_cjs = require('../../chunk-XCHBQVMK.cjs');
4
+ require('../../chunk-FSAXPBGP.cjs');
5
+ require('../../chunk-GUTKJMSF.cjs');
6
+ require('../../chunk-CMPJR3HS.cjs');
7
7
  require('../../chunk-5BLDMQED.cjs');
8
8
 
9
9
  // src/repositories/realm/walletRepository.ts
@@ -37,7 +37,7 @@ var RealmWalletRepository = class {
37
37
  await this.ensureInit();
38
38
  this.realm.write(() => {
39
39
  for (const vtxo of vtxos) {
40
- const s = chunkKQK4PP6L_cjs.serializeVtxo(vtxo);
40
+ const s = chunkXCHBQVMK_cjs.serializeVtxo(vtxo);
41
41
  this.realm.create(
42
42
  "ArkVtxo",
43
43
  {
@@ -85,7 +85,7 @@ var RealmWalletRepository = class {
85
85
  throw new Error("RealmWalletRepository requires an address");
86
86
  }
87
87
  for (const vtxo of vtxos) {
88
- if (!chunkKQK4PP6L_cjs.isVtxoForScript(vtxo, key.script)) {
88
+ if (!chunkXCHBQVMK_cjs.isVtxoForScript(vtxo, key.script)) {
89
89
  throw new Error(
90
90
  `VTXO ${vtxo.txid}:${vtxo.vout} script mismatch: expected ${key.script}, got ${vtxo.script}`
91
91
  );
@@ -110,7 +110,7 @@ var RealmWalletRepository = class {
110
110
  await this.ensureInit();
111
111
  this.realm.write(() => {
112
112
  for (const utxo of utxos) {
113
- const s = chunkKQK4PP6L_cjs.serializeUtxo(utxo);
113
+ const s = chunkXCHBQVMK_cjs.serializeUtxo(utxo);
114
114
  this.realm.create(
115
115
  "ArkUtxo",
116
116
  {
@@ -163,7 +163,7 @@ var RealmWalletRepository = class {
163
163
  amount: tx.amount,
164
164
  settled: tx.settled,
165
165
  createdAt: tx.createdAt,
166
- assetsJson: tx.assets ? JSON.stringify(chunkKQK4PP6L_cjs.serializeAssets(tx.assets)) : null
166
+ assetsJson: tx.assets ? JSON.stringify(chunkXCHBQVMK_cjs.serializeAssets(tx.assets)) : null
167
167
  },
168
168
  "modified"
169
169
  );
@@ -233,9 +233,9 @@ function vtxoObjectToDomain(obj) {
233
233
  // Post-migration every row has `script`, but the backfill is
234
234
  // idempotent: derive from `address` if the legacy column is still
235
235
  // null (e.g. the migration hasn't run yet on this handle).
236
- script: obj.script ?? chunkKQK4PP6L_cjs.scriptFromArkAddress(obj.address)
236
+ script: obj.script ?? chunkXCHBQVMK_cjs.scriptFromArkAddress(obj.address)
237
237
  };
238
- return chunkKQK4PP6L_cjs.deserializeVtxo(serialized);
238
+ return chunkXCHBQVMK_cjs.deserializeVtxo(serialized);
239
239
  }
240
240
  function utxoObjectToDomain(obj) {
241
241
  const serialized = {
@@ -254,7 +254,7 @@ function utxoObjectToDomain(obj) {
254
254
  status: JSON.parse(obj.statusJson),
255
255
  extraWitness: obj.extraWitnessJson ? JSON.parse(obj.extraWitnessJson) : void 0
256
256
  };
257
- return chunkKQK4PP6L_cjs.deserializeUtxo(serialized);
257
+ return chunkXCHBQVMK_cjs.deserializeUtxo(serialized);
258
258
  }
259
259
  function txObjectToDomain(obj) {
260
260
  const tx = {
@@ -269,7 +269,7 @@ function txObjectToDomain(obj) {
269
269
  createdAt: obj.createdAt
270
270
  };
271
271
  if (obj.assetsJson) {
272
- tx.assets = chunkKQK4PP6L_cjs.deserializeAssets(JSON.parse(obj.assetsJson));
272
+ tx.assets = chunkXCHBQVMK_cjs.deserializeAssets(JSON.parse(obj.assetsJson));
273
273
  }
274
274
  return tx;
275
275
  }
@@ -499,7 +499,7 @@ function runArkRealmMigrations(oldRealm, newRealm) {
499
499
  for (let i = 0; i < newVtxos.length; i++) {
500
500
  const newVtxo = newVtxos[i];
501
501
  if (!newVtxo.script) {
502
- newVtxo.script = chunkKQK4PP6L_cjs.scriptFromArkAddress(newVtxo.address);
502
+ newVtxo.script = chunkXCHBQVMK_cjs.scriptFromArkAddress(newVtxo.address);
503
503
  }
504
504
  }
505
505
  }
@@ -1,4 +1,4 @@
1
- import { W as WalletRepository, E as ExtendedVirtualCoin, s as VtxoRepositoryKey, d as ExtendedCoin, A as ArkTransaction, t as WalletState, C as ContractRepository, u as ContractFilter, r as Contract } from '../../ark-ibLW4Hte.cjs';
1
+ import { W as WalletRepository, E as ExtendedVirtualCoin, a2 as VtxoRepositoryKey, d as ExtendedCoin, A as ArkTransaction, a3 as WalletState, C as ContractRepository, a4 as ContractFilter, r as Contract } from '../../ark-Dsv5Jq4E.cjs';
2
2
  import '@scure/btc-signer/transaction.js';
3
3
  import '@scure/btc-signer/utils.js';
4
4
  import '@scure/btc-signer/psbt.js';
@@ -1,4 +1,4 @@
1
- import { W as WalletRepository, E as ExtendedVirtualCoin, s as VtxoRepositoryKey, d as ExtendedCoin, A as ArkTransaction, t as WalletState, C as ContractRepository, u as ContractFilter, r as Contract } from '../../ark-ibLW4Hte.js';
1
+ import { W as WalletRepository, E as ExtendedVirtualCoin, a2 as VtxoRepositoryKey, d as ExtendedCoin, A as ArkTransaction, a3 as WalletState, C as ContractRepository, a4 as ContractFilter, r as Contract } from '../../ark-Dsv5Jq4E.js';
2
2
  import '@scure/btc-signer/transaction.js';
3
3
  import '@scure/btc-signer/utils.js';
4
4
  import '@scure/btc-signer/psbt.js';
@@ -1,7 +1,7 @@
1
- import { serializeVtxo, isVtxoForScript, serializeUtxo, serializeAssets, scriptFromArkAddress, deserializeVtxo, deserializeUtxo, deserializeAssets } from '../../chunk-XROGFOPX.js';
2
- import '../../chunk-6NWNOLL3.js';
3
- import '../../chunk-YA4G7RFB.js';
4
- import '../../chunk-TU3LVAPX.js';
1
+ import { serializeVtxo, isVtxoForScript, serializeUtxo, serializeAssets, scriptFromArkAddress, deserializeVtxo, deserializeUtxo, deserializeAssets } from '../../chunk-HFXEUW55.js';
2
+ import '../../chunk-FXFBPXV3.js';
3
+ import '../../chunk-CUSABEUQ.js';
4
+ import '../../chunk-OUVTG72A.js';
5
5
  import '../../chunk-NSBPE2FW.js';
6
6
 
7
7
  // src/repositories/realm/walletRepository.ts
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkKQK4PP6L_cjs = require('../../chunk-KQK4PP6L.cjs');
4
- require('../../chunk-6FLL2Q36.cjs');
5
- require('../../chunk-IEO3XDKI.cjs');
6
- require('../../chunk-WMIPYZSB.cjs');
3
+ var chunkXCHBQVMK_cjs = require('../../chunk-XCHBQVMK.cjs');
4
+ require('../../chunk-FSAXPBGP.cjs');
5
+ require('../../chunk-GUTKJMSF.cjs');
6
+ require('../../chunk-CMPJR3HS.cjs');
7
7
  require('../../chunk-5BLDMQED.cjs');
8
8
 
9
9
  // src/repositories/sqlite/walletRepository.ts
@@ -126,7 +126,7 @@ var SQLiteWalletRepository = class {
126
126
  for (const row of nullRows) {
127
127
  await this.db.run(
128
128
  `UPDATE ${this.tables.vtxos} SET script = ? WHERE txid = ? AND vout = ?`,
129
- [chunkKQK4PP6L_cjs.scriptFromArkAddress(row.address), row.txid, row.vout]
129
+ [chunkXCHBQVMK_cjs.scriptFromArkAddress(row.address), row.txid, row.vout]
130
130
  );
131
131
  }
132
132
  const tempName = `${this.tables.vtxos}__migrate_tmp`;
@@ -204,7 +204,7 @@ var SQLiteWalletRepository = class {
204
204
  async saveVtxos(address, vtxos) {
205
205
  await this.ensureInit();
206
206
  for (const vtxo of vtxos) {
207
- const s = chunkKQK4PP6L_cjs.serializeVtxo(vtxo);
207
+ const s = chunkXCHBQVMK_cjs.serializeVtxo(vtxo);
208
208
  await this.db.run(
209
209
  `INSERT OR REPLACE INTO ${this.tables.vtxos}
210
210
  (txid, vout, value, address,
@@ -259,7 +259,7 @@ var SQLiteWalletRepository = class {
259
259
  throw new Error("SQLiteWalletRepository requires an address");
260
260
  }
261
261
  for (const vtxo of vtxos) {
262
- if (!chunkKQK4PP6L_cjs.isVtxoForScript(vtxo, key.script)) {
262
+ if (!chunkXCHBQVMK_cjs.isVtxoForScript(vtxo, key.script)) {
263
263
  throw new Error(
264
264
  `VTXO ${vtxo.txid}:${vtxo.vout} script mismatch: expected ${key.script}, got ${vtxo.script}`
265
265
  );
@@ -283,7 +283,7 @@ var SQLiteWalletRepository = class {
283
283
  async saveUtxos(address, utxos) {
284
284
  await this.ensureInit();
285
285
  for (const utxo of utxos) {
286
- const s = chunkKQK4PP6L_cjs.serializeUtxo(utxo);
286
+ const s = chunkXCHBQVMK_cjs.serializeUtxo(utxo);
287
287
  await this.db.run(
288
288
  `INSERT OR REPLACE INTO ${this.tables.utxos}
289
289
  (txid, vout, value, address,
@@ -339,7 +339,7 @@ var SQLiteWalletRepository = class {
339
339
  tx.amount,
340
340
  tx.settled ? 1 : 0,
341
341
  tx.createdAt,
342
- tx.assets ? JSON.stringify(chunkKQK4PP6L_cjs.serializeAssets(tx.assets)) : null
342
+ tx.assets ? JSON.stringify(chunkXCHBQVMK_cjs.serializeAssets(tx.assets)) : null
343
343
  ]
344
344
  );
345
345
  }
@@ -413,9 +413,9 @@ function vtxoRowToDomain(row) {
413
413
  // Post-migration every row has `script`, but the backfill is
414
414
  // idempotent: derive from `address` if the legacy column is still
415
415
  // null (e.g. the migration hasn't run yet on this handle).
416
- script: row.script ?? chunkKQK4PP6L_cjs.scriptFromArkAddress(row.address)
416
+ script: row.script ?? chunkXCHBQVMK_cjs.scriptFromArkAddress(row.address)
417
417
  };
418
- return chunkKQK4PP6L_cjs.deserializeVtxo(serialized);
418
+ return chunkXCHBQVMK_cjs.deserializeVtxo(serialized);
419
419
  }
420
420
  function utxoRowToDomain(row) {
421
421
  const serialized = {
@@ -434,7 +434,7 @@ function utxoRowToDomain(row) {
434
434
  status: JSON.parse(row.status_json),
435
435
  extraWitness: row.extra_witness_json ? JSON.parse(row.extra_witness_json) : void 0
436
436
  };
437
- return chunkKQK4PP6L_cjs.deserializeUtxo(serialized);
437
+ return chunkXCHBQVMK_cjs.deserializeUtxo(serialized);
438
438
  }
439
439
  function txRowToDomain(row) {
440
440
  const tx = {
@@ -449,7 +449,7 @@ function txRowToDomain(row) {
449
449
  createdAt: row.created_at
450
450
  };
451
451
  if (row.assets_json) {
452
- tx.assets = chunkKQK4PP6L_cjs.deserializeAssets(JSON.parse(row.assets_json));
452
+ tx.assets = chunkXCHBQVMK_cjs.deserializeAssets(JSON.parse(row.assets_json));
453
453
  }
454
454
  return tx;
455
455
  }
@@ -1,4 +1,4 @@
1
- import { W as WalletRepository, E as ExtendedVirtualCoin, s as VtxoRepositoryKey, d as ExtendedCoin, A as ArkTransaction, t as WalletState, C as ContractRepository, u as ContractFilter, r as Contract } from '../../ark-ibLW4Hte.cjs';
1
+ import { W as WalletRepository, E as ExtendedVirtualCoin, a2 as VtxoRepositoryKey, d as ExtendedCoin, A as ArkTransaction, a3 as WalletState, C as ContractRepository, a4 as ContractFilter, r as Contract } from '../../ark-Dsv5Jq4E.cjs';
2
2
  import '@scure/btc-signer/transaction.js';
3
3
  import '@scure/btc-signer/utils.js';
4
4
  import '@scure/btc-signer/psbt.js';
@@ -1,4 +1,4 @@
1
- import { W as WalletRepository, E as ExtendedVirtualCoin, s as VtxoRepositoryKey, d as ExtendedCoin, A as ArkTransaction, t as WalletState, C as ContractRepository, u as ContractFilter, r as Contract } from '../../ark-ibLW4Hte.js';
1
+ import { W as WalletRepository, E as ExtendedVirtualCoin, a2 as VtxoRepositoryKey, d as ExtendedCoin, A as ArkTransaction, a3 as WalletState, C as ContractRepository, a4 as ContractFilter, r as Contract } from '../../ark-Dsv5Jq4E.js';
2
2
  import '@scure/btc-signer/transaction.js';
3
3
  import '@scure/btc-signer/utils.js';
4
4
  import '@scure/btc-signer/psbt.js';
@@ -1,7 +1,7 @@
1
- import { scriptFromArkAddress, serializeVtxo, isVtxoForScript, serializeUtxo, serializeAssets, deserializeVtxo, deserializeUtxo, deserializeAssets } from '../../chunk-XROGFOPX.js';
2
- import '../../chunk-6NWNOLL3.js';
3
- import '../../chunk-YA4G7RFB.js';
4
- import '../../chunk-TU3LVAPX.js';
1
+ import { scriptFromArkAddress, serializeVtxo, isVtxoForScript, serializeUtxo, serializeAssets, deserializeVtxo, deserializeUtxo, deserializeAssets } from '../../chunk-HFXEUW55.js';
2
+ import '../../chunk-FXFBPXV3.js';
3
+ import '../../chunk-CUSABEUQ.js';
4
+ import '../../chunk-OUVTG72A.js';
5
5
  import '../../chunk-NSBPE2FW.js';
6
6
 
7
7
  // src/repositories/sqlite/walletRepository.ts
@@ -1,4 +1,4 @@
1
- import { W as WalletRepository, C as ContractRepository, n as IndexerProvider, m as ArkProvider, q as VirtualCoin, r as Contract, E as ExtendedVirtualCoin } from './ark-ibLW4Hte.js';
1
+ import { W as WalletRepository, C as ContractRepository, n as IndexerProvider, m as ArkProvider, q as VirtualCoin, r as Contract, E as ExtendedVirtualCoin } from './ark-Dsv5Jq4E.js';
2
2
 
3
3
  /**
4
4
  * A task item represents a unit of work in the inbox.