{ "openapi": "3.0.0", "info": { "title": "Antelope Transactions Api", "summary": "Transactions information from the Antelope blockchains, powered by Substreams", "license": { "name": "MIT", "url": "https://github.com/pinax-network/antelope-transactions-api/blob/75db1c61477ac7ea5e56f775cefe54875af953d4/LICENSE" }, "version": "0.1.0" }, "tags": [ { "name": "Usage" }, { "name": "Blocks" }, { "name": "Transactions" }, { "name": "Actions" }, { "name": "DBOps" }, { "name": "Docs" }, { "name": "Monitoring" } ], "paths": { "/actions/account/{account}": { "get": { "tags": [ "Usage", "Actions" ], "operationId": "Usage_actionsAccount", "summary": "Actions", "description": "Actions by account.", "parameters": [ { "name": "account", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 10 } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 1 } } ], "responses": { "200": { "description": "Array of actions.", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "meta" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Models.Actions" } }, "meta": { "$ref": "#/components/schemas/ResponseMetadata" } } } } } }, "default": { "description": "An unexpected error response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } } }, "security": [ { "ApiKeyAuth": [] } ] } }, "/actions/date/{date}": { "get": { "tags": [ "Usage", "Actions" ], "operationId": "Usage_actionsDate", "summary": "Actions", "description": "Actions by date.", "parameters": [ { "name": "date", "in": "path", "required": true, "schema": { "type": "string", "format": "date" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 10 } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 1 } } ], "responses": { "200": { "description": "Array of actions.", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "meta" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Models.Actions" } }, "meta": { "$ref": "#/components/schemas/ResponseMetadata" } } } } } }, "default": { "description": "An unexpected error response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } } }, "security": [ { "ApiKeyAuth": [] } ] } }, "/actions/name/{name}": { "get": { "tags": [ "Usage", "Actions" ], "operationId": "Usage_actionsName", "summary": "Actions", "description": "Actions by name.", "parameters": [ { "name": "name", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 10 } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 1 } } ], "responses": { "200": { "description": "Array of actions.", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "meta" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Models.Actions" } }, "meta": { "$ref": "#/components/schemas/ResponseMetadata" } } } } } }, "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_blocksDate", "summary": "Blocks by date", "description": "Blocks by date.", "parameters": [ { "name": "date", "in": "path", "required": true, "schema": { "type": "string", "format": "date" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 10 } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 1 } } ], "responses": { "200": { "description": "Array of blocks.", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "meta" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Models.Blocks" } }, "meta": { "$ref": "#/components/schemas/ResponseMetadata" } } } } } }, "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_blocksHash", "summary": "Blocks by hash", "description": "Blocks by hash.", "parameters": [ { "name": "hash", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 10 } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 1 } } ], "responses": { "200": { "description": "Array of blocks.", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "meta" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Models.Blocks" } }, "meta": { "$ref": "#/components/schemas/ResponseMetadata" } } } } } }, "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_blocksNumber", "summary": "Blocks by block number", "description": "Blocks by block number.", "parameters": [ { "name": "number", "in": "path", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 10 } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 1 } } ], "responses": { "200": { "description": "Array of blocks.", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "meta" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Models.Blocks" } }, "meta": { "$ref": "#/components/schemas/ResponseMetadata" } } } } } }, "default": { "description": "An unexpected error response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } } }, "security": [ { "ApiKeyAuth": [] } ] } }, "/dbops/date/{date}": { "get": { "tags": [ "Usage", "DBOps" ], "operationId": "Usage_dbopsDate", "summary": "DBOps", "description": "DBOp by date.", "parameters": [ { "name": "date", "in": "path", "required": true, "schema": { "type": "string", "format": "date" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 10 } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 1 } } ], "responses": { "200": { "description": "Array of dbops.", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "meta" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Models.DBOps" } }, "meta": { "$ref": "#/components/schemas/ResponseMetadata" } } } } } }, "default": { "description": "An unexpected error response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } } }, "security": [ { "ApiKeyAuth": [] } ] } }, "/dbops/pk/{pk}": { "get": { "tags": [ "Usage", "DBOps" ], "operationId": "Usage_dbopsPk", "summary": "DBOps", "description": "DBOp by primary key.", "parameters": [ { "name": "pk", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 10 } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 1 } } ], "responses": { "200": { "description": "Array of dbops.", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "meta" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Models.DBOps" } }, "meta": { "$ref": "#/components/schemas/ResponseMetadata" } } } } } }, "default": { "description": "An unexpected error response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } } }, "security": [ { "ApiKeyAuth": [] } ] } }, "/dbops/scope/{scope}": { "get": { "tags": [ "Usage", "DBOps" ], "operationId": "Usage_dbopsScope", "summary": "DBOps", "description": "DBOps by contract.DBOp by scope.", "parameters": [ { "name": "scope", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 10 } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 1 } } ], "responses": { "200": { "description": "Array of dbops.", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "meta" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Models.DBOps" } }, "meta": { "$ref": "#/components/schemas/ResponseMetadata" } } } } } }, "default": { "description": "An unexpected error response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } } }, "security": [ { "ApiKeyAuth": [] } ] } }, "/health": { "get": { "tags": [ "Monitoring" ], "operationId": "Monitoring_health", "summary": "Health check", "description": "Checks database connection.", "parameters": [], "responses": { "200": { "description": "OK or ApiError.", "content": { "application/json": { "schema": { "type": "string" } } } }, "default": { "description": "An unexpected error response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } } } } }, "/metrics": { "get": { "tags": [ "Monitoring" ], "operationId": "Monitoring_metrics", "summary": "Prometheus metrics", "description": "Prometheus metrics.", "parameters": [], "responses": { "200": { "description": "Metrics as text.", "content": { "application/json": { "schema": { "type": "string" } } } }, "default": { "description": "An unexpected error response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } } } } }, "/openapi": { "get": { "tags": [ "Docs" ], "operationId": "Docs_openapi", "summary": "OpenAPI JSON spec", "description": "Reflection endpoint to return OpenAPI JSON spec. Also used by Swagger to generate the frontpage.", "parameters": [], "responses": { "200": { "description": "The OpenAPI JSON spec", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": {} } } } }, "default": { "description": "An unexpected error response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } } } } }, "/transactions/date/{date}": { "get": { "tags": [ "Usage", "Transactions" ], "operationId": "Usage_transactionsDate", "summary": "Transactions", "description": "Transactions by date.", "parameters": [ { "name": "date", "in": "path", "required": true, "schema": { "type": "string", "format": "date" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 10 } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 1 } } ], "responses": { "200": { "description": "Array of transactions.", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "meta" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Models.Transactions" } }, "meta": { "$ref": "#/components/schemas/ResponseMetadata" } } } } } }, "default": { "description": "An unexpected error response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } } }, "security": [ { "ApiKeyAuth": [] } ] } }, "/transactions/hash/{hash}": { "get": { "tags": [ "Usage", "Transactions" ], "operationId": "Usage_transactionsHash", "summary": "Transactions by hash", "description": "Transactions by hash.", "parameters": [ { "name": "hash", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 10 } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 1 } } ], "responses": { "200": { "description": "Array of transactions.", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "meta" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Models.Transactions" } }, "meta": { "$ref": "#/components/schemas/ResponseMetadata" } } } } } }, "default": { "description": "An unexpected error response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } } }, "security": [ { "ApiKeyAuth": [] } ] } }, "/version": { "get": { "tags": [ "Docs" ], "operationId": "Docs_version", "summary": "Api version", "description": "Api version and Git short commit hash.", "parameters": [], "responses": { "200": { "description": "The Api version and commit hash.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Version" } } } }, "default": { "description": "An unexpected error response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } } } } } }, "components": { "schemas": { "ApiError": { "type": "object", "required": [ "status", "code", "message" ], "properties": { "status": { "type": "number", "enum": [ 500, 504, 400, 401, 403, 404, 405 ] }, "code": { "type": "string", "enum": [ "bad_database_response", "bad_header", "missing_required_header", "bad_query_input", "database_timeout", "forbidden", "internal_server_error", "method_not_allowed", "route_not_found", "unauthorized" ] }, "message": { "type": "string" } } }, "Models.Actions": { "type": "object", "required": [ "block_time", "block_number", "block_hash", "block_date", "tx_hash", "tx_index", "tx_status", "tx_status_code", "tx_success", "abi_sequence", "code_sequence", "digest", "global_sequence", "receipt_receiver", "recv_sequence", "account", "name", "json_data", "raw_data", "index", "receiver", "context_free", "elapsed", "console", "raw_return_value", "json_return_value", "creator_action_ordinal", "closest_unnotified_ancestor_action_ordinal", "execution_index", "action_mroot" ], "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_index": { "type": "integer", "format": "uint64" }, "tx_status": { "type": "string" }, "tx_status_code": { "type": "integer", "format": "uint8" }, "tx_success": { "type": "boolean" }, "abi_sequence": { "type": "integer", "format": "uint64" }, "code_sequence": { "type": "integer", "format": "uint64" }, "digest": { "type": "string" }, "global_sequence": { "type": "integer", "format": "uint64" }, "receipt_receiver": { "type": "string" }, "recv_sequence": { "type": "integer", "format": "uint64" }, "account": { "type": "string" }, "name": { "type": "string" }, "json_data": { "type": "string" }, "raw_data": { "type": "string" }, "index": { "type": "integer", "format": "uint32" }, "receiver": { "type": "string" }, "context_free": { "type": "boolean" }, "elapsed": { "type": "integer", "format": "int64" }, "console": { "type": "string" }, "raw_return_value": { "type": "string" }, "json_return_value": { "type": "string" }, "creator_action_ordinal": { "type": "integer", "format": "uint32" }, "closest_unnotified_ancestor_action_ordinal": { "type": "integer", "format": "uint32" }, "execution_index": { "type": "integer", "format": "uint32" }, "action_mroot": { "type": "string" } } }, "Models.Blocks": { "type": "object", "required": [ "time", "number", "hash", "date", "parent_hash", "producer", "confirmed", "schedule_version", "version", "producer_signature", "dpos_proposed_irreversible_blocknum", "dpos_irreversible_blocknum", "transaction_mroot", "action_mroot", "blockroot_merkle_node_count", "size", "total_transactions", "successful_transactions", "failed_transactions", "total_actions", "total_db_ops" ], "properties": { "time": { "type": "string", "format": "date-time" }, "number": { "type": "integer", "format": "uint64" }, "hash": { "type": "string" }, "date": { "type": "string", "format": "date" }, "parent_hash": { "type": "string" }, "producer": { "type": "string" }, "confirmed": { "type": "integer", "format": "uint32" }, "schedule_version": { "type": "integer", "format": "uint32" }, "version": { "type": "integer", "format": "uint32" }, "producer_signature": { "type": "string" }, "dpos_proposed_irreversible_blocknum": { "type": "integer", "format": "uint32" }, "dpos_irreversible_blocknum": { "type": "integer", "format": "uint32" }, "transaction_mroot": { "type": "string" }, "action_mroot": { "type": "string" }, "blockroot_merkle_node_count": { "type": "integer", "format": "uint32" }, "size": { "type": "integer", "format": "uint64" }, "total_transactions": { "type": "integer", "format": "uint64" }, "successful_transactions": { "type": "integer", "format": "uint64" }, "failed_transactions": { "type": "integer", "format": "uint64" }, "total_actions": { "type": "integer", "format": "uint64" }, "total_db_ops": { "type": "integer", "format": "uint64" } } }, "Models.DBOps": { "type": "object", "required": [ "block_time", "block_number", "block_hash", "block_date", "tx_hash", "tx_index", "tx_status", "tx_status_code", "tx_success", "index", "operation", "operation_code", "action_index", "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_index": { "type": "integer", "format": "uint64" }, "tx_status": { "type": "string" }, "tx_status_code": { "type": "integer", "format": "uint8" }, "tx_success": { "type": "boolean" }, "index": { "type": "integer", "format": "uint32" }, "operation": { "type": "string" }, "operation_code": { "type": "integer", "format": "uint8" }, "action_index": { "type": "integer", "format": "uint32" }, "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": [ "block_time", "block_number", "block_hash", "block_date", "hash", "index", "elapsed", "net_usage", "scheduled", "cpu_usage_micro_seconds", "net_usage_words", "status", "status_code", "success", "transaction_mroot" ], "properties": { "block_time": { "type": "string", "format": "date-time" }, "block_number": { "type": "integer", "format": "uint64" }, "block_hash": { "type": "string" }, "block_date": { "type": "string", "format": "date" }, "hash": { "type": "string" }, "index": { "type": "integer", "format": "uint64" }, "elapsed": { "type": "integer", "format": "int64" }, "net_usage": { "type": "integer", "format": "uint64" }, "scheduled": { "type": "boolean" }, "cpu_usage_micro_seconds": { "type": "integer", "format": "uint32" }, "net_usage_words": { "type": "integer", "format": "uint32" }, "status": { "type": "string" }, "status_code": { "type": "integer", "format": "uint8" }, "success": { "type": "boolean" }, "transaction_mroot": { "type": "string" } } }, "Pagination": { "type": "object", "required": [ "next_page", "previous_page", "total_pages", "total_results" ], "properties": { "next_page": { "type": "integer", "format": "int64" }, "previous_page": { "type": "integer", "format": "int64" }, "total_pages": { "type": "integer", "format": "int64" }, "total_results": { "type": "integer", "format": "int64" } } }, "QueryStatistics": { "type": "object", "required": [ "elapsed", "rows_read", "bytes_read" ], "properties": { "elapsed": { "type": "number" }, "rows_read": { "type": "integer", "format": "int64" }, "bytes_read": { "type": "integer", "format": "int64" } } }, "ResponseMetadata": { "type": "object", "required": [ "statistics", "next_page", "previous_page", "total_pages", "total_results" ], "properties": { "statistics": { "type": "object", "allOf": [ { "$ref": "#/components/schemas/QueryStatistics" } ], "nullable": true }, "next_page": { "type": "integer", "format": "int64" }, "previous_page": { "type": "integer", "format": "int64" }, "total_pages": { "type": "integer", "format": "int64" }, "total_results": { "type": "integer", "format": "int64" } } }, "Version": { "type": "object", "required": [ "version", "commit" ], "properties": { "version": { "type": "string", "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$" }, "commit": { "type": "string", "pattern": "^[0-9a-f]{7}$" } } } }, "securitySchemes": { "ApiKeyAuth": { "type": "apiKey", "in": "header", "name": "X-Api-Key" } } } }