@arkade-os/sdk 0.5.5 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/adapters/expo.cjs +6 -6
  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/{asyncStorageTaskQueue-BbH-THYJ.d.cts → asyncStorageTaskQueue-B9byr6ij.d.cts} +1 -1
  6. package/dist/{asyncStorageTaskQueue-BlvkJyTa.d.ts → asyncStorageTaskQueue-XP4CCdRY.d.ts} +1 -1
  7. package/dist/{chunk-XWUCNMPN.cjs → chunk-3NALVGMJ.cjs} +16 -16
  8. package/dist/{chunk-XWUCNMPN.cjs.map → chunk-3NALVGMJ.cjs.map} +1 -1
  9. package/dist/{chunk-FVVXCDNE.js → chunk-4AJRIM44.js} +4 -4
  10. package/dist/{chunk-FVVXCDNE.js.map → chunk-4AJRIM44.js.map} +1 -1
  11. package/dist/{chunk-AMH7Q3DF.cjs → chunk-MQUATTIM.cjs} +8 -8
  12. package/dist/{chunk-AMH7Q3DF.cjs.map → chunk-MQUATTIM.cjs.map} +1 -1
  13. package/dist/{chunk-CE46RS6L.js → chunk-MWEDDWFU.js} +4 -4
  14. package/dist/{chunk-CE46RS6L.js.map → chunk-MWEDDWFU.js.map} +1 -1
  15. package/dist/{chunk-7GIKLFHC.js → chunk-MWMO2ZQP.js} +3 -3
  16. package/dist/{chunk-7GIKLFHC.js.map → chunk-MWMO2ZQP.js.map} +1 -1
  17. package/dist/{chunk-HQQ4NRXI.cjs → chunk-MXCB6EVM.cjs} +15 -15
  18. package/dist/{chunk-HQQ4NRXI.cjs.map → chunk-MXCB6EVM.cjs.map} +1 -1
  19. package/dist/{chunk-KCL5AVML.cjs → chunk-OMPDPBT5.cjs} +3 -3
  20. package/dist/chunk-OMPDPBT5.cjs.map +1 -0
  21. package/dist/{chunk-OO2KEK64.js → chunk-RLD7DRSZ.js} +381 -54
  22. package/dist/chunk-RLD7DRSZ.js.map +1 -0
  23. package/dist/{chunk-T254PXSN.cjs → chunk-URGVQ5TQ.cjs} +795 -462
  24. package/dist/chunk-URGVQ5TQ.cjs.map +1 -0
  25. package/dist/{chunk-BCA6D255.js → chunk-V2DDN4MV.js} +3 -3
  26. package/dist/{chunk-BCA6D255.js.map → chunk-V2DDN4MV.js.map} +1 -1
  27. package/dist/{chunk-5SYUEVJH.cjs → chunk-V5WRO3P6.cjs} +10 -10
  28. package/dist/{chunk-5SYUEVJH.cjs.map → chunk-V5WRO3P6.cjs.map} +1 -1
  29. package/dist/{chunk-4I53THL6.js → chunk-VMVFRTF4.js} +3 -3
  30. package/dist/chunk-VMVFRTF4.js.map +1 -0
  31. package/dist/contracts/handlers/index.cjs +9 -9
  32. package/dist/contracts/handlers/index.d.cts +2 -2
  33. package/dist/contracts/handlers/index.d.ts +2 -2
  34. package/dist/contracts/handlers/index.js +2 -2
  35. package/dist/{index-DCml4QJn.d.ts → index-18cDMayF.d.ts} +25 -25
  36. package/dist/{index-Bx-iArDs.d.ts → index-B_kcptF8.d.ts} +1 -1
  37. package/dist/{index-BWwVnJhU.d.cts → index-Ccfhdfvj.d.cts} +1 -1
  38. package/dist/{index-DkyzIzKL.d.cts → index-DDJFHfba.d.cts} +25 -25
  39. package/dist/index.cjs +335 -311
  40. package/dist/index.d.cts +89 -138
  41. package/dist/index.d.ts +89 -138
  42. package/dist/index.js +4 -4
  43. package/dist/{keyringDescriptorProvider-CS4w4PWd.d.ts → keyringDescriptorProvider-DL-jAiRO.d.ts} +158 -10
  44. package/dist/{keyringDescriptorProvider-CmHXrIXd.d.cts → keyringDescriptorProvider-Dtv0JWrT.d.cts} +158 -10
  45. package/dist/repositories/realm/index.cjs +37 -37
  46. package/dist/repositories/realm/index.cjs.map +1 -1
  47. package/dist/repositories/realm/index.d.cts +6 -6
  48. package/dist/repositories/realm/index.d.ts +6 -6
  49. package/dist/repositories/realm/index.js +6 -6
  50. package/dist/repositories/realm/index.js.map +1 -1
  51. package/dist/repositories/sqlite/index.cjs +35 -35
  52. package/dist/repositories/sqlite/index.cjs.map +1 -1
  53. package/dist/repositories/sqlite/index.d.cts +6 -6
  54. package/dist/repositories/sqlite/index.d.ts +6 -6
  55. package/dist/repositories/sqlite/index.js +5 -5
  56. package/dist/repositories/sqlite/index.js.map +1 -1
  57. package/dist/{taskRunner-DgMLSk_O.d.ts → taskRunner-DUafWu0o.d.ts} +1 -1
  58. package/dist/{taskRunner-buh6aFpG.d.cts → taskRunner-JYHaLPne.d.cts} +1 -1
  59. package/dist/wallet/expo/background.cjs +14 -14
  60. package/dist/wallet/expo/background.d.cts +3 -3
  61. package/dist/wallet/expo/background.d.ts +3 -3
  62. package/dist/wallet/expo/background.js +6 -6
  63. package/dist/wallet/expo/index.cjs +15 -15
  64. package/dist/wallet/expo/index.cjs.map +1 -1
  65. package/dist/wallet/expo/index.d.cts +6 -6
  66. package/dist/wallet/expo/index.d.ts +6 -6
  67. package/dist/wallet/expo/index.js +5 -5
  68. package/dist/wallet/expo/index.js.map +1 -1
  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 +2 -2
  74. package/dist/chunk-4I53THL6.js.map +0 -1
  75. package/dist/chunk-KCL5AVML.cjs.map +0 -1
  76. package/dist/chunk-OO2KEK64.js.map +0 -1
  77. package/dist/chunk-T254PXSN.cjs.map +0 -1
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var chunkT254PXSN_cjs = require('../../chunk-T254PXSN.cjs');
3
+ var chunkURGVQ5TQ_cjs = require('../../chunk-URGVQ5TQ.cjs');
4
4
  require('../../chunk-X6ZI53DZ.cjs');
5
- require('../../chunk-XWUCNMPN.cjs');
6
- require('../../chunk-AMH7Q3DF.cjs');
5
+ require('../../chunk-3NALVGMJ.cjs');
6
+ require('../../chunk-MQUATTIM.cjs');
7
7
  require('../../chunk-JFJNB7ZH.cjs');
8
- var chunkKCL5AVML_cjs = require('../../chunk-KCL5AVML.cjs');
8
+ var chunkOMPDPBT5_cjs = require('../../chunk-OMPDPBT5.cjs');
9
9
  require('../../chunk-FLPWNMX3.cjs');
10
10
 
11
11
  // src/repositories/realm/walletRepository.ts
@@ -42,7 +42,7 @@ var RealmWalletRepository = class {
42
42
  await this.ensureInit();
43
43
  this.realm.write(() => {
44
44
  for (const vtxo of vtxos) {
45
- const s = chunkT254PXSN_cjs.serializeVtxo(vtxo);
45
+ const s = chunkURGVQ5TQ_cjs.serializeVtxo(vtxo);
46
46
  this.realm.create(
47
47
  "ArkVtxo",
48
48
  {
@@ -57,7 +57,7 @@ var RealmWalletRepository = class {
57
57
  intentCb: s.intentTapLeafScript.cb,
58
58
  intentS: s.intentTapLeafScript.s,
59
59
  statusJson: JSON.stringify(s.status),
60
- createdAt: chunkT254PXSN_cjs.createdAtToIso(s.createdAt),
60
+ createdAt: chunkURGVQ5TQ_cjs.createdAtToIso(s.createdAt),
61
61
  isUnrolled: s.isUnrolled ?? false,
62
62
  isSpent: s.isSpent === void 0 ? null : s.isSpent,
63
63
  isSwept: s.isSwept === void 0 ? null : s.isSwept,
@@ -81,7 +81,7 @@ var RealmWalletRepository = class {
81
81
  return this.deleteWhere("ArkVtxo", "address", address);
82
82
  }
83
83
  async getVtxosForScriptPage(script, page, options) {
84
- chunkT254PXSN_cjs.assertPageRequest(page);
84
+ chunkURGVQ5TQ_cjs.assertPageRequest(page);
85
85
  await this.ensureInit();
86
86
  let results = this.realm.objects("ArkVtxo").filtered("script == $0", script);
87
87
  if (options?.unspentOnly) {
@@ -108,15 +108,15 @@ var RealmWalletRepository = class {
108
108
  rows.push({ address: row.address, vtxo: vtxoObjectToDomain(row) });
109
109
  if (rows.length > page.limit) break;
110
110
  }
111
- const result = chunkT254PXSN_cjs.pageResult(rows, page.limit, (row) => ({
111
+ const result = chunkURGVQ5TQ_cjs.pageResult(rows, page.limit, (row) => ({
112
112
  address: row.address,
113
113
  txid: row.vtxo.txid,
114
114
  vout: row.vtxo.vout
115
115
  }));
116
- return options?.unspentOnly ? { ...result, items: result.items.filter((row) => !chunkKCL5AVML_cjs.isVtxoSpent(row.vtxo)) } : result;
116
+ return options?.unspentOnly ? { ...result, items: result.items.filter((row) => !chunkOMPDPBT5_cjs.isVtxoSpent(row.vtxo)) } : result;
117
117
  }
118
118
  async saveVtxosForScript(key, vtxos) {
119
- return this.saveVtxos(chunkT254PXSN_cjs.checkSaveVtxosForScript("RealmWalletRepository", key, vtxos), vtxos);
119
+ return this.saveVtxos(chunkURGVQ5TQ_cjs.checkSaveVtxosForScript("RealmWalletRepository", key, vtxos), vtxos);
120
120
  }
121
121
  async deleteVtxosForScript(script) {
122
122
  return this.deleteWhere("ArkVtxo", "script", script);
@@ -126,7 +126,7 @@ var RealmWalletRepository = class {
126
126
  return this.pageByAddress("ArkUtxo", address, page, utxoObjectToDomain);
127
127
  }
128
128
  async pageByAddress(schema, address, page, deserialize) {
129
- chunkT254PXSN_cjs.assertPageRequest(page);
129
+ chunkURGVQ5TQ_cjs.assertPageRequest(page);
130
130
  await this.ensureInit();
131
131
  let results = this.realm.objects(schema).filtered("address == $0", address);
132
132
  if (page.after) {
@@ -144,18 +144,18 @@ var RealmWalletRepository = class {
144
144
  rows.push({ key: { txid: row.txid, vout: row.vout }, item: deserialize(row) });
145
145
  if (rows.length > page.limit) break;
146
146
  }
147
- const result = chunkT254PXSN_cjs.pageResult(rows, page.limit, (row) => row.key);
147
+ const result = chunkURGVQ5TQ_cjs.pageResult(rows, page.limit, (row) => row.key);
148
148
  return { items: result.items.map((row) => row.item), nextCursor: result.nextCursor };
149
149
  }
150
150
  async saveUtxos(addressOrBatch, utxos) {
151
151
  await this.ensureInit();
152
- const rows = chunkT254PXSN_cjs.utxoEntries(addressOrBatch, utxos).flatMap(
152
+ const rows = chunkURGVQ5TQ_cjs.utxoEntries(addressOrBatch, utxos).flatMap(
153
153
  ([address, list]) => list.map((utxo) => ({ address, utxo }))
154
154
  );
155
155
  if (rows.length === 0) return;
156
156
  this.realm.write(() => {
157
157
  for (const { address, utxo } of rows) {
158
- const s = chunkT254PXSN_cjs.serializeUtxo(utxo);
158
+ const s = chunkURGVQ5TQ_cjs.serializeUtxo(utxo);
159
159
  this.realm.create(
160
160
  "ArkUtxo",
161
161
  {
@@ -182,8 +182,8 @@ var RealmWalletRepository = class {
182
182
  }
183
183
  // ── Transaction history ────────────────────────────────────────────
184
184
  async getTransactionHistoryPage(filter, page) {
185
- chunkT254PXSN_cjs.assertPageRequest(page);
186
- chunkT254PXSN_cjs.assertHistoryPageFilter(filter);
185
+ chunkURGVQ5TQ_cjs.assertPageRequest(page);
186
+ chunkURGVQ5TQ_cjs.assertHistoryPageFilter(filter);
187
187
  let results = this.realm.objects("ArkTransaction").filtered("address == $0", filter.address);
188
188
  results = results.filtered(
189
189
  "createdAt >= $0",
@@ -197,12 +197,12 @@ var RealmWalletRepository = class {
197
197
  ["arkTxid", false]
198
198
  ])) {
199
199
  const tx = txObjectToDomain(row);
200
- if (page.after !== void 0 && chunkT254PXSN_cjs.compareHistoryCursors({ createdAt: tx.createdAt, key: tx.key }, page.after) <= 0)
200
+ if (page.after !== void 0 && chunkURGVQ5TQ_cjs.compareHistoryCursors({ createdAt: tx.createdAt, key: tx.key }, page.after) <= 0)
201
201
  continue;
202
202
  rows.push(tx);
203
203
  if (rows.length > page.limit) break;
204
204
  }
205
- return chunkT254PXSN_cjs.pageResult(rows, page.limit, (tx) => ({ createdAt: tx.createdAt, key: tx.key }));
205
+ return chunkURGVQ5TQ_cjs.pageResult(rows, page.limit, (tx) => ({ createdAt: tx.createdAt, key: tx.key }));
206
206
  }
207
207
  async saveTransactions(address, txs) {
208
208
  await this.ensureInit();
@@ -220,7 +220,7 @@ var RealmWalletRepository = class {
220
220
  amount: tx.amount,
221
221
  settled: tx.settled,
222
222
  createdAt: tx.createdAt,
223
- assetsJson: tx.assets ? JSON.stringify(chunkT254PXSN_cjs.serializeAssets(tx.assets)) : null
223
+ assetsJson: tx.assets ? JSON.stringify(chunkURGVQ5TQ_cjs.serializeAssets(tx.assets)) : null
224
224
  },
225
225
  "modified"
226
226
  );
@@ -250,7 +250,7 @@ var RealmWalletRepository = class {
250
250
  settings: row.settingsJson ? JSON.parse(row.settingsJson) : void 0,
251
251
  lastSyncTime: row.lastSyncTime ?? void 0
252
252
  } : {};
253
- const state = chunkT254PXSN_cjs.applyWalletStateUpdate(current, updater);
253
+ const state = chunkURGVQ5TQ_cjs.applyWalletStateUpdate(current, updater);
254
254
  this.realm.create(
255
255
  "ArkWalletState",
256
256
  {
@@ -322,9 +322,9 @@ function vtxoObjectToDomain(obj) {
322
322
  // Post-migration every row has `script`, but the backfill is
323
323
  // idempotent: derive from `address` if the legacy column is still
324
324
  // null (e.g. the migration hasn't run yet on this handle).
325
- script: obj.script ?? chunkT254PXSN_cjs.scriptFromArkAddress(obj.address)
325
+ script: obj.script ?? chunkURGVQ5TQ_cjs.scriptFromArkAddress(obj.address)
326
326
  };
327
- return chunkT254PXSN_cjs.deserializeVtxo(serialized);
327
+ return chunkURGVQ5TQ_cjs.deserializeVtxo(serialized);
328
328
  }
329
329
  function utxoObjectToDomain(obj) {
330
330
  const serialized = {
@@ -343,7 +343,7 @@ function utxoObjectToDomain(obj) {
343
343
  status: JSON.parse(obj.statusJson),
344
344
  extraWitness: obj.extraWitnessJson ? JSON.parse(obj.extraWitnessJson) : void 0
345
345
  };
346
- return chunkT254PXSN_cjs.deserializeUtxo(serialized);
346
+ return chunkURGVQ5TQ_cjs.deserializeUtxo(serialized);
347
347
  }
348
348
  function txObjectToDomain(obj) {
349
349
  const tx = {
@@ -358,7 +358,7 @@ function txObjectToDomain(obj) {
358
358
  createdAt: obj.createdAt
359
359
  };
360
360
  if (obj.assetsJson) {
361
- tx.assets = chunkT254PXSN_cjs.deserializeAssets(JSON.parse(obj.assetsJson));
361
+ tx.assets = chunkURGVQ5TQ_cjs.deserializeAssets(JSON.parse(obj.assetsJson));
362
362
  }
363
363
  return tx;
364
364
  }
@@ -384,9 +384,9 @@ var RealmContractRepository = class {
384
384
  }
385
385
  // ── Contract management ────────────────────────────────────────────
386
386
  async getContractsPage(filter, page) {
387
- chunkT254PXSN_cjs.assertPageRequest(page);
388
- if (chunkT254PXSN_cjs.contractFilterMatchesNothing(filter)) return { items: [] };
389
- const toPage = (rows) => chunkT254PXSN_cjs.pageResult(rows.map(contractObjectToDomain), page.limit, (contract) => contract.script);
387
+ chunkURGVQ5TQ_cjs.assertPageRequest(page);
388
+ if (chunkURGVQ5TQ_cjs.contractFilterMatchesNothing(filter)) return { items: [] };
389
+ const toPage = (rows) => chunkURGVQ5TQ_cjs.pageResult(rows.map(contractObjectToDomain), page.limit, (contract) => contract.script);
390
390
  if (filter?.watch === void 0 || filter.script !== void 0) {
391
391
  return toPage(this.readRows(filter, page));
392
392
  }
@@ -420,7 +420,7 @@ var RealmContractRepository = class {
420
420
  if (query) results = results.filtered(query, ...args);
421
421
  const rows = [];
422
422
  for (const row of results.sorted("script")) {
423
- if (filter?.scope !== void 0 && ![filter.scope].flat().includes(chunkT254PXSN_cjs.scopeOf(contractObjectToDomain(row))))
423
+ if (filter?.scope !== void 0 && ![filter.scope].flat().includes(chunkURGVQ5TQ_cjs.scopeOf(contractObjectToDomain(row))))
424
424
  continue;
425
425
  rows.push(row);
426
426
  if (rows.length > page.limit) break;
@@ -550,7 +550,7 @@ var RealmBatchRegistrationRepository = class {
550
550
  const clashes = [
551
551
  ...this.realm.objects("ArkIntent").filtered("intentId == $0", intent.registrationId)
552
552
  ].map(toIntent);
553
- chunkT254PXSN_cjs.assertIntentIdUnique(intent, clashes);
553
+ chunkURGVQ5TQ_cjs.assertIntentIdUnique(intent, clashes);
554
554
  }
555
555
  this.realm.create(
556
556
  "ArkIntent",
@@ -578,22 +578,22 @@ var RealmBatchRegistrationRepository = class {
578
578
  });
579
579
  }
580
580
  async getBatchRegistrationsPage(filter, page) {
581
- chunkT254PXSN_cjs.assertPageRequest(page);
581
+ chunkURGVQ5TQ_cjs.assertPageRequest(page);
582
582
  let results = this.realm.objects("ArkIntent");
583
583
  if (page.after !== void 0) results = results.filtered("intentTxId > $0", page.after);
584
584
  const rows = [];
585
585
  for (const row of results.sorted("intentTxId")) {
586
586
  const intent = toIntent(row);
587
- if (filter && !chunkT254PXSN_cjs.intentMatchesFilter(intent, filter)) continue;
587
+ if (filter && !chunkURGVQ5TQ_cjs.intentMatchesFilter(intent, filter)) continue;
588
588
  rows.push(intent);
589
589
  if (rows.length > page.limit) break;
590
590
  }
591
- return chunkT254PXSN_cjs.pageResult(rows, page.limit, (intent) => intent.proofTxId);
591
+ return chunkURGVQ5TQ_cjs.pageResult(rows, page.limit, (intent) => intent.proofTxId);
592
592
  }
593
593
  async getLockedVtxoOutpoints() {
594
594
  const out = [];
595
595
  for (const o of [...this.realm.objects("ArkIntent")].map(toIntent))
596
- if (!chunkT254PXSN_cjs.isTerminalIntentState(o.state)) out.push(...o.proofInputs);
596
+ if (!chunkURGVQ5TQ_cjs.isTerminalBatchRegistrationState(o.state)) out.push(...o.proofInputs);
597
597
  return out;
598
598
  }
599
599
  /** @deprecated Use {@link saveBatchRegistration}. */
@@ -644,7 +644,7 @@ var RealmVirtualTxRepository = class {
644
644
  txid: t.txid,
645
645
  psbt: t.psbt ?? prev?.psbt ?? null,
646
646
  expiresAt: t.expiresAt ?? prev?.expiresAt ?? null,
647
- type: chunkT254PXSN_cjs.mergeChainedTxType(t.type, prev?.type)
647
+ type: chunkURGVQ5TQ_cjs.mergeChainedTxType(t.type, prev?.type)
648
648
  },
649
649
  "modified"
650
650
  );
@@ -890,9 +890,9 @@ function runArkRealmMigrations(oldRealm, newRealm) {
890
890
  for (let i = 0; i < newVtxos.length; i++) {
891
891
  const newVtxo = newVtxos[i];
892
892
  if (!newVtxo.script) {
893
- newVtxo.script = chunkT254PXSN_cjs.scriptFromArkAddress(newVtxo.address);
893
+ newVtxo.script = chunkURGVQ5TQ_cjs.scriptFromArkAddress(newVtxo.address);
894
894
  }
895
- const facts = chunkT254PXSN_cjs.legacyVtxoFacts(legacyByPk.get(newVtxo.pk));
895
+ const facts = chunkURGVQ5TQ_cjs.legacyVtxoFacts(legacyByPk.get(newVtxo.pk));
896
896
  if (facts) {
897
897
  if (newVtxo.isSpent == null) newVtxo.isSpent = facts.isSpent;
898
898
  if (newVtxo.isSwept == null) newVtxo.isSwept = facts.isSwept;
@@ -922,7 +922,7 @@ function runArkRealmMigrations(oldRealm, newRealm) {
922
922
 
923
923
  Object.defineProperty(exports, "ChainedTxType", {
924
924
  enumerable: true,
925
- get: function () { return chunkT254PXSN_cjs.ChainedTxType; }
925
+ get: function () { return chunkURGVQ5TQ_cjs.ChainedTxType; }
926
926
  });
927
927
  exports.ARK_REALM_SCHEMA_VERSION = ARK_REALM_SCHEMA_VERSION;
928
928
  exports.ArkExperimentalRealmSchemas = ArkExperimentalRealmSchemas;