Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose onchain transactions in store and events #432

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

tnull
Copy link
Collaborator

@tnull tnull commented Jan 16, 2025

Closes #67
Based on #426

Previously, onchain-transactions where neither tracked in our PaymentStore nor where events for emitted for them.

Now, that the upgrade to BDK 1.0 is behind us, we take a stab at finally exposing them in our interface via PaymentStore and Events.

TODOs

tnull added 8 commits January 16, 2025 09:43
Previously, we decided to continue parsing any fields if we failed to
parse a known (i.e., `lightning` or `lno`) parameter failed to parse.
This however just hides the error and is a bit anti-idiomatic even
though allowing to use *some* URI fields even in the face of
incompatible formats for others.

Here we therefore opt to fail parsing the URI if any field fails.
Here, we move updating fields via `PaymentDetailsUpdate` to
`PaymentDetails::update`. This allows us to only update the fields that
changed, keeping track *whether* something changed, and only updating
the timestamp and persisting the entry *if* something changed.

This is a nice improvement in general (as we want to reduce persist
calls anyways), but we'll also use this for batch updates in the next
commits.
We implement a batch updating method that will only persist entries that
have been changed.
Previously, `PaymentKind::Onchain` was simply a placeholder entry we
never actually used. Here, we extend it to include fields that are
actually useful.
We update the payment store whenever syncing the wallet state finished.
…events

.. two new events that we're emitting when we sent or received an
onchain payment, i.e., the transactions reached ANTI_REORG_DELAY
confirmations.
@tnull tnull marked this pull request as draft January 16, 2025 13:28
@tnull tnull added this to the 0.5 milestone Jan 16, 2025
@tnull tnull mentioned this pull request Jan 23, 2025
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose on-chain transactions
1 participant