@arkade-os/sdk 0.5.3 → 0.5.5

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 (114) hide show
  1. package/README.md +138 -50
  2. package/dist/adapters/expo.cjs +10 -5
  3. package/dist/adapters/expo.d.cts +13 -8
  4. package/dist/adapters/expo.d.ts +13 -8
  5. package/dist/adapters/expo.js +4 -3
  6. package/dist/{asyncStorageTaskQueue-C9PkPcW_.d.cts → asyncStorageTaskQueue-BbH-THYJ.d.cts} +2 -2
  7. package/dist/{asyncStorageTaskQueue-B3U5gQ-i.d.ts → asyncStorageTaskQueue-BlvkJyTa.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-OPX2HRWM.js → chunk-4I53THL6.js} +210 -937
  11. package/dist/chunk-4I53THL6.js.map +1 -0
  12. package/dist/{chunk-5WRA66RV.cjs → chunk-5SYUEVJH.cjs} +10 -10
  13. package/dist/chunk-5SYUEVJH.cjs.map +1 -0
  14. package/dist/{chunk-6FL4N4S2.js → chunk-7GIKLFHC.js} +83 -20
  15. package/dist/chunk-7GIKLFHC.js.map +1 -0
  16. package/dist/{chunk-BYPBVHVA.cjs → chunk-AMH7Q3DF.cjs} +61 -935
  17. package/dist/chunk-AMH7Q3DF.cjs.map +1 -0
  18. package/dist/{chunk-P7B4LQ3H.js → chunk-BCA6D255.js} +18 -842
  19. package/dist/chunk-BCA6D255.js.map +1 -0
  20. package/dist/{chunk-T7C3E2HL.js → chunk-CE46RS6L.js} +20 -39
  21. package/dist/chunk-CE46RS6L.js.map +1 -0
  22. package/dist/chunk-DNFTHG73.js +829 -0
  23. package/dist/chunk-DNFTHG73.js.map +1 -0
  24. package/dist/chunk-FDJ734CH.js +882 -0
  25. package/dist/chunk-FDJ734CH.js.map +1 -0
  26. package/dist/chunk-FLPWNMX3.cjs +930 -0
  27. package/dist/chunk-FLPWNMX3.cjs.map +1 -0
  28. package/dist/{chunk-Y4BL3YYX.js → chunk-FVVXCDNE.js} +4 -4
  29. package/dist/chunk-FVVXCDNE.js.map +1 -0
  30. package/dist/{chunk-ZPF4I3K2.cjs → chunk-HQQ4NRXI.cjs} +29 -47
  31. package/dist/chunk-HQQ4NRXI.cjs.map +1 -0
  32. package/dist/chunk-JFJNB7ZH.cjs +884 -0
  33. package/dist/chunk-JFJNB7ZH.cjs.map +1 -0
  34. package/dist/{chunk-KW7ZEWYS.cjs → chunk-KCL5AVML.cjs} +223 -985
  35. package/dist/chunk-KCL5AVML.cjs.map +1 -0
  36. package/dist/{chunk-HAQAWBYG.js → chunk-OO2KEK64.js} +2860 -1366
  37. package/dist/chunk-OO2KEK64.js.map +1 -0
  38. package/dist/{chunk-OUTWUYJ4.cjs → chunk-T254PXSN.cjs} +3337 -1824
  39. package/dist/chunk-T254PXSN.cjs.map +1 -0
  40. package/dist/chunk-V3ZLL5VY.js +380 -0
  41. package/dist/chunk-V3ZLL5VY.js.map +1 -0
  42. package/dist/chunk-X6ZI53DZ.cjs +383 -0
  43. package/dist/chunk-X6ZI53DZ.cjs.map +1 -0
  44. package/dist/{chunk-ZMSM3NOH.cjs → chunk-XWUCNMPN.cjs} +98 -34
  45. package/dist/chunk-XWUCNMPN.cjs.map +1 -0
  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-Cd28gxpM.d.ts → delegate-gGkUnYpi.d.cts} +1 -1
  57. package/dist/{delegate-ByfKszb6.d.cts → delegate-iyDum4fw.d.ts} +1 -1
  58. package/dist/{index-B6X2E7W_.d.ts → index-BWwVnJhU.d.cts} +7 -272
  59. package/dist/{index-DgH_0j14.d.cts → index-Bx-iArDs.d.ts} +7 -272
  60. package/dist/{index-BURzbRup.d.cts → index-DCml4QJn.d.ts} +1090 -1140
  61. package/dist/{index-BURzbRup.d.ts → index-DkyzIzKL.d.cts} +1090 -1140
  62. package/dist/index.cjs +470 -371
  63. package/dist/index.d.cts +687 -410
  64. package/dist/index.d.ts +687 -410
  65. package/dist/index.js +7 -4
  66. package/dist/{wallet-BnmhohgZ.d.ts → keyringDescriptorProvider-CS4w4PWd.d.ts} +427 -372
  67. package/dist/{wallet-BjQugVUt.d.cts → keyringDescriptorProvider-CmHXrIXd.d.cts} +427 -372
  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 +100 -51
  71. package/dist/repositories/realm/index.cjs.map +1 -1
  72. package/dist/repositories/realm/index.d.cts +25 -10
  73. package/dist/repositories/realm/index.d.ts +25 -10
  74. package/dist/repositories/realm/index.js +72 -24
  75. package/dist/repositories/realm/index.js.map +1 -1
  76. package/dist/repositories/sqlite/index.cjs +222 -131
  77. package/dist/repositories/sqlite/index.cjs.map +1 -1
  78. package/dist/repositories/sqlite/index.d.cts +36 -17
  79. package/dist/repositories/sqlite/index.d.ts +36 -17
  80. package/dist/repositories/sqlite/index.js +196 -107
  81. package/dist/repositories/sqlite/index.js.map +1 -1
  82. package/dist/{taskRunner-BaNCSxqK.d.ts → taskRunner-DgMLSk_O.d.ts} +4 -4
  83. package/dist/{taskRunner-i56-drQV.d.cts → taskRunner-buh6aFpG.d.cts} +4 -4
  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 +10 -7
  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 +20 -7
  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-5WRA66RV.cjs.map +0 -1
  104. package/dist/chunk-6FL4N4S2.js.map +0 -1
  105. package/dist/chunk-BYPBVHVA.cjs.map +0 -1
  106. package/dist/chunk-HAQAWBYG.js.map +0 -1
  107. package/dist/chunk-KW7ZEWYS.cjs.map +0 -1
  108. package/dist/chunk-OPX2HRWM.js.map +0 -1
  109. package/dist/chunk-OUTWUYJ4.cjs.map +0 -1
  110. package/dist/chunk-P7B4LQ3H.js.map +0 -1
  111. package/dist/chunk-T7C3E2HL.js.map +0 -1
  112. package/dist/chunk-Y4BL3YYX.js.map +0 -1
  113. package/dist/chunk-ZMSM3NOH.cjs.map +0 -1
  114. package/dist/chunk-ZPF4I3K2.cjs.map +0 -1
@@ -1,13 +1,14 @@
1
1
  'use strict';
2
2
 
3
- var chunkKW7ZEWYS_cjs = require('./chunk-KW7ZEWYS.cjs');
3
+ var chunkKCL5AVML_cjs = require('./chunk-KCL5AVML.cjs');
4
+ var chunkFLPWNMX3_cjs = require('./chunk-FLPWNMX3.cjs');
4
5
  var base = require('@scure/base');
5
6
  var secp256k1_js = require('@noble/curves/secp256k1.js');
6
7
  var utils_js = require('@scure/btc-signer/utils.js');
7
8
 
8
9
  // src/extension/asset/index.ts
9
10
  var asset_exports = {};
10
- chunkKW7ZEWYS_cjs.__export(asset_exports, {
11
+ chunkFLPWNMX3_cjs.__export(asset_exports, {
11
12
  ASSET_ID_VECTORS: () => ASSET_ID_VECTORS,
12
13
  AssetGroup: () => AssetGroup,
13
14
  AssetId: () => AssetId,
@@ -30,6 +31,7 @@ var AssetInputType = /* @__PURE__ */ ((AssetInputType2) => {
30
31
  AssetInputType2[AssetInputType2["Unspecified"] = 0] = "Unspecified";
31
32
  AssetInputType2[AssetInputType2["Local"] = 1] = "Local";
32
33
  AssetInputType2[AssetInputType2["Intent"] = 2] = "Intent";
34
+ AssetInputType2[AssetInputType2["Proof"] = 2] = "Proof";
33
35
  return AssetInputType2;
34
36
  })(AssetInputType || {});
35
37
  var AssetRefType = /* @__PURE__ */ ((AssetRefType2) => {
@@ -413,8 +415,8 @@ var AssetInput = class _AssetInput {
413
415
  input.validate();
414
416
  return input;
415
417
  }
416
- /** Create an intent-backed asset input referencing an external intent transaction. */
417
- static createIntent(txid, vin, amount) {
418
+ /** Create a proof-backed asset input referencing an external proof transaction. */
419
+ static createProof(txid, vin, amount) {
418
420
  if (!txid || txid.length === 0) {
419
421
  throw new Error("missing input intent txid");
420
422
  }
@@ -423,7 +425,7 @@ var AssetInput = class _AssetInput {
423
425
  throw new Error("invalid input intent txid length");
424
426
  }
425
427
  const input = new _AssetInput({
426
- type: 2 /* Intent */,
428
+ type: 2 /* Proof */,
427
429
  txid: buf,
428
430
  vin,
429
431
  amount: typeof amount === "number" ? BigInt(amount) : amount
@@ -431,6 +433,8 @@ var AssetInput = class _AssetInput {
431
433
  input.validate();
432
434
  return input;
433
435
  }
436
+ /** @deprecated Use {@link createProof}. */
437
+ static createIntent = _AssetInput.createProof;
434
438
  /** Decode an asset input from its hex string form. */
435
439
  static fromString(s) {
436
440
  return _AssetInput.fromBytes(hexOrThrow(s, "invalid format, must be hex"));
@@ -455,7 +459,7 @@ var AssetInput = class _AssetInput {
455
459
  switch (this.input.type) {
456
460
  case 1 /* Local */:
457
461
  break;
458
- case 2 /* Intent */:
462
+ case 2 /* Proof */:
459
463
  if (isZeroBytes(this.input.txid)) {
460
464
  throw new Error("missing input intent txid");
461
465
  }
@@ -477,7 +481,7 @@ var AssetInput = class _AssetInput {
477
481
  });
478
482
  break;
479
483
  }
480
- case 2 /* Intent */: {
484
+ case 2 /* Proof */: {
481
485
  if (reader.remaining() < TX_HASH_SIZE) {
482
486
  throw new Error("invalid input intent txid length");
483
487
  }
@@ -485,7 +489,7 @@ var AssetInput = class _AssetInput {
485
489
  const vin = reader.readUint16LE();
486
490
  const amount = reader.readVarUint();
487
491
  input = new _AssetInput({
488
- type: 2 /* Intent */,
492
+ type: 2 /* Proof */,
489
493
  txid: new Uint8Array(txid),
490
494
  vin,
491
495
  amount
@@ -503,7 +507,7 @@ var AssetInput = class _AssetInput {
503
507
  /** Serialize the asset input into an existing buffer writer. */
504
508
  serializeTo(writer) {
505
509
  writer.writeByte(this.input.type);
506
- if (this.input.type === 2 /* Intent */) {
510
+ if (this.input.type === 2 /* Proof */) {
507
511
  writer.write(this.input.txid);
508
512
  }
509
513
  writer.writeUint16LE(this.input.vin);
@@ -942,7 +946,7 @@ var AssetGroup = class _AssetGroup {
942
946
  *
943
947
  * @returns `true` when the group has an asset id and outputs exceed local inputs
944
948
  * @remarks
945
- * Only local inputs contribute to the comparison; intent-backed inputs contribute `0` here.
949
+ * Only local inputs contribute to the comparison; proof-backed inputs contribute `0` here.
946
950
  */
947
951
  isReissuance() {
948
952
  const sumReducer = (s, { amount }) => s + amount;
@@ -984,14 +988,14 @@ var AssetGroup = class _AssetGroup {
984
988
  }
985
989
  }
986
990
  /**
987
- * Convert the group into its batch-leaf representation for the given intent txid.
991
+ * Convert the group into its batch-leaf representation for the given proof txid.
988
992
  *
989
- * @param intentTxid - Intent transaction id used to build the leaf input reference
993
+ * @param proofTxid - Proof transaction id used to build the leaf input reference
990
994
  * @returns Batch-leaf asset group
991
- * @see AssetInput.createIntent
995
+ * @see AssetInput.createProof
992
996
  */
993
- toBatchLeafAssetGroup(intentTxid) {
994
- const leafInput = AssetInput.createIntent(base.hex.encode(intentTxid), 0, 0);
997
+ toBatchLeafAssetGroup(proofTxid) {
998
+ const leafInput = AssetInput.createProof(base.hex.encode(proofTxid), 0, 0);
995
999
  return new _AssetGroup(
996
1000
  this.assetId,
997
1001
  this.controlAsset,
@@ -1106,9 +1110,9 @@ var Packet = class _Packet {
1106
1110
  type() {
1107
1111
  return _Packet.PACKET_TYPE;
1108
1112
  }
1109
- /** Convert the packet into the batch-leaf form for a specific intent transaction id. */
1110
- leafTxPacket(intentTxid) {
1111
- const leafGroups = this.groups.map((group) => group.toBatchLeafAssetGroup(intentTxid));
1113
+ /** Convert the packet into the batch-leaf form for a specific proof transaction id. */
1114
+ leafTxPacket(proofTxid) {
1115
+ const leafGroups = this.groups.map((group) => group.toBatchLeafAssetGroup(proofTxid));
1112
1116
  return new _Packet(leafGroups);
1113
1117
  }
1114
1118
  /**
@@ -1316,10 +1320,10 @@ async function indexerFetch(input, init) {
1316
1320
  const lastAttempt = attempt >= maxAttempts;
1317
1321
  let res;
1318
1322
  try {
1319
- res = await chunkKW7ZEWYS_cjs.rateGate.runHttp(input, () => chunkKW7ZEWYS_cjs.baseFetch(input, init));
1323
+ res = await chunkKCL5AVML_cjs.rateGate.runHttp(input, () => chunkKCL5AVML_cjs.baseFetch(input, init));
1320
1324
  } catch (err) {
1321
- const mapped = chunkKW7ZEWYS_cjs.toProviderUnavailable(err, "indexer");
1322
- if (lastAttempt || !(mapped instanceof chunkKW7ZEWYS_cjs.ProviderUnavailableError)) throw mapped;
1325
+ const mapped = chunkKCL5AVML_cjs.toProviderUnavailable(err, "indexer");
1326
+ if (lastAttempt || !(mapped instanceof chunkKCL5AVML_cjs.ProviderUnavailableError)) throw mapped;
1323
1327
  await sleep(retryDelayMs(attempt));
1324
1328
  continue;
1325
1329
  }
@@ -1331,7 +1335,7 @@ async function indexerFetch(input, init) {
1331
1335
  body = void 0;
1332
1336
  }
1333
1337
  try {
1334
- chunkKW7ZEWYS_cjs.throwIfHttpUnavailable(res, "indexer", body);
1338
+ chunkKCL5AVML_cjs.throwIfHttpUnavailable(res, "indexer", body);
1335
1339
  } catch (err) {
1336
1340
  if (lastAttempt) throw err;
1337
1341
  await sleep(retryDelayMs(attempt));
@@ -1359,14 +1363,22 @@ var ChainTxType = /* @__PURE__ */ ((ChainTxType2) => {
1359
1363
  ChainTxType2["CHECKPOINT"] = "INDEXER_CHAINED_TX_TYPE_CHECKPOINT";
1360
1364
  return ChainTxType2;
1361
1365
  })(ChainTxType || {});
1366
+ var IndexerUtxosUnsupportedError = class extends Error {
1367
+ constructor() {
1368
+ super("Arkade server does not support GetUtxos");
1369
+ this.name = "IndexerUtxosUnsupportedError";
1370
+ }
1371
+ };
1362
1372
  var RestIndexerProvider = class {
1363
- constructor(serverUrl = chunkKW7ZEWYS_cjs.DEFAULT_ARKADE_SERVER_URL, options = {}) {
1373
+ constructor(serverUrl = chunkFLPWNMX3_cjs.DEFAULT_ARKADE_SERVER_URL, options = {}) {
1364
1374
  this.serverUrl = serverUrl;
1365
1375
  this.eventSource = options.eventSource;
1366
1376
  }
1367
1377
  serverUrl;
1368
1378
  /** Overrides {@link configureEventSource} for this provider's subscription. */
1369
1379
  eventSource;
1380
+ /** Set by a 404 for this provider's lifetime: a server upgraded meanwhile needs a new one. */
1381
+ utxosUnsupported = false;
1370
1382
  /** @see fetchVtxosJson */
1371
1383
  inFlightVtxoReads = /* @__PURE__ */ new Map();
1372
1384
  async getVtxoTree(batchOutpoint, opts) {
@@ -1487,8 +1499,8 @@ var RestIndexerProvider = class {
1487
1499
  try {
1488
1500
  while (!abortSignal?.aborted) {
1489
1501
  try {
1490
- const currentIterator = chunkKW7ZEWYS_cjs.eventSourceIterator(
1491
- chunkKW7ZEWYS_cjs.resolveEventSource(override)(url)
1502
+ const currentIterator = chunkKCL5AVML_cjs.eventSourceIterator(
1503
+ chunkKCL5AVML_cjs.resolveEventSource(override)(url)
1492
1504
  );
1493
1505
  iterator = currentIterator;
1494
1506
  for await (const event of currentIterator) {
@@ -1505,14 +1517,14 @@ var RestIndexerProvider = class {
1505
1517
  if (abortSignal?.aborted || error instanceof Error && error.name === "AbortError") {
1506
1518
  break;
1507
1519
  }
1508
- if (chunkKW7ZEWYS_cjs.isFetchTimeoutError(error)) {
1520
+ if (chunkKCL5AVML_cjs.isFetchTimeoutError(error)) {
1509
1521
  console.debug("Timeout error ignored");
1510
1522
  continue;
1511
1523
  }
1512
- if (chunkKW7ZEWYS_cjs.isEventSourceError(error)) {
1524
+ if (chunkKCL5AVML_cjs.isEventSourceError(error)) {
1513
1525
  throw error;
1514
1526
  }
1515
- if (chunkKW7ZEWYS_cjs.isEventSourceUnavailableError(error)) throw error;
1527
+ if (chunkKCL5AVML_cjs.isEventSourceUnavailableError(error)) throw error;
1516
1528
  console.error("Subscription error:", error);
1517
1529
  throw error;
1518
1530
  } finally {
@@ -1641,7 +1653,7 @@ var RestIndexerProvider = class {
1641
1653
  }
1642
1654
  const data = await this.fetchVtxosJson(url);
1643
1655
  return {
1644
- vtxos: data.vtxos.map(chunkKW7ZEWYS_cjs.convertVtxo),
1656
+ vtxos: data.vtxos.map(chunkKCL5AVML_cjs.convertVtxo),
1645
1657
  page: data.page
1646
1658
  };
1647
1659
  }
@@ -1676,6 +1688,32 @@ var RestIndexerProvider = class {
1676
1688
  if (this.inFlightVtxoReads.get(url) === shared) this.inFlightVtxoReads.delete(url);
1677
1689
  }
1678
1690
  }
1691
+ async getUtxos(opts) {
1692
+ const hasScripts = (opts.scripts?.length ?? 0) > 0;
1693
+ const hasOutpoints = (opts.outpoints?.length ?? 0) > 0;
1694
+ if (hasScripts === hasOutpoints) {
1695
+ throw new Error("getUtxos needs either scripts or outpoints");
1696
+ }
1697
+ if (this.utxosUnsupported) throw new IndexerUtxosUnsupportedError();
1698
+ const params = new URLSearchParams();
1699
+ for (const script of opts.scripts ?? []) params.append("scripts", script);
1700
+ for (const o of opts.outpoints ?? []) params.append("outpoints", `${o.txid}:${o.vout}`);
1701
+ if (opts.pageIndex !== void 0) params.append("page.index", opts.pageIndex.toString());
1702
+ if (opts.pageSize !== void 0) params.append("page.size", opts.pageSize.toString());
1703
+ const res = await indexerFetch(`${this.serverUrl}/v1/indexer/utxos?${params.toString()}`);
1704
+ if (res.status === 404) {
1705
+ this.utxosUnsupported = true;
1706
+ throw new IndexerUtxosUnsupportedError();
1707
+ }
1708
+ if (!res.ok) {
1709
+ throw new Error(`Failed to fetch utxos: ${res.statusText}`);
1710
+ }
1711
+ const data = await res.json();
1712
+ if (!Response.isUtxosResponse(data)) {
1713
+ throw new Error("Invalid utxos data received");
1714
+ }
1715
+ return { utxos: data.utxos.map(convertUtxo), page: data.page ?? void 0 };
1716
+ }
1679
1717
  async getAssetDetails(assetId) {
1680
1718
  const url = `${this.serverUrl}/v1/indexer/asset/${encodeURIComponent(assetId)}`;
1681
1719
  const res = await indexerFetch(url);
@@ -1727,6 +1765,18 @@ var RestIndexerProvider = class {
1727
1765
  }
1728
1766
  }
1729
1767
  };
1768
+ function convertUtxo(utxo) {
1769
+ const height = Number(utxo.spend.confirmedAtHeight ?? 0);
1770
+ const time = Number(utxo.spend.confirmedAtTime ?? 0);
1771
+ return {
1772
+ txid: utxo.outpoint.txid,
1773
+ vout: utxo.outpoint.vout,
1774
+ value: Number(utxo.amount),
1775
+ script: utxo.script,
1776
+ spentBy: utxo.spend.txid,
1777
+ ...(height > 0 || time > 0) && { spendConfirmation: { height, time } }
1778
+ };
1779
+ }
1730
1780
  function withPage(url, opts) {
1731
1781
  const params = new URLSearchParams();
1732
1782
  if (opts?.pageIndex !== void 0) params.append("page.index", opts.pageIndex.toString());
@@ -1750,9 +1800,9 @@ function toSubscriptionResponse(event) {
1750
1800
  return {
1751
1801
  txid: event.txid,
1752
1802
  scripts: event.scripts || [],
1753
- newVtxos: (event.newVtxos || []).map(chunkKW7ZEWYS_cjs.convertVtxo),
1754
- spentVtxos: (event.spentVtxos || []).map(chunkKW7ZEWYS_cjs.convertVtxo),
1755
- sweptVtxos: (event.sweptVtxos || []).map(chunkKW7ZEWYS_cjs.convertVtxo),
1803
+ newVtxos: (event.newVtxos || []).map(chunkKCL5AVML_cjs.convertVtxo),
1804
+ spentVtxos: (event.spentVtxos || []).map(chunkKCL5AVML_cjs.convertVtxo),
1805
+ sweptVtxos: (event.sweptVtxos || []).map(chunkKCL5AVML_cjs.convertVtxo),
1756
1806
  tx: event.tx,
1757
1807
  checkpointTxs: event.checkpointTxs
1758
1808
  };
@@ -1843,6 +1893,19 @@ var Response;
1843
1893
  return typeof data === "object" && Array.isArray(data.vtxos) && data.vtxos.every(isVtxo) && (!data.page || isPageResponse(data.page));
1844
1894
  }
1845
1895
  Response2.isVtxosResponse = isVtxosResponse;
1896
+ function isWireInt(data) {
1897
+ return typeof data === "string" ? /^\d+$/.test(data) && Number.isSafeInteger(Number(data)) : typeof data === "number" && Number.isSafeInteger(data) && data >= 0;
1898
+ }
1899
+ function isOptionalWireInt(data) {
1900
+ return data === void 0 || isWireInt(data);
1901
+ }
1902
+ function isUtxo(data) {
1903
+ return typeof data === "object" && data !== null && isOutpoint(data.outpoint) && isWireInt(data.amount) && typeof data.script === "string" && typeof data.spend === "object" && data.spend !== null && isTxid(data.spend.txid) && isOptionalWireInt(data.spend.confirmedAtTime) && isOptionalWireInt(data.spend.confirmedAtHeight);
1904
+ }
1905
+ function isUtxosResponse(data) {
1906
+ return typeof data === "object" && data !== null && Array.isArray(data.utxos) && data.utxos.every(isUtxo) && (!data.page || isPageResponse(data.page));
1907
+ }
1908
+ Response2.isUtxosResponse = isUtxosResponse;
1846
1909
  function isGetAssetResponse(data) {
1847
1910
  return typeof data === "object" && data !== null && typeof data.assetId === "string" && typeof data.supply === "string" && (data.controlAsset === void 0 || typeof data.controlAsset === "string") && (data.metadata === void 0 || typeof data.metadata === "string");
1848
1911
  }
@@ -1859,10 +1922,11 @@ exports.BufferWriter = BufferWriter;
1859
1922
  exports.ChainTxType = ChainTxType;
1860
1923
  exports.DEFAULT_VTXO_PAGE_SIZE = DEFAULT_VTXO_PAGE_SIZE;
1861
1924
  exports.IndexerTxType = IndexerTxType;
1925
+ exports.IndexerUtxosUnsupportedError = IndexerUtxosUnsupportedError;
1862
1926
  exports.Metadata = Metadata;
1863
1927
  exports.Packet = Packet;
1864
1928
  exports.RestIndexerProvider = RestIndexerProvider;
1865
1929
  exports.asset_exports = asset_exports;
1866
1930
  exports.toSubscriptionMessage = toSubscriptionMessage;
1867
- //# sourceMappingURL=chunk-ZMSM3NOH.cjs.map
1868
- //# sourceMappingURL=chunk-ZMSM3NOH.cjs.map
1931
+ //# sourceMappingURL=chunk-XWUCNMPN.cjs.map
1932
+ //# sourceMappingURL=chunk-XWUCNMPN.cjs.map