@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.
- package/README.md +34 -6
- package/dist/adapters/expo.cjs +5 -5
- package/dist/adapters/expo.d.cts +4 -4
- package/dist/adapters/expo.d.ts +4 -4
- package/dist/adapters/expo.js +3 -3
- package/dist/adapters/indexedDB.cjs +5 -5
- package/dist/adapters/indexedDB.js +4 -4
- package/dist/{asyncStorageTaskQueue-CYHXFfvn.d.cts → asyncStorageTaskQueue-BWDxp3Dr.d.cts} +2 -2
- package/dist/{asyncStorageTaskQueue-BwuWQ1Qc.d.ts → asyncStorageTaskQueue-Cq9FpKv6.d.ts} +2 -2
- package/dist/{chunk-V2KENVN6.cjs → chunk-2JHN5RCY.cjs} +22 -15
- package/dist/chunk-2JHN5RCY.cjs.map +1 -0
- package/dist/{chunk-DYNB6POO.cjs → chunk-3NUDA3MB.cjs} +4423 -2934
- package/dist/chunk-3NUDA3MB.cjs.map +1 -0
- package/dist/{chunk-PN5RD7ZI.js → chunk-6O5OLYTZ.js} +1685 -1138
- package/dist/chunk-6O5OLYTZ.js.map +1 -0
- package/dist/{chunk-OVSNY3HC.js → chunk-AUEXB42T.js} +3965 -2503
- package/dist/chunk-AUEXB42T.js.map +1 -0
- package/dist/{chunk-DSTYXT2D.cjs → chunk-FNCQJLR2.cjs} +44 -6
- package/dist/chunk-FNCQJLR2.cjs.map +1 -0
- package/dist/{chunk-VSHY5TBY.js → chunk-GDI2A65Z.js} +4 -4
- package/dist/{chunk-VSHY5TBY.js.map → chunk-GDI2A65Z.js.map} +1 -1
- package/dist/{chunk-FIMOVH25.js → chunk-PVY6DMN5.js} +40 -7
- package/dist/chunk-PVY6DMN5.js.map +1 -0
- package/dist/{chunk-2XO43UHI.cjs → chunk-SF5NKAUA.cjs} +1731 -1180
- package/dist/chunk-SF5NKAUA.cjs.map +1 -0
- package/dist/{chunk-7FA36NOA.cjs → chunk-XFYFREPH.cjs} +17 -17
- package/dist/{chunk-7FA36NOA.cjs.map → chunk-XFYFREPH.cjs.map} +1 -1
- package/dist/{chunk-H342JPPZ.js → chunk-XLHN5L2O.js} +5 -5
- package/dist/chunk-XLHN5L2O.js.map +1 -0
- package/dist/{chunk-IPFGYVF3.cjs → chunk-XMRB74HA.cjs} +10 -10
- package/dist/chunk-XMRB74HA.cjs.map +1 -0
- package/dist/{chunk-YEHGCHIL.js → chunk-YVQNHELA.js} +12 -5
- package/dist/chunk-YVQNHELA.js.map +1 -0
- package/dist/contracts/handlers/index.cjs +12 -8
- package/dist/contracts/handlers/index.d.cts +5 -5
- package/dist/contracts/handlers/index.d.ts +5 -5
- package/dist/contracts/handlers/index.js +2 -2
- package/dist/{delegate-D0eGaz3J.d.cts → delegate-BySzD37I.d.ts} +1 -1
- package/dist/{delegate-B_oKWm1k.d.ts → delegate-C4Rl6h9l.d.cts} +1 -1
- package/dist/{ark-C9DsPSm8.d.cts → index-BcRCHnzN.d.cts} +4887 -4331
- package/dist/{ark-C9DsPSm8.d.ts → index-BcRCHnzN.d.ts} +4887 -4331
- package/dist/{index-BmK6tEqf.d.ts → index-Butfkm-K.d.cts} +224 -68
- package/dist/{index-BG2AL2Ie.d.cts → index-C29VNcxC.d.ts} +224 -68
- package/dist/index.cjs +374 -230
- package/dist/index.d.cts +522 -82
- package/dist/index.d.ts +522 -82
- package/dist/index.js +4 -4
- package/dist/repositories/realm/index.cjs +43 -23
- package/dist/repositories/realm/index.cjs.map +1 -1
- package/dist/repositories/realm/index.d.cts +23 -11
- package/dist/repositories/realm/index.d.ts +23 -11
- package/dist/repositories/realm/index.js +29 -9
- package/dist/repositories/realm/index.js.map +1 -1
- package/dist/repositories/sqlite/index.cjs +48 -23
- package/dist/repositories/sqlite/index.cjs.map +1 -1
- package/dist/repositories/sqlite/index.d.cts +11 -5
- package/dist/repositories/sqlite/index.d.ts +11 -5
- package/dist/repositories/sqlite/index.js +35 -10
- package/dist/repositories/sqlite/index.js.map +1 -1
- package/dist/{taskRunner-Cy4Gh8n7.d.ts → taskRunner-BTq3rMpI.d.cts} +2 -2
- package/dist/{taskRunner-CBvKIttE.d.cts → taskRunner-DxMJYJ7Y.d.ts} +2 -2
- package/dist/wallet/expo/background.cjs +14 -14
- package/dist/wallet/expo/background.d.cts +5 -5
- package/dist/wallet/expo/background.d.ts +5 -5
- package/dist/wallet/expo/background.js +6 -6
- package/dist/wallet/expo/index.cjs +37 -14
- package/dist/wallet/expo/index.cjs.map +1 -1
- package/dist/wallet/expo/index.d.cts +13 -5
- package/dist/wallet/expo/index.d.ts +13 -5
- package/dist/wallet/expo/index.js +28 -5
- package/dist/wallet/expo/index.js.map +1 -1
- package/dist/{wallet-EyVDhqzP.d.ts → wallet-BVIfg2ic.d.ts} +222 -19
- package/dist/{wallet-DlXemAzP.d.cts → wallet-DrSsUden.d.cts} +222 -19
- package/dist/worker/expo/index.cjs +9 -9
- package/dist/worker/expo/index.d.cts +7 -7
- package/dist/worker/expo/index.d.ts +7 -7
- package/dist/worker/expo/index.js +5 -5
- package/package.json +4 -2
- package/dist/chunk-2XO43UHI.cjs.map +0 -1
- package/dist/chunk-DSTYXT2D.cjs.map +0 -1
- package/dist/chunk-DYNB6POO.cjs.map +0 -1
- package/dist/chunk-FIMOVH25.js.map +0 -1
- package/dist/chunk-H342JPPZ.js.map +0 -1
- package/dist/chunk-IPFGYVF3.cjs.map +0 -1
- package/dist/chunk-OVSNY3HC.js.map +0 -1
- package/dist/chunk-PN5RD7ZI.js.map +0 -1
- package/dist/chunk-V2KENVN6.cjs.map +0 -1
- 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
|
|
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
|
-
|
|
1157
|
+
import { configureEventSource, Wallet } from "@arkade-os/sdk";
|
|
1153
1158
|
|
|
1154
|
-
|
|
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
|
-
>
|
|
1172
|
-
> `
|
|
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).
|
package/dist/adapters/expo.cjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
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
|
|
12
|
+
get: function () { return chunkXFYFREPH_cjs.ExpoArkProvider; }
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "ExpoIndexerProvider", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkXFYFREPH_cjs.ExpoIndexerProvider; }
|
|
17
17
|
});
|
|
18
18
|
//# sourceMappingURL=expo.cjs.map
|
|
19
19
|
//# sourceMappingURL=expo.cjs.map
|
package/dist/adapters/expo.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { k as RestArkProvider, i as SettlementEvent, T as TxNotification, l as RestIndexerProvider, m as SubscriptionResponse } from '../
|
|
2
|
-
export { n as ArkProvider, o as IndexerProvider } from '../
|
|
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/
|
|
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.
|
package/dist/adapters/expo.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { k as RestArkProvider, i as SettlementEvent, T as TxNotification, l as RestIndexerProvider, m as SubscriptionResponse } from '../
|
|
2
|
-
export { n as ArkProvider, o as IndexerProvider } from '../
|
|
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/
|
|
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.
|
package/dist/adapters/expo.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { ExpoArkProvider, ExpoIndexerProvider } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
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
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
6
|
-
require('../chunk-
|
|
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 =
|
|
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-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
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 {
|
|
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 {
|
|
49
|
+
export { AsyncStorageTaskQueue as A, type AsyncStorageLike as a };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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 {
|
|
49
|
+
export { AsyncStorageTaskQueue as A, type AsyncStorageLike as a };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
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
|
|
1285
|
+
res = await chunkFNCQJLR2_cjs.rateGate.runHttp(input, () => chunkFNCQJLR2_cjs.baseFetch(input, init));
|
|
1286
1286
|
} catch (err) {
|
|
1287
|
-
const mapped =
|
|
1288
|
-
if (lastAttempt || !(mapped instanceof
|
|
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
|
-
|
|
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 =
|
|
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 =
|
|
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(
|
|
1471
|
-
spentVtxos: (data.event.spentVtxos || []).map(
|
|
1472
|
-
sweptVtxos: (data.event.sweptVtxos || []).map(
|
|
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 (
|
|
1492
|
+
if (chunkFNCQJLR2_cjs.isFetchTimeoutError(error)) {
|
|
1487
1493
|
console.debug("Timeout error ignored");
|
|
1488
1494
|
continue;
|
|
1489
1495
|
}
|
|
1490
|
-
if (
|
|
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(
|
|
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-
|
|
1801
|
-
//# sourceMappingURL=chunk-
|
|
1807
|
+
//# sourceMappingURL=chunk-2JHN5RCY.cjs.map
|
|
1808
|
+
//# sourceMappingURL=chunk-2JHN5RCY.cjs.map
|