Class BlockRoutesApi
- java.lang.Object
-
- io.nem.symbol.sdk.openapi.jersey2.api.BlockRoutesApi
-
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2020-05-15T14:38:14.328808-03:00[America/Argentina/Buenos_Aires]") public class BlockRoutesApi extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description BlockRoutesApi()BlockRoutesApi(ApiClient apiClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ApiClientgetApiClient()BlockInfoDTOgetBlockByHeight(java.math.BigInteger height)Get block information Gets a block from the chain that has the given height.ApiResponse<BlockInfoDTO>getBlockByHeightWithHttpInfo(java.math.BigInteger height)Get block information Gets a block from the chain that has the given height.java.util.List<BlockInfoDTO>getBlocksByHeightWithLimit(java.math.BigInteger height, java.lang.Integer limit)Get blocks information Gets up to limit number of blocks after given block height.ApiResponse<java.util.List<BlockInfoDTO>>getBlocksByHeightWithLimitWithHttpInfo(java.math.BigInteger height, java.lang.Integer limit)Get blocks information Gets up to limit number of blocks after given block height.java.util.List<TransactionInfoDTO>getBlockTransactions(java.math.BigInteger height, java.lang.Integer pageSize, java.lang.String id)Get transactions from a block Returns an array of transactions included in a block for a given block height.ApiResponse<java.util.List<TransactionInfoDTO>>getBlockTransactionsWithHttpInfo(java.math.BigInteger height, java.lang.Integer pageSize, java.lang.String id)Get transactions from a block Returns an array of transactions included in a block for a given block height.MerkleProofInfoDTOgetMerkleTransaction(java.math.BigInteger height, java.lang.String hash)Get the merkle path for a given a transaction and block Returns the merkle path for a transaction included in a block.ApiResponse<MerkleProofInfoDTO>getMerkleTransactionWithHttpInfo(java.math.BigInteger height, java.lang.String hash)Get the merkle path for a given a transaction and block Returns the merkle path for a transaction included in a block.voidsetApiClient(ApiClient apiClient)
-
-
-
Constructor Detail
-
BlockRoutesApi
public BlockRoutesApi()
-
BlockRoutesApi
public BlockRoutesApi(ApiClient apiClient)
-
-
Method Detail
-
getApiClient
public ApiClient getApiClient()
-
setApiClient
public void setApiClient(ApiClient apiClient)
-
getBlockByHeight
public BlockInfoDTO getBlockByHeight(java.math.BigInteger height) throws ApiException
Get block information Gets a block from the chain that has the given height.- Parameters:
height- Block height. (required)- Returns:
- BlockInfoDTO
- Throws:
ApiException- if fails to make API call- Http Response Details
Status Code Description Response Headers 200 success - 404 ResourceNotFound - 409 InvalidArgument -
-
getBlockByHeightWithHttpInfo
public ApiResponse<BlockInfoDTO> getBlockByHeightWithHttpInfo(java.math.BigInteger height) throws ApiException
Get block information Gets a block from the chain that has the given height.- Parameters:
height- Block height. (required)- Returns:
- ApiResponse<BlockInfoDTO>
- Throws:
ApiException- if fails to make API call- Http Response Details
Status Code Description Response Headers 200 success - 404 ResourceNotFound - 409 InvalidArgument -
-
getBlockTransactions
public java.util.List<TransactionInfoDTO> getBlockTransactions(java.math.BigInteger height, java.lang.Integer pageSize, java.lang.String id) throws ApiException
Get transactions from a block Returns an array of transactions included in a block for a given block height.- Parameters:
height- Block height. (required)pageSize- Number of entries to return. (optional, default to 10)id- Entry id at which to start pagination. If the ordering parameter is set to -id, the elements returned precede the identifier. Otherwise, newer elements with respect to the id are returned. (optional)- Returns:
- List<TransactionInfoDTO>
- Throws:
ApiException- if fails to make API call- Http Response Details
Status Code Description Response Headers 200 success - 404 ResourceNotFound - 409 InvalidArgument -
-
getBlockTransactionsWithHttpInfo
public ApiResponse<java.util.List<TransactionInfoDTO>> getBlockTransactionsWithHttpInfo(java.math.BigInteger height, java.lang.Integer pageSize, java.lang.String id) throws ApiException
Get transactions from a block Returns an array of transactions included in a block for a given block height.- Parameters:
height- Block height. (required)pageSize- Number of entries to return. (optional, default to 10)id- Entry id at which to start pagination. If the ordering parameter is set to -id, the elements returned precede the identifier. Otherwise, newer elements with respect to the id are returned. (optional)- Returns:
- ApiResponse<List<TransactionInfoDTO>>
- Throws:
ApiException- if fails to make API call- Http Response Details
Status Code Description Response Headers 200 success - 404 ResourceNotFound - 409 InvalidArgument -
-
getBlocksByHeightWithLimit
public java.util.List<BlockInfoDTO> getBlocksByHeightWithLimit(java.math.BigInteger height, java.lang.Integer limit) throws ApiException
Get blocks information Gets up to limit number of blocks after given block height.- Parameters:
height- Block height. (required)limit- Number of elements to be returned. The limit should be greater than or equal to \"db.pageSizeMin\" and not higher than \"db.pageSizeMax\". The settings are adjustable via the configuration file (rest/resources/rest.json) per REST instance. (required)- Returns:
- List<BlockInfoDTO>
- Throws:
ApiException- if fails to make API call- Http Response Details
Status Code Description Response Headers 200 success - 409 InvalidArgument -
-
getBlocksByHeightWithLimitWithHttpInfo
public ApiResponse<java.util.List<BlockInfoDTO>> getBlocksByHeightWithLimitWithHttpInfo(java.math.BigInteger height, java.lang.Integer limit) throws ApiException
Get blocks information Gets up to limit number of blocks after given block height.- Parameters:
height- Block height. (required)limit- Number of elements to be returned. The limit should be greater than or equal to \"db.pageSizeMin\" and not higher than \"db.pageSizeMax\". The settings are adjustable via the configuration file (rest/resources/rest.json) per REST instance. (required)- Returns:
- ApiResponse<List<BlockInfoDTO>>
- Throws:
ApiException- if fails to make API call- Http Response Details
Status Code Description Response Headers 200 success - 409 InvalidArgument -
-
getMerkleTransaction
public MerkleProofInfoDTO getMerkleTransaction(java.math.BigInteger height, java.lang.String hash) throws ApiException
Get the merkle path for a given a transaction and block Returns the merkle path for a transaction included in a block. The merkle path is the minimum number of nodes needed to calculate the merkle root. Steps to calculate the merkle root: 1. proofHash = hash (leaf). 2. Concatenate proofHash with the first unprocessed item from the merklePath list as follows: * a) If item.position == left -> proofHash = sha_256(item.hash + proofHash). * b) If item.position == right -> proofHash = sha_256(proofHash+ item.hash). 3. Repeat 2. for every item in the merklePath list. 4. Compare if the calculated proofHash equals the one recorded in the block header (block.transactionsHash) to verify if the transaction was included in the block.- Parameters:
height- Block height. (required)hash- Transaction hash. (required)- Returns:
- MerkleProofInfoDTO
- Throws:
ApiException- if fails to make API call- Http Response Details
Status Code Description Response Headers 200 success - 404 ResourceNotFound - 409 InvalidArgument -
-
getMerkleTransactionWithHttpInfo
public ApiResponse<MerkleProofInfoDTO> getMerkleTransactionWithHttpInfo(java.math.BigInteger height, java.lang.String hash) throws ApiException
Get the merkle path for a given a transaction and block Returns the merkle path for a transaction included in a block. The merkle path is the minimum number of nodes needed to calculate the merkle root. Steps to calculate the merkle root: 1. proofHash = hash (leaf). 2. Concatenate proofHash with the first unprocessed item from the merklePath list as follows: * a) If item.position == left -> proofHash = sha_256(item.hash + proofHash). * b) If item.position == right -> proofHash = sha_256(proofHash+ item.hash). 3. Repeat 2. for every item in the merklePath list. 4. Compare if the calculated proofHash equals the one recorded in the block header (block.transactionsHash) to verify if the transaction was included in the block.- Parameters:
height- Block height. (required)hash- Transaction hash. (required)- Returns:
- ApiResponse<MerkleProofInfoDTO>
- Throws:
ApiException- if fails to make API call- Http Response Details
Status Code Description Response Headers 200 success - 404 ResourceNotFound - 409 InvalidArgument -
-
-