@arkade-os/sdk 0.4.76 → 0.4.77
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/dist/adapters/expo.cjs +5 -5
- package/dist/adapters/expo.d.cts +2 -2
- package/dist/adapters/expo.d.ts +2 -2
- package/dist/adapters/expo.js +3 -3
- package/dist/adapters/indexedDB.cjs +3 -5
- package/dist/adapters/indexedDB.cjs.map +1 -1
- package/dist/adapters/indexedDB.d.cts +1 -1
- package/dist/adapters/indexedDB.d.ts +1 -1
- package/dist/adapters/indexedDB.js +3 -5
- package/dist/adapters/indexedDB.js.map +1 -1
- package/dist/{asyncStorageTaskQueue-DrKbfleJ.d.ts → asyncStorageTaskQueue-DTl0WM7E.d.ts} +1 -1
- package/dist/{asyncStorageTaskQueue-D7BU-BdP.d.cts → asyncStorageTaskQueue-MmJyAnu-.d.cts} +1 -1
- package/dist/{chunk-2KFXM3N5.cjs → chunk-4LP6XOMW.cjs} +17 -17
- package/dist/{chunk-2KFXM3N5.cjs.map → chunk-4LP6XOMW.cjs.map} +1 -1
- package/dist/{chunk-F6YOCYWU.js → chunk-52OA3UIC.js} +25 -12
- package/dist/chunk-52OA3UIC.js.map +1 -0
- package/dist/{chunk-7UJLIZQU.js → chunk-ACPANSOX.js} +43 -11
- package/dist/chunk-ACPANSOX.js.map +1 -0
- package/dist/{chunk-P53OHGXY.cjs → chunk-CJN4CUEU.cjs} +25 -11
- package/dist/chunk-CJN4CUEU.cjs.map +1 -0
- package/dist/{chunk-T327OEMV.cjs → chunk-H62OOAS4.cjs} +17 -17
- package/dist/{chunk-T327OEMV.cjs.map → chunk-H62OOAS4.cjs.map} +1 -1
- package/dist/{chunk-54W6QBXL.js → chunk-HKOFYHZP.js} +3 -3
- package/dist/{chunk-54W6QBXL.js.map → chunk-HKOFYHZP.js.map} +1 -1
- package/dist/{chunk-CQNX4BTA.cjs → chunk-LUWSY2QO.cjs} +89 -57
- package/dist/chunk-LUWSY2QO.cjs.map +1 -0
- package/dist/{chunk-WMHELOHH.js → chunk-MLOZHTBN.js} +523 -104
- package/dist/chunk-MLOZHTBN.js.map +1 -0
- package/dist/{chunk-O2BIWLZC.js → chunk-T6MGH4V4.js} +4 -4
- package/dist/{chunk-O2BIWLZC.js.map → chunk-T6MGH4V4.js.map} +1 -1
- package/dist/{chunk-LQM6RHNT.cjs → chunk-Y4YK44IM.cjs} +10 -10
- package/dist/{chunk-LQM6RHNT.cjs.map → chunk-Y4YK44IM.cjs.map} +1 -1
- package/dist/{chunk-LHSVPDFJ.cjs → chunk-YJEWWLOQ.cjs} +959 -541
- package/dist/chunk-YJEWWLOQ.cjs.map +1 -0
- package/dist/{chunk-MUBPGYUE.js → chunk-YKNTUOUG.js} +4 -4
- package/dist/{chunk-MUBPGYUE.js.map → chunk-YKNTUOUG.js.map} +1 -1
- package/dist/contracts/handlers/index.cjs +9 -9
- package/dist/contracts/handlers/index.d.cts +3 -3
- package/dist/contracts/handlers/index.d.ts +3 -3
- package/dist/contracts/handlers/index.js +2 -2
- package/dist/{delegate-BAYpqkEx.d.ts → delegate-CjcysR7s.d.ts} +1 -1
- package/dist/{delegate-CR7msIXK.d.cts → delegate-QPCGaD_z.d.cts} +1 -1
- package/dist/{hdWalletCapable-BSF29IjK.d.ts → hdWalletCapable--pMncWbC.d.ts} +6 -4
- package/dist/{hdWalletCapable-BbZxCUeZ.d.cts → hdWalletCapable-Bp_p0WLj.d.cts} +6 -4
- package/dist/{index-4NF3srcg.d.cts → index-BMY272ns.d.cts} +26 -8
- package/dist/{index-B_RYn9rg.d.cts → index-Ie_ak2zY.d.cts} +35 -9
- package/dist/{index-B_RYn9rg.d.ts → index-Ie_ak2zY.d.ts} +35 -9
- package/dist/{index-Dj2yOhQ2.d.ts → index-m-EM-e8D.d.ts} +26 -8
- package/dist/index.cjs +307 -303
- package/dist/index.d.cts +75 -13
- package/dist/index.d.ts +75 -13
- package/dist/index.js +4 -4
- package/dist/repositories/realm/index.cjs +36 -19
- package/dist/repositories/realm/index.cjs.map +1 -1
- package/dist/repositories/realm/index.d.cts +6 -3
- package/dist/repositories/realm/index.d.ts +6 -3
- package/dist/repositories/realm/index.js +22 -5
- package/dist/repositories/realm/index.js.map +1 -1
- package/dist/repositories/sqlite/index.cjs +42 -18
- package/dist/repositories/sqlite/index.cjs.map +1 -1
- package/dist/repositories/sqlite/index.d.cts +5 -2
- package/dist/repositories/sqlite/index.d.ts +5 -2
- package/dist/repositories/sqlite/index.js +29 -5
- package/dist/repositories/sqlite/index.js.map +1 -1
- package/dist/{taskRunner-DGxde-YU.d.cts → taskRunner-BgRowCqB.d.cts} +1 -1
- package/dist/{taskRunner-TzGUhxP-.d.ts → taskRunner-CqrlrJEt.d.ts} +1 -1
- package/dist/wallet/expo/background.cjs +14 -14
- package/dist/wallet/expo/background.d.cts +3 -3
- package/dist/wallet/expo/background.d.ts +3 -3
- package/dist/wallet/expo/background.js +6 -6
- package/dist/wallet/expo/index.cjs +14 -14
- package/dist/wallet/expo/index.cjs.map +1 -1
- package/dist/wallet/expo/index.d.cts +5 -5
- package/dist/wallet/expo/index.d.ts +5 -5
- package/dist/wallet/expo/index.js +5 -5
- package/dist/wallet/expo/index.js.map +1 -1
- package/dist/worker/expo/index.cjs +9 -9
- package/dist/worker/expo/index.d.cts +4 -4
- package/dist/worker/expo/index.d.ts +4 -4
- package/dist/worker/expo/index.js +5 -5
- package/package.json +1 -1
- package/dist/chunk-7UJLIZQU.js.map +0 -1
- package/dist/chunk-CQNX4BTA.cjs.map +0 -1
- package/dist/chunk-F6YOCYWU.js.map +0 -1
- package/dist/chunk-LHSVPDFJ.cjs.map +0 -1
- package/dist/chunk-P53OHGXY.cjs.map +0 -1
- package/dist/chunk-WMHELOHH.js.map +0 -1
|
@@ -1044,7 +1044,7 @@ function resolveEventSource(override) {
|
|
|
1044
1044
|
}
|
|
1045
1045
|
|
|
1046
1046
|
// package.json
|
|
1047
|
-
var version = "0.4.
|
|
1047
|
+
var version = "0.4.77";
|
|
1048
1048
|
|
|
1049
1049
|
// src/utils/fetch.ts
|
|
1050
1050
|
var buildVersion = "0.9.9";
|
|
@@ -2388,11 +2388,16 @@ async function getNormalizedVtxos(provider, opts) {
|
|
|
2388
2388
|
const { vtxos, page } = await provider.getVtxos(opts);
|
|
2389
2389
|
return { vtxos: vtxos.map(normalizeVtxo), page };
|
|
2390
2390
|
}
|
|
2391
|
+
var SCRIPT_CHUNK_CONCURRENCY = 4;
|
|
2391
2392
|
async function getAllNormalizedVtxos(provider, scripts, opts = {}) {
|
|
2392
2393
|
const { pageSize = DEFAULT_PAGE_SIZE, ...filters } = opts;
|
|
2393
2394
|
const all = [];
|
|
2395
|
+
const chunks = [];
|
|
2394
2396
|
for (let i = 0; i < scripts.length; i += SCRIPT_QUERY_CHUNK_SIZE) {
|
|
2395
|
-
|
|
2397
|
+
chunks.push(scripts.slice(i, i + SCRIPT_QUERY_CHUNK_SIZE));
|
|
2398
|
+
}
|
|
2399
|
+
const fetchChunk = async (chunk) => {
|
|
2400
|
+
const result = [];
|
|
2396
2401
|
let pageIndex = 0;
|
|
2397
2402
|
let hasMore = true;
|
|
2398
2403
|
while (hasMore) {
|
|
@@ -2402,11 +2407,18 @@ async function getAllNormalizedVtxos(provider, scripts, opts = {}) {
|
|
|
2402
2407
|
pageIndex,
|
|
2403
2408
|
pageSize
|
|
2404
2409
|
});
|
|
2405
|
-
|
|
2410
|
+
result.push(...vtxos);
|
|
2406
2411
|
hasMore = page ? vtxos.length === pageSize : false;
|
|
2407
2412
|
pageIndex++;
|
|
2408
2413
|
if (hasMore) await new Promise((r) => setTimeout(r, 500));
|
|
2409
2414
|
}
|
|
2415
|
+
return result;
|
|
2416
|
+
};
|
|
2417
|
+
for (let i = 0; i < chunks.length; i += SCRIPT_CHUNK_CONCURRENCY) {
|
|
2418
|
+
const batch = await Promise.all(
|
|
2419
|
+
chunks.slice(i, i + SCRIPT_CHUNK_CONCURRENCY).map(fetchChunk)
|
|
2420
|
+
);
|
|
2421
|
+
for (const result of batch) all.push(...result);
|
|
2410
2422
|
}
|
|
2411
2423
|
return all;
|
|
2412
2424
|
}
|
|
@@ -2429,10 +2441,11 @@ async function fetchVtxoCreatedAtByTxid(provider, txids) {
|
|
|
2429
2441
|
}
|
|
2430
2442
|
return createdAt;
|
|
2431
2443
|
}
|
|
2432
|
-
function
|
|
2444
|
+
function isVtxoSpent(vtxo) {
|
|
2433
2445
|
const n = normalizeVtxo(vtxo);
|
|
2434
2446
|
return !!n.isSpent || !!n.spentBy || !!n.settledBy;
|
|
2435
2447
|
}
|
|
2448
|
+
var hasTerminalSpend = isVtxoSpent;
|
|
2436
2449
|
function isPastExpiry(vtxo, now) {
|
|
2437
2450
|
const n = normalizeVtxo(vtxo);
|
|
2438
2451
|
if (n.expiresAt !== void 0 && now.timestamp.getTime() >= n.expiresAt.getTime()) return true;
|
|
@@ -2440,15 +2453,15 @@ function isPastExpiry(vtxo, now) {
|
|
|
2440
2453
|
}
|
|
2441
2454
|
function canSpendOffchain(vtxo, now) {
|
|
2442
2455
|
const n = normalizeVtxo(vtxo);
|
|
2443
|
-
return !
|
|
2456
|
+
return !isVtxoSpent(n) && !n.isUnrolled && !(n.isSwept || isPastExpiry(n, now));
|
|
2444
2457
|
}
|
|
2445
2458
|
function canRecoverOnchain(vtxo, now) {
|
|
2446
2459
|
const n = normalizeVtxo(vtxo);
|
|
2447
|
-
return !
|
|
2460
|
+
return !isVtxoSpent(n) && !n.isUnrolled && (n.isSwept || isPastExpiry(n, now));
|
|
2448
2461
|
}
|
|
2449
2462
|
function canSweepOnchain(vtxo) {
|
|
2450
2463
|
const n = normalizeVtxo(vtxo);
|
|
2451
|
-
return !
|
|
2464
|
+
return !isVtxoSpent(n) && !!n.isUnrolled;
|
|
2452
2465
|
}
|
|
2453
2466
|
function toOffchainInputFeeParams(vtxo) {
|
|
2454
2467
|
const batchExpiry = toBatchExpiry(vtxo);
|
|
@@ -2464,11 +2477,11 @@ function isVirtualCoin(input) {
|
|
|
2464
2477
|
return typeof input === "object" && input !== null && typeof input.script === "string";
|
|
2465
2478
|
}
|
|
2466
2479
|
function isSpendable(vtxo) {
|
|
2467
|
-
return !
|
|
2480
|
+
return !isVtxoSpent(vtxo);
|
|
2468
2481
|
}
|
|
2469
2482
|
function isRecoverable(vtxo) {
|
|
2470
2483
|
const n = normalizeVtxo(vtxo);
|
|
2471
|
-
return n.isSwept && !
|
|
2484
|
+
return n.isSwept && !isVtxoSpent(n);
|
|
2472
2485
|
}
|
|
2473
2486
|
function isExpired(vtxo) {
|
|
2474
2487
|
const n = normalizeVtxo(vtxo);
|
|
@@ -2539,6 +2552,7 @@ exports.isRecoverable = isRecoverable;
|
|
|
2539
2552
|
exports.isRetryableProviderError = isRetryableProviderError;
|
|
2540
2553
|
exports.isSpendable = isSpendable;
|
|
2541
2554
|
exports.isVirtualCoin = isVirtualCoin;
|
|
2555
|
+
exports.isVtxoSpent = isVtxoSpent;
|
|
2542
2556
|
exports.maybeArkError = maybeArkError;
|
|
2543
2557
|
exports.networks = networks;
|
|
2544
2558
|
exports.normalizeVtxo = normalizeVtxo;
|
|
@@ -2557,5 +2571,5 @@ exports.toBatchExpiry = toBatchExpiry;
|
|
|
2557
2571
|
exports.toOffchainInputFeeParams = toOffchainInputFeeParams;
|
|
2558
2572
|
exports.toProviderUnavailable = toProviderUnavailable;
|
|
2559
2573
|
exports.toVirtualStatus = toVirtualStatus;
|
|
2560
|
-
//# sourceMappingURL=chunk-
|
|
2561
|
-
//# sourceMappingURL=chunk-
|
|
2574
|
+
//# sourceMappingURL=chunk-CJN4CUEU.cjs.map
|
|
2575
|
+
//# sourceMappingURL=chunk-CJN4CUEU.cjs.map
|