From 67e424a32a043f2b5fd88ca4c0b5a189b56ac7ef Mon Sep 17 00:00:00 2001 From: CalDescent Date: Fri, 7 Jan 2022 14:38:05 +0000 Subject: [PATCH] Added GET /arbitrary/relaymode API endpoint, which returns whether relay mode is enabled in the settings or not. --- .../qortal/api/resource/ArbitraryResource.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main/java/org/qortal/api/resource/ArbitraryResource.java b/src/main/java/org/qortal/api/resource/ArbitraryResource.java index 52efc884..57d39867 100644 --- a/src/main/java/org/qortal/api/resource/ArbitraryResource.java +++ b/src/main/java/org/qortal/api/resource/ArbitraryResource.java @@ -328,6 +328,23 @@ public class ArbitraryResource { } } + @GET + @Path("/relaymode") + @Operation( + summary = "Returns whether relay mode is enabled or not", + responses = { + @ApiResponse( + content = @Content(mediaType = MediaType.TEXT_PLAIN, schema = @Schema(type = "boolean")) + ) + } + ) + @ApiErrors({ApiError.REPOSITORY_ISSUE}) + public boolean getRelayMode() { + Security.checkApiCallAllowed(request); + + return Settings.getInstance().isRelayModeEnabled(); + } + @GET @Path("/hosted/transactions") @Operation(