@arkade-os/sdk 0.4.49 → 0.4.50

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 (63) hide show
  1. package/dist/adapters/expo.cjs +4 -4
  2. package/dist/adapters/expo.d.cts +2 -2
  3. package/dist/adapters/expo.d.ts +2 -2
  4. package/dist/adapters/expo.js +2 -2
  5. package/dist/adapters/indexedDB.cjs +3 -3
  6. package/dist/adapters/indexedDB.js +2 -2
  7. package/dist/{ark-nkSiPYNf.d.cts → ark-ApoclKQZ.d.cts} +59 -52
  8. package/dist/{ark-nkSiPYNf.d.ts → ark-ApoclKQZ.d.ts} +59 -52
  9. package/dist/{asyncStorageTaskQueue-DCaEE83p.d.ts → asyncStorageTaskQueue-BCWmdVg8.d.ts} +1 -1
  10. package/dist/{asyncStorageTaskQueue-DdxhsEz6.d.cts → asyncStorageTaskQueue-CIjgv1co.d.cts} +1 -1
  11. package/dist/{chunk-2LAJ3RTH.cjs → chunk-6BQTROB4.cjs} +139 -148
  12. package/dist/chunk-6BQTROB4.cjs.map +1 -0
  13. package/dist/{chunk-BLJQV3N4.js → chunk-7WSVP7DK.js} +3 -3
  14. package/dist/{chunk-BLJQV3N4.js.map → chunk-7WSVP7DK.js.map} +1 -1
  15. package/dist/{chunk-CPO2UB7L.js → chunk-AA4Q2J57.js} +3 -3
  16. package/dist/{chunk-CPO2UB7L.js.map → chunk-AA4Q2J57.js.map} +1 -1
  17. package/dist/{chunk-6UI5BFE7.cjs → chunk-Q4K2RSMY.cjs} +7 -7
  18. package/dist/{chunk-6UI5BFE7.cjs.map → chunk-Q4K2RSMY.cjs.map} +1 -1
  19. package/dist/{chunk-QDXQULVM.cjs → chunk-SIAVTHMZ.cjs} +3 -3
  20. package/dist/{chunk-QDXQULVM.cjs.map → chunk-SIAVTHMZ.cjs.map} +1 -1
  21. package/dist/{chunk-5QVBJUOG.js → chunk-SNTSB6M2.js} +34 -43
  22. package/dist/chunk-SNTSB6M2.js.map +1 -0
  23. package/dist/{chunk-XOLH3LFO.cjs → chunk-TO3SR7TY.cjs} +11 -11
  24. package/dist/{chunk-XOLH3LFO.cjs.map → chunk-TO3SR7TY.cjs.map} +1 -1
  25. package/dist/{chunk-HN25T276.js → chunk-ZXRSSBCF.js} +3 -3
  26. package/dist/{chunk-HN25T276.js.map → chunk-ZXRSSBCF.js.map} +1 -1
  27. package/dist/contracts/handlers/index.d.cts +3 -3
  28. package/dist/contracts/handlers/index.d.ts +3 -3
  29. package/dist/{delegate-Cqqw1T1J.d.cts → delegate-CCHPwQft.d.cts} +1 -1
  30. package/dist/{delegate-D6Orvyq7.d.ts → delegate-hJYMZN1D.d.ts} +1 -1
  31. package/dist/{index-CWoogah0.d.ts → index-5Y9h9OnO.d.ts} +2 -2
  32. package/dist/{index-Yd4hecbM.d.cts → index-8jE1XJpT.d.cts} +2 -2
  33. package/dist/index.cjs +145 -145
  34. package/dist/index.d.cts +8 -8
  35. package/dist/index.d.ts +8 -8
  36. package/dist/index.js +2 -2
  37. package/dist/repositories/realm/index.cjs +17 -17
  38. package/dist/repositories/realm/index.d.cts +2 -2
  39. package/dist/repositories/realm/index.d.ts +2 -2
  40. package/dist/repositories/realm/index.js +3 -3
  41. package/dist/repositories/sqlite/index.cjs +16 -16
  42. package/dist/repositories/sqlite/index.d.cts +2 -2
  43. package/dist/repositories/sqlite/index.d.ts +2 -2
  44. package/dist/repositories/sqlite/index.js +3 -3
  45. package/dist/{taskRunner-BjB5QINR.d.cts → taskRunner-C3YLaM2x.d.cts} +1 -1
  46. package/dist/{taskRunner-Dw7xs60Q.d.ts → taskRunner-ChvV6Xrh.d.ts} +1 -1
  47. package/dist/wallet/expo/background.cjs +12 -12
  48. package/dist/wallet/expo/background.d.cts +3 -3
  49. package/dist/wallet/expo/background.d.ts +3 -3
  50. package/dist/wallet/expo/background.js +4 -4
  51. package/dist/wallet/expo/index.cjs +12 -12
  52. package/dist/wallet/expo/index.d.cts +4 -4
  53. package/dist/wallet/expo/index.d.ts +4 -4
  54. package/dist/wallet/expo/index.js +3 -3
  55. package/dist/{wallet-CGkWu3xV.d.cts → wallet-B260BTJs.d.cts} +2 -2
  56. package/dist/{wallet-DyUHrPyN.d.ts → wallet-DIH0gVfW.d.ts} +2 -2
  57. package/dist/worker/expo/index.cjs +7 -7
  58. package/dist/worker/expo/index.d.cts +4 -4
  59. package/dist/worker/expo/index.d.ts +4 -4
  60. package/dist/worker/expo/index.js +3 -3
  61. package/package.json +1 -1
  62. package/dist/chunk-2LAJ3RTH.cjs.map +0 -1
  63. package/dist/chunk-5QVBJUOG.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkQDXQULVM_cjs = require('./chunk-QDXQULVM.cjs');
3
+ var chunkSIAVTHMZ_cjs = require('./chunk-SIAVTHMZ.cjs');
4
4
  var chunkLJQ2VQBE_cjs = require('./chunk-LJQ2VQBE.cjs');
5
5
  var chunkE7HB3GKK_cjs = require('./chunk-E7HB3GKK.cjs');
6
6
  var chunk5BLDMQED_cjs = require('./chunk-5BLDMQED.cjs');
@@ -185,7 +185,7 @@ var TreeSignerSession = class _TreeSignerSession {
185
185
  noncesByPubkey.set(base.hex.encode(myPublicKey.subarray(1)), myNonce);
186
186
  const tx = this.graph.find(txid);
187
187
  if (!tx) throw new Error(`missing tx for txid ${txid}`);
188
- const cosigners = chunkQDXQULVM_cjs.getArkPsbtFields(tx.root, 0, chunkQDXQULVM_cjs.CosignerPublicKey).map(
188
+ const cosigners = chunkSIAVTHMZ_cjs.getArkPsbtFields(tx.root, 0, chunkSIAVTHMZ_cjs.CosignerPublicKey).map(
189
189
  (c) => base.hex.encode(c.key.subarray(1))
190
190
  // xonly pubkey
191
191
  );
@@ -237,7 +237,7 @@ var TreeSignerSession = class _TreeSignerSession {
237
237
  if (!aggNonce) throw new Error("missing aggregate nonce");
238
238
  const prevoutAmounts = [];
239
239
  const prevoutScripts = [];
240
- const cosigners = chunkQDXQULVM_cjs.getArkPsbtFields(g.root, 0, chunkQDXQULVM_cjs.CosignerPublicKey).map((c) => c.key);
240
+ const cosigners = chunkSIAVTHMZ_cjs.getArkPsbtFields(g.root, 0, chunkSIAVTHMZ_cjs.CosignerPublicKey).map((c) => c.key);
241
241
  const { finalKey } = aggregateKeys(cosigners, true, {
242
242
  taprootTweak: this.scriptRoot
243
243
  });
@@ -986,14 +986,14 @@ var RestDelegateProvider = class {
986
986
  */
987
987
  async delegate(intent, forfeitTxs, options) {
988
988
  const url = `${this.url}/v1/delegate`;
989
- const response = await chunkQDXQULVM_cjs.baseFetch(url, {
989
+ const response = await chunkSIAVTHMZ_cjs.baseFetch(url, {
990
990
  method: "POST",
991
991
  headers: {
992
992
  "Content-Type": "application/json"
993
993
  },
994
994
  body: JSON.stringify({
995
995
  intent: {
996
- message: chunkQDXQULVM_cjs.Intent.encodeMessage(intent.message),
996
+ message: chunkSIAVTHMZ_cjs.Intent.encodeMessage(intent.message),
997
997
  proof: intent.proof
998
998
  },
999
999
  forfeit_txs: forfeitTxs,
@@ -1013,7 +1013,7 @@ var RestDelegateProvider = class {
1013
1013
  */
1014
1014
  async getDelegateInfo() {
1015
1015
  const url = `${this.url}/v1/delegator/info`;
1016
- const response = await chunkQDXQULVM_cjs.rateGate.runHttp(url, () => chunkQDXQULVM_cjs.baseFetch(url));
1016
+ const response = await chunkSIAVTHMZ_cjs.rateGate.runHttp(url, () => chunkSIAVTHMZ_cjs.baseFetch(url));
1017
1017
  if (!response.ok) {
1018
1018
  const errorText2 = await response.text();
1019
1019
  throw new Error(`Failed to get delegate info: ${errorText2}`);
@@ -1049,14 +1049,14 @@ var EsploraProvider = class {
1049
1049
  pollingInterval;
1050
1050
  forcePolling;
1051
1051
  async getCoins(address) {
1052
- const response = await chunkQDXQULVM_cjs.baseFetch(`${this.baseUrl}/address/${address}/utxo`);
1052
+ const response = await chunkSIAVTHMZ_cjs.baseFetch(`${this.baseUrl}/address/${address}/utxo`);
1053
1053
  if (!response.ok) {
1054
1054
  throw new Error(`Failed to fetch UTXOs: ${response.statusText}`);
1055
1055
  }
1056
1056
  return response.json();
1057
1057
  }
1058
1058
  async getFeeRate() {
1059
- const response = await chunkQDXQULVM_cjs.baseFetch(`${this.baseUrl}/fee-estimates`);
1059
+ const response = await chunkSIAVTHMZ_cjs.baseFetch(`${this.baseUrl}/fee-estimates`);
1060
1060
  if (response.status === 404) {
1061
1061
  return void 0;
1062
1062
  }
@@ -1077,7 +1077,7 @@ var EsploraProvider = class {
1077
1077
  }
1078
1078
  }
1079
1079
  async getTxOutspends(txid) {
1080
- const response = await chunkQDXQULVM_cjs.baseFetch(`${this.baseUrl}/tx/${txid}/outspends`);
1080
+ const response = await chunkSIAVTHMZ_cjs.baseFetch(`${this.baseUrl}/tx/${txid}/outspends`);
1081
1081
  if (!response.ok) {
1082
1082
  const error = await response.text();
1083
1083
  throw new Error(`Failed to get transaction outspends: ${error}`);
@@ -1085,7 +1085,7 @@ var EsploraProvider = class {
1085
1085
  return response.json();
1086
1086
  }
1087
1087
  async getTransactions(address) {
1088
- const response = await chunkQDXQULVM_cjs.baseFetch(`${this.baseUrl}/address/${address}/txs`);
1088
+ const response = await chunkSIAVTHMZ_cjs.baseFetch(`${this.baseUrl}/address/${address}/txs`);
1089
1089
  if (!response.ok) {
1090
1090
  const error = await response.text();
1091
1091
  throw new Error(`Failed to get transactions: ${error}`);
@@ -1093,7 +1093,7 @@ var EsploraProvider = class {
1093
1093
  return response.json();
1094
1094
  }
1095
1095
  async getTxStatus(txid) {
1096
- const txresponse = await chunkQDXQULVM_cjs.baseFetch(`${this.baseUrl}/tx/${txid}`);
1096
+ const txresponse = await chunkSIAVTHMZ_cjs.baseFetch(`${this.baseUrl}/tx/${txid}`);
1097
1097
  if (!txresponse.ok) {
1098
1098
  throw new Error(txresponse.statusText);
1099
1099
  }
@@ -1101,7 +1101,7 @@ var EsploraProvider = class {
1101
1101
  if (!tx.status.confirmed) {
1102
1102
  return { confirmed: false };
1103
1103
  }
1104
- const response = await chunkQDXQULVM_cjs.baseFetch(`${this.baseUrl}/tx/${txid}/status`);
1104
+ const response = await chunkSIAVTHMZ_cjs.baseFetch(`${this.baseUrl}/tx/${txid}/status`);
1105
1105
  if (!response.ok) {
1106
1106
  throw new Error(`Failed to get transaction status: ${response.statusText}`);
1107
1107
  }
@@ -1185,7 +1185,7 @@ var EsploraProvider = class {
1185
1185
  return stopFunc;
1186
1186
  }
1187
1187
  async getChainTip() {
1188
- const tipBlocks = await chunkQDXQULVM_cjs.baseFetch(`${this.baseUrl}/blocks`);
1188
+ const tipBlocks = await chunkSIAVTHMZ_cjs.baseFetch(`${this.baseUrl}/blocks`);
1189
1189
  if (!tipBlocks.ok) {
1190
1190
  throw new Error(`Failed to get chain tip: ${tipBlocks.statusText}`);
1191
1191
  }
@@ -1204,7 +1204,7 @@ var EsploraProvider = class {
1204
1204
  };
1205
1205
  }
1206
1206
  async broadcastPackage(parent, child) {
1207
- const response = await chunkQDXQULVM_cjs.baseFetch(`${this.baseUrl}/txs/package`, {
1207
+ const response = await chunkSIAVTHMZ_cjs.baseFetch(`${this.baseUrl}/txs/package`, {
1208
1208
  method: "POST",
1209
1209
  headers: {
1210
1210
  "Content-Type": "application/json"
@@ -1218,7 +1218,7 @@ var EsploraProvider = class {
1218
1218
  return response.json();
1219
1219
  }
1220
1220
  async broadcastTx(tx) {
1221
- const response = await chunkQDXQULVM_cjs.baseFetch(`${this.baseUrl}/tx`, {
1221
+ const response = await chunkSIAVTHMZ_cjs.baseFetch(`${this.baseUrl}/tx`, {
1222
1222
  method: "POST",
1223
1223
  headers: {
1224
1224
  "Content-Type": "text/plain"
@@ -1380,7 +1380,7 @@ function findP2AOutput(tx) {
1380
1380
  var CHILD_DUST_AMOUNT = 546;
1381
1381
  function buildAnchorChild(params) {
1382
1382
  const { parent, feeRate, fundingCoins, changeAddress, tapInternalKey, network } = params;
1383
- const child = new chunkQDXQULVM_cjs.Transaction({ version: 3, allowLegacyWitnessUtxo: true });
1383
+ const child = new chunkSIAVTHMZ_cjs.Transaction({ version: 3, allowLegacyWitnessUtxo: true });
1384
1384
  child.addInput(findP2AOutput(parent));
1385
1385
  const estimator = TxWeightEstimator.create().addP2AInput();
1386
1386
  for (const _ of fundingCoins) {
@@ -1428,7 +1428,7 @@ function buildForfeitTx(inputs, forfeitPkScript, txLocktime) {
1428
1428
  );
1429
1429
  }
1430
1430
  function buildForfeitTxWithOutput(inputs, output, txLocktime) {
1431
- const tx = new chunkQDXQULVM_cjs.Transaction({
1431
+ const tx = new chunkSIAVTHMZ_cjs.Transaction({
1432
1432
  version: 3,
1433
1433
  lockTime: txLocktime
1434
1434
  });
@@ -1504,7 +1504,7 @@ function validateVtxoTxGraph(graph, roundTransaction, sweepTapTreeRoot) {
1504
1504
  if (previousScriptKey.length !== 32) {
1505
1505
  throw new Error(`parent output ${childIndex} has invalid script`);
1506
1506
  }
1507
- const cosigners = chunkQDXQULVM_cjs.getArkPsbtFields(child.root, 0, chunkQDXQULVM_cjs.CosignerPublicKey);
1507
+ const cosigners = chunkSIAVTHMZ_cjs.getArkPsbtFields(child.root, 0, chunkSIAVTHMZ_cjs.CosignerPublicKey);
1508
1508
  if (cosigners.length === 0) {
1509
1509
  throw ErrMissingCosignersPublicKeys;
1510
1510
  }
@@ -1562,7 +1562,7 @@ var EmulatorPacket = class _EmulatorPacket {
1562
1562
  return new _EmulatorPacket(entries);
1563
1563
  }
1564
1564
  static fromBytes(data) {
1565
- const reader = new chunkQDXQULVM_cjs.BufferReader(data);
1565
+ const reader = new chunkSIAVTHMZ_cjs.BufferReader(data);
1566
1566
  const entryCount = reader.readCompactSize();
1567
1567
  const entries = [];
1568
1568
  for (let i = 0; i < entryCount; i++) {
@@ -1580,7 +1580,7 @@ var EmulatorPacket = class _EmulatorPacket {
1580
1580
  return _EmulatorPacket.PACKET_TYPE;
1581
1581
  }
1582
1582
  serialize() {
1583
- const writer = new chunkQDXQULVM_cjs.BufferWriter();
1583
+ const writer = new chunkSIAVTHMZ_cjs.BufferWriter();
1584
1584
  writer.writeCompactSize(this.entries.length);
1585
1585
  for (const entry of this.entries) {
1586
1586
  writer.writeUint16LE(entry.vin);
@@ -1667,7 +1667,7 @@ var Extension = class _Extension {
1667
1667
  `expected magic prefix ${base.hex.encode(ARKADE_MAGIC)}, got ${base.hex.encode(payload.slice(0, Math.min(payload.length, ARKADE_MAGIC.length)))}`
1668
1668
  );
1669
1669
  }
1670
- const reader = new chunkQDXQULVM_cjs.BufferReader(payload.slice(ARKADE_MAGIC.length));
1670
+ const reader = new chunkSIAVTHMZ_cjs.BufferReader(payload.slice(ARKADE_MAGIC.length));
1671
1671
  const packets = [];
1672
1672
  while (reader.remaining() > 0) {
1673
1673
  const packetType = reader.readByte();
@@ -1741,7 +1741,7 @@ var Extension = class _Extension {
1741
1741
  */
1742
1742
  getAssetPacket() {
1743
1743
  for (const p of this.packets) {
1744
- if (p instanceof chunkQDXQULVM_cjs.Packet) {
1744
+ if (p instanceof chunkSIAVTHMZ_cjs.Packet) {
1745
1745
  return p;
1746
1746
  }
1747
1747
  }
@@ -1779,8 +1779,8 @@ var Extension = class _Extension {
1779
1779
  };
1780
1780
  function parsePacket(packetType, data) {
1781
1781
  switch (packetType) {
1782
- case chunkQDXQULVM_cjs.Packet.PACKET_TYPE:
1783
- return chunkQDXQULVM_cjs.Packet.fromBytes(data);
1782
+ case chunkSIAVTHMZ_cjs.Packet.PACKET_TYPE:
1783
+ return chunkSIAVTHMZ_cjs.Packet.fromBytes(data);
1784
1784
  case EmulatorPacket.PACKET_TYPE:
1785
1785
  return EmulatorPacket.fromBytes(data);
1786
1786
  default:
@@ -2077,7 +2077,7 @@ function createAssetPacket(assetInputs, receivers, changeReceiver) {
2077
2077
  const existing = inputsByAssetId.get(asset.assetId);
2078
2078
  inputsByAssetId.set(asset.assetId, [
2079
2079
  ...existing ?? [],
2080
- chunkQDXQULVM_cjs.AssetInput.create(inputIndex, asset.amount)
2080
+ chunkSIAVTHMZ_cjs.AssetInput.create(inputIndex, asset.amount)
2081
2081
  ]);
2082
2082
  }
2083
2083
  }
@@ -2089,7 +2089,7 @@ function createAssetPacket(assetInputs, receivers, changeReceiver) {
2089
2089
  const existing = outputsByAssetId.get(asset.assetId);
2090
2090
  outputsByAssetId.set(asset.assetId, [
2091
2091
  ...existing ?? [],
2092
- chunkQDXQULVM_cjs.AssetOutput.create(outputIndex, asset.amount)
2092
+ chunkSIAVTHMZ_cjs.AssetOutput.create(outputIndex, asset.amount)
2093
2093
  ]);
2094
2094
  }
2095
2095
  }
@@ -2100,7 +2100,7 @@ function createAssetPacket(assetInputs, receivers, changeReceiver) {
2100
2100
  const existing = outputsByAssetId.get(asset.assetId);
2101
2101
  outputsByAssetId.set(asset.assetId, [
2102
2102
  ...existing ?? [],
2103
- chunkQDXQULVM_cjs.AssetOutput.create(outputIndex, asset.amount)
2103
+ chunkSIAVTHMZ_cjs.AssetOutput.create(outputIndex, asset.amount)
2104
2104
  ]);
2105
2105
  }
2106
2106
  }
@@ -2109,11 +2109,11 @@ function createAssetPacket(assetInputs, receivers, changeReceiver) {
2109
2109
  for (const assetIdStr of allAssetIds) {
2110
2110
  const inputs = inputsByAssetId.get(assetIdStr);
2111
2111
  const outputs = outputsByAssetId.get(assetIdStr);
2112
- const assetId = chunkQDXQULVM_cjs.AssetId.fromString(assetIdStr);
2113
- const group = chunkQDXQULVM_cjs.AssetGroup.create(assetId, null, inputs ?? [], outputs ?? [], []);
2112
+ const assetId = chunkSIAVTHMZ_cjs.AssetId.fromString(assetIdStr);
2113
+ const group = chunkSIAVTHMZ_cjs.AssetGroup.create(assetId, null, inputs ?? [], outputs ?? [], []);
2114
2114
  groups.push(group);
2115
2115
  }
2116
- return chunkQDXQULVM_cjs.Packet.create(groups);
2116
+ return chunkSIAVTHMZ_cjs.Packet.create(groups);
2117
2117
  }
2118
2118
  function selectCoinsWithAsset(coins, assetId, requiredAmount) {
2119
2119
  const coinsWithAsset = coins.filter((coin) => coin.assets?.some((a) => a.assetId === assetId));
@@ -2230,7 +2230,7 @@ function buildVirtualTx(inputs, outputs) {
2230
2230
  }
2231
2231
  }
2232
2232
  }
2233
- const tx = new chunkQDXQULVM_cjs.Transaction({
2233
+ const tx = new chunkSIAVTHMZ_cjs.Transaction({
2234
2234
  version: 3,
2235
2235
  lockTime: Number(lockTime)
2236
2236
  });
@@ -2245,7 +2245,7 @@ function buildVirtualTx(inputs, outputs) {
2245
2245
  },
2246
2246
  tapLeafScript: [input.tapLeafScript]
2247
2247
  });
2248
- chunkQDXQULVM_cjs.setArkPsbtField(tx, i, chunkQDXQULVM_cjs.VtxoTaprootTree, input.tapTree);
2248
+ chunkSIAVTHMZ_cjs.setArkPsbtField(tx, i, chunkSIAVTHMZ_cjs.VtxoTaprootTree, input.tapTree);
2249
2249
  }
2250
2250
  for (const output of outputs) {
2251
2251
  tx.addOutput(output);
@@ -2428,14 +2428,14 @@ async function submitOffchainTx(provider, offchainTx, signer, hooks) {
2428
2428
  let finalCheckpoints;
2429
2429
  if (userSignedCheckpoints) {
2430
2430
  finalCheckpoints = signedCheckpointTxs.map((c, i) => {
2431
- const serverSigned = chunkQDXQULVM_cjs.Transaction.fromPSBT(base.base64.decode(c));
2431
+ const serverSigned = chunkSIAVTHMZ_cjs.Transaction.fromPSBT(base.base64.decode(c));
2432
2432
  combineTapscriptSigs(userSignedCheckpoints[i], serverSigned);
2433
2433
  return base.base64.encode(serverSigned.toPSBT());
2434
2434
  });
2435
2435
  } else {
2436
2436
  finalCheckpoints = await Promise.all(
2437
2437
  signedCheckpointTxs.map(async (c) => {
2438
- const tx = chunkQDXQULVM_cjs.Transaction.fromPSBT(base.base64.decode(c));
2438
+ const tx = chunkSIAVTHMZ_cjs.Transaction.fromPSBT(base.base64.decode(c));
2439
2439
  const signed = await signer.signCheckpoint(tx);
2440
2440
  return base.base64.encode(signed.toPSBT());
2441
2441
  })
@@ -3339,7 +3339,7 @@ var VtxoManager = class _VtxoManager {
3339
3339
  `Sweep not economical: output ${outputAmount} sats after ${fee} sats fee is below dust (${dustAmount} sats)`
3340
3340
  );
3341
3341
  }
3342
- const tx = new chunkQDXQULVM_cjs.Transaction();
3342
+ const tx = new chunkSIAVTHMZ_cjs.Transaction();
3343
3343
  for (const utxo of expiredUtxos) {
3344
3344
  const utxoScript = chunkE7HB3GKK_cjs.VtxoScript.decode(utxo.tapTree);
3345
3345
  const utxoExitLeaf = utxoScript.leaves.find(
@@ -3998,8 +3998,8 @@ var VtxoManager = class _VtxoManager {
3998
3998
  * or doesn't carry the metadata.
3999
3999
  */
4000
4000
  extractSpentOutpoint(error) {
4001
- const ark = chunkQDXQULVM_cjs.maybeArkError(error);
4002
- if (!chunkQDXQULVM_cjs.isArkError(ark, chunkQDXQULVM_cjs.ArkErrorName.VTXO_ALREADY_SPENT)) return void 0;
4001
+ const ark = chunkSIAVTHMZ_cjs.maybeArkError(error);
4002
+ if (!chunkSIAVTHMZ_cjs.isArkError(ark, chunkSIAVTHMZ_cjs.ArkErrorName.VTXO_ALREADY_SPENT)) return void 0;
4003
4003
  const raw = ark.metadata?.vtxo_outpoint;
4004
4004
  if (typeof raw !== "string") return void 0;
4005
4005
  const [txid, voutStr] = raw.split(":");
@@ -4734,7 +4734,7 @@ async function captureExitBranch(params) {
4734
4734
  const nonCommitment = ordered.filter((c) => chainTxTypeToChainedExit(c.type) !== 1 /* Commitment */).map((c) => c.txid);
4735
4735
  if (nonCommitment.length > 0) {
4736
4736
  for (const psbt of await resolver.getVirtualTxs(nonCommitment)) {
4737
- psbtByTxid.set(chunkQDXQULVM_cjs.Transaction.fromPSBT(base.base64.decode(psbt)).id, psbt);
4737
+ psbtByTxid.set(chunkSIAVTHMZ_cjs.Transaction.fromPSBT(base.base64.decode(psbt)).id, psbt);
4738
4738
  }
4739
4739
  }
4740
4740
  }
@@ -4795,7 +4795,7 @@ var IndexerExitDataSource = class {
4795
4795
  pageSize: chunkE7HB3GKK_cjs.DEFAULT_PAGE_SIZE
4796
4796
  });
4797
4797
  for (const psbt of txs) {
4798
- out.set(chunkQDXQULVM_cjs.Transaction.fromPSBT(base.base64.decode(psbt)).id, psbt);
4798
+ out.set(chunkSIAVTHMZ_cjs.Transaction.fromPSBT(base.base64.decode(psbt)).id, psbt);
4799
4799
  }
4800
4800
  hasMore = page ? txs.length === chunkE7HB3GKK_cjs.DEFAULT_PAGE_SIZE : false;
4801
4801
  pageIndex++;
@@ -4818,7 +4818,7 @@ function chainedTxTypeToChainTxType(t) {
4818
4818
  }
4819
4819
  }
4820
4820
  function psbtInputTxids(psbtBase64) {
4821
- const tx = chunkQDXQULVM_cjs.Transaction.fromPSBT(base.base64.decode(psbtBase64));
4821
+ const tx = chunkSIAVTHMZ_cjs.Transaction.fromPSBT(base.base64.decode(psbtBase64));
4822
4822
  const ids = [];
4823
4823
  for (let i = 0; i < tx.inputsLength; i++) {
4824
4824
  const txid = tx.getInput(i).txid;
@@ -4921,7 +4921,7 @@ function createExitChainResolver(params) {
4921
4921
 
4922
4922
  // src/providers/availability.ts
4923
4923
  function isRetryableProviderError(error) {
4924
- return error instanceof chunkQDXQULVM_cjs.ProviderUnavailableError || error instanceof chunkQDXQULVM_cjs.FetchError || chunkQDXQULVM_cjs.isFetchTimeoutError(error);
4924
+ return error instanceof chunkSIAVTHMZ_cjs.ProviderUnavailableError || error instanceof chunkSIAVTHMZ_cjs.FetchError || chunkSIAVTHMZ_cjs.isFetchTimeoutError(error);
4925
4925
  }
4926
4926
 
4927
4927
  // src/utils/syncCursors.ts
@@ -5174,7 +5174,7 @@ async function resolveArkInfo(arkProvider, walletRepository) {
5174
5174
  if (!isRetryableProviderError(err)) throw err;
5175
5175
  const snapshot = await loadArkInfoSnapshot(walletRepository);
5176
5176
  if (!snapshot) {
5177
- throw new chunkQDXQULVM_cjs.ProviderUnavailableError(
5177
+ throw new chunkSIAVTHMZ_cjs.ProviderUnavailableError(
5178
5178
  "Arkade server info is unavailable and no cached snapshot exists",
5179
5179
  { cause: err }
5180
5180
  );
@@ -5709,7 +5709,7 @@ var AssetManager = class extends ReadonlyAssetManager {
5709
5709
  const virtualCoins = await this.wallet.getVtxos({
5710
5710
  withRecoverable: false
5711
5711
  });
5712
- const controlAssetRef = params.controlAssetId ? chunkQDXQULVM_cjs.AssetRef.fromId(chunkQDXQULVM_cjs.AssetId.fromString(params.controlAssetId)) : null;
5712
+ const controlAssetRef = params.controlAssetId ? chunkSIAVTHMZ_cjs.AssetRef.fromId(chunkSIAVTHMZ_cjs.AssetId.fromString(params.controlAssetId)) : null;
5713
5713
  const coinSelection = selectVirtualCoins(virtualCoins, Number(this.wallet.dustAmount));
5714
5714
  let totalBtcSelected = 0n;
5715
5715
  const assetChanges = /* @__PURE__ */ new Map();
@@ -5722,8 +5722,8 @@ var AssetManager = class extends ReadonlyAssetManager {
5722
5722
  }
5723
5723
  }
5724
5724
  const groups = [];
5725
- const issuedAssetOutput = chunkQDXQULVM_cjs.AssetOutput.create(0, params.amount);
5726
- const issuedAssetGroup = chunkQDXQULVM_cjs.AssetGroup.create(
5725
+ const issuedAssetOutput = chunkSIAVTHMZ_cjs.AssetOutput.create(0, params.amount);
5726
+ const issuedAssetGroup = chunkSIAVTHMZ_cjs.AssetGroup.create(
5727
5727
  null,
5728
5728
  controlAssetRef,
5729
5729
  [],
@@ -5738,15 +5738,15 @@ var AssetManager = class extends ReadonlyAssetManager {
5738
5738
  for (const [inputIndex, assets] of assetInputs) {
5739
5739
  for (const asset of assets) {
5740
5740
  if (asset.assetId !== assetId) continue;
5741
- changeInputs.push(chunkQDXQULVM_cjs.AssetInput.create(inputIndex, asset.amount));
5741
+ changeInputs.push(chunkSIAVTHMZ_cjs.AssetInput.create(inputIndex, asset.amount));
5742
5742
  }
5743
5743
  }
5744
5744
  groups.push(
5745
- chunkQDXQULVM_cjs.AssetGroup.create(
5746
- chunkQDXQULVM_cjs.AssetId.fromString(assetId),
5745
+ chunkSIAVTHMZ_cjs.AssetGroup.create(
5746
+ chunkSIAVTHMZ_cjs.AssetId.fromString(assetId),
5747
5747
  null,
5748
5748
  changeInputs,
5749
- [chunkQDXQULVM_cjs.AssetOutput.create(0, amount)],
5749
+ [chunkSIAVTHMZ_cjs.AssetOutput.create(0, amount)],
5750
5750
  []
5751
5751
  )
5752
5752
  );
@@ -5759,7 +5759,7 @@ var AssetManager = class extends ReadonlyAssetManager {
5759
5759
  script: outputAddress.pkScript,
5760
5760
  amount: BigInt(totalBtcSelected)
5761
5761
  },
5762
- Extension.create([chunkQDXQULVM_cjs.Packet.create(groups)]).txOut()
5762
+ Extension.create([chunkSIAVTHMZ_cjs.Packet.create(groups)]).txOut()
5763
5763
  ];
5764
5764
  const { arkTxid } = await this.wallet.buildAndSubmitOffchainTx(
5765
5765
  coinSelection.inputs,
@@ -5767,7 +5767,7 @@ var AssetManager = class extends ReadonlyAssetManager {
5767
5767
  );
5768
5768
  return {
5769
5769
  arkTxId: arkTxid,
5770
- assetId: chunkQDXQULVM_cjs.AssetId.create(arkTxid, 0).toString()
5770
+ assetId: chunkSIAVTHMZ_cjs.AssetId.create(arkTxid, 0).toString()
5771
5771
  };
5772
5772
  }
5773
5773
  /**
@@ -5839,16 +5839,16 @@ var AssetManager = class extends ReadonlyAssetManager {
5839
5839
  for (const [inputIndex, assets] of assetInputs) {
5840
5840
  for (const asset of assets) {
5841
5841
  if (asset.assetId !== params.assetId) continue;
5842
- reissueInputs.push(chunkQDXQULVM_cjs.AssetInput.create(inputIndex, asset.amount));
5842
+ reissueInputs.push(chunkSIAVTHMZ_cjs.AssetInput.create(inputIndex, asset.amount));
5843
5843
  }
5844
5844
  }
5845
5845
  const totalAssetAmount = assetToReissueAmount + params.amount;
5846
- const reissueAssetIdObj = chunkQDXQULVM_cjs.AssetId.fromString(params.assetId);
5847
- const reissueAssetGroup = chunkQDXQULVM_cjs.AssetGroup.create(
5846
+ const reissueAssetIdObj = chunkSIAVTHMZ_cjs.AssetId.fromString(params.assetId);
5847
+ const reissueAssetGroup = chunkSIAVTHMZ_cjs.AssetGroup.create(
5848
5848
  reissueAssetIdObj,
5849
5849
  null,
5850
5850
  reissueInputs,
5851
- [chunkQDXQULVM_cjs.AssetOutput.create(0, totalAssetAmount)],
5851
+ [chunkSIAVTHMZ_cjs.AssetOutput.create(0, totalAssetAmount)],
5852
5852
  []
5853
5853
  );
5854
5854
  const groups = [reissueAssetGroup];
@@ -5857,15 +5857,15 @@ var AssetManager = class extends ReadonlyAssetManager {
5857
5857
  for (const [inputIndex, assets] of assetInputs) {
5858
5858
  for (const asset of assets) {
5859
5859
  if (asset.assetId !== assetId) continue;
5860
- changeInputs.push(chunkQDXQULVM_cjs.AssetInput.create(inputIndex, asset.amount));
5860
+ changeInputs.push(chunkSIAVTHMZ_cjs.AssetInput.create(inputIndex, asset.amount));
5861
5861
  }
5862
5862
  }
5863
5863
  groups.push(
5864
- chunkQDXQULVM_cjs.AssetGroup.create(
5865
- chunkQDXQULVM_cjs.AssetId.fromString(assetId),
5864
+ chunkSIAVTHMZ_cjs.AssetGroup.create(
5865
+ chunkSIAVTHMZ_cjs.AssetId.fromString(assetId),
5866
5866
  null,
5867
5867
  changeInputs,
5868
- [chunkQDXQULVM_cjs.AssetOutput.create(0, amount)],
5868
+ [chunkSIAVTHMZ_cjs.AssetOutput.create(0, amount)],
5869
5869
  []
5870
5870
  )
5871
5871
  );
@@ -5877,7 +5877,7 @@ var AssetManager = class extends ReadonlyAssetManager {
5877
5877
  script: outputAddress.pkScript,
5878
5878
  amount: BigInt(totalBtcSelected)
5879
5879
  },
5880
- Extension.create([chunkQDXQULVM_cjs.Packet.create(groups)]).txOut()
5880
+ Extension.create([chunkSIAVTHMZ_cjs.Packet.create(groups)]).txOut()
5881
5881
  ];
5882
5882
  const { arkTxid } = await this.wallet.buildAndSubmitOffchainTx(selectedCoins, outputs);
5883
5883
  return arkTxid;
@@ -5944,15 +5944,15 @@ var AssetManager = class extends ReadonlyAssetManager {
5944
5944
  for (const [inputIndex, assets] of assetInputs) {
5945
5945
  for (const asset of assets) {
5946
5946
  if (asset.assetId !== assetId) continue;
5947
- changeInputs.push(chunkQDXQULVM_cjs.AssetInput.create(inputIndex, asset.amount));
5947
+ changeInputs.push(chunkSIAVTHMZ_cjs.AssetInput.create(inputIndex, asset.amount));
5948
5948
  }
5949
5949
  }
5950
5950
  groups.push(
5951
- chunkQDXQULVM_cjs.AssetGroup.create(
5952
- chunkQDXQULVM_cjs.AssetId.fromString(assetId),
5951
+ chunkSIAVTHMZ_cjs.AssetGroup.create(
5952
+ chunkSIAVTHMZ_cjs.AssetId.fromString(assetId),
5953
5953
  null,
5954
5954
  changeInputs,
5955
- amount > 0n ? [chunkQDXQULVM_cjs.AssetOutput.create(0, amount)] : [],
5955
+ amount > 0n ? [chunkSIAVTHMZ_cjs.AssetOutput.create(0, amount)] : [],
5956
5956
  []
5957
5957
  )
5958
5958
  );
@@ -5964,7 +5964,7 @@ var AssetManager = class extends ReadonlyAssetManager {
5964
5964
  script: outputAddress.pkScript,
5965
5965
  amount: BigInt(totalBtcSelected)
5966
5966
  },
5967
- Extension.create([chunkQDXQULVM_cjs.Packet.create(groups)]).txOut()
5967
+ Extension.create([chunkSIAVTHMZ_cjs.Packet.create(groups)]).txOut()
5968
5968
  ];
5969
5969
  const { arkTxid } = await this.wallet.buildAndSubmitOffchainTx(selectedCoins, outputs);
5970
5970
  return arkTxid;
@@ -5989,7 +5989,7 @@ function castMetadata(metadata) {
5989
5989
  } else {
5990
5990
  throw new Error("Invalid metadata value type");
5991
5991
  }
5992
- md.push(chunkQDXQULVM_cjs.Metadata.create(textEncoder.encode(key), valueBytes));
5992
+ md.push(chunkSIAVTHMZ_cjs.Metadata.create(textEncoder.encode(key), valueBytes));
5993
5993
  }
5994
5994
  return md;
5995
5995
  }
@@ -6273,7 +6273,7 @@ async function makeSignedDelegateIntent(identity, coins, outputs, onchainOutputs
6273
6273
  expire_at: 0,
6274
6274
  cosigners_public_keys: cosignerPubKeys
6275
6275
  };
6276
- const proof = chunkQDXQULVM_cjs.Intent.create(message, coins, outputs);
6276
+ const proof = chunkSIAVTHMZ_cjs.Intent.create(message, coins, outputs);
6277
6277
  const signedProof = await identity.sign(proof);
6278
6278
  return {
6279
6279
  proof: base.base64.encode(signedProof.toPSBT()),
@@ -8136,10 +8136,10 @@ var ContractWatcher = class {
8136
8136
  /**
8137
8137
  * Add a contract to be watched.
8138
8138
  *
8139
- * Active contracts are immediately subscribed.
8139
+ * Once watching, every contract is subscribed and polled whatever
8140
+ * its state.
8140
8141
  *
8141
- * All contracts are polled to discover any existing virtual outputs
8142
- * (which may cause them to be watched even if inactive).
8142
+ * @see getWatchedContracts
8143
8143
  */
8144
8144
  async addContract(contract) {
8145
8145
  const state = {
@@ -8207,18 +8207,18 @@ var ContractWatcher = class {
8207
8207
  return Array.from(this.contracts.values()).map((s) => s.contract);
8208
8208
  }
8209
8209
  /**
8210
- * Contracts the watcher is actually tracking:
8211
- * - all active contracts, plus
8212
- * - inactive contracts that still hold known virtual outputs
8213
- * (the subscription keeps watching them so `vtxo_spent` events for
8214
- * those unspent outputs are still observed).
8210
+ * Every registered contract, retired (`inactive`) ones included.
8215
8211
  *
8216
- * This is the single source of truth for "contracts whose VTXO state
8217
- * we still care about" callers and the subscription itself fan out
8218
- * over the same set so nothing is reconciled that isn't also watched.
8212
+ * Feeds both the subscription and the indexer sweep scope, so
8213
+ * narrowing it drops a contract from every background channel at
8214
+ * once. Nothing may be narrowed out: an Ark receive address can be
8215
+ * paid again after the wallet has rotated past it, and a payment
8216
+ * that lands outside every background channel is invisible until
8217
+ * some foreground read happens to sweep it. Retirement therefore
8218
+ * governs receive-address selection, not coverage.
8219
8219
  */
8220
8220
  getWatchedContracts() {
8221
- return Array.from(this.contracts.values()).filter((s) => s.contract.state === "active" || s.lastKnownVtxos.size > 0).map((s) => s.contract);
8221
+ return this.getAllContracts();
8222
8222
  }
8223
8223
  /**
8224
8224
  * Get virtual outputs for contracts, grouped by contract script.
@@ -8247,7 +8247,7 @@ var ContractWatcher = class {
8247
8247
  return new Map(results.flat(1));
8248
8248
  }
8249
8249
  /**
8250
- * Start watching for virtual output events across all active contracts.
8250
+ * Start watching for virtual output events across all watched contracts.
8251
8251
  */
8252
8252
  async startWatching(callback) {
8253
8253
  if (this.isWatching) {
@@ -8298,7 +8298,7 @@ var ContractWatcher = class {
8298
8298
  return this.connectionState;
8299
8299
  }
8300
8300
  /**
8301
- * Force a poll of all active contracts.
8301
+ * Force a poll of all watched contracts.
8302
8302
  * Useful for manual refresh or after app resume.
8303
8303
  */
8304
8304
  async forcePoll() {
@@ -8322,7 +8322,7 @@ var ContractWatcher = class {
8322
8322
  this.connectionState = "connected";
8323
8323
  this.reconnectAttempts = 0;
8324
8324
  this.listenLoop().catch((e) => {
8325
- if (chunkQDXQULVM_cjs.isEventSourceError(e)) {
8325
+ if (chunkSIAVTHMZ_cjs.isEventSourceError(e)) {
8326
8326
  console.debug("ContractWatcher subscription disconnected; reconnecting");
8327
8327
  } else {
8328
8328
  console.error(e);
@@ -8486,7 +8486,7 @@ var ContractWatcher = class {
8486
8486
  /**
8487
8487
  * Update the subscription with scripts that should be watched.
8488
8488
  *
8489
- * Watches both active contracts and contracts with virtual outputs.
8489
+ * @see getWatchedContracts
8490
8490
  */
8491
8491
  async updateSubscription() {
8492
8492
  const scriptsToWatch = this.getWatchedContracts().map((c) => c.script);
@@ -8759,8 +8759,8 @@ var ContractManager = class _ContractManager {
8759
8759
  * Static factory method for creating a new ContractManager.
8760
8760
  * Initialize the manager by loading persisted contracts and starting to watch.
8761
8761
  *
8762
- * After initialization, the manager automatically watches all active contracts
8763
- * and contracts with virtual outputs. Use `onContractEvent()` to register event callbacks.
8762
+ * After initialization, the manager automatically watches every persisted
8763
+ * contract. Use `onContractEvent()` to register event callbacks.
8764
8764
  *
8765
8765
  * @param config ContractManagerConfig
8766
8766
  */
@@ -9207,13 +9207,17 @@ var ContractManager = class _ContractManager {
9207
9207
  return updated;
9208
9208
  }
9209
9209
  /**
9210
- * Set a contract's state.
9210
+ * Set a contract's state. Retiring (`inactive`) keeps it watched;
9211
+ * see {@link ContractState}. To stop watching, use
9212
+ * {@link deleteContract}.
9211
9213
  */
9212
9214
  async setContractState(script, state) {
9213
9215
  await this.updateContract(script, { state });
9214
9216
  }
9215
9217
  /**
9216
- * Delete a contract.
9218
+ * Delete a contract. Also removes it from the watcher — the only way
9219
+ * to stop watching a contract (retiring it via
9220
+ * {@link setContractState} does not).
9217
9221
  *
9218
9222
  * @param script - Contract script
9219
9223
  */
@@ -9288,22 +9292,10 @@ var ContractManager = class _ContractManager {
9288
9292
  /**
9289
9293
  * Force refresh virtual outputs from the indexer.
9290
9294
  *
9291
- * Without options, re-fetches every contract in the watcher's
9292
- * watched set and advances the global cursor.
9293
- *
9294
- * `scripts` narrows the refresh to a specific list (subset query —
9295
- * cursor is not advanced because contracts outside the list may
9296
- * have data we'd skip).
9297
- *
9298
- * `includeInactive: true` (and no `scripts`) widens the refresh to
9299
- * every contract in the repository, including ones marked
9300
- * `inactive` and ones that have dropped out of the watcher's
9301
- * active set. This is a *superset* of the watched set, so the
9302
- * cursor invariant still holds and the cursor advances normally.
9303
- *
9304
- * `after` / `before` apply a caller-supplied time window. The
9305
- * cursor never advances on a windowed query because the window
9306
- * may skip data outside its bounds.
9295
+ * Without options, re-fetches the watcher's watched set and
9296
+ * advances the global cursor. Each option narrows or widens that
9297
+ * scope and may hold the cursor back — see
9298
+ * {@link RefreshVtxosOptions}.
9307
9299
  */
9308
9300
  async refreshVtxos(opts) {
9309
9301
  const contracts = opts?.scripts ? await this.getContracts({ script: opts.scripts }) : void 0;
@@ -9419,11 +9411,10 @@ var ContractManager = class _ContractManager {
9419
9411
  * Sync virtual outputs for the given contracts against the indexer.
9420
9412
  *
9421
9413
  * When `options.contracts` is omitted the sync covers the full
9422
- * watched set (active contracts plus any inactive contracts still
9423
- * holding cached VTXOs) and the global cursor is advanced on
9424
- * success. Passing an explicit subset leaves the cursor alone so a
9425
- * narrow poll can't hide data that other contracts still need to
9426
- * pick up.
9414
+ * watched set ({@link ContractWatcher.getWatchedContracts}) and the
9415
+ * global cursor is advanced on success. Passing an explicit subset
9416
+ * leaves the cursor alone so a narrow poll can't hide data that
9417
+ * other contracts still need to pick up.
9427
9418
  */
9428
9419
  async syncContracts(options) {
9429
9420
  const cursor = await getSyncCursor(this.config.walletRepository);
@@ -10634,7 +10625,7 @@ var ReadonlyWallet = class _ReadonlyWallet {
10634
10625
  */
10635
10626
  static async setupWalletConfig(config, pubKey) {
10636
10627
  const arkadeServerUrl = getArkadeServerUrl(config);
10637
- const arkProvider = config.arkProvider || new chunkQDXQULVM_cjs.RestArkProvider(arkadeServerUrl);
10628
+ const arkProvider = config.arkProvider || new chunkSIAVTHMZ_cjs.RestArkProvider(arkadeServerUrl);
10638
10629
  let indexerProvider = config.indexerProvider;
10639
10630
  if (!indexerProvider) {
10640
10631
  let indexerUrl = config.indexerUrl;
@@ -10651,7 +10642,7 @@ var ReadonlyWallet = class _ReadonlyWallet {
10651
10642
  indexerUrl = arkadeServerUrl;
10652
10643
  }
10653
10644
  }
10654
- indexerProvider = new chunkQDXQULVM_cjs.RestIndexerProvider(indexerUrl);
10645
+ indexerProvider = new chunkSIAVTHMZ_cjs.RestIndexerProvider(indexerUrl);
10655
10646
  }
10656
10647
  const walletRepository = config.storage?.walletRepository ?? new IndexedDBWalletRepository();
10657
10648
  const contractRepository = config.storage?.contractRepository ?? new IndexedDBContractRepository();
@@ -12729,9 +12720,9 @@ var Wallet2 = class _Wallet extends ReadonlyWallet {
12729
12720
  ...existing ?? {},
12730
12721
  intentTxId,
12731
12722
  registerProof: intent.proof,
12732
- registerProofMessage: chunkQDXQULVM_cjs.Intent.encodeMessage(intent.message),
12723
+ registerProofMessage: chunkSIAVTHMZ_cjs.Intent.encodeMessage(intent.message),
12733
12724
  deleteProof: deleteIntent.proof,
12734
- deleteProofMessage: chunkQDXQULVM_cjs.Intent.encodeMessage(deleteIntent.message),
12725
+ deleteProofMessage: chunkSIAVTHMZ_cjs.Intent.encodeMessage(deleteIntent.message),
12735
12726
  intentVtxos: inputs.map((i) => ({
12736
12727
  txid: i.txid,
12737
12728
  vout: i.vout
@@ -12763,7 +12754,7 @@ var Wallet2 = class _Wallet extends ReadonlyWallet {
12763
12754
  try {
12764
12755
  return await this.arkProvider.registerIntent(intent);
12765
12756
  } catch (error) {
12766
- if (error instanceof chunkQDXQULVM_cjs.ArkError && error.code === 0 && error.message.includes("duplicated input")) {
12757
+ if (error instanceof chunkSIAVTHMZ_cjs.ArkError && error.code === 0 && error.message.includes("duplicated input")) {
12767
12758
  const deleteIntent = await this.makeDeleteIntentSignature(inputs);
12768
12759
  await this.arkProvider.deleteIntent(deleteIntent);
12769
12760
  return this.arkProvider.registerIntent(intent);
@@ -12779,7 +12770,7 @@ var Wallet2 = class _Wallet extends ReadonlyWallet {
12779
12770
  expire_at: 0,
12780
12771
  cosigners_public_keys: cosignerPubKeys
12781
12772
  };
12782
- const proof = chunkQDXQULVM_cjs.Intent.create(message, coins, outputs);
12773
+ const proof = chunkSIAVTHMZ_cjs.Intent.create(message, coins, outputs);
12783
12774
  const signedProof = await this._signerRouter.sign(proof, intentProofJobs(coins));
12784
12775
  return {
12785
12776
  proof: base.base64.encode(signedProof.toPSBT()),
@@ -12791,7 +12782,7 @@ var Wallet2 = class _Wallet extends ReadonlyWallet {
12791
12782
  type: "delete",
12792
12783
  expire_at: 0
12793
12784
  };
12794
- const proof = chunkQDXQULVM_cjs.Intent.create(message, coins, []);
12785
+ const proof = chunkSIAVTHMZ_cjs.Intent.create(message, coins, []);
12795
12786
  const signedProof = await this._signerRouter.sign(proof, intentProofJobs(coins));
12796
12787
  return {
12797
12788
  proof: base.base64.encode(signedProof.toPSBT()),
@@ -12803,7 +12794,7 @@ var Wallet2 = class _Wallet extends ReadonlyWallet {
12803
12794
  type: "get-pending-tx",
12804
12795
  expire_at: 0
12805
12796
  };
12806
- const proof = chunkQDXQULVM_cjs.Intent.create(message, coins, []);
12797
+ const proof = chunkSIAVTHMZ_cjs.Intent.create(message, coins, []);
12807
12798
  const signedProof = await this._signerRouter.sign(proof, intentProofJobs(coins));
12808
12799
  return {
12809
12800
  proof: base.base64.encode(signedProof.toPSBT()),
@@ -13136,7 +13127,7 @@ var Wallet2 = class _Wallet extends ReadonlyWallet {
13136
13127
  for (let i = 0; i < inputs.length; i += MAX_INPUTS_PER_INTENT) {
13137
13128
  const batch = inputs.slice(i, i + MAX_INPUTS_PER_INTENT);
13138
13129
  const message = { type: "get-pending-tx", expire_at: 0 };
13139
- const proof = chunkQDXQULVM_cjs.Intent.create(message, batch, []);
13130
+ const proof = chunkSIAVTHMZ_cjs.Intent.create(message, batch, []);
13140
13131
  const signedProof = await identity.sign(
13141
13132
  proof,
13142
13133
  Array.from({ length: batch.length + 1 }, (_, j) => j)
@@ -14019,7 +14010,7 @@ var MessageBus = class {
14019
14010
  this.initialized = true;
14020
14011
  }
14021
14012
  async buildServices(config) {
14022
- const arkProvider = new chunkQDXQULVM_cjs.RestArkProvider(config.arkServer.url);
14013
+ const arkProvider = new chunkSIAVTHMZ_cjs.RestArkProvider(config.arkServer.url);
14023
14014
  const storage = {
14024
14015
  walletRepository: this.walletRepository,
14025
14016
  contractRepository: this.contractRepository
@@ -15179,7 +15170,7 @@ var WalletMessageHandler = class {
15179
15170
  // Wallet methods
15180
15171
  async handleInitWallet({ payload }) {
15181
15172
  const { arkServerUrl } = payload;
15182
- this.indexerProvider = new chunkQDXQULVM_cjs.RestIndexerProvider(arkServerUrl);
15173
+ this.indexerProvider = new chunkSIAVTHMZ_cjs.RestIndexerProvider(arkServerUrl);
15183
15174
  await this.onWalletInitialized();
15184
15175
  }
15185
15176
  async handleGetBalance() {
@@ -17047,7 +17038,7 @@ var OnchainWallet = class _OnchainWallet {
17047
17038
  if (!inputs) {
17048
17039
  throw new Error("Fee estimation failed");
17049
17040
  }
17050
- let tx = new chunkQDXQULVM_cjs.Transaction();
17041
+ let tx = new chunkSIAVTHMZ_cjs.Transaction();
17051
17042
  for (const input of inputs) {
17052
17043
  tx.addInput({
17053
17044
  txid: input.txid,
@@ -17105,7 +17096,7 @@ var OnchainWallet = class _OnchainWallet {
17105
17096
  * @throws If the parent has no anchor, or funding cannot be selected/signed
17106
17097
  */
17107
17098
  async bumpAnchor(parentHex, feeRate) {
17108
- const parent = chunkQDXQULVM_cjs.Transaction.fromRaw(base.hex.decode(parentHex));
17099
+ const parent = chunkSIAVTHMZ_cjs.Transaction.fromRaw(base.hex.decode(parentHex));
17109
17100
  const coins = (await this.getCoins()).filter((c) => c.status.confirmed);
17110
17101
  const child = await this.buildBumpPackage(parent, feeRate, coins);
17111
17102
  return [parent.hex, child.hex];
@@ -17870,7 +17861,7 @@ exports.BIP322 = void 0;
17870
17861
  async function sign2(message, identity, network) {
17871
17862
  const xOnlyPubKey = await identity.xOnlyPublicKey();
17872
17863
  const payment = btcSigner.p2tr(xOnlyPubKey, void 0, network);
17873
- const toSpend = chunkQDXQULVM_cjs.craftToSpendTx(message, payment.script, TAG_BIP322);
17864
+ const toSpend = chunkSIAVTHMZ_cjs.craftToSpendTx(message, payment.script, TAG_BIP322);
17874
17865
  const toSign = craftBIP322ToSignP2TR(toSpend, payment.script, xOnlyPubKey);
17875
17866
  const signed = await identity.sign(toSign, [0]);
17876
17867
  signed.finalizeIdx(0);
@@ -17928,7 +17919,7 @@ function verifyP2TR(message, witnessItems, pkScript, pubkey) {
17928
17919
  if (sighashType !== btcSigner.SigHash.DEFAULT && sighashType !== btcSigner.SigHash.ALL) {
17929
17920
  return false;
17930
17921
  }
17931
- const toSpend = chunkQDXQULVM_cjs.craftToSpendTx(message, pkScript, TAG_BIP322);
17922
+ const toSpend = chunkSIAVTHMZ_cjs.craftToSpendTx(message, pkScript, TAG_BIP322);
17932
17923
  const toSign = craftBIP322ToSignP2TR(toSpend, pkScript, pubkey);
17933
17924
  const sighash = toSign.preimageWitnessV1(0, [pkScript], sighashType, [0n]);
17934
17925
  const rawSig = sig.length === 65 ? sig.subarray(0, 64) : sig;
@@ -17949,7 +17940,7 @@ function verifyP2WPKH(message, witnessItems, pkScript, addressHash) {
17949
17940
  }
17950
17941
  const sighashType = sigWithHash[sigWithHash.length - 1];
17951
17942
  const derSig = sigWithHash.subarray(0, sigWithHash.length - 1);
17952
- const toSpend = chunkQDXQULVM_cjs.craftToSpendTx(message, pkScript, TAG_BIP322);
17943
+ const toSpend = chunkSIAVTHMZ_cjs.craftToSpendTx(message, pkScript, TAG_BIP322);
17953
17944
  const toSign = craftBIP322ToSignSimple(toSpend, pkScript);
17954
17945
  const scriptCode = btcSigner.OutScript.encode({ type: "pkh", hash: addressHash });
17955
17946
  const sighash = toSign.preimageWitnessV0(0, scriptCode, sighashType, 0n);
@@ -18002,7 +17993,7 @@ function encodeCompactSize(n) {
18002
17993
  return buf;
18003
17994
  }
18004
17995
  function craftBIP322ToSignP2TR(toSpend, pkScript, tapInternalKey) {
18005
- const tx = new chunkQDXQULVM_cjs.Transaction({ version: 0 });
17996
+ const tx = new chunkSIAVTHMZ_cjs.Transaction({ version: 0 });
18006
17997
  tx.addInput({
18007
17998
  txid: toSpend.id,
18008
17999
  index: 0,
@@ -18016,12 +18007,12 @@ function craftBIP322ToSignP2TR(toSpend, pkScript, tapInternalKey) {
18016
18007
  });
18017
18008
  tx.addOutput({
18018
18009
  amount: 0n,
18019
- script: chunkQDXQULVM_cjs.OP_RETURN_EMPTY_PKSCRIPT
18010
+ script: chunkSIAVTHMZ_cjs.OP_RETURN_EMPTY_PKSCRIPT
18020
18011
  });
18021
18012
  return tx;
18022
18013
  }
18023
18014
  function craftBIP322ToSignSimple(toSpend, pkScript) {
18024
- const tx = new chunkQDXQULVM_cjs.Transaction({ version: 0 });
18015
+ const tx = new chunkSIAVTHMZ_cjs.Transaction({ version: 0 });
18025
18016
  tx.addInput({
18026
18017
  txid: toSpend.id,
18027
18018
  index: 0,
@@ -18033,7 +18024,7 @@ function craftBIP322ToSignSimple(toSpend, pkScript) {
18033
18024
  });
18034
18025
  tx.addOutput({
18035
18026
  amount: 0n,
18036
- script: chunkQDXQULVM_cjs.OP_RETURN_EMPTY_PKSCRIPT
18027
+ script: chunkSIAVTHMZ_cjs.OP_RETURN_EMPTY_PKSCRIPT
18037
18028
  });
18038
18029
  return tx;
18039
18030
  }
@@ -18164,7 +18155,7 @@ var RestEmulatorProvider = class {
18164
18155
  }
18165
18156
  };
18166
18157
  function finalizeVirtualTx(type, psbtBase64) {
18167
- const tx = chunkQDXQULVM_cjs.Transaction.fromPSBT(base.base64.decode(psbtBase64));
18158
+ const tx = chunkSIAVTHMZ_cjs.Transaction.fromPSBT(base.base64.decode(psbtBase64));
18168
18159
  if (type === "INDEXER_CHAINED_TX_TYPE_TREE" /* TREE */) {
18169
18160
  const input = tx.getInput(0);
18170
18161
  if (!input) {
@@ -18442,7 +18433,7 @@ async function prepareUnrollTransaction(wallet, vtxoTxIds, outputAddress) {
18442
18433
  btcSigner.TaprootControlBlock.encode(spendingLeaf[0]).length
18443
18434
  );
18444
18435
  }
18445
- const tx = new chunkQDXQULVM_cjs.Transaction({ version: 2 });
18436
+ const tx = new chunkSIAVTHMZ_cjs.Transaction({ version: 2 });
18446
18437
  for (const input of inputs) {
18447
18438
  tx.addInput(input);
18448
18439
  }
@@ -18509,7 +18500,7 @@ async function buildSignedSweep(params) {
18509
18500
  `uneconomic vtxo ${vtxo.txid}:${vtxo.vout}: value ${vtxo.value} - fee ${fee} < dust`
18510
18501
  );
18511
18502
  }
18512
- const tx = new chunkQDXQULVM_cjs.Transaction({ version: 2 });
18503
+ const tx = new chunkSIAVTHMZ_cjs.Transaction({ version: 2 });
18513
18504
  tx.addInput({
18514
18505
  txid: vtxo.txid,
18515
18506
  index: vtxo.vout,
@@ -18609,7 +18600,7 @@ async function computeExitLayout(opts, feeRate) {
18609
18600
  if (pendingNodes.length > 0) {
18610
18601
  const txs = await resolver.getVirtualTxs(pendingNodes.map((n) => n.txid));
18611
18602
  for (const psbt of txs) {
18612
- psbts.set(chunkQDXQULVM_cjs.Transaction.fromPSBT(base.base64.decode(psbt)).id, psbt);
18603
+ psbts.set(chunkSIAVTHMZ_cjs.Transaction.fromPSBT(base.base64.decode(psbt)).id, psbt);
18613
18604
  }
18614
18605
  }
18615
18606
  const childVsize = Number(
@@ -19056,7 +19047,7 @@ async function prepare(opts) {
19056
19047
  if (newFee <= splitterFee) break;
19057
19048
  splitterFee = newFee;
19058
19049
  }
19059
- const splitter = new chunkQDXQULVM_cjs.Transaction({ version: 2 });
19050
+ const splitter = new chunkSIAVTHMZ_cjs.Transaction({ version: 2 });
19060
19051
  for (const coin of selected.inputs) {
19061
19052
  splitter.addInput({
19062
19053
  txid: coin.txid,
@@ -19263,7 +19254,7 @@ function createArkadeBatchHandler(intentId, inputs, signer, signedProof, message
19263
19254
  if (!xOnlyPubkeys.includes(base.hex.encode(xonlySignerPubKey))) {
19264
19255
  return { skip: true };
19265
19256
  }
19266
- const commitmentTx = chunkQDXQULVM_cjs.Transaction.fromPSBT(base.base64.decode(event.unsignedCommitmentTx));
19257
+ const commitmentTx = chunkSIAVTHMZ_cjs.Transaction.fromPSBT(base.base64.decode(event.unsignedCommitmentTx));
19267
19258
  validateVtxoTxGraph(vtxoTree, commitmentTx, sweepTapTreeRoot);
19268
19259
  if (recipients && recipients.length > 0) {
19269
19260
  validateBatchRecipients(commitmentTx, vtxoTree.leaves(), recipients, network);
@@ -19294,7 +19285,7 @@ function createArkadeBatchHandler(intentId, inputs, signer, signedProof, message
19294
19285
  if (connectorTree) {
19295
19286
  validateConnectorsTxGraph(event.commitmentTx, connectorTree);
19296
19287
  }
19297
- let commitmentPsbt = chunkQDXQULVM_cjs.Transaction.fromPSBT(base.base64.decode(event.commitmentTx));
19288
+ let commitmentPsbt = chunkSIAVTHMZ_cjs.Transaction.fromPSBT(base.base64.decode(event.commitmentTx));
19298
19289
  const signedForfeits = [];
19299
19290
  let connectorIndex = 0;
19300
19291
  const connectorLeaves = connectorTree?.leaves() || [];
@@ -19702,12 +19693,12 @@ var ArkadeTransactionBuilder = class {
19702
19693
  this.contract.client.checkpoint
19703
19694
  );
19704
19695
  if (coin.sourceTx) {
19705
- chunkQDXQULVM_cjs.setArkPsbtField(arkTx, 0, chunkQDXQULVM_cjs.PrevArkTxField, coin.sourceTx);
19696
+ chunkSIAVTHMZ_cjs.setArkPsbtField(arkTx, 0, chunkSIAVTHMZ_cjs.PrevArkTxField, coin.sourceTx);
19706
19697
  }
19707
19698
  const condition = (def.tapscript.witness ?? []).map((w) => this.witnessBytes(w));
19708
19699
  if (condition.length > 0) {
19709
- chunkQDXQULVM_cjs.setArkPsbtField(arkTx, 0, chunkQDXQULVM_cjs.ConditionWitness, condition);
19710
- chunkQDXQULVM_cjs.setArkPsbtField(checkpoints[0], 0, chunkQDXQULVM_cjs.ConditionWitness, condition);
19700
+ chunkSIAVTHMZ_cjs.setArkPsbtField(arkTx, 0, chunkSIAVTHMZ_cjs.ConditionWitness, condition);
19701
+ chunkSIAVTHMZ_cjs.setArkPsbtField(checkpoints[0], 0, chunkSIAVTHMZ_cjs.ConditionWitness, condition);
19711
19702
  }
19712
19703
  const packets = [];
19713
19704
  if (this.assetSpecs.length > 0) {
@@ -19746,7 +19737,7 @@ var ArkadeTransactionBuilder = class {
19746
19737
  base.base64.encode(signedArk2.toPSBT()),
19747
19738
  signedCps.map((c) => base.base64.encode(c.toPSBT()))
19748
19739
  );
19749
- const txid = chunkQDXQULVM_cjs.Transaction.fromPSBT(base.base64.decode(res2.signedArkTx)).id;
19740
+ const txid = chunkSIAVTHMZ_cjs.Transaction.fromPSBT(base.base64.decode(res2.signedArkTx)).id;
19750
19741
  return {
19751
19742
  txid,
19752
19743
  signedArkTx: res2.signedArkTx,
@@ -19764,7 +19755,7 @@ var ArkadeTransactionBuilder = class {
19764
19755
  const finalCps = await Promise.all(
19765
19756
  res.signedCheckpointTxs.map(
19766
19757
  async (b) => base.base64.encode(
19767
- (await client.identity.sign(chunkQDXQULVM_cjs.Transaction.fromPSBT(base.base64.decode(b)), [0])).toPSBT()
19758
+ (await client.identity.sign(chunkSIAVTHMZ_cjs.Transaction.fromPSBT(base.base64.decode(b)), [0])).toPSBT()
19768
19759
  )
19769
19760
  )
19770
19761
  );
@@ -19805,16 +19796,16 @@ var ArkadeTransactionBuilder = class {
19805
19796
  }
19806
19797
  buildAssetPacket() {
19807
19798
  const groups = this.assetSpecs.map((s) => {
19808
- const id = typeof s.assetId === "string" ? chunkQDXQULVM_cjs.AssetId.fromString(s.assetId) : chunkQDXQULVM_cjs.AssetId.fromBytes(s.assetId);
19809
- return chunkQDXQULVM_cjs.AssetGroup.create(
19799
+ const id = typeof s.assetId === "string" ? chunkSIAVTHMZ_cjs.AssetId.fromString(s.assetId) : chunkSIAVTHMZ_cjs.AssetId.fromBytes(s.assetId);
19800
+ return chunkSIAVTHMZ_cjs.AssetGroup.create(
19810
19801
  id,
19811
19802
  null,
19812
- s.inputs.map((i) => chunkQDXQULVM_cjs.AssetInput.create(i.vin, i.amount)),
19813
- s.outputs.map((o) => chunkQDXQULVM_cjs.AssetOutput.create(o.vout, o.amount)),
19814
- (s.metadata ?? []).map((m) => chunkQDXQULVM_cjs.Metadata.create(m.key, m.value))
19803
+ s.inputs.map((i) => chunkSIAVTHMZ_cjs.AssetInput.create(i.vin, i.amount)),
19804
+ s.outputs.map((o) => chunkSIAVTHMZ_cjs.AssetOutput.create(o.vout, o.amount)),
19805
+ (s.metadata ?? []).map((m) => chunkSIAVTHMZ_cjs.Metadata.create(m.key, m.value))
19815
19806
  );
19816
19807
  });
19817
- return chunkQDXQULVM_cjs.Packet.create(groups);
19808
+ return chunkSIAVTHMZ_cjs.Packet.create(groups);
19818
19809
  }
19819
19810
  witnessBytes(ref) {
19820
19811
  return chunkLJQ2VQBE_cjs.witnessRefToBytes(ref, this.args, this.contract.args);
@@ -20037,5 +20028,5 @@ exports.validateVtxoTxGraph = validateVtxoTxGraph;
20037
20028
  exports.verifyTapscriptSignatures = verifyTapscriptSignatures;
20038
20029
  exports.waitForIncomingFunds = waitForIncomingFunds;
20039
20030
  exports.warnAndFilterVtxosForScript = warnAndFilterVtxosForScript;
20040
- //# sourceMappingURL=chunk-2LAJ3RTH.cjs.map
20041
- //# sourceMappingURL=chunk-2LAJ3RTH.cjs.map
20031
+ //# sourceMappingURL=chunk-6BQTROB4.cjs.map
20032
+ //# sourceMappingURL=chunk-6BQTROB4.cjs.map