mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 05:44:20 +01:00
add csharp snippets
This commit is contained in:
21
snippets/csharp/SendSpontaneousPayment.cs
Normal file
21
snippets/csharp/SendSpontaneousPayment.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Breez.Sdk;
|
||||
|
||||
public class SendSpontaneousPaymentSnippets
|
||||
{
|
||||
public void SendSpontaneousPayment(BlockingBreezServices sdk)
|
||||
{
|
||||
// ANCHOR: send-spontaneous-payment
|
||||
var nodeId = "...";
|
||||
ulong amountMsat = 3_000_000;
|
||||
try
|
||||
{
|
||||
var response = sdk.SendSpontaneousPayment(
|
||||
new SendSpontaneousPaymentRequest(nodeId, amountMsat));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Handle error
|
||||
}
|
||||
// ANCHOR_END: send-spontaneous-payment
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user