mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 22:04:21 +01:00
31 lines
676 B
Swift
31 lines
676 B
Swift
//
|
|
// ConnectingLsp.swift
|
|
//
|
|
//
|
|
// Created by ruben on 14/11/2023.
|
|
//
|
|
|
|
import Foundation
|
|
import BreezSDK
|
|
|
|
func getLspInfo(sdk: BlockingBreezServices) -> LspInformation?{
|
|
// ANCHOR: get-lsp-info
|
|
let lspId = try? sdk.lspId()
|
|
let lspInfo = try? sdk.lspInfo()
|
|
// ANCHOR_END: get-lsp-info
|
|
return lspInfo
|
|
}
|
|
|
|
func listLsps(sdk: BlockingBreezServices) -> [LspInformation]? {
|
|
// ANCHOR: list-lsps
|
|
let availableLsps = try? sdk.listLsps()
|
|
// ANCHOR_END: list-lsps
|
|
return availableLsps
|
|
}
|
|
|
|
func connectLsp(sdk: BlockingBreezServices, lspId: String) {
|
|
// ANCHOR: connect-lsp
|
|
try? sdk.connectLsp(lspId: lspId)
|
|
// ANCHOR_END: connect-lsp
|
|
}
|