From e134d60ea6ceeacc2d3b9c6c68f48b85d8afee06 Mon Sep 17 00:00:00 2001 From: Roei Erez Date: Sun, 26 Nov 2023 08:53:16 +0200 Subject: [PATCH] fix tab size --- snippets/react-native/send_onchain.ts | 78 +++++++++++++-------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/snippets/react-native/send_onchain.ts b/snippets/react-native/send_onchain.ts index 95a98af..1785f3a 100644 --- a/snippets/react-native/send_onchain.ts +++ b/snippets/react-native/send_onchain.ts @@ -1,60 +1,60 @@ import { - type ReverseSwapPairInfo, - fetchReverseSwapFees, - inProgressReverseSwaps, - sendOnchain + type ReverseSwapPairInfo, + fetchReverseSwapFees, + inProgressReverseSwaps, + sendOnchain } from '@breeztech/react-native-breez-sdk' const exampleFetchReverseSwapFees = async () => { - // ANCHOR: estimate-current-reverse-swap-total-fees - const currentFees = await fetchReverseSwapFees({ sendAmountSat: 50000 }) + // ANCHOR: estimate-current-reverse-swap-total-fees + const currentFees = await fetchReverseSwapFees({ sendAmountSat: 50000 }) - console.log( - `Total estimated fees for reverse swap: ${currentFees.totalEstimatedFees}` - ) - // ANCHOR_END: estimate-current-reverse-swap-total-fees + console.log( + `Total estimated fees for reverse swap: ${currentFees.totalEstimatedFees}` + ) + // ANCHOR_END: estimate-current-reverse-swap-total-fees } const exampleListCurrentFees = (currentFees: ReverseSwapPairInfo) => { - // ANCHOR: get-current-reverse-swap-min-max - console.log(`Minimum amount, in sats: ${currentFees.min}`) - console.log(`Maximum amount, in sats: ${currentFees.max}`) - // ANCHOR_END: get-current-reverse-swap-min-max + // ANCHOR: get-current-reverse-swap-min-max + console.log(`Minimum amount, in sats: ${currentFees.min}`) + console.log(`Maximum amount, in sats: ${currentFees.max}`) + // ANCHOR_END: get-current-reverse-swap-min-max } const maxReverseSwapAmount = async () => { - // ANCHOR: max-reverse-swap-amount - const maxAmount = await maxReverseSwapAmount() + // ANCHOR: max-reverse-swap-amount + const maxAmount = await maxReverseSwapAmount() - console.log( - `Max reverse swap amount: ${maxAmount.totalSat}` - ) - // ANCHOR_END: max-reverse-swap-amount + console.log( + `Max reverse swap amount: ${maxAmount.totalSat}` + ) + // ANCHOR_END: max-reverse-swap-amount } const exampleSendOnchain = async (currentFees: ReverseSwapPairInfo) => { - // ANCHOR: start-reverse-swap - const onchainRecipientAddress = 'bc1..' - const amountSat = currentFees.min - const satPerVbyte = 5 + // ANCHOR: start-reverse-swap + const onchainRecipientAddress = 'bc1..' + const amountSat = currentFees.min + const satPerVbyte = 5 - const reverseSwapInfo = await sendOnchain({ - amountSat, - onchainRecipientAddress, - pairHash: currentFees.feesHash, - satPerVbyte - }) - // ANCHOR_END: start-reverse-swap + const reverseSwapInfo = await sendOnchain({ + amountSat, + onchainRecipientAddress, + pairHash: currentFees.feesHash, + satPerVbyte + }) + // ANCHOR_END: start-reverse-swap } const exampleInProgressReverseSwaps = async () => { - // ANCHOR: check-reverse-swaps-status - const swaps = await inProgressReverseSwaps() - for (const swap of swaps) { - console.log( - `Reverse swap ${swap.id} in progress, status is ${swap.status}` - ) - } - // ANCHOR_END: check-reverse-swaps-status + // ANCHOR: check-reverse-swaps-status + const swaps = await inProgressReverseSwaps() + for (const swap of swaps) { + console.log( + `Reverse swap ${swap.id} in progress, status is ${swap.status}` + ) + } + // ANCHOR_END: check-reverse-swaps-status }