Class LNUrlStatusResponse
- Namespace
- LNURL
- Assembly
- LNURL.Core.dll
Represents an LNURL status response, used across all LNURL flows to indicate success or error.
When the Status is "ERROR", the Reason property contains
a human-readable error message.
public class LNUrlStatusResponse
- Inheritance
-
LNUrlStatusResponse
- Inherited Members
Properties
Reason
Gets or sets the human-readable error message. Only meaningful when Status is "ERROR".
[JsonProperty("reason")]
[JsonPropertyName("reason")]
public string Reason { get; set; }
Property Value
Status
Gets or sets the status string. A value of "ERROR" (case-insensitive) indicates an error;
"OK" indicates success.
[JsonProperty("status")]
[JsonPropertyName("status")]
public string Status { get; set; }
Property Value
Methods
IsErrorResponse(JObject, out LNUrlStatusResponse)
Determines whether the given JSON response represents an LNURL error response. This overload accepts a Newtonsoft.Json Newtonsoft.Json.Linq.JObject for backward compatibility.
public static bool IsErrorResponse(JObject response, out LNUrlStatusResponse status)
Parameters
responseJObjectThe JSON object to inspect.
statusLNUrlStatusResponseWhen this method returns
true, contains the deserialized LNUrlStatusResponse; otherwisenull.
Returns
- bool
trueif the response contains astatusfield equal to"ERROR"; otherwisefalse.
IsErrorResponse(string, out LNUrlStatusResponse)
Determines whether the given JSON string represents an LNURL error response.
public static bool IsErrorResponse(string json, out LNUrlStatusResponse status)
Parameters
jsonstringThe raw JSON string to inspect.
statusLNUrlStatusResponseWhen this method returns
true, contains the deserialized LNUrlStatusResponse; otherwisenull.
Returns
- bool
trueif the response contains astatusfield equal to"ERROR"; otherwisefalse.