@@ -46,15 +46,6 @@ type UpdateWalletParams struct {
4646// API Keys
4747// ---------------------------------------------------------------------------
4848
49- // APIKey represents an API key's metadata.
50- type APIKey struct {
51- ID string `json:"id"`
52- Name string `json:"name"`
53- Hint string `json:"hint"`
54- CreatedAt * time.Time `json:"createdAt"`
55- LastUsedAt * time.Time `json:"lastUsedAt"`
56- }
57-
5849// RotatedAPIKey is returned after rotating an API key.
5950type RotatedAPIKey struct {
6051 Key string `json:"key"`
@@ -298,3 +289,57 @@ type PasskeyAssertionParams struct {
298289 SessionID string `json:"sessionId"`
299290 Assertion map [string ]any `json:"assertion"`
300291}
292+
293+ // ---------------------------------------------------------------------------
294+ // L402
295+ // ---------------------------------------------------------------------------
296+
297+ // CreateL402ChallengeParams are the parameters for creating an L402 challenge.
298+ type CreateL402ChallengeParams struct {
299+ Amount int64 `json:"amount"`
300+ Description * string `json:"description,omitempty"`
301+ ExpirySeconds * int `json:"expirySeconds,omitempty"`
302+ Caveats []string `json:"caveats,omitempty"`
303+ }
304+
305+ // L402Challenge is returned when an L402 challenge is created.
306+ type L402Challenge struct {
307+ Macaroon string `json:"macaroon"`
308+ Invoice string `json:"invoice"`
309+ PaymentHash string `json:"paymentHash"`
310+ ExpiresAt time.Time `json:"expiresAt"`
311+ WwwAuthenticate string `json:"wwwAuthenticate"`
312+ }
313+
314+ // VerifyL402Params are the parameters for verifying an L402 token.
315+ type VerifyL402Params struct {
316+ Authorization string `json:"authorization"`
317+ }
318+
319+ // VerifyL402Response is returned when verifying an L402 token.
320+ type VerifyL402Response struct {
321+ Valid bool `json:"valid"`
322+ PaymentHash * string `json:"paymentHash"`
323+ Caveats []string `json:"caveats"`
324+ Error * string `json:"error"`
325+ }
326+
327+ // PayL402Params are the parameters for paying an L402 challenge.
328+ type PayL402Params struct {
329+ WwwAuthenticate string `json:"wwwAuthenticate"`
330+ MaxFee * int64 `json:"maxFee,omitempty"`
331+ Reference * string `json:"reference,omitempty"`
332+ Wait * bool `json:"wait,omitempty"`
333+ Timeout * int `json:"timeout,omitempty"`
334+ }
335+
336+ // L402PayResponse is returned after paying an L402 challenge.
337+ type L402PayResponse struct {
338+ Authorization * string `json:"authorization"`
339+ PaymentHash string `json:"paymentHash"`
340+ Preimage * string `json:"preimage"`
341+ Amount int64 `json:"amount"`
342+ Fee * int64 `json:"fee"`
343+ PaymentNumber int `json:"paymentNumber"`
344+ Status string `json:"status"`
345+ }
0 commit comments