mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 13:54:20 +01:00
fix formatting
This commit is contained in:
@@ -2,84 +2,84 @@ using Breez.Sdk;
|
||||
|
||||
public class ReceiveOnchainSnippets
|
||||
{
|
||||
public void ReceiveOnchain(BlockingBreezServices sdk)
|
||||
{
|
||||
// ANCHOR: generate-receive-onchain-address
|
||||
try
|
||||
public void ReceiveOnchain(BlockingBreezServices sdk)
|
||||
{
|
||||
var swapInfo = sdk.ReceiveOnchain(new ReceiveOnchainRequest());
|
||||
// Send your funds to the below bitcoin address
|
||||
var address = swapInfo.bitcoinAddress;
|
||||
Console.WriteLine($"Minimum amount allowed to deposit in sats: {swapInfo.minAllowedDeposit}");
|
||||
Console.WriteLine($"Maximum amount allowed to deposit in sats: {swapInfo.maxAllowedDeposit}");
|
||||
// ANCHOR: generate-receive-onchain-address
|
||||
try
|
||||
{
|
||||
var swapInfo = sdk.ReceiveOnchain(new ReceiveOnchainRequest());
|
||||
// Send your funds to the below bitcoin address
|
||||
var address = swapInfo.bitcoinAddress;
|
||||
Console.WriteLine($"Minimum amount allowed to deposit in sats: {swapInfo.minAllowedDeposit}");
|
||||
Console.WriteLine($"Maximum amount allowed to deposit in sats: {swapInfo.maxAllowedDeposit}");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Handle error
|
||||
}
|
||||
// ANCHOR_END: generate-receive-onchain-address
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Handle error
|
||||
}
|
||||
// ANCHOR_END: generate-receive-onchain-address
|
||||
}
|
||||
|
||||
public void GetInProgressSwap(BlockingBreezServices sdk)
|
||||
{
|
||||
// ANCHOR: in-progress-swap
|
||||
try
|
||||
public void GetInProgressSwap(BlockingBreezServices sdk)
|
||||
{
|
||||
var swapInfo = sdk.InProgressSwap();
|
||||
// ANCHOR: in-progress-swap
|
||||
try
|
||||
{
|
||||
var swapInfo = sdk.InProgressSwap();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Handle error
|
||||
}
|
||||
// ANCHOR_END: in-progress-swap
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Handle error
|
||||
}
|
||||
// ANCHOR_END: in-progress-swap
|
||||
}
|
||||
|
||||
public void ListRefundables(BlockingBreezServices sdk)
|
||||
{
|
||||
// ANCHOR: list-refundables
|
||||
try
|
||||
public void ListRefundables(BlockingBreezServices sdk)
|
||||
{
|
||||
var refundables = sdk.ListRefundables();
|
||||
// ANCHOR: list-refundables
|
||||
try
|
||||
{
|
||||
var refundables = sdk.ListRefundables();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Handle error
|
||||
}
|
||||
// ANCHOR_END: list-refundables
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Handle error
|
||||
}
|
||||
// ANCHOR_END: list-refundables
|
||||
}
|
||||
|
||||
public void ExecuteRefund(BlockingBreezServices sdk, uint refundTxFeeRate, SwapInfo refundable)
|
||||
{
|
||||
// ANCHOR: execute-refund
|
||||
var destinationAddress = "...";
|
||||
var satPerVbyte = refundTxFeeRate;
|
||||
try
|
||||
public void ExecuteRefund(BlockingBreezServices sdk, uint refundTxFeeRate, SwapInfo refundable)
|
||||
{
|
||||
var result = sdk.Refund(
|
||||
new RefundRequest(
|
||||
refundable.bitcoinAddress,
|
||||
destinationAddress,
|
||||
satPerVbyte));
|
||||
// ANCHOR: execute-refund
|
||||
var destinationAddress = "...";
|
||||
var satPerVbyte = refundTxFeeRate;
|
||||
try
|
||||
{
|
||||
var result = sdk.Refund(
|
||||
new RefundRequest(
|
||||
refundable.bitcoinAddress,
|
||||
destinationAddress,
|
||||
satPerVbyte));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Handle error
|
||||
}
|
||||
// ANCHOR_END: execute-refund
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Handle error
|
||||
}
|
||||
// ANCHOR_END: execute-refund
|
||||
}
|
||||
|
||||
public void GetChannelOpeningFees(BlockingBreezServices sdk, ulong amountMsat)
|
||||
{
|
||||
// ANCHOR: get-channel-opening-fees
|
||||
try
|
||||
public void GetChannelOpeningFees(BlockingBreezServices sdk, ulong amountMsat)
|
||||
{
|
||||
var channelFees = sdk.OpenChannelFee(
|
||||
new OpenChannelFeeRequest(amountMsat));
|
||||
// ANCHOR: get-channel-opening-fees
|
||||
try
|
||||
{
|
||||
var channelFees = sdk.OpenChannelFee(
|
||||
new OpenChannelFeeRequest(amountMsat));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Handle error
|
||||
}
|
||||
// ANCHOR_END: get-channel-opening-fees
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Handle error
|
||||
}
|
||||
// ANCHOR_END: get-channel-opening-fees
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user