Skip to content

Commit 5274c76

Browse files
authored
Merge pull request #18 from synonymdev/feat/update-onchain-events
Improve Onchain Events API and Add Transaction Details Retrieval
2 parents 7de3bce + dbe2ada commit 5274c76

File tree

21 files changed

+2041
-586
lines changed

21 files changed

+2041
-586
lines changed

CHANGELOG.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,34 @@
66
- `OnchainTransactionReceived`: Emitted when a new unconfirmed transaction is
77
first detected in the mempool (instant notification for incoming payments!)
88
- `OnchainTransactionConfirmed`: Emitted when a transaction receives confirmations
9-
- `OnchainTransactionUnconfirmed`: Emitted when a previously confirmed transaction
10-
becomes unconfirmed (blockchain reorg)
9+
- `OnchainTransactionReplaced`: Emitted when a transaction is replaced (via RBF or different transaction using a commmon input)
10+
- `OnchainTransactionReorged`: Emitted when a previously confirmed transaction
11+
becomes unconfirmed due to a blockchain reorg
12+
- `OnchainTransactionEvicted`: Emitted when a transaction is evicted from the mempool
1113
- **Sync Completion Event** (fully implemented):
1214
- `SyncCompleted`: Emitted when onchain wallet sync finishes successfully
1315
- **Balance Change Event** (fully implemented):
1416
- `BalanceChanged`: Emitted when onchain or Lightning balances change, allowing
1517
applications to update balance displays immediately without polling
16-
- Added `TransactionContext` enum to onchain transaction events, which provides
17-
information about whether a transaction is related to channel funding, channel
18-
closure, or regular wallet activity. Applications can cross-reference with
19-
`ChannelPending` and `ChannelClosed` events to identify channel-related
20-
transactions.
18+
- Added `TransactionDetails`, `TxInput`, and `TxOutput` structs to provide comprehensive
19+
transaction information in onchain events, including inputs and outputs. This enables
20+
applications to analyze transaction data themselves to detect channel funding, closures,
21+
and other transaction types.
22+
- Added `Node::get_transaction_details()` method to retrieve transaction details for any
23+
transaction ID that exists in the wallet, returning `None` if the transaction is not found.
24+
- Added `Node::get_address_balance()` method to retrieve the current balance (in satoshis) for
25+
any Bitcoin address. This queries the chain source (Esplora or Electrum) to get the balance.
26+
Throws `InvalidAddress` if the address string cannot be parsed or doesn't match the node's
27+
network. Returns 0 if the balance cannot be queried (e.g., chain source unavailable). Note: This
28+
method is not available for BitcoindRpc chain source.
2129
- Added `SyncType` enum to distinguish between onchain wallet sync, Lightning
2230
wallet sync, and fee rate cache updates.
2331
- Balance tracking is now persisted in `NodeMetrics` to detect changes across restarts.
2432

33+
## Bug Fixes and Improvements
34+
- Fixed bug in `BitcoindRpc` eviction detection where transactions were incorrectly
35+
filtered (using `contains_key` instead of `!contains_key`).
36+
2537
# 0.6.2 - Aug. 14, 2025
2638
This patch release fixes a panic that could have been hit when syncing to a
2739
TLS-enabled Electrum server, as well as some minor issues when shutting down

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ldk-node"
3-
version = "0.6.2-rc.4"
3+
version = "0.6.2-rc.6"
44
authors = ["Elias Rohrer <[email protected]>"]
55
homepage = "https://lightningdevkit.org/"
66
license = "MIT OR Apache-2.0"

0 commit comments

Comments
 (0)