Merge pull request #104 from breez/savage-service-status

Update 0.2.10 & add service status page
This commit is contained in:
Roei Erez
2023-11-27 17:27:25 +02:00
committed by GitHub
20 changed files with 379 additions and 42 deletions

View File

@@ -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")
}
}
}

View File

@@ -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
}
}