@@ -0,0 +1,2064 @@
+package nxt.http.rpc;%0A%0Aimport nxt.MofoQueries;%0Aimport nxt.Nxt;%0Aimport nxt.http.websocket.JSONData;%0Aimport nxt.http.ParameterException;%0Aimport nxt.http.websocket.RPCCall;%0A%0Aimport org.json.simple.JSONObject;%0Aimport org.json.simple.JSONStreamAware;%0A%0Apublic class GetActivityStatistics extends RPCCall %7B%0A  %0A    public static RPCCall instance = new GetActivityStatistics(%22getActivityStatistics%22);%0A    static final int SECONDS_24H = 24 * 60 * 60;%0A    static final int SECONDS_WEEK = 7 * SECONDS_24H;%0A    static final int SECONDS_MONTH = 30 * SECONDS_24H;  %0A  %0A    public GetActivityStatistics(String identifier) %7B%0A        super(identifier);%0A    %7D%0A    %0A    @SuppressWarnings(%22unchecked%22)%0A    @Override%0A    public JSONStreamAware call(JSONObject arguments) throws ParameterException %7B%0A%0A        JSONObject response = new JSONObject();        %0A        int time = Nxt.getBlockchain().getLastBlock().getTimestamp();%0A      %0A        response.put(%22averageBlockTime24H%22, MofoQueries.getAverageBlockTime24H());%0A        response.put(%22transactionCountToday%22, MofoQueries.getTransactionCountSince(time - SECONDS_24H));%0A        response.put(%22transactionCountWeek%22, MofoQueries.getTransactionCountSince(time - SECONDS_WEEK));%0A        response.put(%22transactionCountMonth%22, MofoQueries.getTransactionCountSince(time - SECONDS_MONTH));%0A        %0A        // TODO - Instead of using single queries try to do this with one single query%0A        long dayReward = MofoQueries.getBlockRewardsSince(time - SECONDS_24H).getTotalRewardsNQT();%0A        long weekReward = MofoQueries.getBlockRewardsSince(time - SECONDS_WEEK).getTotalRewardsNQT();%0A        long monthReward = MofoQueries.getBlockRewardsSince(time - SECONDS_MONTH).getTotalRewardsNQT();%0A%0A        response.put(%22rewardsToday%22, String.valueOf(dayReward));        %0A        response.put(%22rewardsWeek%22, String.valueOf(weekReward));%0A        response.put(%22rewardsMonth%22, String.valueOf(monthReward));%0A     %0A        response.put(%22lastBlock%22, JSONData.minimalBlock(Nxt.getBlockchain().getLastBlock()));%0A        %0A        return response;%0A    %7D  %0A%0A%7D%0A

Add websocket API GetActivityStatistics