diff --git a/README.md b/README.md index a13e6ec..6304d8c 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ > Transactions information from the Antelope blockchains, powered by [Substreams](https://substreams.streamingfast.io/) - - + + ## Swagger API @@ -14,14 +14,20 @@ | Path | Description | | :------ | ----------- | | GET `/actions/tx_hash/{tx_hash}` | Actions by transaction | +| GET `/actions/block_number/{block_number}` | Actions by block | +| GET `/actions/block_date/{block_date}` | Actions by date | | GET `/authorizations/tx_hash/{tx_hash}` | Authorizations by transaction | -| GET `/blocks/date/{date}` | Blocks by date | +| GET `/authorizations/block_number/{block_number}` | Authorizations by block | +| GET `/authorizations/block_date/{block_date}` | Authorizations by date | | GET `/blocks/hash/{hash}` | Blocks by hash | | GET `/blocks/number/{number}` | Blocks by number | +| GET `/blocks/date/{date}` | Blocks by date | | GET `/db_ops/tx_hash/{tx_hash}` | Database operations by transaction | -| GET `/transactions/block_date/{block_date}` | Transactions by date | -| GET `/transactions/block_number/{block_number}` | Transactions by block | +| GET `/db_ops/block_number/{block_number}` | Database operations by block | +| GET `/db_ops/block_date/{block_date}` | Database operations by date | | GET `/transactions/hash/{hash}` | Transactions by hash | +| GET `/transactions/block_number/{block_number}` | Transactions by block | +| GET `/transactions/block_date/{block_date}` | Transactions by date | > [!NOTE] > All endpoints support `first`, `skip`, `order_by`, `order_direction` as additional query parameters. diff --git a/src/types/zod.gen.ts b/src/types/zod.gen.ts index c83209a..5f8a7d0 100644 --- a/src/types/zod.gen.ts +++ b/src/types/zod.gen.ts @@ -17,7 +17,11 @@ export const modelsBlocksSchema = z.object({ "time": z.string().datetime(), "num export type ModelsBlocksSchema = z.infer; -export const modelsTransactionsSchema = z.object({ "block_time": z.string().datetime(), "block_number": z.coerce.number(), "block_hash": z.coerce.string(), "block_date": z.string().date(), "hash": z.coerce.string(), "index": z.coerce.number(), "elapsed": z.coerce.number(), "net_usage": z.coerce.number(), "scheduled": z.boolean(), "cpu_usage_micro_seconds": z.coerce.number(), "net_usage_words": z.coerce.number(), "status": z.coerce.string(), "status_code": z.coerce.number(), "success": z.boolean(), "transaction_mroot": z.coerce.string() }); +export const modelsDbOpsSchema = z.object({ "block_time": z.string().datetime(), "block_number": z.coerce.number(), "block_hash": z.coerce.string(), "block_date": z.string().date(), "tx_hash": z.coerce.string(), "tx_success": z.boolean(), "action_index": z.coerce.number(), "index": z.coerce.number(), "operation": z.coerce.string(), "operation_code": z.coerce.number(), "code": z.coerce.string(), "scope": z.coerce.string(), "table_name": z.coerce.string(), "primary_key": z.coerce.string(), "old_payer": z.coerce.string(), "new_payer": z.coerce.string(), "old_data": z.coerce.string(), "new_data": z.coerce.string(), "old_data_json": z.coerce.string(), "new_data_json": z.coerce.string() }); +export type ModelsDbOpsSchema = z.infer; + + +export const modelsTransactionsSchema = z.object({ "block_time": z.string().datetime(), "block_number": z.coerce.number(), "block_hash": z.coerce.string(), "block_date": z.string().date(), "hash": z.coerce.string(), "index": z.coerce.number(), "elapsed": z.coerce.number(), "net_usage": z.coerce.number(), "scheduled": z.boolean(), "cpu_usage_micro_seconds": z.coerce.number(), "net_usage_words": z.coerce.number(), "status": z.enum(["Executed"]), "status_code": z.coerce.number(), "success": z.boolean(), "transaction_mroot": z.coerce.string() }); export type ModelsTransactionsSchema = z.infer; @@ -25,10 +29,54 @@ export const versionSchema = z.object({ "version": z.coerce.string().regex(new R export type VersionSchema = z.infer; +export const usageActionsByDatePathParamsSchema = z.object({ "block_date": z.string().date() }); +export type UsageActionsByDatePathParamsSchema = z.infer; + + export const usageActionsByDateQueryParamsSchema = z.object({ "account": z.coerce.string().optional(), "name": z.coerce.string().optional(), "receiver": z.coerce.string().optional(), "order_by": z.enum(["block_number,index", "block_number"]).default("block_number,index").optional(), "order_direction": z.enum(["asc", "desc"]).default("asc").optional(), "first": z.coerce.number().optional(), "skip": z.coerce.number().optional() }).optional(); +export type UsageActionsByDateQueryParamsSchema = z.infer; +/** + * @description The request has succeeded. + */ +export const usageActionsByDate200Schema = z.object({ "data": z.array(z.lazy(() => modelsActionsSchema)), "statistics": z.object({ "elapsed": z.coerce.number(), "rows_read": z.coerce.number(), "bytes_read": z.coerce.number() }), "rows": z.coerce.number(), "rows_before_limit_at_least": z.coerce.number() }); +export type UsageActionsByDate200Schema = z.infer; +/** + * @description An unexpected error response. + */ +export const usageActionsByDateErrorSchema = z.lazy(() => apiErrorSchema); +export type UsageActionsByDateErrorSchema = z.infer; +/** + * @description The request has succeeded. + */ +export const usageActionsByDateQueryResponseSchema = z.object({ "data": z.array(z.lazy(() => modelsActionsSchema)), "statistics": z.object({ "elapsed": z.coerce.number(), "rows_read": z.coerce.number(), "bytes_read": z.coerce.number() }), "rows": z.coerce.number(), "rows_before_limit_at_least": z.coerce.number() }); +export type UsageActionsByDateQueryResponseSchema = z.infer; + + +export const usageActionsByBlockPathParamsSchema = z.object({ "block_number": z.coerce.number() }); +export type UsageActionsByBlockPathParamsSchema = z.infer; + + export const usageActionsByBlockQueryParamsSchema = z.object({ "account": z.coerce.string().optional(), "name": z.coerce.string().optional(), "receiver": z.coerce.string().optional(), "order_by": z.enum(["block_number,index", "block_number"]).default("block_number,index").optional(), "order_direction": z.enum(["asc", "desc"]).default("asc").optional(), "first": z.coerce.number().optional(), "skip": z.coerce.number().optional() }).optional(); +export type UsageActionsByBlockQueryParamsSchema = z.infer; +/** + * @description The request has succeeded. + */ +export const usageActionsByBlock200Schema = z.object({ "data": z.array(z.lazy(() => modelsActionsSchema)), "statistics": z.object({ "elapsed": z.coerce.number(), "rows_read": z.coerce.number(), "bytes_read": z.coerce.number() }), "rows": z.coerce.number(), "rows_before_limit_at_least": z.coerce.number() }); +export type UsageActionsByBlock200Schema = z.infer; +/** + * @description An unexpected error response. + */ +export const usageActionsByBlockErrorSchema = z.lazy(() => apiErrorSchema); +export type UsageActionsByBlockErrorSchema = z.infer; +/** + * @description The request has succeeded. + */ +export const usageActionsByBlockQueryResponseSchema = z.object({ "data": z.array(z.lazy(() => modelsActionsSchema)), "statistics": z.object({ "elapsed": z.coerce.number(), "rows_read": z.coerce.number(), "bytes_read": z.coerce.number() }), "rows": z.coerce.number(), "rows_before_limit_at_least": z.coerce.number() }); +export type UsageActionsByBlockQueryResponseSchema = z.infer; + + export const usageActionsByTransactionPathParamsSchema = z.object({ "tx_hash": z.coerce.string() }); export type UsageActionsByTransactionPathParamsSchema = z.infer; - export const usageActionsByTransactionQueryParamsSchema = z.object({ "order_by": z.enum(["index"]).default("index").optional(), "order_direction": z.enum(["asc", "desc"]).default("asc").optional(), "first": z.coerce.number().optional(), "skip": z.coerce.number().optional() }).optional(); + export const usageActionsByTransactionQueryParamsSchema = z.object({ "account": z.coerce.string().optional(), "name": z.coerce.string().optional(), "receiver": z.coerce.string().optional(), "order_by": z.enum(["index"]).default("index").optional(), "order_direction": z.enum(["asc", "desc"]).default("asc").optional(), "first": z.coerce.number().optional(), "skip": z.coerce.number().optional() }).optional(); export type UsageActionsByTransactionQueryParamsSchema = z.infer; /** * @description The request has succeeded. @@ -47,26 +95,70 @@ export const usageActionsByTransactionQueryResponseSchema = z.object({ "data": z export type UsageActionsByTransactionQueryResponseSchema = z.infer; -export const usageAuthorizationsPathParamsSchema = z.object({ "tx_hash": z.coerce.string() }); -export type UsageAuthorizationsPathParamsSchema = z.infer; +export const usageAuthorizationsByDatePathParamsSchema = z.object({ "block_date": z.string().date() }); +export type UsageAuthorizationsByDatePathParamsSchema = z.infer; + + export const usageAuthorizationsByDateQueryParamsSchema = z.object({ "actor": z.coerce.string().optional(), "permission": z.coerce.string().optional(), "action_index": z.coerce.number().optional(), "order_by": z.enum(["block_number,action_index,index", "block_number", "action_index", "index"]).default("block_number,action_index,index").optional(), "order_direction": z.enum(["asc", "desc"]).default("asc").optional(), "first": z.coerce.number().optional(), "skip": z.coerce.number().optional() }).optional(); +export type UsageAuthorizationsByDateQueryParamsSchema = z.infer; +/** + * @description The request has succeeded. + */ +export const usageAuthorizationsByDate200Schema = z.object({ "data": z.array(z.lazy(() => modelsAuthorizationsSchema)), "statistics": z.object({ "elapsed": z.coerce.number(), "rows_read": z.coerce.number(), "bytes_read": z.coerce.number() }), "rows": z.coerce.number(), "rows_before_limit_at_least": z.coerce.number() }); +export type UsageAuthorizationsByDate200Schema = z.infer; +/** + * @description An unexpected error response. + */ +export const usageAuthorizationsByDateErrorSchema = z.lazy(() => apiErrorSchema); +export type UsageAuthorizationsByDateErrorSchema = z.infer; +/** + * @description The request has succeeded. + */ +export const usageAuthorizationsByDateQueryResponseSchema = z.object({ "data": z.array(z.lazy(() => modelsAuthorizationsSchema)), "statistics": z.object({ "elapsed": z.coerce.number(), "rows_read": z.coerce.number(), "bytes_read": z.coerce.number() }), "rows": z.coerce.number(), "rows_before_limit_at_least": z.coerce.number() }); +export type UsageAuthorizationsByDateQueryResponseSchema = z.infer; + + +export const usageAuthorizationsByBlockPathParamsSchema = z.object({ "block_number": z.coerce.number() }); +export type UsageAuthorizationsByBlockPathParamsSchema = z.infer; - export const usageAuthorizationsQueryParamsSchema = z.object({ "action_index": z.coerce.number().optional(), "order_by": z.enum(["action_index,index", "action_index", "index"]).default("action_index,index").optional(), "order_direction": z.enum(["asc", "desc"]).default("asc").optional(), "first": z.coerce.number().optional(), "skip": z.coerce.number().optional() }).optional(); -export type UsageAuthorizationsQueryParamsSchema = z.infer; + export const usageAuthorizationsByBlockQueryParamsSchema = z.object({ "actor": z.coerce.string().optional(), "permission": z.coerce.string().optional(), "action_index": z.coerce.number().optional(), "order_by": z.enum(["block_number,action_index,index", "block_number", "action_index", "index"]).default("block_number,action_index,index").optional(), "order_direction": z.enum(["asc", "desc"]).default("asc").optional(), "first": z.coerce.number().optional(), "skip": z.coerce.number().optional() }).optional(); +export type UsageAuthorizationsByBlockQueryParamsSchema = z.infer; /** * @description The request has succeeded. */ -export const usageAuthorizations200Schema = z.object({ "data": z.array(z.lazy(() => modelsAuthorizationsSchema)), "statistics": z.object({ "elapsed": z.coerce.number(), "rows_read": z.coerce.number(), "bytes_read": z.coerce.number() }), "rows": z.coerce.number(), "rows_before_limit_at_least": z.coerce.number() }); -export type UsageAuthorizations200Schema = z.infer; +export const usageAuthorizationsByBlock200Schema = z.object({ "data": z.array(z.lazy(() => modelsAuthorizationsSchema)), "statistics": z.object({ "elapsed": z.coerce.number(), "rows_read": z.coerce.number(), "bytes_read": z.coerce.number() }), "rows": z.coerce.number(), "rows_before_limit_at_least": z.coerce.number() }); +export type UsageAuthorizationsByBlock200Schema = z.infer; /** * @description An unexpected error response. */ -export const usageAuthorizationsErrorSchema = z.lazy(() => apiErrorSchema); -export type UsageAuthorizationsErrorSchema = z.infer; +export const usageAuthorizationsByBlockErrorSchema = z.lazy(() => apiErrorSchema); +export type UsageAuthorizationsByBlockErrorSchema = z.infer; /** * @description The request has succeeded. */ -export const usageAuthorizationsQueryResponseSchema = z.object({ "data": z.array(z.lazy(() => modelsAuthorizationsSchema)), "statistics": z.object({ "elapsed": z.coerce.number(), "rows_read": z.coerce.number(), "bytes_read": z.coerce.number() }), "rows": z.coerce.number(), "rows_before_limit_at_least": z.coerce.number() }); -export type UsageAuthorizationsQueryResponseSchema = z.infer; +export const usageAuthorizationsByBlockQueryResponseSchema = z.object({ "data": z.array(z.lazy(() => modelsAuthorizationsSchema)), "statistics": z.object({ "elapsed": z.coerce.number(), "rows_read": z.coerce.number(), "bytes_read": z.coerce.number() }), "rows": z.coerce.number(), "rows_before_limit_at_least": z.coerce.number() }); +export type UsageAuthorizationsByBlockQueryResponseSchema = z.infer; + + +export const usageAuthorizationsByTransactionPathParamsSchema = z.object({ "tx_hash": z.coerce.string() }); +export type UsageAuthorizationsByTransactionPathParamsSchema = z.infer; + + export const usageAuthorizationsByTransactionQueryParamsSchema = z.object({ "actor": z.coerce.string().optional(), "permission": z.coerce.string().optional(), "action_index": z.coerce.number().optional(), "order_by": z.enum(["action_index,index", "action_index", "index"]).default("action_index,index").optional(), "order_direction": z.enum(["asc", "desc"]).default("asc").optional(), "first": z.coerce.number().optional(), "skip": z.coerce.number().optional() }).optional(); +export type UsageAuthorizationsByTransactionQueryParamsSchema = z.infer; +/** + * @description The request has succeeded. + */ +export const usageAuthorizationsByTransaction200Schema = z.object({ "data": z.array(z.lazy(() => modelsAuthorizationsSchema)), "statistics": z.object({ "elapsed": z.coerce.number(), "rows_read": z.coerce.number(), "bytes_read": z.coerce.number() }), "rows": z.coerce.number(), "rows_before_limit_at_least": z.coerce.number() }); +export type UsageAuthorizationsByTransaction200Schema = z.infer; +/** + * @description An unexpected error response. + */ +export const usageAuthorizationsByTransactionErrorSchema = z.lazy(() => apiErrorSchema); +export type UsageAuthorizationsByTransactionErrorSchema = z.infer; +/** + * @description The request has succeeded. + */ +export const usageAuthorizationsByTransactionQueryResponseSchema = z.object({ "data": z.array(z.lazy(() => modelsAuthorizationsSchema)), "statistics": z.object({ "elapsed": z.coerce.number(), "rows_read": z.coerce.number(), "bytes_read": z.coerce.number() }), "rows": z.coerce.number(), "rows_before_limit_at_least": z.coerce.number() }); +export type UsageAuthorizationsByTransactionQueryResponseSchema = z.infer; export const usageBlocksByDatePathParamsSchema = z.object({ "date": z.string().date() }); @@ -129,26 +221,70 @@ export const usageBlocksByNumberQueryResponseSchema = z.object({ "data": z.array export type UsageBlocksByNumberQueryResponseSchema = z.infer; -export const usageDbOpsPathParamsSchema = z.object({ "tx_hash": z.coerce.string() }); -export type UsageDbOpsPathParamsSchema = z.infer; +export const usageDbOpsByDatePathParamsSchema = z.object({ "block_date": z.string().date() }); +export type UsageDbOpsByDatePathParamsSchema = z.infer; + + export const usageDbOpsByDateQueryParamsSchema = z.object({ "code": z.coerce.string().optional(), "table_name": z.coerce.string().optional(), "scope": z.coerce.string().optional(), "primary_key": z.coerce.string().optional(), "order_by": z.enum(["block_number,index", "block_number"]).default("block_number,index").optional(), "order_direction": z.enum(["asc", "desc"]).default("asc").optional(), "first": z.coerce.number().optional(), "skip": z.coerce.number().optional() }).optional(); +export type UsageDbOpsByDateQueryParamsSchema = z.infer; +/** + * @description The request has succeeded. + */ +export const usageDbOpsByDate200Schema = z.object({ "data": z.array(z.lazy(() => modelsDbOpsSchema)), "statistics": z.object({ "elapsed": z.coerce.number(), "rows_read": z.coerce.number(), "bytes_read": z.coerce.number() }), "rows": z.coerce.number(), "rows_before_limit_at_least": z.coerce.number() }); +export type UsageDbOpsByDate200Schema = z.infer; +/** + * @description An unexpected error response. + */ +export const usageDbOpsByDateErrorSchema = z.lazy(() => apiErrorSchema); +export type UsageDbOpsByDateErrorSchema = z.infer; +/** + * @description The request has succeeded. + */ +export const usageDbOpsByDateQueryResponseSchema = z.object({ "data": z.array(z.lazy(() => modelsDbOpsSchema)), "statistics": z.object({ "elapsed": z.coerce.number(), "rows_read": z.coerce.number(), "bytes_read": z.coerce.number() }), "rows": z.coerce.number(), "rows_before_limit_at_least": z.coerce.number() }); +export type UsageDbOpsByDateQueryResponseSchema = z.infer; + + +export const usageDbOpsByBlockPathParamsSchema = z.object({ "block_number": z.coerce.number() }); +export type UsageDbOpsByBlockPathParamsSchema = z.infer; - export const usageDbOpsQueryParamsSchema = z.object({ "action_index": z.coerce.number().optional(), "order_by": z.enum(["index", "action_index"]).default("index").optional(), "order_direction": z.enum(["asc", "desc"]).default("asc").optional(), "first": z.coerce.number().optional(), "skip": z.coerce.number().optional() }).optional(); -export type UsageDbOpsQueryParamsSchema = z.infer; + export const usageDbOpsByBlockQueryParamsSchema = z.object({ "code": z.coerce.string().optional(), "table_name": z.coerce.string().optional(), "scope": z.coerce.string().optional(), "primary_key": z.coerce.string().optional(), "order_by": z.enum(["index"]).default("index").optional(), "order_direction": z.enum(["asc", "desc"]).default("asc").optional(), "first": z.coerce.number().optional(), "skip": z.coerce.number().optional() }).optional(); +export type UsageDbOpsByBlockQueryParamsSchema = z.infer; /** * @description The request has succeeded. */ -export const usageDbOps200Schema = z.object({ "data": z.array(z.lazy(() => modelsAuthorizationsSchema)), "statistics": z.object({ "elapsed": z.coerce.number(), "rows_read": z.coerce.number(), "bytes_read": z.coerce.number() }), "rows": z.coerce.number(), "rows_before_limit_at_least": z.coerce.number() }); -export type UsageDbOps200Schema = z.infer; +export const usageDbOpsByBlock200Schema = z.object({ "data": z.array(z.lazy(() => modelsDbOpsSchema)), "statistics": z.object({ "elapsed": z.coerce.number(), "rows_read": z.coerce.number(), "bytes_read": z.coerce.number() }), "rows": z.coerce.number(), "rows_before_limit_at_least": z.coerce.number() }); +export type UsageDbOpsByBlock200Schema = z.infer; /** * @description An unexpected error response. */ -export const usageDbOpsErrorSchema = z.lazy(() => apiErrorSchema); -export type UsageDbOpsErrorSchema = z.infer; +export const usageDbOpsByBlockErrorSchema = z.lazy(() => apiErrorSchema); +export type UsageDbOpsByBlockErrorSchema = z.infer; /** * @description The request has succeeded. */ -export const usageDbOpsQueryResponseSchema = z.object({ "data": z.array(z.lazy(() => modelsAuthorizationsSchema)), "statistics": z.object({ "elapsed": z.coerce.number(), "rows_read": z.coerce.number(), "bytes_read": z.coerce.number() }), "rows": z.coerce.number(), "rows_before_limit_at_least": z.coerce.number() }); -export type UsageDbOpsQueryResponseSchema = z.infer; +export const usageDbOpsByBlockQueryResponseSchema = z.object({ "data": z.array(z.lazy(() => modelsDbOpsSchema)), "statistics": z.object({ "elapsed": z.coerce.number(), "rows_read": z.coerce.number(), "bytes_read": z.coerce.number() }), "rows": z.coerce.number(), "rows_before_limit_at_least": z.coerce.number() }); +export type UsageDbOpsByBlockQueryResponseSchema = z.infer; + + +export const usageDbOpsByTransactionPathParamsSchema = z.object({ "tx_hash": z.coerce.string() }); +export type UsageDbOpsByTransactionPathParamsSchema = z.infer; + + export const usageDbOpsByTransactionQueryParamsSchema = z.object({ "code": z.coerce.string().optional(), "table_name": z.coerce.string().optional(), "scope": z.coerce.string().optional(), "primary_key": z.coerce.string().optional(), "order_by": z.enum(["index"]).default("index").optional(), "order_direction": z.enum(["asc", "desc"]).default("asc").optional(), "first": z.coerce.number().optional(), "skip": z.coerce.number().optional() }).optional(); +export type UsageDbOpsByTransactionQueryParamsSchema = z.infer; +/** + * @description The request has succeeded. + */ +export const usageDbOpsByTransaction200Schema = z.object({ "data": z.array(z.lazy(() => modelsDbOpsSchema)), "statistics": z.object({ "elapsed": z.coerce.number(), "rows_read": z.coerce.number(), "bytes_read": z.coerce.number() }), "rows": z.coerce.number(), "rows_before_limit_at_least": z.coerce.number() }); +export type UsageDbOpsByTransaction200Schema = z.infer; +/** + * @description An unexpected error response. + */ +export const usageDbOpsByTransactionErrorSchema = z.lazy(() => apiErrorSchema); +export type UsageDbOpsByTransactionErrorSchema = z.infer; +/** + * @description The request has succeeded. + */ +export const usageDbOpsByTransactionQueryResponseSchema = z.object({ "data": z.array(z.lazy(() => modelsDbOpsSchema)), "statistics": z.object({ "elapsed": z.coerce.number(), "rows_read": z.coerce.number(), "bytes_read": z.coerce.number() }), "rows": z.coerce.number(), "rows_before_limit_at_least": z.coerce.number() }); +export type UsageDbOpsByTransactionQueryResponseSchema = z.infer; /** * @description OK or ApiError. @@ -202,7 +338,7 @@ export type DocsOpenapiQueryResponseSchema = z.infer; - export const usageTransactionsByBlockDateQueryParamsSchema = z.object({ "order_by": z.enum(["block_number,index", "block_number", "index"]).default("block_number,index").optional(), "order_direction": z.enum(["asc", "desc"]).default("asc").optional(), "first": z.coerce.number().optional(), "skip": z.coerce.number().optional() }).optional(); + export const usageTransactionsByBlockDateQueryParamsSchema = z.object({ "order_by": z.enum(["block_number,index", "block_number"]).default("block_number,index").optional(), "order_direction": z.enum(["asc", "desc"]).default("asc").optional(), "first": z.coerce.number().optional(), "skip": z.coerce.number().optional() }).optional(); export type UsageTransactionsByBlockDateQueryParamsSchema = z.infer; /** * @description The request has succeeded. @@ -277,7 +413,31 @@ export type DocsVersionErrorSchema = z.infer; export const docsVersionQueryResponseSchema = z.lazy(() => versionSchema); export type DocsVersionQueryResponseSchema = z.infer; - export const operations = { "Usage_actionsByTransaction": { + export const operations = { "Usage_actionsByDate": { + request: undefined, + parameters: { + path: usageActionsByDatePathParamsSchema, + query: usageActionsByDateQueryParamsSchema, + header: undefined + }, + responses: { + 200: usageActionsByDateQueryResponseSchema, + default: usageActionsByDateQueryResponseSchema + }, + errors: {} + }, "Usage_actionsByBlock": { + request: undefined, + parameters: { + path: usageActionsByBlockPathParamsSchema, + query: usageActionsByBlockQueryParamsSchema, + header: undefined + }, + responses: { + 200: usageActionsByBlockQueryResponseSchema, + default: usageActionsByBlockQueryResponseSchema + }, + errors: {} + }, "Usage_actionsByTransaction": { request: undefined, parameters: { path: usageActionsByTransactionPathParamsSchema, @@ -289,16 +449,40 @@ export type DocsVersionQueryResponseSchema = z.infer) transactionsByBlockNumber( @path block_number: Models.Transactions.block_number, - @query order_by?: "index" = "index", + ...OrderByIndex, ...OrderDirection, ...PaginationFilters, ): ApiResponse>; @@ -145,10 +187,7 @@ interface Usage { @useAuth(ApiKeyAuth) transactionsByBlockDate( @path block_date: Models.Transactions.block_date, - - @query - order_by?: "block_number,index" | "block_number" | "index" = "block_number,index", - + ...OrderByBlockIndex, ...OrderDirection, ...PaginationFilters, ): ApiResponse>; @@ -163,7 +202,34 @@ interface Usage { @useAuth(ApiKeyAuth) actionsByTransaction( @path tx_hash: Models.Actions.tx_hash, - @query order_by?: "index" = "index", + ...ActionsFilters, + ...OrderByIndex, + ...OrderDirection, + ...PaginationFilters, + ): ApiResponse>; + + @tag("Actions") + @summary("Actions by block") + @route("/actions/block_number/{block_number}") + @get + @useAuth(ApiKeyAuth) + actionsByBlock( + @path block_number: Models.Actions.block_number, + ...ActionsFilters, + ...OrderByBlockIndex, + ...OrderDirection, + ...PaginationFilters, + ): ApiResponse>; + + @tag("Actions") + @summary("Actions by date") + @route("/actions/block_date/{block_date}") + @get + @useAuth(ApiKeyAuth) + actionsByDate( + @path block_date: Models.Actions.block_date, + ...ActionsFilters, + ...OrderByBlockIndex, ...OrderDirection, ...PaginationFilters, ): ApiResponse>; @@ -176,13 +242,39 @@ interface Usage { @route("/db_ops/tx_hash/{tx_hash}") @get @useAuth(ApiKeyAuth) - db_ops( + dbOpsByTransaction( @path tx_hash: Models.DbOps.tx_hash, - @query action_index?: Models.DbOps.action_index, - @query order_by?: "index" | "action_index" = "index", + ...DbOpsFilters, + ...OrderByIndex, ...OrderDirection, ...PaginationFilters, - ): ApiResponse>; + ): ApiResponse>; + + @tag("Database Operations") + @summary("Database operations by block") + @route("/db_ops/block_number/{block_number}") + @get + @useAuth(ApiKeyAuth) + dbOpsByBlock( + @path block_number: Models.DbOps.block_number, + ...DbOpsFilters, + ...OrderByIndex, + ...OrderDirection, + ...PaginationFilters, + ): ApiResponse>; + + @tag("Database Operations") + @summary("Database operations by date") + @route("/db_ops/block_date/{block_date}") + @get + @useAuth(ApiKeyAuth) + dbOpsByDate( + @path block_date: Models.DbOps.block_date, + ...DbOpsFilters, + ...OrderByBlockIndex, + ...OrderDirection, + ...PaginationFilters, + ): ApiResponse>; // =========================================================== // Authorizations @@ -192,13 +284,36 @@ interface Usage { @route("/authorizations/tx_hash/{tx_hash}") @get @useAuth(ApiKeyAuth) - authorizations( + authorizationsByTransaction( @path tx_hash: Models.Authorizations.tx_hash, - @query action_index?: Models.Authorizations.action_index, + ...AuthorizationsFilters, + ...OrderByActionIndex, + ...OrderDirection, + ...PaginationFilters, + ): ApiResponse>; - @query - order_by?: "action_index,index" | "action_index" | "index" = "action_index,index", + @tag("Authorizations") + @summary("Authorizations by block") + @route("/authorizations/block_number/{block_number}") + @get + @useAuth(ApiKeyAuth) + authorizationsByBlock( + @path block_number: Models.Authorizations.block_number, + ...AuthorizationsFilters, + ...OrderByBlockActionIndex, + ...OrderDirection, + ...PaginationFilters, + ): ApiResponse>; + @tag("Authorizations") + @summary("Authorizations by date") + @route("/authorizations/block_date/{block_date}") + @get + @useAuth(ApiKeyAuth) + authorizationsByDate( + @path block_date: Models.Authorizations.block_date, + ...AuthorizationsFilters, + ...OrderByBlockActionIndex, ...OrderDirection, ...PaginationFilters, ): ApiResponse>; diff --git a/static/@typespec/openapi3/openapi.json b/static/@typespec/openapi3/openapi.json index 322e346..38569c6 100644 --- a/static/@typespec/openapi3/openapi.json +++ b/static/@typespec/openapi3/openapi.json @@ -36,19 +36,44 @@ } ], "paths": { - "/actions/tx_hash/{tx_hash}": { + "/actions/block_date/{block_date}": { "get": { "tags": [ "Usage", "Actions" ], - "operationId": "Usage_actionsByTransaction", - "summary": "Actions by transaction", + "operationId": "Usage_actionsByDate", + "summary": "Actions by date", "parameters": [ { - "name": "tx_hash", + "name": "block_date", "in": "path", "required": true, + "schema": { + "type": "string", + "format": "date" + } + }, + { + "name": "account", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "receiver", + "in": "query", + "required": false, "schema": { "type": "string" } @@ -60,9 +85,10 @@ "schema": { "type": "string", "enum": [ - "index" + "block_number,index", + "block_number" ], - "default": "index" + "default": "block_number,index" } }, { @@ -171,30 +197,206 @@ ] } }, - "/authorizations/tx_hash/{tx_hash}": { + "/actions/block_number/{block_number}": { "get": { "tags": [ "Usage", - "Authorizations" + "Actions" ], - "operationId": "Usage_authorizations", - "summary": "Authorizations by transaction", + "operationId": "Usage_actionsByBlock", + "summary": "Actions by block", "parameters": [ { - "name": "tx_hash", + "name": "block_number", "in": "path", "required": true, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + { + "name": "account", + "in": "query", + "required": false, "schema": { "type": "string" } }, { - "name": "action_index", + "name": "name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "receiver", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "order_by", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "block_number,index", + "block_number" + ], + "default": "block_number,index" + } + }, + { + "name": "order_direction", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "default": "asc" + } + }, + { + "name": "first", "in": "query", "required": false, "schema": { "type": "integer", - "format": "uint32" + "format": "int64", + "default": 20 + } + }, + { + "name": "skip", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "default": 0 + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "data", + "statistics", + "rows", + "rows_before_limit_at_least" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Models.Actions" + } + }, + "statistics": { + "type": "object", + "properties": { + "elapsed": { + "type": "number" + }, + "rows_read": { + "type": "integer", + "format": "int64" + }, + "bytes_read": { + "type": "integer", + "format": "int64" + } + }, + "required": [ + "elapsed", + "rows_read", + "bytes_read" + ] + }, + "rows": { + "type": "integer", + "format": "int64" + }, + "rows_before_limit_at_least": { + "type": "integer", + "format": "int64" + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiError" + } + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/actions/tx_hash/{tx_hash}": { + "get": { + "tags": [ + "Usage", + "Actions" + ], + "operationId": "Usage_actionsByTransaction", + "summary": "Actions by transaction", + "parameters": [ + { + "name": "tx_hash", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "account", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "receiver", + "in": "query", + "required": false, + "schema": { + "type": "string" } }, { @@ -204,11 +406,9 @@ "schema": { "type": "string", "enum": [ - "action_index,index", - "action_index", "index" ], - "default": "action_index,index" + "default": "index" } }, { @@ -262,7 +462,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/Models.Authorizations" + "$ref": "#/components/schemas/Models.Actions" } }, "statistics": { @@ -317,17 +517,17 @@ ] } }, - "/blocks/date/{date}": { + "/authorizations/block_date/{block_date}": { "get": { "tags": [ "Usage", - "Blocks" + "Authorizations" ], - "operationId": "Usage_blocksByDate", - "summary": "Blocks by date", + "operationId": "Usage_authorizationsByDate", + "summary": "Authorizations by date", "parameters": [ { - "name": "date", + "name": "block_date", "in": "path", "required": true, "schema": { @@ -335,6 +535,31 @@ "format": "date" } }, + { + "name": "actor", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "permission", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "action_index", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "uint32" + } + }, { "name": "order_by", "in": "query", @@ -342,9 +567,12 @@ "schema": { "type": "string", "enum": [ - "number" + "block_number,action_index,index", + "block_number", + "action_index", + "index" ], - "default": "number" + "default": "block_number,action_index,index" } }, { @@ -398,7 +626,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/Models.Blocks" + "$ref": "#/components/schemas/Models.Authorizations" } }, "statistics": { @@ -435,39 +663,761 @@ } } }, - "default": { - "description": "An unexpected error response.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApiError" - } - } + "default": { + "description": "An unexpected error response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiError" + } + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/authorizations/block_number/{block_number}": { + "get": { + "tags": [ + "Usage", + "Authorizations" + ], + "operationId": "Usage_authorizationsByBlock", + "summary": "Authorizations by block", + "parameters": [ + { + "name": "block_number", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "uint64" + } + }, + { + "name": "actor", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "permission", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "action_index", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "uint32" + } + }, + { + "name": "order_by", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "block_number,action_index,index", + "block_number", + "action_index", + "index" + ], + "default": "block_number,action_index,index" + } + }, + { + "name": "order_direction", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "default": "asc" + } + }, + { + "name": "first", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "default": 20 + } + }, + { + "name": "skip", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "default": 0 + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "data", + "statistics", + "rows", + "rows_before_limit_at_least" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Models.Authorizations" + } + }, + "statistics": { + "type": "object", + "properties": { + "elapsed": { + "type": "number" + }, + "rows_read": { + "type": "integer", + "format": "int64" + }, + "bytes_read": { + "type": "integer", + "format": "int64" + } + }, + "required": [ + "elapsed", + "rows_read", + "bytes_read" + ] + }, + "rows": { + "type": "integer", + "format": "int64" + }, + "rows_before_limit_at_least": { + "type": "integer", + "format": "int64" + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiError" + } + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/authorizations/tx_hash/{tx_hash}": { + "get": { + "tags": [ + "Usage", + "Authorizations" + ], + "operationId": "Usage_authorizationsByTransaction", + "summary": "Authorizations by transaction", + "parameters": [ + { + "name": "tx_hash", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "actor", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "permission", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "action_index", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "uint32" + } + }, + { + "name": "order_by", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "action_index,index", + "action_index", + "index" + ], + "default": "action_index,index" + } + }, + { + "name": "order_direction", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "default": "asc" + } + }, + { + "name": "first", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "default": 20 + } + }, + { + "name": "skip", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "default": 0 + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "data", + "statistics", + "rows", + "rows_before_limit_at_least" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Models.Authorizations" + } + }, + "statistics": { + "type": "object", + "properties": { + "elapsed": { + "type": "number" + }, + "rows_read": { + "type": "integer", + "format": "int64" + }, + "bytes_read": { + "type": "integer", + "format": "int64" + } + }, + "required": [ + "elapsed", + "rows_read", + "bytes_read" + ] + }, + "rows": { + "type": "integer", + "format": "int64" + }, + "rows_before_limit_at_least": { + "type": "integer", + "format": "int64" + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiError" + } + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/blocks/date/{date}": { + "get": { + "tags": [ + "Usage", + "Blocks" + ], + "operationId": "Usage_blocksByDate", + "summary": "Blocks by date", + "parameters": [ + { + "name": "date", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "date" + } + }, + { + "name": "order_by", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "number" + ], + "default": "number" + } + }, + { + "name": "order_direction", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "default": "asc" + } + }, + { + "name": "first", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "default": 20 + } + }, + { + "name": "skip", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "default": 0 + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "data", + "statistics", + "rows", + "rows_before_limit_at_least" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Models.Blocks" + } + }, + "statistics": { + "type": "object", + "properties": { + "elapsed": { + "type": "number" + }, + "rows_read": { + "type": "integer", + "format": "int64" + }, + "bytes_read": { + "type": "integer", + "format": "int64" + } + }, + "required": [ + "elapsed", + "rows_read", + "bytes_read" + ] + }, + "rows": { + "type": "integer", + "format": "int64" + }, + "rows_before_limit_at_least": { + "type": "integer", + "format": "int64" + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiError" + } + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/blocks/hash/{hash}": { + "get": { + "tags": [ + "Usage", + "Blocks" + ], + "operationId": "Usage_blocksByHash", + "summary": "Blocks by hash", + "parameters": [ + { + "name": "hash", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "data", + "statistics", + "rows", + "rows_before_limit_at_least" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Models.Blocks" + } + }, + "statistics": { + "type": "object", + "properties": { + "elapsed": { + "type": "number" + }, + "rows_read": { + "type": "integer", + "format": "int64" + }, + "bytes_read": { + "type": "integer", + "format": "int64" + } + }, + "required": [ + "elapsed", + "rows_read", + "bytes_read" + ] + }, + "rows": { + "type": "integer", + "format": "int64" + }, + "rows_before_limit_at_least": { + "type": "integer", + "format": "int64" + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiError" + } + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/blocks/number/{number}": { + "get": { + "tags": [ + "Usage", + "Blocks" + ], + "operationId": "Usage_blocksByNumber", + "summary": "Blocks by number", + "parameters": [ + { + "name": "number", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "uint64" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "data", + "statistics", + "rows", + "rows_before_limit_at_least" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Models.Blocks" + } + }, + "statistics": { + "type": "object", + "properties": { + "elapsed": { + "type": "number" + }, + "rows_read": { + "type": "integer", + "format": "int64" + }, + "bytes_read": { + "type": "integer", + "format": "int64" + } + }, + "required": [ + "elapsed", + "rows_read", + "bytes_read" + ] + }, + "rows": { + "type": "integer", + "format": "int64" + }, + "rows_before_limit_at_least": { + "type": "integer", + "format": "int64" + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiError" + } + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/db_ops/block_date/{block_date}": { + "get": { + "tags": [ + "Usage", + "Database Operations" + ], + "operationId": "Usage_dbOpsByDate", + "summary": "Database operations by date", + "parameters": [ + { + "name": "block_date", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "date" + } + }, + { + "name": "code", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "table_name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "scope", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "primary_key", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "order_by", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "block_number,index", + "block_number" + ], + "default": "block_number,index" } - } - }, - "security": [ + }, { - "ApiKeyAuth": [] - } - ] - } - }, - "/blocks/hash/{hash}": { - "get": { - "tags": [ - "Usage", - "Blocks" - ], - "operationId": "Usage_blocksByHash", - "summary": "Blocks by hash", - "parameters": [ + "name": "order_direction", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "default": "asc" + } + }, { - "name": "hash", - "in": "path", - "required": true, + "name": "first", + "in": "query", + "required": false, "schema": { - "type": "string" + "type": "integer", + "format": "int64", + "default": 20 + } + }, + { + "name": "skip", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "default": 0 } } ], @@ -488,7 +1438,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/Models.Blocks" + "$ref": "#/components/schemas/Models.DbOps" } }, "statistics": { @@ -543,23 +1493,100 @@ ] } }, - "/blocks/number/{number}": { + "/db_ops/block_number/{block_number}": { "get": { "tags": [ "Usage", - "Blocks" + "Database Operations" ], - "operationId": "Usage_blocksByNumber", - "summary": "Blocks by number", + "operationId": "Usage_dbOpsByBlock", + "summary": "Database operations by block", "parameters": [ { - "name": "number", + "name": "block_number", "in": "path", "required": true, "schema": { "type": "integer", "format": "uint64" } + }, + { + "name": "code", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "table_name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "scope", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "primary_key", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "order_by", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "index" + ], + "default": "index" + } + }, + { + "name": "order_direction", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "default": "asc" + } + }, + { + "name": "first", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "default": 20 + } + }, + { + "name": "skip", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "default": 0 + } } ], "responses": { @@ -579,7 +1606,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/Models.Blocks" + "$ref": "#/components/schemas/Models.DbOps" } }, "statistics": { @@ -640,7 +1667,7 @@ "Usage", "Database Operations" ], - "operationId": "Usage_db_ops", + "operationId": "Usage_dbOpsByTransaction", "summary": "Database operations by transaction", "parameters": [ { @@ -652,12 +1679,35 @@ } }, { - "name": "action_index", + "name": "code", "in": "query", "required": false, "schema": { - "type": "integer", - "format": "uint32" + "type": "string" + } + }, + { + "name": "table_name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "scope", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "primary_key", + "in": "query", + "required": false, + "schema": { + "type": "string" } }, { @@ -667,8 +1717,7 @@ "schema": { "type": "string", "enum": [ - "index", - "action_index" + "index" ], "default": "index" } @@ -724,7 +1773,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/Models.Authorizations" + "$ref": "#/components/schemas/Models.DbOps" } }, "statistics": { @@ -905,8 +1954,7 @@ "type": "string", "enum": [ "block_number,index", - "block_number", - "index" + "block_number" ], "default": "block_number,index" } @@ -1604,6 +2652,99 @@ } } }, + "Models.DbOps": { + "type": "object", + "required": [ + "block_time", + "block_number", + "block_hash", + "block_date", + "tx_hash", + "tx_success", + "action_index", + "index", + "operation", + "operation_code", + "code", + "scope", + "table_name", + "primary_key", + "old_payer", + "new_payer", + "old_data", + "new_data", + "old_data_json", + "new_data_json" + ], + "properties": { + "block_time": { + "type": "string", + "format": "date-time" + }, + "block_number": { + "type": "integer", + "format": "uint64" + }, + "block_hash": { + "type": "string" + }, + "block_date": { + "type": "string", + "format": "date" + }, + "tx_hash": { + "type": "string" + }, + "tx_success": { + "type": "boolean" + }, + "action_index": { + "type": "integer", + "format": "uint32" + }, + "index": { + "type": "integer", + "format": "uint32" + }, + "operation": { + "type": "string" + }, + "operation_code": { + "type": "integer", + "format": "uint8" + }, + "code": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "table_name": { + "type": "string" + }, + "primary_key": { + "type": "string" + }, + "old_payer": { + "type": "string" + }, + "new_payer": { + "type": "string" + }, + "old_data": { + "type": "string" + }, + "new_data": { + "type": "string" + }, + "old_data_json": { + "type": "string" + }, + "new_data_json": { + "type": "string" + } + } + }, "Models.Transactions": { "type": "object", "required": [ @@ -1666,7 +2807,10 @@ "format": "uint32" }, "status": { - "type": "string" + "type": "string", + "enum": [ + "Executed" + ] }, "status_code": { "type": "integer",