diff --git a/src/guide/receive_payment.md b/src/guide/receive_payment.md index 162251e..b479b4d 100644 --- a/src/guide/receive_payment.md +++ b/src/guide/receive_payment.md @@ -68,3 +68,77 @@ The Breez SDK automatically connects your node to the LSP peer and you can now r ``` + +# Calculating fees + +When the amount to be received exceeds the inbound liquidity of the node, a new channel will be opened by the LSP in order for the node to receive it. This can checked by retrieving the NodeState from the SDK and comparing the inbound liquidity to the amount to be received. If the amount is greater or equal to the inbound liquidity, a new channel opening is required. + +To calculate the fees for a channel being opened by the LSP: + + +
Rust
+
+ +```rust,ignore +{{#include ../../snippets/rust/src/receive_onchain.rs:get-channel-opening-fees}} +``` +
+ +
Swift
+
+ +```swift,ignore +{{#include ../../snippets/swift/BreezSDKExamples/Sources/ReceiveOnchain.swift:get-channel-opening-fees}} +``` +
+ +
Kotlin
+
+ +```kotlin,ignore +{{#include ../../snippets/kotlin_mpp_lib/shared/src/commonMain/kotlin/com/example/kotlinmpplib/ReceiveOnchain.kt:get-channel-opening-fees}} +``` +
+ +
React Native
+
+ +```typescript +{{#include ../../snippets/react-native/receive_onchain.ts:get-channel-opening-fees}} +``` +
+ +
Dart
+
+ +```dart,ignore +{{#include ../../snippets/dart_snippets/lib/receive_onchain.dart:get-channel-opening-fees}} +``` +
+ +
Python
+
+ +```python,ignore +{{#include ../../snippets/python/src/receive_onchain.py:get-channel-opening-fees}} +``` +
+ +
Go
+
+ +```go,ignore +{{#include ../../snippets/go/receive_onchain.go:get-channel-opening-fees}} +``` +
+ +
C#
+
+ +```cs,ignore +{{#include ../../snippets/csharp/ReceiveOnchain.cs:get-channel-opening-fees}} +``` +
+
+ +[^1]: For more details on these fees, see [Channel Opening Fees](connecting_lsp.md#channel-opening-fees)