refactor: clean up LNbitsApi

This commit is contained in:
2026-06-12 12:14:01 +02:00
parent aaadd0d73f
commit 4694b6d44e
2 changed files with 8 additions and 8 deletions
@@ -15,7 +15,7 @@ interface LNbitsApi {
/** GET /api/v1/wallet — returns balance and wallet info */ /** GET /api/v1/wallet — returns balance and wallet info */
@GET("api/v1/wallet") @GET("api/v1/wallet")
suspend fun getWallet( suspend fun getWallet(
@Header("X-Api-Key") apiKey: String @Header("X-Api-Key") invoiceKey: String
): WalletResponse ): WalletResponse
/** POST /api/v1/payments — creates a BOLT-11 invoice */ /** POST /api/v1/payments — creates a BOLT-11 invoice */
@@ -44,10 +44,10 @@ interface LNbitsApi {
): PayInvoiceResponse ): PayInvoiceResponse
/** GET /api/v1/payments — returns payment history */ /** GET /api/v1/payments — returns payment history */
@GET("api/v1/payments") // @GET("api/v1/payments")
suspend fun getPayments( // suspend fun getPayments(
@Header("X-Api-Key") apiKey: String // @Header("X-Api-Key") apiKey: String
): List<WsPayment> // ): List<WsPayment>
/** GET /api/v1/payments/paginated — returns bulk payment history */ /** GET /api/v1/payments/paginated — returns bulk payment history */
@GET("api/v1/payments/paginated") @GET("api/v1/payments/paginated")
@@ -151,7 +151,7 @@ interface LNbitsApi {
@GET("nwcprovider/api/v1/permissions") @GET("nwcprovider/api/v1/permissions")
suspend fun getNwcPermissions( suspend fun getNwcPermissions(
@Header("X-Api-Key") apiKey: String @Header("X-Api-Key") invoiceKey: String
): Map<String, Any> ): Map<String, Any>
@GET("nwcprovider/api/v1/nwc") @GET("nwcprovider/api/v1/nwc")
@@ -183,7 +183,7 @@ interface LNbitsApi {
@GET("nwcprovider/api/v1/pairing/{secret}") @GET("nwcprovider/api/v1/pairing/{secret}")
suspend fun getNwcPairingUrl( suspend fun getNwcPairingUrl(
@Header("X-Api-Key") apiKey: String, @Header("X-Api-Key") invoiceKey: String,
@Path("secret") secret: String @Path("secret") secret: String
): String ): String
@@ -370,7 +370,7 @@ class LNbitsWalletRepository(
override suspend fun getNwcPairingUrl(secret: String): String { override suspend fun getNwcPairingUrl(secret: String): String {
Timber.d("NWC [PAIRING ] fetching pairing URL for secret=${secret.take(8)}") Timber.d("NWC [PAIRING ] fetching pairing URL for secret=${secret.take(8)}")
val url = api.getNwcPairingUrl( val url = api.getNwcPairingUrl(
apiKey = secrets.invoiceKey(), invoiceKey = secrets.invoiceKey(),
secret = secret secret = secret
) )
Timber.i("NWC [PAIRING ] pairing URL received ✓") Timber.i("NWC [PAIRING ] pairing URL received ✓")