mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 22:04:21 +01:00
34 lines
707 B
TypeScript
34 lines
707 B
TypeScript
import { connectLsp, listLsps, lspId, lspInfo } from '@breeztech/react-native-breez-sdk'
|
|
|
|
const exampleAutoConnect = async () => {
|
|
// ANCHOR: get-lsp-info
|
|
try {
|
|
const id = await lspId()
|
|
const info = await lspInfo()
|
|
} catch (err) {
|
|
console.error(err)
|
|
}
|
|
// ANCHOR_END: get-lsp-info
|
|
}
|
|
|
|
const exampleListLsps = async () => {
|
|
// ANCHOR: list-lsps
|
|
try {
|
|
const availableLsps = await listLsps()
|
|
} catch (err) {
|
|
console.error(err)
|
|
}
|
|
// ANCHOR_END: list-lsps
|
|
}
|
|
|
|
const exampleManualConnect = async () => {
|
|
// ANCHOR: connect-lsp
|
|
try {
|
|
const id = 'your selected lsp id'
|
|
await connectLsp(id)
|
|
} catch (err) {
|
|
console.error(err)
|
|
}
|
|
// ANCHOR_END: connect-lsp
|
|
}
|