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:
19
snippets/csharp/BuyBtc.cs
Normal file
19
snippets/csharp/BuyBtc.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Breez.Sdk;
|
||||
|
||||
public class BuyBtcSnippets
|
||||
{
|
||||
public void BuyBtc(BlockingBreezServices sdk)
|
||||
{
|
||||
// ANCHOR: buy-btc
|
||||
try
|
||||
{
|
||||
var buyBitcoinResponse = sdk.BuyBitcoin(
|
||||
new BuyBitcoinRequest(BuyBitcoinProvider.MOONPAY));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Handle error
|
||||
}
|
||||
// ANCHOR_END: buy-btc
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user