mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
Add TxFeeRateInfo proto wrapper
This commit is contained in:
parent
9662f26b23
commit
abe7160608
61
core/src/main/java/bisq/core/api/model/TxFeeRateInfo.java
Normal file
61
core/src/main/java/bisq/core/api/model/TxFeeRateInfo.java
Normal file
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* This file is part of Bisq.
|
||||
*
|
||||
* Bisq is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bisq is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package bisq.core.api.model;
|
||||
|
||||
import bisq.common.Payload;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
|
||||
@EqualsAndHashCode
|
||||
@Getter
|
||||
public class TxFeeRateInfo implements Payload {
|
||||
|
||||
private final long stdTxFeeRate;
|
||||
private final long customTxFeeRate;
|
||||
|
||||
public TxFeeRateInfo(long stdTxFeeRate, long customTxFeeRate) {
|
||||
this.stdTxFeeRate = stdTxFeeRate;
|
||||
this.customTxFeeRate = customTxFeeRate;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
// PROTO BUFFER
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public bisq.proto.grpc.TxFeeRateInfo toProtoMessage() {
|
||||
return bisq.proto.grpc.TxFeeRateInfo.newBuilder()
|
||||
.setStdTxFeeRate(stdTxFeeRate)
|
||||
.setCustomTxFeeRate(customTxFeeRate)
|
||||
.build();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static TxFeeRateInfo fromProto(bisq.proto.grpc.TxFeeRateInfo proto) {
|
||||
return new TxFeeRateInfo(proto.getStdTxFeeRate(), proto.getCustomTxFeeRate());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TxFeeRateInfo{"
|
||||
+ "stdTxFeeRate=" + stdTxFeeRate + " sats/byte"
|
||||
+ ", customWithdrawalTxFeeRate=" + customTxFeeRate + " sats/byte"
|
||||
+ "}";
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user