All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.arkecosystem.client.api.one.Delegates Maven / Gradle / Ivy

The newest version!
package org.arkecosystem.client.api.one;

import com.google.gson.internal.LinkedTreeMap;
import org.arkecosystem.client.http.Client;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class Delegates {
    Client client;

    public Delegates(Client client) {
        this.client = client;
    }

    public LinkedTreeMap all(Map query) throws IOException {
        return this.client.get("delegates", query);
    }

    public LinkedTreeMap all() throws IOException {
        return this.all(new HashMap());
    }

    public LinkedTreeMap show(Map id) throws IOException {
        return this.client.get("delegates/get", id);
    }

    public LinkedTreeMap count() throws IOException {
        return this.client.get("delegates/count");
    }

    public LinkedTreeMap fee() throws IOException {
        return this.client.get("delegates/fee");
    }

    public LinkedTreeMap forgedByAccount(String generatorPublicKey) throws IOException {
        HashMap map = new HashMap<>();
        map.put("generatorPublicKey", generatorPublicKey);
        return this.client.get("delegates/forging/getForgedByAccount", map);
    }

    public LinkedTreeMap search(String query) throws IOException {
        HashMap map = new HashMap<>();
        map.put("q", query);
        return this.client.get("delegates/search", map);
    }

    public LinkedTreeMap voters(String publicKey) throws IOException {
        HashMap map = new HashMap<>();
        map.put("publicKey", publicKey);
        return this.client.get("delegates/voters", map);
    }

    public LinkedTreeMap nextForgers() throws IOException {
        return this.client.get("delegates/getNextForgers");
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy