mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 13:54:20 +01:00
Create Dart snippets and reference them
Co-Authored-By: ok300 <106775972+ok300@users.noreply.github.com>
This commit is contained in:
14
snippets/dart_snippets/lib/receive_payment.dart
Normal file
14
snippets/dart_snippets/lib/receive_payment.dart
Normal file
@@ -0,0 +1,14 @@
|
||||
import 'package:breez_sdk/breez_sdk.dart';
|
||||
import 'package:breez_sdk/bridge_generated.dart';
|
||||
|
||||
Future<ReceivePaymentResponse> receivePayment() async {
|
||||
// ANCHOR: receive-payment
|
||||
ReceivePaymentRequest req = const ReceivePaymentRequest(
|
||||
amountMsat: 3000000,
|
||||
description: "Invoice for 3000 sats",
|
||||
);
|
||||
ReceivePaymentResponse resp = await BreezSDK().receivePayment(req: req);
|
||||
print(resp.lnInvoice);
|
||||
// ANCHOR_END: receive-payment
|
||||
return resp;
|
||||
}
|
||||
Reference in New Issue
Block a user