fix tab size

This commit is contained in:
Roei Erez
2023-11-26 08:53:16 +02:00
parent 790d1784a4
commit e134d60ea6

View File

@@ -1,60 +1,60 @@
import { import {
type ReverseSwapPairInfo, type ReverseSwapPairInfo,
fetchReverseSwapFees, fetchReverseSwapFees,
inProgressReverseSwaps, inProgressReverseSwaps,
sendOnchain sendOnchain
} from '@breeztech/react-native-breez-sdk' } from '@breeztech/react-native-breez-sdk'
const exampleFetchReverseSwapFees = async () => { const exampleFetchReverseSwapFees = async () => {
// ANCHOR: estimate-current-reverse-swap-total-fees // ANCHOR: estimate-current-reverse-swap-total-fees
const currentFees = await fetchReverseSwapFees({ sendAmountSat: 50000 }) const currentFees = await fetchReverseSwapFees({ sendAmountSat: 50000 })
console.log( console.log(
`Total estimated fees for reverse swap: ${currentFees.totalEstimatedFees}` `Total estimated fees for reverse swap: ${currentFees.totalEstimatedFees}`
) )
// ANCHOR_END: estimate-current-reverse-swap-total-fees // ANCHOR_END: estimate-current-reverse-swap-total-fees
} }
const exampleListCurrentFees = (currentFees: ReverseSwapPairInfo) => { const exampleListCurrentFees = (currentFees: ReverseSwapPairInfo) => {
// ANCHOR: get-current-reverse-swap-min-max // ANCHOR: get-current-reverse-swap-min-max
console.log(`Minimum amount, in sats: ${currentFees.min}`) console.log(`Minimum amount, in sats: ${currentFees.min}`)
console.log(`Maximum amount, in sats: ${currentFees.max}`) console.log(`Maximum amount, in sats: ${currentFees.max}`)
// ANCHOR_END: get-current-reverse-swap-min-max // ANCHOR_END: get-current-reverse-swap-min-max
} }
const maxReverseSwapAmount = async () => { const maxReverseSwapAmount = async () => {
// ANCHOR: max-reverse-swap-amount // ANCHOR: max-reverse-swap-amount
const maxAmount = await maxReverseSwapAmount() const maxAmount = await maxReverseSwapAmount()
console.log( console.log(
`Max reverse swap amount: ${maxAmount.totalSat}` `Max reverse swap amount: ${maxAmount.totalSat}`
) )
// ANCHOR_END: max-reverse-swap-amount // ANCHOR_END: max-reverse-swap-amount
} }
const exampleSendOnchain = async (currentFees: ReverseSwapPairInfo) => { const exampleSendOnchain = async (currentFees: ReverseSwapPairInfo) => {
// ANCHOR: start-reverse-swap // ANCHOR: start-reverse-swap
const onchainRecipientAddress = 'bc1..' const onchainRecipientAddress = 'bc1..'
const amountSat = currentFees.min const amountSat = currentFees.min
const satPerVbyte = 5 const satPerVbyte = 5
const reverseSwapInfo = await sendOnchain({ const reverseSwapInfo = await sendOnchain({
amountSat, amountSat,
onchainRecipientAddress, onchainRecipientAddress,
pairHash: currentFees.feesHash, pairHash: currentFees.feesHash,
satPerVbyte satPerVbyte
}) })
// ANCHOR_END: start-reverse-swap // ANCHOR_END: start-reverse-swap
} }
const exampleInProgressReverseSwaps = async () => { const exampleInProgressReverseSwaps = async () => {
// ANCHOR: check-reverse-swaps-status // ANCHOR: check-reverse-swaps-status
const swaps = await inProgressReverseSwaps() const swaps = await inProgressReverseSwaps()
for (const swap of swaps) { for (const swap of swaps) {
console.log( console.log(
`Reverse swap ${swap.id} in progress, status is ${swap.status}` `Reverse swap ${swap.id} in progress, status is ${swap.status}`
) )
} }
// ANCHOR_END: check-reverse-swaps-status // ANCHOR_END: check-reverse-swaps-status
} }