diff --git a/bitrafael-common/src/main/java/com/generalbytes/bitrafael/api/IBitrafaelAPI.java b/bitrafael-common/src/main/java/com/generalbytes/bitrafael/api/IBitrafaelAPI.java index 24e4878..fe138d5 100644 --- a/bitrafael-common/src/main/java/com/generalbytes/bitrafael/api/IBitrafaelAPI.java +++ b/bitrafael-common/src/main/java/com/generalbytes/bitrafael/api/IBitrafaelAPI.java @@ -99,6 +99,11 @@ public interface IBitrafaelAPI { @Path("/transactions/fees") TxFeesInfoResponse getTransactionFeesInfo(); + @POST + @Consumes(MediaType.APPLICATION_JSON) + @Path("/transactions/fees") + TxFeesResponse getTransactionFees(List txHashes); + @GET @Path("/blockchain/height") BlockchainHeightResponse getCurrentBlockchainHeight(); diff --git a/bitrafael-common/src/main/java/com/generalbytes/bitrafael/api/dto/TxFees.java b/bitrafael-common/src/main/java/com/generalbytes/bitrafael/api/dto/TxFees.java new file mode 100644 index 0000000..ea0d05a --- /dev/null +++ b/bitrafael-common/src/main/java/com/generalbytes/bitrafael/api/dto/TxFees.java @@ -0,0 +1,58 @@ +/************************************************************************************* + * Copyright (C) 2016 GENERAL BYTES s.r.o. All rights reserved. + * + * This software may be distributed and modified under the terms of the GNU + * General Public License version 2 (GPL2) as published by the Free Software + * Foundation and appearing in the file GPL2.TXT included in the packaging of + * this file. Please note that GPL2 Section 2[b] requires that all works based + * on this software must also be made publicly available under the terms of + * the GPL2 ("Copyleft"). + * + * Contact information + * ------------------- + * + * GENERAL BYTES s.r.o. + * Web : http://www.generalbytes.com + * + ************************************************************************************/ + +package com.generalbytes.bitrafael.api.dto; + +import java.util.Map; + +public class TxFees { + private long totalFee; + private Map transactionFees; + + public TxFees() { + } + + public TxFees(long totalFee, Map transactionFees) { + this.totalFee = totalFee; + this.transactionFees = transactionFees; + } + + public long getTotalFee() { + return totalFee; + } + + public void setTotalFee(long totalFee) { + this.totalFee = totalFee; + } + + public Map getTransactionFees() { + return transactionFees; + } + + public void setTransactionFees(Map transactionFees) { + this.transactionFees = transactionFees; + } + + @Override + public String toString() { + return "TxFees{" + + "totalFee=" + totalFee + + ", transactionFees=" + transactionFees + + '}'; + } +} diff --git a/bitrafael-common/src/main/java/com/generalbytes/bitrafael/api/dto/rest/TxFeesResponse.java b/bitrafael-common/src/main/java/com/generalbytes/bitrafael/api/dto/rest/TxFeesResponse.java new file mode 100644 index 0000000..e6af2cb --- /dev/null +++ b/bitrafael-common/src/main/java/com/generalbytes/bitrafael/api/dto/rest/TxFeesResponse.java @@ -0,0 +1,41 @@ +/************************************************************************************* + * Copyright (C) 2016 GENERAL BYTES s.r.o. All rights reserved. + * + * This software may be distributed and modified under the terms of the GNU + * General Public License version 2 (GPL2) as published by the Free Software + * Foundation and appearing in the file GPL2.TXT included in the packaging of + * this file. Please note that GPL2 Section 2[b] requires that all works based + * on this software must also be made publicly available under the terms of + * the GPL2 ("Copyleft"). + * + * Contact information + * ------------------- + * + * GENERAL BYTES s.r.o. + * Web : http://www.generalbytes.com + * + ************************************************************************************/ +package com.generalbytes.bitrafael.api.dto.rest; + +import com.generalbytes.bitrafael.api.dto.TxFees; + +public class TxFeesResponse extends APIResponse{ + public TxFeesResponse() { + } + + public TxFeesResponse(Object data) { + super(true, data); + } + + public TxFeesResponse(String message) { + super(false, message); + } + + public TxFees getData() { + return (TxFees) data; + } + + public void setData(TxFees data) { + super.data = data; + } +}