@arkade-os/sdk 0.4.59 → 0.4.61

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 (88) hide show
  1. package/README.md +34 -6
  2. package/dist/adapters/expo.cjs +5 -5
  3. package/dist/adapters/expo.d.cts +4 -4
  4. package/dist/adapters/expo.d.ts +4 -4
  5. package/dist/adapters/expo.js +3 -3
  6. package/dist/adapters/indexedDB.cjs +5 -5
  7. package/dist/adapters/indexedDB.js +4 -4
  8. package/dist/{asyncStorageTaskQueue-CYHXFfvn.d.cts → asyncStorageTaskQueue-BWDxp3Dr.d.cts} +2 -2
  9. package/dist/{asyncStorageTaskQueue-BwuWQ1Qc.d.ts → asyncStorageTaskQueue-Cq9FpKv6.d.ts} +2 -2
  10. package/dist/{chunk-V2KENVN6.cjs → chunk-2JHN5RCY.cjs} +22 -15
  11. package/dist/chunk-2JHN5RCY.cjs.map +1 -0
  12. package/dist/{chunk-DYNB6POO.cjs → chunk-3NUDA3MB.cjs} +4423 -2934
  13. package/dist/chunk-3NUDA3MB.cjs.map +1 -0
  14. package/dist/{chunk-PN5RD7ZI.js → chunk-6O5OLYTZ.js} +1685 -1138
  15. package/dist/chunk-6O5OLYTZ.js.map +1 -0
  16. package/dist/{chunk-OVSNY3HC.js → chunk-AUEXB42T.js} +3965 -2503
  17. package/dist/chunk-AUEXB42T.js.map +1 -0
  18. package/dist/{chunk-DSTYXT2D.cjs → chunk-FNCQJLR2.cjs} +44 -6
  19. package/dist/chunk-FNCQJLR2.cjs.map +1 -0
  20. package/dist/{chunk-VSHY5TBY.js → chunk-GDI2A65Z.js} +4 -4
  21. package/dist/{chunk-VSHY5TBY.js.map → chunk-GDI2A65Z.js.map} +1 -1
  22. package/dist/{chunk-FIMOVH25.js → chunk-PVY6DMN5.js} +40 -7
  23. package/dist/chunk-PVY6DMN5.js.map +1 -0
  24. package/dist/{chunk-2XO43UHI.cjs → chunk-SF5NKAUA.cjs} +1731 -1180
  25. package/dist/chunk-SF5NKAUA.cjs.map +1 -0
  26. package/dist/{chunk-7FA36NOA.cjs → chunk-XFYFREPH.cjs} +17 -17
  27. package/dist/{chunk-7FA36NOA.cjs.map → chunk-XFYFREPH.cjs.map} +1 -1
  28. package/dist/{chunk-H342JPPZ.js → chunk-XLHN5L2O.js} +5 -5
  29. package/dist/chunk-XLHN5L2O.js.map +1 -0
  30. package/dist/{chunk-IPFGYVF3.cjs → chunk-XMRB74HA.cjs} +10 -10
  31. package/dist/chunk-XMRB74HA.cjs.map +1 -0
  32. package/dist/{chunk-YEHGCHIL.js → chunk-YVQNHELA.js} +12 -5
  33. package/dist/chunk-YVQNHELA.js.map +1 -0
  34. package/dist/contracts/handlers/index.cjs +12 -8
  35. package/dist/contracts/handlers/index.d.cts +5 -5
  36. package/dist/contracts/handlers/index.d.ts +5 -5
  37. package/dist/contracts/handlers/index.js +2 -2
  38. package/dist/{delegate-D0eGaz3J.d.cts → delegate-BySzD37I.d.ts} +1 -1
  39. package/dist/{delegate-B_oKWm1k.d.ts → delegate-C4Rl6h9l.d.cts} +1 -1
  40. package/dist/{ark-C9DsPSm8.d.cts → index-BcRCHnzN.d.cts} +4887 -4331
  41. package/dist/{ark-C9DsPSm8.d.ts → index-BcRCHnzN.d.ts} +4887 -4331
  42. package/dist/{index-BmK6tEqf.d.ts → index-Butfkm-K.d.cts} +224 -68
  43. package/dist/{index-BG2AL2Ie.d.cts → index-C29VNcxC.d.ts} +224 -68
  44. package/dist/index.cjs +374 -230
  45. package/dist/index.d.cts +522 -82
  46. package/dist/index.d.ts +522 -82
  47. package/dist/index.js +4 -4
  48. package/dist/repositories/realm/index.cjs +43 -23
  49. package/dist/repositories/realm/index.cjs.map +1 -1
  50. package/dist/repositories/realm/index.d.cts +23 -11
  51. package/dist/repositories/realm/index.d.ts +23 -11
  52. package/dist/repositories/realm/index.js +29 -9
  53. package/dist/repositories/realm/index.js.map +1 -1
  54. package/dist/repositories/sqlite/index.cjs +48 -23
  55. package/dist/repositories/sqlite/index.cjs.map +1 -1
  56. package/dist/repositories/sqlite/index.d.cts +11 -5
  57. package/dist/repositories/sqlite/index.d.ts +11 -5
  58. package/dist/repositories/sqlite/index.js +35 -10
  59. package/dist/repositories/sqlite/index.js.map +1 -1
  60. package/dist/{taskRunner-Cy4Gh8n7.d.ts → taskRunner-BTq3rMpI.d.cts} +2 -2
  61. package/dist/{taskRunner-CBvKIttE.d.cts → taskRunner-DxMJYJ7Y.d.ts} +2 -2
  62. package/dist/wallet/expo/background.cjs +14 -14
  63. package/dist/wallet/expo/background.d.cts +5 -5
  64. package/dist/wallet/expo/background.d.ts +5 -5
  65. package/dist/wallet/expo/background.js +6 -6
  66. package/dist/wallet/expo/index.cjs +37 -14
  67. package/dist/wallet/expo/index.cjs.map +1 -1
  68. package/dist/wallet/expo/index.d.cts +13 -5
  69. package/dist/wallet/expo/index.d.ts +13 -5
  70. package/dist/wallet/expo/index.js +28 -5
  71. package/dist/wallet/expo/index.js.map +1 -1
  72. package/dist/{wallet-EyVDhqzP.d.ts → wallet-BVIfg2ic.d.ts} +222 -19
  73. package/dist/{wallet-DlXemAzP.d.cts → wallet-DrSsUden.d.cts} +222 -19
  74. package/dist/worker/expo/index.cjs +9 -9
  75. package/dist/worker/expo/index.d.cts +7 -7
  76. package/dist/worker/expo/index.d.ts +7 -7
  77. package/dist/worker/expo/index.js +5 -5
  78. package/package.json +4 -2
  79. package/dist/chunk-2XO43UHI.cjs.map +0 -1
  80. package/dist/chunk-DSTYXT2D.cjs.map +0 -1
  81. package/dist/chunk-DYNB6POO.cjs.map +0 -1
  82. package/dist/chunk-FIMOVH25.js.map +0 -1
  83. package/dist/chunk-H342JPPZ.js.map +0 -1
  84. package/dist/chunk-IPFGYVF3.cjs.map +0 -1
  85. package/dist/chunk-OVSNY3HC.js.map +0 -1
  86. package/dist/chunk-PN5RD7ZI.js.map +0 -1
  87. package/dist/chunk-V2KENVN6.cjs.map +0 -1
  88. package/dist/chunk-YEHGCHIL.js.map +0 -1
package/README.md CHANGED
@@ -914,6 +914,7 @@ import {
914
914
  WalletMessageHandler,
915
915
  IndexedDBWalletRepository,
916
916
  IndexedDBContractRepository,
917
+ IndexedDBIntentRepository,
917
918
  } from '@arkade-os/sdk'
918
919
 
919
920
  const walletRepo = new IndexedDBWalletRepository()
@@ -922,6 +923,10 @@ const contractRepo = new IndexedDBContractRepository()
922
923
  const bus = new MessageBus(walletRepo, contractRepo, {
923
924
  messageHandlers: [new WalletMessageHandler()],
924
925
  tickIntervalMs: 10_000, // default 10s
926
+ // Optional, same opt-in as `storage.intentRepository` on a main-thread
927
+ // wallet. Omit it and the worker persists no settlement intent, reconciles
928
+ // none on restart, and counts intent-locked VTXOs as available.
929
+ intentRepository: new IndexedDBIntentRepository(),
925
930
  })
926
931
 
927
932
  bus.start()
@@ -1141,7 +1146,7 @@ const wallet = await Wallet.create({
1141
1146
 
1142
1147
  ### Using with Node.js
1143
1148
 
1144
- Node.js does not provide a global `EventSource` implementation. The SDK relies on `EventSource` for Server-Sent Events during settlement (onboarding/offboarding) and contract watching. You must polyfill it before using the SDK:
1149
+ Node.js does not provide a global `EventSource` implementation (24.x has one behind `--experimental-eventsource`). The SDK relies on `EventSource` for Server-Sent Events during settlement (onboarding/offboarding) and contract watching, so tell it which one to use:
1145
1150
 
1146
1151
  ```bash
1147
1152
  npm install eventsource
@@ -1149,12 +1154,15 @@ npm install eventsource
1149
1154
 
1150
1155
  ```typescript
1151
1156
  import { EventSource } from "eventsource";
1152
- (globalThis as any).EventSource = EventSource;
1157
+ import { configureEventSource, Wallet } from "@arkade-os/sdk";
1153
1158
 
1154
- // Use dynamic import so the polyfill is set before the SDK evaluates
1155
- const { Wallet } = await import("@arkade-os/sdk");
1159
+ configureEventSource((url) => new EventSource(url));
1156
1160
  ```
1157
1161
 
1162
+ Order does not matter: the factory is resolved when a stream opens, not when the SDK is imported, so no dynamic-import dance is needed. A single provider can override it — `new RestIndexerProvider(url, { eventSource })` — for a process that needs different transports per connection.
1163
+
1164
+ Assigning `globalThis.EventSource` still works and is still the last resort in the resolution order (per-provider option → `configureEventSource` → global).
1165
+
1158
1166
  If you also need IndexedDB persistence (e.g. for `WalletRepository`), set up the shim before any SDK import:
1159
1167
 
1160
1168
  ```typescript
@@ -1168,8 +1176,10 @@ setGlobalVars(null, { checkOrigin: false });
1168
1176
  ```
1169
1177
 
1170
1178
  > **Note:** `eventsource` and `indexeddbshim` are optional peer dependencies.
1171
- > Without the `EventSource` polyfill, settlement operations will fail with
1172
- > `ReferenceError: EventSource is not defined`.
1179
+ > With no `EventSource` available, settlement fails with a typed
1180
+ > `EventSourceUnavailableError` naming the remedy, and contract watching warns
1181
+ > once and falls back to its failsafe polling — it does not retry a missing
1182
+ > global, and it does not go quiet either.
1173
1183
 
1174
1184
  See [`examples/node/multiple-wallets.ts`](examples/node/multiple-wallets.ts) for a complete working example.
1175
1185
 
@@ -1351,6 +1361,24 @@ Contract freshness behavior:
1351
1361
  - **Failsafe polling** every 20 seconds by default to catch missed events, configurable via `watcherConfig.failsafePollIntervalMs`
1352
1362
  - **Manual refresh** through `manager.refreshVtxos()`; pass `{ includeInactive: true }` to sweep every repository contract
1353
1363
 
1364
+ Which contracts get that coverage is `contract.watch`, and it is independent of
1365
+ `contract.state` (which only governs receive-address selection — a retired
1366
+ receive address stays watched, because it can still be paid):
1367
+
1368
+ ```typescript
1369
+ // Watch a one-shot destination only until it is funded; the manager
1370
+ // demotes it to `retained` itself once a VTXO lands.
1371
+ await manager.createContract({ ...params, watch: 'awaiting-funds' })
1372
+
1373
+ // A finished contract — a settled swap lockup, say. The row stays for
1374
+ // history, annotation and restore; it just leaves the subscription and
1375
+ // the poll. Unlike `deleteContract`, nothing is lost.
1376
+ await manager.setContractWatchState(script, 'retained')
1377
+ ```
1378
+
1379
+ A row with no `watch` value is `watched`, so contracts written by earlier SDK
1380
+ versions keep the coverage they have today.
1381
+
1354
1382
  ### Repository Pattern
1355
1383
 
1356
1384
  Most users don't need to touch repositories directly — `Wallet` reads through them and `ContractManager` owns VTXO/contract synchronization into them. They are documented here for advanced integrations (custom storage backends, offline-first apps, repository inspection).
@@ -1,19 +1,19 @@
1
1
  'use strict';
2
2
 
3
- var chunk7FA36NOA_cjs = require('../chunk-7FA36NOA.cjs');
4
- require('../chunk-V2KENVN6.cjs');
5
- require('../chunk-DSTYXT2D.cjs');
3
+ var chunkXFYFREPH_cjs = require('../chunk-XFYFREPH.cjs');
4
+ require('../chunk-2JHN5RCY.cjs');
5
+ require('../chunk-FNCQJLR2.cjs');
6
6
  require('../chunk-5BLDMQED.cjs');
7
7
 
8
8
 
9
9
 
10
10
  Object.defineProperty(exports, "ExpoArkProvider", {
11
11
  enumerable: true,
12
- get: function () { return chunk7FA36NOA_cjs.ExpoArkProvider; }
12
+ get: function () { return chunkXFYFREPH_cjs.ExpoArkProvider; }
13
13
  });
14
14
  Object.defineProperty(exports, "ExpoIndexerProvider", {
15
15
  enumerable: true,
16
- get: function () { return chunk7FA36NOA_cjs.ExpoIndexerProvider; }
16
+ get: function () { return chunkXFYFREPH_cjs.ExpoIndexerProvider; }
17
17
  });
18
18
  //# sourceMappingURL=expo.cjs.map
19
19
  //# sourceMappingURL=expo.cjs.map
@@ -1,9 +1,9 @@
1
- import { k as RestArkProvider, i as SettlementEvent, T as TxNotification, l as RestIndexerProvider, m as SubscriptionResponse } from '../ark-C9DsPSm8.cjs';
2
- export { n as ArkProvider, o as IndexerProvider } from '../ark-C9DsPSm8.cjs';
3
- import '@scure/btc-signer/transaction.js';
1
+ import { k as RestArkProvider, i as SettlementEvent, T as TxNotification, l as RestIndexerProvider, m as SubscriptionResponse } from '../index-BcRCHnzN.cjs';
2
+ export { n as ArkProvider, o as IndexerProvider } from '../index-BcRCHnzN.cjs';
4
3
  import '@scure/btc-signer/utils.js';
5
- import '@scure/btc-signer/psbt.js';
4
+ import '@scure/btc-signer/transaction.js';
6
5
  import '@scure/btc-signer';
6
+ import '@scure/btc-signer/psbt.js';
7
7
 
8
8
  /**
9
9
  * Expo-compatible Arkade provider implementation using expo/fetch for SSE support.
@@ -1,9 +1,9 @@
1
- import { k as RestArkProvider, i as SettlementEvent, T as TxNotification, l as RestIndexerProvider, m as SubscriptionResponse } from '../ark-C9DsPSm8.js';
2
- export { n as ArkProvider, o as IndexerProvider } from '../ark-C9DsPSm8.js';
3
- import '@scure/btc-signer/transaction.js';
1
+ import { k as RestArkProvider, i as SettlementEvent, T as TxNotification, l as RestIndexerProvider, m as SubscriptionResponse } from '../index-BcRCHnzN.js';
2
+ export { n as ArkProvider, o as IndexerProvider } from '../index-BcRCHnzN.js';
4
3
  import '@scure/btc-signer/utils.js';
5
- import '@scure/btc-signer/psbt.js';
4
+ import '@scure/btc-signer/transaction.js';
6
5
  import '@scure/btc-signer';
6
+ import '@scure/btc-signer/psbt.js';
7
7
 
8
8
  /**
9
9
  * Expo-compatible Arkade provider implementation using expo/fetch for SSE support.
@@ -1,6 +1,6 @@
1
- export { ExpoArkProvider, ExpoIndexerProvider } from '../chunk-VSHY5TBY.js';
2
- import '../chunk-YEHGCHIL.js';
3
- import '../chunk-FIMOVH25.js';
1
+ export { ExpoArkProvider, ExpoIndexerProvider } from '../chunk-GDI2A65Z.js';
2
+ import '../chunk-YVQNHELA.js';
3
+ import '../chunk-PVY6DMN5.js';
4
4
  import '../chunk-NSBPE2FW.js';
5
5
  //# sourceMappingURL=expo.js.map
6
6
  //# sourceMappingURL=expo.js.map
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkDYNB6POO_cjs = require('../chunk-DYNB6POO.cjs');
4
- require('../chunk-V2KENVN6.cjs');
5
- require('../chunk-2XO43UHI.cjs');
6
- require('../chunk-DSTYXT2D.cjs');
3
+ var chunk3NUDA3MB_cjs = require('../chunk-3NUDA3MB.cjs');
4
+ require('../chunk-2JHN5RCY.cjs');
5
+ require('../chunk-SF5NKAUA.cjs');
6
+ require('../chunk-FNCQJLR2.cjs');
7
7
  require('../chunk-5BLDMQED.cjs');
8
8
 
9
9
  // src/storage/indexedDB.ts
@@ -11,7 +11,7 @@ var IndexedDBStorageAdapter = class {
11
11
  dbName;
12
12
  version;
13
13
  db = null;
14
- constructor(dbName, version = chunkDYNB6POO_cjs.DB_VERSION) {
14
+ constructor(dbName, version = chunk3NUDA3MB_cjs.DB_VERSION) {
15
15
  this.dbName = dbName;
16
16
  this.version = version;
17
17
  }
@@ -1,7 +1,7 @@
1
- import { DB_VERSION } from '../chunk-OVSNY3HC.js';
2
- import '../chunk-YEHGCHIL.js';
3
- import '../chunk-PN5RD7ZI.js';
4
- import '../chunk-FIMOVH25.js';
1
+ import { DB_VERSION } from '../chunk-AUEXB42T.js';
2
+ import '../chunk-YVQNHELA.js';
3
+ import '../chunk-6O5OLYTZ.js';
4
+ import '../chunk-PVY6DMN5.js';
5
5
  import '../chunk-NSBPE2FW.js';
6
6
 
7
7
  // src/storage/indexedDB.ts
@@ -1,4 +1,4 @@
1
- import { c as TaskQueue, b as TaskItem, d as TaskResult } from './taskRunner-CBvKIttE.cjs';
1
+ import { a as TaskQueue, c as TaskItem, d as TaskResult } from './taskRunner-BTq3rMpI.cjs';
2
2
 
3
3
  /**
4
4
  * Minimal async key-value storage interface.
@@ -46,4 +46,4 @@ declare class AsyncStorageTaskQueue implements TaskQueue {
46
46
  private writeList;
47
47
  }
48
48
 
49
- export { type AsyncStorageLike as A, AsyncStorageTaskQueue as a };
49
+ export { AsyncStorageTaskQueue as A, type AsyncStorageLike as a };
@@ -1,4 +1,4 @@
1
- import { c as TaskQueue, b as TaskItem, d as TaskResult } from './taskRunner-Cy4Gh8n7.js';
1
+ import { a as TaskQueue, c as TaskItem, d as TaskResult } from './taskRunner-DxMJYJ7Y.js';
2
2
 
3
3
  /**
4
4
  * Minimal async key-value storage interface.
@@ -46,4 +46,4 @@ declare class AsyncStorageTaskQueue implements TaskQueue {
46
46
  private writeList;
47
47
  }
48
48
 
49
- export { type AsyncStorageLike as A, AsyncStorageTaskQueue as a };
49
+ export { AsyncStorageTaskQueue as A, type AsyncStorageLike as a };
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkDSTYXT2D_cjs = require('./chunk-DSTYXT2D.cjs');
3
+ var chunkFNCQJLR2_cjs = require('./chunk-FNCQJLR2.cjs');
4
4
  var chunk5BLDMQED_cjs = require('./chunk-5BLDMQED.cjs');
5
5
  var base = require('@scure/base');
6
6
  var secp256k1_js = require('@noble/curves/secp256k1.js');
@@ -1282,10 +1282,10 @@ async function indexerFetch(input, init) {
1282
1282
  const lastAttempt = attempt >= maxAttempts;
1283
1283
  let res;
1284
1284
  try {
1285
- res = await chunkDSTYXT2D_cjs.rateGate.runHttp(input, () => chunkDSTYXT2D_cjs.baseFetch(input, init));
1285
+ res = await chunkFNCQJLR2_cjs.rateGate.runHttp(input, () => chunkFNCQJLR2_cjs.baseFetch(input, init));
1286
1286
  } catch (err) {
1287
- const mapped = chunkDSTYXT2D_cjs.toProviderUnavailable(err, "indexer");
1288
- if (lastAttempt || !(mapped instanceof chunkDSTYXT2D_cjs.ProviderUnavailableError)) throw mapped;
1287
+ const mapped = chunkFNCQJLR2_cjs.toProviderUnavailable(err, "indexer");
1288
+ if (lastAttempt || !(mapped instanceof chunkFNCQJLR2_cjs.ProviderUnavailableError)) throw mapped;
1289
1289
  await sleep(retryDelayMs(attempt));
1290
1290
  continue;
1291
1291
  }
@@ -1297,7 +1297,7 @@ async function indexerFetch(input, init) {
1297
1297
  body = void 0;
1298
1298
  }
1299
1299
  try {
1300
- chunkDSTYXT2D_cjs.throwIfHttpUnavailable(res, "indexer", body);
1300
+ chunkFNCQJLR2_cjs.throwIfHttpUnavailable(res, "indexer", body);
1301
1301
  } catch (err) {
1302
1302
  if (lastAttempt) throw err;
1303
1303
  await sleep(retryDelayMs(attempt));
@@ -1325,10 +1325,13 @@ var ChainTxType = /* @__PURE__ */ ((ChainTxType2) => {
1325
1325
  return ChainTxType2;
1326
1326
  })(ChainTxType || {});
1327
1327
  var RestIndexerProvider = class {
1328
- constructor(serverUrl = chunkDSTYXT2D_cjs.DEFAULT_ARKADE_SERVER_URL) {
1328
+ constructor(serverUrl = chunkFNCQJLR2_cjs.DEFAULT_ARKADE_SERVER_URL, options = {}) {
1329
1329
  this.serverUrl = serverUrl;
1330
+ this.eventSource = options.eventSource;
1330
1331
  }
1331
1332
  serverUrl;
1333
+ /** Overrides {@link configureEventSource} for this provider's subscription. */
1334
+ eventSource;
1332
1335
  async getVtxoTree(batchOutpoint, opts) {
1333
1336
  let url = `${this.serverUrl}/v1/indexer/batch/${batchOutpoint.txid}/${batchOutpoint.vout}/tree`;
1334
1337
  const params = new URLSearchParams();
@@ -1449,6 +1452,7 @@ var RestIndexerProvider = class {
1449
1452
  }
1450
1453
  getSubscription(subscriptionId, abortSignal) {
1451
1454
  const url = `${this.serverUrl}/v1/indexer/script/subscription/${subscriptionId}`;
1455
+ const override = this.eventSource;
1452
1456
  let iterator = null;
1453
1457
  const closeIterator = () => iterator?.close();
1454
1458
  const gen = (async function* () {
@@ -1457,7 +1461,9 @@ var RestIndexerProvider = class {
1457
1461
  try {
1458
1462
  while (!abortSignal?.aborted) {
1459
1463
  try {
1460
- const currentIterator = chunkDSTYXT2D_cjs.eventSourceIterator(new EventSource(url));
1464
+ const currentIterator = chunkFNCQJLR2_cjs.eventSourceIterator(
1465
+ chunkFNCQJLR2_cjs.resolveEventSource(override)(url)
1466
+ );
1461
1467
  iterator = currentIterator;
1462
1468
  for await (const event of currentIterator) {
1463
1469
  if (abortSignal?.aborted) break;
@@ -1467,9 +1473,9 @@ var RestIndexerProvider = class {
1467
1473
  yield {
1468
1474
  txid: data.event.txid,
1469
1475
  scripts: data.event.scripts || [],
1470
- newVtxos: (data.event.newVtxos || []).map(chunkDSTYXT2D_cjs.convertVtxo),
1471
- spentVtxos: (data.event.spentVtxos || []).map(chunkDSTYXT2D_cjs.convertVtxo),
1472
- sweptVtxos: (data.event.sweptVtxos || []).map(chunkDSTYXT2D_cjs.convertVtxo),
1476
+ newVtxos: (data.event.newVtxos || []).map(chunkFNCQJLR2_cjs.convertVtxo),
1477
+ spentVtxos: (data.event.spentVtxos || []).map(chunkFNCQJLR2_cjs.convertVtxo),
1478
+ sweptVtxos: (data.event.sweptVtxos || []).map(chunkFNCQJLR2_cjs.convertVtxo),
1473
1479
  tx: data.event.tx,
1474
1480
  checkpointTxs: data.event.checkpointTxs
1475
1481
  };
@@ -1483,13 +1489,14 @@ var RestIndexerProvider = class {
1483
1489
  if (abortSignal?.aborted || error instanceof Error && error.name === "AbortError") {
1484
1490
  break;
1485
1491
  }
1486
- if (chunkDSTYXT2D_cjs.isFetchTimeoutError(error)) {
1492
+ if (chunkFNCQJLR2_cjs.isFetchTimeoutError(error)) {
1487
1493
  console.debug("Timeout error ignored");
1488
1494
  continue;
1489
1495
  }
1490
- if (chunkDSTYXT2D_cjs.isEventSourceError(error)) {
1496
+ if (chunkFNCQJLR2_cjs.isEventSourceError(error)) {
1491
1497
  throw error;
1492
1498
  }
1499
+ if (chunkFNCQJLR2_cjs.isEventSourceUnavailableError(error)) throw error;
1493
1500
  console.error("Subscription error:", error);
1494
1501
  throw error;
1495
1502
  } finally {
@@ -1615,7 +1622,7 @@ var RestIndexerProvider = class {
1615
1622
  throw new Error("Invalid vtxos data received");
1616
1623
  }
1617
1624
  return {
1618
- vtxos: data.vtxos.map(chunkDSTYXT2D_cjs.convertVtxo),
1625
+ vtxos: data.vtxos.map(chunkFNCQJLR2_cjs.convertVtxo),
1619
1626
  page: data.page
1620
1627
  };
1621
1628
  }
@@ -1797,5 +1804,5 @@ exports.Metadata = Metadata;
1797
1804
  exports.Packet = Packet;
1798
1805
  exports.RestIndexerProvider = RestIndexerProvider;
1799
1806
  exports.asset_exports = asset_exports;
1800
- //# sourceMappingURL=chunk-V2KENVN6.cjs.map
1801
- //# sourceMappingURL=chunk-V2KENVN6.cjs.map
1807
+ //# sourceMappingURL=chunk-2JHN5RCY.cjs.map
1808
+ //# sourceMappingURL=chunk-2JHN5RCY.cjs.map