mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 13:54:20 +01:00
Merge branch 'main' into ok300-bump-sdk-dependency-version
# Conflicts: # .github/workflows/main.yml # snippets/go/go.mod # snippets/kotlin_mpp_lib/shared/build.gradle.kts # snippets/python/src/send_spontaneous_payment.py # snippets/react-native/yarn.lock # snippets/rust/Cargo.lock # snippets/rust/Cargo.toml # snippets/swift/BreezSDKExamples/Package.resolved # snippets/swift/BreezSDKExamples/Package.swift # src/guide/install.md
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:breez_sdk/breez_sdk.dart';
|
||||
import 'package:breez_sdk/bridge_generated.dart';
|
||||
import 'dart:convert';
|
||||
|
||||
Future<SendPaymentResponse> sendSpontaneousPayment({
|
||||
required String nodeId,
|
||||
@@ -13,3 +14,23 @@ Future<SendPaymentResponse> sendSpontaneousPayment({
|
||||
// ANCHOR_END: send-spontaneous-payment
|
||||
return resp;
|
||||
}
|
||||
|
||||
Future<SendPaymentResponse> sendSpontaneousPaymentWithTlvs({
|
||||
required String nodeId,
|
||||
}) async {
|
||||
// ANCHOR: send-spontaneous-payment-with-tlvs
|
||||
List<TlvEntry> extraTlvs = [
|
||||
TlvEntry(
|
||||
fieldNumber: 34349334,
|
||||
value: utf8.encode("Hello world!"),
|
||||
)
|
||||
];
|
||||
SendSpontaneousPaymentRequest req = SendSpontaneousPaymentRequest(
|
||||
amountMsat: 3000000,
|
||||
nodeId: nodeId,
|
||||
extraTlvs: extraTlvs,
|
||||
);
|
||||
SendPaymentResponse resp = await BreezSDK().sendSpontaneousPayment(req: req);
|
||||
// ANCHOR_END: send-spontaneous-payment-with-tlvs
|
||||
return resp;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user