Change send_paymenet to use to msat

This commit is contained in:
Roei Erez
2023-10-18 09:24:30 +03:00
committed by Erdem Yerebasmaz
parent 04a91ade4b
commit f717da5915

View File

@@ -18,9 +18,9 @@ sdk.send_payment(bolt11.into(), None).await?;
```swift ```swift
let bolt11 = "..."; let bolt11 = "...";
do { do {
// The `amountSats` param is optional so nil can be passed if the // The `amount_msat` param is optional and should only passed if the bolt11 doesn't specify an amount.
// bolt11 invoice spesifies an amount. // The amount_msat is required in case an amount is not specified in the bolt11 invoice'.
let payment = try sdk.sendPayment(bolt11: bolt11, amountSats: 3000) let payment = try sdk.sendPayment(bolt11: bolt11, amount_msat: 3000)
} catch { } catch {
// handle error // handle error
} }
@@ -61,7 +61,7 @@ String bolt11 = "...";
try { try {
Payment payment = await sendPayment( Payment payment = await sendPayment(
bolt11: bolt11, bolt11: bolt11,
amountSats: 3000, amount_msat: 3000,
); );
} catch (error) { } catch (error) {
// handle error // handle error
@@ -75,9 +75,9 @@ try {
```python ```python
bolt11 = "..." bolt11 = "..."
try: try:
# The `amountSats` param is optional so None can be passed if the # The `amount_msat` param is optional and should only passed if the bolt11 doesn't specify an amount.
# bolt11 invoice spesifies an amount. # The amount_msat is required in case an amount is not specified in the bolt11 invoice'.
sdk_services.send_payment(bolt11=bolt11, amount_sats=None) sdk_services.send_payment(bolt11=bolt11, amount_msat=None)
except Exception as error: except Exception as error:
# Handle error # Handle error
``` ```
@@ -88,8 +88,8 @@ except Exception as error:
```go ```go
bolt11 := "bolt11 invoice" bolt11 := "bolt11 invoice"
amountSats := uint64(3000) amount_msat := uint64(3000)
if payment, err := sdk.SendPayment(bolt11, &amountSats); err == nil { if payment, err := sdk.SendPayment(bolt11, &amount_msat); err == nil {
log.Printf("%#v", payment) log.Printf("%#v", payment)
} }
``` ```