Table of Contents

Interface IBlockchainMonitor

Namespace
NLightning.Infrastructure.Bitcoin.Wallet.Interfaces
Assembly
NLightning.Infrastructure.Bitcoin.dll
public interface IBlockchainMonitor

Properties

LastProcessedBlockHeight

uint LastProcessedBlockHeight { get; }

Property Value

uint

Methods

PublishAndWatchTransactionAsync(ChannelId, SignedTransaction, uint)

Task PublishAndWatchTransactionAsync(ChannelId channelId, SignedTransaction signedTransaction, uint requiredDepth)

Parameters

channelId ChannelId
signedTransaction SignedTransaction
requiredDepth uint

Returns

Task

StartAsync(uint, CancellationToken)

Starts a background task to periodically refresh the fee rate

Task StartAsync(uint heightOfBirth, CancellationToken cancellationToken = default)

Parameters

heightOfBirth uint

Wallet's height of birth to avoid processing old blocks

cancellationToken CancellationToken

Returns

Task

StopAsync()

Stops the background task and cancels any ongoing operations within the service.

Task StopAsync()

Returns

Task

A task representing the asynchronous stop operation.

WatchBitcoinAddress(WalletAddressModel)

void WatchBitcoinAddress(WalletAddressModel walletAddress)

Parameters

walletAddress WalletAddressModel

WatchTransactionAsync(ChannelId, TxId, uint)

Task WatchTransactionAsync(ChannelId channelId, TxId txId, uint requiredDepth)

Parameters

channelId ChannelId
txId TxId
requiredDepth uint

Returns

Task

Events

OnNewBlockDetected

event EventHandler<NewBlockEventArgs> OnNewBlockDetected

Event Type

EventHandler<NewBlockEventArgs>

OnTransactionConfirmed

event EventHandler<TransactionConfirmedEventArgs> OnTransactionConfirmed

Event Type

EventHandler<TransactionConfirmedEventArgs>

OnWalletMovementDetected

event EventHandler<WalletMovementEventArgs>? OnWalletMovementDetected

Event Type

EventHandler<WalletMovementEventArgs>