refactor: clean up LNbitsApi
This commit is contained in:
@@ -15,7 +15,7 @@ interface LNbitsApi {
|
||||
/** GET /api/v1/wallet — returns balance and wallet info */
|
||||
@GET("api/v1/wallet")
|
||||
suspend fun getWallet(
|
||||
@Header("X-Api-Key") apiKey: String
|
||||
@Header("X-Api-Key") invoiceKey: String
|
||||
): WalletResponse
|
||||
|
||||
/** POST /api/v1/payments — creates a BOLT-11 invoice */
|
||||
@@ -44,10 +44,10 @@ interface LNbitsApi {
|
||||
): PayInvoiceResponse
|
||||
|
||||
/** GET /api/v1/payments — returns payment history */
|
||||
@GET("api/v1/payments")
|
||||
suspend fun getPayments(
|
||||
@Header("X-Api-Key") apiKey: String
|
||||
): List<WsPayment>
|
||||
// @GET("api/v1/payments")
|
||||
// suspend fun getPayments(
|
||||
// @Header("X-Api-Key") apiKey: String
|
||||
// ): List<WsPayment>
|
||||
|
||||
/** GET /api/v1/payments/paginated — returns bulk payment history */
|
||||
@GET("api/v1/payments/paginated")
|
||||
@@ -151,7 +151,7 @@ interface LNbitsApi {
|
||||
|
||||
@GET("nwcprovider/api/v1/permissions")
|
||||
suspend fun getNwcPermissions(
|
||||
@Header("X-Api-Key") apiKey: String
|
||||
@Header("X-Api-Key") invoiceKey: String
|
||||
): Map<String, Any>
|
||||
|
||||
@GET("nwcprovider/api/v1/nwc")
|
||||
@@ -183,7 +183,7 @@ interface LNbitsApi {
|
||||
|
||||
@GET("nwcprovider/api/v1/pairing/{secret}")
|
||||
suspend fun getNwcPairingUrl(
|
||||
@Header("X-Api-Key") apiKey: String,
|
||||
@Header("X-Api-Key") invoiceKey: String,
|
||||
@Path("secret") secret: String
|
||||
): String
|
||||
|
||||
|
||||
@@ -370,7 +370,7 @@ class LNbitsWalletRepository(
|
||||
override suspend fun getNwcPairingUrl(secret: String): String {
|
||||
Timber.d("NWC [PAIRING ] fetching pairing URL for secret=${secret.take(8)}…")
|
||||
val url = api.getNwcPairingUrl(
|
||||
apiKey = secrets.invoiceKey(),
|
||||
invoiceKey = secrets.invoiceKey(),
|
||||
secret = secret
|
||||
)
|
||||
Timber.i("NWC [PAIRING ] pairing URL received ✓")
|
||||
|
||||
Reference in New Issue
Block a user