@arkade-os/sdk 0.4.56 → 0.4.57
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 +5 -5
- package/dist/adapters/indexedDB.js +4 -4
- package/dist/{ark-Cgsd9tMd.d.cts → ark-CJgH_pmn.d.cts} +20 -1
- package/dist/{ark-Cgsd9tMd.d.ts → ark-CJgH_pmn.d.ts} +20 -1
- package/dist/{asyncStorageTaskQueue-CXz4PRBW.d.ts → asyncStorageTaskQueue-BeeZbf-Q.d.ts} +2 -2
- package/dist/{asyncStorageTaskQueue-C0ZsDE60.d.cts → asyncStorageTaskQueue-BlrsUUX_.d.cts} +2 -2
- package/dist/{chunk-IMVKQQHU.cjs → chunk-A7TOVUYG.cjs} +9 -9
- package/dist/{chunk-IMVKQQHU.cjs.map → chunk-A7TOVUYG.cjs.map} +1 -1
- package/dist/{chunk-NN7BNNF5.js → chunk-ASUJNZ63.js} +3 -3
- package/dist/{chunk-NN7BNNF5.js.map → chunk-ASUJNZ63.js.map} +1 -1
- package/dist/{chunk-5IMBONCK.js → chunk-C4SVRVNM.js} +4 -4
- package/dist/{chunk-5IMBONCK.js.map → chunk-C4SVRVNM.js.map} +1 -1
- package/dist/{chunk-VNDVUM2W.js → chunk-CPS7V4A3.js} +4 -4
- package/dist/{chunk-VNDVUM2W.js.map → chunk-CPS7V4A3.js.map} +1 -1
- package/dist/{chunk-MXPBHDOI.cjs → chunk-EZBKSWEL.cjs} +17 -17
- package/dist/{chunk-MXPBHDOI.cjs.map → chunk-EZBKSWEL.cjs.map} +1 -1
- package/dist/{chunk-ENRRZFZ4.cjs → chunk-KEG4AAKX.cjs} +511 -409
- package/dist/chunk-KEG4AAKX.cjs.map +1 -0
- package/dist/{chunk-CDWLZQQW.cjs → chunk-KUN5ZRMW.cjs} +4 -3
- package/dist/chunk-KUN5ZRMW.cjs.map +1 -0
- package/dist/{chunk-T22257HW.js → chunk-NIZPFPUM.js} +136 -44
- package/dist/chunk-NIZPFPUM.js.map +1 -0
- package/dist/{chunk-37XKN5DZ.cjs → chunk-OWTKOMJZ.cjs} +40 -40
- package/dist/{chunk-37XKN5DZ.cjs.map → chunk-OWTKOMJZ.cjs.map} +1 -1
- package/dist/{chunk-OOPDT2WV.js → chunk-P6L2W5IL.js} +3 -3
- package/dist/{chunk-OOPDT2WV.js.map → chunk-P6L2W5IL.js.map} +1 -1
- package/dist/{chunk-IFGN2GB2.js → chunk-PUNBWFIV.js} +4 -3
- package/dist/chunk-PUNBWFIV.js.map +1 -0
- package/dist/{chunk-24YNIQSW.cjs → chunk-YK6NP5KX.cjs} +15 -15
- package/dist/{chunk-24YNIQSW.cjs.map → chunk-YK6NP5KX.cjs.map} +1 -1
- package/dist/contracts/handlers/index.cjs +8 -8
- 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-CZPXtd2F.d.ts → delegate-DM3YECSY.d.ts} +1 -1
- package/dist/{delegate-xXT8O-Kn.d.cts → delegate-Dk-OJVdf.d.cts} +1 -1
- package/dist/{index-BYG2eKOA.d.cts → index-Cig0RkTf.d.cts} +2 -2
- package/dist/{index-BBJ466mM.d.ts → index-CnE7Gnvb.d.ts} +2 -2
- package/dist/index.cjs +253 -213
- package/dist/index.d.cts +12 -10
- package/dist/index.d.ts +12 -10
- package/dist/index.js +4 -4
- package/dist/repositories/realm/index.cjs +19 -19
- package/dist/repositories/realm/index.d.cts +2 -2
- package/dist/repositories/realm/index.d.ts +2 -2
- package/dist/repositories/realm/index.js +5 -5
- package/dist/repositories/sqlite/index.cjs +18 -18
- package/dist/repositories/sqlite/index.d.cts +2 -2
- package/dist/repositories/sqlite/index.d.ts +2 -2
- package/dist/repositories/sqlite/index.js +5 -5
- package/dist/{taskRunner-BG1PRFps.d.cts → taskRunner-CnGSTaAJ.d.cts} +2 -2
- package/dist/{taskRunner-C46NnRsY.d.ts → taskRunner-F7tWzsrC.d.ts} +2 -2
- 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.d.cts +4 -4
- package/dist/wallet/expo/index.d.ts +4 -4
- package/dist/wallet/expo/index.js +5 -5
- package/dist/{wallet-DuCm55EC.d.ts → wallet-D6_S0n6B.d.ts} +107 -4
- package/dist/{wallet-1yWg75gN.d.cts → wallet-DvRIQBBY.d.cts} +107 -4
- 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-CDWLZQQW.cjs.map +0 -1
- package/dist/chunk-ENRRZFZ4.cjs.map +0 -1
- package/dist/chunk-IFGN2GB2.js.map +0 -1
- package/dist/chunk-T22257HW.js.map +0 -1
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 chunkEZBKSWEL_cjs = require('../chunk-EZBKSWEL.cjs');
|
|
4
|
+
require('../chunk-YK6NP5KX.cjs');
|
|
5
|
+
require('../chunk-KUN5ZRMW.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 chunkEZBKSWEL_cjs.ExpoArkProvider; }
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "ExpoIndexerProvider", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkEZBKSWEL_cjs.ExpoIndexerProvider; }
|
|
17
17
|
});
|
|
18
18
|
//# sourceMappingURL=expo.cjs.map
|
|
19
19
|
//# sourceMappingURL=expo.cjs.map
|
package/dist/adapters/expo.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { k as RestArkProvider, i as SettlementEvent, T as TxNotification, l as RestIndexerProvider, m as SubscriptionResponse } from '../ark-
|
|
2
|
-
export { n as ArkProvider, o as IndexerProvider } from '../ark-
|
|
1
|
+
import { k as RestArkProvider, i as SettlementEvent, T as TxNotification, l as RestIndexerProvider, m as SubscriptionResponse } from '../ark-CJgH_pmn.cjs';
|
|
2
|
+
export { n as ArkProvider, o as IndexerProvider } from '../ark-CJgH_pmn.cjs';
|
|
3
3
|
import '@scure/btc-signer/transaction.js';
|
|
4
4
|
import '@scure/btc-signer/utils.js';
|
|
5
5
|
import '@scure/btc-signer/psbt.js';
|
package/dist/adapters/expo.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { k as RestArkProvider, i as SettlementEvent, T as TxNotification, l as RestIndexerProvider, m as SubscriptionResponse } from '../ark-
|
|
2
|
-
export { n as ArkProvider, o as IndexerProvider } from '../ark-
|
|
1
|
+
import { k as RestArkProvider, i as SettlementEvent, T as TxNotification, l as RestIndexerProvider, m as SubscriptionResponse } from '../ark-CJgH_pmn.js';
|
|
2
|
+
export { n as ArkProvider, o as IndexerProvider } from '../ark-CJgH_pmn.js';
|
|
3
3
|
import '@scure/btc-signer/transaction.js';
|
|
4
4
|
import '@scure/btc-signer/utils.js';
|
|
5
5
|
import '@scure/btc-signer/psbt.js';
|
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-CPS7V4A3.js';
|
|
2
|
+
import '../chunk-ASUJNZ63.js';
|
|
3
|
+
import '../chunk-PUNBWFIV.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 chunkKEG4AAKX_cjs = require('../chunk-KEG4AAKX.cjs');
|
|
4
|
+
require('../chunk-YK6NP5KX.cjs');
|
|
5
|
+
require('../chunk-OWTKOMJZ.cjs');
|
|
6
|
+
require('../chunk-KUN5ZRMW.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 = chunkKEG4AAKX_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-NIZPFPUM.js';
|
|
2
|
+
import '../chunk-ASUJNZ63.js';
|
|
3
|
+
import '../chunk-P6L2W5IL.js';
|
|
4
|
+
import '../chunk-PUNBWFIV.js';
|
|
5
5
|
import '../chunk-NSBPE2FW.js';
|
|
6
6
|
|
|
7
7
|
// src/storage/indexedDB.ts
|
|
@@ -3655,6 +3655,19 @@ interface BaseWalletConfig {
|
|
|
3655
3655
|
boardingTimelock?: RelativeTimelock;
|
|
3656
3656
|
/** Relative timelock applied to unilateral exit paths. */
|
|
3657
3657
|
exitTimelock?: RelativeTimelock;
|
|
3658
|
+
/**
|
|
3659
|
+
* Minimum accepted `BatchStartedEvent.batchExpiry`, as wall-clock seconds.
|
|
3660
|
+
* Defaults per network — see `defaultBatchExpiryPolicy`. Lowering it below
|
|
3661
|
+
* the default relaxes a fund-safety bound; intended for local testing.
|
|
3662
|
+
*/
|
|
3663
|
+
minBatchExpirySeconds?: bigint;
|
|
3664
|
+
/**
|
|
3665
|
+
* Minimum accepted checkpoint exit delay decoded from `ArkInfo.checkpointTapscript`,
|
|
3666
|
+
* as wall-clock seconds. Defaults per network — see
|
|
3667
|
+
* `defaultCheckpointExitDelayPolicy`. Lowering it below the default relaxes a
|
|
3668
|
+
* fund-safety bound; intended for local testing.
|
|
3669
|
+
*/
|
|
3670
|
+
minCheckpointExitDelaySeconds?: bigint;
|
|
3658
3671
|
/**
|
|
3659
3672
|
* Repository-backed storage configuration overrides.
|
|
3660
3673
|
* Defaults to IndexedDB if unset.
|
|
@@ -4924,6 +4937,12 @@ interface ArkInfo {
|
|
|
4924
4937
|
sessionDuration: bigint;
|
|
4925
4938
|
signerPubkey: string;
|
|
4926
4939
|
unilateralExitDelay: bigint;
|
|
4940
|
+
/**
|
|
4941
|
+
* Sweep delay the operator advertises for the shared batch output.
|
|
4942
|
+
* `undefined` when not advertised — never coerce to `0n`, which would
|
|
4943
|
+
* satisfy any floor comparison.
|
|
4944
|
+
*/
|
|
4945
|
+
vtxoTreeExpiry?: bigint;
|
|
4927
4946
|
/**
|
|
4928
4947
|
* Maximum boarding input amount.
|
|
4929
4948
|
*
|
|
@@ -5204,4 +5223,4 @@ declare namespace ProtoTypes {
|
|
|
5204
5223
|
export { };
|
|
5205
5224
|
}
|
|
5206
5225
|
|
|
5207
|
-
export { type
|
|
5226
|
+
export { type TreeSignatureEvent as $, type ArkTransaction as A, type VirtualTxRepository as B, type ContractRepository as C, type VirtualTx as D, type ExtendedCoin as E, type VtxoBranch as F, type GetVtxosFilter as G, ChainedTxType as H, type IWallet as I, type Network as J, CSVMultisigTapscript as K, type SignerSet as L, type BatchStartedEvent as M, type NormalizedExtendedVirtualCoin as N, type Outpoint as O, type TreeSigningStartedEvent as P, TxTree as Q, type Recipient as R, type SendBitcoinParams as S, type TxNotification as T, type TreeNoncesEvent as U, VtxoScript as V, type WalletRepository as W, type BatchFinalizationEvent as X, type BatchFinalizedEvent as Y, type BatchFailedEvent as Z, type TreeTxEvent as _, type Identity as a, type BatchSignableIdentity as a$, type DescriptorProvider as a0, type IReadonlyWallet as a1, type ReadonlyIdentity as a2, type OnchainProvider as a3, type DelegateProvider as a4, type ReadonlyWalletConfig as a5, type ExitCaptureMode as a6, type ExitDataSource as a7, type IReadonlyAssetManager as a8, type ContractSyncState as a9, type IssuanceParams as aA, type ReissuanceParams as aB, type BurnParams as aC, type RenewVtxosOptions as aD, type ContractWithVtxos as aE, type PathSelection as aF, type ContractEvent as aG, type AssetDetails as aH, type IssuanceResult as aI, type DelegateInfo as aJ, type MigrationGlobalSkipReason as aK, type MigrationLegSkipReason as aL, type SignerStatus as aM, type StorageConfig as aN, type IVtxoManager as aO, type ExplorerTransaction as aP, type EncodedVtxoScript as aQ, type Status as aR, type ChainTx as aS, type PathContext as aT, type ActivityIntent as aU, type ActivityResolver as aV, type ArkIntentState as aW, type ArkTapscript as aX, type AssetMetadata as aY, type BaseWalletConfig as aZ, type BatchInfo as a_, type NetworkName as aa, type ArkInfo as ab, ArkAddress as ac, type Coin as ad, ContractManager as ae, type ContractManagerConfig as af, type SettlementConfig as ag, VtxoManager as ah, type SignerSession as ai, type SignedIntent as aj, Intent as ak, type TimeHeight as al, type DescriptorSigningRequest as am, Transaction as an, type IntentFeeConfig as ao, type OffchainInput as ap, FeeAmount as aq, type OnchainInput as ar, type FeeOutput as as, type ContractWatcherConfig as at, type Asset as au, type FeeInfo as av, type CreateContractParams as aw, type GetContractsFilter as ax, type GetSpendablePathsOptions as ay, type GetAllSpendingPathsOptions as az, type WalletConfig as b, type VirtualStatus as b$, CLTVMultisigTapscript as b0, type CandidateDeps as b1, ChainTxType as b2, type CommitmentTx as b3, ConditionCSVMultisigTapscript as b4, ConditionMultisigTapscript as b5, type ContractBalance as b6, type ContractEventCallback as b7, type ContractHandler as b8, type ContractState as b9, type Nonces as bA, type Output as bB, type PageResponse as bC, type PaginationOptions as bD, PartialSig as bE, type ProviderClass as bF, RestDelegateProvider as bG, RestDelegatorProvider as bH, type ScanContractsOptions as bI, type ScanResult as bJ, type ScheduledSession as bK, SettlementEventType as bL, type SignRequest as bM, type SignerClassification as bN, type SubscriptionEvent as bO, type SubscriptionHeartbeat as bP, type TapLeaves as bQ, TapTreeCoder as bR, TapscriptType as bS, type TreeNonces as bT, type TreePartialSigs as bU, type Tx as bV, type TxHistoryRecord as bW, type TxKey as bX, type TxTag as bY, type TxTreeNode as bZ, TxType as b_, type ContractVtxo as ba, ContractWatcher as bb, DelegateManagerImpl as bc, type DelegateOptions as bd, DelegatorManagerImpl as be, type DelegatorProvider as bf, type DeprecatedSignerMigrationReport as bg, type DeprecatedSignerReport as bh, DigestMismatchError as bi, type Discoverable as bj, type DiscoveredContract as bk, type DiscoveryDeps as bl, ESPLORA_URL as bm, EsploraProvider as bn, type ExitChainResolver as bo, type ExtendedContractVtxo as bp, type GroupMembership as bq, type HandlerError as br, type IDelegatorManager as bs, INTENT_TERMINAL_STATES as bt, IndexerTxType as bu, type KnownMetadata as bv, type MigrateDeprecatedSignerOptions as bw, type MigrationLegReport as bx, type MigrationVtxoRef as by, MultisigTapscript as bz, type WalletBalance as c, type Vtxo as c0, type VtxoChain as c1, type VtxoType as c2, type WalletMode as c3, assetMintResolver as c4, boardingResolver as c5, canRecoverOnchain as c6, canSpendOffchain as c7, classifyAgainstSignerSet as c8, classifyContractSigner as c9, collabExitResolver as ca, createDefaultActivityRegistry as cb, createExitChainResolver as cc, decodeTapscript as cd, getNetwork as ce, getSequence as cf, hasCandidates as cg, hasTerminalSpend as ch, isBatchSignable as ci, isCooperativelyMigratable as cj, isDiscoverable as ck, isExpired as cl, isPastExpiry as cm, isRecoverable as cn, isSpendable as co, isSubdust as cp, isTerminalIntentState as cq, isVirtualCoin as cr, isVtxoExpiringSoon as cs, networks as ct, scriptFromTapLeafScript as cu, signerSetFromInfo as cv, toXOnlySignerHex as cw, type TapscriptDeriving as cx, ActivityRegistry as d, type Activity as e, type IContractManager as f, type IDelegateManager as g, type SettleParams as h, type SettlementEvent as i, type IAssetManager as j, RestArkProvider as k, RestIndexerProvider as l, type SubscriptionResponse as m, type ArkProvider as n, type IndexerProvider as o, type RelativeTimelock as p, type TapLeafScript as q, type VirtualCoin as r, type Contract as s, type ExtendedVirtualCoin as t, type VtxoRepositoryKey as u, type WalletState as v, type ContractFilter as w, type IntentRepository as x, type ArkIntent as y, type IntentFilter as z };
|
|
@@ -3655,6 +3655,19 @@ interface BaseWalletConfig {
|
|
|
3655
3655
|
boardingTimelock?: RelativeTimelock;
|
|
3656
3656
|
/** Relative timelock applied to unilateral exit paths. */
|
|
3657
3657
|
exitTimelock?: RelativeTimelock;
|
|
3658
|
+
/**
|
|
3659
|
+
* Minimum accepted `BatchStartedEvent.batchExpiry`, as wall-clock seconds.
|
|
3660
|
+
* Defaults per network — see `defaultBatchExpiryPolicy`. Lowering it below
|
|
3661
|
+
* the default relaxes a fund-safety bound; intended for local testing.
|
|
3662
|
+
*/
|
|
3663
|
+
minBatchExpirySeconds?: bigint;
|
|
3664
|
+
/**
|
|
3665
|
+
* Minimum accepted checkpoint exit delay decoded from `ArkInfo.checkpointTapscript`,
|
|
3666
|
+
* as wall-clock seconds. Defaults per network — see
|
|
3667
|
+
* `defaultCheckpointExitDelayPolicy`. Lowering it below the default relaxes a
|
|
3668
|
+
* fund-safety bound; intended for local testing.
|
|
3669
|
+
*/
|
|
3670
|
+
minCheckpointExitDelaySeconds?: bigint;
|
|
3658
3671
|
/**
|
|
3659
3672
|
* Repository-backed storage configuration overrides.
|
|
3660
3673
|
* Defaults to IndexedDB if unset.
|
|
@@ -4924,6 +4937,12 @@ interface ArkInfo {
|
|
|
4924
4937
|
sessionDuration: bigint;
|
|
4925
4938
|
signerPubkey: string;
|
|
4926
4939
|
unilateralExitDelay: bigint;
|
|
4940
|
+
/**
|
|
4941
|
+
* Sweep delay the operator advertises for the shared batch output.
|
|
4942
|
+
* `undefined` when not advertised — never coerce to `0n`, which would
|
|
4943
|
+
* satisfy any floor comparison.
|
|
4944
|
+
*/
|
|
4945
|
+
vtxoTreeExpiry?: bigint;
|
|
4927
4946
|
/**
|
|
4928
4947
|
* Maximum boarding input amount.
|
|
4929
4948
|
*
|
|
@@ -5204,4 +5223,4 @@ declare namespace ProtoTypes {
|
|
|
5204
5223
|
export { };
|
|
5205
5224
|
}
|
|
5206
5225
|
|
|
5207
|
-
export { type
|
|
5226
|
+
export { type TreeSignatureEvent as $, type ArkTransaction as A, type VirtualTxRepository as B, type ContractRepository as C, type VirtualTx as D, type ExtendedCoin as E, type VtxoBranch as F, type GetVtxosFilter as G, ChainedTxType as H, type IWallet as I, type Network as J, CSVMultisigTapscript as K, type SignerSet as L, type BatchStartedEvent as M, type NormalizedExtendedVirtualCoin as N, type Outpoint as O, type TreeSigningStartedEvent as P, TxTree as Q, type Recipient as R, type SendBitcoinParams as S, type TxNotification as T, type TreeNoncesEvent as U, VtxoScript as V, type WalletRepository as W, type BatchFinalizationEvent as X, type BatchFinalizedEvent as Y, type BatchFailedEvent as Z, type TreeTxEvent as _, type Identity as a, type BatchSignableIdentity as a$, type DescriptorProvider as a0, type IReadonlyWallet as a1, type ReadonlyIdentity as a2, type OnchainProvider as a3, type DelegateProvider as a4, type ReadonlyWalletConfig as a5, type ExitCaptureMode as a6, type ExitDataSource as a7, type IReadonlyAssetManager as a8, type ContractSyncState as a9, type IssuanceParams as aA, type ReissuanceParams as aB, type BurnParams as aC, type RenewVtxosOptions as aD, type ContractWithVtxos as aE, type PathSelection as aF, type ContractEvent as aG, type AssetDetails as aH, type IssuanceResult as aI, type DelegateInfo as aJ, type MigrationGlobalSkipReason as aK, type MigrationLegSkipReason as aL, type SignerStatus as aM, type StorageConfig as aN, type IVtxoManager as aO, type ExplorerTransaction as aP, type EncodedVtxoScript as aQ, type Status as aR, type ChainTx as aS, type PathContext as aT, type ActivityIntent as aU, type ActivityResolver as aV, type ArkIntentState as aW, type ArkTapscript as aX, type AssetMetadata as aY, type BaseWalletConfig as aZ, type BatchInfo as a_, type NetworkName as aa, type ArkInfo as ab, ArkAddress as ac, type Coin as ad, ContractManager as ae, type ContractManagerConfig as af, type SettlementConfig as ag, VtxoManager as ah, type SignerSession as ai, type SignedIntent as aj, Intent as ak, type TimeHeight as al, type DescriptorSigningRequest as am, Transaction as an, type IntentFeeConfig as ao, type OffchainInput as ap, FeeAmount as aq, type OnchainInput as ar, type FeeOutput as as, type ContractWatcherConfig as at, type Asset as au, type FeeInfo as av, type CreateContractParams as aw, type GetContractsFilter as ax, type GetSpendablePathsOptions as ay, type GetAllSpendingPathsOptions as az, type WalletConfig as b, type VirtualStatus as b$, CLTVMultisigTapscript as b0, type CandidateDeps as b1, ChainTxType as b2, type CommitmentTx as b3, ConditionCSVMultisigTapscript as b4, ConditionMultisigTapscript as b5, type ContractBalance as b6, type ContractEventCallback as b7, type ContractHandler as b8, type ContractState as b9, type Nonces as bA, type Output as bB, type PageResponse as bC, type PaginationOptions as bD, PartialSig as bE, type ProviderClass as bF, RestDelegateProvider as bG, RestDelegatorProvider as bH, type ScanContractsOptions as bI, type ScanResult as bJ, type ScheduledSession as bK, SettlementEventType as bL, type SignRequest as bM, type SignerClassification as bN, type SubscriptionEvent as bO, type SubscriptionHeartbeat as bP, type TapLeaves as bQ, TapTreeCoder as bR, TapscriptType as bS, type TreeNonces as bT, type TreePartialSigs as bU, type Tx as bV, type TxHistoryRecord as bW, type TxKey as bX, type TxTag as bY, type TxTreeNode as bZ, TxType as b_, type ContractVtxo as ba, ContractWatcher as bb, DelegateManagerImpl as bc, type DelegateOptions as bd, DelegatorManagerImpl as be, type DelegatorProvider as bf, type DeprecatedSignerMigrationReport as bg, type DeprecatedSignerReport as bh, DigestMismatchError as bi, type Discoverable as bj, type DiscoveredContract as bk, type DiscoveryDeps as bl, ESPLORA_URL as bm, EsploraProvider as bn, type ExitChainResolver as bo, type ExtendedContractVtxo as bp, type GroupMembership as bq, type HandlerError as br, type IDelegatorManager as bs, INTENT_TERMINAL_STATES as bt, IndexerTxType as bu, type KnownMetadata as bv, type MigrateDeprecatedSignerOptions as bw, type MigrationLegReport as bx, type MigrationVtxoRef as by, MultisigTapscript as bz, type WalletBalance as c, type Vtxo as c0, type VtxoChain as c1, type VtxoType as c2, type WalletMode as c3, assetMintResolver as c4, boardingResolver as c5, canRecoverOnchain as c6, canSpendOffchain as c7, classifyAgainstSignerSet as c8, classifyContractSigner as c9, collabExitResolver as ca, createDefaultActivityRegistry as cb, createExitChainResolver as cc, decodeTapscript as cd, getNetwork as ce, getSequence as cf, hasCandidates as cg, hasTerminalSpend as ch, isBatchSignable as ci, isCooperativelyMigratable as cj, isDiscoverable as ck, isExpired as cl, isPastExpiry as cm, isRecoverable as cn, isSpendable as co, isSubdust as cp, isTerminalIntentState as cq, isVirtualCoin as cr, isVtxoExpiringSoon as cs, networks as ct, scriptFromTapLeafScript as cu, signerSetFromInfo as cv, toXOnlySignerHex as cw, type TapscriptDeriving as cx, ActivityRegistry as d, type Activity as e, type IContractManager as f, type IDelegateManager as g, type SettleParams as h, type SettlementEvent as i, type IAssetManager as j, RestArkProvider as k, RestIndexerProvider as l, type SubscriptionResponse as m, type ArkProvider as n, type IndexerProvider as o, type RelativeTimelock as p, type TapLeafScript as q, type VirtualCoin as r, type Contract as s, type ExtendedVirtualCoin as t, type VtxoRepositoryKey as u, type WalletState as v, type ContractFilter as w, type IntentRepository as x, type ArkIntent as y, type IntentFilter as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as TaskQueue, b as TaskItem, d as TaskResult } from './taskRunner-F7tWzsrC.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 { type AsyncStorageLike as A, AsyncStorageTaskQueue as a };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as TaskQueue, b as TaskItem, d as TaskResult } from './taskRunner-CnGSTaAJ.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 { type AsyncStorageLike as A, AsyncStorageTaskQueue as a };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkKEG4AAKX_cjs = require('./chunk-KEG4AAKX.cjs');
|
|
4
|
+
var chunkKUN5ZRMW_cjs = require('./chunk-KUN5ZRMW.cjs');
|
|
5
5
|
|
|
6
6
|
// src/worker/expo/taskRunner.ts
|
|
7
7
|
async function runTasks(queue, processors, deps) {
|
|
@@ -33,7 +33,7 @@ async function runTasks(queue, processors, deps) {
|
|
|
33
33
|
}
|
|
34
34
|
const result = {
|
|
35
35
|
...partial,
|
|
36
|
-
id:
|
|
36
|
+
id: chunkKEG4AAKX_cjs.getRandomId(),
|
|
37
37
|
executedAt: Date.now()
|
|
38
38
|
};
|
|
39
39
|
await queue.pushResult(result);
|
|
@@ -45,7 +45,7 @@ async function runTasks(queue, processors, deps) {
|
|
|
45
45
|
function createTaskDependencies(options) {
|
|
46
46
|
return {
|
|
47
47
|
...options,
|
|
48
|
-
extendVtxo: (vtxo, contract) =>
|
|
48
|
+
extendVtxo: (vtxo, contract) => chunkKEG4AAKX_cjs.extendVirtualCoinForContract(vtxo, contract)
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -64,7 +64,7 @@ var contractPollProcessor = {
|
|
|
64
64
|
let hasMore = true;
|
|
65
65
|
const allVtxos = [];
|
|
66
66
|
while (hasMore) {
|
|
67
|
-
const { vtxos, page } = await
|
|
67
|
+
const { vtxos, page } = await chunkKUN5ZRMW_cjs.getNormalizedVtxos(indexerProvider, {
|
|
68
68
|
scripts: [contract.script],
|
|
69
69
|
pageIndex,
|
|
70
70
|
pageSize
|
|
@@ -75,12 +75,12 @@ var contractPollProcessor = {
|
|
|
75
75
|
hasMore = page ? vtxos.length === pageSize : false;
|
|
76
76
|
pageIndex++;
|
|
77
77
|
}
|
|
78
|
-
const filtered =
|
|
78
|
+
const filtered = chunkKEG4AAKX_cjs.warnAndFilterVtxosForScript(
|
|
79
79
|
allVtxos,
|
|
80
80
|
contract.script,
|
|
81
81
|
"contractPollProcessor"
|
|
82
82
|
);
|
|
83
|
-
await
|
|
83
|
+
await chunkKEG4AAKX_cjs.saveVtxosForContract(walletRepository, contract, filtered);
|
|
84
84
|
vtxosSaved += filtered.length;
|
|
85
85
|
contractsProcessed++;
|
|
86
86
|
}
|
|
@@ -97,5 +97,5 @@ exports.CONTRACT_POLL_TASK_TYPE = CONTRACT_POLL_TASK_TYPE;
|
|
|
97
97
|
exports.contractPollProcessor = contractPollProcessor;
|
|
98
98
|
exports.createTaskDependencies = createTaskDependencies;
|
|
99
99
|
exports.runTasks = runTasks;
|
|
100
|
-
//# sourceMappingURL=chunk-
|
|
101
|
-
//# sourceMappingURL=chunk-
|
|
100
|
+
//# sourceMappingURL=chunk-A7TOVUYG.cjs.map
|
|
101
|
+
//# sourceMappingURL=chunk-A7TOVUYG.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/worker/expo/taskRunner.ts","../src/worker/expo/processors/contractPollProcessor.ts"],"names":["getRandomId","extendVirtualCoinForContract","getNormalizedVtxos","warnAndFilterVtxosForScript","saveVtxosForContract"],"mappings":";;;;;;AAkDA,eAAsB,QAAA,CAClB,KAAA,EACA,UAAA,EACA,IAAA,EACqB;AACrB,EAAA,MAAM,KAAA,GAAQ,MAAM,KAAA,CAAM,QAAA,EAAS;AACnC,EAAA,MAAM,YAAA,GAAe,IAAI,GAAA,CAAI,UAAA,CAAW,GAAA,CAAI,CAAC,CAAA,KAAM,CAAC,CAAA,CAAE,QAAA,EAAU,CAAC,CAAC,CAAC,CAAA;AACnE,EAAA,MAAM,UAAwB,EAAC;AAE/B,EAAA,KAAA,MAAW,QAAQ,KAAA,EAAO;AACtB,IAAA,MAAM,SAAA,GAAY,YAAA,CAAa,GAAA,CAAI,IAAA,CAAK,IAAI,CAAA;AAE5C,IAAA,IAAI,OAAA;AAEJ,IAAA,IAAI,CAAC,SAAA,EAAW;AACZ,MAAA,OAAA,GAAU;AAAA,QACN,YAAY,IAAA,CAAK,EAAA;AAAA,QACjB,MAAM,IAAA,CAAK,IAAA;AAAA,QACX,MAAA,EAAQ;AAAA,OACZ;AAAA,IACJ,CAAA,MAAO;AACH,MAAA,IAAI;AACA,QAAA,OAAA,GAAU,MAAM,SAAA,CAAU,OAAA,CAAQ,IAAA,EAAM,IAAI,CAAA;AAAA,MAChD,SAAS,KAAA,EAAO;AACZ,QAAA,OAAA,GAAU;AAAA,UACN,YAAY,IAAA,CAAK,EAAA;AAAA,UACjB,MAAM,IAAA,CAAK,IAAA;AAAA,UACX,MAAA,EAAQ,QAAA;AAAA,UACR,IAAA,EAAM;AAAA,YACF,OAAO,KAAA,YAAiB,KAAA,GAAQ,KAAA,CAAM,OAAA,GAAU,OAAO,KAAK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AA,EAAS,CAAC,QAAA,CAAS,MAAM,CAAA;AAAA,UACzB,SAAA;AAAA,UACA;AAAA,SACH,CAAA;AAED,QAAA,KAAA,MAAW,QAAQ,KAAA,EAAO;AACtB,UAAA,QAAA,CAAS,IAAA,CAAK,UAAA,CAAW,IAAA,EAAM,QAAQ,CAAC,CAAA;AAAA,QAC5C;AAEA,QAAA,OAAA,GAAU,IAAA,GAAO,KAAA,CAAM,MAAA,KAAW,QAAA,GAAW,KAAA;AAC7C,QAAA,SAAA,EAAA;AAAA,MACJ;AAKA,MAAA,MAAM,QAAA,GAAWC,6CAAA;AAAA,QACb,QAAA;AAAA,QACA,QAAA,CAAS,MAAA;AAAA,QACT;AAAA,OACJ;AACA,MAAA,MAAMC,sCAAA,CAAqB,gBAAA,EAAkB,QAAA,EAAU,QAAQ,CAAA;AAC/D,MAAA,UAAA,IAAc,QAAA,CAAS,MAAA;AACvB,MAAA,kBAAA,EAAA;AAAA,IACJ;AAEA,IAAA,OAAO;AAAA,MACH,YAAY,IAAA,CAAK,EAAA;AAAA,MACjB,IAAA,EAAM,uBAAA;AAAA,MACN,MAAA,EAAQ,SAAA;AAAA,MACR,IAAA,EAAM,EAAE,kBAAA,EAAoB,UAAA;AAAW,KAC3C;AAAA,EACJ;AACJ","file":"chunk-IMVKQQHU.cjs","sourcesContent":["import type { TaskItem, TaskResult, TaskQueue } from \"./taskQueue\";\nimport type { WalletRepository } from \"../../repositories/walletRepository\";\nimport type { ContractRepository } from \"../../repositories/contractRepository\";\nimport type { IndexerProvider } from \"../../providers/indexer\";\nimport type { ArkProvider } from \"../../providers/ark\";\nimport type { ExtendedVirtualCoin, VirtualCoin } from \"../../wallet\";\nimport type { Contract } from \"../../contracts/types\";\nimport { getRandomId, extendVirtualCoinForContract } from \"../../wallet/utils\";\n\n/**\n * Shared dependencies injected into every processor at runtime.\n *\n * `extendVtxo` requires the owning contract — processors must resolve each\n * vtxo's `script` to a known contract (via the contract repository) before\n * calling this. The strict signature prevents the footgun where a missing\n * contract silently falls back to the wallet's default tapscript.\n */\nexport interface TaskDependencies {\n walletRepository: WalletRepository;\n contractRepository: ContractRepository;\n indexerProvider: IndexerProvider;\n arkProvider: ArkProvider;\n extendVtxo: (vtxo: VirtualCoin, contract: Contract) => ExtendedVirtualCoin;\n}\n\n/**\n * A stateless unit that handles one type of task item.\n *\n * Processors must not keep in-memory state across invocations —\n * all coordination lives in the @see TaskQueue and repositories.\n *\n * The `TDeps` parameter defaults to @see TaskDependencies but\n * can be overridden for domain-specific processors (e.g. swap processing).\n */\nexport interface TaskProcessor<TDeps = TaskDependencies> {\n readonly taskType: string;\n execute(item: TaskItem, deps: TDeps): Promise<Omit<TaskResult, \"id\" | \"executedAt\">>;\n}\n\n/**\n * Run all pending tasks from the queue through matching processors.\n *\n * For each task in the inbox:\n * 1. Find the processor whose `taskType` matches `task.type`.\n * 2. Execute it, producing a @see TaskResult.\n * 3. Push the result to the outbox and remove the task from the inbox.\n *\n * Tasks with no matching processor produce a `\"noop\"` result.\n * Processor errors produce a `\"failed\"` result with the error message.\n */\nexport async function runTasks<TDeps = TaskDependencies>(\n queue: TaskQueue,\n processors: TaskProcessor<TDeps>[],\n deps: TDeps,\n): Promise<TaskResult[]> {\n const tasks = await queue.getTasks();\n const processorMap = new Map(processors.map((p) => [p.taskType, p]));\n const results: TaskResult[] = [];\n\n for (const task of tasks) {\n const processor = processorMap.get(task.type);\n\n let partial: Omit<TaskResult, \"id\" | \"executedAt\">;\n\n if (!processor) {\n partial = {\n taskItemId: task.id,\n type: task.type,\n status: \"noop\",\n };\n } else {\n try {\n partial = await processor.execute(task, deps);\n } catch (error) {\n partial = {\n taskItemId: task.id,\n type: task.type,\n status: \"failed\",\n data: {\n error: error instanceof Error ? error.message : String(error),\n },\n };\n }\n }\n\n const result: TaskResult = {\n ...partial,\n id: getRandomId(),\n executedAt: Date.now(),\n };\n\n await queue.pushResult(result);\n await queue.removeTask(task.id);\n results.push(result);\n }\n\n return results;\n}\n\n/**\n * Options for @see createTaskDependencies.\n */\nexport interface CreateTaskDependenciesOptions {\n walletRepository: WalletRepository;\n contractRepository: ContractRepository;\n indexerProvider: IndexerProvider;\n arkProvider: ArkProvider;\n}\n\n/**\n * Build the @see TaskDependencies needed by task processors\n * (e.g. `src/worker/expo/processors/contractPollProcessor.ts`)\n *\n * This is the same construction that `defineExpoBackgroundTask` does\n * internally, extracted so that consumers with custom schedulers\n * (e.g. bare React Native with `react-native-background-fetch`)\n * can build deps without depending on Expo.\n */\nexport function createTaskDependencies(options: CreateTaskDependenciesOptions): TaskDependencies {\n return {\n ...options,\n extendVtxo: (vtxo: VirtualCoin, contract: Contract) =>\n extendVirtualCoinForContract(vtxo, contract),\n };\n}\n","import type { TaskItem, TaskResult } from \"../taskQueue\";\nimport type { TaskProcessor, TaskDependencies } from \"../taskRunner\";\nimport type { ExtendedVirtualCoin } from \"../../../wallet\";\nimport { getNormalizedVtxos } from \"../../../wallet/vtxo\";\nimport {\n warnAndFilterVtxosForScript,\n saveVtxosForContract,\n} from \"../../../contracts/vtxoOwnership\";\n\nexport const CONTRACT_POLL_TASK_TYPE = \"contract-poll\";\n\n/**\n * Polls the indexer for the latest VTXO state of every contract and\n * persists the results to the wallet repository.\n *\n * Replicates the polling subset of @see ContractManager.initialize:\n * 1. Load all contracts from the contract repository.\n * 2. Paginated fetch of every VTXO (including spent) from the indexer.\n * 3. Extend each VTXO with tapscript data.\n * 4. Save to the wallet repository.\n *\n * NOTE: the indexer query deliberately omits `spendableOnly`. Every\n * repository implements `saveVtxos` as an upsert with no batch delete,\n * so filtering to spendable-only would leave VTXOs that became spent\n * between polls marked as spendable forever. Fetching the full set lets\n * the upsert overwrite stale records with their latest state.\n */\nexport const contractPollProcessor: TaskProcessor = {\n taskType: CONTRACT_POLL_TASK_TYPE,\n\n async execute(\n item: TaskItem,\n deps: TaskDependencies,\n ): Promise<Omit<TaskResult, \"id\" | \"executedAt\">> {\n const { contractRepository, walletRepository, indexerProvider, extendVtxo } = deps;\n\n const contracts = await contractRepository.getContracts();\n let contractsProcessed = 0;\n let vtxosSaved = 0;\n\n for (const contract of contracts) {\n // Paginated fetch of spendable virtual outputs\n const pageSize = 100;\n let pageIndex = 0;\n let hasMore = true;\n const allVtxos: ExtendedVirtualCoin[] = [];\n\n while (hasMore) {\n const { vtxos, page } = await getNormalizedVtxos(indexerProvider, {\n scripts: [contract.script],\n pageIndex,\n pageSize,\n });\n\n for (const vtxo of vtxos) {\n allVtxos.push(extendVtxo(vtxo, contract));\n }\n\n hasMore = page ? vtxos.length === pageSize : false;\n pageIndex++;\n }\n\n // Skip wrong-script rows (legacy duplicates or indexer drift)\n // before persisting; the loop must keep going for the remaining\n // contracts even when one row is rejected.\n const filtered = warnAndFilterVtxosForScript(\n allVtxos,\n contract.script,\n \"contractPollProcessor\",\n );\n await saveVtxosForContract(walletRepository, contract, filtered);\n vtxosSaved += filtered.length;\n contractsProcessed++;\n }\n\n return {\n taskItemId: item.id,\n type: CONTRACT_POLL_TASK_TYPE,\n status: \"success\",\n data: { contractsProcessed, vtxosSaved },\n };\n },\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/worker/expo/taskRunner.ts","../src/worker/expo/processors/contractPollProcessor.ts"],"names":["getRandomId","extendVirtualCoinForContract","getNormalizedVtxos","warnAndFilterVtxosForScript","saveVtxosForContract"],"mappings":";;;;;;AAkDA,eAAsB,QAAA,CAClB,KAAA,EACA,UAAA,EACA,IAAA,EACqB;AACrB,EAAA,MAAM,KAAA,GAAQ,MAAM,KAAA,CAAM,QAAA,EAAS;AACnC,EAAA,MAAM,YAAA,GAAe,IAAI,GAAA,CAAI,UAAA,CAAW,GAAA,CAAI,CAAC,CAAA,KAAM,CAAC,CAAA,CAAE,QAAA,EAAU,CAAC,CAAC,CAAC,CAAA;AACnE,EAAA,MAAM,UAAwB,EAAC;AAE/B,EAAA,KAAA,MAAW,QAAQ,KAAA,EAAO;AACtB,IAAA,MAAM,SAAA,GAAY,YAAA,CAAa,GAAA,CAAI,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AK,EAAA;AAAA,MACjB,IAAA,EAAM,uBAAA;AAAA,MACN,MAAA,EAAQ,SAAA;AAAA,MACR,IAAA,EAAM,EAAE,kBAAA,EAAoB,UAAA;AAAW,KAC3C;AAAA,EACJ;AACJ","file":"chunk-A7TOVUYG.cjs","sourcesContent":["import type { TaskItem, TaskResult, TaskQueue } from \"./taskQueue\";\nimport type { WalletRepository } from \"../../repositories/walletRepository\";\nimport type { ContractRepository } from \"../../repositories/contractRepository\";\nimport type { IndexerProvider } from \"../../providers/indexer\";\nimport type { ArkProvider } from \"../../providers/ark\";\nimport type { ExtendedVirtualCoin, VirtualCoin } from \"../../wallet\";\nimport type { Contract } from \"../../contracts/types\";\nimport { getRandomId, extendVirtualCoinForContract } from \"../../wallet/utils\";\n\n/**\n * Shared dependencies injected into every processor at runtime.\n *\n * `extendVtxo` requires the owning contract — processors must resolve each\n * vtxo's `script` to a known contract (via the contract repository) before\n * calling this. The strict signature prevents the footgun where a missing\n * contract silently falls back to the wallet's default tapscript.\n */\nexport interface TaskDependencies {\n walletRepository: WalletRepository;\n contractRepository: ContractRepository;\n indexerProvider: IndexerProvider;\n arkProvider: ArkProvider;\n extendVtxo: (vtxo: VirtualCoin, contract: Contract) => ExtendedVirtualCoin;\n}\n\n/**\n * A stateless unit that handles one type of task item.\n *\n * Processors must not keep in-memory state across invocations —\n * all coordination lives in the @see TaskQueue and repositories.\n *\n * The `TDeps` parameter defaults to @see TaskDependencies but\n * can be overridden for domain-specific processors (e.g. swap processing).\n */\nexport interface TaskProcessor<TDeps = TaskDependencies> {\n readonly taskType: string;\n execute(item: TaskItem, deps: TDeps): Promise<Omit<TaskResult, \"id\" | \"executedAt\">>;\n}\n\n/**\n * Run all pending tasks from the queue through matching processors.\n *\n * For each task in the inbox:\n * 1. Find the processor whose `taskType` matches `task.type`.\n * 2. Execute it, producing a @see TaskResult.\n * 3. Push the result to the outbox and remove the task from the inbox.\n *\n * Tasks with no matching processor produce a `\"noop\"` result.\n * Processor errors produce a `\"failed\"` result with the error message.\n */\nexport async function runTasks<TDeps = TaskDependencies>(\n queue: TaskQueue,\n processors: TaskProcessor<TDeps>[],\n deps: TDeps,\n): Promise<TaskResult[]> {\n const tasks = await queue.getTasks();\n const processorMap = new Map(processors.map((p) => [p.taskType, p]));\n const results: TaskResult[] = [];\n\n for (const task of tasks) {\n const processor = processorMap.get(task.type);\n\n let partial: Omit<TaskResult, \"id\" | \"executedAt\">;\n\n if (!processor) {\n partial = {\n taskItemId: task.id,\n type: task.type,\n status: \"noop\",\n };\n } else {\n try {\n partial = await processor.execute(task, deps);\n } catch (error) {\n partial = {\n taskItemId: task.id,\n type: task.type,\n status: \"failed\",\n data: {\n error: error instanceof Error ? error.message : String(error),\n },\n };\n }\n }\n\n const result: TaskResult = {\n ...partial,\n id: getRandomId(),\n executedAt: Date.now(),\n };\n\n await queue.pushResult(result);\n await queue.removeTask(task.id);\n results.push(result);\n }\n\n return results;\n}\n\n/**\n * Options for @see createTaskDependencies.\n */\nexport interface CreateTaskDependenciesOptions {\n walletRepository: WalletRepository;\n contractRepository: ContractRepository;\n indexerProvider: IndexerProvider;\n arkProvider: ArkProvider;\n}\n\n/**\n * Build the @see TaskDependencies needed by task processors\n * (e.g. `src/worker/expo/processors/contractPollProcessor.ts`)\n *\n * This is the same construction that `defineExpoBackgroundTask` does\n * internally, extracted so that consumers with custom schedulers\n * (e.g. bare React Native with `react-native-background-fetch`)\n * can build deps without depending on Expo.\n */\nexport function createTaskDependencies(options: CreateTaskDependenciesOptions): TaskDependencies {\n return {\n ...options,\n extendVtxo: (vtxo: VirtualCoin, contract: Contract) =>\n extendVirtualCoinForContract(vtxo, contract),\n };\n}\n","import type { TaskItem, TaskResult } from \"../taskQueue\";\nimport type { TaskProcessor, TaskDependencies } from \"../taskRunner\";\nimport type { ExtendedVirtualCoin } from \"../../../wallet\";\nimport { getNormalizedVtxos } from \"../../../wallet/vtxo\";\nimport {\n warnAndFilterVtxosForScript,\n saveVtxosForContract,\n} from \"../../../contracts/vtxoOwnership\";\n\nexport const CONTRACT_POLL_TASK_TYPE = \"contract-poll\";\n\n/**\n * Polls the indexer for the latest VTXO state of every contract and\n * persists the results to the wallet repository.\n *\n * Replicates the polling subset of @see ContractManager.initialize:\n * 1. Load all contracts from the contract repository.\n * 2. Paginated fetch of every VTXO (including spent) from the indexer.\n * 3. Extend each VTXO with tapscript data.\n * 4. Save to the wallet repository.\n *\n * NOTE: the indexer query deliberately omits `spendableOnly`. Every\n * repository implements `saveVtxos` as an upsert with no batch delete,\n * so filtering to spendable-only would leave VTXOs that became spent\n * between polls marked as spendable forever. Fetching the full set lets\n * the upsert overwrite stale records with their latest state.\n */\nexport const contractPollProcessor: TaskProcessor = {\n taskType: CONTRACT_POLL_TASK_TYPE,\n\n async execute(\n item: TaskItem,\n deps: TaskDependencies,\n ): Promise<Omit<TaskResult, \"id\" | \"executedAt\">> {\n const { contractRepository, walletRepository, indexerProvider, extendVtxo } = deps;\n\n const contracts = await contractRepository.getContracts();\n let contractsProcessed = 0;\n let vtxosSaved = 0;\n\n for (const contract of contracts) {\n // Paginated fetch of spendable virtual outputs\n const pageSize = 100;\n let pageIndex = 0;\n let hasMore = true;\n const allVtxos: ExtendedVirtualCoin[] = [];\n\n while (hasMore) {\n const { vtxos, page } = await getNormalizedVtxos(indexerProvider, {\n scripts: [contract.script],\n pageIndex,\n pageSize,\n });\n\n for (const vtxo of vtxos) {\n allVtxos.push(extendVtxo(vtxo, contract));\n }\n\n hasMore = page ? vtxos.length === pageSize : false;\n pageIndex++;\n }\n\n // Skip wrong-script rows (legacy duplicates or indexer drift)\n // before persisting; the loop must keep going for the remaining\n // contracts even when one row is rejected.\n const filtered = warnAndFilterVtxosForScript(\n allVtxos,\n contract.script,\n \"contractPollProcessor\",\n );\n await saveVtxosForContract(walletRepository, contract, filtered);\n vtxosSaved += filtered.length;\n contractsProcessed++;\n }\n\n return {\n taskItemId: item.id,\n type: CONTRACT_POLL_TASK_TYPE,\n status: \"success\",\n data: { contractsProcessed, vtxosSaved },\n };\n },\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEFAULT_ARKADE_SERVER_URL, eventSourceIterator, convertVtxo, isFetchTimeoutError, isEventSourceError, rateGate, baseFetch, toProviderUnavailable, ProviderUnavailableError, throwIfHttpUnavailable } from './chunk-
|
|
1
|
+
import { DEFAULT_ARKADE_SERVER_URL, eventSourceIterator, convertVtxo, isFetchTimeoutError, isEventSourceError, rateGate, baseFetch, toProviderUnavailable, ProviderUnavailableError, throwIfHttpUnavailable } from './chunk-PUNBWFIV.js';
|
|
2
2
|
import { __export } from './chunk-NSBPE2FW.js';
|
|
3
3
|
import { hex } from '@scure/base';
|
|
4
4
|
import { schnorr } from '@noble/curves/secp256k1.js';
|
|
@@ -1783,5 +1783,5 @@ var Response;
|
|
|
1783
1783
|
})(Response || (Response = {}));
|
|
1784
1784
|
|
|
1785
1785
|
export { AssetGroup, AssetId, AssetInput, AssetOutput, AssetRef, BufferReader, BufferWriter, ChainTxType, IndexerTxType, Metadata, Packet, RestIndexerProvider, asset_exports };
|
|
1786
|
-
//# sourceMappingURL=chunk-
|
|
1787
|
-
//# sourceMappingURL=chunk-
|
|
1786
|
+
//# sourceMappingURL=chunk-ASUJNZ63.js.map
|
|
1787
|
+
//# sourceMappingURL=chunk-ASUJNZ63.js.map
|