Skip to content

Commit

Permalink
Added Fees API for transactions
Browse files Browse the repository at this point in the history
Took 10 minutes
  • Loading branch information
kkyovsky committed Jan 26, 2020
1 parent e9039e4 commit e7fcc0a
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ public interface IBitrafaelAPI {
@Path("/transactions/fees")
TxFeesInfoResponse getTransactionFeesInfo();

@POST
@Consumes(MediaType.APPLICATION_JSON)
@Path("/transactions/fees")
TxFeesResponse getTransactionFees(List<String> txHashes);

@GET
@Path("/blockchain/height")
BlockchainHeightResponse getCurrentBlockchainHeight();
Expand Down
Original file line number Diff line number Diff line change
@@ -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<String,Long> transactionFees;

public TxFees() {
}

public TxFees(long totalFee, Map<String, Long> transactionFees) {
this.totalFee = totalFee;
this.transactionFees = transactionFees;
}

public long getTotalFee() {
return totalFee;
}

public void setTotalFee(long totalFee) {
this.totalFee = totalFee;
}

public Map<String, Long> getTransactionFees() {
return transactionFees;
}

public void setTransactionFees(Map<String, Long> transactionFees) {
this.transactionFees = transactionFees;
}

@Override
public String toString() {
return "TxFees{" +
"totalFee=" + totalFee +
", transactionFees=" + transactionFees +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -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;
}
}

0 comments on commit e7fcc0a

Please sign in to comment.