mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 05:44:20 +01:00
Merge pull request #104 from breez/savage-service-status
Update 0.2.10 & add service status page
This commit is contained in:
@@ -34,7 +34,7 @@ kotlin {
|
||||
}
|
||||
val commonMain by getting {
|
||||
dependencies {
|
||||
implementation("technology.breez:breez-sdk-kmp:0.2.9")
|
||||
implementation("technology.breez:breez-sdk-kmp:0.2.10")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.example.kotlinmpplib
|
||||
|
||||
import breez_sdk.*
|
||||
class ServiceStatus {
|
||||
fun HealthCheckStatus(sdk: BlockingBreezServices) {
|
||||
// ANCHOR: health-check-status
|
||||
try {
|
||||
val healthCheck = sdk.serviceHealthCheck()
|
||||
// Log.v("Breez", "Current service status is: ${healthCheck.status}")
|
||||
} catch (e: Exception) {
|
||||
// Handle error
|
||||
}
|
||||
// ANCHOR_END: health-check-status
|
||||
}
|
||||
|
||||
fun reportPaymentFailure(sdk: BlockingBreezServices) {
|
||||
// ANCHOR: report-payment-failure
|
||||
val paymentHash = "..."
|
||||
try {
|
||||
sdk.reportIssue(ReportIssueRequest.PaymentFailure(
|
||||
ReportPaymentFailureDetails(paymentHash)))
|
||||
} catch (e: Exception) {
|
||||
// Handle error
|
||||
}
|
||||
// ANCHOR_END: report-payment-failure
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user