rename LNUrlPayRequest -> LNUrlPayResponseRaw

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2025-09-01 13:33:33 -04:00
parent 72d696beb2
commit 2a7c5eb983

View File

@@ -13,7 +13,7 @@ pub struct FetchedInvoice {
pub type FetchingInvoice = Promise<Result<Result<FetchedInvoice, ZapError>, JoinError>>; pub type FetchingInvoice = Promise<Result<Result<FetchedInvoice, ZapError>, JoinError>>;
async fn fetch_pay_req_async(url: &Url) -> Result<LNUrlPayRequest, ZapError> { async fn fetch_pay_req_async(url: &Url) -> Result<LNUrlPayResponseRaw, ZapError> {
let (sender, promise) = Promise::new(); let (sender, promise) = Promise::new();
let on_done = move |response: Result<ehttp::Response, String>| { let on_done = move |response: Result<ehttp::Response, String>| {
@@ -36,7 +36,7 @@ async fn fetch_pay_req_async(url: &Url) -> Result<LNUrlPayRequest, ZapError> {
tokio::task::block_in_place(|| promise.block_and_take()) tokio::task::block_in_place(|| promise.block_and_take())
} }
async fn fetch_pay_req_from_lud16(lud16: &str) -> Result<LNUrlPayRequest, ZapError> { async fn fetch_pay_req_from_lud16(lud16: &str) -> Result<LNUrlPayResponseRaw, ZapError> {
let url = match generate_endpoint_url(lud16) { let url = match generate_endpoint_url(lud16) {
Ok(url) => url, Ok(url) => url,
Err(e) => return Err(e), Err(e) => return Err(e),
@@ -100,7 +100,7 @@ fn make_kind_9734<'a>(
} }
#[derive(Debug, Deserialize)] #[derive(Debug, Deserialize)]
pub struct LNUrlPayRequest { pub struct LNUrlPayResponseRaw {
#[allow(dead_code)] #[allow(dead_code)]
#[serde(rename = "allowsNostr")] #[serde(rename = "allowsNostr")]
allow_nostr: bool, allow_nostr: bool,
@@ -184,7 +184,7 @@ fn convert_lnurl_to_endpoint_url(lnurl: &str) -> Result<Url, ZapError> {
.map_err(|e| ZapError::EndpointError(format!("endpoint url from lnurl is invalid: {e}"))) .map_err(|e| ZapError::EndpointError(format!("endpoint url from lnurl is invalid: {e}")))
} }
async fn fetch_pay_req_from_lnurl_async(lnurl: &str) -> Result<LNUrlPayRequest, ZapError> { async fn fetch_pay_req_from_lnurl_async(lnurl: &str) -> Result<LNUrlPayResponseRaw, ZapError> {
let url = match convert_lnurl_to_endpoint_url(lnurl) { let url = match convert_lnurl_to_endpoint_url(lnurl) {
Ok(u) => u, Ok(u) => u,
Err(e) => return Err(e), Err(e) => return Err(e),
@@ -195,7 +195,7 @@ async fn fetch_pay_req_from_lnurl_async(lnurl: &str) -> Result<LNUrlPayRequest,
async fn fetch_invoice_lnurl_async( async fn fetch_invoice_lnurl_async(
lnurl: &str, lnurl: &str,
pay_req: &LNUrlPayRequest, pay_req: &LNUrlPayResponseRaw,
msats: u64, msats: u64,
sender_nsec: &[u8; 32], sender_nsec: &[u8; 32],
relays: Vec<String>, relays: Vec<String>,