Table of Contents

Class WalletRecoveryService

Namespace
NArk.Core.Recovery
Assembly
NArk.Core.dll

Unified, wallet-type-agnostic recovery. Composes the existing building blocks — the HD index scanner (HdWalletRecoveryService), the pending-tx finalizer (PendingArkTransactionRecoveryService) and the VTXO sync (VtxoSynchronizationService) — behind one RecoverAsync(string, RecoveryOptions?, CancellationToken) call.

public class WalletRecoveryService : IWalletRecoveryService
Inheritance
WalletRecoveryService
Implements
Inherited Members

Constructors

WalletRecoveryService(IWalletStorage, IContractStorage, HdWalletRecoveryService, SingleKeyVtxoRecoveryService, PendingArkTransactionRecoveryService, VtxoSynchronizationService, ILogger<WalletRecoveryService>?)

Unified, wallet-type-agnostic recovery. Composes the existing building blocks — the HD index scanner (HdWalletRecoveryService), the pending-tx finalizer (PendingArkTransactionRecoveryService) and the VTXO sync (VtxoSynchronizationService) — behind one RecoverAsync(string, RecoveryOptions?, CancellationToken) call.

public WalletRecoveryService(IWalletStorage walletStorage, IContractStorage contractStorage, HdWalletRecoveryService hdRecovery, SingleKeyVtxoRecoveryService singleKeyRecovery, PendingArkTransactionRecoveryService pendingTxRecovery, VtxoSynchronizationService vtxoSync, ILogger<WalletRecoveryService>? logger = null)

Parameters

walletStorage IWalletStorage
contractStorage IContractStorage
hdRecovery HdWalletRecoveryService
singleKeyRecovery SingleKeyVtxoRecoveryService
pendingTxRecovery PendingArkTransactionRecoveryService
vtxoSync VtxoSynchronizationService
logger ILogger<WalletRecoveryService>

Methods

RecoverAsync(string, RecoveryOptions?, CancellationToken)

Recover everything reconstructable for walletId.

public Task<WalletRecoveryReport> RecoverAsync(string walletId, RecoveryOptions? options = null, CancellationToken cancellationToken = default)

Parameters

walletId string

The wallet to recover (must already exist in storage).

options RecoveryOptions

HD scan tuning (gap limit, max index). Ignored for SingleKey.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<WalletRecoveryReport>