feat: nwc

This commit is contained in:
2026-06-09 15:48:38 +02:00
parent 2490ea2f75
commit 7fad5ec9dd
9 changed files with 1288 additions and 194 deletions
@@ -322,3 +322,43 @@ data class PaginatedPaymentsResponse(
@SerializedName("data") val data: List<PaymentRecord>,
@SerializedName("total") val total: Int
)
// ── NWC Provider models ───────────────────────────────────────────────────────
data class NwcKey(
val pubkey: String,
val wallet: String,
val description: String,
val expires_at: Long,
val permissions: String, // comma-separated permission names
val created_at: Long,
val last_used: Long
)
data class NwcBudget(
val id: Int,
val pubkey: String,
val budget_msats: Long,
val refresh_window: Int, // seconds
val created_at: Long,
val used_budget_msats: Long = 0
)
/** Response for GET /nwc and GET /nwc/{pubkey} */
data class NwcGetResponse(
val data: NwcKey,
val budgets: List<NwcBudget>
)
data class NwcNewBudget(
val budget_msats: Long,
val refresh_window: Int // seconds
)
/** Request body for PUT /nwc/{pubkey} */
data class NwcRegistrationRequest(
val permissions: List<String>,
val description: String,
val expires_at: Long, // unix timestamp; 0 = no expiry
val budgets: List<NwcNewBudget> = emptyList()
)