@arkade-os/sdk 0.4.67 → 0.4.68

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 (78) hide show
  1. package/README.md +5 -0
  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/{asyncStorageTaskQueue-LTpeXYaD.d.cts → asyncStorageTaskQueue-B2CcXIHU.d.cts} +2 -2
  9. package/dist/{asyncStorageTaskQueue-Za-e_zMk.d.ts → asyncStorageTaskQueue-DaZlVTbM.d.ts} +2 -2
  10. package/dist/{chunk-X3VEMUVV.js → chunk-33Q2RFET.js} +3 -3
  11. package/dist/{chunk-X3VEMUVV.js.map → chunk-33Q2RFET.js.map} +1 -1
  12. package/dist/{chunk-6TAQF6EV.js → chunk-45FKMOJH.js} +72 -120
  13. package/dist/chunk-45FKMOJH.js.map +1 -0
  14. package/dist/{chunk-3WIWNE4P.js → chunk-4CMXV5SF.js} +16 -4
  15. package/dist/chunk-4CMXV5SF.js.map +1 -0
  16. package/dist/{chunk-YDRZDZPP.cjs → chunk-4KCVS4ZN.cjs} +10 -10
  17. package/dist/{chunk-YDRZDZPP.cjs.map → chunk-4KCVS4ZN.cjs.map} +1 -1
  18. package/dist/{chunk-OIZ2V2VD.cjs → chunk-6YUACVX4.cjs} +118 -166
  19. package/dist/chunk-6YUACVX4.cjs.map +1 -0
  20. package/dist/{chunk-2JV4VQ7C.cjs → chunk-EJOFL5WH.cjs} +17 -3
  21. package/dist/chunk-EJOFL5WH.cjs.map +1 -0
  22. package/dist/{chunk-MZFUZUTQ.js → chunk-G4I6PU5H.js} +4 -4
  23. package/dist/{chunk-MZFUZUTQ.js.map → chunk-G4I6PU5H.js.map} +1 -1
  24. package/dist/{chunk-EALWOVHK.js → chunk-GQ4NMQGR.js} +4 -4
  25. package/dist/{chunk-EALWOVHK.js.map → chunk-GQ4NMQGR.js.map} +1 -1
  26. package/dist/{chunk-R2YAMONM.cjs → chunk-JGMSZIE4.cjs} +17 -17
  27. package/dist/{chunk-R2YAMONM.cjs.map → chunk-JGMSZIE4.cjs.map} +1 -1
  28. package/dist/{chunk-CO3KKSWM.cjs → chunk-PJR63FTK.cjs} +17 -17
  29. package/dist/{chunk-CO3KKSWM.cjs.map → chunk-PJR63FTK.cjs.map} +1 -1
  30. package/dist/{chunk-AEWJU6NZ.js → chunk-VBHXBI7F.js} +59 -23
  31. package/dist/chunk-VBHXBI7F.js.map +1 -0
  32. package/dist/{chunk-MJUTO3PY.cjs → chunk-WCJVKFAP.cjs} +480 -444
  33. package/dist/chunk-WCJVKFAP.cjs.map +1 -0
  34. package/dist/contracts/handlers/index.cjs +9 -9
  35. package/dist/contracts/handlers/index.d.cts +3 -3
  36. package/dist/contracts/handlers/index.d.ts +3 -3
  37. package/dist/contracts/handlers/index.js +2 -2
  38. package/dist/{delegate-cdmzb2f9.d.ts → delegate-AomVWxO_.d.ts} +1 -1
  39. package/dist/{delegate-Bz2e2zXY.d.cts → delegate-Bffc5f54.d.cts} +1 -1
  40. package/dist/{hdWalletCapable-BSjuUYOO.d.cts → hdWalletCapable-B5nRs3RH.d.cts} +2 -2
  41. package/dist/{hdWalletCapable-Hi12xjCJ.d.ts → hdWalletCapable-DZdIVa23.d.ts} +2 -2
  42. package/dist/{index-DU5o_hz7.d.cts → index-C7RZCfoY.d.cts} +17 -1
  43. package/dist/{index-DU5o_hz7.d.ts → index-C7RZCfoY.d.ts} +17 -1
  44. package/dist/{index-BiACuWaf.d.ts → index-jouvy8FD.d.ts} +96 -119
  45. package/dist/{index-D2GjZxBr.d.cts → index-nfyQM33h.d.cts} +96 -119
  46. package/dist/index.cjs +293 -289
  47. package/dist/index.d.cts +12 -8
  48. package/dist/index.d.ts +12 -8
  49. package/dist/index.js +4 -4
  50. package/dist/repositories/realm/index.cjs +19 -19
  51. package/dist/repositories/realm/index.d.cts +2 -2
  52. package/dist/repositories/realm/index.d.ts +2 -2
  53. package/dist/repositories/realm/index.js +5 -5
  54. package/dist/repositories/sqlite/index.cjs +18 -18
  55. package/dist/repositories/sqlite/index.d.cts +2 -2
  56. package/dist/repositories/sqlite/index.d.ts +2 -2
  57. package/dist/repositories/sqlite/index.js +5 -5
  58. package/dist/{taskRunner-BZJMLQ6g.d.cts → taskRunner-D2vnpPBT.d.cts} +2 -2
  59. package/dist/{taskRunner-DATaRQus.d.ts → taskRunner-DuwK9t8O.d.ts} +2 -2
  60. package/dist/wallet/expo/background.cjs +14 -14
  61. package/dist/wallet/expo/background.d.cts +3 -3
  62. package/dist/wallet/expo/background.d.ts +3 -3
  63. package/dist/wallet/expo/background.js +6 -6
  64. package/dist/wallet/expo/index.cjs +14 -14
  65. package/dist/wallet/expo/index.d.cts +4 -4
  66. package/dist/wallet/expo/index.d.ts +4 -4
  67. package/dist/wallet/expo/index.js +5 -5
  68. package/dist/worker/expo/index.cjs +9 -9
  69. package/dist/worker/expo/index.d.cts +4 -4
  70. package/dist/worker/expo/index.d.ts +4 -4
  71. package/dist/worker/expo/index.js +5 -5
  72. package/package.json +1 -1
  73. package/dist/chunk-2JV4VQ7C.cjs.map +0 -1
  74. package/dist/chunk-3WIWNE4P.js.map +0 -1
  75. package/dist/chunk-6TAQF6EV.js.map +0 -1
  76. package/dist/chunk-AEWJU6NZ.js.map +0 -1
  77. package/dist/chunk-MJUTO3PY.cjs.map +0 -1
  78. package/dist/chunk-OIZ2V2VD.cjs.map +0 -1
@@ -1,6 +1,6 @@
1
- import { AssetId, AssetGroup, AssetInput, AssetOutput, Metadata, Packet, BufferReader, BufferWriter, AssetRef, RestIndexerProvider } from './chunk-X3VEMUVV.js';
2
- import { witnessRefToBytes, validateProgram, toASM, stringifyArtifact, serializeArkadeContractParams, resolveAsm, parseArtifact, getOpcodeValue, getOpcodeName, fromASM, deserializeArkadeContractParams, computeArkadeScriptPublicKey, bytesToASM, asmToBytes, arkadeWitnessHash, arkadeScriptHash, SUPPORTED_PROGRAM_VERSION, OPCODE_VALUES, OPCODE_NAMES, bignum_exports, ArkadeScript, ArkadeProgramScript, ARKADE_OPS, ARKADE_OPCODE_VALUES, ARKADE_OPCODE_NAMES, ARKADE_OPCODES, ARKADE_OP, toXOnly, inputName, contractHandlers, isMainnetDescriptor, descriptorIsOurs, deriveDescriptorLeafPubKey, deriveDescriptorLeafCompressedPubKey, parseHDDescriptor, identityDescriptor, DefaultVtxo, speculativeReceiveMetadata, DelegateVtxo, WALLET_RECEIVE_SOURCE, BoardingContractHandler } from './chunk-6TAQF6EV.js';
3
- import { VtxoScript, Transaction, isRecoverable, CSVMultisigTapscript, DEFAULT_NETWORK, resolveEmulatorPubkey, hasTerminalSpend, getNormalizedVtxos, setArkPsbtField, PrevArkTxField, ConditionWitness, craftToSpendTx, ArkAddress, isVirtualCoin, getArkPsbtFields, CosignerPublicKey, ServerResponseMismatchError, OP_RETURN_EMPTY_PKSCRIPT, canSweepOnchain, sequenceToTimelock, decodeTapscript, scriptFromTapLeafScript, CLTVMultisigTapscript, VtxoTaprootTree, timelockToSequence, baseFetch, Intent, rateGate, DEFAULT_NETWORK_NAME, normalizeVtxo, getSequence, toBatchExpiry, maybeArkError, isArkError, ArkErrorName, toOffchainInputFeeParams, canRecoverOnchain, getNetwork, MultisigTapscript, isEventSourceError, isEventSourceUnavailableError, isRetryableProviderError, getAllNormalizedVtxos, DEFAULT_PAGE_SIZE, RestArkProvider, toVirtualStatus, ArkError, TapTreeCoder, resolveTimeHeight, canSpendOffchain, parseLegacyExpiry, isExpired, PrevoutTxField, DEFAULT_ARKADE_SERVER_URL, ProviderUnavailableError, networks as networks$1, isPastExpiry, fetchVtxoCreatedAtByTxid } from './chunk-3WIWNE4P.js';
1
+ import { AssetId, AssetGroup, AssetInput, AssetOutput, Metadata, Packet, BufferReader, BufferWriter, AssetRef, RestIndexerProvider } from './chunk-33Q2RFET.js';
2
+ import { witnessRefToBytes, validateProgram, toASM, stringifyArtifact, serializeArkadeContractParams, resolveAsm, parseArtifact, getOpcodeValue, getOpcodeName, fromASM, deserializeArkadeContractParams, computeArkadeScriptPublicKey, bytesToASM, asmToBytes, arkadeWitnessHash, arkadeScriptHash, SUPPORTED_PROGRAM_VERSION, OPCODE_VALUES, OPCODE_NAMES, bignum_exports, ArkadeScript, ArkadeProgramScript, ARKADE_OPS, ARKADE_OPCODE_VALUES, ARKADE_OPCODE_NAMES, ARKADE_OPCODES, ARKADE_OP, toXOnly, inputName, contractHandlers, isMainnetDescriptor, descriptorIsOurs, deriveDescriptorLeafPubKey, deriveDescriptorLeafCompressedPubKey, parseHDDescriptor, identityDescriptor, DefaultVtxo, speculativeReceiveMetadata, DelegateVtxo, WALLET_RECEIVE_SOURCE, BoardingContractHandler } from './chunk-45FKMOJH.js';
3
+ import { VtxoScript, Transaction, isRecoverable, CSVMultisigTapscript, DEFAULT_NETWORK, resolveEmulatorPubkey, hasTerminalSpend, getNormalizedVtxos, setArkPsbtField, PrevArkTxField, ConditionWitness, craftToSpendTx, ArkAddress, isVirtualCoin, getArkPsbtFields, CosignerPublicKey, ServerResponseMismatchError, OP_RETURN_EMPTY_PKSCRIPT, canSweepOnchain, sequenceToTimelock, decodeTapscript, scriptFromTapLeafScript, CLTVMultisigTapscript, VtxoTaprootTree, timelockToSequence, assertAllowedSighashTypes, baseFetch, Intent, rateGate, DEFAULT_NETWORK_NAME, formatSighash, normalizeVtxo, getSequence, toBatchExpiry, maybeArkError, isArkError, ArkErrorName, toOffchainInputFeeParams, canRecoverOnchain, getNetwork, MultisigTapscript, isEventSourceError, isEventSourceUnavailableError, isRetryableProviderError, getAllNormalizedVtxos, DEFAULT_PAGE_SIZE, RestArkProvider, toVirtualStatus, ArkError, TapTreeCoder, resolveTimeHeight, canSpendOffchain, parseLegacyExpiry, isExpired, PrevoutTxField, DEFAULT_ARKADE_SERVER_URL, ProviderUnavailableError, networks as networks$1, isPastExpiry, fetchVtxoCreatedAtByTxid } from './chunk-4CMXV5SF.js';
4
4
  import { __export } from './chunk-NSBPE2FW.js';
5
5
  import { sha256 as sha256$1, equalBytes, hash160, sha256x2, concatBytes, randomPrivateKeyBytes, pubECDSA, pubSchnorr } from '@scure/btc-signer/utils.js';
6
6
  import { SigHash, Script, OP, OutScript, Address, RawWitness, p2tr, p2wpkh, TaprootControlBlock, DEFAULT_SEQUENCE, Transaction as Transaction$2 } from '@scure/btc-signer';
@@ -272,7 +272,7 @@ function getPrevOutput(finalKey, graph, sharedOutputAmount, tx) {
272
272
  script: pkScript
273
273
  };
274
274
  }
275
- var ALL_SIGHASH = Object.values(SigHash).filter((x) => typeof x === "number");
275
+ var ALLOWED_SIGHASH = [SigHash.DEFAULT, SigHash.ALL, SigHash.ALL_ANYONECANPAY];
276
276
  var SingleKey = class _SingleKey {
277
277
  key;
278
278
  constructor(key) {
@@ -301,8 +301,9 @@ var SingleKey = class _SingleKey {
301
301
  async sign(tx, inputIndexes) {
302
302
  const txCpy = tx.clone();
303
303
  if (!inputIndexes) {
304
+ assertAllowedSighashTypes(txCpy, ALLOWED_SIGHASH);
304
305
  try {
305
- if (!txCpy.sign(this.key, ALL_SIGHASH)) {
306
+ if (!txCpy.sign(this.key, ALLOWED_SIGHASH)) {
306
307
  throw new Error("Failed to sign transaction");
307
308
  }
308
309
  } catch (e) {
@@ -313,7 +314,7 @@ var SingleKey = class _SingleKey {
313
314
  return txCpy;
314
315
  }
315
316
  for (const inputIndex of inputIndexes) {
316
- if (!txCpy.signIdx(this.key, inputIndex, ALL_SIGHASH)) {
317
+ if (!txCpy.signIdx(this.key, inputIndex, ALLOWED_SIGHASH)) {
317
318
  throw new Error(`Failed to sign input #${inputIndex}`);
318
319
  }
319
320
  }
@@ -378,7 +379,7 @@ var ReadonlySingleKey = class _ReadonlySingleKey {
378
379
  return Promise.resolve(this.publicKey);
379
380
  }
380
381
  };
381
- var ALL_SIGHASH2 = Object.values(SigHash).filter((x) => typeof x === "number");
382
+ var ALLOWED_SIGHASH2 = [SigHash.DEFAULT, SigHash.ALL, SigHash.ALL_ANYONECANPAY];
382
383
  var seedBytes = /* @__PURE__ */ new WeakMap();
383
384
  var mnemonicMeta = /* @__PURE__ */ new WeakMap();
384
385
  var SeedIdentity = class _SeedIdentity {
@@ -581,8 +582,9 @@ var SeedIdentity = class _SeedIdentity {
581
582
  signTxWithKey(tx, key, inputIndexes) {
582
583
  const txCpy = tx.clone();
583
584
  if (!inputIndexes) {
585
+ assertAllowedSighashTypes(txCpy, ALLOWED_SIGHASH2);
584
586
  try {
585
- if (!txCpy.sign(key, ALL_SIGHASH2)) {
587
+ if (!txCpy.sign(key, ALLOWED_SIGHASH2)) {
586
588
  throw new Error("Failed to sign transaction");
587
589
  }
588
590
  } catch (e) {
@@ -592,7 +594,7 @@ var SeedIdentity = class _SeedIdentity {
592
594
  }
593
595
  } else {
594
596
  for (const idx of inputIndexes) {
595
- if (!txCpy.signIdx(key, idx, ALL_SIGHASH2)) {
597
+ if (!txCpy.signIdx(key, idx, ALLOWED_SIGHASH2)) {
596
598
  throw new Error(`Failed to sign input #${idx}`);
597
599
  }
598
600
  }
@@ -3085,9 +3087,6 @@ function hasBoardingTxExpired(coin, boardingTimelock, chainTipHeight) {
3085
3087
  const blockTime = BigInt(Math.floor(coin.status.block_time));
3086
3088
  return blockTime + boardingTimelock.value <= now;
3087
3089
  }
3088
- function formatSighash(type) {
3089
- return `0x${type.toString(16).padStart(2, "0")}`;
3090
- }
3091
3090
  function verifyTapscriptSignatures(tx, inputIndex, requiredSigners, excludePubkeys = [], allowedSighashTypes = [SigHash.DEFAULT], expectedLeafHash) {
3092
3091
  const input = tx.getInput(inputIndex);
3093
3092
  const prevoutScripts = [];
@@ -3305,6 +3304,15 @@ async function submitOffchainTx(provider, offchainTx, signer, hooks, options) {
3305
3304
  assertSubmittedArkTxid(response, signedArkTx, "submitTx");
3306
3305
  const { arkTxid, signedCheckpointTxs } = response;
3307
3306
  const matched = matchServerCheckpoints(signedCheckpointTxs, offchainTx.checkpoints, "submitTx");
3307
+ matched.forEach(({ server }, index) => {
3308
+ try {
3309
+ assertAllowedSighashTypes(server);
3310
+ } catch (error) {
3311
+ throw new ServerResponseMismatchError(
3312
+ `submitTx checkpoint ${index}: ${error instanceof Error ? error.message : String(error)}`
3313
+ );
3314
+ }
3315
+ });
3308
3316
  const verify = options?.verifyServerSignatures;
3309
3317
  if (verify) {
3310
3318
  if (response.finalArkTx === void 0) {
@@ -3906,6 +3914,7 @@ function getRecoverableWithSubdust(vtxos, dustAmount, now) {
3906
3914
  };
3907
3915
  }
3908
3916
  function isVtxoExpiringSoon(vtxo, thresholdMs) {
3917
+ if (vtxo.isUnrolled) return false;
3909
3918
  const realThresholdMs = thresholdMs <= 100 ? DEFAULT_THRESHOLD_MS : thresholdMs;
3910
3919
  const expiresAt = normalizeVtxo(vtxo).expiresAt;
3911
3920
  if (expiresAt === void 0) return false;
@@ -3916,7 +3925,9 @@ function isVtxoExpiringSoon(vtxo, thresholdMs) {
3916
3925
  }
3917
3926
  function getExpiringAndRecoverableVtxos(vtxos, thresholdMs, dustAmount, now) {
3918
3927
  return vtxos.filter(
3919
- (vtxo) => isVtxoExpiringSoon(vtxo, thresholdMs) || canRecoverOnchain(vtxo, now) || isSubdust(vtxo, dustAmount)
3928
+ // The leading exclusion covers the `isSubdust` arm too, which is a value
3929
+ // property and would otherwise re-admit an exited coin on its own.
3930
+ (vtxo) => !vtxo.isUnrolled && (isVtxoExpiringSoon(vtxo, thresholdMs) || canRecoverOnchain(vtxo, now) || isSubdust(vtxo, dustAmount))
3920
3931
  );
3921
3932
  }
3922
3933
  function isMigrationCapable(wallet) {
@@ -6448,6 +6459,13 @@ var TxTree = class {
6448
6459
  if (nbOfInputs !== 1) {
6449
6460
  throw new Error(`unexpected number of inputs: ${nbOfInputs}, expected 1`);
6450
6461
  }
6462
+ if (this.root.lockTime !== 0) {
6463
+ throw new Error(`unexpected locktime: ${this.root.lockTime}, expected 0`);
6464
+ }
6465
+ const sequence = this.root.getInput(0).sequence;
6466
+ if (sequence !== void 0 && sequence !== DEFAULT_SEQUENCE) {
6467
+ throw new Error(`unexpected sequence: ${sequence}, expected ${DEFAULT_SEQUENCE}`);
6468
+ }
6451
6469
  if (this.children.size > nbOfOutputs - 1) {
6452
6470
  throw new Error(
6453
6471
  `unexpected number of children: ${this.children.size}, expected maximum ${nbOfOutputs - 1}`
@@ -12079,6 +12097,7 @@ function filterSnapshotVtxos(snapshot, filter, pendingSpendOutpoints) {
12079
12097
  });
12080
12098
  }
12081
12099
  var PENDING_RECOVERY_REASON = "is past its operator signer's rotation cutoff \u2014 the operator will not co-sign it until it recovers";
12100
+ var UNROLLED_REASON = "was unilaterally exited and lives onchain \u2014 `Unroll.completeUnroll` is the only spend that reaches it";
12082
12101
  function omittedOutpoints(before, after) {
12083
12102
  if (before.length === after.length) return /* @__PURE__ */ new Set();
12084
12103
  const kept = new Set(after.map((vtxo) => `${vtxo.txid}:${vtxo.vout}`));
@@ -12651,6 +12670,13 @@ var ReadonlyWallet = class _ReadonlyWallet {
12651
12670
  "is locked by an in-flight settlement intent"
12652
12671
  )
12653
12672
  ]);
12673
+ if (!filter?.withUnrolled) {
12674
+ logExcludedVtxos(
12675
+ "getSpendableVtxos",
12676
+ snapshot.flatMap((contract) => contract.vtxos).filter((vtxo) => vtxo.isUnrolled && !hasTerminalSpend(vtxo)),
12677
+ [() => UNROLLED_REASON]
12678
+ );
12679
+ }
12654
12680
  return unlocked;
12655
12681
  }
12656
12682
  /**
@@ -15203,9 +15229,11 @@ var Wallet2 = class _Wallet extends ReadonlyWallet {
15203
15229
  seen.add(pendingTx.arkTxid);
15204
15230
  batchPending.push(pendingTx.arkTxid);
15205
15231
  try {
15206
- const checkpointTxs = pendingTx.signedCheckpointTxs.map(
15207
- (c) => Transaction$2.fromPSBT(base64.decode(c))
15208
- );
15232
+ const checkpointTxs = pendingTx.signedCheckpointTxs.map((c) => {
15233
+ const tx = Transaction$2.fromPSBT(base64.decode(c));
15234
+ assertAllowedSighashTypes(tx);
15235
+ return tx;
15236
+ });
15209
15237
  assertCheckpointsMatchInputs(
15210
15238
  checkpointTxs,
15211
15239
  checkpointInputs,
@@ -15373,7 +15401,9 @@ var Wallet2 = class _Wallet extends ReadonlyWallet {
15373
15401
  const myPkScript = ArkAddress.decode(await this.getAddress()).pkScript;
15374
15402
  let { spendable, unclaimed } = this.classifyCashVtxos(vtxos);
15375
15403
  let swept = 0;
15376
- const drainable = vtxos.filter((vtxo) => !isSubdust(vtxo, this.dustAmount));
15404
+ const drainable = vtxos.filter(
15405
+ (vtxo) => !isSubdust(vtxo, this.dustAmount) && !vtxo.isUnrolled
15406
+ );
15377
15407
  if (drainable.length > 0) {
15378
15408
  let drained = { count: 0, swept: 0, claimed: /* @__PURE__ */ new Set() };
15379
15409
  try {
@@ -15533,9 +15563,11 @@ var Wallet2 = class _Wallet extends ReadonlyWallet {
15533
15563
  const unrollCandidates = this.checkpointUnrollCandidates(await this.arkProvider.getInfo());
15534
15564
  for (const pendingTx of pendingTxs) {
15535
15565
  try {
15536
- const checkpointTxs = pendingTx.signedCheckpointTxs.map(
15537
- (checkpoint) => Transaction$2.fromPSBT(base64.decode(checkpoint))
15538
- );
15566
+ const checkpointTxs = pendingTx.signedCheckpointTxs.map((checkpoint) => {
15567
+ const tx = Transaction$2.fromPSBT(base64.decode(checkpoint));
15568
+ assertAllowedSighashTypes(tx);
15569
+ return tx;
15570
+ });
15539
15571
  assertCheckpointsMatchInputs(
15540
15572
  checkpointTxs,
15541
15573
  inputs.map((input) => ({
@@ -22834,6 +22866,10 @@ var ArkadeContract = class _ArkadeContract {
22834
22866
  * When a `contractManager` is configured and this contract is registered,
22835
22867
  * reads the repository-backed state (offline-first, kept fresh by the
22836
22868
  * contract watcher). Otherwise falls back to a direct indexer query.
22869
+ *
22870
+ * Both branches refuse a spent or unilaterally exited output. They are not
22871
+ * otherwise interchangeable: the fallback asks `spendableOnly`, which also
22872
+ * drops swept coins — the manager branch keeps those.
22837
22873
  */
22838
22874
  async getUtxos() {
22839
22875
  const manager = this.client.contractManager;
@@ -22854,7 +22890,7 @@ var ArkadeContract = class _ArkadeContract {
22854
22890
  scripts: [scriptHex],
22855
22891
  spendableOnly: true
22856
22892
  });
22857
- return vtxos;
22893
+ return vtxos.filter((v) => !hasTerminalSpend(v) && !v.isUnrolled);
22858
22894
  }
22859
22895
  /** Total spendable balance (requires an indexer). */
22860
22896
  async getBalance() {
@@ -23473,5 +23509,5 @@ function createDefaultPaymentRouter(wallet) {
23473
23509
  */
23474
23510
 
23475
23511
  export { ARKADE_MAGIC, ARKADE_SALTED_PREIMAGE_TAG, ARKADE_SWAP_PREIMAGE_TAG, ActivityRegistry, AmbiguousRouteError, ArkNote, ArkadeCash, ArkadeCashCreateError, AssetManager, BIP21, BIP21Error, BIP322, BLOCKED_UPGRADE_TIMEOUT_MS, Batch, CachingArkProvider, ChainedTxType, ConnectionDisposedError, ContractManager, ContractRepositoryImpl, ContractWatcher, DB_VERSION, DEFAULT_MESSAGE_TIMEOUTS, DEFAULT_MIN_BATCH_EXPIRY_SECONDS, DEFAULT_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, DatabaseUpgradeBlockedError, DelegateManagerImpl, DelegateNotConfiguredError, DelegatorManagerImpl, DelegatorNotConfiguredError, DescriptorIdentity, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, ESPLORA_URL, ElectrumOnchainProvider, EmulatorPacket, EsploraProvider, Estimator, Extension, ExtensionNotFoundError, ForeignDescriptorError, HDDescriptorProvider, INTENT_TERMINAL_STATES, InMemoryContractRepository, InMemoryIntentRepository, InMemoryVirtualTxRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBIntentRepository, IndexedDBVirtualTxRepository, IndexedDBWalletRepository, MAX_USED_SIGNING_DESCRIPTORS_LOOK_AHEAD, MESSAGE_BUS_INITIALIZING, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MUTINYNET_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, MessageBus, MessageBusInitializingError, MessageBusNotInitializedError, MissingSigningDescriptorError, MnemonicIdentity, OnchainWallet, P2A, PaymentRouter, PrevTxUnavailableError, REGTEST_MIN_BATCH_EXPIRY_SECONDS, REGTEST_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, RestDelegateProvider, RestDelegatorProvider, RestEmulatorProvider, SIGNET_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, SeedIdentity, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, SingleKey, TxTree, TxType, TxWeightEstimator, UnannotatableInputError, UnilateralExit, UnknownPacket, Unroll, VtxoManager, Wallet2 as Wallet, WalletCannotAllocateAddressError, WalletCannotSignError, WalletMessageHandler, WalletNotInitializedError, WalletRepositoryImpl, WsElectrumChainSource, adoptContractDescriptor, arkRail, arkTarget, arkade_exports, assertFinalCommitmentMatchesValidated, assertIntentIdUnique, assertSendableAmount, assertSubmittedArkTxid, assertValidBatchExpiry, assertValidServerUnrollScript, assetMintResolver, attachPrevArkTxs, attachPrevoutTxs, awaitTransaction, boardingResolver, btcTarget, buildForfeitTx, buildOffchainTx, buildPreimageMessage, buildSaltedPreimageMessage, claimWithPreimageIdentity, classifyAgainstSignerSet, classifyContractSigner, closeDatabase, collabExitResolver, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, contractPreimage, contractSigner, createAssetPacket, createDefaultActivityRegistry, createDefaultPaymentRouter, createExitChainResolver, createManagedConnection, decodeArkContract, defaultBatchExpiryPolicy, defaultCheckpointExitDelayPolicy, deleteByIndex, deserializeAssets, deserializeExitPackage, deserializeUtxo, deserializeVtxo, encodeArkContract, exitObserverFor, extendVirtualCoinForContract, extractArkProviderUrl, gateExclusion, gatedContracts, getAllByIndexValues, getMigrationStatus, getRandomId, hasBoardingTxExpired, hasCandidates, intentMatchesFilter, intentPageBounds, invoiceTarget, isAddressAllocationCapable, isArkContract, isBatchSignable, isBtcAddress, isContractGenericallySpendable, isCooperativelyMigratable, isDeterministicSigner, isDiscoverable, isHDAllocationCapable, isHDDeterministicSignCapable, isHDWalletCapable, isLightningInvoice, isLnurl, isMessageBusInitializingError, isMessageBusNotInitializedError, isPerArtifactDescriptor, isSigningIdentity, isSubdust, isTerminalIntentState, isValidArkAddress, isVtxoExpiringSoon, isVtxoForScript, isWatchedContract, logExcludedVtxos, makeHandle, matchServerCheckpoints, mergeChainedTxType, migrateWalletRepository, notifyExitObserved, onchainRail, openDatabase, outpointExclusion, outpointReasons, promisifyRequest, provisionClaimSecret, provisionRefundKey, requiresMigration, resolveBatchExpiryPolicy, resolveCheckpointExitDelayPolicy, resolveDescriptorSigner, resolvePrevTxs, resolveSendAmount, rollbackMigration, saveVtxosForContract, scriptFromArkAddress, selectCoinsWithAsset, selectVirtualCoins, serializeAssets, serializeExitPackage, serializeUtxo, serializeVtxo, setupServiceWorker, signAndSubmitOffchainTx, signerSetFromInfo, signingDescriptorIndex, strictSigningDescriptorIndex, toXOnlySignerHex, tryResolveSendAmount, validateBatchRecipients, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures, waitForIncomingFunds, warnAndFilterVtxosForScript, withPrevTxs };
23476
- //# sourceMappingURL=chunk-AEWJU6NZ.js.map
23477
- //# sourceMappingURL=chunk-AEWJU6NZ.js.map
23512
+ //# sourceMappingURL=chunk-VBHXBI7F.js.map
23513
+ //# sourceMappingURL=chunk-VBHXBI7F.js.map