mirror of
https://github.com/aljazceru/cdk.git
synced 2025-12-23 15:44:50 +01:00
Prepared Send (#596)
Co-authored-by: thesimplekid <tsk@thesimplekid.com> Co-authored-by: ok300 <106775972+ok300@users.noreply.github.com>
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
use std::io::{self, Write};
|
||||
|
||||
use anyhow::{anyhow, Result};
|
||||
use cdk::amount::SplitTarget;
|
||||
use cdk::nuts::nut18::TransportType;
|
||||
use cdk::nuts::{PaymentRequest, PaymentRequestPayload};
|
||||
use cdk::wallet::{MultiMintWallet, SendKind};
|
||||
use cdk::wallet::{MultiMintWallet, SendOptions};
|
||||
use clap::Args;
|
||||
use nostr_sdk::nips::nip19::Nip19Profile;
|
||||
use nostr_sdk::{Client as NostrClient, EventBuilder, FromBech32, Keys};
|
||||
@@ -81,17 +80,16 @@ pub async fn pay_request(
|
||||
})
|
||||
.ok_or(anyhow!("No supported transport method found"))?;
|
||||
|
||||
let proofs = matching_wallet
|
||||
.send(
|
||||
let prepared_send = matching_wallet
|
||||
.prepare_send(
|
||||
amount,
|
||||
None,
|
||||
None,
|
||||
&SplitTarget::default(),
|
||||
&SendKind::default(),
|
||||
true,
|
||||
SendOptions {
|
||||
include_fee: true,
|
||||
..Default::default()
|
||||
},
|
||||
)
|
||||
.await?
|
||||
.proofs();
|
||||
.await?;
|
||||
let proofs = matching_wallet.send(prepared_send, None).await?.proofs();
|
||||
|
||||
let payload = PaymentRequestPayload {
|
||||
id: payment_request.payment_id.clone(),
|
||||
|
||||
Reference in New Issue
Block a user