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:
@@ -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"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -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.
|
||||
|
||||
27
snippets/swift/BreezSDKExamples/Sources/ServiceStatus.swift
Normal file
27
snippets/swift/BreezSDKExamples/Sources/ServiceStatus.swift
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user