@arkade-os/sdk 0.4.52 → 0.4.54

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 (81) hide show
  1. package/dist/adapters/expo.cjs +5 -5
  2. package/dist/adapters/expo.d.cts +2 -2
  3. package/dist/adapters/expo.d.ts +2 -2
  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/{ark-B69ugeJw.d.cts → ark-acFuA57I.d.cts} +2 -1
  8. package/dist/{ark-B69ugeJw.d.ts → ark-acFuA57I.d.ts} +2 -1
  9. package/dist/{asyncStorageTaskQueue-DScPdQAy.d.cts → asyncStorageTaskQueue-BO3cvMpP.d.cts} +1 -1
  10. package/dist/{asyncStorageTaskQueue-BImF14sj.d.ts → asyncStorageTaskQueue-DACXtP0I.d.ts} +1 -1
  11. package/dist/chunk-4EIKOJLD.js +2319 -0
  12. package/dist/chunk-4EIKOJLD.js.map +1 -0
  13. package/dist/{chunk-IEMPH7J6.cjs → chunk-53XNU2EL.cjs} +40 -40
  14. package/dist/{chunk-IEMPH7J6.cjs.map → chunk-53XNU2EL.cjs.map} +1 -1
  15. package/dist/{chunk-3ZGANANS.js → chunk-7L3P3EP5.js} +4 -4
  16. package/dist/{chunk-3ZGANANS.js.map → chunk-7L3P3EP5.js.map} +1 -1
  17. package/dist/{chunk-UZLQUWYP.js → chunk-A37WVZ5T.js} +3 -3
  18. package/dist/{chunk-UZLQUWYP.js.map → chunk-A37WVZ5T.js.map} +1 -1
  19. package/dist/{chunk-E6RT5XYB.cjs → chunk-BYJJIITU.cjs} +17 -17
  20. package/dist/{chunk-E6RT5XYB.cjs.map → chunk-BYJJIITU.cjs.map} +1 -1
  21. package/dist/{chunk-ML33GFCH.cjs → chunk-D5LUPJJP.cjs} +837 -437
  22. package/dist/chunk-D5LUPJJP.cjs.map +1 -0
  23. package/dist/chunk-GMUVWKOK.cjs +2407 -0
  24. package/dist/chunk-GMUVWKOK.cjs.map +1 -0
  25. package/dist/{chunk-WIVQWYPZ.js → chunk-QY2YVFZT.js} +4 -4
  26. package/dist/{chunk-WIVQWYPZ.js.map → chunk-QY2YVFZT.js.map} +1 -1
  27. package/dist/{chunk-FZPYPEWN.cjs → chunk-RNECH3TA.cjs} +19 -1367
  28. package/dist/chunk-RNECH3TA.cjs.map +1 -0
  29. package/dist/{chunk-AXCKRS2D.js → chunk-TEHJCEF3.js} +473 -91
  30. package/dist/chunk-TEHJCEF3.js.map +1 -0
  31. package/dist/{chunk-3Z5HK35D.cjs → chunk-YRLBZJYO.cjs} +9 -9
  32. package/dist/{chunk-3Z5HK35D.cjs.map → chunk-YRLBZJYO.cjs.map} +1 -1
  33. package/dist/{chunk-ZK3JITHP.js → chunk-ZOY5JSVA.js} +8 -1327
  34. package/dist/chunk-ZOY5JSVA.js.map +1 -0
  35. package/dist/contracts/handlers/index.cjs +8 -8
  36. package/dist/contracts/handlers/index.d.cts +3 -3
  37. package/dist/contracts/handlers/index.d.ts +3 -3
  38. package/dist/contracts/handlers/index.js +2 -2
  39. package/dist/{delegate-C_Y2YrXC.d.cts → delegate-Ca_wXiYE.d.cts} +1 -1
  40. package/dist/{delegate-BU-Cpyjw.d.ts → delegate-DjwZZi6L.d.ts} +1 -1
  41. package/dist/{index-tzAInyiX.d.cts → index-DFfefdpc.d.cts} +2 -2
  42. package/dist/{index-BWF-C9eh.d.ts → index-Ddq0mIKX.d.ts} +2 -2
  43. package/dist/index.cjs +319 -239
  44. package/dist/index.d.cts +300 -12
  45. package/dist/index.d.ts +300 -12
  46. package/dist/index.js +4 -4
  47. package/dist/repositories/realm/index.cjs +19 -19
  48. package/dist/repositories/realm/index.d.cts +2 -2
  49. package/dist/repositories/realm/index.d.ts +2 -2
  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 +2 -2
  53. package/dist/repositories/sqlite/index.d.ts +2 -2
  54. package/dist/repositories/sqlite/index.js +5 -5
  55. package/dist/{taskRunner-ClwI8jU8.d.cts → taskRunner-DEwlrgId.d.cts} +1 -1
  56. package/dist/{taskRunner-Cf80BqSy.d.ts → taskRunner-DbCNRP31.d.ts} +1 -1
  57. package/dist/wallet/expo/background.cjs +15 -15
  58. package/dist/wallet/expo/background.cjs.map +1 -1
  59. package/dist/wallet/expo/background.d.cts +3 -3
  60. package/dist/wallet/expo/background.d.ts +3 -3
  61. package/dist/wallet/expo/background.js +7 -7
  62. package/dist/wallet/expo/background.js.map +1 -1
  63. package/dist/wallet/expo/index.cjs +14 -14
  64. package/dist/wallet/expo/index.d.cts +4 -4
  65. package/dist/wallet/expo/index.d.ts +4 -4
  66. package/dist/wallet/expo/index.js +5 -5
  67. package/dist/{wallet-B6Xiferv.d.cts → wallet-B9rpddG2.d.ts} +2 -2
  68. package/dist/{wallet-CuHAI-eW.d.ts → wallet-ByjM6L20.d.cts} +2 -2
  69. package/dist/worker/expo/index.cjs +9 -9
  70. package/dist/worker/expo/index.d.cts +4 -4
  71. package/dist/worker/expo/index.d.ts +4 -4
  72. package/dist/worker/expo/index.js +5 -5
  73. package/package.json +1 -1
  74. package/dist/chunk-AXCKRS2D.js.map +0 -1
  75. package/dist/chunk-E7HB3GKK.cjs +0 -1030
  76. package/dist/chunk-E7HB3GKK.cjs.map +0 -1
  77. package/dist/chunk-EFNLTS6Q.js +0 -976
  78. package/dist/chunk-EFNLTS6Q.js.map +0 -1
  79. package/dist/chunk-FZPYPEWN.cjs.map +0 -1
  80. package/dist/chunk-ML33GFCH.cjs.map +0 -1
  81. package/dist/chunk-ZK3JITHP.js.map +0 -1
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkML33GFCH_cjs = require('../../chunk-ML33GFCH.cjs');
4
- require('../../chunk-FZPYPEWN.cjs');
5
- require('../../chunk-IEMPH7J6.cjs');
6
- require('../../chunk-E7HB3GKK.cjs');
3
+ var chunkD5LUPJJP_cjs = require('../../chunk-D5LUPJJP.cjs');
4
+ require('../../chunk-RNECH3TA.cjs');
5
+ require('../../chunk-53XNU2EL.cjs');
6
+ require('../../chunk-GMUVWKOK.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
- [chunkML33GFCH_cjs.scriptFromArkAddress(row.address), row.txid, row.vout]
157
+ [chunkD5LUPJJP_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 = chunkML33GFCH_cjs.serializeVtxo(vtxo);
228
+ const s = chunkD5LUPJJP_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 (!chunkML33GFCH_cjs.isVtxoForScript(vtxo, key.script)) {
283
+ if (!chunkD5LUPJJP_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 = chunkML33GFCH_cjs.serializeUtxo(utxo);
307
+ const s = chunkD5LUPJJP_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(chunkML33GFCH_cjs.serializeAssets(tx.assets)) : null
363
+ tx.assets ? JSON.stringify(chunkD5LUPJJP_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 ?? chunkML33GFCH_cjs.scriptFromArkAddress(row.address)
437
+ script: row.script ?? chunkD5LUPJJP_cjs.scriptFromArkAddress(row.address)
438
438
  };
439
- return chunkML33GFCH_cjs.deserializeVtxo(serialized);
439
+ return chunkD5LUPJJP_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 chunkML33GFCH_cjs.deserializeUtxo(serialized);
458
+ return chunkD5LUPJJP_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 = chunkML33GFCH_cjs.deserializeAssets(JSON.parse(row.assets_json));
473
+ tx.assets = chunkD5LUPJJP_cjs.deserializeAssets(JSON.parse(row.assets_json));
474
474
  }
475
475
  return tx;
476
476
  }
@@ -718,8 +718,8 @@ var SQLiteIntentRepository = class {
718
718
  `SELECT * FROM ${this.t} ORDER BY created_at ASC, intent_tx_id ASC`
719
719
  );
720
720
  let out = rows.map(rowToIntent);
721
- if (filter) out = out.filter((i) => chunkML33GFCH_cjs.intentMatchesFilter(i, filter));
722
- const { skip, end } = chunkML33GFCH_cjs.intentPageBounds(filter, out.length);
721
+ if (filter) out = out.filter((i) => chunkD5LUPJJP_cjs.intentMatchesFilter(i, filter));
722
+ const { skip, end } = chunkD5LUPJJP_cjs.intentPageBounds(filter, out.length);
723
723
  return out.slice(skip, end);
724
724
  }
725
725
  async getLockedVtxoOutpoints() {
@@ -727,7 +727,7 @@ var SQLiteIntentRepository = class {
727
727
  const rows = await this.db.all(`SELECT * FROM ${this.t}`);
728
728
  const out = [];
729
729
  for (const r of rows) {
730
- if (chunkML33GFCH_cjs.isTerminalIntentState(r.state)) continue;
730
+ if (chunkD5LUPJJP_cjs.isTerminalIntentState(r.state)) continue;
731
731
  for (const o of JSON.parse(r.intent_vtxos_json)) out.push(o);
732
732
  }
733
733
  return out;
@@ -822,7 +822,7 @@ var SQLiteVirtualTxRepository = class {
822
822
  const prev = prevByTxid.get(t.txid);
823
823
  const psbt = t.psbt ?? prev?.psbt ?? null;
824
824
  const expires = t.expiresAt ?? prev?.expires_at ?? null;
825
- const type = chunkML33GFCH_cjs.mergeChainedTxType(t.type, prev?.type);
825
+ const type = chunkD5LUPJJP_cjs.mergeChainedTxType(t.type, prev?.type);
826
826
  await this.db.run(
827
827
  `INSERT OR REPLACE INTO ${this.tTx} (txid, psbt, expires_at, type) VALUES (?, ?, ?, ?)`,
828
828
  [t.txid, psbt, expires, type]
@@ -908,7 +908,7 @@ function rowToTx(r) {
908
908
 
909
909
  Object.defineProperty(exports, "ChainedTxType", {
910
910
  enumerable: true,
911
- get: function () { return chunkML33GFCH_cjs.ChainedTxType; }
911
+ get: function () { return chunkD5LUPJJP_cjs.ChainedTxType; }
912
912
  });
913
913
  exports.SQLiteContractRepository = SQLiteContractRepository;
914
914
  exports.SQLiteIntentRepository = SQLiteIntentRepository;
@@ -1,5 +1,5 @@
1
- import { W as WalletRepository, t as ExtendedVirtualCoin, ac as VtxoRepositoryKey, E as ExtendedCoin, A as ArkTransaction, ad as WalletState, C as ContractRepository, ae as ContractFilter, s as Contract, Q as IntentRepository, af as ArkIntent, ag as IntentFilter, ah as Outpoint, U as VirtualTxRepository, ai as VirtualTx, aj as VtxoBranch } from '../../ark-B69ugeJw.cjs';
2
- export { ak as ChainedTxType } from '../../ark-B69ugeJw.cjs';
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-acFuA57I.cjs';
2
+ export { H as ChainedTxType } from '../../ark-acFuA57I.cjs';
3
3
  import '@scure/btc-signer/transaction.js';
4
4
  import '@scure/btc-signer/utils.js';
5
5
  import '@scure/btc-signer/psbt.js';
@@ -1,5 +1,5 @@
1
- import { W as WalletRepository, t as ExtendedVirtualCoin, ac as VtxoRepositoryKey, E as ExtendedCoin, A as ArkTransaction, ad as WalletState, C as ContractRepository, ae as ContractFilter, s as Contract, Q as IntentRepository, af as ArkIntent, ag as IntentFilter, ah as Outpoint, U as VirtualTxRepository, ai as VirtualTx, aj as VtxoBranch } from '../../ark-B69ugeJw.js';
2
- export { ak as ChainedTxType } from '../../ark-B69ugeJw.js';
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-acFuA57I.js';
2
+ export { H as ChainedTxType } from '../../ark-acFuA57I.js';
3
3
  import '@scure/btc-signer/transaction.js';
4
4
  import '@scure/btc-signer/utils.js';
5
5
  import '@scure/btc-signer/psbt.js';
@@ -1,8 +1,8 @@
1
- import { serializeVtxo, isVtxoForScript, serializeUtxo, serializeAssets, scriptFromArkAddress, deserializeVtxo, deserializeUtxo, deserializeAssets, intentMatchesFilter, intentPageBounds, isTerminalIntentState, mergeChainedTxType } from '../../chunk-AXCKRS2D.js';
2
- export { ChainedTxType } from '../../chunk-AXCKRS2D.js';
3
- import '../../chunk-ZK3JITHP.js';
4
- import '../../chunk-UZLQUWYP.js';
5
- import '../../chunk-EFNLTS6Q.js';
1
+ import { serializeVtxo, isVtxoForScript, serializeUtxo, serializeAssets, scriptFromArkAddress, deserializeVtxo, deserializeUtxo, deserializeAssets, intentMatchesFilter, intentPageBounds, isTerminalIntentState, mergeChainedTxType } from '../../chunk-TEHJCEF3.js';
2
+ export { ChainedTxType } from '../../chunk-TEHJCEF3.js';
3
+ import '../../chunk-ZOY5JSVA.js';
4
+ import '../../chunk-A37WVZ5T.js';
5
+ import '../../chunk-4EIKOJLD.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-B69ugeJw.cjs';
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-acFuA57I.cjs';
2
2
 
3
3
  /**
4
4
  * A task item represents a unit of work in the inbox.
@@ -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-B69ugeJw.js';
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-acFuA57I.js';
2
2
 
3
3
  /**
4
4
  * A task item represents a unit of work in the inbox.
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var chunkE6RT5XYB_cjs = require('../../chunk-E6RT5XYB.cjs');
4
- var chunk3Z5HK35D_cjs = require('../../chunk-3Z5HK35D.cjs');
5
- var chunkML33GFCH_cjs = require('../../chunk-ML33GFCH.cjs');
6
- require('../../chunk-FZPYPEWN.cjs');
7
- require('../../chunk-IEMPH7J6.cjs');
8
- require('../../chunk-E7HB3GKK.cjs');
3
+ var chunkYRLBZJYO_cjs = require('../../chunk-YRLBZJYO.cjs');
4
+ var chunkBYJJIITU_cjs = require('../../chunk-BYJJIITU.cjs');
5
+ var chunkD5LUPJJP_cjs = require('../../chunk-D5LUPJJP.cjs');
6
+ require('../../chunk-RNECH3TA.cjs');
7
+ require('../../chunk-53XNU2EL.cjs');
8
+ require('../../chunk-GMUVWKOK.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 = [chunk3Z5HK35D_cjs.contractPollProcessor]
39
+ processors = [chunkYRLBZJYO_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 chunkE6RT5XYB_cjs.ExpoIndexerProvider(config.arkServerUrl);
48
- const arkProvider = new chunkE6RT5XYB_cjs.ExpoArkProvider(config.arkServerUrl);
49
- const deps = chunk3Z5HK35D_cjs.createTaskDependencies({
47
+ const indexerProvider = new chunkBYJJIITU_cjs.ExpoIndexerProvider(config.arkServerUrl);
48
+ const arkProvider = new chunkBYJJIITU_cjs.ExpoArkProvider(config.arkServerUrl);
49
+ const deps = chunkYRLBZJYO_cjs.createTaskDependencies({
50
50
  walletRepository,
51
51
  contractRepository,
52
52
  indexerProvider,
53
53
  arkProvider
54
54
  });
55
- await chunk3Z5HK35D_cjs.runTasks(taskQueue, processors, deps);
55
+ await chunkYRLBZJYO_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(chunk3Z5HK35D_cjs.CONTRACT_POLL_TASK_TYPE);
60
+ const existing = await taskQueue.getTasks(chunkYRLBZJYO_cjs.CONTRACT_POLL_TASK_TYPE);
61
61
  if (existing.length === 0) {
62
62
  const task = {
63
- id: chunkML33GFCH_cjs.getRandomId(),
64
- type: chunk3Z5HK35D_cjs.CONTRACT_POLL_TASK_TYPE,
63
+ id: chunkD5LUPJJP_cjs.getRandomId(),
64
+ type: chunkYRLBZJYO_cjs.CONTRACT_POLL_TASK_TYPE,
65
65
  data: {},
66
66
  createdAt: Date.now()
67
67
  };
@@ -79,7 +79,7 @@ function defineExpoBackgroundTask(taskName, options) {
79
79
  }
80
80
  async function registerExpoBackgroundTask(taskName, options) {
81
81
  await BackgroundTask__namespace.registerTaskAsync(taskName, {
82
- minimumInterval: (options?.minimumInterval ?? 15) * 60
82
+ minimumInterval: options?.minimumInterval ?? 15
83
83
  });
84
84
  }
85
85
  async function unregisterExpoBackgroundTask(taskName) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/wallet/expo/background.ts"],"names":["contractPollProcessor","TaskManager","BackgroundTask","ExpoIndexerProvider","ExpoArkProvider","createTaskDependencies","runTasks","CONTRACT_POLL_TASK_TYPE","getRandomId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyFO,SAAS,wBAAA,CACZ,UACA,OAAA,EACI;AACJ,EAAA,MAAM;AAAA,IACF,SAAA;AAAA,IACA,gBAAA;AAAA,IACA,kBAAA;AAAA,IACA,UAAA,GAAa,CAACA,uCAAqB;AAAA,GACvC,GAAI,OAAA;AAEJ,EAAYC,sBAAA,CAAA,UAAA,CAAW,UAAU,YAAY;AACzC,IAAA,IAAI;AACA,MAAA,MAAM,MAAA,GAAS,MAAM,SAAA,CAAU,UAAA,EAAsC;AACrE,MAAA,IAAI,CAAC,MAAA,EAAQ;AAGT,QAAA,OAAsBC,yBAAA,CAAA,oBAAA,CAAqB,OAAA;AAAA,MAC/C;AAEA,MAAA,MAAM,eAAA,GAAkB,IAAIC,qCAAA,CAAoB,MAAA,CAAO,YAAY,CAAA;AACnE,MAAA,MAAM,WAAA,GAAc,IAAIC,iCAAA,CAAgB,MAAA,CAAO,YAAY,CAAA;AAE3D,MAAA,MAAM,OAAOC,wCAAA,CAAuB;AAAA,QAChC,gBAAA;AAAA,QACA,kBAAA;AAAA,QACA,eAAA;AAAA,QACA;AAAA,OACH,CAAA;AAED,MAAA,MAAMC,0BAAA,CAAS,SAAA,EAAW,UAAA,EAAY,IAAI,CAAA;AAG1C,MAAA,MAAM,OAAA,GAAU,MAAM,SAAA,CAAU,UAAA,EAAW;AAC3C,MAAA,IAAI,OAAA,CAAQ,SAAS,CAAA,EAAG;AACpB,QAAA,MAAM,SAAA,CAAU,mBAAmB,OAAA,CAAQ,GAAA,CAAI,CAAC,CAAA,KAAM,CAAA,CAAE,EAAE,CAAC,CAAA;AAAA,MAC/D;AAGA,MAAA,MAAM,QAAA,GAAW,MAAM,SAAA,CAAU,QAAA,CAASC,yCAAuB,CAAA;AACjE,MAAA,IAAI,QAAA,CAAS,WAAW,CAAA,EAAG;AACvB,QAAA,MAAM,IAAA,GAAiB;AAAA,UACnB,IAAIC,6BAAA,EAAY;AAAA,UAChB,IAAA,EAAMD,yCAAA;AAAA,UACN,MAAM,EAAC;AAAA,UACP,SAAA,EAAW,KAAK,GAAA;AAAI,SACxB;AACA,QAAA,MAAM,SAAA,CAAU,QAAQ,IAAI,CAAA;AAAA,MAChC;AAEA,MAAA,OAAsBL,yBAAA,CAAA,oBAAA,CAAqB,OAAA;AAAA,IAC/C,SAAS,KAAA,EAAO;AACZ,MAAA,OAAA,CAAQ,KAAA;AAAA,QACJ,mCAAA;AAAA,QACA,KAAA,YAAiB,KAAA,GAAQ,KAAA,CAAM,OAAA,GAAU;AAAA,OAC7C;AACA,MAAA,OAAsBA,yBAAA,CAAA,oBAAA,CAAqB,MAAA;AAAA,IAC/C;AAAA,EACJ,CAAC,CAAA;AACL;AAcA,eAAsB,0BAAA,CAClB,UACA,OAAA,EACa;AACb,EAAA,MAAqBA,4CAAkB,QAAA,EAAU;AAAA,IAC7C,eAAA,EAAA,CAAkB,OAAA,EAAS,eAAA,IAAmB,EAAA,IAAM;AAAA,GACvD,CAAA;AACL;AASA,eAAsB,6BAA6B,QAAA,EAAiC;AAChF,EAAA,MAAqBA,8CAAoB,QAAQ,CAAA;AACrD","file":"background.cjs","sourcesContent":["/**\n * Expo background task entrypoint — `@arkade-os/sdk/wallet/expo/background`.\n *\n * This subpath is the **only** module in the package that touches\n * `expo-task-manager` / `expo-background-task`. It is split out from\n * `/wallet/expo` on purpose: those packages have no web platform and\n * are declared as optional peer dependencies, so importing them from\n * `/wallet/expo` would regress react-native-web / Node consumers who\n * only need the foreground APIs.\n *\n * The imports are static (not lazy `require()`) because Metro's static\n * dependency collector cannot see modules hidden behind `__require()`\n * in the ESM build — without static imports the packages never enter\n * the bundle graph and resolution fails at runtime. See\n * https://github.com/arkade-os/ts-sdk/issues/486 for details.\n *\n * Consumers install the peers in their Expo app:\n * npx expo install expo-task-manager expo-background-task\n */\nimport * as TaskManager from \"expo-task-manager\";\nimport * as BackgroundTask from \"expo-background-task\";\n\nimport type { WalletRepository } from \"../../repositories/walletRepository\";\nimport type { ContractRepository } from \"../../repositories/contractRepository\";\nimport type { AsyncStorageTaskQueue } from \"../../worker/expo/asyncStorageTaskQueue\";\nimport type { TaskProcessor } from \"../../worker/expo/taskRunner\";\nimport type { TaskItem } from \"../../worker/expo/taskQueue\";\nimport { runTasks, createTaskDependencies } from \"../../worker/expo/taskRunner\";\nimport { contractPollProcessor, CONTRACT_POLL_TASK_TYPE } from \"../../worker/expo/processors\";\nimport { ExpoArkProvider } from \"../../providers/expoArk\";\nimport { ExpoIndexerProvider } from \"../../providers/expoIndexer\";\nimport { getRandomId } from \"../utils\";\n\n// ── Persisted config ─────────────────────────────────────────────\n\n/**\n * Wallet parameters persisted by @see ExpoWallet.setup and read\n * by the background handler to reconstruct providers and `extendVtxo`\n * without a network call.\n */\nexport interface PersistedBackgroundConfig {\n arkServerUrl: string;\n pubkeyHex: string;\n serverPubKeyHex: string;\n exitTimelockValue: string;\n exitTimelockType: \"blocks\" | \"seconds\";\n}\n\n// ── Public API ───────────────────────────────────────────────────\n\n/**\n * Options for @see defineExpoBackgroundTask.\n */\nexport interface DefineBackgroundTaskOptions {\n /** AsyncStorage-backed queue (must match the one passed to ExpoWallet.setup). */\n taskQueue: AsyncStorageTaskQueue;\n /** Wallet repository (fresh instance is fine — connects to the same DB). */\n walletRepository: WalletRepository;\n /** Contract repository (fresh instance is fine — connects to the same DB). */\n contractRepository: ContractRepository;\n /** Processors to run. Defaults to `[contractPollProcessor]`. */\n processors?: TaskProcessor[];\n}\n\n/**\n * Define the Expo background task handler.\n *\n * **Must be called at module/global scope** (before React mounts) so\n * Expo's TaskManager can resume the task on cold start.\n *\n * Pair with @see registerExpoBackgroundTask to activate the OS\n * scheduler — `ExpoWallet.setup()` no longer registers the task for\n * you.\n *\n * @example\n * ```ts\n * // App entry (e.g. _layout.tsx) — module scope\n * import { defineExpoBackgroundTask } from \"@arkade-os/sdk/wallet/expo/background\";\n * import { AsyncStorageTaskQueue } from \"@arkade-os/sdk/worker/expo\";\n * import AsyncStorage from \"@react-native-async-storage/async-storage\";\n *\n * const taskQueue = new AsyncStorageTaskQueue(AsyncStorage);\n * defineExpoBackgroundTask(\"ark-background-poll\", {\n * taskQueue,\n * walletRepository: new IndexedDBWalletRepository(),\n * contractRepository: new IndexedDBContractRepository(),\n * });\n * ```\n */\nexport function defineExpoBackgroundTask(\n taskName: string,\n options: DefineBackgroundTaskOptions,\n): void {\n const {\n taskQueue,\n walletRepository,\n contractRepository,\n processors = [contractPollProcessor],\n } = options;\n\n TaskManager.defineTask(taskName, async () => {\n try {\n const config = await taskQueue.loadConfig<PersistedBackgroundConfig>();\n if (!config) {\n // No config persisted yet — ExpoWallet.setup() hasn't run.\n // Nothing to do.\n return BackgroundTask.BackgroundTaskResult.Success;\n }\n\n const indexerProvider = new ExpoIndexerProvider(config.arkServerUrl);\n const arkProvider = new ExpoArkProvider(config.arkServerUrl);\n\n const deps = createTaskDependencies({\n walletRepository,\n contractRepository,\n indexerProvider,\n arkProvider,\n });\n\n await runTasks(taskQueue, processors, deps);\n\n // Acknowledge outbox results (no foreground to consume them)\n const results = await taskQueue.getResults();\n if (results.length > 0) {\n await taskQueue.acknowledgeResults(results.map((r) => r.id));\n }\n\n // Re-seed the contract-poll task for the next OS wake\n const existing = await taskQueue.getTasks(CONTRACT_POLL_TASK_TYPE);\n if (existing.length === 0) {\n const task: TaskItem = {\n id: getRandomId(),\n type: CONTRACT_POLL_TASK_TYPE,\n data: {},\n createdAt: Date.now(),\n };\n await taskQueue.addTask(task);\n }\n\n return BackgroundTask.BackgroundTaskResult.Success;\n } catch (error) {\n console.error(\n \"[ark-sdk] Background task failed:\",\n error instanceof Error ? error.message : error,\n );\n return BackgroundTask.BackgroundTaskResult.Failed;\n }\n });\n}\n\n/**\n * Activate the OS-level background task scheduler.\n *\n * Call once after @see defineExpoBackgroundTask — typically right after\n * `ExpoWallet.setup()`. Safe to call again to update the interval.\n *\n * @param taskName - The task name passed to {@link defineExpoBackgroundTask}.\n * @param options.minimumInterval - Minimum interval in **minutes** (default\n * 15, the floor enforced by `expo-background-task`).\n *\n * @see https://docs.expo.dev/versions/latest/sdk/background-task/#backgroundtaskoptions\n */\nexport async function registerExpoBackgroundTask(\n taskName: string,\n options?: { minimumInterval?: number },\n): Promise<void> {\n await BackgroundTask.registerTaskAsync(taskName, {\n minimumInterval: (options?.minimumInterval ?? 15) * 60,\n });\n}\n\n/**\n * Unregister the background task from the OS scheduler.\n *\n * `ExpoWallet.dispose()` does **not** call this — the OS-level task\n * lifecycle is the consumer's responsibility, matching the explicit\n * `register` step.\n */\nexport async function unregisterExpoBackgroundTask(taskName: string): Promise<void> {\n await BackgroundTask.unregisterTaskAsync(taskName);\n}\n"]}
1
+ {"version":3,"sources":["../../../src/wallet/expo/background.ts"],"names":["contractPollProcessor","TaskManager","BackgroundTask","ExpoIndexerProvider","ExpoArkProvider","createTaskDependencies","runTasks","CONTRACT_POLL_TASK_TYPE","getRandomId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyFO,SAAS,wBAAA,CACZ,UACA,OAAA,EACI;AACJ,EAAA,MAAM;AAAA,IACF,SAAA;AAAA,IACA,gBAAA;AAAA,IACA,kBAAA;AAAA,IACA,UAAA,GAAa,CAACA,uCAAqB;AAAA,GACvC,GAAI,OAAA;AAEJ,EAAYC,sBAAA,CAAA,UAAA,CAAW,UAAU,YAAY;AACzC,IAAA,IAAI;AACA,MAAA,MAAM,MAAA,GAAS,MAAM,SAAA,CAAU,UAAA,EAAsC;AACrE,MAAA,IAAI,CAAC,MAAA,EAAQ;AAGT,QAAA,OAAsBC,yBAAA,CAAA,oBAAA,CAAqB,OAAA;AAAA,MAC/C;AAEA,MAAA,MAAM,eAAA,GAAkB,IAAIC,qCAAA,CAAoB,MAAA,CAAO,YAAY,CAAA;AACnE,MAAA,MAAM,WAAA,GAAc,IAAIC,iCAAA,CAAgB,MAAA,CAAO,YAAY,CAAA;AAE3D,MAAA,MAAM,OAAOC,wCAAA,CAAuB;AAAA,QAChC,gBAAA;AAAA,QACA,kBAAA;AAAA,QACA,eAAA;AAAA,QACA;AAAA,OACH,CAAA;AAED,MAAA,MAAMC,0BAAA,CAAS,SAAA,EAAW,UAAA,EAAY,IAAI,CAAA;AAG1C,MAAA,MAAM,OAAA,GAAU,MAAM,SAAA,CAAU,UAAA,EAAW;AAC3C,MAAA,IAAI,OAAA,CAAQ,SAAS,CAAA,EAAG;AACpB,QAAA,MAAM,SAAA,CAAU,mBAAmB,OAAA,CAAQ,GAAA,CAAI,CAAC,CAAA,KAAM,CAAA,CAAE,EAAE,CAAC,CAAA;AAAA,MAC/D;AAGA,MAAA,MAAM,QAAA,GAAW,MAAM,SAAA,CAAU,QAAA,CAASC,yCAAuB,CAAA;AACjE,MAAA,IAAI,QAAA,CAAS,WAAW,CAAA,EAAG;AACvB,QAAA,MAAM,IAAA,GAAiB;AAAA,UACnB,IAAIC,6BAAA,EAAY;AAAA,UAChB,IAAA,EAAMD,yCAAA;AAAA,UACN,MAAM,EAAC;AAAA,UACP,SAAA,EAAW,KAAK,GAAA;AAAI,SACxB;AACA,QAAA,MAAM,SAAA,CAAU,QAAQ,IAAI,CAAA;AAAA,MAChC;AAEA,MAAA,OAAsBL,yBAAA,CAAA,oBAAA,CAAqB,OAAA;AAAA,IAC/C,SAAS,KAAA,EAAO;AACZ,MAAA,OAAA,CAAQ,KAAA;AAAA,QACJ,mCAAA;AAAA,QACA,KAAA,YAAiB,KAAA,GAAQ,KAAA,CAAM,OAAA,GAAU;AAAA,OAC7C;AACA,MAAA,OAAsBA,yBAAA,CAAA,oBAAA,CAAqB,MAAA;AAAA,IAC/C;AAAA,EACJ,CAAC,CAAA;AACL;AAcA,eAAsB,0BAAA,CAClB,UACA,OAAA,EACa;AACb,EAAA,MAAqBA,4CAAkB,QAAA,EAAU;AAAA,IAC7C,eAAA,EAAiB,SAAS,eAAA,IAAmB;AAAA,GAChD,CAAA;AACL;AASA,eAAsB,6BAA6B,QAAA,EAAiC;AAChF,EAAA,MAAqBA,8CAAoB,QAAQ,CAAA;AACrD","file":"background.cjs","sourcesContent":["/**\n * Expo background task entrypoint — `@arkade-os/sdk/wallet/expo/background`.\n *\n * This subpath is the **only** module in the package that touches\n * `expo-task-manager` / `expo-background-task`. It is split out from\n * `/wallet/expo` on purpose: those packages have no web platform and\n * are declared as optional peer dependencies, so importing them from\n * `/wallet/expo` would regress react-native-web / Node consumers who\n * only need the foreground APIs.\n *\n * The imports are static (not lazy `require()`) because Metro's static\n * dependency collector cannot see modules hidden behind `__require()`\n * in the ESM build — without static imports the packages never enter\n * the bundle graph and resolution fails at runtime. See\n * https://github.com/arkade-os/ts-sdk/issues/486 for details.\n *\n * Consumers install the peers in their Expo app:\n * npx expo install expo-task-manager expo-background-task\n */\nimport * as TaskManager from \"expo-task-manager\";\nimport * as BackgroundTask from \"expo-background-task\";\n\nimport type { WalletRepository } from \"../../repositories/walletRepository\";\nimport type { ContractRepository } from \"../../repositories/contractRepository\";\nimport type { AsyncStorageTaskQueue } from \"../../worker/expo/asyncStorageTaskQueue\";\nimport type { TaskProcessor } from \"../../worker/expo/taskRunner\";\nimport type { TaskItem } from \"../../worker/expo/taskQueue\";\nimport { runTasks, createTaskDependencies } from \"../../worker/expo/taskRunner\";\nimport { contractPollProcessor, CONTRACT_POLL_TASK_TYPE } from \"../../worker/expo/processors\";\nimport { ExpoArkProvider } from \"../../providers/expoArk\";\nimport { ExpoIndexerProvider } from \"../../providers/expoIndexer\";\nimport { getRandomId } from \"../utils\";\n\n// ── Persisted config ─────────────────────────────────────────────\n\n/**\n * Wallet parameters persisted by @see ExpoWallet.setup and read\n * by the background handler to reconstruct providers and `extendVtxo`\n * without a network call.\n */\nexport interface PersistedBackgroundConfig {\n arkServerUrl: string;\n pubkeyHex: string;\n serverPubKeyHex: string;\n exitTimelockValue: string;\n exitTimelockType: \"blocks\" | \"seconds\";\n}\n\n// ── Public API ───────────────────────────────────────────────────\n\n/**\n * Options for @see defineExpoBackgroundTask.\n */\nexport interface DefineBackgroundTaskOptions {\n /** AsyncStorage-backed queue (must match the one passed to ExpoWallet.setup). */\n taskQueue: AsyncStorageTaskQueue;\n /** Wallet repository (fresh instance is fine — connects to the same DB). */\n walletRepository: WalletRepository;\n /** Contract repository (fresh instance is fine — connects to the same DB). */\n contractRepository: ContractRepository;\n /** Processors to run. Defaults to `[contractPollProcessor]`. */\n processors?: TaskProcessor[];\n}\n\n/**\n * Define the Expo background task handler.\n *\n * **Must be called at module/global scope** (before React mounts) so\n * Expo's TaskManager can resume the task on cold start.\n *\n * Pair with @see registerExpoBackgroundTask to activate the OS\n * scheduler — `ExpoWallet.setup()` no longer registers the task for\n * you.\n *\n * @example\n * ```ts\n * // App entry (e.g. _layout.tsx) — module scope\n * import { defineExpoBackgroundTask } from \"@arkade-os/sdk/wallet/expo/background\";\n * import { AsyncStorageTaskQueue } from \"@arkade-os/sdk/worker/expo\";\n * import AsyncStorage from \"@react-native-async-storage/async-storage\";\n *\n * const taskQueue = new AsyncStorageTaskQueue(AsyncStorage);\n * defineExpoBackgroundTask(\"ark-background-poll\", {\n * taskQueue,\n * walletRepository: new IndexedDBWalletRepository(),\n * contractRepository: new IndexedDBContractRepository(),\n * });\n * ```\n */\nexport function defineExpoBackgroundTask(\n taskName: string,\n options: DefineBackgroundTaskOptions,\n): void {\n const {\n taskQueue,\n walletRepository,\n contractRepository,\n processors = [contractPollProcessor],\n } = options;\n\n TaskManager.defineTask(taskName, async () => {\n try {\n const config = await taskQueue.loadConfig<PersistedBackgroundConfig>();\n if (!config) {\n // No config persisted yet — ExpoWallet.setup() hasn't run.\n // Nothing to do.\n return BackgroundTask.BackgroundTaskResult.Success;\n }\n\n const indexerProvider = new ExpoIndexerProvider(config.arkServerUrl);\n const arkProvider = new ExpoArkProvider(config.arkServerUrl);\n\n const deps = createTaskDependencies({\n walletRepository,\n contractRepository,\n indexerProvider,\n arkProvider,\n });\n\n await runTasks(taskQueue, processors, deps);\n\n // Acknowledge outbox results (no foreground to consume them)\n const results = await taskQueue.getResults();\n if (results.length > 0) {\n await taskQueue.acknowledgeResults(results.map((r) => r.id));\n }\n\n // Re-seed the contract-poll task for the next OS wake\n const existing = await taskQueue.getTasks(CONTRACT_POLL_TASK_TYPE);\n if (existing.length === 0) {\n const task: TaskItem = {\n id: getRandomId(),\n type: CONTRACT_POLL_TASK_TYPE,\n data: {},\n createdAt: Date.now(),\n };\n await taskQueue.addTask(task);\n }\n\n return BackgroundTask.BackgroundTaskResult.Success;\n } catch (error) {\n console.error(\n \"[ark-sdk] Background task failed:\",\n error instanceof Error ? error.message : error,\n );\n return BackgroundTask.BackgroundTaskResult.Failed;\n }\n });\n}\n\n/**\n * Activate the OS-level background task scheduler.\n *\n * Call once after @see defineExpoBackgroundTask — typically right after\n * `ExpoWallet.setup()`. Safe to call again to update the interval.\n *\n * @param taskName - The task name passed to {@link defineExpoBackgroundTask}.\n * @param options.minimumInterval - Minimum interval in **minutes** (default\n * 15, the floor enforced by `expo-background-task`).\n *\n * @see https://docs.expo.dev/versions/latest/sdk/background-task/#backgroundtaskoptions\n */\nexport async function registerExpoBackgroundTask(\n taskName: string,\n options?: { minimumInterval?: number },\n): Promise<void> {\n await BackgroundTask.registerTaskAsync(taskName, {\n minimumInterval: options?.minimumInterval ?? 15,\n });\n}\n\n/**\n * Unregister the background task from the OS scheduler.\n *\n * `ExpoWallet.dispose()` does **not** call this — the OS-level task\n * lifecycle is the consumer's responsibility, matching the explicit\n * `register` step.\n */\nexport async function unregisterExpoBackgroundTask(taskName: string): Promise<void> {\n await BackgroundTask.unregisterTaskAsync(taskName);\n}\n"]}
@@ -1,6 +1,6 @@
1
- import { W as WalletRepository, C as ContractRepository } from '../../ark-B69ugeJw.cjs';
2
- import { a as AsyncStorageTaskQueue } from '../../asyncStorageTaskQueue-DScPdQAy.cjs';
3
- import { T as TaskProcessor } from '../../taskRunner-ClwI8jU8.cjs';
1
+ import { W as WalletRepository, C as ContractRepository } from '../../ark-acFuA57I.cjs';
2
+ import { a as AsyncStorageTaskQueue } from '../../asyncStorageTaskQueue-BO3cvMpP.cjs';
3
+ import { T as TaskProcessor } from '../../taskRunner-DEwlrgId.cjs';
4
4
  import '@scure/btc-signer/transaction.js';
5
5
  import '@scure/btc-signer/utils.js';
6
6
  import '@scure/btc-signer/psbt.js';
@@ -1,6 +1,6 @@
1
- import { W as WalletRepository, C as ContractRepository } from '../../ark-B69ugeJw.js';
2
- import { a as AsyncStorageTaskQueue } from '../../asyncStorageTaskQueue-BImF14sj.js';
3
- import { T as TaskProcessor } from '../../taskRunner-Cf80BqSy.js';
1
+ import { W as WalletRepository, C as ContractRepository } from '../../ark-acFuA57I.js';
2
+ import { a as AsyncStorageTaskQueue } from '../../asyncStorageTaskQueue-DACXtP0I.js';
3
+ import { T as TaskProcessor } from '../../taskRunner-DbCNRP31.js';
4
4
  import '@scure/btc-signer/transaction.js';
5
5
  import '@scure/btc-signer/utils.js';
6
6
  import '@scure/btc-signer/psbt.js';
@@ -1,9 +1,9 @@
1
- import { ExpoIndexerProvider, ExpoArkProvider } from '../../chunk-WIVQWYPZ.js';
2
- import { contractPollProcessor, createTaskDependencies, runTasks, CONTRACT_POLL_TASK_TYPE } from '../../chunk-3ZGANANS.js';
3
- import { getRandomId } from '../../chunk-AXCKRS2D.js';
4
- import '../../chunk-ZK3JITHP.js';
5
- import '../../chunk-UZLQUWYP.js';
6
- import '../../chunk-EFNLTS6Q.js';
1
+ import { contractPollProcessor, createTaskDependencies, runTasks, CONTRACT_POLL_TASK_TYPE } from '../../chunk-7L3P3EP5.js';
2
+ import { ExpoIndexerProvider, ExpoArkProvider } from '../../chunk-QY2YVFZT.js';
3
+ import { getRandomId } from '../../chunk-TEHJCEF3.js';
4
+ import '../../chunk-ZOY5JSVA.js';
5
+ import '../../chunk-A37WVZ5T.js';
6
+ import '../../chunk-4EIKOJLD.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';
@@ -56,7 +56,7 @@ function defineExpoBackgroundTask(taskName, options) {
56
56
  }
57
57
  async function registerExpoBackgroundTask(taskName, options) {
58
58
  await BackgroundTask.registerTaskAsync(taskName, {
59
- minimumInterval: (options?.minimumInterval ?? 15) * 60
59
+ minimumInterval: options?.minimumInterval ?? 15
60
60
  });
61
61
  }
62
62
  async function unregisterExpoBackgroundTask(taskName) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/wallet/expo/background.ts"],"names":[],"mappings":";;;;;;;;;;AAyFO,SAAS,wBAAA,CACZ,UACA,OAAA,EACI;AACJ,EAAA,MAAM;AAAA,IACF,SAAA;AAAA,IACA,gBAAA;AAAA,IACA,kBAAA;AAAA,IACA,UAAA,GAAa,CAAC,qBAAqB;AAAA,GACvC,GAAI,OAAA;AAEJ,EAAY,WAAA,CAAA,UAAA,CAAW,UAAU,YAAY;AACzC,IAAA,IAAI;AACA,MAAA,MAAM,MAAA,GAAS,MAAM,SAAA,CAAU,UAAA,EAAsC;AACrE,MAAA,IAAI,CAAC,MAAA,EAAQ;AAGT,QAAA,OAAsB,cAAA,CAAA,oBAAA,CAAqB,OAAA;AAAA,MAC/C;AAEA,MAAA,MAAM,eAAA,GAAkB,IAAI,mBAAA,CAAoB,MAAA,CAAO,YAAY,CAAA;AACnE,MAAA,MAAM,WAAA,GAAc,IAAI,eAAA,CAAgB,MAAA,CAAO,YAAY,CAAA;AAE3D,MAAA,MAAM,OAAO,sBAAA,CAAuB;AAAA,QAChC,gBAAA;AAAA,QACA,kBAAA;AAAA,QACA,eAAA;AAAA,QACA;AAAA,OACH,CAAA;AAED,MAAA,MAAM,QAAA,CAAS,SAAA,EAAW,UAAA,EAAY,IAAI,CAAA;AAG1C,MAAA,MAAM,OAAA,GAAU,MAAM,SAAA,CAAU,UAAA,EAAW;AAC3C,MAAA,IAAI,OAAA,CAAQ,SAAS,CAAA,EAAG;AACpB,QAAA,MAAM,SAAA,CAAU,mBAAmB,OAAA,CAAQ,GAAA,CAAI,CAAC,CAAA,KAAM,CAAA,CAAE,EAAE,CAAC,CAAA;AAAA,MAC/D;AAGA,MAAA,MAAM,QAAA,GAAW,MAAM,SAAA,CAAU,QAAA,CAAS,uBAAuB,CAAA;AACjE,MAAA,IAAI,QAAA,CAAS,WAAW,CAAA,EAAG;AACvB,QAAA,MAAM,IAAA,GAAiB;AAAA,UACnB,IAAI,WAAA,EAAY;AAAA,UAChB,IAAA,EAAM,uBAAA;AAAA,UACN,MAAM,EAAC;AAAA,UACP,SAAA,EAAW,KAAK,GAAA;AAAI,SACxB;AACA,QAAA,MAAM,SAAA,CAAU,QAAQ,IAAI,CAAA;AAAA,MAChC;AAEA,MAAA,OAAsB,cAAA,CAAA,oBAAA,CAAqB,OAAA;AAAA,IAC/C,SAAS,KAAA,EAAO;AACZ,MAAA,OAAA,CAAQ,KAAA;AAAA,QACJ,mCAAA;AAAA,QACA,KAAA,YAAiB,KAAA,GAAQ,KAAA,CAAM,OAAA,GAAU;AAAA,OAC7C;AACA,MAAA,OAAsB,cAAA,CAAA,oBAAA,CAAqB,MAAA;AAAA,IAC/C;AAAA,EACJ,CAAC,CAAA;AACL;AAcA,eAAsB,0BAAA,CAClB,UACA,OAAA,EACa;AACb,EAAA,MAAqB,iCAAkB,QAAA,EAAU;AAAA,IAC7C,eAAA,EAAA,CAAkB,OAAA,EAAS,eAAA,IAAmB,EAAA,IAAM;AAAA,GACvD,CAAA;AACL;AASA,eAAsB,6BAA6B,QAAA,EAAiC;AAChF,EAAA,MAAqB,mCAAoB,QAAQ,CAAA;AACrD","file":"background.js","sourcesContent":["/**\n * Expo background task entrypoint — `@arkade-os/sdk/wallet/expo/background`.\n *\n * This subpath is the **only** module in the package that touches\n * `expo-task-manager` / `expo-background-task`. It is split out from\n * `/wallet/expo` on purpose: those packages have no web platform and\n * are declared as optional peer dependencies, so importing them from\n * `/wallet/expo` would regress react-native-web / Node consumers who\n * only need the foreground APIs.\n *\n * The imports are static (not lazy `require()`) because Metro's static\n * dependency collector cannot see modules hidden behind `__require()`\n * in the ESM build — without static imports the packages never enter\n * the bundle graph and resolution fails at runtime. See\n * https://github.com/arkade-os/ts-sdk/issues/486 for details.\n *\n * Consumers install the peers in their Expo app:\n * npx expo install expo-task-manager expo-background-task\n */\nimport * as TaskManager from \"expo-task-manager\";\nimport * as BackgroundTask from \"expo-background-task\";\n\nimport type { WalletRepository } from \"../../repositories/walletRepository\";\nimport type { ContractRepository } from \"../../repositories/contractRepository\";\nimport type { AsyncStorageTaskQueue } from \"../../worker/expo/asyncStorageTaskQueue\";\nimport type { TaskProcessor } from \"../../worker/expo/taskRunner\";\nimport type { TaskItem } from \"../../worker/expo/taskQueue\";\nimport { runTasks, createTaskDependencies } from \"../../worker/expo/taskRunner\";\nimport { contractPollProcessor, CONTRACT_POLL_TASK_TYPE } from \"../../worker/expo/processors\";\nimport { ExpoArkProvider } from \"../../providers/expoArk\";\nimport { ExpoIndexerProvider } from \"../../providers/expoIndexer\";\nimport { getRandomId } from \"../utils\";\n\n// ── Persisted config ─────────────────────────────────────────────\n\n/**\n * Wallet parameters persisted by @see ExpoWallet.setup and read\n * by the background handler to reconstruct providers and `extendVtxo`\n * without a network call.\n */\nexport interface PersistedBackgroundConfig {\n arkServerUrl: string;\n pubkeyHex: string;\n serverPubKeyHex: string;\n exitTimelockValue: string;\n exitTimelockType: \"blocks\" | \"seconds\";\n}\n\n// ── Public API ───────────────────────────────────────────────────\n\n/**\n * Options for @see defineExpoBackgroundTask.\n */\nexport interface DefineBackgroundTaskOptions {\n /** AsyncStorage-backed queue (must match the one passed to ExpoWallet.setup). */\n taskQueue: AsyncStorageTaskQueue;\n /** Wallet repository (fresh instance is fine — connects to the same DB). */\n walletRepository: WalletRepository;\n /** Contract repository (fresh instance is fine — connects to the same DB). */\n contractRepository: ContractRepository;\n /** Processors to run. Defaults to `[contractPollProcessor]`. */\n processors?: TaskProcessor[];\n}\n\n/**\n * Define the Expo background task handler.\n *\n * **Must be called at module/global scope** (before React mounts) so\n * Expo's TaskManager can resume the task on cold start.\n *\n * Pair with @see registerExpoBackgroundTask to activate the OS\n * scheduler — `ExpoWallet.setup()` no longer registers the task for\n * you.\n *\n * @example\n * ```ts\n * // App entry (e.g. _layout.tsx) — module scope\n * import { defineExpoBackgroundTask } from \"@arkade-os/sdk/wallet/expo/background\";\n * import { AsyncStorageTaskQueue } from \"@arkade-os/sdk/worker/expo\";\n * import AsyncStorage from \"@react-native-async-storage/async-storage\";\n *\n * const taskQueue = new AsyncStorageTaskQueue(AsyncStorage);\n * defineExpoBackgroundTask(\"ark-background-poll\", {\n * taskQueue,\n * walletRepository: new IndexedDBWalletRepository(),\n * contractRepository: new IndexedDBContractRepository(),\n * });\n * ```\n */\nexport function defineExpoBackgroundTask(\n taskName: string,\n options: DefineBackgroundTaskOptions,\n): void {\n const {\n taskQueue,\n walletRepository,\n contractRepository,\n processors = [contractPollProcessor],\n } = options;\n\n TaskManager.defineTask(taskName, async () => {\n try {\n const config = await taskQueue.loadConfig<PersistedBackgroundConfig>();\n if (!config) {\n // No config persisted yet — ExpoWallet.setup() hasn't run.\n // Nothing to do.\n return BackgroundTask.BackgroundTaskResult.Success;\n }\n\n const indexerProvider = new ExpoIndexerProvider(config.arkServerUrl);\n const arkProvider = new ExpoArkProvider(config.arkServerUrl);\n\n const deps = createTaskDependencies({\n walletRepository,\n contractRepository,\n indexerProvider,\n arkProvider,\n });\n\n await runTasks(taskQueue, processors, deps);\n\n // Acknowledge outbox results (no foreground to consume them)\n const results = await taskQueue.getResults();\n if (results.length > 0) {\n await taskQueue.acknowledgeResults(results.map((r) => r.id));\n }\n\n // Re-seed the contract-poll task for the next OS wake\n const existing = await taskQueue.getTasks(CONTRACT_POLL_TASK_TYPE);\n if (existing.length === 0) {\n const task: TaskItem = {\n id: getRandomId(),\n type: CONTRACT_POLL_TASK_TYPE,\n data: {},\n createdAt: Date.now(),\n };\n await taskQueue.addTask(task);\n }\n\n return BackgroundTask.BackgroundTaskResult.Success;\n } catch (error) {\n console.error(\n \"[ark-sdk] Background task failed:\",\n error instanceof Error ? error.message : error,\n );\n return BackgroundTask.BackgroundTaskResult.Failed;\n }\n });\n}\n\n/**\n * Activate the OS-level background task scheduler.\n *\n * Call once after @see defineExpoBackgroundTask — typically right after\n * `ExpoWallet.setup()`. Safe to call again to update the interval.\n *\n * @param taskName - The task name passed to {@link defineExpoBackgroundTask}.\n * @param options.minimumInterval - Minimum interval in **minutes** (default\n * 15, the floor enforced by `expo-background-task`).\n *\n * @see https://docs.expo.dev/versions/latest/sdk/background-task/#backgroundtaskoptions\n */\nexport async function registerExpoBackgroundTask(\n taskName: string,\n options?: { minimumInterval?: number },\n): Promise<void> {\n await BackgroundTask.registerTaskAsync(taskName, {\n minimumInterval: (options?.minimumInterval ?? 15) * 60,\n });\n}\n\n/**\n * Unregister the background task from the OS scheduler.\n *\n * `ExpoWallet.dispose()` does **not** call this — the OS-level task\n * lifecycle is the consumer's responsibility, matching the explicit\n * `register` step.\n */\nexport async function unregisterExpoBackgroundTask(taskName: string): Promise<void> {\n await BackgroundTask.unregisterTaskAsync(taskName);\n}\n"]}
1
+ {"version":3,"sources":["../../../src/wallet/expo/background.ts"],"names":[],"mappings":";;;;;;;;;;AAyFO,SAAS,wBAAA,CACZ,UACA,OAAA,EACI;AACJ,EAAA,MAAM;AAAA,IACF,SAAA;AAAA,IACA,gBAAA;AAAA,IACA,kBAAA;AAAA,IACA,UAAA,GAAa,CAAC,qBAAqB;AAAA,GACvC,GAAI,OAAA;AAEJ,EAAY,WAAA,CAAA,UAAA,CAAW,UAAU,YAAY;AACzC,IAAA,IAAI;AACA,MAAA,MAAM,MAAA,GAAS,MAAM,SAAA,CAAU,UAAA,EAAsC;AACrE,MAAA,IAAI,CAAC,MAAA,EAAQ;AAGT,QAAA,OAAsB,cAAA,CAAA,oBAAA,CAAqB,OAAA;AAAA,MAC/C;AAEA,MAAA,MAAM,eAAA,GAAkB,IAAI,mBAAA,CAAoB,MAAA,CAAO,YAAY,CAAA;AACnE,MAAA,MAAM,WAAA,GAAc,IAAI,eAAA,CAAgB,MAAA,CAAO,YAAY,CAAA;AAE3D,MAAA,MAAM,OAAO,sBAAA,CAAuB;AAAA,QAChC,gBAAA;AAAA,QACA,kBAAA;AAAA,QACA,eAAA;AAAA,QACA;AAAA,OACH,CAAA;AAED,MAAA,MAAM,QAAA,CAAS,SAAA,EAAW,UAAA,EAAY,IAAI,CAAA;AAG1C,MAAA,MAAM,OAAA,GAAU,MAAM,SAAA,CAAU,UAAA,EAAW;AAC3C,MAAA,IAAI,OAAA,CAAQ,SAAS,CAAA,EAAG;AACpB,QAAA,MAAM,SAAA,CAAU,mBAAmB,OAAA,CAAQ,GAAA,CAAI,CAAC,CAAA,KAAM,CAAA,CAAE,EAAE,CAAC,CAAA;AAAA,MAC/D;AAGA,MAAA,MAAM,QAAA,GAAW,MAAM,SAAA,CAAU,QAAA,CAAS,uBAAuB,CAAA;AACjE,MAAA,IAAI,QAAA,CAAS,WAAW,CAAA,EAAG;AACvB,QAAA,MAAM,IAAA,GAAiB;AAAA,UACnB,IAAI,WAAA,EAAY;AAAA,UAChB,IAAA,EAAM,uBAAA;AAAA,UACN,MAAM,EAAC;AAAA,UACP,SAAA,EAAW,KAAK,GAAA;AAAI,SACxB;AACA,QAAA,MAAM,SAAA,CAAU,QAAQ,IAAI,CAAA;AAAA,MAChC;AAEA,MAAA,OAAsB,cAAA,CAAA,oBAAA,CAAqB,OAAA;AAAA,IAC/C,SAAS,KAAA,EAAO;AACZ,MAAA,OAAA,CAAQ,KAAA;AAAA,QACJ,mCAAA;AAAA,QACA,KAAA,YAAiB,KAAA,GAAQ,KAAA,CAAM,OAAA,GAAU;AAAA,OAC7C;AACA,MAAA,OAAsB,cAAA,CAAA,oBAAA,CAAqB,MAAA;AAAA,IAC/C;AAAA,EACJ,CAAC,CAAA;AACL;AAcA,eAAsB,0BAAA,CAClB,UACA,OAAA,EACa;AACb,EAAA,MAAqB,iCAAkB,QAAA,EAAU;AAAA,IAC7C,eAAA,EAAiB,SAAS,eAAA,IAAmB;AAAA,GAChD,CAAA;AACL;AASA,eAAsB,6BAA6B,QAAA,EAAiC;AAChF,EAAA,MAAqB,mCAAoB,QAAQ,CAAA;AACrD","file":"background.js","sourcesContent":["/**\n * Expo background task entrypoint — `@arkade-os/sdk/wallet/expo/background`.\n *\n * This subpath is the **only** module in the package that touches\n * `expo-task-manager` / `expo-background-task`. It is split out from\n * `/wallet/expo` on purpose: those packages have no web platform and\n * are declared as optional peer dependencies, so importing them from\n * `/wallet/expo` would regress react-native-web / Node consumers who\n * only need the foreground APIs.\n *\n * The imports are static (not lazy `require()`) because Metro's static\n * dependency collector cannot see modules hidden behind `__require()`\n * in the ESM build — without static imports the packages never enter\n * the bundle graph and resolution fails at runtime. See\n * https://github.com/arkade-os/ts-sdk/issues/486 for details.\n *\n * Consumers install the peers in their Expo app:\n * npx expo install expo-task-manager expo-background-task\n */\nimport * as TaskManager from \"expo-task-manager\";\nimport * as BackgroundTask from \"expo-background-task\";\n\nimport type { WalletRepository } from \"../../repositories/walletRepository\";\nimport type { ContractRepository } from \"../../repositories/contractRepository\";\nimport type { AsyncStorageTaskQueue } from \"../../worker/expo/asyncStorageTaskQueue\";\nimport type { TaskProcessor } from \"../../worker/expo/taskRunner\";\nimport type { TaskItem } from \"../../worker/expo/taskQueue\";\nimport { runTasks, createTaskDependencies } from \"../../worker/expo/taskRunner\";\nimport { contractPollProcessor, CONTRACT_POLL_TASK_TYPE } from \"../../worker/expo/processors\";\nimport { ExpoArkProvider } from \"../../providers/expoArk\";\nimport { ExpoIndexerProvider } from \"../../providers/expoIndexer\";\nimport { getRandomId } from \"../utils\";\n\n// ── Persisted config ─────────────────────────────────────────────\n\n/**\n * Wallet parameters persisted by @see ExpoWallet.setup and read\n * by the background handler to reconstruct providers and `extendVtxo`\n * without a network call.\n */\nexport interface PersistedBackgroundConfig {\n arkServerUrl: string;\n pubkeyHex: string;\n serverPubKeyHex: string;\n exitTimelockValue: string;\n exitTimelockType: \"blocks\" | \"seconds\";\n}\n\n// ── Public API ───────────────────────────────────────────────────\n\n/**\n * Options for @see defineExpoBackgroundTask.\n */\nexport interface DefineBackgroundTaskOptions {\n /** AsyncStorage-backed queue (must match the one passed to ExpoWallet.setup). */\n taskQueue: AsyncStorageTaskQueue;\n /** Wallet repository (fresh instance is fine — connects to the same DB). */\n walletRepository: WalletRepository;\n /** Contract repository (fresh instance is fine — connects to the same DB). */\n contractRepository: ContractRepository;\n /** Processors to run. Defaults to `[contractPollProcessor]`. */\n processors?: TaskProcessor[];\n}\n\n/**\n * Define the Expo background task handler.\n *\n * **Must be called at module/global scope** (before React mounts) so\n * Expo's TaskManager can resume the task on cold start.\n *\n * Pair with @see registerExpoBackgroundTask to activate the OS\n * scheduler — `ExpoWallet.setup()` no longer registers the task for\n * you.\n *\n * @example\n * ```ts\n * // App entry (e.g. _layout.tsx) — module scope\n * import { defineExpoBackgroundTask } from \"@arkade-os/sdk/wallet/expo/background\";\n * import { AsyncStorageTaskQueue } from \"@arkade-os/sdk/worker/expo\";\n * import AsyncStorage from \"@react-native-async-storage/async-storage\";\n *\n * const taskQueue = new AsyncStorageTaskQueue(AsyncStorage);\n * defineExpoBackgroundTask(\"ark-background-poll\", {\n * taskQueue,\n * walletRepository: new IndexedDBWalletRepository(),\n * contractRepository: new IndexedDBContractRepository(),\n * });\n * ```\n */\nexport function defineExpoBackgroundTask(\n taskName: string,\n options: DefineBackgroundTaskOptions,\n): void {\n const {\n taskQueue,\n walletRepository,\n contractRepository,\n processors = [contractPollProcessor],\n } = options;\n\n TaskManager.defineTask(taskName, async () => {\n try {\n const config = await taskQueue.loadConfig<PersistedBackgroundConfig>();\n if (!config) {\n // No config persisted yet — ExpoWallet.setup() hasn't run.\n // Nothing to do.\n return BackgroundTask.BackgroundTaskResult.Success;\n }\n\n const indexerProvider = new ExpoIndexerProvider(config.arkServerUrl);\n const arkProvider = new ExpoArkProvider(config.arkServerUrl);\n\n const deps = createTaskDependencies({\n walletRepository,\n contractRepository,\n indexerProvider,\n arkProvider,\n });\n\n await runTasks(taskQueue, processors, deps);\n\n // Acknowledge outbox results (no foreground to consume them)\n const results = await taskQueue.getResults();\n if (results.length > 0) {\n await taskQueue.acknowledgeResults(results.map((r) => r.id));\n }\n\n // Re-seed the contract-poll task for the next OS wake\n const existing = await taskQueue.getTasks(CONTRACT_POLL_TASK_TYPE);\n if (existing.length === 0) {\n const task: TaskItem = {\n id: getRandomId(),\n type: CONTRACT_POLL_TASK_TYPE,\n data: {},\n createdAt: Date.now(),\n };\n await taskQueue.addTask(task);\n }\n\n return BackgroundTask.BackgroundTaskResult.Success;\n } catch (error) {\n console.error(\n \"[ark-sdk] Background task failed:\",\n error instanceof Error ? error.message : error,\n );\n return BackgroundTask.BackgroundTaskResult.Failed;\n }\n });\n}\n\n/**\n * Activate the OS-level background task scheduler.\n *\n * Call once after @see defineExpoBackgroundTask — typically right after\n * `ExpoWallet.setup()`. Safe to call again to update the interval.\n *\n * @param taskName - The task name passed to {@link defineExpoBackgroundTask}.\n * @param options.minimumInterval - Minimum interval in **minutes** (default\n * 15, the floor enforced by `expo-background-task`).\n *\n * @see https://docs.expo.dev/versions/latest/sdk/background-task/#backgroundtaskoptions\n */\nexport async function registerExpoBackgroundTask(\n taskName: string,\n options?: { minimumInterval?: number },\n): Promise<void> {\n await BackgroundTask.registerTaskAsync(taskName, {\n minimumInterval: options?.minimumInterval ?? 15,\n });\n}\n\n/**\n * Unregister the background task from the OS scheduler.\n *\n * `ExpoWallet.dispose()` does **not** call this — the OS-level task\n * lifecycle is the consumer's responsibility, matching the explicit\n * `register` step.\n */\nexport async function unregisterExpoBackgroundTask(taskName: string): Promise<void> {\n await BackgroundTask.unregisterTaskAsync(taskName);\n}\n"]}
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var chunk3Z5HK35D_cjs = require('../../chunk-3Z5HK35D.cjs');
4
- var chunkML33GFCH_cjs = require('../../chunk-ML33GFCH.cjs');
5
- var chunkFZPYPEWN_cjs = require('../../chunk-FZPYPEWN.cjs');
6
- require('../../chunk-IEMPH7J6.cjs');
7
- require('../../chunk-E7HB3GKK.cjs');
3
+ var chunkYRLBZJYO_cjs = require('../../chunk-YRLBZJYO.cjs');
4
+ var chunkD5LUPJJP_cjs = require('../../chunk-D5LUPJJP.cjs');
5
+ require('../../chunk-RNECH3TA.cjs');
6
+ require('../../chunk-53XNU2EL.cjs');
7
+ var chunkGMUVWKOK_cjs = require('../../chunk-GMUVWKOK.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 chunkML33GFCH_cjs.Wallet.create(config);
62
- const processors = config.background.processors ?? [chunk3Z5HK35D_cjs.contractPollProcessor];
61
+ const wallet = await chunkD5LUPJJP_cjs.Wallet.create(config);
62
+ const processors = config.background.processors ?? [chunkYRLBZJYO_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) => chunkML33GFCH_cjs.extendVirtualCoinForContract(vtxo, contract)
68
+ extendVtxo: (vtxo, contract) => chunkD5LUPJJP_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 chunkFZPYPEWN_cjs.RestArkProvider ? wallet.arkProvider.serverUrl : void 0);
72
+ const arkServerUrl = config.arkServerUrl || (wallet.arkProvider instanceof chunkGMUVWKOK_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 chunk3Z5HK35D_cjs.runTasks(this.taskQueue, this.processors, this.deps);
103
+ await chunkYRLBZJYO_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(chunk3Z5HK35D_cjs.CONTRACT_POLL_TASK_TYPE);
112
+ const existing = await this.taskQueue.getTasks(chunkYRLBZJYO_cjs.CONTRACT_POLL_TASK_TYPE);
113
113
  if (existing.length > 0) return;
114
114
  const task = {
115
- id: chunkML33GFCH_cjs.getRandomId(),
116
- type: chunk3Z5HK35D_cjs.CONTRACT_POLL_TASK_TYPE,
115
+ id: chunkD5LUPJJP_cjs.getRandomId(),
116
+ type: chunkYRLBZJYO_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(chunk3Z5HK35D_cjs.CONTRACT_POLL_TASK_TYPE);
123
+ const tasks = await this.taskQueue.getTasks(chunkYRLBZJYO_cjs.CONTRACT_POLL_TASK_TYPE);
124
124
  for (const task of tasks) {
125
125
  await this.taskQueue.removeTask(task.id);
126
126
  }
@@ -1,10 +1,10 @@
1
- import { W as Wallet, P as ProviderConnectionState } from '../../wallet-B6Xiferv.cjs';
2
- import { I as IWallet, a as Identity, b as WalletConfig, c as WalletBalance, G as GetVtxosFilter, N as NormalizedExtendedVirtualCoin, E as ExtendedCoin, A as ArkTransaction, d as ActivityRegistry, e as Activity, f as IContractManager, g as IDelegateManager, S as SendBitcoinParams, h as SettleParams, i as SettlementEvent, R as Recipient, j as IAssetManager } from '../../ark-B69ugeJw.cjs';
3
- import { c as TaskQueue, T as TaskProcessor } from '../../taskRunner-ClwI8jU8.cjs';
1
+ import { W as Wallet, P as ProviderConnectionState } from '../../wallet-ByjM6L20.cjs';
2
+ import { I as IWallet, a as Identity, b as WalletConfig, c as WalletBalance, G as GetVtxosFilter, N as NormalizedExtendedVirtualCoin, E as ExtendedCoin, A as ArkTransaction, d as ActivityRegistry, e as Activity, f as IContractManager, g as IDelegateManager, S as SendBitcoinParams, h as SettleParams, i as SettlementEvent, R as Recipient, j as IAssetManager } from '../../ark-acFuA57I.cjs';
3
+ import { c as TaskQueue, T as TaskProcessor } from '../../taskRunner-DEwlrgId.cjs';
4
4
  import '@scure/btc-signer';
5
5
  import '@scure/btc-signer/utils.js';
6
6
  import '@scure/btc-signer/psbt.js';
7
- import '../../delegate-C_Y2YrXC.cjs';
7
+ import '../../delegate-Ca_wXiYE.cjs';
8
8
  import '@scure/btc-signer/transaction.js';
9
9
 
10
10
  /**
@@ -1,10 +1,10 @@
1
- import { W as Wallet, P as ProviderConnectionState } from '../../wallet-CuHAI-eW.js';
2
- import { I as IWallet, a as Identity, b as WalletConfig, c as WalletBalance, G as GetVtxosFilter, N as NormalizedExtendedVirtualCoin, E as ExtendedCoin, A as ArkTransaction, d as ActivityRegistry, e as Activity, f as IContractManager, g as IDelegateManager, S as SendBitcoinParams, h as SettleParams, i as SettlementEvent, R as Recipient, j as IAssetManager } from '../../ark-B69ugeJw.js';
3
- import { c as TaskQueue, T as TaskProcessor } from '../../taskRunner-Cf80BqSy.js';
1
+ import { W as Wallet, P as ProviderConnectionState } from '../../wallet-B9rpddG2.js';
2
+ import { I as IWallet, a as Identity, b as WalletConfig, c as WalletBalance, G as GetVtxosFilter, N as NormalizedExtendedVirtualCoin, E as ExtendedCoin, A as ArkTransaction, d as ActivityRegistry, e as Activity, f as IContractManager, g as IDelegateManager, S as SendBitcoinParams, h as SettleParams, i as SettlementEvent, R as Recipient, j as IAssetManager } from '../../ark-acFuA57I.js';
3
+ import { c as TaskQueue, T as TaskProcessor } from '../../taskRunner-DbCNRP31.js';
4
4
  import '@scure/btc-signer';
5
5
  import '@scure/btc-signer/utils.js';
6
6
  import '@scure/btc-signer/psbt.js';
7
- import '../../delegate-BU-Cpyjw.js';
7
+ import '../../delegate-DjwZZi6L.js';
8
8
  import '@scure/btc-signer/transaction.js';
9
9
 
10
10
  /**
@@ -1,8 +1,8 @@
1
- import { contractPollProcessor, runTasks, CONTRACT_POLL_TASK_TYPE } from '../../chunk-3ZGANANS.js';
2
- import { Wallet, getRandomId, extendVirtualCoinForContract } from '../../chunk-AXCKRS2D.js';
3
- import { RestArkProvider } from '../../chunk-ZK3JITHP.js';
4
- import '../../chunk-UZLQUWYP.js';
5
- import '../../chunk-EFNLTS6Q.js';
1
+ import { contractPollProcessor, runTasks, CONTRACT_POLL_TASK_TYPE } from '../../chunk-7L3P3EP5.js';
2
+ import { Wallet, getRandomId, extendVirtualCoinForContract } from '../../chunk-TEHJCEF3.js';
3
+ import '../../chunk-ZOY5JSVA.js';
4
+ import '../../chunk-A37WVZ5T.js';
5
+ import { RestArkProvider } from '../../chunk-4EIKOJLD.js';
6
6
  import '../../chunk-NSBPE2FW.js';
7
7
  import { hex } from '@scure/base';
8
8
 
@@ -1,8 +1,8 @@
1
1
  import { Transaction } from '@scure/btc-signer';
2
2
  import { Bytes } from '@scure/btc-signer/utils.js';
3
- import { B as BatchStartedEvent, u as TreeSigningStartedEvent, v as TxTree, w as TreeNoncesEvent, x as BatchFinalizationEvent, y as BatchFinalizedEvent, z as BatchFailedEvent, D as TreeTxEvent, F as TreeSignatureEvent, i as SettlementEvent, b as WalletConfig, W as WalletRepository, C as ContractRepository, H as DescriptorProvider, f as IContractManager, J as IReadonlyWallet, K as ReadonlyIdentity, L as Network, O as OnchainProvider, o as IndexerProvider, M as DelegateProvider, P as ReadonlyWalletConfig, Q as IntentRepository, U as VirtualTxRepository, X as ExitCaptureMode, Y as ExitDataSource, p as RelativeTimelock, d as ActivityRegistry, Z as IReadonlyAssetManager, _ as ContractSyncState, n as ArkProvider, $ as NetworkName, a0 as ArkInfo, a1 as ArkAddress, c as WalletBalance, G as GetVtxosFilter, N as NormalizedExtendedVirtualCoin, A as ArkTransaction, e as Activity, E as ExtendedCoin, a2 as Coin, t as ExtendedVirtualCoin, a3 as ContractManager, a4 as ContractManagerConfig, I as IWallet, a as Identity, a5 as CSVMultisigTapscript, a6 as SettlementConfig, j as IAssetManager, a7 as VtxoManager, g as IDelegateManager, S as SendBitcoinParams, h as SettleParams, R as Recipient, a8 as SignerSession, a9 as SignedIntent, aa as Intent, ab as TimeHeight } from './ark-B69ugeJw.cjs';
3
+ import { J as BatchStartedEvent, K as TreeSigningStartedEvent, L as TxTree, M as TreeNoncesEvent, P as BatchFinalizationEvent, Q as BatchFinalizedEvent, U as BatchFailedEvent, X as TreeTxEvent, Y as TreeSignatureEvent, i as SettlementEvent, b as WalletConfig, W as WalletRepository, C as ContractRepository, Z as DescriptorProvider, f as IContractManager, _ as IReadonlyWallet, $ as ReadonlyIdentity, a0 as Network, a1 as OnchainProvider, o as IndexerProvider, a2 as DelegateProvider, a3 as ReadonlyWalletConfig, x as IntentRepository, B as VirtualTxRepository, a4 as ExitCaptureMode, a5 as ExitDataSource, p as RelativeTimelock, d as ActivityRegistry, a6 as IReadonlyAssetManager, a7 as ContractSyncState, n as ArkProvider, a8 as NetworkName, a9 as ArkInfo, aa as ArkAddress, c as WalletBalance, G as GetVtxosFilter, N as NormalizedExtendedVirtualCoin, A as ArkTransaction, e as Activity, E as ExtendedCoin, ab as Coin, t as ExtendedVirtualCoin, ac as ContractManager, ad as ContractManagerConfig, I as IWallet, a as Identity, ae as CSVMultisigTapscript, af as SettlementConfig, j as IAssetManager, ag as VtxoManager, g as IDelegateManager, S as SendBitcoinParams, h as SettleParams, R as Recipient, ah as SignerSession, ai as SignedIntent, aj as Intent, ak as TimeHeight } from './ark-acFuA57I.js';
4
4
  import { TransactionOutput } from '@scure/btc-signer/psbt.js';
5
- import { D as DefaultVtxo, a as DelegateVtxo } from './delegate-C_Y2YrXC.cjs';
5
+ import { D as DefaultVtxo, a as DelegateVtxo } from './delegate-DjwZZi6L.js';
6
6
 
7
7
  declare class ArkError extends Error {
8
8
  readonly code: number;
@@ -1,8 +1,8 @@
1
1
  import { Transaction } from '@scure/btc-signer';
2
2
  import { Bytes } from '@scure/btc-signer/utils.js';
3
- import { B as BatchStartedEvent, u as TreeSigningStartedEvent, v as TxTree, w as TreeNoncesEvent, x as BatchFinalizationEvent, y as BatchFinalizedEvent, z as BatchFailedEvent, D as TreeTxEvent, F as TreeSignatureEvent, i as SettlementEvent, b as WalletConfig, W as WalletRepository, C as ContractRepository, H as DescriptorProvider, f as IContractManager, J as IReadonlyWallet, K as ReadonlyIdentity, L as Network, O as OnchainProvider, o as IndexerProvider, M as DelegateProvider, P as ReadonlyWalletConfig, Q as IntentRepository, U as VirtualTxRepository, X as ExitCaptureMode, Y as ExitDataSource, p as RelativeTimelock, d as ActivityRegistry, Z as IReadonlyAssetManager, _ as ContractSyncState, n as ArkProvider, $ as NetworkName, a0 as ArkInfo, a1 as ArkAddress, c as WalletBalance, G as GetVtxosFilter, N as NormalizedExtendedVirtualCoin, A as ArkTransaction, e as Activity, E as ExtendedCoin, a2 as Coin, t as ExtendedVirtualCoin, a3 as ContractManager, a4 as ContractManagerConfig, I as IWallet, a as Identity, a5 as CSVMultisigTapscript, a6 as SettlementConfig, j as IAssetManager, a7 as VtxoManager, g as IDelegateManager, S as SendBitcoinParams, h as SettleParams, R as Recipient, a8 as SignerSession, a9 as SignedIntent, aa as Intent, ab as TimeHeight } from './ark-B69ugeJw.js';
3
+ import { J as BatchStartedEvent, K as TreeSigningStartedEvent, L as TxTree, M as TreeNoncesEvent, P as BatchFinalizationEvent, Q as BatchFinalizedEvent, U as BatchFailedEvent, X as TreeTxEvent, Y as TreeSignatureEvent, i as SettlementEvent, b as WalletConfig, W as WalletRepository, C as ContractRepository, Z as DescriptorProvider, f as IContractManager, _ as IReadonlyWallet, $ as ReadonlyIdentity, a0 as Network, a1 as OnchainProvider, o as IndexerProvider, a2 as DelegateProvider, a3 as ReadonlyWalletConfig, x as IntentRepository, B as VirtualTxRepository, a4 as ExitCaptureMode, a5 as ExitDataSource, p as RelativeTimelock, d as ActivityRegistry, a6 as IReadonlyAssetManager, a7 as ContractSyncState, n as ArkProvider, a8 as NetworkName, a9 as ArkInfo, aa as ArkAddress, c as WalletBalance, G as GetVtxosFilter, N as NormalizedExtendedVirtualCoin, A as ArkTransaction, e as Activity, E as ExtendedCoin, ab as Coin, t as ExtendedVirtualCoin, ac as ContractManager, ad as ContractManagerConfig, I as IWallet, a as Identity, ae as CSVMultisigTapscript, af as SettlementConfig, j as IAssetManager, ag as VtxoManager, g as IDelegateManager, S as SendBitcoinParams, h as SettleParams, R as Recipient, ah as SignerSession, ai as SignedIntent, aj as Intent, ak as TimeHeight } from './ark-acFuA57I.cjs';
4
4
  import { TransactionOutput } from '@scure/btc-signer/psbt.js';
5
- import { D as DefaultVtxo, a as DelegateVtxo } from './delegate-BU-Cpyjw.js';
5
+ import { D as DefaultVtxo, a as DelegateVtxo } from './delegate-Ca_wXiYE.cjs';
6
6
 
7
7
  declare class ArkError extends Error {
8
8
  readonly code: number;
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var chunk3Z5HK35D_cjs = require('../../chunk-3Z5HK35D.cjs');
4
- require('../../chunk-ML33GFCH.cjs');
5
- require('../../chunk-FZPYPEWN.cjs');
6
- require('../../chunk-IEMPH7J6.cjs');
7
- require('../../chunk-E7HB3GKK.cjs');
3
+ var chunkYRLBZJYO_cjs = require('../../chunk-YRLBZJYO.cjs');
4
+ require('../../chunk-D5LUPJJP.cjs');
5
+ require('../../chunk-RNECH3TA.cjs');
6
+ require('../../chunk-53XNU2EL.cjs');
7
+ require('../../chunk-GMUVWKOK.cjs');
8
8
  require('../../chunk-5BLDMQED.cjs');
9
9
 
10
10
  // src/worker/expo/taskQueue.ts
@@ -121,19 +121,19 @@ var AsyncStorageTaskQueue = class {
121
121
 
122
122
  Object.defineProperty(exports, "CONTRACT_POLL_TASK_TYPE", {
123
123
  enumerable: true,
124
- get: function () { return chunk3Z5HK35D_cjs.CONTRACT_POLL_TASK_TYPE; }
124
+ get: function () { return chunkYRLBZJYO_cjs.CONTRACT_POLL_TASK_TYPE; }
125
125
  });
126
126
  Object.defineProperty(exports, "contractPollProcessor", {
127
127
  enumerable: true,
128
- get: function () { return chunk3Z5HK35D_cjs.contractPollProcessor; }
128
+ get: function () { return chunkYRLBZJYO_cjs.contractPollProcessor; }
129
129
  });
130
130
  Object.defineProperty(exports, "createTaskDependencies", {
131
131
  enumerable: true,
132
- get: function () { return chunk3Z5HK35D_cjs.createTaskDependencies; }
132
+ get: function () { return chunkYRLBZJYO_cjs.createTaskDependencies; }
133
133
  });
134
134
  Object.defineProperty(exports, "runTasks", {
135
135
  enumerable: true,
136
- get: function () { return chunk3Z5HK35D_cjs.runTasks; }
136
+ get: function () { return chunkYRLBZJYO_cjs.runTasks; }
137
137
  });
138
138
  exports.AsyncStorageTaskQueue = AsyncStorageTaskQueue;
139
139
  exports.InMemoryTaskQueue = InMemoryTaskQueue;
@@ -1,7 +1,7 @@
1
- import { T as TaskProcessor } from '../../taskRunner-ClwI8jU8.cjs';
2
- export { C as CreateTaskDependenciesOptions, I as InMemoryTaskQueue, a as TaskDependencies, b as TaskItem, c as TaskQueue, d as TaskResult, e as createTaskDependencies, r as runTasks } from '../../taskRunner-ClwI8jU8.cjs';
3
- export { A as AsyncStorageLike, a as AsyncStorageTaskQueue } from '../../asyncStorageTaskQueue-DScPdQAy.cjs';
4
- import '../../ark-B69ugeJw.cjs';
1
+ import { T as TaskProcessor } from '../../taskRunner-DEwlrgId.cjs';
2
+ export { C as CreateTaskDependenciesOptions, I as InMemoryTaskQueue, a as TaskDependencies, b as TaskItem, c as TaskQueue, d as TaskResult, e as createTaskDependencies, r as runTasks } from '../../taskRunner-DEwlrgId.cjs';
3
+ export { A as AsyncStorageLike, a as AsyncStorageTaskQueue } from '../../asyncStorageTaskQueue-BO3cvMpP.cjs';
4
+ import '../../ark-acFuA57I.cjs';
5
5
  import '@scure/btc-signer/transaction.js';
6
6
  import '@scure/btc-signer/utils.js';
7
7
  import '@scure/btc-signer/psbt.js';
@@ -1,7 +1,7 @@
1
- import { T as TaskProcessor } from '../../taskRunner-Cf80BqSy.js';
2
- export { C as CreateTaskDependenciesOptions, I as InMemoryTaskQueue, a as TaskDependencies, b as TaskItem, c as TaskQueue, d as TaskResult, e as createTaskDependencies, r as runTasks } from '../../taskRunner-Cf80BqSy.js';
3
- export { A as AsyncStorageLike, a as AsyncStorageTaskQueue } from '../../asyncStorageTaskQueue-BImF14sj.js';
4
- import '../../ark-B69ugeJw.js';
1
+ import { T as TaskProcessor } from '../../taskRunner-DbCNRP31.js';
2
+ export { C as CreateTaskDependenciesOptions, I as InMemoryTaskQueue, a as TaskDependencies, b as TaskItem, c as TaskQueue, d as TaskResult, e as createTaskDependencies, r as runTasks } from '../../taskRunner-DbCNRP31.js';
3
+ export { A as AsyncStorageLike, a as AsyncStorageTaskQueue } from '../../asyncStorageTaskQueue-DACXtP0I.js';
4
+ import '../../ark-acFuA57I.js';
5
5
  import '@scure/btc-signer/transaction.js';
6
6
  import '@scure/btc-signer/utils.js';
7
7
  import '@scure/btc-signer/psbt.js';