move receive_payment docs to msat

This commit is contained in:
Jesse de Wit
2023-10-20 10:25:14 +02:00
parent c719cc4ae6
commit 2d663e901a

View File

@@ -1,6 +1,6 @@
# Receiving Lightning Payments # Receiving Lightning Payments
With the Breez SDK you arn't required to open a channel and set up your inbound liquidity. With the Breez SDK you aren't required to open a channel and set up your inbound liquidity.
The Breez SDK automatically connects your node to the LSP peer and you can now receive payments. The Breez SDK automatically connects your node to the LSP peer and you can now receive payments.
<custom-tabs category="lang"> <custom-tabs category="lang">
@@ -10,7 +10,7 @@ The Breez SDK automatically connects your node to the LSP peer and you can now r
```rust,ignore ```rust,ignore
let res = sdk.receive_payment( let res = sdk.receive_payment(
ReceivePaymentRequest { ReceivePaymentRequest {
amount_sats: 3000, amount_msat: 3_000_000,
description: "Invoice for 3000 sats".into(), description: "Invoice for 3000 sats".into(),
cltv: None, cltv: None,
expiry: None, expiry: None,
@@ -28,8 +28,8 @@ let res = sdk.receive_payment(
```swift ```swift
do { do {
let invoice = try sdk.receivePayment( let invoice = try sdk.receivePayment(
reqData: ReceivePaymentRequest( req: ReceivePaymentRequest(
amountSats: 3000, amountMsat: 3_000_000,
description: "Invoice for 3000 sats")) description: "Invoice for 3000 sats"))
} catch { } catch {
// handle error // handle error
@@ -43,7 +43,7 @@ do {
```kotlin,ignore ```kotlin,ignore
try { try {
val invoice = sdk.receivePayment(ReceivePaymentRequest( val invoice = sdk.receivePayment(ReceivePaymentRequest(
3000L.toULong(), 3_000_000L.toULong(),
"Invoice for 3000 sats", "Invoice for 3000 sats",
)) ))
} catch (e: Exception) { } catch (e: Exception) {
@@ -58,7 +58,7 @@ try {
```typescript ```typescript
try { try {
const invoice = await receivePayment({ const invoice = await receivePayment({
amountSats: 3000, amountMsat: 3_000_000,
description: "Invoice for 3000 sats" description: "Invoice for 3000 sats"
}) })
} catch (error) { } catch (error) {
@@ -73,8 +73,8 @@ try {
```dart ```dart
try { try {
ReceivePaymentResponse invoice = await receivePayment( ReceivePaymentResponse invoice = await receivePayment(
reqData: ReceivePaymentRequest( req: ReceivePaymentRequest(
amountSats: 3000, amountMsat: 3_000_000,
description: "Invoice for 3000 sats", description: "Invoice for 3000 sats",
), ),
); );
@@ -91,7 +91,7 @@ try {
try: try:
receive_payment_response = sdk_services.receive_payment( receive_payment_response = sdk_services.receive_payment(
breez_sdk.ReceivePaymentRequest( breez_sdk.ReceivePaymentRequest(
amount_sats=3000, amount_msat=3_000_000,
description="Invoice for 3000 sats")) description="Invoice for 3000 sats"))
except Exception as error: except Exception as error:
# Handle error # Handle error
@@ -103,7 +103,7 @@ except Exception as error:
```go ```go
receivePaymentRequest := breez_sdk.ReceivePaymentRequest{ receivePaymentRequest := breez_sdk.ReceivePaymentRequest{
AmountSats: 3000, AmountMsat: 3_000_000,
Description: "Invoice for 3000 sats", Description: "Invoice for 3000 sats",
} }
if receivePaymentResponse, err := sdk.ReceivePayment(receivePaymentRequest); err == nil { if receivePaymentResponse, err := sdk.ReceivePayment(receivePaymentRequest); err == nil {
@@ -119,7 +119,7 @@ if receivePaymentResponse, err := sdk.ReceivePayment(receivePaymentRequest); err
try try
{ {
var invoice = sdk.ReceivePayment( var invoice = sdk.ReceivePayment(
new ReceivePaymentRequest(3000, "Invoice for 3000 sats")); new ReceivePaymentRequest(3_000_000, "Invoice for 3000 sats"));
} }
catch (Exception) catch (Exception)
{ {