mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-18 22:34:19 +01:00
Fix some layout and typo issues
This commit is contained in:
@@ -3,12 +3,13 @@
|
|||||||
<custom-tabs category="lang">
|
<custom-tabs category="lang">
|
||||||
<div slot="title">Swift</div>
|
<div slot="title">Swift</div>
|
||||||
<section>
|
<section>
|
||||||
|
|
||||||
Based on the API key provided to the Breez SDK, a default LSP is selected for your node to provide liquidity to it. To get the information about the selected LSP you can do the following:
|
Based on the API key provided to the Breez SDK, a default LSP is selected for your node to provide liquidity to it. To get the information about the selected LSP you can do the following:
|
||||||
|
|
||||||
```swift
|
```swift
|
||||||
do {
|
do {
|
||||||
let lspId = let lspId = try sdk.lspId()
|
let lspId = try sdk.lspId()
|
||||||
let lspInfo = try sdk.fetchLspInfo(lspId: lspID!)
|
let lspInfo = try sdk.fetchLspInfo(lspId: lspId!)
|
||||||
} catch {
|
} catch {
|
||||||
// Handle error
|
// Handle error
|
||||||
}
|
}
|
||||||
@@ -18,7 +19,7 @@ When you have selected an LSP you may then connect to it.
|
|||||||
|
|
||||||
```swift
|
```swift
|
||||||
do {
|
do {
|
||||||
try sdk.connectLsp(lspId: lspID!)
|
try sdk.connectLsp(lspId: lspId!)
|
||||||
} catch {
|
} catch {
|
||||||
// Handle error
|
// Handle error
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,11 +26,10 @@ try {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
</section>
|
</section>
|
||||||
<div slot="title">python</div>
|
<div slot="title">Python</div>
|
||||||
<section>
|
<section>
|
||||||
|
|
||||||
|
|
||||||
In order to list the availiable fiat currencies.
|
In order to list the availiable fiat currencies.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
try:
|
try:
|
||||||
fiat_currencies = sdk_services.list_fiat_currencies()
|
fiat_currencies = sdk_services.list_fiat_currencies()
|
||||||
@@ -43,7 +42,7 @@ To get the current BTC rate for the currencies.
|
|||||||
|
|
||||||
```python
|
```python
|
||||||
try:
|
try:
|
||||||
fiat_rates = sdk_services.sdk_services.fetch_fiat_rates()
|
fiat_rates = sdk_services.fetch_fiat_rates()
|
||||||
# print your desired rate
|
# print your desired rate
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
# Handle error
|
# Handle error
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ try {
|
|||||||
// Connect to the Breez SDK make it ready for use
|
// Connect to the Breez SDK make it ready for use
|
||||||
const sdkServices = await connect(config, seed);
|
const sdkServices = await connect(config, seed);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ try {
|
|||||||
const lnBalance = nodeInfo.channelsBalanceMsat;
|
const lnBalance = nodeInfo.channelsBalanceMsat;
|
||||||
const onchainBalance = nodeInfo.onchainBalanceMsat;
|
const onchainBalance = nodeInfo.onchainBalanceMsat;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ do {
|
|||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
try {
|
try {
|
||||||
const swapInfo = await receiveOnchain();
|
const swapInfo = await receiveOnchain()
|
||||||
|
|
||||||
// Send your funds to the below bitcoin address
|
// Send your funds to the below bitcoin address
|
||||||
const address = swapInfo.bitcoinAddress;
|
const address = swapInfo.bitcoinAddress;
|
||||||
@@ -352,7 +352,7 @@ func calculateChannelOpeningFee(amountMsats: Int64) -> Int64? {
|
|||||||
return calculateFeesForAmount(amountMsats: amountMsats)
|
return calculateFeesForAmount(amountMsats: amountMsats)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
How to detect if open channel fees are needed:
|
How to detect if open channel fees are needed:
|
||||||
@@ -364,12 +364,11 @@ func isChannelOpeningFeeNeeded(amountMsats: Int64) -> Bool {
|
|||||||
if let inboundLiquidityMsats = nodeInfo?.inboundLiquidityMsats {
|
if let inboundLiquidityMsats = nodeInfo?.inboundLiquidityMsats {
|
||||||
return inboundLiquidityMsats <= amountMsats
|
return inboundLiquidityMsats <= amountMsats
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch {
|
} catch {
|
||||||
// Handle error
|
// Handle error
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
LSP fees are calculated in two ways, either by a minimum fee set by the LSP or by a fee per myriad calculated based on the amount being received. If the fee calculated from the fee per myriad is less than the minimum fee, the minimum fee is used.
|
LSP fees are calculated in two ways, either by a minimum fee set by the LSP or by a fee per myriad calculated based on the amount being received. If the fee calculated from the fee per myriad is less than the minimum fee, the minimum fee is used.
|
||||||
|
|||||||
Reference in New Issue
Block a user