Resolve conflicts

This commit is contained in:
Erdem Yerebasmaz
2023-11-03 02:41:32 +03:00
parent 24181ca7e1
commit 77f152273d
3 changed files with 16 additions and 14 deletions

View File

@@ -1,9 +1,11 @@
import 'package:breez_sdk/breez_sdk.dart'; import 'package:breez_sdk/breez_sdk.dart';
import 'package:breez_sdk/bridge_generated.dart'; import 'package:breez_sdk/bridge_generated.dart';
Future<SendPaymentResponse> buyBitcoin({required String bolt11}) async { Future<SendPaymentResponse> sendPayment({required String bolt11}) async {
// ANCHOR: send-payment // ANCHOR: send-payment
SendPaymentRequest req = SendPaymentRequest(bolt11: bolt11); // The `amountMsat` param is optional and should only passed if the bolt11 doesn't specify an amount.
// The amountMsat is required in case an amount is not specified in the bolt11 invoice'.
SendPaymentRequest req = SendPaymentRequest(bolt11: bolt11, amountMsat: 3000000);
SendPaymentResponse resp = await BreezSDK().sendPayment(req: req); SendPaymentResponse resp = await BreezSDK().sendPayment(req: req);
// ANCHOR_END: send-payment // ANCHOR_END: send-payment
return resp; return resp;

View File

@@ -2,11 +2,9 @@ import { sendPayment } from "@breeztech/react-native-breez-sdk"
const exampleSendLightningPayment = async () => { const exampleSendLightningPayment = async () => {
// ANCHOR: send-payment // ANCHOR: send-payment
const bolt11 = "..." // The `amountMsat` param is optional and should only passed if the bolt11 doesn't specify an amount.
// The amountMsat is required in case an amount is not specified in the bolt11 invoice'.
const sendPaymentResponse = await sendPayment({ const amountMsat = 3000000
bolt11, const response = await sendPayment({bolt11, amountMsat})
amountMsat: 3000000
})
// ANCHOR_END: send-payment // ANCHOR_END: send-payment
} }

View File

@@ -5,12 +5,14 @@ use breez_sdk_core::*;
async fn send_payment(sdk: Arc<BreezServices>) -> Result<()> { async fn send_payment(sdk: Arc<BreezServices>) -> Result<()> {
// ANCHOR: send-payment // ANCHOR: send-payment
let bolt11 = "...".into(); // The `amount_msat` param is optional and should only passed if the bolt11 doesn't specify an amount.
// The amount_msat is required in case an amount is not specified in the bolt11 invoice'.
sdk.send_payment(SendPaymentRequest { let amount_msat: Option<u64> = None;
bolt11, let req = SendPaymentRequest {
amount_msat: None bolt11: "...".into(),
}).await?; amount_msat,
};
let response = sdk.send_payment(req).await?;
// ANCHOR_END: send-payment // ANCHOR_END: send-payment
Ok(()) Ok(())