Skip to content

Emit PaymentReceived on upstream PaymentReceived or PaymentClaimed? #34

Closed

Description

@tnull

Having PaymentReceived and PaymentClaimed in LDK Lite might be a bit verbose for the 'simplified' API.

If we only want to have one, i.e., PaymentReceived event, it raises the question when we should emit it: on receiving PaymentReceived or PaymentClaimed?

Or do we want to mirror both events here after all?

Activity

  1. TheBlueMatt commented on Nov 30, 2022

    @TheBlueMatt
    Contributor

    LDKLite should just expose PaymentClaimed, ie that we have received and claimed a payment, not PaymentReceived, which it should just handle by calling claim_payment.

  2. tnull commented on Nov 30, 2022

    @tnull
    CollaboratorAuthor

    Yes, this is also what I'm leaning towards, only issue being that I find PaymentReceived a much more intuitive name to use for this event in LDK Lite, which however would shadow the upstream event with different meaning, i.e., would be pretty confusing if someone is aware of LDK Events already. I'll have to think about whether there is a good alternative naming for it.

    For the record, I'd find using something along the lines of PaymentIncoming / PaymentReceived also more intuitive than PaymentReceived/PaymentClaimed upstream, since PaymentReceived sounds pretty final by itself, even though it's actually not.

  3. valentinewallace commented on Nov 30, 2022

    @valentinewallace
    Contributor

    For the record, I'd find using something along the lines of PaymentIncoming / PaymentReceived also more intuitive than PaymentReceived/PaymentClaimed upstream, since PaymentReceived sounds pretty final by itself, even though it's actually not.

    +1, I've gotten similar feedback about PaymentReceived being a confusing name

  4. tnull commented on Nov 30, 2022

    @tnull
    CollaboratorAuthor

    +1, I've gotten similar feedback about PaymentReceived being a confusing name

    Thanks, good to know, then maybe the solution could indeed be renaming the upstream event..

  5. TheBlueMatt commented on Nov 30, 2022

    @TheBlueMatt
    Contributor

    Any suggestions for a better one? We should totally rename it upstream if it makes sense.

  6. tnull commented on Nov 30, 2022

    @tnull
    CollaboratorAuthor

    Any suggestions for a better one? We should totally rename it upstream if it makes sense.

    As mentioned above (in an edit), maybe something along the lines of
    PaymentReceived -> PaymentIncoming / PaymentInbound
    PaymentClaimed -> PaymentReceived?

  7. valentinewallace commented on Nov 30, 2022

    @valentinewallace
    Contributor

    PaymentClaimable? But I'm fine with all the above too^

  8. TheBlueMatt commented on Nov 30, 2022

    @TheBlueMatt
    Contributor

    Any of those SGTM, feel free to PR :)

  9. tnull commented on Nov 30, 2022

    @tnull
    CollaboratorAuthor

    PaymentClaimable? But I'm fine with all the above too^

    Ah, that's even better! Now the only thing is that the migration PaymentClaimed->PaymentReceived might be a pitfall for users as their code for the former PaymentReceived event might just keep on working for the wrong event without them noticing.

  10. TheBlueMatt commented on Nov 30, 2022

    @TheBlueMatt
    Contributor

    Maybe after #1886 tho.

  11. tnull commented on Nov 30, 2022

    @tnull
    CollaboratorAuthor

    Any of those SGTM, feel free to PR :)

    Alright, will open a PR tomorrow/in the next days!

  12. tnull commented on Dec 1, 2022

    @tnull
    CollaboratorAuthor

    Closing as clarified, will update after upstream event has been merged.

  13. added a commit that references this issue on Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions