mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 13:54:20 +01:00
add csharp snippets
This commit is contained in:
33
snippets/csharp/ConnectingLsp.cs
Normal file
33
snippets/csharp/ConnectingLsp.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Breez.Sdk;
|
||||
|
||||
public class ConnectingLspSnippets
|
||||
{
|
||||
public void GetLspInfo(BlockingBreezServices sdk)
|
||||
{
|
||||
// ANCHOR: get-lsp-info
|
||||
try
|
||||
{
|
||||
var lspId = sdk.LspId();
|
||||
var lspInfo = sdk.LspInfo();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Handle error
|
||||
}
|
||||
// ANCHOR_END: get-lsp-info
|
||||
}
|
||||
|
||||
public void ConnectLsp(BlockingBreezServices sdk, string? lspId)
|
||||
{
|
||||
// ANCHOR: connect-lsp
|
||||
try
|
||||
{
|
||||
sdk.ConnectLsp(lspId!);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Handle error
|
||||
}
|
||||
// ANCHOR_END: connect-lsp
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user