feat: nwc
This commit is contained in:
@@ -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()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user