Skip to content

Commit 3ba17ad

Browse files
committed
feat: vss auth setup
1 parent 68361da commit 3ba17ad

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

app/src/main/java/to/bitkit/env/Env.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,15 @@ internal object Env {
4040
val vssServerUrl
4141
get() = when (network) {
4242
Network.BITCOIN -> TODO("VSS not implemented for mainnet")
43+
// Network.REGTEST -> "http://localhost:5050/vss"
4344
else -> "https://bitkit.stag0.blocktank.to/vss_rs/"
4445
}
4546

47+
val lnurlAuthSeverUrl = when (network) {
48+
// Network.REGTEST -> "http://localhost:3000/auth"
49+
else -> "" // TODO implement LNURL-auth Server for other networks
50+
}
51+
4652
val vssStoreId
4753
get() = when (network) {
4854
Network.REGTEST -> "bitkit_regtest"

app/src/main/java/to/bitkit/services/LightningService.kt

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,20 @@ class LightningService @Inject constructor(
113113

114114
ServiceQueue.LDK.background {
115115
node = try {
116-
builder.buildWithVssStoreAndFixedHeaders(
117-
vssUrl = Env.vssServerUrl,
118-
storeId = vssStoreId,
119-
fixedHeaders = emptyMap(),
120-
)
116+
if (Env.lnurlAuthSeverUrl.isNotBlank()) {
117+
builder.buildWithVssStore(
118+
vssUrl = Env.vssServerUrl,
119+
storeId = vssStoreId,
120+
lnurlAuthServerUrl = Env.lnurlAuthSeverUrl,
121+
fixedHeaders = emptyMap(),
122+
)
123+
} else {
124+
builder.buildWithVssStoreAndFixedHeaders(
125+
vssUrl = Env.vssServerUrl,
126+
storeId = vssStoreId,
127+
fixedHeaders = emptyMap(),
128+
)
129+
}
121130
} catch (e: BuildException) {
122131
throw LdkError(e)
123132
}

0 commit comments

Comments
 (0)