All URIs are relative to /v2.5.0
Method | HTTP request | Description |
---|---|---|
getDelegate | GET /delegate | Get delegate info |
getDelegates | GET /delegates | Get all delegates |
getValidators | GET /validators | Get all validators |
getVote | GET /vote | Get the vote between a delegate and a voter |
getVotes | GET /votes | Get all votes of a delegate |
GetDelegateResponse getDelegate(address)
Get delegate info
Returns the information about delegate.
// Import classes:
//import org.semux.sdk.client.ApiClient;
//import org.semux.sdk.client.ApiException;
//import org.semux.sdk.client.Configuration;
//import org.semux.sdk.client.auth.*;
//import org.semux.sdk.client.api.DelegateApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
DelegateApi apiInstance = new DelegateApi();
String address = "address_example"; // String | Delegate address
try {
GetDelegateResponse result = apiInstance.getDelegate(address);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DelegateApi#getDelegate");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
address | String | Delegate address |
- Content-Type: Not defined
- Accept: application/json
GetDelegatesResponse getDelegates()
Get all delegates
Returns a list of delegates.
// Import classes:
//import org.semux.sdk.client.ApiClient;
//import org.semux.sdk.client.ApiException;
//import org.semux.sdk.client.Configuration;
//import org.semux.sdk.client.auth.*;
//import org.semux.sdk.client.api.DelegateApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
DelegateApi apiInstance = new DelegateApi();
try {
GetDelegatesResponse result = apiInstance.getDelegates();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DelegateApi#getDelegates");
e.printStackTrace();
}
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
GetValidatorsResponse getValidators()
Get all validators
Returns a list of validators in Semux addresses.
// Import classes:
//import org.semux.sdk.client.ApiClient;
//import org.semux.sdk.client.ApiException;
//import org.semux.sdk.client.Configuration;
//import org.semux.sdk.client.auth.*;
//import org.semux.sdk.client.api.DelegateApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
DelegateApi apiInstance = new DelegateApi();
try {
GetValidatorsResponse result = apiInstance.getValidators();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DelegateApi#getValidators");
e.printStackTrace();
}
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
GetVoteResponse getVote(delegate, voter)
Get the vote between a delegate and a voter
Returns the vote from a voter to a delegate.
// Import classes:
//import org.semux.sdk.client.ApiClient;
//import org.semux.sdk.client.ApiException;
//import org.semux.sdk.client.Configuration;
//import org.semux.sdk.client.auth.*;
//import org.semux.sdk.client.api.DelegateApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
DelegateApi apiInstance = new DelegateApi();
String delegate = "delegate_example"; // String | Delegate address
String voter = "voter_example"; // String | Voter address
try {
GetVoteResponse result = apiInstance.getVote(delegate, voter);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DelegateApi#getVote");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
delegate | String | Delegate address | |
voter | String | Voter address |
- Content-Type: Not defined
- Accept: application/json
GetVotesResponse getVotes(delegate)
Get all votes of a delegate
Returns all the votes to a delegate as a map of [voter address] => [votes]
// Import classes:
//import org.semux.sdk.client.ApiClient;
//import org.semux.sdk.client.ApiException;
//import org.semux.sdk.client.Configuration;
//import org.semux.sdk.client.auth.*;
//import org.semux.sdk.client.api.DelegateApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
DelegateApi apiInstance = new DelegateApi();
String delegate = "delegate_example"; // String | Delegate address
try {
GetVotesResponse result = apiInstance.getVotes(delegate);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DelegateApi#getVotes");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
delegate | String | Delegate address |
- Content-Type: Not defined
- Accept: application/json