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

@@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/breez/breez-sdk-swift",
"state" : {
"revision" : "dcbb39d45bc6797447bf20f52bc22344026d0662",
"version" : "0.2.9"
"revision" : "74402afba8218ff84a0f32d1bc0d4ddc7698f576",
"version" : "0.2.10"
}
},
{

View File

@@ -8,7 +8,7 @@ let package = Package(
platforms: [.macOS(.v12)],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.2.3"),
.package(url: "https://github.com/breez/breez-sdk-swift", from:"0.2.9")
.package(url: "https://github.com/breez/breez-sdk-swift", from:"0.2.10")
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.

View File

@@ -0,0 +1,27 @@
//
// ServiceStatus.swift
//
//
// Created by dangeross on 27/11/2023.
//
import Foundation
import BreezSDK
func getServiceStatus(sdk: BlockingBreezServices) -> ServiceHealthCheckResponse? {
// ANCHOR: health-check-status
let healthCheck = try? sdk.serviceHealthCheck()
print("Current service status is: \(healthCheck?.status)")
// ANCHOR_END: health-check-status
return healthCheck
}
func reportPaymentFailure(sdk: BlockingBreezServices) {
// ANCHOR: report-payment-failure
let paymentHash = "..."
try? sdk.reportIssue(
req: ReportIssueRequest.paymentFailure(
data: ReportPaymentFailureDetails(paymentHash: paymentHash)))
// ANCHOR_END: report-payment-failure
}