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:
ok300
2024-01-30 15:59:42 +01:00
25 changed files with 364 additions and 47 deletions

View File

@@ -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;
}