mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-22 23:44:21 +01:00
add /balance endpoint for channels
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package de.cotto.lndmanagej.controller;
|
||||
|
||||
import com.codahale.metrics.MetricRegistry;
|
||||
import de.cotto.lndmanagej.controller.dto.BalanceInformationDto;
|
||||
import de.cotto.lndmanagej.controller.dto.ChannelDetailsDto;
|
||||
import de.cotto.lndmanagej.controller.dto.FeeConfigurationDto;
|
||||
import de.cotto.lndmanagej.controller.dto.ObjectMapperConfiguration;
|
||||
@@ -71,6 +72,14 @@ public class ChannelController {
|
||||
);
|
||||
}
|
||||
|
||||
@GetMapping("/balance")
|
||||
public BalanceInformationDto getBalance(@PathVariable ChannelId channelId) {
|
||||
metrics.mark(MetricRegistry.name(getClass(), "getBalance"));
|
||||
BalanceInformation balanceInformation = balanceService.getBalanceInformation(channelId)
|
||||
.orElse(BalanceInformation.EMPTY);
|
||||
return BalanceInformationDto.createFrom(balanceInformation);
|
||||
}
|
||||
|
||||
@GetMapping("/fee-configuration")
|
||||
public FeeConfigurationDto getFeeConfiguration(@PathVariable ChannelId channelId) {
|
||||
metrics.mark(MetricRegistry.name(getClass(), "getFeeConfiguration"));
|
||||
|
||||
Reference in New Issue
Block a user