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

Feature: handle lnurl success action #3362

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

tiankii
Copy link

@tiankii tiankii commented Feb 18, 2025

Implemented: LNURL successAction: LUD-09, LUD-10

image

Copy link
Collaborator

@dolcalmi dolcalmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also please add a screenshot

@tiankii tiankii marked this pull request as draft February 25, 2025 14:08
@tiankii tiankii requested a review from dolcalmi February 26, 2025 01:20
@tiankii tiankii marked this pull request as ready for review February 26, 2025 02:06
Copy link
Collaborator

@dolcalmi dolcalmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont forget to disable auto redirect to home when it has success action

SuccessLUD09Message,
SuccessLUD09URL,
SuccessLUD09URLWithDesc,
} from "../../app/screens/send-bitcoin-screen/send-bitcoin-completed-screen.stories"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use @app/screens/...

@@ -381,6 +381,15 @@ const SendBitcoinDetailsScreen: React.FC<Props> = ({ route }) => {
}

const result = await requestInvoice(requestInvoiceParams)

setPaymentDetail((prev) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, why prev? this is more like paymentDetail


setPaymentDetail((prev) => {
if (prev?.setSuccessAction) {
return prev.setSuccessAction(result.successAction)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happen if result.successAction is undefined? maybe better add && result.successAction to the if

@@ -396,6 +405,10 @@ const SendBitcoinDetailsScreen: React.FC<Props> = ({ route }) => {
paymentRequest: invoice,
paymentRequestAmount: btcAmount,
})

paymentDetailForConfirmation =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if result.successAction is undefined?

@@ -154,6 +154,8 @@ const SendBitcoinConfirmationScreen: React.FC<Props> = ({ route }) => {
params: {
arrivalAtMempoolEstimate: extraInfo?.arrivalAtMempoolEstimate,
status,
successAction: paymentDetail?.successAction,
preimage: extraInfo?.preimage,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you test this?

</View>
</View>
)}
<TouchableOpacity
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add accessibility label on touchable elements

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are missing aes test... you can use this data

    successAction: {
      tag: "aes",
      description: "Here is your redeem code",
      ciphertext: "564u3BEMRefWUV1098gJ5w==",
      iv: "IhkC5ktKB9LG91FvlbN2kg==",
    },
    preimage: "25004cd52960a3bac983e3f95c432341a7052cef37b9253b0b0b1256d754559b",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

Comment on lines 61 to 62
successAction: undefined,
preimage: undefined,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if they are undefined then there is no need to set them here

Comment on lines 42 to 43
successAction: undefined,
preimage: undefined,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

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.

4 participants