@arkade-os/sdk 0.4.60 → 0.4.62

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 (77) hide show
  1. package/dist/adapters/expo.cjs +5 -5
  2. package/dist/adapters/expo.d.cts +4 -4
  3. package/dist/adapters/expo.d.ts +4 -4
  4. package/dist/adapters/expo.js +3 -3
  5. package/dist/adapters/indexedDB.cjs +5 -5
  6. package/dist/adapters/indexedDB.js +4 -4
  7. package/dist/{asyncStorageTaskQueue-CqijAAPG.d.cts → asyncStorageTaskQueue-B53mOTCw.d.cts} +2 -2
  8. package/dist/{asyncStorageTaskQueue-Vsp6uk8e.d.ts → asyncStorageTaskQueue-Df-CTfTE.d.ts} +2 -2
  9. package/dist/{chunk-Y54MUBT7.js → chunk-2IZW6AEK.js} +879 -146
  10. package/dist/chunk-2IZW6AEK.js.map +1 -0
  11. package/dist/{chunk-MZNLCMUP.cjs → chunk-G53HASDV.cjs} +113 -79
  12. package/dist/chunk-G53HASDV.cjs.map +1 -0
  13. package/dist/{chunk-3Q7BBUWO.js → chunk-H2ZAJOQA.js} +4 -4
  14. package/dist/{chunk-3Q7BBUWO.js.map → chunk-H2ZAJOQA.js.map} +1 -1
  15. package/dist/{chunk-PRFL62ID.cjs → chunk-I6EDUE75.cjs} +17 -17
  16. package/dist/{chunk-PRFL62ID.cjs.map → chunk-I6EDUE75.cjs.map} +1 -1
  17. package/dist/{chunk-B66RYHTB.js → chunk-I7RLG6VX.js} +4 -4
  18. package/dist/{chunk-B66RYHTB.js.map → chunk-I7RLG6VX.js.map} +1 -1
  19. package/dist/{chunk-2DINXHGQ.js → chunk-L7S5KC5B.js} +66 -35
  20. package/dist/chunk-L7S5KC5B.js.map +1 -0
  21. package/dist/{chunk-4A4GRSTB.cjs → chunk-OH2XLTXE.cjs} +3 -3
  22. package/dist/{chunk-4A4GRSTB.cjs.map → chunk-OH2XLTXE.cjs.map} +1 -1
  23. package/dist/{chunk-2XLNQHG4.cjs → chunk-PWWA4DBL.cjs} +10 -10
  24. package/dist/{chunk-2XLNQHG4.cjs.map → chunk-PWWA4DBL.cjs.map} +1 -1
  25. package/dist/{chunk-H7JCHFM6.cjs → chunk-QRSR4HV4.cjs} +17 -17
  26. package/dist/{chunk-H7JCHFM6.cjs.map → chunk-QRSR4HV4.cjs.map} +1 -1
  27. package/dist/{chunk-FSKANUV4.js → chunk-RMBI6P4N.js} +3 -3
  28. package/dist/{chunk-FSKANUV4.js.map → chunk-RMBI6P4N.js.map} +1 -1
  29. package/dist/{chunk-JBULXTCC.js → chunk-URT2RVGB.js} +3 -3
  30. package/dist/{chunk-JBULXTCC.js.map → chunk-URT2RVGB.js.map} +1 -1
  31. package/dist/{chunk-KNS5MTTI.cjs → chunk-Z2OZMKFV.cjs} +1272 -523
  32. package/dist/chunk-Z2OZMKFV.cjs.map +1 -0
  33. package/dist/contracts/handlers/index.cjs +9 -9
  34. package/dist/contracts/handlers/index.d.cts +5 -5
  35. package/dist/contracts/handlers/index.d.ts +5 -5
  36. package/dist/contracts/handlers/index.js +2 -2
  37. package/dist/{delegate-DNEuM_nK.d.cts → delegate-BjYJJsml.d.ts} +1 -1
  38. package/dist/{delegate-DidNTsKm.d.ts → delegate-CC1gcvuC.d.cts} +1 -1
  39. package/dist/{index-BP8-zniX.d.cts → index-C888wFEV.d.ts} +102 -102
  40. package/dist/{ark-D2_yNhfz.d.cts → index-CwBr7qzV.d.cts} +3941 -3812
  41. package/dist/{ark-D2_yNhfz.d.ts → index-CwBr7qzV.d.ts} +3941 -3812
  42. package/dist/{index-DzQbNQUG.d.ts → index-Cz5_WaQP.d.cts} +102 -102
  43. package/dist/index.cjs +328 -248
  44. package/dist/index.d.cts +340 -52
  45. package/dist/index.d.ts +340 -52
  46. package/dist/index.js +4 -4
  47. package/dist/repositories/realm/index.cjs +19 -19
  48. package/dist/repositories/realm/index.d.cts +4 -4
  49. package/dist/repositories/realm/index.d.ts +4 -4
  50. package/dist/repositories/realm/index.js +5 -5
  51. package/dist/repositories/sqlite/index.cjs +18 -18
  52. package/dist/repositories/sqlite/index.d.cts +4 -4
  53. package/dist/repositories/sqlite/index.d.ts +4 -4
  54. package/dist/repositories/sqlite/index.js +5 -5
  55. package/dist/{taskRunner-9gnlYEpb.d.ts → taskRunner-BMUndClz.d.cts} +2 -2
  56. package/dist/{taskRunner-BEQNFEa4.d.cts → taskRunner-DZWUsSzA.d.ts} +2 -2
  57. package/dist/wallet/expo/background.cjs +14 -14
  58. package/dist/wallet/expo/background.d.cts +5 -5
  59. package/dist/wallet/expo/background.d.ts +5 -5
  60. package/dist/wallet/expo/background.js +6 -6
  61. package/dist/wallet/expo/index.cjs +36 -16
  62. package/dist/wallet/expo/index.cjs.map +1 -1
  63. package/dist/wallet/expo/index.d.cts +13 -6
  64. package/dist/wallet/expo/index.d.ts +13 -6
  65. package/dist/wallet/expo/index.js +27 -7
  66. package/dist/wallet/expo/index.js.map +1 -1
  67. package/dist/{wallet-ipUA1XCp.d.cts → wallet-Dpjx6CJ7.d.ts} +91 -17
  68. package/dist/{wallet-C_MYHyOj.d.ts → wallet-H3f14est.d.cts} +91 -17
  69. package/dist/worker/expo/index.cjs +9 -9
  70. package/dist/worker/expo/index.d.cts +6 -6
  71. package/dist/worker/expo/index.d.ts +6 -6
  72. package/dist/worker/expo/index.js +5 -5
  73. package/package.json +1 -1
  74. package/dist/chunk-2DINXHGQ.js.map +0 -1
  75. package/dist/chunk-KNS5MTTI.cjs.map +0 -1
  76. package/dist/chunk-MZNLCMUP.cjs.map +0 -1
  77. package/dist/chunk-Y54MUBT7.js.map +0 -1
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkKNS5MTTI_cjs = require('../../chunk-KNS5MTTI.cjs');
4
- require('../../chunk-PRFL62ID.cjs');
5
- require('../../chunk-MZNLCMUP.cjs');
6
- require('../../chunk-4A4GRSTB.cjs');
3
+ var chunkZ2OZMKFV_cjs = require('../../chunk-Z2OZMKFV.cjs');
4
+ require('../../chunk-I6EDUE75.cjs');
5
+ require('../../chunk-G53HASDV.cjs');
6
+ require('../../chunk-OH2XLTXE.cjs');
7
7
  require('../../chunk-5BLDMQED.cjs');
8
8
 
9
9
  // src/repositories/realm/walletRepository.ts
@@ -38,7 +38,7 @@ var RealmWalletRepository = class {
38
38
  await this.ensureInit();
39
39
  this.realm.write(() => {
40
40
  for (const vtxo of vtxos) {
41
- const s = chunkKNS5MTTI_cjs.serializeVtxo(vtxo);
41
+ const s = chunkZ2OZMKFV_cjs.serializeVtxo(vtxo);
42
42
  this.realm.create(
43
43
  "ArkVtxo",
44
44
  {
@@ -86,7 +86,7 @@ var RealmWalletRepository = class {
86
86
  throw new Error("RealmWalletRepository requires an address");
87
87
  }
88
88
  for (const vtxo of vtxos) {
89
- if (!chunkKNS5MTTI_cjs.isVtxoForScript(vtxo, key.script)) {
89
+ if (!chunkZ2OZMKFV_cjs.isVtxoForScript(vtxo, key.script)) {
90
90
  throw new Error(
91
91
  `VTXO ${vtxo.txid}:${vtxo.vout} script mismatch: expected ${key.script}, got ${vtxo.script}`
92
92
  );
@@ -111,7 +111,7 @@ var RealmWalletRepository = class {
111
111
  await this.ensureInit();
112
112
  this.realm.write(() => {
113
113
  for (const utxo of utxos) {
114
- const s = chunkKNS5MTTI_cjs.serializeUtxo(utxo);
114
+ const s = chunkZ2OZMKFV_cjs.serializeUtxo(utxo);
115
115
  this.realm.create(
116
116
  "ArkUtxo",
117
117
  {
@@ -164,7 +164,7 @@ var RealmWalletRepository = class {
164
164
  amount: tx.amount,
165
165
  settled: tx.settled,
166
166
  createdAt: tx.createdAt,
167
- assetsJson: tx.assets ? JSON.stringify(chunkKNS5MTTI_cjs.serializeAssets(tx.assets)) : null
167
+ assetsJson: tx.assets ? JSON.stringify(chunkZ2OZMKFV_cjs.serializeAssets(tx.assets)) : null
168
168
  },
169
169
  "modified"
170
170
  );
@@ -234,9 +234,9 @@ function vtxoObjectToDomain(obj) {
234
234
  // Post-migration every row has `script`, but the backfill is
235
235
  // idempotent: derive from `address` if the legacy column is still
236
236
  // null (e.g. the migration hasn't run yet on this handle).
237
- script: obj.script ?? chunkKNS5MTTI_cjs.scriptFromArkAddress(obj.address)
237
+ script: obj.script ?? chunkZ2OZMKFV_cjs.scriptFromArkAddress(obj.address)
238
238
  };
239
- return chunkKNS5MTTI_cjs.deserializeVtxo(serialized);
239
+ return chunkZ2OZMKFV_cjs.deserializeVtxo(serialized);
240
240
  }
241
241
  function utxoObjectToDomain(obj) {
242
242
  const serialized = {
@@ -255,7 +255,7 @@ function utxoObjectToDomain(obj) {
255
255
  status: JSON.parse(obj.statusJson),
256
256
  extraWitness: obj.extraWitnessJson ? JSON.parse(obj.extraWitnessJson) : void 0
257
257
  };
258
- return chunkKNS5MTTI_cjs.deserializeUtxo(serialized);
258
+ return chunkZ2OZMKFV_cjs.deserializeUtxo(serialized);
259
259
  }
260
260
  function txObjectToDomain(obj) {
261
261
  const tx = {
@@ -270,7 +270,7 @@ function txObjectToDomain(obj) {
270
270
  createdAt: obj.createdAt
271
271
  };
272
272
  if (obj.assetsJson) {
273
- tx.assets = chunkKNS5MTTI_cjs.deserializeAssets(JSON.parse(obj.assetsJson));
273
+ tx.assets = chunkZ2OZMKFV_cjs.deserializeAssets(JSON.parse(obj.assetsJson));
274
274
  }
275
275
  return tx;
276
276
  }
@@ -450,7 +450,7 @@ var RealmIntentRepository = class {
450
450
  const clashes = [
451
451
  ...this.realm.objects("ArkIntent").filtered("intentId == $0", intent.intentId)
452
452
  ].map(toIntent);
453
- chunkKNS5MTTI_cjs.assertIntentIdUnique(intent, clashes);
453
+ chunkZ2OZMKFV_cjs.assertIntentIdUnique(intent, clashes);
454
454
  }
455
455
  this.realm.create(
456
456
  "ArkIntent",
@@ -479,14 +479,14 @@ var RealmIntentRepository = class {
479
479
  }
480
480
  async getIntents(filter) {
481
481
  const all = [...this.realm.objects("ArkIntent")].map(toIntent).sort((a, b) => a.createdAt - b.createdAt || a.intentTxId.localeCompare(b.intentTxId));
482
- const out = filter ? all.filter((i) => chunkKNS5MTTI_cjs.intentMatchesFilter(i, filter)) : all;
483
- const { skip, end } = chunkKNS5MTTI_cjs.intentPageBounds(filter, out.length);
482
+ const out = filter ? all.filter((i) => chunkZ2OZMKFV_cjs.intentMatchesFilter(i, filter)) : all;
483
+ const { skip, end } = chunkZ2OZMKFV_cjs.intentPageBounds(filter, out.length);
484
484
  return out.slice(skip, end);
485
485
  }
486
486
  async getLockedVtxoOutpoints() {
487
487
  const out = [];
488
488
  for (const o of [...this.realm.objects("ArkIntent")].map(toIntent))
489
- if (!chunkKNS5MTTI_cjs.isTerminalIntentState(o.state)) out.push(...o.intentVtxos);
489
+ if (!chunkZ2OZMKFV_cjs.isTerminalIntentState(o.state)) out.push(...o.intentVtxos);
490
490
  return out;
491
491
  }
492
492
  async [Symbol.asyncDispose]() {
@@ -528,7 +528,7 @@ var RealmVirtualTxRepository = class {
528
528
  txid: t.txid,
529
529
  psbt: t.psbt ?? prev?.psbt ?? null,
530
530
  expiresAt: t.expiresAt ?? prev?.expiresAt ?? null,
531
- type: chunkKNS5MTTI_cjs.mergeChainedTxType(t.type, prev?.type)
531
+ type: chunkZ2OZMKFV_cjs.mergeChainedTxType(t.type, prev?.type)
532
532
  },
533
533
  "modified"
534
534
  );
@@ -762,7 +762,7 @@ function runArkRealmMigrations(oldRealm, newRealm) {
762
762
  for (let i = 0; i < newVtxos.length; i++) {
763
763
  const newVtxo = newVtxos[i];
764
764
  if (!newVtxo.script) {
765
- newVtxo.script = chunkKNS5MTTI_cjs.scriptFromArkAddress(newVtxo.address);
765
+ newVtxo.script = chunkZ2OZMKFV_cjs.scriptFromArkAddress(newVtxo.address);
766
766
  }
767
767
  }
768
768
  const oldHasVirtualTx = Array.isArray(oldRealm?.schema) && oldRealm.schema.some((s) => s.name === "ArkVirtualTx");
@@ -779,7 +779,7 @@ function runArkRealmMigrations(oldRealm, newRealm) {
779
779
 
780
780
  Object.defineProperty(exports, "ChainedTxType", {
781
781
  enumerable: true,
782
- get: function () { return chunkKNS5MTTI_cjs.ChainedTxType; }
782
+ get: function () { return chunkZ2OZMKFV_cjs.ChainedTxType; }
783
783
  });
784
784
  exports.ARK_REALM_SCHEMA_VERSION = ARK_REALM_SCHEMA_VERSION;
785
785
  exports.ArkExperimentalRealmSchemas = ArkExperimentalRealmSchemas;
@@ -1,9 +1,9 @@
1
- import { W as WalletRepository, t as ExtendedVirtualCoin, u as VtxoRepositoryKey, E as ExtendedCoin, A as ArkTransaction, v as WalletState, C as ContractRepository, w as ContractFilter, s as Contract, x as IntentRepository, y as ArkIntent, z as IntentFilter, O as Outpoint, B as VirtualTxRepository, D as VirtualTx, F as VtxoBranch } from '../../ark-D2_yNhfz.cjs';
2
- export { H as ChainedTxType } from '../../ark-D2_yNhfz.cjs';
3
- import '@scure/btc-signer/transaction.js';
1
+ import { W as WalletRepository, u as ExtendedVirtualCoin, v as VtxoRepositoryKey, E as ExtendedCoin, A as ArkTransaction, w as WalletState, C as ContractRepository, x as ContractFilter, t as Contract, y as IntentRepository, z as ArkIntent, B as IntentFilter, O as Outpoint, D as VirtualTxRepository, F as VirtualTx, H as VtxoBranch } from '../../index-CwBr7qzV.cjs';
2
+ export { J as ChainedTxType } from '../../index-CwBr7qzV.cjs';
4
3
  import '@scure/btc-signer/utils.js';
5
- import '@scure/btc-signer/psbt.js';
4
+ import '@scure/btc-signer/transaction.js';
6
5
  import '@scure/btc-signer';
6
+ import '@scure/btc-signer/psbt.js';
7
7
 
8
8
  /**
9
9
  * Minimal interface for the subset of the Realm API used by the
@@ -1,9 +1,9 @@
1
- import { W as WalletRepository, t as ExtendedVirtualCoin, u as VtxoRepositoryKey, E as ExtendedCoin, A as ArkTransaction, v as WalletState, C as ContractRepository, w as ContractFilter, s as Contract, x as IntentRepository, y as ArkIntent, z as IntentFilter, O as Outpoint, B as VirtualTxRepository, D as VirtualTx, F as VtxoBranch } from '../../ark-D2_yNhfz.js';
2
- export { H as ChainedTxType } from '../../ark-D2_yNhfz.js';
3
- import '@scure/btc-signer/transaction.js';
1
+ import { W as WalletRepository, u as ExtendedVirtualCoin, v as VtxoRepositoryKey, E as ExtendedCoin, A as ArkTransaction, w as WalletState, C as ContractRepository, x as ContractFilter, t as Contract, y as IntentRepository, z as ArkIntent, B as IntentFilter, O as Outpoint, D as VirtualTxRepository, F as VirtualTx, H as VtxoBranch } from '../../index-CwBr7qzV.js';
2
+ export { J as ChainedTxType } from '../../index-CwBr7qzV.js';
4
3
  import '@scure/btc-signer/utils.js';
5
- import '@scure/btc-signer/psbt.js';
4
+ import '@scure/btc-signer/transaction.js';
6
5
  import '@scure/btc-signer';
6
+ import '@scure/btc-signer/psbt.js';
7
7
 
8
8
  /**
9
9
  * Minimal interface for the subset of the Realm API used by the
@@ -1,8 +1,8 @@
1
- import { serializeVtxo, isVtxoForScript, serializeUtxo, serializeAssets, scriptFromArkAddress, deserializeVtxo, deserializeUtxo, deserializeAssets, assertIntentIdUnique, intentMatchesFilter, intentPageBounds, isTerminalIntentState, mergeChainedTxType } from '../../chunk-Y54MUBT7.js';
2
- export { ChainedTxType } from '../../chunk-Y54MUBT7.js';
3
- import '../../chunk-FSKANUV4.js';
4
- import '../../chunk-2DINXHGQ.js';
5
- import '../../chunk-JBULXTCC.js';
1
+ import { serializeVtxo, isVtxoForScript, serializeUtxo, serializeAssets, scriptFromArkAddress, deserializeVtxo, deserializeUtxo, deserializeAssets, assertIntentIdUnique, intentMatchesFilter, intentPageBounds, isTerminalIntentState, mergeChainedTxType } from '../../chunk-2IZW6AEK.js';
2
+ export { ChainedTxType } from '../../chunk-2IZW6AEK.js';
3
+ import '../../chunk-RMBI6P4N.js';
4
+ import '../../chunk-L7S5KC5B.js';
5
+ import '../../chunk-URT2RVGB.js';
6
6
  import '../../chunk-NSBPE2FW.js';
7
7
 
8
8
  // src/repositories/realm/walletRepository.ts
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkKNS5MTTI_cjs = require('../../chunk-KNS5MTTI.cjs');
4
- require('../../chunk-PRFL62ID.cjs');
5
- require('../../chunk-MZNLCMUP.cjs');
6
- require('../../chunk-4A4GRSTB.cjs');
3
+ var chunkZ2OZMKFV_cjs = require('../../chunk-Z2OZMKFV.cjs');
4
+ require('../../chunk-I6EDUE75.cjs');
5
+ require('../../chunk-G53HASDV.cjs');
6
+ require('../../chunk-OH2XLTXE.cjs');
7
7
  require('../../chunk-5BLDMQED.cjs');
8
8
 
9
9
  // src/repositories/sqlite/transaction.ts
@@ -154,7 +154,7 @@ var SQLiteWalletRepository = class {
154
154
  for (const row of nullRows) {
155
155
  await this.db.run(
156
156
  `UPDATE ${this.tables.vtxos} SET script = ? WHERE txid = ? AND vout = ?`,
157
- [chunkKNS5MTTI_cjs.scriptFromArkAddress(row.address), row.txid, row.vout]
157
+ [chunkZ2OZMKFV_cjs.scriptFromArkAddress(row.address), row.txid, row.vout]
158
158
  );
159
159
  }
160
160
  const tempName = `${this.tables.vtxos}__migrate_tmp`;
@@ -225,7 +225,7 @@ var SQLiteWalletRepository = class {
225
225
  async saveVtxos(address, vtxos) {
226
226
  await this.ensureInit();
227
227
  for (const vtxo of vtxos) {
228
- const s = chunkKNS5MTTI_cjs.serializeVtxo(vtxo);
228
+ const s = chunkZ2OZMKFV_cjs.serializeVtxo(vtxo);
229
229
  await this.db.run(
230
230
  `INSERT OR REPLACE INTO ${this.tables.vtxos}
231
231
  (txid, vout, value, address,
@@ -280,7 +280,7 @@ var SQLiteWalletRepository = class {
280
280
  throw new Error("SQLiteWalletRepository requires an address");
281
281
  }
282
282
  for (const vtxo of vtxos) {
283
- if (!chunkKNS5MTTI_cjs.isVtxoForScript(vtxo, key.script)) {
283
+ if (!chunkZ2OZMKFV_cjs.isVtxoForScript(vtxo, key.script)) {
284
284
  throw new Error(
285
285
  `VTXO ${vtxo.txid}:${vtxo.vout} script mismatch: expected ${key.script}, got ${vtxo.script}`
286
286
  );
@@ -304,7 +304,7 @@ var SQLiteWalletRepository = class {
304
304
  async saveUtxos(address, utxos) {
305
305
  await this.ensureInit();
306
306
  for (const utxo of utxos) {
307
- const s = chunkKNS5MTTI_cjs.serializeUtxo(utxo);
307
+ const s = chunkZ2OZMKFV_cjs.serializeUtxo(utxo);
308
308
  await this.db.run(
309
309
  `INSERT OR REPLACE INTO ${this.tables.utxos}
310
310
  (txid, vout, value, address,
@@ -360,7 +360,7 @@ var SQLiteWalletRepository = class {
360
360
  tx.amount,
361
361
  tx.settled ? 1 : 0,
362
362
  tx.createdAt,
363
- tx.assets ? JSON.stringify(chunkKNS5MTTI_cjs.serializeAssets(tx.assets)) : null
363
+ tx.assets ? JSON.stringify(chunkZ2OZMKFV_cjs.serializeAssets(tx.assets)) : null
364
364
  ]
365
365
  );
366
366
  }
@@ -434,9 +434,9 @@ function vtxoRowToDomain(row) {
434
434
  // Post-migration every row has `script`, but the backfill is
435
435
  // idempotent: derive from `address` if the legacy column is still
436
436
  // null (e.g. the migration hasn't run yet on this handle).
437
- script: row.script ?? chunkKNS5MTTI_cjs.scriptFromArkAddress(row.address)
437
+ script: row.script ?? chunkZ2OZMKFV_cjs.scriptFromArkAddress(row.address)
438
438
  };
439
- return chunkKNS5MTTI_cjs.deserializeVtxo(serialized);
439
+ return chunkZ2OZMKFV_cjs.deserializeVtxo(serialized);
440
440
  }
441
441
  function utxoRowToDomain(row) {
442
442
  const serialized = {
@@ -455,7 +455,7 @@ function utxoRowToDomain(row) {
455
455
  status: JSON.parse(row.status_json),
456
456
  extraWitness: row.extra_witness_json ? JSON.parse(row.extra_witness_json) : void 0
457
457
  };
458
- return chunkKNS5MTTI_cjs.deserializeUtxo(serialized);
458
+ return chunkZ2OZMKFV_cjs.deserializeUtxo(serialized);
459
459
  }
460
460
  function txRowToDomain(row) {
461
461
  const tx = {
@@ -470,7 +470,7 @@ function txRowToDomain(row) {
470
470
  createdAt: row.created_at
471
471
  };
472
472
  if (row.assets_json) {
473
- tx.assets = chunkKNS5MTTI_cjs.deserializeAssets(JSON.parse(row.assets_json));
473
+ tx.assets = chunkZ2OZMKFV_cjs.deserializeAssets(JSON.parse(row.assets_json));
474
474
  }
475
475
  return tx;
476
476
  }
@@ -743,8 +743,8 @@ var SQLiteIntentRepository = class {
743
743
  `SELECT * FROM ${this.t} ORDER BY created_at ASC, intent_tx_id ASC`
744
744
  );
745
745
  let out = rows.map(rowToIntent);
746
- if (filter) out = out.filter((i) => chunkKNS5MTTI_cjs.intentMatchesFilter(i, filter));
747
- const { skip, end } = chunkKNS5MTTI_cjs.intentPageBounds(filter, out.length);
746
+ if (filter) out = out.filter((i) => chunkZ2OZMKFV_cjs.intentMatchesFilter(i, filter));
747
+ const { skip, end } = chunkZ2OZMKFV_cjs.intentPageBounds(filter, out.length);
748
748
  return out.slice(skip, end);
749
749
  }
750
750
  async getLockedVtxoOutpoints() {
@@ -752,7 +752,7 @@ var SQLiteIntentRepository = class {
752
752
  const rows = await this.db.all(`SELECT * FROM ${this.t}`);
753
753
  const out = [];
754
754
  for (const r of rows) {
755
- if (chunkKNS5MTTI_cjs.isTerminalIntentState(r.state)) continue;
755
+ if (chunkZ2OZMKFV_cjs.isTerminalIntentState(r.state)) continue;
756
756
  for (const o of JSON.parse(r.intent_vtxos_json)) out.push(o);
757
757
  }
758
758
  return out;
@@ -847,7 +847,7 @@ var SQLiteVirtualTxRepository = class {
847
847
  const prev = prevByTxid.get(t.txid);
848
848
  const psbt = t.psbt ?? prev?.psbt ?? null;
849
849
  const expires = t.expiresAt ?? prev?.expires_at ?? null;
850
- const type = chunkKNS5MTTI_cjs.mergeChainedTxType(t.type, prev?.type);
850
+ const type = chunkZ2OZMKFV_cjs.mergeChainedTxType(t.type, prev?.type);
851
851
  await this.db.run(
852
852
  `INSERT OR REPLACE INTO ${this.tTx} (txid, psbt, expires_at, type) VALUES (?, ?, ?, ?)`,
853
853
  [t.txid, psbt, expires, type]
@@ -933,7 +933,7 @@ function rowToTx(r) {
933
933
 
934
934
  Object.defineProperty(exports, "ChainedTxType", {
935
935
  enumerable: true,
936
- get: function () { return chunkKNS5MTTI_cjs.ChainedTxType; }
936
+ get: function () { return chunkZ2OZMKFV_cjs.ChainedTxType; }
937
937
  });
938
938
  exports.SQLiteContractRepository = SQLiteContractRepository;
939
939
  exports.SQLiteIntentRepository = SQLiteIntentRepository;
@@ -1,9 +1,9 @@
1
- import { W as WalletRepository, t as ExtendedVirtualCoin, u as VtxoRepositoryKey, E as ExtendedCoin, A as ArkTransaction, v as WalletState, C as ContractRepository, w as ContractFilter, s as Contract, x as IntentRepository, y as ArkIntent, z as IntentFilter, O as Outpoint, B as VirtualTxRepository, D as VirtualTx, F as VtxoBranch } from '../../ark-D2_yNhfz.cjs';
2
- export { H as ChainedTxType } from '../../ark-D2_yNhfz.cjs';
3
- import '@scure/btc-signer/transaction.js';
1
+ import { W as WalletRepository, u as ExtendedVirtualCoin, v as VtxoRepositoryKey, E as ExtendedCoin, A as ArkTransaction, w as WalletState, C as ContractRepository, x as ContractFilter, t as Contract, y as IntentRepository, z as ArkIntent, B as IntentFilter, O as Outpoint, D as VirtualTxRepository, F as VirtualTx, H as VtxoBranch } from '../../index-CwBr7qzV.cjs';
2
+ export { J as ChainedTxType } from '../../index-CwBr7qzV.cjs';
4
3
  import '@scure/btc-signer/utils.js';
5
- import '@scure/btc-signer/psbt.js';
4
+ import '@scure/btc-signer/transaction.js';
6
5
  import '@scure/btc-signer';
6
+ import '@scure/btc-signer/psbt.js';
7
7
 
8
8
  /**
9
9
  * Minimal SQL execution interface that consumers implement
@@ -1,9 +1,9 @@
1
- import { W as WalletRepository, t as ExtendedVirtualCoin, u as VtxoRepositoryKey, E as ExtendedCoin, A as ArkTransaction, v as WalletState, C as ContractRepository, w as ContractFilter, s as Contract, x as IntentRepository, y as ArkIntent, z as IntentFilter, O as Outpoint, B as VirtualTxRepository, D as VirtualTx, F as VtxoBranch } from '../../ark-D2_yNhfz.js';
2
- export { H as ChainedTxType } from '../../ark-D2_yNhfz.js';
3
- import '@scure/btc-signer/transaction.js';
1
+ import { W as WalletRepository, u as ExtendedVirtualCoin, v as VtxoRepositoryKey, E as ExtendedCoin, A as ArkTransaction, w as WalletState, C as ContractRepository, x as ContractFilter, t as Contract, y as IntentRepository, z as ArkIntent, B as IntentFilter, O as Outpoint, D as VirtualTxRepository, F as VirtualTx, H as VtxoBranch } from '../../index-CwBr7qzV.js';
2
+ export { J as ChainedTxType } from '../../index-CwBr7qzV.js';
4
3
  import '@scure/btc-signer/utils.js';
5
- import '@scure/btc-signer/psbt.js';
4
+ import '@scure/btc-signer/transaction.js';
6
5
  import '@scure/btc-signer';
6
+ import '@scure/btc-signer/psbt.js';
7
7
 
8
8
  /**
9
9
  * Minimal SQL execution interface that consumers implement
@@ -1,8 +1,8 @@
1
- import { serializeVtxo, isVtxoForScript, serializeUtxo, serializeAssets, scriptFromArkAddress, deserializeVtxo, deserializeUtxo, deserializeAssets, intentMatchesFilter, intentPageBounds, isTerminalIntentState, mergeChainedTxType } from '../../chunk-Y54MUBT7.js';
2
- export { ChainedTxType } from '../../chunk-Y54MUBT7.js';
3
- import '../../chunk-FSKANUV4.js';
4
- import '../../chunk-2DINXHGQ.js';
5
- import '../../chunk-JBULXTCC.js';
1
+ import { serializeVtxo, isVtxoForScript, serializeUtxo, serializeAssets, scriptFromArkAddress, deserializeVtxo, deserializeUtxo, deserializeAssets, intentMatchesFilter, intentPageBounds, isTerminalIntentState, mergeChainedTxType } from '../../chunk-2IZW6AEK.js';
2
+ export { ChainedTxType } from '../../chunk-2IZW6AEK.js';
3
+ import '../../chunk-RMBI6P4N.js';
4
+ import '../../chunk-L7S5KC5B.js';
5
+ import '../../chunk-URT2RVGB.js';
6
6
  import '../../chunk-NSBPE2FW.js';
7
7
 
8
8
  // src/repositories/sqlite/transaction.ts
@@ -1,4 +1,4 @@
1
- import { W as WalletRepository, C as ContractRepository, o as IndexerProvider, n as ArkProvider, r as VirtualCoin, s as Contract, t as ExtendedVirtualCoin } from './ark-D2_yNhfz.js';
1
+ import { W as WalletRepository, C as ContractRepository, p as IndexerProvider, o as ArkProvider, s as VirtualCoin, t as Contract, u as ExtendedVirtualCoin } from './index-CwBr7qzV.cjs';
2
2
 
3
3
  /**
4
4
  * A task item represents a unit of work in the inbox.
@@ -111,4 +111,4 @@ interface CreateTaskDependenciesOptions {
111
111
  */
112
112
  declare function createTaskDependencies(options: CreateTaskDependenciesOptions): TaskDependencies;
113
113
 
114
- export { type CreateTaskDependenciesOptions as C, InMemoryTaskQueue as I, type TaskProcessor as T, type TaskDependencies as a, type TaskItem as b, type TaskQueue as c, type TaskResult as d, createTaskDependencies as e, runTasks as r };
114
+ export { type CreateTaskDependenciesOptions as C, InMemoryTaskQueue as I, type TaskProcessor as T, type TaskQueue as a, type TaskDependencies as b, type TaskItem as c, type TaskResult as d, createTaskDependencies as e, runTasks as r };
@@ -1,4 +1,4 @@
1
- import { W as WalletRepository, C as ContractRepository, o as IndexerProvider, n as ArkProvider, r as VirtualCoin, s as Contract, t as ExtendedVirtualCoin } from './ark-D2_yNhfz.cjs';
1
+ import { W as WalletRepository, C as ContractRepository, p as IndexerProvider, o as ArkProvider, s as VirtualCoin, t as Contract, u as ExtendedVirtualCoin } from './index-CwBr7qzV.js';
2
2
 
3
3
  /**
4
4
  * A task item represents a unit of work in the inbox.
@@ -111,4 +111,4 @@ interface CreateTaskDependenciesOptions {
111
111
  */
112
112
  declare function createTaskDependencies(options: CreateTaskDependenciesOptions): TaskDependencies;
113
113
 
114
- export { type CreateTaskDependenciesOptions as C, InMemoryTaskQueue as I, type TaskProcessor as T, type TaskDependencies as a, type TaskItem as b, type TaskQueue as c, type TaskResult as d, createTaskDependencies as e, runTasks as r };
114
+ export { type CreateTaskDependenciesOptions as C, InMemoryTaskQueue as I, type TaskProcessor as T, type TaskQueue as a, type TaskDependencies as b, type TaskItem as c, type TaskResult as d, createTaskDependencies as e, runTasks as r };
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var chunkH7JCHFM6_cjs = require('../../chunk-H7JCHFM6.cjs');
4
- var chunk2XLNQHG4_cjs = require('../../chunk-2XLNQHG4.cjs');
5
- var chunkKNS5MTTI_cjs = require('../../chunk-KNS5MTTI.cjs');
6
- require('../../chunk-PRFL62ID.cjs');
7
- require('../../chunk-MZNLCMUP.cjs');
8
- require('../../chunk-4A4GRSTB.cjs');
3
+ var chunkPWWA4DBL_cjs = require('../../chunk-PWWA4DBL.cjs');
4
+ var chunkQRSR4HV4_cjs = require('../../chunk-QRSR4HV4.cjs');
5
+ var chunkZ2OZMKFV_cjs = require('../../chunk-Z2OZMKFV.cjs');
6
+ require('../../chunk-I6EDUE75.cjs');
7
+ require('../../chunk-G53HASDV.cjs');
8
+ require('../../chunk-OH2XLTXE.cjs');
9
9
  require('../../chunk-5BLDMQED.cjs');
10
10
  var TaskManager = require('expo-task-manager');
11
11
  var BackgroundTask = require('expo-background-task');
@@ -36,7 +36,7 @@ function defineExpoBackgroundTask(taskName, options) {
36
36
  taskQueue,
37
37
  walletRepository,
38
38
  contractRepository,
39
- processors = [chunk2XLNQHG4_cjs.contractPollProcessor]
39
+ processors = [chunkPWWA4DBL_cjs.contractPollProcessor]
40
40
  } = options;
41
41
  TaskManager__namespace.defineTask(taskName, async () => {
42
42
  try {
@@ -44,24 +44,24 @@ function defineExpoBackgroundTask(taskName, options) {
44
44
  if (!config) {
45
45
  return BackgroundTask__namespace.BackgroundTaskResult.Success;
46
46
  }
47
- const indexerProvider = new chunkH7JCHFM6_cjs.ExpoIndexerProvider(config.arkServerUrl);
48
- const arkProvider = new chunkH7JCHFM6_cjs.ExpoArkProvider(config.arkServerUrl);
49
- const deps = chunk2XLNQHG4_cjs.createTaskDependencies({
47
+ const indexerProvider = new chunkQRSR4HV4_cjs.ExpoIndexerProvider(config.arkServerUrl);
48
+ const arkProvider = new chunkQRSR4HV4_cjs.ExpoArkProvider(config.arkServerUrl);
49
+ const deps = chunkPWWA4DBL_cjs.createTaskDependencies({
50
50
  walletRepository,
51
51
  contractRepository,
52
52
  indexerProvider,
53
53
  arkProvider
54
54
  });
55
- await chunk2XLNQHG4_cjs.runTasks(taskQueue, processors, deps);
55
+ await chunkPWWA4DBL_cjs.runTasks(taskQueue, processors, deps);
56
56
  const results = await taskQueue.getResults();
57
57
  if (results.length > 0) {
58
58
  await taskQueue.acknowledgeResults(results.map((r) => r.id));
59
59
  }
60
- const existing = await taskQueue.getTasks(chunk2XLNQHG4_cjs.CONTRACT_POLL_TASK_TYPE);
60
+ const existing = await taskQueue.getTasks(chunkPWWA4DBL_cjs.CONTRACT_POLL_TASK_TYPE);
61
61
  if (existing.length === 0) {
62
62
  const task = {
63
- id: chunkKNS5MTTI_cjs.getRandomId(),
64
- type: chunk2XLNQHG4_cjs.CONTRACT_POLL_TASK_TYPE,
63
+ id: chunkZ2OZMKFV_cjs.getRandomId(),
64
+ type: chunkPWWA4DBL_cjs.CONTRACT_POLL_TASK_TYPE,
65
65
  data: {},
66
66
  createdAt: Date.now()
67
67
  };
@@ -1,10 +1,10 @@
1
- import { W as WalletRepository, C as ContractRepository } from '../../ark-D2_yNhfz.cjs';
2
- import { a as AsyncStorageTaskQueue } from '../../asyncStorageTaskQueue-CqijAAPG.cjs';
3
- import { T as TaskProcessor } from '../../taskRunner-BEQNFEa4.cjs';
4
- import '@scure/btc-signer/transaction.js';
1
+ import { W as WalletRepository, C as ContractRepository } from '../../index-CwBr7qzV.cjs';
2
+ import { A as AsyncStorageTaskQueue } from '../../asyncStorageTaskQueue-B53mOTCw.cjs';
3
+ import { T as TaskProcessor } from '../../taskRunner-BMUndClz.cjs';
5
4
  import '@scure/btc-signer/utils.js';
6
- import '@scure/btc-signer/psbt.js';
5
+ import '@scure/btc-signer/transaction.js';
7
6
  import '@scure/btc-signer';
7
+ import '@scure/btc-signer/psbt.js';
8
8
 
9
9
  /**
10
10
  * Wallet parameters persisted by @see ExpoWallet.setup and read
@@ -1,10 +1,10 @@
1
- import { W as WalletRepository, C as ContractRepository } from '../../ark-D2_yNhfz.js';
2
- import { a as AsyncStorageTaskQueue } from '../../asyncStorageTaskQueue-Vsp6uk8e.js';
3
- import { T as TaskProcessor } from '../../taskRunner-9gnlYEpb.js';
4
- import '@scure/btc-signer/transaction.js';
1
+ import { W as WalletRepository, C as ContractRepository } from '../../index-CwBr7qzV.js';
2
+ import { A as AsyncStorageTaskQueue } from '../../asyncStorageTaskQueue-Df-CTfTE.js';
3
+ import { T as TaskProcessor } from '../../taskRunner-DZWUsSzA.js';
5
4
  import '@scure/btc-signer/utils.js';
6
- import '@scure/btc-signer/psbt.js';
5
+ import '@scure/btc-signer/transaction.js';
7
6
  import '@scure/btc-signer';
7
+ import '@scure/btc-signer/psbt.js';
8
8
 
9
9
  /**
10
10
  * Wallet parameters persisted by @see ExpoWallet.setup and read
@@ -1,9 +1,9 @@
1
- import { ExpoIndexerProvider, ExpoArkProvider } from '../../chunk-3Q7BBUWO.js';
2
- import { contractPollProcessor, createTaskDependencies, runTasks, CONTRACT_POLL_TASK_TYPE } from '../../chunk-B66RYHTB.js';
3
- import { getRandomId } from '../../chunk-Y54MUBT7.js';
4
- import '../../chunk-FSKANUV4.js';
5
- import '../../chunk-2DINXHGQ.js';
6
- import '../../chunk-JBULXTCC.js';
1
+ import { contractPollProcessor, createTaskDependencies, runTasks, CONTRACT_POLL_TASK_TYPE } from '../../chunk-I7RLG6VX.js';
2
+ import { ExpoIndexerProvider, ExpoArkProvider } from '../../chunk-H2ZAJOQA.js';
3
+ import { getRandomId } from '../../chunk-2IZW6AEK.js';
4
+ import '../../chunk-RMBI6P4N.js';
5
+ import '../../chunk-L7S5KC5B.js';
6
+ import '../../chunk-URT2RVGB.js';
7
7
  import '../../chunk-NSBPE2FW.js';
8
8
  import * as TaskManager from 'expo-task-manager';
9
9
  import * as BackgroundTask from 'expo-background-task';
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var chunk2XLNQHG4_cjs = require('../../chunk-2XLNQHG4.cjs');
4
- var chunkKNS5MTTI_cjs = require('../../chunk-KNS5MTTI.cjs');
5
- require('../../chunk-PRFL62ID.cjs');
6
- require('../../chunk-MZNLCMUP.cjs');
7
- var chunk4A4GRSTB_cjs = require('../../chunk-4A4GRSTB.cjs');
3
+ var chunkPWWA4DBL_cjs = require('../../chunk-PWWA4DBL.cjs');
4
+ var chunkZ2OZMKFV_cjs = require('../../chunk-Z2OZMKFV.cjs');
5
+ require('../../chunk-I6EDUE75.cjs');
6
+ require('../../chunk-G53HASDV.cjs');
7
+ var chunkOH2XLTXE_cjs = require('../../chunk-OH2XLTXE.cjs');
8
8
  require('../../chunk-5BLDMQED.cjs');
9
9
  var base = require('@scure/base');
10
10
 
@@ -58,18 +58,18 @@ var ExpoWallet = class _ExpoWallet {
58
58
  */
59
59
  static async setup(config) {
60
60
  warnOnRemovedBackgroundFields(config.background);
61
- const wallet = await chunkKNS5MTTI_cjs.Wallet.create(config);
62
- const processors = config.background.processors ?? [chunk2XLNQHG4_cjs.contractPollProcessor];
61
+ const wallet = await chunkZ2OZMKFV_cjs.Wallet.create(config);
62
+ const processors = config.background.processors ?? [chunkPWWA4DBL_cjs.contractPollProcessor];
63
63
  const deps = {
64
64
  walletRepository: wallet.walletRepository,
65
65
  contractRepository: wallet.contractRepository,
66
66
  indexerProvider: wallet.indexerProvider,
67
67
  arkProvider: wallet.arkProvider,
68
- extendVtxo: (vtxo, contract) => chunkKNS5MTTI_cjs.extendVirtualCoinForContract(vtxo, contract)
68
+ extendVtxo: (vtxo, contract) => chunkZ2OZMKFV_cjs.extendVirtualCoinForContract(vtxo, contract)
69
69
  };
70
70
  const { taskQueue } = config.background;
71
71
  if ("persistConfig" in taskQueue) {
72
- const arkServerUrl = config.arkServerUrl || (wallet.arkProvider instanceof chunk4A4GRSTB_cjs.RestArkProvider ? wallet.arkProvider.serverUrl : void 0);
72
+ const arkServerUrl = config.arkServerUrl || (wallet.arkProvider instanceof chunkOH2XLTXE_cjs.RestArkProvider ? wallet.arkProvider.serverUrl : void 0);
73
73
  if (arkServerUrl) {
74
74
  const timelock = wallet.offchainTapscript.options.csvTimelock;
75
75
  const bgConfig = {
@@ -100,7 +100,7 @@ var ExpoWallet = class _ExpoWallet {
100
100
  }
101
101
  async runForegroundPoll() {
102
102
  if (this.cleared) return;
103
- await chunk2XLNQHG4_cjs.runTasks(this.taskQueue, this.processors, this.deps);
103
+ await chunkPWWA4DBL_cjs.runTasks(this.taskQueue, this.processors, this.deps);
104
104
  const results = await this.taskQueue.getResults();
105
105
  if (results.length > 0) {
106
106
  await this.taskQueue.acknowledgeResults(results.map((r) => r.id));
@@ -109,18 +109,18 @@ var ExpoWallet = class _ExpoWallet {
109
109
  await this.seedContractPollTask();
110
110
  }
111
111
  async seedContractPollTask() {
112
- const existing = await this.taskQueue.getTasks(chunk2XLNQHG4_cjs.CONTRACT_POLL_TASK_TYPE);
112
+ const existing = await this.taskQueue.getTasks(chunkPWWA4DBL_cjs.CONTRACT_POLL_TASK_TYPE);
113
113
  if (existing.length > 0) return;
114
114
  const task = {
115
- id: chunkKNS5MTTI_cjs.getRandomId(),
116
- type: chunk2XLNQHG4_cjs.CONTRACT_POLL_TASK_TYPE,
115
+ id: chunkZ2OZMKFV_cjs.getRandomId(),
116
+ type: chunkPWWA4DBL_cjs.CONTRACT_POLL_TASK_TYPE,
117
117
  data: {},
118
118
  createdAt: Date.now()
119
119
  };
120
120
  await this.taskQueue.addTask(task);
121
121
  }
122
122
  async removeContractPollTasks() {
123
- const tasks = await this.taskQueue.getTasks(chunk2XLNQHG4_cjs.CONTRACT_POLL_TASK_TYPE);
123
+ const tasks = await this.taskQueue.getTasks(chunkPWWA4DBL_cjs.CONTRACT_POLL_TASK_TYPE);
124
124
  for (const task of tasks) {
125
125
  await this.taskQueue.removeTask(task.id);
126
126
  }
@@ -186,6 +186,26 @@ var ExpoWallet = class _ExpoWallet {
186
186
  getContractManager() {
187
187
  return this.wallet.getContractManager();
188
188
  }
189
+ // Descriptor surface, delegated like everything else here. Without these
190
+ // the structural probes see a wallet with no HD state, so an Expo wallet
191
+ // running `walletMode: 'hd'` would bind every artifact to its baseline
192
+ // identity key — reusing one key across swaps while its receive addresses
193
+ // rotate, and never allocating the indices a restore scan looks for.
194
+ getCurrentSigningDescriptor() {
195
+ return this.wallet.getCurrentSigningDescriptor();
196
+ }
197
+ getNextSigningDescriptor() {
198
+ return this.wallet.getNextSigningDescriptor();
199
+ }
200
+ getUsedSigningDescriptors(opts) {
201
+ return this.wallet.getUsedSigningDescriptors(opts);
202
+ }
203
+ advanceSigningDescriptorWatermark(descriptor) {
204
+ return this.wallet.advanceSigningDescriptorWatermark(descriptor);
205
+ }
206
+ signerForDescriptor(descriptor) {
207
+ return this.wallet.signerForDescriptor(descriptor);
208
+ }
189
209
  /**
190
210
  * Wallet-level provider-connection freshness, delegated to the wrapped
191
211
  * in-process wallet. Synchronous because the Expo foreground wallet is
@@ -208,8 +228,8 @@ var ExpoWallet = class _ExpoWallet {
208
228
  settle(params, eventCallback) {
209
229
  return this.wallet.settle(params, eventCallback);
210
230
  }
211
- send(...recipients) {
212
- return this.wallet.send(...recipients);
231
+ send(...args) {
232
+ return this.wallet.send(...args);
213
233
  }
214
234
  get assetManager() {
215
235
  return this.wallet.assetManager;