@arkade-os/sdk 0.5.4 → 0.5.6

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 (112) hide show
  1. package/README.md +103 -17
  2. package/dist/adapters/expo.cjs +7 -6
  3. package/dist/adapters/expo.d.cts +4 -3
  4. package/dist/adapters/expo.d.ts +4 -3
  5. package/dist/adapters/expo.js +4 -3
  6. package/dist/{asyncStorageTaskQueue-DTBa8EH7.d.cts → asyncStorageTaskQueue-Bh2n0msM.d.cts} +2 -2
  7. package/dist/{asyncStorageTaskQueue-DHMIxY04.d.ts → asyncStorageTaskQueue-CpkstKZ5.d.ts} +2 -2
  8. package/dist/base-C-Y5t_0F.d.cts +359 -0
  9. package/dist/base-C-Y5t_0F.d.ts +359 -0
  10. package/dist/{chunk-6CUP6ZIF.js → chunk-47Z4LEIW.js} +17 -841
  11. package/dist/chunk-47Z4LEIW.js.map +1 -0
  12. package/dist/{chunk-DNITZVNG.cjs → chunk-4X67IB2V.cjs} +18 -17
  13. package/dist/chunk-4X67IB2V.cjs.map +1 -0
  14. package/dist/{chunk-BTRCN4JJ.js → chunk-C7NY6WSA.js} +64 -4
  15. package/dist/chunk-C7NY6WSA.js.map +1 -0
  16. package/dist/{chunk-TUOLZBNC.js → chunk-DJYX73W2.js} +5 -4
  17. package/dist/chunk-DJYX73W2.js.map +1 -0
  18. package/dist/chunk-DNFTHG73.js +829 -0
  19. package/dist/chunk-DNFTHG73.js.map +1 -0
  20. package/dist/chunk-FDJ734CH.js +882 -0
  21. package/dist/chunk-FDJ734CH.js.map +1 -0
  22. package/dist/chunk-FLPWNMX3.cjs +930 -0
  23. package/dist/chunk-FLPWNMX3.cjs.map +1 -0
  24. package/dist/{chunk-WXNSISXK.cjs → chunk-HKEPJBTY.cjs} +79 -18
  25. package/dist/chunk-HKEPJBTY.cjs.map +1 -0
  26. package/dist/chunk-JFJNB7ZH.cjs +884 -0
  27. package/dist/chunk-JFJNB7ZH.cjs.map +1 -0
  28. package/dist/{chunk-GHUUT54D.cjs → chunk-LZAINCGU.cjs} +89 -933
  29. package/dist/chunk-LZAINCGU.cjs.map +1 -0
  30. package/dist/{chunk-E6OOJEHL.cjs → chunk-NDQ4LB4X.cjs} +60 -934
  31. package/dist/chunk-NDQ4LB4X.cjs.map +1 -0
  32. package/dist/{chunk-AG4TFD6F.js → chunk-QTMK34TP.js} +79 -884
  33. package/dist/chunk-QTMK34TP.js.map +1 -0
  34. package/dist/chunk-V3ZLL5VY.js +380 -0
  35. package/dist/chunk-V3ZLL5VY.js.map +1 -0
  36. package/dist/{chunk-MWVAWFX6.js → chunk-VWW2ZBPI.js} +4 -4
  37. package/dist/{chunk-MWVAWFX6.js.map → chunk-VWW2ZBPI.js.map} +1 -1
  38. package/dist/chunk-X6ZI53DZ.cjs +383 -0
  39. package/dist/chunk-X6ZI53DZ.cjs.map +1 -0
  40. package/dist/{chunk-F3FAE7VJ.cjs → chunk-Y3CDDPWI.cjs} +3138 -1764
  41. package/dist/chunk-Y3CDDPWI.cjs.map +1 -0
  42. package/dist/{chunk-ZJHLLDBP.js → chunk-YKT4NAQG.js} +2653 -1295
  43. package/dist/chunk-YKT4NAQG.js.map +1 -0
  44. package/dist/{chunk-B6VNKGIH.cjs → chunk-YS76JSGP.cjs} +10 -10
  45. package/dist/{chunk-B6VNKGIH.cjs.map → chunk-YS76JSGP.cjs.map} +1 -1
  46. package/dist/compiler.cjs +50 -0
  47. package/dist/compiler.cjs.map +1 -0
  48. package/dist/compiler.d.cts +38 -0
  49. package/dist/compiler.d.ts +38 -0
  50. package/dist/compiler.js +47 -0
  51. package/dist/compiler.js.map +1 -0
  52. package/dist/contracts/handlers/index.cjs +11 -9
  53. package/dist/contracts/handlers/index.d.cts +6 -4
  54. package/dist/contracts/handlers/index.d.ts +6 -4
  55. package/dist/contracts/handlers/index.js +4 -2
  56. package/dist/{delegate-xrSBNybC.d.ts → delegate-gGkUnYpi.d.cts} +1 -1
  57. package/dist/{delegate-f4_t864Z.d.cts → delegate-iyDum4fw.d.ts} +1 -1
  58. package/dist/{index-BJDz15ms.d.ts → index-2wKMrT0a.d.ts} +5 -270
  59. package/dist/{index-BjiVGtp8.d.cts → index-46g577Ka.d.cts} +5 -270
  60. package/dist/{index-DRwe0UDN.d.cts → index-C66rjxz2.d.ts} +1603 -1721
  61. package/dist/{index-DRwe0UDN.d.ts → index-Dqk07NwJ.d.cts} +1603 -1721
  62. package/dist/index.cjs +457 -378
  63. package/dist/index.d.cts +640 -385
  64. package/dist/index.d.ts +640 -385
  65. package/dist/index.js +7 -4
  66. package/dist/{wallet-jVBDQl6R.d.cts → keyringDescriptorProvider-DiBM4GmB.d.ts} +417 -366
  67. package/dist/{wallet-Oc3Wd5gv.d.ts → keyringDescriptorProvider-DnaLUC7v.d.cts} +417 -366
  68. package/dist/program-BARSNg3X.d.ts +286 -0
  69. package/dist/program-znrWkxE4.d.cts +286 -0
  70. package/dist/repositories/realm/index.cjs +71 -51
  71. package/dist/repositories/realm/index.cjs.map +1 -1
  72. package/dist/repositories/realm/index.d.cts +20 -9
  73. package/dist/repositories/realm/index.d.ts +20 -9
  74. package/dist/repositories/realm/index.js +42 -23
  75. package/dist/repositories/realm/index.js.map +1 -1
  76. package/dist/repositories/sqlite/index.cjs +81 -56
  77. package/dist/repositories/sqlite/index.cjs.map +1 -1
  78. package/dist/repositories/sqlite/index.d.cts +17 -8
  79. package/dist/repositories/sqlite/index.d.ts +17 -8
  80. package/dist/repositories/sqlite/index.js +55 -31
  81. package/dist/repositories/sqlite/index.js.map +1 -1
  82. package/dist/{taskRunner-CDlNeth0.d.ts → taskRunner-BM6IAKlS.d.ts} +2 -2
  83. package/dist/{taskRunner-BPPU-YHG.d.cts → taskRunner-BmDIZiSl.d.cts} +2 -2
  84. package/dist/wallet/expo/background.cjs +17 -14
  85. package/dist/wallet/expo/background.cjs.map +1 -1
  86. package/dist/wallet/expo/background.d.cts +5 -4
  87. package/dist/wallet/expo/background.d.ts +5 -4
  88. package/dist/wallet/expo/background.js +9 -6
  89. package/dist/wallet/expo/background.js.map +1 -1
  90. package/dist/wallet/expo/index.cjs +29 -16
  91. package/dist/wallet/expo/index.cjs.map +1 -1
  92. package/dist/wallet/expo/index.d.cts +12 -7
  93. package/dist/wallet/expo/index.d.ts +12 -7
  94. package/dist/wallet/expo/index.js +19 -6
  95. package/dist/wallet/expo/index.js.map +1 -1
  96. package/dist/worker/expo/index.cjs +12 -9
  97. package/dist/worker/expo/index.cjs.map +1 -1
  98. package/dist/worker/expo/index.d.cts +6 -5
  99. package/dist/worker/expo/index.d.ts +6 -5
  100. package/dist/worker/expo/index.js +8 -5
  101. package/dist/worker/expo/index.js.map +1 -1
  102. package/package.json +16 -1
  103. package/dist/chunk-6CUP6ZIF.js.map +0 -1
  104. package/dist/chunk-AG4TFD6F.js.map +0 -1
  105. package/dist/chunk-BTRCN4JJ.js.map +0 -1
  106. package/dist/chunk-DNITZVNG.cjs.map +0 -1
  107. package/dist/chunk-E6OOJEHL.cjs.map +0 -1
  108. package/dist/chunk-F3FAE7VJ.cjs.map +0 -1
  109. package/dist/chunk-GHUUT54D.cjs.map +0 -1
  110. package/dist/chunk-TUOLZBNC.js.map +0 -1
  111. package/dist/chunk-WXNSISXK.cjs.map +0 -1
  112. package/dist/chunk-ZJHLLDBP.js.map +0 -1
@@ -1,9 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkF3FAE7VJ_cjs = require('../../chunk-F3FAE7VJ.cjs');
4
- require('../../chunk-WXNSISXK.cjs');
5
- require('../../chunk-E6OOJEHL.cjs');
6
- var chunkGHUUT54D_cjs = require('../../chunk-GHUUT54D.cjs');
3
+ var chunkY3CDDPWI_cjs = require('../../chunk-Y3CDDPWI.cjs');
4
+ require('../../chunk-X6ZI53DZ.cjs');
5
+ require('../../chunk-HKEPJBTY.cjs');
6
+ require('../../chunk-NDQ4LB4X.cjs');
7
+ require('../../chunk-JFJNB7ZH.cjs');
8
+ var chunkLZAINCGU_cjs = require('../../chunk-LZAINCGU.cjs');
9
+ require('../../chunk-FLPWNMX3.cjs');
7
10
 
8
11
  // src/repositories/realm/walletRepository.ts
9
12
  var RealmWalletRepository = class {
@@ -39,7 +42,7 @@ var RealmWalletRepository = class {
39
42
  await this.ensureInit();
40
43
  this.realm.write(() => {
41
44
  for (const vtxo of vtxos) {
42
- const s = chunkF3FAE7VJ_cjs.serializeVtxo(vtxo);
45
+ const s = chunkY3CDDPWI_cjs.serializeVtxo(vtxo);
43
46
  this.realm.create(
44
47
  "ArkVtxo",
45
48
  {
@@ -54,7 +57,7 @@ var RealmWalletRepository = class {
54
57
  intentCb: s.intentTapLeafScript.cb,
55
58
  intentS: s.intentTapLeafScript.s,
56
59
  statusJson: JSON.stringify(s.status),
57
- createdAt: chunkF3FAE7VJ_cjs.createdAtToIso(s.createdAt),
60
+ createdAt: chunkY3CDDPWI_cjs.createdAtToIso(s.createdAt),
58
61
  isUnrolled: s.isUnrolled ?? false,
59
62
  isSpent: s.isSpent === void 0 ? null : s.isSpent,
60
63
  isSwept: s.isSwept === void 0 ? null : s.isSwept,
@@ -78,7 +81,7 @@ var RealmWalletRepository = class {
78
81
  return this.deleteWhere("ArkVtxo", "address", address);
79
82
  }
80
83
  async getVtxosForScriptPage(script, page, options) {
81
- chunkF3FAE7VJ_cjs.assertPageRequest(page);
84
+ chunkY3CDDPWI_cjs.assertPageRequest(page);
82
85
  await this.ensureInit();
83
86
  let results = this.realm.objects("ArkVtxo").filtered("script == $0", script);
84
87
  if (options?.unspentOnly) {
@@ -105,15 +108,15 @@ var RealmWalletRepository = class {
105
108
  rows.push({ address: row.address, vtxo: vtxoObjectToDomain(row) });
106
109
  if (rows.length > page.limit) break;
107
110
  }
108
- const result = chunkF3FAE7VJ_cjs.pageResult(rows, page.limit, (row) => ({
111
+ const result = chunkY3CDDPWI_cjs.pageResult(rows, page.limit, (row) => ({
109
112
  address: row.address,
110
113
  txid: row.vtxo.txid,
111
114
  vout: row.vtxo.vout
112
115
  }));
113
- return options?.unspentOnly ? { ...result, items: result.items.filter((row) => !chunkGHUUT54D_cjs.isVtxoSpent(row.vtxo)) } : result;
116
+ return options?.unspentOnly ? { ...result, items: result.items.filter((row) => !chunkLZAINCGU_cjs.isVtxoSpent(row.vtxo)) } : result;
114
117
  }
115
118
  async saveVtxosForScript(key, vtxos) {
116
- return this.saveVtxos(chunkF3FAE7VJ_cjs.checkSaveVtxosForScript("RealmWalletRepository", key, vtxos), vtxos);
119
+ return this.saveVtxos(chunkY3CDDPWI_cjs.checkSaveVtxosForScript("RealmWalletRepository", key, vtxos), vtxos);
117
120
  }
118
121
  async deleteVtxosForScript(script) {
119
122
  return this.deleteWhere("ArkVtxo", "script", script);
@@ -123,7 +126,7 @@ var RealmWalletRepository = class {
123
126
  return this.pageByAddress("ArkUtxo", address, page, utxoObjectToDomain);
124
127
  }
125
128
  async pageByAddress(schema, address, page, deserialize) {
126
- chunkF3FAE7VJ_cjs.assertPageRequest(page);
129
+ chunkY3CDDPWI_cjs.assertPageRequest(page);
127
130
  await this.ensureInit();
128
131
  let results = this.realm.objects(schema).filtered("address == $0", address);
129
132
  if (page.after) {
@@ -141,18 +144,18 @@ var RealmWalletRepository = class {
141
144
  rows.push({ key: { txid: row.txid, vout: row.vout }, item: deserialize(row) });
142
145
  if (rows.length > page.limit) break;
143
146
  }
144
- const result = chunkF3FAE7VJ_cjs.pageResult(rows, page.limit, (row) => row.key);
147
+ const result = chunkY3CDDPWI_cjs.pageResult(rows, page.limit, (row) => row.key);
145
148
  return { items: result.items.map((row) => row.item), nextCursor: result.nextCursor };
146
149
  }
147
150
  async saveUtxos(addressOrBatch, utxos) {
148
151
  await this.ensureInit();
149
- const rows = chunkF3FAE7VJ_cjs.utxoEntries(addressOrBatch, utxos).flatMap(
152
+ const rows = chunkY3CDDPWI_cjs.utxoEntries(addressOrBatch, utxos).flatMap(
150
153
  ([address, list]) => list.map((utxo) => ({ address, utxo }))
151
154
  );
152
155
  if (rows.length === 0) return;
153
156
  this.realm.write(() => {
154
157
  for (const { address, utxo } of rows) {
155
- const s = chunkF3FAE7VJ_cjs.serializeUtxo(utxo);
158
+ const s = chunkY3CDDPWI_cjs.serializeUtxo(utxo);
156
159
  this.realm.create(
157
160
  "ArkUtxo",
158
161
  {
@@ -179,8 +182,8 @@ var RealmWalletRepository = class {
179
182
  }
180
183
  // ── Transaction history ────────────────────────────────────────────
181
184
  async getTransactionHistoryPage(filter, page) {
182
- chunkF3FAE7VJ_cjs.assertPageRequest(page);
183
- chunkF3FAE7VJ_cjs.assertHistoryPageFilter(filter);
185
+ chunkY3CDDPWI_cjs.assertPageRequest(page);
186
+ chunkY3CDDPWI_cjs.assertHistoryPageFilter(filter);
184
187
  let results = this.realm.objects("ArkTransaction").filtered("address == $0", filter.address);
185
188
  results = results.filtered(
186
189
  "createdAt >= $0",
@@ -194,12 +197,12 @@ var RealmWalletRepository = class {
194
197
  ["arkTxid", false]
195
198
  ])) {
196
199
  const tx = txObjectToDomain(row);
197
- if (page.after !== void 0 && chunkF3FAE7VJ_cjs.compareHistoryCursors({ createdAt: tx.createdAt, key: tx.key }, page.after) <= 0)
200
+ if (page.after !== void 0 && chunkY3CDDPWI_cjs.compareHistoryCursors({ createdAt: tx.createdAt, key: tx.key }, page.after) <= 0)
198
201
  continue;
199
202
  rows.push(tx);
200
203
  if (rows.length > page.limit) break;
201
204
  }
202
- return chunkF3FAE7VJ_cjs.pageResult(rows, page.limit, (tx) => ({ createdAt: tx.createdAt, key: tx.key }));
205
+ return chunkY3CDDPWI_cjs.pageResult(rows, page.limit, (tx) => ({ createdAt: tx.createdAt, key: tx.key }));
203
206
  }
204
207
  async saveTransactions(address, txs) {
205
208
  await this.ensureInit();
@@ -217,7 +220,7 @@ var RealmWalletRepository = class {
217
220
  amount: tx.amount,
218
221
  settled: tx.settled,
219
222
  createdAt: tx.createdAt,
220
- assetsJson: tx.assets ? JSON.stringify(chunkF3FAE7VJ_cjs.serializeAssets(tx.assets)) : null
223
+ assetsJson: tx.assets ? JSON.stringify(chunkY3CDDPWI_cjs.serializeAssets(tx.assets)) : null
221
224
  },
222
225
  "modified"
223
226
  );
@@ -247,7 +250,7 @@ var RealmWalletRepository = class {
247
250
  settings: row.settingsJson ? JSON.parse(row.settingsJson) : void 0,
248
251
  lastSyncTime: row.lastSyncTime ?? void 0
249
252
  } : {};
250
- const state = chunkF3FAE7VJ_cjs.applyWalletStateUpdate(current, updater);
253
+ const state = chunkY3CDDPWI_cjs.applyWalletStateUpdate(current, updater);
251
254
  this.realm.create(
252
255
  "ArkWalletState",
253
256
  {
@@ -319,9 +322,9 @@ function vtxoObjectToDomain(obj) {
319
322
  // Post-migration every row has `script`, but the backfill is
320
323
  // idempotent: derive from `address` if the legacy column is still
321
324
  // null (e.g. the migration hasn't run yet on this handle).
322
- script: obj.script ?? chunkF3FAE7VJ_cjs.scriptFromArkAddress(obj.address)
325
+ script: obj.script ?? chunkY3CDDPWI_cjs.scriptFromArkAddress(obj.address)
323
326
  };
324
- return chunkF3FAE7VJ_cjs.deserializeVtxo(serialized);
327
+ return chunkY3CDDPWI_cjs.deserializeVtxo(serialized);
325
328
  }
326
329
  function utxoObjectToDomain(obj) {
327
330
  const serialized = {
@@ -340,7 +343,7 @@ function utxoObjectToDomain(obj) {
340
343
  status: JSON.parse(obj.statusJson),
341
344
  extraWitness: obj.extraWitnessJson ? JSON.parse(obj.extraWitnessJson) : void 0
342
345
  };
343
- return chunkF3FAE7VJ_cjs.deserializeUtxo(serialized);
346
+ return chunkY3CDDPWI_cjs.deserializeUtxo(serialized);
344
347
  }
345
348
  function txObjectToDomain(obj) {
346
349
  const tx = {
@@ -355,7 +358,7 @@ function txObjectToDomain(obj) {
355
358
  createdAt: obj.createdAt
356
359
  };
357
360
  if (obj.assetsJson) {
358
- tx.assets = chunkF3FAE7VJ_cjs.deserializeAssets(JSON.parse(obj.assetsJson));
361
+ tx.assets = chunkY3CDDPWI_cjs.deserializeAssets(JSON.parse(obj.assetsJson));
359
362
  }
360
363
  return tx;
361
364
  }
@@ -366,7 +369,7 @@ var RealmContractRepository = class {
366
369
  this.realm = realm;
367
370
  }
368
371
  realm;
369
- version = 3;
372
+ version = 4;
370
373
  // ── Lifecycle ──────────────────────────────────────────────────────
371
374
  async ensureInit() {
372
375
  }
@@ -381,9 +384,9 @@ var RealmContractRepository = class {
381
384
  }
382
385
  // ── Contract management ────────────────────────────────────────────
383
386
  async getContractsPage(filter, page) {
384
- chunkF3FAE7VJ_cjs.assertPageRequest(page);
385
- if (chunkF3FAE7VJ_cjs.contractFilterMatchesNothing(filter)) return { items: [] };
386
- const toPage = (rows) => chunkF3FAE7VJ_cjs.pageResult(rows.map(contractObjectToDomain), page.limit, (contract) => contract.script);
387
+ chunkY3CDDPWI_cjs.assertPageRequest(page);
388
+ if (chunkY3CDDPWI_cjs.contractFilterMatchesNothing(filter)) return { items: [] };
389
+ const toPage = (rows) => chunkY3CDDPWI_cjs.pageResult(rows.map(contractObjectToDomain), page.limit, (contract) => contract.script);
387
390
  if (filter?.watch === void 0 || filter.script !== void 0) {
388
391
  return toPage(this.readRows(filter, page));
389
392
  }
@@ -417,6 +420,8 @@ var RealmContractRepository = class {
417
420
  if (query) results = results.filtered(query, ...args);
418
421
  const rows = [];
419
422
  for (const row of results.sorted("script")) {
423
+ if (filter?.scope !== void 0 && ![filter.scope].flat().includes(chunkY3CDDPWI_cjs.scopeOf(contractObjectToDomain(row))))
424
+ continue;
420
425
  rows.push(row);
421
426
  if (rows.length > page.limit) break;
422
427
  }
@@ -436,7 +441,8 @@ var RealmContractRepository = class {
436
441
  createdAt: contract.createdAt,
437
442
  label: contract.label ?? null,
438
443
  metadataJson: contract.metadata ? JSON.stringify(contract.metadata) : null,
439
- watch: contract.watch ?? null
444
+ watch: contract.watch ?? null,
445
+ scope: contract.scope ?? null
440
446
  },
441
447
  "modified"
442
448
  );
@@ -499,14 +505,17 @@ function contractObjectToDomain(obj) {
499
505
  if (obj.watch !== null && obj.watch !== void 0) {
500
506
  contract.watch = obj.watch;
501
507
  }
508
+ if (obj.scope !== null && obj.scope !== void 0) {
509
+ contract.scope = obj.scope;
510
+ }
502
511
  return contract;
503
512
  }
504
513
 
505
514
  // src/repositories/realm/intentRepository.ts
506
515
  function toIntent(o) {
507
516
  return {
508
- intentTxId: o.intentTxId,
509
- intentId: o.intentId ?? void 0,
517
+ proofTxId: o.intentTxId,
518
+ registrationId: o.intentId ?? void 0,
510
519
  state: o.state,
511
520
  validFrom: o.validFrom ?? void 0,
512
521
  validUntil: o.validUntil ?? void 0,
@@ -521,10 +530,10 @@ function toIntent(o) {
521
530
  cancellationReason: o.cancellationReason ?? void 0,
522
531
  partialForfeits: JSON.parse(o.partialForfeitsJson),
523
532
  signerDescriptor: o.signerDescriptor ?? void 0,
524
- intentVtxos: JSON.parse(o.intentVtxosJson)
533
+ proofInputs: JSON.parse(o.intentVtxosJson)
525
534
  };
526
535
  }
527
- var RealmIntentRepository = class {
536
+ var RealmBatchRegistrationRepository = class {
528
537
  constructor(realm) {
529
538
  this.realm = realm;
530
539
  }
@@ -535,19 +544,19 @@ var RealmIntentRepository = class {
535
544
  this.realm.delete(this.realm.objects("ArkIntent"));
536
545
  });
537
546
  }
538
- async saveIntent(intent) {
547
+ async saveBatchRegistration(intent) {
539
548
  this.realm.write(() => {
540
- if (intent.intentId != null) {
549
+ if (intent.registrationId != null) {
541
550
  const clashes = [
542
- ...this.realm.objects("ArkIntent").filtered("intentId == $0", intent.intentId)
551
+ ...this.realm.objects("ArkIntent").filtered("intentId == $0", intent.registrationId)
543
552
  ].map(toIntent);
544
- chunkF3FAE7VJ_cjs.assertIntentIdUnique(intent, clashes);
553
+ chunkY3CDDPWI_cjs.assertIntentIdUnique(intent, clashes);
545
554
  }
546
555
  this.realm.create(
547
556
  "ArkIntent",
548
557
  {
549
- intentTxId: intent.intentTxId,
550
- intentId: intent.intentId ?? null,
558
+ intentTxId: intent.proofTxId,
559
+ intentId: intent.registrationId ?? null,
551
560
  state: intent.state,
552
561
  validFrom: intent.validFrom ?? null,
553
562
  validUntil: intent.validUntil ?? null,
@@ -562,34 +571,43 @@ var RealmIntentRepository = class {
562
571
  cancellationReason: intent.cancellationReason ?? null,
563
572
  partialForfeitsJson: JSON.stringify(intent.partialForfeits),
564
573
  signerDescriptor: intent.signerDescriptor ?? null,
565
- intentVtxosJson: JSON.stringify(intent.intentVtxos)
574
+ intentVtxosJson: JSON.stringify(intent.proofInputs)
566
575
  },
567
576
  "modified"
568
577
  );
569
578
  });
570
579
  }
571
- async getIntentsPage(filter, page) {
572
- chunkF3FAE7VJ_cjs.assertPageRequest(page);
580
+ async getBatchRegistrationsPage(filter, page) {
581
+ chunkY3CDDPWI_cjs.assertPageRequest(page);
573
582
  let results = this.realm.objects("ArkIntent");
574
583
  if (page.after !== void 0) results = results.filtered("intentTxId > $0", page.after);
575
584
  const rows = [];
576
585
  for (const row of results.sorted("intentTxId")) {
577
586
  const intent = toIntent(row);
578
- if (filter && !chunkF3FAE7VJ_cjs.intentMatchesFilter(intent, filter)) continue;
587
+ if (filter && !chunkY3CDDPWI_cjs.intentMatchesFilter(intent, filter)) continue;
579
588
  rows.push(intent);
580
589
  if (rows.length > page.limit) break;
581
590
  }
582
- return chunkF3FAE7VJ_cjs.pageResult(rows, page.limit, (intent) => intent.intentTxId);
591
+ return chunkY3CDDPWI_cjs.pageResult(rows, page.limit, (intent) => intent.proofTxId);
583
592
  }
584
593
  async getLockedVtxoOutpoints() {
585
594
  const out = [];
586
595
  for (const o of [...this.realm.objects("ArkIntent")].map(toIntent))
587
- if (!chunkF3FAE7VJ_cjs.isTerminalIntentState(o.state)) out.push(...o.intentVtxos);
596
+ if (!chunkY3CDDPWI_cjs.isTerminalBatchRegistrationState(o.state)) out.push(...o.proofInputs);
588
597
  return out;
589
598
  }
599
+ /** @deprecated Use {@link saveBatchRegistration}. */
600
+ saveIntent(intent) {
601
+ return this.saveBatchRegistration(intent);
602
+ }
603
+ /** @deprecated Use {@link getBatchRegistrationsPage}. */
604
+ getIntentsPage(filter, page) {
605
+ return this.getBatchRegistrationsPage(filter, page);
606
+ }
590
607
  async [Symbol.asyncDispose]() {
591
608
  }
592
609
  };
610
+ var RealmIntentRepository = RealmBatchRegistrationRepository;
593
611
 
594
612
  // src/repositories/realm/virtualTxRepository.ts
595
613
  var vtxoKey = (o) => `${o.txid}:${o.vout}`;
@@ -626,7 +644,7 @@ var RealmVirtualTxRepository = class {
626
644
  txid: t.txid,
627
645
  psbt: t.psbt ?? prev?.psbt ?? null,
628
646
  expiresAt: t.expiresAt ?? prev?.expiresAt ?? null,
629
- type: chunkF3FAE7VJ_cjs.mergeChainedTxType(t.type, prev?.type)
647
+ type: chunkY3CDDPWI_cjs.mergeChainedTxType(t.type, prev?.type)
630
648
  },
631
649
  "modified"
632
650
  );
@@ -797,7 +815,8 @@ var ArkContractSchema = {
797
815
  expiresAt: "int?",
798
816
  label: "string?",
799
817
  metadataJson: "string?",
800
- watch: { type: "string", optional: true, indexed: true }
818
+ watch: { type: "string", optional: true, indexed: true },
819
+ scope: "string?"
801
820
  }
802
821
  };
803
822
  var ArkIntentSchema = {
@@ -859,7 +878,7 @@ var ArkExperimentalRealmSchemas = [
859
878
  ArkVirtualTxSchema,
860
879
  ArkVtxoBranchSchema
861
880
  ];
862
- var ARK_REALM_SCHEMA_VERSION = 5;
881
+ var ARK_REALM_SCHEMA_VERSION = 6;
863
882
  function runArkRealmMigrations(oldRealm, newRealm) {
864
883
  const legacyByPk = /* @__PURE__ */ new Map();
865
884
  const oldVtxos = oldRealm?.objects?.("ArkVtxo") ?? [];
@@ -871,9 +890,9 @@ function runArkRealmMigrations(oldRealm, newRealm) {
871
890
  for (let i = 0; i < newVtxos.length; i++) {
872
891
  const newVtxo = newVtxos[i];
873
892
  if (!newVtxo.script) {
874
- newVtxo.script = chunkF3FAE7VJ_cjs.scriptFromArkAddress(newVtxo.address);
893
+ newVtxo.script = chunkY3CDDPWI_cjs.scriptFromArkAddress(newVtxo.address);
875
894
  }
876
- const facts = chunkF3FAE7VJ_cjs.legacyVtxoFacts(legacyByPk.get(newVtxo.pk));
895
+ const facts = chunkY3CDDPWI_cjs.legacyVtxoFacts(legacyByPk.get(newVtxo.pk));
877
896
  if (facts) {
878
897
  if (newVtxo.isSpent == null) newVtxo.isSpent = facts.isSpent;
879
898
  if (newVtxo.isSwept == null) newVtxo.isSwept = facts.isSwept;
@@ -903,11 +922,12 @@ function runArkRealmMigrations(oldRealm, newRealm) {
903
922
 
904
923
  Object.defineProperty(exports, "ChainedTxType", {
905
924
  enumerable: true,
906
- get: function () { return chunkF3FAE7VJ_cjs.ChainedTxType; }
925
+ get: function () { return chunkY3CDDPWI_cjs.ChainedTxType; }
907
926
  });
908
927
  exports.ARK_REALM_SCHEMA_VERSION = ARK_REALM_SCHEMA_VERSION;
909
928
  exports.ArkExperimentalRealmSchemas = ArkExperimentalRealmSchemas;
910
929
  exports.ArkRealmSchemas = ArkRealmSchemas;
930
+ exports.RealmBatchRegistrationRepository = RealmBatchRegistrationRepository;
911
931
  exports.RealmContractRepository = RealmContractRepository;
912
932
  exports.RealmIntentRepository = RealmIntentRepository;
913
933
  exports.RealmVirtualTxRepository = RealmVirtualTxRepository;