diff --git a/bfxapi/rest/endpoints/rest_authenticated_endpoints.py b/bfxapi/rest/endpoints/rest_authenticated_endpoints.py index a69ea28..1493489 100644 --- a/bfxapi/rest/endpoints/rest_authenticated_endpoints.py +++ b/bfxapi/rest/endpoints/rest_authenticated_endpoints.py @@ -348,4 +348,7 @@ class RestAuthenticatedEndpoints(Middleware): }) ] def get_invoice_count_stats(self, status: Literal["CREATED", "PENDING", "COMPLETED", "EXPIRED"], format: str) -> List[InvoiceCountStats]: - return [ InvoiceCountStats(**sub_data) for sub_data in self._POST("auth/r/ext/pay/invoice/stats/count", body={ "status": status, "format": format }) ] \ No newline at end of file + return [ InvoiceCountStats(**sub_data) for sub_data in self._POST("auth/r/ext/pay/invoice/stats/count", body={ "status": status, "format": format }) ] + + def get_invoice_earning_stats(self, currency: str, format: str) -> List[InvoiceEarningStats]: + return [ InvoiceEarningStats(**sub_data) for sub_data in self._POST("auth/r/ext/pay/invoice/stats/earning", body={ "currency": currency, "format": format }) ] \ No newline at end of file diff --git a/bfxapi/rest/types.py b/bfxapi/rest/types.py index 5f98ca8..3d659b4 100644 --- a/bfxapi/rest/types.py +++ b/bfxapi/rest/types.py @@ -618,4 +618,9 @@ class InvoiceCountStats(_Type): time: str count: float +@dataclass +class InvoiceEarningStats(_Type): + time: str + count: float + #endregion \ No newline at end of file diff --git a/examples/rest/merchant.py b/examples/rest/merchant.py index a113b3f..9e85d88 100644 --- a/examples/rest/merchant.py +++ b/examples/rest/merchant.py @@ -31,4 +31,6 @@ print(bfx.rest.auth.submit_invoice( print(bfx.rest.auth.get_invoices()) -print(bfx.rest.auth.get_invoice_count_stats(status="CREATED", format="Y")) \ No newline at end of file +print(bfx.rest.auth.get_invoice_count_stats(status="CREATED", format="Y")) + +print(bfx.rest.auth.get_invoice_earning_stats(currency="USD", format="Y")) \ No newline at end of file