Skip to content

Commit

Permalink
Update LNURL structs
Browse files Browse the repository at this point in the history
  • Loading branch information
dangeross committed Dec 18, 2024
1 parent 2208dd5 commit c6bcb58
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/sdk-common/src/lnurl/specs/pay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ pub mod model {
/// Payload of the AES success action, as received from the LNURL endpoint
///
/// See [AesSuccessActionDataDecrypted] for a similar wrapper containing the decrypted payload
#[derive(Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub struct AesSuccessActionData {
/// Contents description, up to 144 characters
pub description: String,
Expand Down Expand Up @@ -243,7 +243,7 @@ pub mod model {
///
/// Receiving any other (unsupported) success action type will result in a failed parsing,
/// which will abort the LNURL-pay workflow, as per LUD-09.
#[derive(Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
#[serde(tag = "tag")]
pub enum SuccessAction {
Expand Down
8 changes: 8 additions & 0 deletions libs/sdk-common/src/lnurl/specs/withdraw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ pub mod model {
ServiceConnectivity { err: String },
}

impl From<anyhow::Error> for LnUrlWithdrawError {
fn from(err: anyhow::Error) -> Self {
Self::Generic {
err: err.to_string(),
}
}
}

impl From<InvoiceError> for LnUrlWithdrawError {
fn from(value: InvoiceError) -> Self {
match value {
Expand Down

0 comments on commit c6bcb58

Please sign in to comment.