mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-22 07:24:23 +01:00
add incoming-base-fee and outgoing-base-fee endpoints
This commit is contained in:
@@ -74,4 +74,14 @@ public class LegacyController {
|
||||
public long getOutgoingFeeRate(@PathVariable ChannelId channelId) {
|
||||
return feeService.getOutgoingFeeRate(channelId);
|
||||
}
|
||||
|
||||
@GetMapping("/channel/{channelId}/incoming-base-fee")
|
||||
public long getIncomingBaseFee(@PathVariable ChannelId channelId) {
|
||||
return feeService.getIncomingBaseFee(channelId).milliSatoshis();
|
||||
}
|
||||
|
||||
@GetMapping("/channel/{channelId}/outgoing-base-fee")
|
||||
public long getOutgoingBaseFee(@PathVariable ChannelId channelId) {
|
||||
return feeService.getOutgoingBaseFee(channelId).milliSatoshis();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package de.cotto.lndmanagej.service;
|
||||
|
||||
import de.cotto.lndmanagej.grpc.GrpcFees;
|
||||
import de.cotto.lndmanagej.model.ChannelId;
|
||||
import de.cotto.lndmanagej.model.Coins;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@@ -19,4 +20,12 @@ public class FeeService {
|
||||
public long getOutgoingFeeRate(ChannelId channelId) {
|
||||
return grpcFees.getOutgoingFeeRate(channelId).orElseThrow(IllegalStateException::new);
|
||||
}
|
||||
|
||||
public Coins getOutgoingBaseFee(ChannelId channelId) {
|
||||
return grpcFees.getOutgoingBaseFee(channelId).orElseThrow(IllegalStateException::new);
|
||||
}
|
||||
|
||||
public Coins getIncomingBaseFee(ChannelId channelId) {
|
||||
return grpcFees.getIncomingBaseFee(channelId).orElseThrow(IllegalStateException::new);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user