mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 22:04:21 +01:00
Fix linter warnings for Swift snippets
This commit is contained in:
@@ -13,6 +13,7 @@ func getLspInfo(sdk: BlockingBreezServices) -> LspInformation?{
|
|||||||
let lspId = try? sdk.lspId()
|
let lspId = try? sdk.lspId()
|
||||||
let lspInfo = try? sdk.lspInfo()
|
let lspInfo = try? sdk.lspInfo()
|
||||||
// ANCHOR_END: get-lsp-info
|
// ANCHOR_END: get-lsp-info
|
||||||
|
print(lspId as Any)
|
||||||
return lspInfo
|
return lspInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,12 +38,13 @@ func gettingStarted() throws -> BlockingBreezServices? {
|
|||||||
return sdk
|
return sdk
|
||||||
}
|
}
|
||||||
// ANCHOR_END: init-sdk
|
// ANCHOR_END: init-sdk
|
||||||
|
|
||||||
func gettingStartedNodeInfo(sdk: BlockingBreezServices) {
|
func gettingStartedNodeInfo(sdk: BlockingBreezServices) {
|
||||||
// ANCHOR: fetch-balance
|
// ANCHOR: fetch-balance
|
||||||
if let nodeInfo = try? sdk.nodeInfo() {
|
if let nodeInfo = try? sdk.nodeInfo() {
|
||||||
let lnBalance = nodeInfo.channelsBalanceMsat
|
let lnBalance = nodeInfo.channelsBalanceMsat
|
||||||
let onchainBalance = nodeInfo.onchainBalanceMsat
|
let onchainBalance = nodeInfo.onchainBalanceMsat
|
||||||
|
print(lnBalance);
|
||||||
|
print(onchainBalance);
|
||||||
}
|
}
|
||||||
// ANCHOR_END: fetch-balance
|
// ANCHOR_END: fetch-balance
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,13 @@ func withdraw(sdk: BlockingBreezServices) -> LnUrlWithdrawResult? {
|
|||||||
if case.lnUrlWithdraw(let `data`) = inputType {
|
if case.lnUrlWithdraw(let `data`) = inputType {
|
||||||
let amountMsat = data.maxWithdrawable
|
let amountMsat = data.maxWithdrawable
|
||||||
let description = "Test withdraw"
|
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
|
// ANCHOR_END: lnurl-withdraw
|
||||||
|
|||||||
@@ -16,5 +16,6 @@ func receivePayment(sdk: BlockingBreezServices) -> ReceivePaymentResponse? {
|
|||||||
|
|
||||||
let invoice = receivePaymentResponse?.lnInvoice;
|
let invoice = receivePaymentResponse?.lnInvoice;
|
||||||
// ANCHOR_END: receive-payment
|
// ANCHOR_END: receive-payment
|
||||||
|
print(invoice as Any)
|
||||||
return receivePaymentResponse
|
return receivePaymentResponse
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,12 +8,12 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import BreezSDK
|
import BreezSDK
|
||||||
|
|
||||||
func getServiceStatus(sdk: BlockingBreezServices) -> ServiceHealthCheckResponse? {
|
func getServiceStatus(sdk: BlockingBreezServices) {
|
||||||
// ANCHOR: health-check-status
|
// ANCHOR: health-check-status
|
||||||
let healthCheck = try? sdk.serviceHealthCheck()
|
if let healthCheck = try? sdk.serviceHealthCheck() {
|
||||||
print("Current service status is: \(healthCheck?.status)")
|
print("Current service status is: \(healthCheck.status)")
|
||||||
|
}
|
||||||
// ANCHOR_END: health-check-status
|
// ANCHOR_END: health-check-status
|
||||||
return healthCheck
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func reportPaymentFailure(sdk: BlockingBreezServices) {
|
func reportPaymentFailure(sdk: BlockingBreezServices) {
|
||||||
|
|||||||
Reference in New Issue
Block a user