From db739dd3e833d86b259a4cac644b3dcbe24cd9da Mon Sep 17 00:00:00 2001 From: Roei Erez Date: Wed, 13 Dec 2023 11:04:22 +0200 Subject: [PATCH] fix formatting --- snippets/csharp/ReceiveOnchain.cs | 132 ++++++++++++------------- snippets/python/src/receive_onchain.py | 4 +- 2 files changed, 68 insertions(+), 68 deletions(-) diff --git a/snippets/csharp/ReceiveOnchain.cs b/snippets/csharp/ReceiveOnchain.cs index 8ad18dd..5110ad1 100644 --- a/snippets/csharp/ReceiveOnchain.cs +++ b/snippets/csharp/ReceiveOnchain.cs @@ -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 - } } diff --git a/snippets/python/src/receive_onchain.py b/snippets/python/src/receive_onchain.py index 34ba3b2..4922e06 100644 --- a/snippets/python/src/receive_onchain.py +++ b/snippets/python/src/receive_onchain.py @@ -7,8 +7,8 @@ def generate_receive_onchain_address(sdk_services): # Send your funds to the below bitcoin address address = swap_info.bitcoin_address - print("Minimum amount allowed to deposit in sats: {}", swap_info.min_allowed_deposit) - print("Maximum amount allowed to deposit in sats: {}", swap_info.max_allowed_deposit) + print("Minimum amount allowed to deposit in sats:", swap_info.min_allowed_deposit) + print("Maximum amount allowed to deposit in sats:", swap_info.max_allowed_deposit) # ANCHOR_END: generate-receive-onchain-address except Exception as error: print(error)