All URIs are relative to /v2.5.0
Method | HTTP request | Description |
---|---|---|
getBlockByHash | GET /block-by-hash | Get block by hash |
getBlockByNumber | GET /block-by-number | Get block by number |
getLatestBlock | GET /latest-block | Get the latest block |
getLatestBlockNumber | GET /latest-block-number | Get the number of the latest block |
getTransaction | GET /transaction | Get transaction |
getTransactionLimits | GET /transaction-limits | Get transaction limits |
getTransactionResult | GET /transaction-result | Get transaction result |
GetBlockResponse getBlockByHash(hash)
Get block by hash
Returns a block by block hash.
// 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.BlockchainApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
BlockchainApi apiInstance = new BlockchainApi();
String hash = "hash_example"; // String | Hash of block
try {
GetBlockResponse result = apiInstance.getBlockByHash(hash);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BlockchainApi#getBlockByHash");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
hash | String | Hash of block |
- Content-Type: Not defined
- Accept: application/json
GetBlockResponse getBlockByNumber(number)
Get block by number
Returns a block by block number.
// 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.BlockchainApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
BlockchainApi apiInstance = new BlockchainApi();
String number = "number_example"; // String | Number of block
try {
GetBlockResponse result = apiInstance.getBlockByNumber(number);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BlockchainApi#getBlockByNumber");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
number | String | Number of block |
- Content-Type: Not defined
- Accept: application/json
GetLatestBlockResponse getLatestBlock()
Get the latest block
Returns the latest block.
// 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.BlockchainApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
BlockchainApi apiInstance = new BlockchainApi();
try {
GetLatestBlockResponse result = apiInstance.getLatestBlock();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BlockchainApi#getLatestBlock");
e.printStackTrace();
}
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
GetLatestBlockNumberResponse getLatestBlockNumber()
Get the number of the latest block
Returns the number of the latest block.
// 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.BlockchainApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
BlockchainApi apiInstance = new BlockchainApi();
try {
GetLatestBlockNumberResponse result = apiInstance.getLatestBlockNumber();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BlockchainApi#getLatestBlockNumber");
e.printStackTrace();
}
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
GetTransactionResponse getTransaction(hash)
Get transaction
Returns a transactions if exists.
// 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.BlockchainApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
BlockchainApi apiInstance = new BlockchainApi();
String hash = "hash_example"; // String | Transaction hash
try {
GetTransactionResponse result = apiInstance.getTransaction(hash);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BlockchainApi#getTransaction");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
hash | String | Transaction hash |
- Content-Type: Not defined
- Accept: application/json
GetTransactionLimitsResponse getTransactionLimits(type)
Get transaction limits
Returns transaction limitations including minimum transaction fee and maximum transaction size.
// 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.BlockchainApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
BlockchainApi apiInstance = new BlockchainApi();
String type = "type_example"; // String | Type of transaction
try {
GetTransactionLimitsResponse result = apiInstance.getTransactionLimits(type);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BlockchainApi#getTransactionLimits");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
type | String | Type of transaction | [enum: COINBASE, TRANSFER, DELEGATE, VOTE, UNVOTE, CREATE, CALL] |
- Content-Type: Not defined
- Accept: application/json
GetTransactionResultResponse getTransactionResult(hash)
Get transaction result
Returns the result of the requested transaction.
// 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.BlockchainApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
BlockchainApi apiInstance = new BlockchainApi();
String hash = "hash_example"; // String | Transaction hash
try {
GetTransactionResultResponse result = apiInstance.getTransactionResult(hash);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BlockchainApi#getTransactionResult");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
hash | String | Transaction hash |
- Content-Type: Not defined
- Accept: application/json