Table of Contents

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

string

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

string

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

response JObject

The JSON object to inspect.

status LNUrlStatusResponse

When this method returns true, contains the deserialized LNUrlStatusResponse; otherwise null.

Returns

bool

true if the response contains a status field equal to "ERROR"; otherwise false.

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

json string

The raw JSON string to inspect.

status LNUrlStatusResponse

When this method returns true, contains the deserialized LNUrlStatusResponse; otherwise null.

Returns

bool

true if the response contains a status field equal to "ERROR"; otherwise false.