/// getting a block with API import in3.*; import in3.eth1.*; import java.math.BigInteger; import java.util.*; public class GetBlockAPI { // public static void main(String[] args) throws Exception { // create incubed IN3 in3 = IN3.forChain(Chain.MAINNET); // set it to mainnet (which is also dthe default) // read the latest Block including all Transactions. Block latestBlock = in3.getEth1API().getBlockByNumber(Block.LATEST, true); // Use the getters to retrieve all containing data System.out.println("current BlockNumber : " + latestBlock.getNumber()); System.out.println("minded at : " + new Date(latestBlock.getTimeStamp()) + " by " + latestBlock.getAuthor()); // get all Transaction of the Block Transaction[] transactions = latestBlock.getTransactions(); BigInteger sum = BigInteger.valueOf(0); for (int i = 0; i < transactions.length; i++) sum = sum.add(transactions[i].getValue()); System.out.println("total Value transfered in all Transactions : " + sum + " wei"); } }