@arkade-os/sdk 0.4.55 → 0.4.57

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 (75) 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-Do9Lqfsp.d.cts → ark-CJgH_pmn.d.cts} +25 -2
  8. package/dist/{ark-Do9Lqfsp.d.ts → ark-CJgH_pmn.d.ts} +25 -2
  9. package/dist/{asyncStorageTaskQueue-DOnBOEDn.d.ts → asyncStorageTaskQueue-BeeZbf-Q.d.ts} +2 -2
  10. package/dist/{asyncStorageTaskQueue-C3DYxvAT.d.cts → asyncStorageTaskQueue-BlrsUUX_.d.cts} +2 -2
  11. package/dist/{chunk-C6UYPHTQ.cjs → chunk-A7TOVUYG.cjs} +9 -9
  12. package/dist/{chunk-C6UYPHTQ.cjs.map → chunk-A7TOVUYG.cjs.map} +1 -1
  13. package/dist/{chunk-ENWR2F2P.js → chunk-ASUJNZ63.js} +3 -3
  14. package/dist/{chunk-ENWR2F2P.js.map → chunk-ASUJNZ63.js.map} +1 -1
  15. package/dist/{chunk-LAONNMM5.js → chunk-C4SVRVNM.js} +4 -4
  16. package/dist/{chunk-LAONNMM5.js.map → chunk-C4SVRVNM.js.map} +1 -1
  17. package/dist/{chunk-SG4X7SEC.js → chunk-CPS7V4A3.js} +4 -4
  18. package/dist/{chunk-SG4X7SEC.js.map → chunk-CPS7V4A3.js.map} +1 -1
  19. package/dist/{chunk-CSS74VCN.cjs → chunk-EZBKSWEL.cjs} +17 -17
  20. package/dist/{chunk-CSS74VCN.cjs.map → chunk-EZBKSWEL.cjs.map} +1 -1
  21. package/dist/{chunk-ZPL34T2Q.cjs → chunk-KEG4AAKX.cjs} +568 -413
  22. package/dist/chunk-KEG4AAKX.cjs.map +1 -0
  23. package/dist/{chunk-OWCPXRGP.cjs → chunk-KUN5ZRMW.cjs} +4 -3
  24. package/dist/chunk-KUN5ZRMW.cjs.map +1 -0
  25. package/dist/{chunk-QO3IKBYL.js → chunk-NIZPFPUM.js} +192 -49
  26. package/dist/chunk-NIZPFPUM.js.map +1 -0
  27. package/dist/{chunk-V2TOHHPW.cjs → chunk-OWTKOMJZ.cjs} +40 -40
  28. package/dist/{chunk-V2TOHHPW.cjs.map → chunk-OWTKOMJZ.cjs.map} +1 -1
  29. package/dist/{chunk-QMPNPZ2T.js → chunk-P6L2W5IL.js} +3 -3
  30. package/dist/{chunk-QMPNPZ2T.js.map → chunk-P6L2W5IL.js.map} +1 -1
  31. package/dist/{chunk-JCJ5WFS3.js → chunk-PUNBWFIV.js} +4 -3
  32. package/dist/chunk-PUNBWFIV.js.map +1 -0
  33. package/dist/{chunk-G7DOBFQN.cjs → chunk-YK6NP5KX.cjs} +15 -15
  34. package/dist/{chunk-G7DOBFQN.cjs.map → chunk-YK6NP5KX.cjs.map} +1 -1
  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-DmhFrtdq.d.ts → delegate-DM3YECSY.d.ts} +1 -1
  40. package/dist/{delegate-C0iIBxen.d.cts → delegate-Dk-OJVdf.d.cts} +1 -1
  41. package/dist/{index-BnLM1XxA.d.cts → index-Cig0RkTf.d.cts} +2 -2
  42. package/dist/{index-BNt4wcSh.d.ts → index-CnE7Gnvb.d.ts} +2 -2
  43. package/dist/index.cjs +259 -211
  44. package/dist/index.d.cts +43 -12
  45. package/dist/index.d.ts +43 -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-RwUvgQ5M.d.cts → taskRunner-CnGSTaAJ.d.cts} +2 -2
  56. package/dist/{taskRunner-Bgs-0I3x.d.ts → taskRunner-F7tWzsrC.d.ts} +2 -2
  57. package/dist/wallet/expo/background.cjs +14 -14
  58. package/dist/wallet/expo/background.d.cts +3 -3
  59. package/dist/wallet/expo/background.d.ts +3 -3
  60. package/dist/wallet/expo/background.js +6 -6
  61. package/dist/wallet/expo/index.cjs +14 -14
  62. package/dist/wallet/expo/index.d.cts +4 -4
  63. package/dist/wallet/expo/index.d.ts +4 -4
  64. package/dist/wallet/expo/index.js +5 -5
  65. package/dist/{wallet-5Aou-V5n.d.ts → wallet-D6_S0n6B.d.ts} +124 -4
  66. package/dist/{wallet-Ck7BH8zR.d.cts → wallet-DvRIQBBY.d.cts} +124 -4
  67. package/dist/worker/expo/index.cjs +9 -9
  68. package/dist/worker/expo/index.d.cts +4 -4
  69. package/dist/worker/expo/index.d.ts +4 -4
  70. package/dist/worker/expo/index.js +5 -5
  71. package/package.json +1 -1
  72. package/dist/chunk-JCJ5WFS3.js.map +0 -1
  73. package/dist/chunk-OWCPXRGP.cjs.map +0 -1
  74. package/dist/chunk-QO3IKBYL.js.map +0 -1
  75. package/dist/chunk-ZPL34T2Q.cjs.map +0 -1
@@ -1,8 +1,8 @@
1
- import { serializeVtxo, isVtxoForScript, serializeUtxo, serializeAssets, scriptFromArkAddress, deserializeVtxo, deserializeUtxo, deserializeAssets, intentMatchesFilter, intentPageBounds, isTerminalIntentState, mergeChainedTxType } from '../../chunk-QO3IKBYL.js';
2
- export { ChainedTxType } from '../../chunk-QO3IKBYL.js';
3
- import '../../chunk-ENWR2F2P.js';
4
- import '../../chunk-QMPNPZ2T.js';
5
- import '../../chunk-JCJ5WFS3.js';
1
+ import { serializeVtxo, isVtxoForScript, serializeUtxo, serializeAssets, scriptFromArkAddress, deserializeVtxo, deserializeUtxo, deserializeAssets, intentMatchesFilter, intentPageBounds, isTerminalIntentState, mergeChainedTxType } from '../../chunk-NIZPFPUM.js';
2
+ export { ChainedTxType } from '../../chunk-NIZPFPUM.js';
3
+ import '../../chunk-ASUJNZ63.js';
4
+ import '../../chunk-P6L2W5IL.js';
5
+ import '../../chunk-PUNBWFIV.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-Do9Lqfsp.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-CJgH_pmn.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 TaskQueue as a, type TaskDependencies as b, type TaskItem 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 TaskDependencies as a, type TaskItem as b, type TaskQueue 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-Do9Lqfsp.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-CJgH_pmn.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 TaskQueue as a, type TaskDependencies as b, type TaskItem 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 TaskDependencies as a, type TaskItem as b, type TaskQueue as c, type TaskResult as d, createTaskDependencies as e, runTasks as r };
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var chunkC6UYPHTQ_cjs = require('../../chunk-C6UYPHTQ.cjs');
4
- var chunkCSS74VCN_cjs = require('../../chunk-CSS74VCN.cjs');
5
- var chunkZPL34T2Q_cjs = require('../../chunk-ZPL34T2Q.cjs');
6
- require('../../chunk-G7DOBFQN.cjs');
7
- require('../../chunk-V2TOHHPW.cjs');
8
- require('../../chunk-OWCPXRGP.cjs');
3
+ var chunkA7TOVUYG_cjs = require('../../chunk-A7TOVUYG.cjs');
4
+ var chunkEZBKSWEL_cjs = require('../../chunk-EZBKSWEL.cjs');
5
+ var chunkKEG4AAKX_cjs = require('../../chunk-KEG4AAKX.cjs');
6
+ require('../../chunk-YK6NP5KX.cjs');
7
+ require('../../chunk-OWTKOMJZ.cjs');
8
+ require('../../chunk-KUN5ZRMW.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 = [chunkC6UYPHTQ_cjs.contractPollProcessor]
39
+ processors = [chunkA7TOVUYG_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 chunkCSS74VCN_cjs.ExpoIndexerProvider(config.arkServerUrl);
48
- const arkProvider = new chunkCSS74VCN_cjs.ExpoArkProvider(config.arkServerUrl);
49
- const deps = chunkC6UYPHTQ_cjs.createTaskDependencies({
47
+ const indexerProvider = new chunkEZBKSWEL_cjs.ExpoIndexerProvider(config.arkServerUrl);
48
+ const arkProvider = new chunkEZBKSWEL_cjs.ExpoArkProvider(config.arkServerUrl);
49
+ const deps = chunkA7TOVUYG_cjs.createTaskDependencies({
50
50
  walletRepository,
51
51
  contractRepository,
52
52
  indexerProvider,
53
53
  arkProvider
54
54
  });
55
- await chunkC6UYPHTQ_cjs.runTasks(taskQueue, processors, deps);
55
+ await chunkA7TOVUYG_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(chunkC6UYPHTQ_cjs.CONTRACT_POLL_TASK_TYPE);
60
+ const existing = await taskQueue.getTasks(chunkA7TOVUYG_cjs.CONTRACT_POLL_TASK_TYPE);
61
61
  if (existing.length === 0) {
62
62
  const task = {
63
- id: chunkZPL34T2Q_cjs.getRandomId(),
64
- type: chunkC6UYPHTQ_cjs.CONTRACT_POLL_TASK_TYPE,
63
+ id: chunkKEG4AAKX_cjs.getRandomId(),
64
+ type: chunkA7TOVUYG_cjs.CONTRACT_POLL_TASK_TYPE,
65
65
  data: {},
66
66
  createdAt: Date.now()
67
67
  };
@@ -1,6 +1,6 @@
1
- import { W as WalletRepository, C as ContractRepository } from '../../ark-Do9Lqfsp.cjs';
2
- import { A as AsyncStorageTaskQueue } from '../../asyncStorageTaskQueue-C3DYxvAT.cjs';
3
- import { T as TaskProcessor } from '../../taskRunner-RwUvgQ5M.cjs';
1
+ import { W as WalletRepository, C as ContractRepository } from '../../ark-CJgH_pmn.cjs';
2
+ import { a as AsyncStorageTaskQueue } from '../../asyncStorageTaskQueue-BlrsUUX_.cjs';
3
+ import { T as TaskProcessor } from '../../taskRunner-CnGSTaAJ.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-Do9Lqfsp.js';
2
- import { A as AsyncStorageTaskQueue } from '../../asyncStorageTaskQueue-DOnBOEDn.js';
3
- import { T as TaskProcessor } from '../../taskRunner-Bgs-0I3x.js';
1
+ import { W as WalletRepository, C as ContractRepository } from '../../ark-CJgH_pmn.js';
2
+ import { a as AsyncStorageTaskQueue } from '../../asyncStorageTaskQueue-BeeZbf-Q.js';
3
+ import { T as TaskProcessor } from '../../taskRunner-F7tWzsrC.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 { contractPollProcessor, createTaskDependencies, runTasks, CONTRACT_POLL_TASK_TYPE } from '../../chunk-LAONNMM5.js';
2
- import { ExpoIndexerProvider, ExpoArkProvider } from '../../chunk-SG4X7SEC.js';
3
- import { getRandomId } from '../../chunk-QO3IKBYL.js';
4
- import '../../chunk-ENWR2F2P.js';
5
- import '../../chunk-QMPNPZ2T.js';
6
- import '../../chunk-JCJ5WFS3.js';
1
+ import { contractPollProcessor, createTaskDependencies, runTasks, CONTRACT_POLL_TASK_TYPE } from '../../chunk-C4SVRVNM.js';
2
+ import { ExpoIndexerProvider, ExpoArkProvider } from '../../chunk-CPS7V4A3.js';
3
+ import { getRandomId } from '../../chunk-NIZPFPUM.js';
4
+ import '../../chunk-ASUJNZ63.js';
5
+ import '../../chunk-P6L2W5IL.js';
6
+ import '../../chunk-PUNBWFIV.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 chunkC6UYPHTQ_cjs = require('../../chunk-C6UYPHTQ.cjs');
4
- var chunkZPL34T2Q_cjs = require('../../chunk-ZPL34T2Q.cjs');
5
- require('../../chunk-G7DOBFQN.cjs');
6
- require('../../chunk-V2TOHHPW.cjs');
7
- var chunkOWCPXRGP_cjs = require('../../chunk-OWCPXRGP.cjs');
3
+ var chunkA7TOVUYG_cjs = require('../../chunk-A7TOVUYG.cjs');
4
+ var chunkKEG4AAKX_cjs = require('../../chunk-KEG4AAKX.cjs');
5
+ require('../../chunk-YK6NP5KX.cjs');
6
+ require('../../chunk-OWTKOMJZ.cjs');
7
+ var chunkKUN5ZRMW_cjs = require('../../chunk-KUN5ZRMW.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 chunkZPL34T2Q_cjs.Wallet.create(config);
62
- const processors = config.background.processors ?? [chunkC6UYPHTQ_cjs.contractPollProcessor];
61
+ const wallet = await chunkKEG4AAKX_cjs.Wallet.create(config);
62
+ const processors = config.background.processors ?? [chunkA7TOVUYG_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) => chunkZPL34T2Q_cjs.extendVirtualCoinForContract(vtxo, contract)
68
+ extendVtxo: (vtxo, contract) => chunkKEG4AAKX_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 chunkOWCPXRGP_cjs.RestArkProvider ? wallet.arkProvider.serverUrl : void 0);
72
+ const arkServerUrl = config.arkServerUrl || (wallet.arkProvider instanceof chunkKUN5ZRMW_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 chunkC6UYPHTQ_cjs.runTasks(this.taskQueue, this.processors, this.deps);
103
+ await chunkA7TOVUYG_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(chunkC6UYPHTQ_cjs.CONTRACT_POLL_TASK_TYPE);
112
+ const existing = await this.taskQueue.getTasks(chunkA7TOVUYG_cjs.CONTRACT_POLL_TASK_TYPE);
113
113
  if (existing.length > 0) return;
114
114
  const task = {
115
- id: chunkZPL34T2Q_cjs.getRandomId(),
116
- type: chunkC6UYPHTQ_cjs.CONTRACT_POLL_TASK_TYPE,
115
+ id: chunkKEG4AAKX_cjs.getRandomId(),
116
+ type: chunkA7TOVUYG_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(chunkC6UYPHTQ_cjs.CONTRACT_POLL_TASK_TYPE);
123
+ const tasks = await this.taskQueue.getTasks(chunkA7TOVUYG_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-Ck7BH8zR.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-Do9Lqfsp.cjs';
3
- import { a as TaskQueue, T as TaskProcessor } from '../../taskRunner-RwUvgQ5M.cjs';
1
+ import { W as Wallet, P as ProviderConnectionState } from '../../wallet-DvRIQBBY.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-CJgH_pmn.cjs';
3
+ import { c as TaskQueue, T as TaskProcessor } from '../../taskRunner-CnGSTaAJ.cjs';
4
4
  import '@scure/btc-signer';
5
5
  import '@scure/btc-signer/psbt.js';
6
6
  import '@scure/btc-signer/utils.js';
7
- import '../../delegate-C0iIBxen.cjs';
7
+ import '../../delegate-Dk-OJVdf.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-5Aou-V5n.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-Do9Lqfsp.js';
3
- import { a as TaskQueue, T as TaskProcessor } from '../../taskRunner-Bgs-0I3x.js';
1
+ import { W as Wallet, P as ProviderConnectionState } from '../../wallet-D6_S0n6B.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-CJgH_pmn.js';
3
+ import { c as TaskQueue, T as TaskProcessor } from '../../taskRunner-F7tWzsrC.js';
4
4
  import '@scure/btc-signer';
5
5
  import '@scure/btc-signer/psbt.js';
6
6
  import '@scure/btc-signer/utils.js';
7
- import '../../delegate-DmhFrtdq.js';
7
+ import '../../delegate-DM3YECSY.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-LAONNMM5.js';
2
- import { Wallet, getRandomId, extendVirtualCoinForContract } from '../../chunk-QO3IKBYL.js';
3
- import '../../chunk-ENWR2F2P.js';
4
- import '../../chunk-QMPNPZ2T.js';
5
- import { RestArkProvider } from '../../chunk-JCJ5WFS3.js';
1
+ import { contractPollProcessor, runTasks, CONTRACT_POLL_TASK_TYPE } from '../../chunk-C4SVRVNM.js';
2
+ import { Wallet, getRandomId, extendVirtualCoinForContract } from '../../chunk-NIZPFPUM.js';
3
+ import '../../chunk-ASUJNZ63.js';
4
+ import '../../chunk-P6L2W5IL.js';
5
+ import { RestArkProvider } from '../../chunk-PUNBWFIV.js';
6
6
  import '../../chunk-NSBPE2FW.js';
7
7
  import { hex } from '@scure/base';
8
8
 
@@ -1,8 +1,8 @@
1
- import { a as Identity, 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, 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-Do9Lqfsp.js';
1
+ import { a as Identity, p as RelativeTimelock, J as Network, K as CSVMultisigTapscript, L as SignerSet, M as BatchStartedEvent, P as TreeSigningStartedEvent, Q as TxTree, U as TreeNoncesEvent, X as BatchFinalizationEvent, Y as BatchFinalizedEvent, Z as BatchFailedEvent, _ as TreeTxEvent, $ as TreeSignatureEvent, i as SettlementEvent, b as WalletConfig, W as WalletRepository, C as ContractRepository, a0 as DescriptorProvider, f as IContractManager, a1 as IReadonlyWallet, a2 as ReadonlyIdentity, a3 as OnchainProvider, o as IndexerProvider, a4 as DelegateProvider, a5 as ReadonlyWalletConfig, x as IntentRepository, B as VirtualTxRepository, a6 as ExitCaptureMode, a7 as ExitDataSource, d as ActivityRegistry, a8 as IReadonlyAssetManager, a9 as ContractSyncState, n as ArkProvider, aa as NetworkName, ab as ArkInfo, ac as ArkAddress, c as WalletBalance, G as GetVtxosFilter, N as NormalizedExtendedVirtualCoin, A as ArkTransaction, e as Activity, E as ExtendedCoin, ad as Coin, t as ExtendedVirtualCoin, ae as ContractManager, af as ContractManagerConfig, I as IWallet, ag as SettlementConfig, j as IAssetManager, ah as VtxoManager, g as IDelegateManager, S as SendBitcoinParams, h as SettleParams, R as Recipient, ai as SignerSession, aj as SignedIntent, ak as Intent, al as TimeHeight } from './ark-CJgH_pmn.js';
2
2
  import { Transaction } from '@scure/btc-signer';
3
3
  import { TransactionOutput } from '@scure/btc-signer/psbt.js';
4
4
  import { Bytes } from '@scure/btc-signer/utils.js';
5
- import { D as DefaultVtxo, a as DelegateVtxo } from './delegate-DmhFrtdq.js';
5
+ import { D as DefaultVtxo, a as DelegateVtxo } from './delegate-DM3YECSY.js';
6
6
 
7
7
  /**
8
8
  * Capability a wallet exposes so descriptor-blind consumers — Boltz swaps and
@@ -36,6 +36,112 @@ interface HDWalletCapable {
36
36
  /** Structural type guard for {@link HDWalletCapable}. */
37
37
  declare function isHDWalletCapable(value: unknown): value is HDWalletCapable;
38
38
 
39
+ /** Wall-clock floor for `batchExpiry` outside regtest. */
40
+ declare const DEFAULT_MIN_BATCH_EXPIRY_SECONDS = 86400n;
41
+ /** Wall-clock floor for `batchExpiry` on regtest (~10 blocks). */
42
+ declare const REGTEST_MIN_BATCH_EXPIRY_SECONDS = 6000n;
43
+ /** Bounds applied to a server-supplied `BatchStartedEvent.batchExpiry`. */
44
+ type BatchExpiryPolicy = {
45
+ /** Minimum wall-clock delay in seconds, after normalization. */
46
+ minSeconds: bigint;
47
+ /**
48
+ * Reject block-typed timelocks. Mirrors arkd, which allows a block-typed
49
+ * vtxo tree expiry only on regtest.
50
+ */
51
+ requireSeconds: boolean;
52
+ /** When advertised by the operator, `batchExpiry` must equal it exactly. */
53
+ advertisedVtxoTreeExpiry?: bigint;
54
+ };
55
+ /**
56
+ * Default policy for a network.
57
+ *
58
+ * Derive it from the locally held {@link Network} — pinned at wallet setup —
59
+ * rather than from a per-round server field, so the permissive regtest branch
60
+ * can't be selected by the operator at event time.
61
+ */
62
+ declare function defaultBatchExpiryPolicy(network: Network): BatchExpiryPolicy;
63
+ /** Resolve a policy for `network`, applying any caller overrides on top. */
64
+ declare function resolveBatchExpiryPolicy(network: Network, overrides?: Partial<BatchExpiryPolicy>): BatchExpiryPolicy;
65
+ /**
66
+ * Check a server-supplied batch expiry against `policy` and return the timelock
67
+ * to commit to.
68
+ *
69
+ * The sweep leaf of the shared batch output is derived from this value, so it
70
+ * is never reconstructible from anything else the server sends: validating the
71
+ * tree only proves it is consistent with whatever value was chosen. Callers
72
+ * must encode the returned timelock rather than re-deriving their own.
73
+ *
74
+ * @throws {ServerResponseMismatchError} if the value is out of policy.
75
+ */
76
+ declare function assertValidBatchExpiry(batchExpiry: bigint, policy: BatchExpiryPolicy): RelativeTimelock;
77
+
78
+ /** Wall-clock floor for the checkpoint exit delay outside regtest. Matches arkd's own default. */
79
+ declare const DEFAULT_MIN_CHECKPOINT_EXIT_DELAY_SECONDS = 86400n;
80
+ /**
81
+ * Wall-clock floor for the checkpoint exit delay on regtest (~2 blocks nominal).
82
+ *
83
+ * Deliberately lower than {@link REGTEST_MIN_BATCH_EXPIRY_SECONDS "../wallet/batchExpiry"} — this
84
+ * repo's own regtest envs run `ARKD_CHECKPOINT_EXIT_DELAY` as low as 5 blocks
85
+ * (`packages/boltz-swap/.env.regtest`), so the floor must clear that while still rejecting a
86
+ * 1-block attack.
87
+ */
88
+ declare const REGTEST_MIN_CHECKPOINT_EXIT_DELAY_SECONDS = 1200n;
89
+ /** Bounds applied to a server-supplied `ArkInfo.checkpointTapscript`. */
90
+ type CheckpointExitDelayPolicy = {
91
+ /** Minimum wall-clock delay in seconds, after normalization. */
92
+ minSeconds: bigint;
93
+ /**
94
+ * Reject block-typed timelocks. Mirrors arkd, which allows a block-typed
95
+ * checkpoint exit delay only on regtest.
96
+ */
97
+ requireSeconds: boolean;
98
+ /**
99
+ * When set, the script's embedded pubkey must equal this x-only key.
100
+ *
101
+ * arkd always builds the checkpoint tapscript from its own `forfeitPubkey`
102
+ * (`internal/core/application/service.go`), so this should be the
103
+ * `forfeitPubkey` the caller already trusts — pinned wallet state where one
104
+ * exists, otherwise the same `ArkInfo` response's own `forfeitPubkey` field
105
+ * as a self-consistency check.
106
+ */
107
+ advertisedForfeitPubkey?: Bytes;
108
+ };
109
+ /**
110
+ * Default policy for a network.
111
+ *
112
+ * Derive it from the locally held {@link Network} — pinned at wallet setup —
113
+ * rather than from server data, so the permissive regtest branch can't be
114
+ * selected by the operator.
115
+ */
116
+ declare function defaultCheckpointExitDelayPolicy(network: Network): CheckpointExitDelayPolicy;
117
+ /** Resolve a policy for `network`, applying any caller overrides on top. */
118
+ declare function resolveCheckpointExitDelayPolicy(network: Network, overrides?: Partial<CheckpointExitDelayPolicy>): CheckpointExitDelayPolicy;
119
+ /**
120
+ * Decode and validate a server-supplied `checkpointTapscript` against `policy`.
121
+ *
122
+ * Every offchain send/claim builds its checkpoint outputs' server-claim leaf
123
+ * straight from this script — undecodable, sub-floor or wrong-pubkey values
124
+ * let the operator sweep an in-flight checkpoint before it settles. This is
125
+ * the sole gate: callers must use the returned script rather than decoding
126
+ * their own copy.
127
+ *
128
+ * @throws {ServerResponseMismatchError} if the script fails to decode, its
129
+ * timelock is out of policy, or its pubkey does not match
130
+ * `policy.advertisedForfeitPubkey` (when set).
131
+ */
132
+ declare function assertValidServerUnrollScript(checkpointTapscript: string, policy: CheckpointExitDelayPolicy): CSVMultisigTapscript.Type;
133
+
134
+ declare function getRandomId(): string;
135
+ /**
136
+ * What a recipient Arkade address must match. An address failing either check
137
+ * belongs to another network or operator, so this wallet's operator cannot
138
+ * create the VTXO where the recipient's wallet expects it.
139
+ */
140
+ type RecipientAddressContext = {
141
+ hrp: string;
142
+ signerSet: SignerSet;
143
+ };
144
+
39
145
  declare class ArkError extends Error {
40
146
  readonly code: number;
41
147
  readonly message: string;
@@ -750,6 +856,12 @@ declare class ReadonlyWallet implements IReadonlyWallet {
750
856
  * spend path, which is current-signer-only.
751
857
  */
752
858
  protected watchedBoardingSigners(): Set<string>;
859
+ /**
860
+ * `serverPubKey` defaults to the live key; spend paths that snapshot it
861
+ * against mid-flight rotation pass their snapshot, so the check reads from
862
+ * one rotation epoch.
863
+ */
864
+ protected recipientAddressContext(serverPubKey?: Bytes): RecipientAddressContext;
753
865
  /**
754
866
  * Currently-active receive tapscript. Read-only from the outside;
755
867
  * mutated only via {@link Wallet.setOffchainTapscriptForRotation}
@@ -1045,6 +1157,10 @@ declare class Wallet extends ReadonlyWallet implements IWallet, HDWalletCapable
1045
1157
  readonly arkProvider: ArkProvider;
1046
1158
  readonly forfeitOutputScript: Bytes;
1047
1159
  readonly forfeitPubkey: Bytes;
1160
+ /** Overrides for the `batchExpiry` bounds; defaults derive from `network`. */
1161
+ protected readonly batchExpiryPolicy?: Partial<BatchExpiryPolicy> | undefined;
1162
+ /** Overrides for the checkpoint exit delay bounds; defaults derive from `network`. */
1163
+ protected readonly checkpointExitDelayPolicy?: Partial<CheckpointExitDelayPolicy> | undefined;
1048
1164
  static MIN_FEE_RATE: number;
1049
1165
  readonly identity: Identity;
1050
1166
  private readonly _delegateManager?;
@@ -1288,7 +1404,11 @@ declare class Wallet extends ReadonlyWallet implements IWallet, HDWalletCapable
1288
1404
  readonly settlementConfig: SettlementConfig | false;
1289
1405
  protected constructor(identity: Identity, network: Network, onchainProvider: OnchainProvider, arkProvider: ArkProvider, indexerProvider: IndexerProvider, arkServerPublicKey: Bytes, offchainTapscript: DefaultVtxo.Script | DelegateVtxo.Script, boardingTapscript: DefaultVtxo.Script, serverUnrollScript: CSVMultisigTapscript.Type, forfeitOutputScript: Bytes, forfeitPubkey: Bytes, dustAmount: bigint, walletRepository: WalletRepository, contractRepository: ContractRepository,
1290
1406
  /** @deprecated Use settlementConfig */
1291
- renewalConfig?: WalletConfig["renewalConfig"], delegateProvider?: DelegateProvider, watcherConfig?: WalletConfig["watcherConfig"], settlementConfig?: WalletConfig["settlementConfig"], walletContractTimelocks?: RelativeTimelock[], receiveRotator?: WalletReceiveRotator, descriptorProvider?: DescriptorProvider, lookAheadWindow?: number);
1407
+ renewalConfig?: WalletConfig["renewalConfig"], delegateProvider?: DelegateProvider, watcherConfig?: WalletConfig["watcherConfig"], settlementConfig?: WalletConfig["settlementConfig"], walletContractTimelocks?: RelativeTimelock[], receiveRotator?: WalletReceiveRotator, descriptorProvider?: DescriptorProvider, lookAheadWindow?: number,
1408
+ /** Overrides for the `batchExpiry` bounds; defaults derive from `network`. */
1409
+ batchExpiryPolicy?: Partial<BatchExpiryPolicy> | undefined,
1410
+ /** Overrides for the checkpoint exit delay bounds; defaults derive from `network`. */
1411
+ checkpointExitDelayPolicy?: Partial<CheckpointExitDelayPolicy> | undefined);
1292
1412
  get assetManager(): IAssetManager;
1293
1413
  getVtxoManager(): Promise<VtxoManager>;
1294
1414
  dispose(): Promise<void>;
@@ -1566,4 +1686,4 @@ declare function selectVirtualCoins(coins: ExtendedVirtualCoin[], targetAmount:
1566
1686
  */
1567
1687
  declare function waitForIncomingFunds(wallet: Wallet): Promise<IncomingFunds>;
1568
1688
 
1569
- export { ArkError as A, Batch as B, type HDWalletCapable as H, type IncomingFunds as I, type ProviderConnectionState as P, ReadonlyWallet as R, type ServerInfoSource as S, Wallet as W, type ReceiveRotatorFactory as a, type ReceiveRotatorBootOpts as b, type ReceiveRotatorBoot as c, ArkErrorName as d, type ArkadeCashClaimResult as e, ArkadeCashCreateError as f, type ArkadeCashUnclaimedReason as g, type ArkadeCashUnclaimedVtxo as h, type BoardingUtxoGroup as i, type ProviderKind as j, ProviderUnavailableError as k, ServerResponseMismatchError as l, isArkError as m, isHDWalletCapable as n, maybeArkError as o, selectVirtualCoins as s, waitForIncomingFunds as w };
1689
+ export { ArkError as A, type BatchExpiryPolicy as B, type CheckpointExitDelayPolicy as C, DEFAULT_MIN_BATCH_EXPIRY_SECONDS as D, selectVirtualCoins as E, waitForIncomingFunds as F, type HDWalletCapable as H, type IncomingFunds as I, type ProviderConnectionState as P, ReadonlyWallet as R, type ServerInfoSource as S, Wallet as W, type ReceiveRotatorFactory as a, type ReceiveRotatorBootOpts as b, type ReceiveRotatorBoot as c, Batch as d, ArkErrorName as e, type ArkadeCashClaimResult as f, ArkadeCashCreateError as g, type ArkadeCashUnclaimedReason as h, type ArkadeCashUnclaimedVtxo as i, type BoardingUtxoGroup as j, DEFAULT_MIN_CHECKPOINT_EXIT_DELAY_SECONDS as k, type ProviderKind as l, ProviderUnavailableError as m, REGTEST_MIN_BATCH_EXPIRY_SECONDS as n, REGTEST_MIN_CHECKPOINT_EXIT_DELAY_SECONDS as o, ServerResponseMismatchError as p, assertValidBatchExpiry as q, assertValidServerUnrollScript as r, defaultBatchExpiryPolicy as s, defaultCheckpointExitDelayPolicy as t, getRandomId as u, isArkError as v, isHDWalletCapable as w, maybeArkError as x, resolveBatchExpiryPolicy as y, resolveCheckpointExitDelayPolicy as z };
@@ -1,8 +1,8 @@
1
- import { a as Identity, 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, 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-Do9Lqfsp.cjs';
1
+ import { a as Identity, p as RelativeTimelock, J as Network, K as CSVMultisigTapscript, L as SignerSet, M as BatchStartedEvent, P as TreeSigningStartedEvent, Q as TxTree, U as TreeNoncesEvent, X as BatchFinalizationEvent, Y as BatchFinalizedEvent, Z as BatchFailedEvent, _ as TreeTxEvent, $ as TreeSignatureEvent, i as SettlementEvent, b as WalletConfig, W as WalletRepository, C as ContractRepository, a0 as DescriptorProvider, f as IContractManager, a1 as IReadonlyWallet, a2 as ReadonlyIdentity, a3 as OnchainProvider, o as IndexerProvider, a4 as DelegateProvider, a5 as ReadonlyWalletConfig, x as IntentRepository, B as VirtualTxRepository, a6 as ExitCaptureMode, a7 as ExitDataSource, d as ActivityRegistry, a8 as IReadonlyAssetManager, a9 as ContractSyncState, n as ArkProvider, aa as NetworkName, ab as ArkInfo, ac as ArkAddress, c as WalletBalance, G as GetVtxosFilter, N as NormalizedExtendedVirtualCoin, A as ArkTransaction, e as Activity, E as ExtendedCoin, ad as Coin, t as ExtendedVirtualCoin, ae as ContractManager, af as ContractManagerConfig, I as IWallet, ag as SettlementConfig, j as IAssetManager, ah as VtxoManager, g as IDelegateManager, S as SendBitcoinParams, h as SettleParams, R as Recipient, ai as SignerSession, aj as SignedIntent, ak as Intent, al as TimeHeight } from './ark-CJgH_pmn.cjs';
2
2
  import { Transaction } from '@scure/btc-signer';
3
3
  import { TransactionOutput } from '@scure/btc-signer/psbt.js';
4
4
  import { Bytes } from '@scure/btc-signer/utils.js';
5
- import { D as DefaultVtxo, a as DelegateVtxo } from './delegate-C0iIBxen.cjs';
5
+ import { D as DefaultVtxo, a as DelegateVtxo } from './delegate-Dk-OJVdf.cjs';
6
6
 
7
7
  /**
8
8
  * Capability a wallet exposes so descriptor-blind consumers — Boltz swaps and
@@ -36,6 +36,112 @@ interface HDWalletCapable {
36
36
  /** Structural type guard for {@link HDWalletCapable}. */
37
37
  declare function isHDWalletCapable(value: unknown): value is HDWalletCapable;
38
38
 
39
+ /** Wall-clock floor for `batchExpiry` outside regtest. */
40
+ declare const DEFAULT_MIN_BATCH_EXPIRY_SECONDS = 86400n;
41
+ /** Wall-clock floor for `batchExpiry` on regtest (~10 blocks). */
42
+ declare const REGTEST_MIN_BATCH_EXPIRY_SECONDS = 6000n;
43
+ /** Bounds applied to a server-supplied `BatchStartedEvent.batchExpiry`. */
44
+ type BatchExpiryPolicy = {
45
+ /** Minimum wall-clock delay in seconds, after normalization. */
46
+ minSeconds: bigint;
47
+ /**
48
+ * Reject block-typed timelocks. Mirrors arkd, which allows a block-typed
49
+ * vtxo tree expiry only on regtest.
50
+ */
51
+ requireSeconds: boolean;
52
+ /** When advertised by the operator, `batchExpiry` must equal it exactly. */
53
+ advertisedVtxoTreeExpiry?: bigint;
54
+ };
55
+ /**
56
+ * Default policy for a network.
57
+ *
58
+ * Derive it from the locally held {@link Network} — pinned at wallet setup —
59
+ * rather than from a per-round server field, so the permissive regtest branch
60
+ * can't be selected by the operator at event time.
61
+ */
62
+ declare function defaultBatchExpiryPolicy(network: Network): BatchExpiryPolicy;
63
+ /** Resolve a policy for `network`, applying any caller overrides on top. */
64
+ declare function resolveBatchExpiryPolicy(network: Network, overrides?: Partial<BatchExpiryPolicy>): BatchExpiryPolicy;
65
+ /**
66
+ * Check a server-supplied batch expiry against `policy` and return the timelock
67
+ * to commit to.
68
+ *
69
+ * The sweep leaf of the shared batch output is derived from this value, so it
70
+ * is never reconstructible from anything else the server sends: validating the
71
+ * tree only proves it is consistent with whatever value was chosen. Callers
72
+ * must encode the returned timelock rather than re-deriving their own.
73
+ *
74
+ * @throws {ServerResponseMismatchError} if the value is out of policy.
75
+ */
76
+ declare function assertValidBatchExpiry(batchExpiry: bigint, policy: BatchExpiryPolicy): RelativeTimelock;
77
+
78
+ /** Wall-clock floor for the checkpoint exit delay outside regtest. Matches arkd's own default. */
79
+ declare const DEFAULT_MIN_CHECKPOINT_EXIT_DELAY_SECONDS = 86400n;
80
+ /**
81
+ * Wall-clock floor for the checkpoint exit delay on regtest (~2 blocks nominal).
82
+ *
83
+ * Deliberately lower than {@link REGTEST_MIN_BATCH_EXPIRY_SECONDS "../wallet/batchExpiry"} — this
84
+ * repo's own regtest envs run `ARKD_CHECKPOINT_EXIT_DELAY` as low as 5 blocks
85
+ * (`packages/boltz-swap/.env.regtest`), so the floor must clear that while still rejecting a
86
+ * 1-block attack.
87
+ */
88
+ declare const REGTEST_MIN_CHECKPOINT_EXIT_DELAY_SECONDS = 1200n;
89
+ /** Bounds applied to a server-supplied `ArkInfo.checkpointTapscript`. */
90
+ type CheckpointExitDelayPolicy = {
91
+ /** Minimum wall-clock delay in seconds, after normalization. */
92
+ minSeconds: bigint;
93
+ /**
94
+ * Reject block-typed timelocks. Mirrors arkd, which allows a block-typed
95
+ * checkpoint exit delay only on regtest.
96
+ */
97
+ requireSeconds: boolean;
98
+ /**
99
+ * When set, the script's embedded pubkey must equal this x-only key.
100
+ *
101
+ * arkd always builds the checkpoint tapscript from its own `forfeitPubkey`
102
+ * (`internal/core/application/service.go`), so this should be the
103
+ * `forfeitPubkey` the caller already trusts — pinned wallet state where one
104
+ * exists, otherwise the same `ArkInfo` response's own `forfeitPubkey` field
105
+ * as a self-consistency check.
106
+ */
107
+ advertisedForfeitPubkey?: Bytes;
108
+ };
109
+ /**
110
+ * Default policy for a network.
111
+ *
112
+ * Derive it from the locally held {@link Network} — pinned at wallet setup —
113
+ * rather than from server data, so the permissive regtest branch can't be
114
+ * selected by the operator.
115
+ */
116
+ declare function defaultCheckpointExitDelayPolicy(network: Network): CheckpointExitDelayPolicy;
117
+ /** Resolve a policy for `network`, applying any caller overrides on top. */
118
+ declare function resolveCheckpointExitDelayPolicy(network: Network, overrides?: Partial<CheckpointExitDelayPolicy>): CheckpointExitDelayPolicy;
119
+ /**
120
+ * Decode and validate a server-supplied `checkpointTapscript` against `policy`.
121
+ *
122
+ * Every offchain send/claim builds its checkpoint outputs' server-claim leaf
123
+ * straight from this script — undecodable, sub-floor or wrong-pubkey values
124
+ * let the operator sweep an in-flight checkpoint before it settles. This is
125
+ * the sole gate: callers must use the returned script rather than decoding
126
+ * their own copy.
127
+ *
128
+ * @throws {ServerResponseMismatchError} if the script fails to decode, its
129
+ * timelock is out of policy, or its pubkey does not match
130
+ * `policy.advertisedForfeitPubkey` (when set).
131
+ */
132
+ declare function assertValidServerUnrollScript(checkpointTapscript: string, policy: CheckpointExitDelayPolicy): CSVMultisigTapscript.Type;
133
+
134
+ declare function getRandomId(): string;
135
+ /**
136
+ * What a recipient Arkade address must match. An address failing either check
137
+ * belongs to another network or operator, so this wallet's operator cannot
138
+ * create the VTXO where the recipient's wallet expects it.
139
+ */
140
+ type RecipientAddressContext = {
141
+ hrp: string;
142
+ signerSet: SignerSet;
143
+ };
144
+
39
145
  declare class ArkError extends Error {
40
146
  readonly code: number;
41
147
  readonly message: string;
@@ -750,6 +856,12 @@ declare class ReadonlyWallet implements IReadonlyWallet {
750
856
  * spend path, which is current-signer-only.
751
857
  */
752
858
  protected watchedBoardingSigners(): Set<string>;
859
+ /**
860
+ * `serverPubKey` defaults to the live key; spend paths that snapshot it
861
+ * against mid-flight rotation pass their snapshot, so the check reads from
862
+ * one rotation epoch.
863
+ */
864
+ protected recipientAddressContext(serverPubKey?: Bytes): RecipientAddressContext;
753
865
  /**
754
866
  * Currently-active receive tapscript. Read-only from the outside;
755
867
  * mutated only via {@link Wallet.setOffchainTapscriptForRotation}
@@ -1045,6 +1157,10 @@ declare class Wallet extends ReadonlyWallet implements IWallet, HDWalletCapable
1045
1157
  readonly arkProvider: ArkProvider;
1046
1158
  readonly forfeitOutputScript: Bytes;
1047
1159
  readonly forfeitPubkey: Bytes;
1160
+ /** Overrides for the `batchExpiry` bounds; defaults derive from `network`. */
1161
+ protected readonly batchExpiryPolicy?: Partial<BatchExpiryPolicy> | undefined;
1162
+ /** Overrides for the checkpoint exit delay bounds; defaults derive from `network`. */
1163
+ protected readonly checkpointExitDelayPolicy?: Partial<CheckpointExitDelayPolicy> | undefined;
1048
1164
  static MIN_FEE_RATE: number;
1049
1165
  readonly identity: Identity;
1050
1166
  private readonly _delegateManager?;
@@ -1288,7 +1404,11 @@ declare class Wallet extends ReadonlyWallet implements IWallet, HDWalletCapable
1288
1404
  readonly settlementConfig: SettlementConfig | false;
1289
1405
  protected constructor(identity: Identity, network: Network, onchainProvider: OnchainProvider, arkProvider: ArkProvider, indexerProvider: IndexerProvider, arkServerPublicKey: Bytes, offchainTapscript: DefaultVtxo.Script | DelegateVtxo.Script, boardingTapscript: DefaultVtxo.Script, serverUnrollScript: CSVMultisigTapscript.Type, forfeitOutputScript: Bytes, forfeitPubkey: Bytes, dustAmount: bigint, walletRepository: WalletRepository, contractRepository: ContractRepository,
1290
1406
  /** @deprecated Use settlementConfig */
1291
- renewalConfig?: WalletConfig["renewalConfig"], delegateProvider?: DelegateProvider, watcherConfig?: WalletConfig["watcherConfig"], settlementConfig?: WalletConfig["settlementConfig"], walletContractTimelocks?: RelativeTimelock[], receiveRotator?: WalletReceiveRotator, descriptorProvider?: DescriptorProvider, lookAheadWindow?: number);
1407
+ renewalConfig?: WalletConfig["renewalConfig"], delegateProvider?: DelegateProvider, watcherConfig?: WalletConfig["watcherConfig"], settlementConfig?: WalletConfig["settlementConfig"], walletContractTimelocks?: RelativeTimelock[], receiveRotator?: WalletReceiveRotator, descriptorProvider?: DescriptorProvider, lookAheadWindow?: number,
1408
+ /** Overrides for the `batchExpiry` bounds; defaults derive from `network`. */
1409
+ batchExpiryPolicy?: Partial<BatchExpiryPolicy> | undefined,
1410
+ /** Overrides for the checkpoint exit delay bounds; defaults derive from `network`. */
1411
+ checkpointExitDelayPolicy?: Partial<CheckpointExitDelayPolicy> | undefined);
1292
1412
  get assetManager(): IAssetManager;
1293
1413
  getVtxoManager(): Promise<VtxoManager>;
1294
1414
  dispose(): Promise<void>;
@@ -1566,4 +1686,4 @@ declare function selectVirtualCoins(coins: ExtendedVirtualCoin[], targetAmount:
1566
1686
  */
1567
1687
  declare function waitForIncomingFunds(wallet: Wallet): Promise<IncomingFunds>;
1568
1688
 
1569
- export { ArkError as A, Batch as B, type HDWalletCapable as H, type IncomingFunds as I, type ProviderConnectionState as P, ReadonlyWallet as R, type ServerInfoSource as S, Wallet as W, type ReceiveRotatorFactory as a, type ReceiveRotatorBootOpts as b, type ReceiveRotatorBoot as c, ArkErrorName as d, type ArkadeCashClaimResult as e, ArkadeCashCreateError as f, type ArkadeCashUnclaimedReason as g, type ArkadeCashUnclaimedVtxo as h, type BoardingUtxoGroup as i, type ProviderKind as j, ProviderUnavailableError as k, ServerResponseMismatchError as l, isArkError as m, isHDWalletCapable as n, maybeArkError as o, selectVirtualCoins as s, waitForIncomingFunds as w };
1689
+ export { ArkError as A, type BatchExpiryPolicy as B, type CheckpointExitDelayPolicy as C, DEFAULT_MIN_BATCH_EXPIRY_SECONDS as D, selectVirtualCoins as E, waitForIncomingFunds as F, type HDWalletCapable as H, type IncomingFunds as I, type ProviderConnectionState as P, ReadonlyWallet as R, type ServerInfoSource as S, Wallet as W, type ReceiveRotatorFactory as a, type ReceiveRotatorBootOpts as b, type ReceiveRotatorBoot as c, Batch as d, ArkErrorName as e, type ArkadeCashClaimResult as f, ArkadeCashCreateError as g, type ArkadeCashUnclaimedReason as h, type ArkadeCashUnclaimedVtxo as i, type BoardingUtxoGroup as j, DEFAULT_MIN_CHECKPOINT_EXIT_DELAY_SECONDS as k, type ProviderKind as l, ProviderUnavailableError as m, REGTEST_MIN_BATCH_EXPIRY_SECONDS as n, REGTEST_MIN_CHECKPOINT_EXIT_DELAY_SECONDS as o, ServerResponseMismatchError as p, assertValidBatchExpiry as q, assertValidServerUnrollScript as r, defaultBatchExpiryPolicy as s, defaultCheckpointExitDelayPolicy as t, getRandomId as u, isArkError as v, isHDWalletCapable as w, maybeArkError as x, resolveBatchExpiryPolicy as y, resolveCheckpointExitDelayPolicy as z };