Skip to content

Commit b6e16ea

Browse files
authored
chore: rename aex9-transfers route and add docs (#1979)
1 parent 94fb010 commit b6e16ea

File tree

3 files changed

+58
-3
lines changed

3 files changed

+58
-3
lines changed

docs/swagger_v3/stats.spec.yaml

+55
Original file line numberDiff line numberDiff line change
@@ -695,3 +695,58 @@ paths:
695695
application/json:
696696
schema:
697697
$ref: '#/components/schemas/ErrorResponse'
698+
/stats/aex9-transfers:
699+
get:
700+
deprecated: false
701+
description: Get total AEx9 token transfers.
702+
operationId: GetNamesStats
703+
parameters:
704+
- name: interval_by
705+
description: The interval in which to return the stats.
706+
in: query
707+
required: false
708+
schema:
709+
type: string
710+
enum:
711+
- day
712+
- week
713+
- month
714+
example: week
715+
- name: min_start_date
716+
description: The minimum start date in YYYY-MM-DD format.
717+
in: query
718+
required: false
719+
schema:
720+
type: string
721+
example: "2023-01-01"
722+
- name: max_start_date
723+
description: The maximum start date in YYYY-MM-DD format.
724+
in: query
725+
required: false
726+
schema:
727+
type: string
728+
example: "2024-01-01"
729+
- $ref: '#/components/parameters/LimitParam'
730+
- $ref: '#/components/parameters/DirectionParam'
731+
responses:
732+
'200':
733+
description: Returns paginated AEx9 transfer stats
734+
content:
735+
application/json:
736+
schema:
737+
allOf:
738+
- type: object
739+
required:
740+
- data
741+
properties:
742+
data:
743+
type: array
744+
items:
745+
$ref: '#/components/schemas/Stat'
746+
- $ref: '#/components/schemas/PaginatedResponse'
747+
'400':
748+
description: Bad request
749+
content:
750+
application/json:
751+
schema:
752+
$ref: '#/components/schemas/ErrorResponse'

lib/ae_mdw_web/controllers/stats_controller.ex

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ defmodule AeMdwWeb.StatsController do
105105
end
106106
end
107107

108-
@spec aex9_token_transfers_stats(Conn.t(), map()) :: Conn.t()
109-
def aex9_token_transfers_stats(%Conn{assigns: assigns} = conn, _params) do
108+
@spec aex9_transfers_stats(Conn.t(), map()) :: Conn.t()
109+
def aex9_transfers_stats(%Conn{assigns: assigns} = conn, _params) do
110110
%{state: state, pagination: pagination, query: query, scope: scope, cursor: cursor} = assigns
111111

112112
with {:ok, paginated_stats} <-

lib/ae_mdw_web/router.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ defmodule AeMdwWeb.Router do
7474
get "/stats/delta", StatsController, :delta_stats
7575
get "/stats/miners", StatsController, :miners_stats
7676
get "/stats/contracts", StatsController, :contracts_stats
77-
get "/stats/aex9-token-transfers", StatsController, :aex9_token_transfers_stats
77+
get "/stats/aex9-transfers", StatsController, :aex9_transfers_stats
7878
get "/stats", StatsController, :stats
7979

8080
get "/names", NameController, :names

0 commit comments

Comments
 (0)