Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Swift CI warnings #126

Merged
merged 13 commits into from
Jan 31, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ func getLspInfo(sdk: BlockingBreezServices) -> LspInformation? {
let lspId = try? sdk.lspId()
let lspInfo = try? sdk.lspInfo()
// ANCHOR_END: get-lsp-info
print(lspId as Any)
return lspInfo
}

Expand Down
3 changes: 2 additions & 1 deletion snippets/swift/BreezSDKExamples/Sources/GettingStarted.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ func gettingStarted() throws -> BlockingBreezServices? {
}

// ANCHOR_END: init-sdk

func gettingStartedNodeInfo(sdk: BlockingBreezServices) {
// ANCHOR: fetch-balance
if let nodeInfo = try? sdk.nodeInfo() {
let lnBalance = nodeInfo.channelsBalanceMsat
let onchainBalance = nodeInfo.onchainBalanceMsat
print(lnBalance);
print(onchainBalance);
}
// ANCHOR_END: fetch-balance
}
8 changes: 7 additions & 1 deletion snippets/swift/BreezSDKExamples/Sources/LnurlWithdraw.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ func withdraw(sdk: BlockingBreezServices) -> LnUrlWithdrawResult? {
if case let .lnUrlWithdraw(data) = inputType {
let amountMsat = data.maxWithdrawable
let description = "Test withdraw"
response = try? sdk.withdrawLnurl(request: LnUrlWithdrawRequest(data: data, amountMsat: amountMsat))
response = try? sdk.withdrawLnurl(
request: LnUrlWithdrawRequest(
data: data,
amountMsat: amountMsat,
description: description
)
)
}
}
// ANCHOR_END: lnurl-withdraw
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ func receivePayment(sdk: BlockingBreezServices) -> ReceivePaymentResponse? {

let invoice = receivePaymentResponse?.lnInvoice;
// ANCHOR_END: receive-payment
print(invoice as Any)
return receivePaymentResponse
}
8 changes: 4 additions & 4 deletions snippets/swift/BreezSDKExamples/Sources/ServiceStatus.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
import BreezSDK
import Foundation

func getServiceStatus(sdk: BlockingBreezServices) -> ServiceHealthCheckResponse? {
func getServiceStatus(sdk: BlockingBreezServices) {
// ANCHOR: health-check-status
let healthCheck = try? sdk.serviceHealthCheck()
print("Current service status is: \(healthCheck?.status)")
if let healthCheck = try? sdk.serviceHealthCheck() {
print("Current service status is: \(healthCheck.status)")
}
// ANCHOR_END: health-check-status
return healthCheck
}

func reportPaymentFailure(sdk: BlockingBreezServices) {
Expand Down
Loading