+
diff --git a/frontend/src/types.ts b/frontend/src/types.ts
index 225a3dd2..db85f927 100644
--- a/frontend/src/types.ts
+++ b/frontend/src/types.ts
@@ -742,3 +742,11 @@ export type GetForwardsResponse = {
totalFeeEarnedMsat: number;
numForwards: number;
};
+
+export type GetTransactionStatsResponse = {
+ totalVolumeSat: number;
+ totalVolumeMsat: number;
+ totalFeesPaidSat: number;
+ totalFeesPaidMsat: number;
+ numPayments: number;
+};
diff --git a/http/http_service.go b/http/http_service.go
index 1714e895..eefbda03 100644
--- a/http/http_service.go
+++ b/http/http_service.go
@@ -138,6 +138,7 @@ func (httpSvc *HttpService) RegisterSharedRoutes(e *echo.Echo) {
readOnlyApiGroup.GET("/wallet/address", httpSvc.onchainAddressHandler)
readOnlyApiGroup.GET("/wallet/capabilities", httpSvc.capabilitiesHandler)
readOnlyApiGroup.GET("/transactions", httpSvc.listTransactionsHandler)
+ readOnlyApiGroup.GET("/transactions/stats", httpSvc.transactionStatsHandler)
readOnlyApiGroup.GET("/transactions/:paymentHash", httpSvc.lookupTransactionHandler)
readOnlyApiGroup.GET("/balances", httpSvc.balancesHandler)
readOnlyApiGroup.GET("/mempool", httpSvc.mempoolApiHandler)
@@ -1606,3 +1607,14 @@ func (httpSvc *HttpService) forwardsHandler(c echo.Context) error {
return c.JSON(http.StatusOK, forwards)
}
+
+func (httpSvc *HttpService) transactionStatsHandler(c echo.Context) error {
+ stats, err := httpSvc.api.GetTransactionStats()
+ if err != nil {
+ return c.JSON(http.StatusInternalServerError, ErrorResponse{
+ Message: fmt.Sprintf("Failed to get transaction stats: %s", err.Error()),
+ })
+ }
+
+ return c.JSON(http.StatusOK, stats)
+}