From b15fdcd9512d43a4317bc0d7034675396fb738b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20S=C3=A1nchez?= Date: Thu, 19 Dec 2024 09:27:27 -0300 Subject: [PATCH] Worker interface method definitions --- .../example/dcav2gui/InstanceInterface.java | 2 - .../com/example/dcav2gui/WorkerInterface.java | 83 +++++++++++++++++++ 2 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 app/src/main/java/com/example/dcav2gui/WorkerInterface.java diff --git a/app/src/main/java/com/example/dcav2gui/InstanceInterface.java b/app/src/main/java/com/example/dcav2gui/InstanceInterface.java index 055cd30..d6f1f7f 100644 --- a/app/src/main/java/com/example/dcav2gui/InstanceInterface.java +++ b/app/src/main/java/com/example/dcav2gui/InstanceInterface.java @@ -27,8 +27,6 @@ public class InstanceInterface { private static final OkHttpClient httpClient = new OkHttpClient(); public static ProfitStatsData getProfitStatsData(boolean retry) throws IOException { - int retries = 3; - Request profitRequest = new Request.Builder() .url(API_BASE_URL + "/statistics_server/combined_totals") .header("X-API-KEY", API_KEY) diff --git a/app/src/main/java/com/example/dcav2gui/WorkerInterface.java b/app/src/main/java/com/example/dcav2gui/WorkerInterface.java new file mode 100644 index 0000000..c9da274 --- /dev/null +++ b/app/src/main/java/com/example/dcav2gui/WorkerInterface.java @@ -0,0 +1,83 @@ +package com.example.dcav2gui; + +import static com.example.dcav2gui.MainActivity.globalSettings; + +import java.io.IOException; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import com.google.gson.JsonSyntaxException; + +import okhttp3.OkHttpClient; + +public class WorkerInterface { + private static final String API_BASE_URL = globalSettings.apiUrl; + private static final String API_KEY = globalSettings.apiKey; + private static final OkHttpClient httpClient = new OkHttpClient(); + + + public static WorkerDetails getWorkerDetails(String pair) throws IOException { + return null; + } + + public static JsonObject addTrader(String exchange, String pair) throws IOException { + return null; + } + + public static JsonObject removeTrader(String exchange, String pair) throws IOException { + return null; + } + + public static JsonObject restartTrader(String exchange, String pair) throws IOException { + return null; + } + + public static JsonObject importTrader(String exchange, String pair) throws IOException { + return null; + } + + public static JsonObject togglePause(String exchange, String pair) throws IOException { + return null; + } + + public static JsonObject toggleAutoswitch(String exchange, String pair) throws IOException { + return null; + } + + public static JsonObject toggleCleanup(String exchange, String pair) throws IOException { + return null; + } + + public static JsonObject toggleLastCall(String exchange, String pair) throws IOException { + return null; + } + + public static JsonObject switchToLong(String exchange, String pair) throws IOException { + return null; + } + + public static JsonObject switchToShort(String exchange, String pair) throws IOException { + return null; + } + + public static JsonObject switchQuoteCurrency(String exchange, String pair) throws IOException { + return null; + } + + public static JsonObject addSafetyOrders(String exchange, String pair) throws IOException { + return null; + } + + public static JsonObject addQuote(String exchange, String pair) throws IOException { + return null; + } + + + + public static class WorkerDetails { + + } +} + +