@arkade-os/sdk 0.4.43 → 0.4.45
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 +100 -0
- package/dist/adapters/expo.cjs +4 -4
- package/dist/adapters/expo.d.cts +2 -2
- package/dist/adapters/expo.d.ts +2 -2
- package/dist/adapters/expo.js +2 -2
- package/dist/adapters/indexedDB.cjs +3 -3
- package/dist/adapters/indexedDB.js +2 -2
- package/dist/{ark-I8jfe5VE.d.cts → ark-C-PjOngm.d.cts} +89 -1
- package/dist/{ark-I8jfe5VE.d.ts → ark-C-PjOngm.d.ts} +89 -1
- package/dist/{asyncStorageTaskQueue-D1FfHfgK.d.cts → asyncStorageTaskQueue-BmBPvTyh.d.cts} +1 -1
- package/dist/{asyncStorageTaskQueue-CjoL-35w.d.ts → asyncStorageTaskQueue-CHpI3moJ.d.ts} +1 -1
- package/dist/{chunk-VKKLOT2E.js → chunk-BOA4SHCD.js} +3 -3
- package/dist/{chunk-VKKLOT2E.js.map → chunk-BOA4SHCD.js.map} +1 -1
- package/dist/{chunk-PLJZRIFZ.cjs → chunk-HZ7VIN7P.cjs} +11 -11
- package/dist/{chunk-PLJZRIFZ.cjs.map → chunk-HZ7VIN7P.cjs.map} +1 -1
- package/dist/{chunk-JIWCE2IK.cjs → chunk-OFQGANH2.cjs} +7 -7
- package/dist/{chunk-JIWCE2IK.cjs.map → chunk-OFQGANH2.cjs.map} +1 -1
- package/dist/{chunk-US274KZO.js → chunk-QZ6HZZZK.js} +3 -3
- package/dist/{chunk-US274KZO.js.map → chunk-QZ6HZZZK.js.map} +1 -1
- package/dist/{chunk-QGNTDGMN.cjs → chunk-SRCWBFSZ.cjs} +1945 -357
- package/dist/chunk-SRCWBFSZ.cjs.map +1 -0
- package/dist/{chunk-B4R36PRN.js → chunk-TGRJ5WAX.js} +1868 -285
- package/dist/chunk-TGRJ5WAX.js.map +1 -0
- package/dist/{chunk-3AQNLQPM.cjs → chunk-UHOHLN3C.cjs} +119 -69
- package/dist/chunk-UHOHLN3C.cjs.map +1 -0
- package/dist/{chunk-763XHDAJ.js → chunk-YBQV7XBC.js} +119 -70
- package/dist/chunk-YBQV7XBC.js.map +1 -0
- package/dist/contracts/handlers/index.d.cts +3 -3
- package/dist/contracts/handlers/index.d.ts +3 -3
- package/dist/{delegate-CgjVjYOP.d.ts → delegate-BKNqva1j.d.ts} +1 -1
- package/dist/{delegate-BRqbh2fW.d.cts → delegate-DOEobYwH.d.cts} +1 -1
- package/dist/{index-DHuXlDEg.d.cts → index-BlW4I30l.d.cts} +2 -2
- package/dist/{index-DvWNB_rl.d.ts → index-Cm2fGeox.d.ts} +2 -2
- package/dist/index.cjs +150 -126
- package/dist/index.d.cts +275 -19
- package/dist/index.d.ts +275 -19
- package/dist/index.js +2 -2
- package/dist/repositories/realm/index.cjs +17 -17
- package/dist/repositories/realm/index.d.cts +2 -2
- package/dist/repositories/realm/index.d.ts +2 -2
- package/dist/repositories/realm/index.js +3 -3
- package/dist/repositories/sqlite/index.cjs +16 -16
- package/dist/repositories/sqlite/index.d.cts +2 -2
- package/dist/repositories/sqlite/index.d.ts +2 -2
- package/dist/repositories/sqlite/index.js +3 -3
- package/dist/{taskRunner-Djlhfgi1.d.ts → taskRunner-BngWSFMi.d.ts} +1 -1
- package/dist/{taskRunner-BSnslNmq.d.cts → taskRunner-DOiyRuJa.d.cts} +1 -1
- package/dist/wallet/expo/background.cjs +12 -12
- package/dist/wallet/expo/background.d.cts +3 -3
- package/dist/wallet/expo/background.d.ts +3 -3
- package/dist/wallet/expo/background.js +4 -4
- package/dist/wallet/expo/index.cjs +21 -12
- package/dist/wallet/expo/index.cjs.map +1 -1
- package/dist/wallet/expo/index.d.cts +11 -4
- package/dist/wallet/expo/index.d.ts +11 -4
- package/dist/wallet/expo/index.js +12 -3
- package/dist/wallet/expo/index.js.map +1 -1
- package/dist/{wallet-BsqRU8KM.d.cts → wallet-B3awP1Nj.d.ts} +105 -3
- package/dist/{wallet-D9z7wssl.d.ts → wallet-DBjumS42.d.cts} +105 -3
- package/dist/worker/expo/index.cjs +7 -7
- package/dist/worker/expo/index.d.cts +4 -4
- package/dist/worker/expo/index.d.ts +4 -4
- package/dist/worker/expo/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-3AQNLQPM.cjs.map +0 -1
- package/dist/chunk-763XHDAJ.js.map +0 -1
- package/dist/chunk-B4R36PRN.js.map +0 -1
- package/dist/chunk-QGNTDGMN.cjs.map +0 -1
|
@@ -1,8 +1,48 @@
|
|
|
1
1
|
import { Transaction } from '@scure/btc-signer';
|
|
2
2
|
import { Bytes } from '@scure/btc-signer/utils.js';
|
|
3
|
-
import { B as BatchStartedEvent, u as TreeSigningStartedEvent, v as TxTree, w as TreeNoncesEvent, x as BatchFinalizationEvent, y as BatchFinalizedEvent, z as BatchFailedEvent, D as TreeTxEvent, F as TreeSignatureEvent, j as SettlementEvent, b as WalletConfig, W as WalletRepository, C as ContractRepository, H as DescriptorProvider, g as IContractManager, J as IReadonlyWallet, K as ReadonlyIdentity, N as Network, O as OnchainProvider, p as IndexerProvider, L as DelegateProvider, M as ReadonlyWalletConfig, P as IntentRepository, Q as VirtualTxRepository, q as RelativeTimelock, e as ActivityRegistry,
|
|
3
|
+
import { B as BatchStartedEvent, u as TreeSigningStartedEvent, v as TxTree, w as TreeNoncesEvent, x as BatchFinalizationEvent, y as BatchFinalizedEvent, z as BatchFailedEvent, D as TreeTxEvent, F as TreeSignatureEvent, j as SettlementEvent, b as WalletConfig, W as WalletRepository, C as ContractRepository, H as DescriptorProvider, g as IContractManager, J as IReadonlyWallet, K as ReadonlyIdentity, N as Network, O as OnchainProvider, p as IndexerProvider, L as DelegateProvider, M as ReadonlyWalletConfig, P as IntentRepository, Q as VirtualTxRepository, U as ExitCaptureMode, X as ExitDataSource, q as RelativeTimelock, e as ActivityRegistry, Y as IReadonlyAssetManager, Z as ContractSyncState, o as ArkProvider, _ as NetworkName, $ as ArkInfo, a0 as ArkAddress, c as WalletBalance, G as GetVtxosFilter, E as ExtendedVirtualCoin, A as ArkTransaction, f as Activity, d as ExtendedCoin, a1 as Coin, a2 as ContractManager, I as IWallet, a as Identity, a3 as CSVMultisigTapscript, a4 as SettlementConfig, k as IAssetManager, a5 as VtxoManager, h as IDelegateManager, S as SendBitcoinParams, i as SettleParams, R as Recipient, a6 as SignerSession, a7 as SignedIntent, a8 as Intent } from './ark-C-PjOngm.js';
|
|
4
4
|
import { TransactionOutput } from '@scure/btc-signer/psbt.js';
|
|
5
|
-
import { D as DefaultVtxo, a as DelegateVtxo } from './delegate-
|
|
5
|
+
import { D as DefaultVtxo, a as DelegateVtxo } from './delegate-BKNqva1j.js';
|
|
6
|
+
|
|
7
|
+
declare class ArkError extends Error {
|
|
8
|
+
readonly code: number;
|
|
9
|
+
readonly message: string;
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly metadata?: Record<string, string> | undefined;
|
|
12
|
+
constructor(code: number, message: string, name: string, metadata?: Record<string, string> | undefined);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Which remote dependency an availability failure refers to. Used to label the
|
|
16
|
+
* {@link ProviderUnavailableError} message and the wallet's
|
|
17
|
+
* `ProviderConnectionState`; it is deliberately *not* carried as a structured
|
|
18
|
+
* field on the error, since custom `Error` own-properties do not survive the
|
|
19
|
+
* service-worker `postMessage` boundary (only `name`/`message`/`cause` do).
|
|
20
|
+
*/
|
|
21
|
+
type ProviderKind = "arkade" | "indexer";
|
|
22
|
+
/**
|
|
23
|
+
* A remote provider (Arkade operator or its indexer) is temporarily
|
|
24
|
+
* unreachable. This is a *retryable* condition — transport failure, request
|
|
25
|
+
* timeout, or a 5xx/429-style temporary HTTP response — as opposed to a
|
|
26
|
+
* terminal configuration/authorization/schema error, which stays a plain
|
|
27
|
+
* `Error`/{@link ArkError}. The original low-level error is preserved as
|
|
28
|
+
* {@link Error.cause}.
|
|
29
|
+
*/
|
|
30
|
+
declare class ProviderUnavailableError extends Error {
|
|
31
|
+
/** Always `true`: this error type only ever wraps retryable conditions. */
|
|
32
|
+
readonly retryable = true;
|
|
33
|
+
constructor(message: string, options?: {
|
|
34
|
+
cause?: unknown;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Try to convert an error to an ArkError class, returning undefined if the error is not an ArkError
|
|
39
|
+
* @param error - The error to parse
|
|
40
|
+
* @returns The parsed ArkError, or undefined if the error is not an ArkError
|
|
41
|
+
*/
|
|
42
|
+
declare function maybeArkError(error: any): ArkError | undefined;
|
|
43
|
+
|
|
44
|
+
/** Where the {@link ArkInfo} used to construct a wallet came from. */
|
|
45
|
+
type ServerInfoSource = "live" | "cache";
|
|
6
46
|
|
|
7
47
|
/**
|
|
8
48
|
* Batch namespace provides utilities for joining and processing batch session.
|
|
@@ -412,6 +452,23 @@ interface BoardingUtxoGroup {
|
|
|
412
452
|
csvTimelock: RelativeTimelock;
|
|
413
453
|
coins: ExtendedCoin[];
|
|
414
454
|
}
|
|
455
|
+
/**
|
|
456
|
+
* Freshness of the wallet's provider-backed sync, composed from the boot
|
|
457
|
+
* server-info source and the contract-manager's indexer-sync health. It
|
|
458
|
+
* describes only how fresh provider data is — never the wallet balances/VTXOs
|
|
459
|
+
* themselves, which are always served from the repository (system of record).
|
|
460
|
+
*/
|
|
461
|
+
type ProviderConnectionState = {
|
|
462
|
+
mode: "online";
|
|
463
|
+
source: "live";
|
|
464
|
+
lastOnlineAt: number;
|
|
465
|
+
} | {
|
|
466
|
+
mode: "degraded";
|
|
467
|
+
source: "cache" | "repository";
|
|
468
|
+
provider: ProviderKind;
|
|
469
|
+
reason: string;
|
|
470
|
+
lastOnlineAt?: number;
|
|
471
|
+
};
|
|
415
472
|
declare class ReadonlyWallet implements IReadonlyWallet {
|
|
416
473
|
readonly identity: ReadonlyIdentity;
|
|
417
474
|
readonly network: Network;
|
|
@@ -438,6 +495,12 @@ declare class ReadonlyWallet implements IReadonlyWallet {
|
|
|
438
495
|
* (ContractManager isn't given it); `undefined` ⇒ no-op.
|
|
439
496
|
*/
|
|
440
497
|
virtualTxRepository?: VirtualTxRepository;
|
|
498
|
+
/** Opt-in exit-data capture settings; see {@link StorageConfig.exitDataCapture}. */
|
|
499
|
+
exitDataCapture?: {
|
|
500
|
+
mode?: ExitCaptureMode;
|
|
501
|
+
minExitWorthSats?: number;
|
|
502
|
+
sources?: ExitDataSource[];
|
|
503
|
+
};
|
|
441
504
|
private readonly _assetManager;
|
|
442
505
|
readonly walletContractTimelocks: RelativeTimelock[];
|
|
443
506
|
protected _pendingSpendOutpoints: Set<string>;
|
|
@@ -473,6 +536,43 @@ declare class ReadonlyWallet implements IReadonlyWallet {
|
|
|
473
536
|
* construction-time snapshot for their lifetime.
|
|
474
537
|
*/
|
|
475
538
|
protected _arkServerPublicKey: Bytes;
|
|
539
|
+
/**
|
|
540
|
+
* Whether this wallet was constructed from live operator server-info
|
|
541
|
+
* (`"live"`) or from a cached snapshot because the operator was unreachable
|
|
542
|
+
* (`"cache"`). Freshness signal for {@link getProviderConnectionState}.
|
|
543
|
+
*/
|
|
544
|
+
protected _serverInfoSource: ServerInfoSource;
|
|
545
|
+
/**
|
|
546
|
+
* Epoch-ms of the last known live operator contact: construction time on the
|
|
547
|
+
* `live` boot path, the cached snapshot's `savedAt` on the `cache` path.
|
|
548
|
+
*/
|
|
549
|
+
protected _serverInfoLastOnlineAt?: number;
|
|
550
|
+
/** @see {@link _serverInfoSource} */
|
|
551
|
+
get serverInfoSource(): ServerInfoSource;
|
|
552
|
+
/**
|
|
553
|
+
* Composed provider-connection freshness: the boot server-info source
|
|
554
|
+
* (Arkade) combined with the contract-manager's indexer-sync health, if the
|
|
555
|
+
* manager has been initialized. Reads no live provider state — it never
|
|
556
|
+
* forces a `ContractManager` to construct — so it is safe for readonly
|
|
557
|
+
* callers that only use address/balance APIs.
|
|
558
|
+
*
|
|
559
|
+
* - Boot fell back to a cached snapshot → degraded on `arkade` (`cache`).
|
|
560
|
+
* - Otherwise, if the contract manager has degraded to repository data →
|
|
561
|
+
* degraded on `indexer` (`repository`).
|
|
562
|
+
* - Otherwise online.
|
|
563
|
+
*
|
|
564
|
+
* This only describes sync freshness; wallet balances/VTXOs are always read
|
|
565
|
+
* from the repository regardless of this state.
|
|
566
|
+
*/
|
|
567
|
+
getProviderConnectionState(): ProviderConnectionState;
|
|
568
|
+
/**
|
|
569
|
+
* The contract-manager's current provider-sync health **without forcing it
|
|
570
|
+
* to initialize** — reads the already-constructed manager, or reports
|
|
571
|
+
* `online` when none exists yet. Unlike {@link getContractManager}, this
|
|
572
|
+
* never triggers a remote sync, so it is safe on a pure diagnostics path
|
|
573
|
+
* (e.g. the service-worker sync-state message).
|
|
574
|
+
*/
|
|
575
|
+
getContractSyncState(): ContractSyncState;
|
|
476
576
|
protected constructor(identity: ReadonlyIdentity, network: Network, onchainProvider: OnchainProvider, indexerProvider: IndexerProvider, arkServerPublicKey: Bytes, offchainTapscript: DefaultVtxo.Script | DelegateVtxo.Script, boardingTapscript: DefaultVtxo.Script, dustAmount: bigint, walletRepository: WalletRepository, contractRepository: ContractRepository, delegateProvider?: DelegateProvider | undefined, watcherConfig?: ReadonlyWalletConfig["watcherConfig"], walletContractTimelocks?: RelativeTimelock[]);
|
|
477
577
|
/**
|
|
478
578
|
* x-only hex of the operator's deprecated signer keys (from
|
|
@@ -570,6 +670,8 @@ declare class ReadonlyWallet implements IReadonlyWallet {
|
|
|
570
670
|
walletRepository: WalletRepository;
|
|
571
671
|
contractRepository: ContractRepository;
|
|
572
672
|
info: ArkInfo;
|
|
673
|
+
serverInfoSource: ServerInfoSource;
|
|
674
|
+
serverInfoLastOnlineAt: number | undefined;
|
|
573
675
|
delegateProvider: DelegateProvider | undefined;
|
|
574
676
|
/** @deprecated alias for `delegateProvider` */
|
|
575
677
|
delegatorProvider: DelegateProvider | undefined;
|
|
@@ -1190,4 +1292,4 @@ declare class Wallet extends ReadonlyWallet implements IWallet {
|
|
|
1190
1292
|
*/
|
|
1191
1293
|
declare function waitForIncomingFunds(wallet: Wallet): Promise<IncomingFunds>;
|
|
1192
1294
|
|
|
1193
|
-
export { Batch as B, type IncomingFunds as I, ReadonlyWallet as R, Wallet as W, type ReceiveRotatorFactory as a, type ReceiveRotatorBootOpts as b, type ReceiveRotatorBoot as c, type BoardingUtxoGroup as d, waitForIncomingFunds as w };
|
|
1295
|
+
export { ArkError as A, Batch as B, type IncomingFunds as I, type ProviderConnectionState as P, ReadonlyWallet as R, type ServerInfoSource as S, Wallet as W, type ReceiveRotatorFactory as a, type ReceiveRotatorBootOpts as b, type ReceiveRotatorBoot as c, type BoardingUtxoGroup as d, type ProviderKind as e, ProviderUnavailableError as f, maybeArkError as m, waitForIncomingFunds as w };
|
|
@@ -1,8 +1,48 @@
|
|
|
1
1
|
import { Transaction } from '@scure/btc-signer';
|
|
2
2
|
import { Bytes } from '@scure/btc-signer/utils.js';
|
|
3
|
-
import { B as BatchStartedEvent, u as TreeSigningStartedEvent, v as TxTree, w as TreeNoncesEvent, x as BatchFinalizationEvent, y as BatchFinalizedEvent, z as BatchFailedEvent, D as TreeTxEvent, F as TreeSignatureEvent, j as SettlementEvent, b as WalletConfig, W as WalletRepository, C as ContractRepository, H as DescriptorProvider, g as IContractManager, J as IReadonlyWallet, K as ReadonlyIdentity, N as Network, O as OnchainProvider, p as IndexerProvider, L as DelegateProvider, M as ReadonlyWalletConfig, P as IntentRepository, Q as VirtualTxRepository, q as RelativeTimelock, e as ActivityRegistry,
|
|
3
|
+
import { B as BatchStartedEvent, u as TreeSigningStartedEvent, v as TxTree, w as TreeNoncesEvent, x as BatchFinalizationEvent, y as BatchFinalizedEvent, z as BatchFailedEvent, D as TreeTxEvent, F as TreeSignatureEvent, j as SettlementEvent, b as WalletConfig, W as WalletRepository, C as ContractRepository, H as DescriptorProvider, g as IContractManager, J as IReadonlyWallet, K as ReadonlyIdentity, N as Network, O as OnchainProvider, p as IndexerProvider, L as DelegateProvider, M as ReadonlyWalletConfig, P as IntentRepository, Q as VirtualTxRepository, U as ExitCaptureMode, X as ExitDataSource, q as RelativeTimelock, e as ActivityRegistry, Y as IReadonlyAssetManager, Z as ContractSyncState, o as ArkProvider, _ as NetworkName, $ as ArkInfo, a0 as ArkAddress, c as WalletBalance, G as GetVtxosFilter, E as ExtendedVirtualCoin, A as ArkTransaction, f as Activity, d as ExtendedCoin, a1 as Coin, a2 as ContractManager, I as IWallet, a as Identity, a3 as CSVMultisigTapscript, a4 as SettlementConfig, k as IAssetManager, a5 as VtxoManager, h as IDelegateManager, S as SendBitcoinParams, i as SettleParams, R as Recipient, a6 as SignerSession, a7 as SignedIntent, a8 as Intent } from './ark-C-PjOngm.cjs';
|
|
4
4
|
import { TransactionOutput } from '@scure/btc-signer/psbt.js';
|
|
5
|
-
import { D as DefaultVtxo, a as DelegateVtxo } from './delegate-
|
|
5
|
+
import { D as DefaultVtxo, a as DelegateVtxo } from './delegate-DOEobYwH.cjs';
|
|
6
|
+
|
|
7
|
+
declare class ArkError extends Error {
|
|
8
|
+
readonly code: number;
|
|
9
|
+
readonly message: string;
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly metadata?: Record<string, string> | undefined;
|
|
12
|
+
constructor(code: number, message: string, name: string, metadata?: Record<string, string> | undefined);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Which remote dependency an availability failure refers to. Used to label the
|
|
16
|
+
* {@link ProviderUnavailableError} message and the wallet's
|
|
17
|
+
* `ProviderConnectionState`; it is deliberately *not* carried as a structured
|
|
18
|
+
* field on the error, since custom `Error` own-properties do not survive the
|
|
19
|
+
* service-worker `postMessage` boundary (only `name`/`message`/`cause` do).
|
|
20
|
+
*/
|
|
21
|
+
type ProviderKind = "arkade" | "indexer";
|
|
22
|
+
/**
|
|
23
|
+
* A remote provider (Arkade operator or its indexer) is temporarily
|
|
24
|
+
* unreachable. This is a *retryable* condition — transport failure, request
|
|
25
|
+
* timeout, or a 5xx/429-style temporary HTTP response — as opposed to a
|
|
26
|
+
* terminal configuration/authorization/schema error, which stays a plain
|
|
27
|
+
* `Error`/{@link ArkError}. The original low-level error is preserved as
|
|
28
|
+
* {@link Error.cause}.
|
|
29
|
+
*/
|
|
30
|
+
declare class ProviderUnavailableError extends Error {
|
|
31
|
+
/** Always `true`: this error type only ever wraps retryable conditions. */
|
|
32
|
+
readonly retryable = true;
|
|
33
|
+
constructor(message: string, options?: {
|
|
34
|
+
cause?: unknown;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Try to convert an error to an ArkError class, returning undefined if the error is not an ArkError
|
|
39
|
+
* @param error - The error to parse
|
|
40
|
+
* @returns The parsed ArkError, or undefined if the error is not an ArkError
|
|
41
|
+
*/
|
|
42
|
+
declare function maybeArkError(error: any): ArkError | undefined;
|
|
43
|
+
|
|
44
|
+
/** Where the {@link ArkInfo} used to construct a wallet came from. */
|
|
45
|
+
type ServerInfoSource = "live" | "cache";
|
|
6
46
|
|
|
7
47
|
/**
|
|
8
48
|
* Batch namespace provides utilities for joining and processing batch session.
|
|
@@ -412,6 +452,23 @@ interface BoardingUtxoGroup {
|
|
|
412
452
|
csvTimelock: RelativeTimelock;
|
|
413
453
|
coins: ExtendedCoin[];
|
|
414
454
|
}
|
|
455
|
+
/**
|
|
456
|
+
* Freshness of the wallet's provider-backed sync, composed from the boot
|
|
457
|
+
* server-info source and the contract-manager's indexer-sync health. It
|
|
458
|
+
* describes only how fresh provider data is — never the wallet balances/VTXOs
|
|
459
|
+
* themselves, which are always served from the repository (system of record).
|
|
460
|
+
*/
|
|
461
|
+
type ProviderConnectionState = {
|
|
462
|
+
mode: "online";
|
|
463
|
+
source: "live";
|
|
464
|
+
lastOnlineAt: number;
|
|
465
|
+
} | {
|
|
466
|
+
mode: "degraded";
|
|
467
|
+
source: "cache" | "repository";
|
|
468
|
+
provider: ProviderKind;
|
|
469
|
+
reason: string;
|
|
470
|
+
lastOnlineAt?: number;
|
|
471
|
+
};
|
|
415
472
|
declare class ReadonlyWallet implements IReadonlyWallet {
|
|
416
473
|
readonly identity: ReadonlyIdentity;
|
|
417
474
|
readonly network: Network;
|
|
@@ -438,6 +495,12 @@ declare class ReadonlyWallet implements IReadonlyWallet {
|
|
|
438
495
|
* (ContractManager isn't given it); `undefined` ⇒ no-op.
|
|
439
496
|
*/
|
|
440
497
|
virtualTxRepository?: VirtualTxRepository;
|
|
498
|
+
/** Opt-in exit-data capture settings; see {@link StorageConfig.exitDataCapture}. */
|
|
499
|
+
exitDataCapture?: {
|
|
500
|
+
mode?: ExitCaptureMode;
|
|
501
|
+
minExitWorthSats?: number;
|
|
502
|
+
sources?: ExitDataSource[];
|
|
503
|
+
};
|
|
441
504
|
private readonly _assetManager;
|
|
442
505
|
readonly walletContractTimelocks: RelativeTimelock[];
|
|
443
506
|
protected _pendingSpendOutpoints: Set<string>;
|
|
@@ -473,6 +536,43 @@ declare class ReadonlyWallet implements IReadonlyWallet {
|
|
|
473
536
|
* construction-time snapshot for their lifetime.
|
|
474
537
|
*/
|
|
475
538
|
protected _arkServerPublicKey: Bytes;
|
|
539
|
+
/**
|
|
540
|
+
* Whether this wallet was constructed from live operator server-info
|
|
541
|
+
* (`"live"`) or from a cached snapshot because the operator was unreachable
|
|
542
|
+
* (`"cache"`). Freshness signal for {@link getProviderConnectionState}.
|
|
543
|
+
*/
|
|
544
|
+
protected _serverInfoSource: ServerInfoSource;
|
|
545
|
+
/**
|
|
546
|
+
* Epoch-ms of the last known live operator contact: construction time on the
|
|
547
|
+
* `live` boot path, the cached snapshot's `savedAt` on the `cache` path.
|
|
548
|
+
*/
|
|
549
|
+
protected _serverInfoLastOnlineAt?: number;
|
|
550
|
+
/** @see {@link _serverInfoSource} */
|
|
551
|
+
get serverInfoSource(): ServerInfoSource;
|
|
552
|
+
/**
|
|
553
|
+
* Composed provider-connection freshness: the boot server-info source
|
|
554
|
+
* (Arkade) combined with the contract-manager's indexer-sync health, if the
|
|
555
|
+
* manager has been initialized. Reads no live provider state — it never
|
|
556
|
+
* forces a `ContractManager` to construct — so it is safe for readonly
|
|
557
|
+
* callers that only use address/balance APIs.
|
|
558
|
+
*
|
|
559
|
+
* - Boot fell back to a cached snapshot → degraded on `arkade` (`cache`).
|
|
560
|
+
* - Otherwise, if the contract manager has degraded to repository data →
|
|
561
|
+
* degraded on `indexer` (`repository`).
|
|
562
|
+
* - Otherwise online.
|
|
563
|
+
*
|
|
564
|
+
* This only describes sync freshness; wallet balances/VTXOs are always read
|
|
565
|
+
* from the repository regardless of this state.
|
|
566
|
+
*/
|
|
567
|
+
getProviderConnectionState(): ProviderConnectionState;
|
|
568
|
+
/**
|
|
569
|
+
* The contract-manager's current provider-sync health **without forcing it
|
|
570
|
+
* to initialize** — reads the already-constructed manager, or reports
|
|
571
|
+
* `online` when none exists yet. Unlike {@link getContractManager}, this
|
|
572
|
+
* never triggers a remote sync, so it is safe on a pure diagnostics path
|
|
573
|
+
* (e.g. the service-worker sync-state message).
|
|
574
|
+
*/
|
|
575
|
+
getContractSyncState(): ContractSyncState;
|
|
476
576
|
protected constructor(identity: ReadonlyIdentity, network: Network, onchainProvider: OnchainProvider, indexerProvider: IndexerProvider, arkServerPublicKey: Bytes, offchainTapscript: DefaultVtxo.Script | DelegateVtxo.Script, boardingTapscript: DefaultVtxo.Script, dustAmount: bigint, walletRepository: WalletRepository, contractRepository: ContractRepository, delegateProvider?: DelegateProvider | undefined, watcherConfig?: ReadonlyWalletConfig["watcherConfig"], walletContractTimelocks?: RelativeTimelock[]);
|
|
477
577
|
/**
|
|
478
578
|
* x-only hex of the operator's deprecated signer keys (from
|
|
@@ -570,6 +670,8 @@ declare class ReadonlyWallet implements IReadonlyWallet {
|
|
|
570
670
|
walletRepository: WalletRepository;
|
|
571
671
|
contractRepository: ContractRepository;
|
|
572
672
|
info: ArkInfo;
|
|
673
|
+
serverInfoSource: ServerInfoSource;
|
|
674
|
+
serverInfoLastOnlineAt: number | undefined;
|
|
573
675
|
delegateProvider: DelegateProvider | undefined;
|
|
574
676
|
/** @deprecated alias for `delegateProvider` */
|
|
575
677
|
delegatorProvider: DelegateProvider | undefined;
|
|
@@ -1190,4 +1292,4 @@ declare class Wallet extends ReadonlyWallet implements IWallet {
|
|
|
1190
1292
|
*/
|
|
1191
1293
|
declare function waitForIncomingFunds(wallet: Wallet): Promise<IncomingFunds>;
|
|
1192
1294
|
|
|
1193
|
-
export { Batch as B, type IncomingFunds as I, ReadonlyWallet as R, Wallet as W, type ReceiveRotatorFactory as a, type ReceiveRotatorBootOpts as b, type ReceiveRotatorBoot as c, type BoardingUtxoGroup as d, waitForIncomingFunds as w };
|
|
1295
|
+
export { ArkError as A, Batch as B, type IncomingFunds as I, type ProviderConnectionState as P, ReadonlyWallet as R, type ServerInfoSource as S, Wallet as W, type ReceiveRotatorFactory as a, type ReceiveRotatorBootOpts as b, type ReceiveRotatorBoot as c, type BoardingUtxoGroup as d, type ProviderKind as e, ProviderUnavailableError as f, maybeArkError as m, waitForIncomingFunds as w };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
5
|
-
require('../../chunk-
|
|
3
|
+
var chunkOFQGANH2_cjs = require('../../chunk-OFQGANH2.cjs');
|
|
4
|
+
require('../../chunk-SRCWBFSZ.cjs');
|
|
5
|
+
require('../../chunk-UHOHLN3C.cjs');
|
|
6
6
|
require('../../chunk-32YKLQPS.cjs');
|
|
7
7
|
require('../../chunk-HXDZ2QTW.cjs');
|
|
8
8
|
require('../../chunk-5BLDMQED.cjs');
|
|
@@ -120,19 +120,19 @@ var AsyncStorageTaskQueue = class {
|
|
|
120
120
|
|
|
121
121
|
Object.defineProperty(exports, "CONTRACT_POLL_TASK_TYPE", {
|
|
122
122
|
enumerable: true,
|
|
123
|
-
get: function () { return
|
|
123
|
+
get: function () { return chunkOFQGANH2_cjs.CONTRACT_POLL_TASK_TYPE; }
|
|
124
124
|
});
|
|
125
125
|
Object.defineProperty(exports, "contractPollProcessor", {
|
|
126
126
|
enumerable: true,
|
|
127
|
-
get: function () { return
|
|
127
|
+
get: function () { return chunkOFQGANH2_cjs.contractPollProcessor; }
|
|
128
128
|
});
|
|
129
129
|
Object.defineProperty(exports, "createTaskDependencies", {
|
|
130
130
|
enumerable: true,
|
|
131
|
-
get: function () { return
|
|
131
|
+
get: function () { return chunkOFQGANH2_cjs.createTaskDependencies; }
|
|
132
132
|
});
|
|
133
133
|
Object.defineProperty(exports, "runTasks", {
|
|
134
134
|
enumerable: true,
|
|
135
|
-
get: function () { return
|
|
135
|
+
get: function () { return chunkOFQGANH2_cjs.runTasks; }
|
|
136
136
|
});
|
|
137
137
|
exports.AsyncStorageTaskQueue = AsyncStorageTaskQueue;
|
|
138
138
|
exports.InMemoryTaskQueue = InMemoryTaskQueue;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { T as TaskProcessor } from '../../taskRunner-
|
|
2
|
-
export { C as CreateTaskDependenciesOptions, I as InMemoryTaskQueue, b as TaskDependencies, c as TaskItem, a as TaskQueue, d as TaskResult, e as createTaskDependencies, r as runTasks } from '../../taskRunner-
|
|
3
|
-
export { a as AsyncStorageLike, A as AsyncStorageTaskQueue } from '../../asyncStorageTaskQueue-
|
|
4
|
-
import '../../ark-
|
|
1
|
+
import { T as TaskProcessor } from '../../taskRunner-DOiyRuJa.cjs';
|
|
2
|
+
export { C as CreateTaskDependenciesOptions, I as InMemoryTaskQueue, b as TaskDependencies, c as TaskItem, a as TaskQueue, d as TaskResult, e as createTaskDependencies, r as runTasks } from '../../taskRunner-DOiyRuJa.cjs';
|
|
3
|
+
export { a as AsyncStorageLike, A as AsyncStorageTaskQueue } from '../../asyncStorageTaskQueue-BmBPvTyh.cjs';
|
|
4
|
+
import '../../ark-C-PjOngm.cjs';
|
|
5
5
|
import '@scure/btc-signer/transaction.js';
|
|
6
6
|
import '@scure/btc-signer/utils.js';
|
|
7
7
|
import '@scure/btc-signer/psbt.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { T as TaskProcessor } from '../../taskRunner-
|
|
2
|
-
export { C as CreateTaskDependenciesOptions, I as InMemoryTaskQueue, b as TaskDependencies, c as TaskItem, a as TaskQueue, d as TaskResult, e as createTaskDependencies, r as runTasks } from '../../taskRunner-
|
|
3
|
-
export { a as AsyncStorageLike, A as AsyncStorageTaskQueue } from '../../asyncStorageTaskQueue-
|
|
4
|
-
import '../../ark-
|
|
1
|
+
import { T as TaskProcessor } from '../../taskRunner-BngWSFMi.js';
|
|
2
|
+
export { C as CreateTaskDependenciesOptions, I as InMemoryTaskQueue, b as TaskDependencies, c as TaskItem, a as TaskQueue, d as TaskResult, e as createTaskDependencies, r as runTasks } from '../../taskRunner-BngWSFMi.js';
|
|
3
|
+
export { a as AsyncStorageLike, A as AsyncStorageTaskQueue } from '../../asyncStorageTaskQueue-CHpI3moJ.js';
|
|
4
|
+
import '../../ark-C-PjOngm.js';
|
|
5
5
|
import '@scure/btc-signer/transaction.js';
|
|
6
6
|
import '@scure/btc-signer/utils.js';
|
|
7
7
|
import '@scure/btc-signer/psbt.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { CONTRACT_POLL_TASK_TYPE, contractPollProcessor, createTaskDependencies, runTasks } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
1
|
+
export { CONTRACT_POLL_TASK_TYPE, contractPollProcessor, createTaskDependencies, runTasks } from '../../chunk-QZ6HZZZK.js';
|
|
2
|
+
import '../../chunk-TGRJ5WAX.js';
|
|
3
|
+
import '../../chunk-YBQV7XBC.js';
|
|
4
4
|
import '../../chunk-YNEDJTX2.js';
|
|
5
5
|
import '../../chunk-BE5MUB7T.js';
|
|
6
6
|
import '../../chunk-NSBPE2FW.js';
|