feat: nwc
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
package com.bitcointxoko.gudariwallet.api
|
||||
|
||||
import retrofit2.http.Body
|
||||
import retrofit2.http.DELETE
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.Header
|
||||
import retrofit2.http.POST
|
||||
import retrofit2.http.PUT
|
||||
import retrofit2.http.Path
|
||||
import retrofit2.http.Query
|
||||
import retrofit2.http.Url
|
||||
@@ -144,4 +146,61 @@ interface LNbitsApi {
|
||||
*/
|
||||
@GET("api/v1/currencies")
|
||||
suspend fun getSupportedCurrencies(): List<String>
|
||||
|
||||
// ── NWC Provider ──────────────────────────────────────────────────────────
|
||||
|
||||
@GET("nwcprovider/api/v1/permissions")
|
||||
suspend fun getNwcPermissions(
|
||||
@Header("X-Api-Key") apiKey: String
|
||||
): Map<String, Any>
|
||||
|
||||
@GET("nwcprovider/api/v1/nwc")
|
||||
suspend fun getNwcKeys(
|
||||
@Header("X-Api-Key") adminKey: String,
|
||||
@Query("include_expired") includeExpired: Boolean = false
|
||||
): List<NwcGetResponse>
|
||||
|
||||
@GET("nwcprovider/api/v1/nwc/{pubkey}")
|
||||
suspend fun getNwcKey(
|
||||
@Header("X-Api-Key") apiKey: String,
|
||||
@Path("pubkey") pubkey: String,
|
||||
@Query("include_expired") includeExpired: Boolean = false,
|
||||
@Query("refresh_last_used") refreshLastUsed: Boolean = false
|
||||
): NwcGetResponse
|
||||
|
||||
@PUT("nwcprovider/api/v1/nwc/{pubkey}")
|
||||
suspend fun registerNwcKey(
|
||||
@Header("X-Api-Key") adminKey: String,
|
||||
@Path("pubkey") pubkey: String,
|
||||
@Body request: NwcRegistrationRequest
|
||||
): NwcGetResponse
|
||||
|
||||
@DELETE("nwcprovider/api/v1/nwc/{pubkey}")
|
||||
suspend fun deleteNwcKey(
|
||||
@Header("X-Api-Key") adminKey: String,
|
||||
@Path("pubkey") pubkey: String
|
||||
)
|
||||
|
||||
@GET("nwcprovider/api/v1/pairing/{secret}")
|
||||
suspend fun getNwcPairingUrl(
|
||||
@Header("X-Api-Key") apiKey: String,
|
||||
@Path("secret") secret: String
|
||||
): String
|
||||
|
||||
@GET("nwcprovider/api/v1/config")
|
||||
suspend fun getNwcConfig(
|
||||
@Header("X-Api-Key") adminKey: String
|
||||
): Map<String, Any>
|
||||
|
||||
@GET("nwcprovider/api/v1/config/{key}")
|
||||
suspend fun getNwcConfigValue(
|
||||
@Header("X-Api-Key") adminKey: String,
|
||||
@Path("key") key: String
|
||||
): Map<String, Any>
|
||||
|
||||
@POST("nwcprovider/api/v1/config")
|
||||
suspend fun setNwcConfig(
|
||||
@Header("X-Api-Key") adminKey: String,
|
||||
@Body config: Map<String, Any>
|
||||
): Map<String, Any>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user