Skip to content

Conversation

thesimplekid
Copy link
Contributor

No description provided.

Copy link
Contributor

@benthecarman benthecarman left a comment

Choose a reason for hiding this comment

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

some preliminary review

Comment on lines 71 to +79
pub fn payment_hash(&self) -> [u8; 32] {
FromHex::from_hex(&self.payment_hash).expect("invalid payment hash")
FromHex::from_hex(self.payment_hash.as_ref().expect("missing payment hash"))
.expect("invalid payment hash")
}

pub fn bolt11(&self) -> Bolt11Invoice {
Bolt11Invoice::from_str(&self.bolt11).expect("invalid bolt11")
Bolt11Invoice::from_str(self.bolt11.as_ref().expect("missing bolt11"))
.expect("invalid bolt11")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

should make these optional

Comment on lines 90 to +98
pub fn payment_hash(&self) -> [u8; 32] {
FromHex::from_hex(&self.payment_hash).expect("invalid payment hash")
FromHex::from_hex(self.payment_hash.as_ref().expect("missing payment hash"))
.expect("invalid payment hash")
}

pub fn bolt11(&self) -> Bolt11Invoice {
Bolt11Invoice::from_str(&self.bolt11).expect("invalid bolt11")
Bolt11Invoice::from_str(self.bolt11.as_ref().expect("missing bolt11"))
.expect("invalid bolt11")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

should make these optional

}

// sort by timestamp so that the most recent items are at the top
Copy link
Contributor

Choose a reason for hiding this comment

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

should keep this comment

ReceiveBolt12 {
mint: MintIdentifier,
amount: Option<Amount>,
// NOTE: The following block was accidentally duplicated during merge. Removing to fix mismatched delimiters.
Copy link
Contributor

Choose a reason for hiding this comment

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

?


// Use CDK's BIP-353 melt flow to get a quote
let quote = client
.melt_bip353_quote(&address, cdk::Amount::from(amount_msats))
Copy link
Contributor

Choose a reason for hiding this comment

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

this may be a problem, i am guessing this won't be over tor

let bolt12_enabled = harbor
.active_mint
.as_ref()
.is_some_and(|a| a.mint_url().is_some());
Copy link
Contributor

Choose a reason for hiding this comment

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

not every mint supports this, we need a flag for if they do or not


let dest_input = h_input(InputArgs {
label: "Destination",
placeholder: "lnbc1...",
placeholder: "lnbc1... or lno... or ₿[email protected] or bc1...",
Copy link
Contributor

Choose a reason for hiding this comment

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

i dont really like this, can we keep the old string

@@ -608,6 +612,60 @@ impl HarborWallet {
self.send_from_ui(UICoreMsg::SendLightning { mint, invoice });
self.current_send_id = Some(id);
task
} else if invoice_str.starts_with("lno") {
Copy link
Contributor

Choose a reason for hiding this comment

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

we should be parsing this so we can tell if it needs an amount or anything. Otherwise will require us talking to the mint which can be very slow

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.

2 participants