From 3a33437f3084a9ceda9abd713c0547a3a54bf4f5 Mon Sep 17 00:00:00 2001 From: Artem Date: Wed, 22 Feb 2023 01:06:29 +0400 Subject: [PATCH] Remove API docs --- Makefile | 6 - build/api/Dockerfile | 2 - cmd/api/docs/docs.go | 3772 ----------------------------------- cmd/api/docs/swagger.json | 3746 ---------------------------------- cmd/api/docs/swagger.yaml | 2553 ------------------------ cmd/api/handlers/swagger.go | 25 - cmd/api/main.go | 4 - configs/development.yml | 1 - configs/production.yml | 1 - configs/sandbox.yml | 1 - docs/configuration.md | 1 - go.mod | 9 - go.sum | 26 - internal/config/config.go | 1 - scripts/newman/tests.json | 49 - scripts/nginx/sitemap.go | 1 - 16 files changed, 10198 deletions(-) delete mode 100644 cmd/api/docs/docs.go delete mode 100644 cmd/api/docs/swagger.json delete mode 100644 cmd/api/docs/swagger.yaml delete mode 100644 cmd/api/handlers/swagger.go diff --git a/Makefile b/Makefile index 9fd8a197c..2b0791eee 100644 --- a/Makefile +++ b/Makefile @@ -66,12 +66,6 @@ test-api: # npm install -g newman newman run ./scripts/newman/tests.json -e ./scripts/newman/env.json -docs: - # wget https://github.com/swaggo/swag/releases/download/v1.8.4/swag_1.8.4_Linux_x86_64.tar.gz - # tar -zxvf swag_1.8.4_Linux_x86_64.tar.gz - # sudo cp swag /usr/bin/swag - cd cmd/api && swag init --parseDependency --parseInternal --parseDepth 2 - stable: TAG=master docker-compose up -d api indexer diff --git a/build/api/Dockerfile b/build/api/Dockerfile index 7646f8de1..eb00d15bb 100644 --- a/build/api/Dockerfile +++ b/build/api/Dockerfile @@ -20,8 +20,6 @@ COPY cmd/api cmd/api COPY internal internal WORKDIR $GOPATH/src/github.com/baking-bad/bcdhub/cmd/api/ -RUN go install github.com/swaggo/swag/cmd/swag@v1.8.4 -RUN swag init --parseDependency --parseInternal --parseDepth 2 RUN go build -a -installsuffix cgo -o /go/bin/api . WORKDIR $GOPATH/src/github.com/baking-bad/bcdhub diff --git a/cmd/api/docs/docs.go b/cmd/api/docs/docs.go deleted file mode 100644 index 3c0e87eb4..000000000 --- a/cmd/api/docs/docs.go +++ /dev/null @@ -1,3772 +0,0 @@ -// Package docs GENERATED BY SWAG; DO NOT EDIT -// This file was generated by swaggo/swag -package docs - -import "github.com/swaggo/swag" - -const docTemplate = `{ - "schemes": {{ marshal .Schemes }}, - "swagger": "2.0", - "info": { - "description": "{{escape .Description}}", - "title": "{{.Title}}", - "contact": { - "name": "Baking Bad Team", - "url": "https://baking-bad.org/docs", - "email": "hello@baking-bad.org" - }, - "version": "{{.Version}}", - "x-logo": { - "altText": "Better Call Dev logo", - "href": "https://better-call.dev", - "url": "https://better-call.dev/img/logo_og.png" - } - }, - "host": "{{.Host}}", - "basePath": "{{.BasePath}}", - "paths": { - "/v1/account/{network}/{address}": { - "get": { - "description": "Get account info", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "account" - ], - "summary": "Get account info", - "operationId": "get-account-info", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "Address", - "name": "address", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.AccountInfo" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/bigmap/{network}/{ptr}": { - "get": { - "description": "Get big map info by pointer", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "bigmap" - ], - "summary": "Get big map info by pointer", - "operationId": "get-bigmap", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Big map pointer", - "name": "ptr", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.GetBigMapResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/bigmap/{network}/{ptr}/count": { - "get": { - "description": "Get big map diffs count info by pointer", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "bigmap" - ], - "summary": "Get big map diffs count info by pointer", - "operationId": "get-bigmapdiff-count", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Big map pointer", - "name": "ptr", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.CountResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/bigmap/{network}/{ptr}/history": { - "get": { - "description": "Get big map actions (alloc/copy/remove)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "bigmap" - ], - "summary": "Get big map actions (alloc/copy/remove)", - "operationId": "get-bigmap-history", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Big map pointer", - "name": "ptr", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.BigMapHistoryResponse" - } - }, - "204": { - "description": "No Content", - "schema": { - "$ref": "#/definitions/gin.H" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/bigmap/{network}/{ptr}/keys": { - "get": { - "description": "Get big map keys by pointer", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "bigmap" - ], - "summary": "Get big map keys by pointer", - "operationId": "get-bigmap-keys", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Big map pointer", - "name": "ptr", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Offset", - "name": "offset", - "in": "query" - }, - { - "maximum": 10, - "type": "integer", - "description": "Requested count", - "name": "size", - "in": "query" - }, - { - "minimum": 0, - "type": "integer", - "description": "Max level filter", - "name": "max_level", - "in": "query" - }, - { - "minimum": 0, - "type": "integer", - "description": "Min level filter", - "name": "min_level", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.BigMapResponseItem" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/bigmap/{network}/{ptr}/keys/{key_hash}": { - "get": { - "description": "Get big map diffs by pointer and key hash", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "bigmap" - ], - "summary": "Get big map diffs by pointer and key hash", - "operationId": "get-bigmap-keyhash", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Big map pointer", - "name": "ptr", - "in": "path", - "required": true - }, - { - "maxLength": 54, - "minLength": 54, - "type": "string", - "description": "Key hash in big map", - "name": "key_hash", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Offset", - "name": "offset", - "in": "query" - }, - { - "maximum": 10, - "type": "integer", - "description": "Requested count", - "name": "size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.BigMapDiffByKeyResponse" - } - }, - "204": { - "description": "No Content", - "schema": { - "$ref": "#/definitions/gin.H" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/bigmap/{network}/{ptr}/keys/{key_hash}/current": { - "get": { - "description": "Get current big map value by pointer and key hash", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "bigmap" - ], - "summary": "Get current big map value by pointer and key hash", - "operationId": "get-bigmap-keyhash-current", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Big map pointer", - "name": "ptr", - "in": "path", - "required": true - }, - { - "maxLength": 54, - "minLength": 54, - "type": "string", - "description": "Key hash in big map", - "name": "key_hash", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.BigMapDiffByKeyResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}": { - "get": { - "description": "Get full contract info", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get contract info", - "operationId": "get-contract", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.ContractWithStats" - } - }, - "204": { - "description": "No Content", - "schema": { - "$ref": "#/definitions/gin.H" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/code": { - "get": { - "description": "Get contract code", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get contract code", - "operationId": "get-contract-code", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Protocol", - "name": "protocol", - "in": "query" - }, - { - "type": "integer", - "description": "Level", - "name": "level", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/entrypoints": { - "get": { - "description": "Get contract entrypoints", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get contract entrypoints", - "operationId": "get-contract-entrypoints", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.EntrypointSchema" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/entrypoints/data": { - "post": { - "description": "Get entrypoint data from schema object", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get entrypoint data from schema object", - "operationId": "get-contract-entrypoints-data", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "description": "Request body", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/handlers.getEntrypointDataRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/gin.H" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/entrypoints/schema": { - "get": { - "description": "Get contract` + "`" + `s entrypoint schema", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get contract` + "`" + `s entrypoint schema", - "operationId": "get-contract-entrypoints-schema", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Entrypoint name", - "name": "entrypoint", - "in": "query", - "required": true - }, - { - "enum": [ - "empty", - "latest" - ], - "type": "string", - "description": "Fill storage type", - "name": "fill_type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.EntrypointSchema" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/entrypoints/trace": { - "post": { - "description": "Execute entrypoint with passed arguments", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Execute entrypoint with passed arguments", - "operationId": "run-code", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "description": "Request body", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/handlers.runCodeRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.Operation" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/events": { - "get": { - "description": "List contract events", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "operations" - ], - "summary": "List contract events", - "operationId": "list-events", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Offset", - "name": "offset", - "in": "query" - }, - { - "maximum": 10, - "type": "integer", - "description": "Expected events count", - "name": "size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.Event" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/global_constants": { - "get": { - "description": "Get global constants used by contract", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get global constants used by contract", - "operationId": "get-contract-global-constants", - "parameters": [ - { - "type": "string", - "description": "network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "maximum": 10, - "type": "integer", - "description": "Constants count", - "name": "size", - "in": "query" - }, - { - "type": "integer", - "description": "Offset", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.GlobalConstant" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/mempool": { - "get": { - "description": "Get contract mempool operations", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get contract mempool operations", - "operationId": "get-contract-mempool", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.Operation" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/migrations": { - "get": { - "description": "Get contract migrations", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get contract migrations", - "operationId": "get-contract-migrations", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.Migration" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/operations": { - "get": { - "description": "Get contract operations", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get contract operations", - "operationId": "get-contract-operations", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Last operation ID", - "name": "last_id", - "in": "query" - }, - { - "type": "integer", - "description": "Timestamp", - "name": "from", - "in": "query" - }, - { - "type": "integer", - "description": "Timestamp", - "name": "to", - "in": "query" - }, - { - "type": "integer", - "description": "Expected OPG count", - "name": "size", - "in": "query" - }, - { - "type": "string", - "description": "Comma-separated operations statuses", - "name": "status", - "in": "query" - }, - { - "type": "string", - "description": "Comma-separated called entrypoints list", - "name": "entrypoints", - "in": "query" - }, - { - "type": "boolean", - "description": "Include storage diff to operations or not", - "name": "with_storage_diff", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.OperationResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/opg": { - "get": { - "description": "Get operation groups by account", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get operation groups by account", - "operationId": "get-operation-groups-by-account", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Last operation ID", - "name": "last_id", - "in": "query" - }, - { - "type": "integer", - "description": "Expected OPG count", - "name": "size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.OPGResponse" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/same": { - "get": { - "description": "Get same contracts", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get same contracts", - "operationId": "get-contract-same", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Offset", - "name": "offset", - "in": "query" - }, - { - "maximum": 10, - "type": "integer", - "description": "Requested count", - "name": "size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.SameContractsResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/storage": { - "get": { - "description": "Get contract storage", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get contract storage", - "operationId": "get-contract-storage", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Level", - "name": "level", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/ast.MiguelNode" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/storage/raw": { - "get": { - "description": "Get contract raw storage", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get contract raw storage", - "operationId": "get-contract-storage-raw", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Level", - "name": "level", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - }, - "204": { - "description": "No Content", - "schema": { - "type": "string" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/storage/rich": { - "get": { - "description": "Get contract rich storage", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get contract rich storage", - "operationId": "get-contract-storage-rich", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Level", - "name": "level", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/gin.H" - } - }, - "204": { - "description": "No Content", - "schema": { - "$ref": "#/definitions/gin.H" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/storage/schema": { - "get": { - "description": "Get contract storage schema", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get contract storage schema", - "operationId": "get-contract-storage-schema", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "enum": [ - "empty", - "current", - "initial" - ], - "type": "string", - "description": "Fill storage type", - "name": "fill_type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.EntrypointSchema" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/views/execute": { - "post": { - "description": "Execute view of contracts metadata", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Execute view of contracts metadata", - "operationId": "contract-execute-view", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "description": "Request body", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/handlers.executeViewRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/ast.MiguelNode" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/views/schema": { - "get": { - "description": "Get view schemas of contract metadata", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get view schemas of contract metadata", - "operationId": "get-contract-tzip-views-schema", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "enum": [ - "on-chain", - "off-chain" - ], - "type": "string", - "description": "Views kind", - "name": "kind", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.ViewSchema" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/global_constants/{network}": { - "get": { - "description": "List global constants", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "global-constants" - ], - "summary": "List global constants", - "operationId": "list-global-constants", - "parameters": [ - { - "type": "string", - "description": "network", - "name": "network", - "in": "path", - "required": true - }, - { - "maximum": 10, - "type": "integer", - "description": "Constants count", - "name": "size", - "in": "query" - }, - { - "type": "integer", - "description": "Offset", - "name": "offset", - "in": "query" - }, - { - "enum": [ - "level", - "timestamp", - "links_count", - "address" - ], - "type": "string", - "description": "Order by", - "name": "order_by", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "description": "Sort order", - "name": "sort", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/contract.ListGlobalConstantItem" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/global_constants/{network}/{address}": { - "get": { - "description": "Get global constant", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "global-constants" - ], - "summary": "Get global constant", - "operationId": "get-global-constant", - "parameters": [ - { - "type": "string", - "description": "network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 54, - "minLength": 54, - "type": "string", - "description": "expr address of constant", - "name": "address", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.GlobalConstant" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/global_constants/{network}/{address}/contracts": { - "get": { - "description": "Get contracts that use the global constant", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "global-constants" - ], - "summary": "Get contracts that use the global constant", - "operationId": "get-global-constant-contracts", - "parameters": [ - { - "type": "string", - "description": "network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 54, - "minLength": 54, - "type": "string", - "description": "expr address of constant", - "name": "address", - "in": "path", - "required": true - }, - { - "maximum": 10, - "type": "integer", - "description": "Constants count", - "name": "size", - "in": "query" - }, - { - "type": "integer", - "description": "Offset", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.Contract" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/head": { - "get": { - "description": "Get indexer head for each network", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "head" - ], - "summary": "Show indexer head", - "operationId": "get-indexer-head", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.Head" - } - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/head/{network}": { - "get": { - "description": "Get indexer head for the network", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "head" - ], - "summary": "Show indexer head for the network", - "operationId": "get-indexer-head-by-network", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.Head" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/implicit/{network}/{counter}": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "operations" - ], - "summary": "Get implicit operation", - "operationId": "get-implicit-operation", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Counter", - "name": "counter", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.Operation" - } - } - }, - "204": { - "description": "No Content", - "schema": { - "$ref": "#/definitions/gin.H" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/off_chain_view": { - "post": { - "description": "Get JSON schema for off-chain view", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get JSON schema for off-chain view", - "operationId": "get-off-chain-view", - "parameters": [ - { - "description": "Micheline. Limit: 1MB", - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "array", - "items": { - "type": "integer" - } - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.ViewSchema" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/operation/{network}/{id}/diff": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "operations" - ], - "summary": "Get operation storage diff", - "operationId": "get-operation-diff", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Internal BCD operation ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/ast.MiguelNode" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/operation/{network}/{id}/error_location": { - "get": { - "description": "Get code line where operation failed", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "operations" - ], - "summary": "Get code line where operation failed", - "operationId": "get-operation-error-location", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Internal BCD operation ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.GetErrorLocationResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/opg/{hash}": { - "get": { - "description": "Get operation group by hash", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "operations" - ], - "summary": "Get operation group", - "operationId": "get-opg", - "parameters": [ - { - "maxLength": 51, - "minLength": 51, - "type": "string", - "description": "Operation group hash", - "name": "hash", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Search operation in mempool or not", - "name": "with_mempool", - "in": "query" - }, - { - "type": "boolean", - "description": "Include storage diff to operations or not", - "name": "with_storage_diff", - "in": "query" - }, - { - "type": "string", - "description": "Network", - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.Operation" - } - } - }, - "204": { - "description": "No Content", - "schema": { - "$ref": "#/definitions/gin.H" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/opg/{hash}/{counter}": { - "get": { - "description": "Get operations by hash and counter", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "operations" - ], - "summary": "Get operations by hash and counter", - "operationId": "get-operations-by-hash-and-counter", - "parameters": [ - { - "maxLength": 51, - "minLength": 51, - "type": "string", - "description": "Operation group hash", - "name": "hash", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Counter of main operation", - "name": "counter", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "You can set network field for better performance", - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.Operation" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/stats": { - "get": { - "description": "get indexer states for all networks", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "statistics" - ], - "summary": "Show indexer stats", - "operationId": "get-stats", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.Block" - } - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/stats/{network}/contracts_count": { - "get": { - "description": "Get contracts count", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "statistics" - ], - "summary": "Get contracts count", - "operationId": "get-contracts-count", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "integer" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/stats/{network}/recently_called_contracts": { - "get": { - "description": "Show recently called contracts", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "statistics" - ], - "summary": "Show recently called contracts", - "operationId": "get-recenly-called-contracts", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maximum": 10, - "type": "integer", - "description": "Contracts count", - "name": "size", - "in": "query" - }, - { - "type": "integer", - "description": "Offset", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.RecentlyCalledContract" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - } - }, - "definitions": { - "ast.JSONModel": { - "type": "object", - "additionalProperties": true - }, - "ast.JSONSchema": { - "type": "object", - "properties": { - "const": { - "type": "string" - }, - "default": {}, - "format": { - "type": "string" - }, - "items": { - "$ref": "#/definitions/ast.JSONSchema" - }, - "maxLength": { - "type": "integer" - }, - "minLength": { - "type": "integer" - }, - "oneOf": { - "type": "array", - "items": { - "$ref": "#/definitions/ast.JSONSchema" - } - }, - "prim": { - "type": "string" - }, - "properties": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/ast.JSONSchema" - } - }, - "required": { - "type": "array", - "items": { - "type": "string" - } - }, - "schemaKey": { - "$ref": "#/definitions/ast.JSONSchema" - }, - "tag": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "type": "string" - }, - "x-itemTitle": { - "type": "string" - }, - "x-options": { - "type": "object", - "additionalProperties": true - } - } - }, - "ast.MiguelNode": { - "type": "object", - "properties": { - "children": { - "type": "array", - "items": { - "$ref": "#/definitions/ast.MiguelNode" - } - }, - "diff_type": { - "type": "string" - }, - "from": {}, - "name": { - "type": "string" - }, - "prim": { - "type": "string" - }, - "type": { - "type": "string" - }, - "value": {} - } - }, - "ast.Typedef": { - "type": "object", - "properties": { - "args": { - "type": "array", - "items": { - "$ref": "#/definitions/ast.TypedefArg" - } - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "typedef": { - "type": "array", - "items": { - "$ref": "#/definitions/ast.Typedef" - } - } - } - }, - "ast.TypedefArg": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, - "contract.ListGlobalConstantItem": { - "type": "object", - "properties": { - "address": { - "type": "string" - }, - "level": { - "type": "integer" - }, - "links_count": { - "type": "integer" - }, - "timestamp": { - "type": "string" - } - } - }, - "contract.Sections": { - "type": "object", - "properties": { - "code": { - "type": "array", - "items": { - "type": "integer" - } - }, - "parameter": { - "type": "array", - "items": { - "type": "integer" - } - }, - "returnType": { - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "contract.ViewImplementation": { - "type": "object", - "properties": { - "michelsonStorageView": { - "$ref": "#/definitions/contract.Sections" - } - } - }, - "gin.H": { - "type": "object", - "additionalProperties": true - }, - "handlers.AccountInfo": { - "type": "object", - "properties": { - "address": { - "type": "string" - }, - "alias": { - "type": "string", - "x-nullable": true - }, - "balance": { - "type": "integer" - }, - "last_action": { - "type": "string" - }, - "network": { - "type": "string" - }, - "tx_count": { - "type": "integer" - } - } - }, - "handlers.BigMapDiffByKeyResponse": { - "type": "object", - "properties": { - "key": { - "x-nullable": true - }, - "key_hash": { - "type": "string" - }, - "total": { - "type": "integer" - }, - "values": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.BigMapDiffItem" - }, - "x-nullable": true - } - } - }, - "handlers.BigMapDiffItem": { - "type": "object", - "properties": { - "level": { - "type": "integer" - }, - "timestamp": { - "type": "string" - }, - "value": {} - } - }, - "handlers.BigMapHistoryItem": { - "type": "object", - "properties": { - "action": { - "type": "string" - }, - "destination_ptr": { - "type": "integer", - "x-nullable": true - }, - "source_ptr": { - "type": "integer", - "x-nullable": true - }, - "timestamp": { - "type": "string" - } - } - }, - "handlers.BigMapHistoryResponse": { - "type": "object", - "properties": { - "address": { - "type": "string" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.BigMapHistoryItem" - }, - "x-nullable": true - }, - "network": { - "type": "string" - }, - "ptr": { - "type": "integer" - } - } - }, - "handlers.BigMapItem": { - "type": "object", - "properties": { - "is_active": { - "type": "boolean" - }, - "key": {}, - "key_hash": { - "type": "string" - }, - "key_string": { - "type": "string" - }, - "level": { - "type": "integer" - }, - "timestamp": { - "type": "string" - } - } - }, - "handlers.BigMapResponseItem": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "data": { - "$ref": "#/definitions/handlers.BigMapItem" - } - } - }, - "handlers.Block": { - "type": "object", - "properties": { - "chain_id": { - "type": "string", - "example": "NetXdQprcVkpaWU" - }, - "cost_per_byte": { - "type": "integer", - "example": 250 - }, - "hard_gas_limit_per_operation": { - "type": "integer", - "example": 1040000 - }, - "hard_storage_limit_per_operation": { - "type": "integer", - "example": 60000 - }, - "hash": { - "type": "string", - "example": "BLyAEwaXShJuZasvUezHUfLqzZ48V8XrPvXF2wRaH15tmzEpsHT" - }, - "level": { - "type": "integer", - "example": 100 - }, - "network": { - "type": "string", - "example": "mainnet" - }, - "predecessor": { - "type": "string", - "example": "BMWVEwEYw9m5iaHzqxDfkPzZTV4rhkSouRh3DkVMVGkxZ3EVaNs" - }, - "protocol": { - "type": "string", - "example": "PtCJ7pwoxe8JasnHY8YonnLYjcVHmhiARPJvqcC6VfHT5s8k8sY" - }, - "time_between_blocks": { - "type": "integer", - "example": 30 - }, - "timestamp": { - "type": "string", - "example": "2018-06-30T18:05:27Z" - } - } - }, - "handlers.Contract": { - "type": "object", - "properties": { - "address": { - "type": "string" - }, - "alias": { - "type": "string", - "x-nullable": true - }, - "annotations": { - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true - }, - "delegate": { - "type": "string", - "x-nullable": true - }, - "delegate_alias": { - "type": "string", - "x-nullable": true - }, - "entrypoints": { - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true - }, - "fail_strings": { - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true - }, - "found_by": { - "type": "string", - "x-nullable": true - }, - "hardcoded": { - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true - }, - "hash": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_action": { - "type": "string", - "x-nullable": true - }, - "level": { - "type": "integer" - }, - "manager": { - "type": "string", - "x-nullable": true - }, - "migrations_count": { - "type": "integer", - "x-nullable": true - }, - "network": { - "type": "string" - }, - "slug": { - "type": "string", - "x-nullable": true - }, - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true - }, - "timestamp": { - "type": "string" - }, - "tx_count": { - "type": "integer", - "x-nullable": true - } - } - }, - "handlers.ContractWithStats": { - "type": "object", - "properties": { - "address": { - "type": "string" - }, - "alias": { - "type": "string", - "x-nullable": true - }, - "annotations": { - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true - }, - "delegate": { - "type": "string", - "x-nullable": true - }, - "delegate_alias": { - "type": "string", - "x-nullable": true - }, - "entrypoints": { - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true - }, - "events_count": { - "type": "integer" - }, - "fail_strings": { - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true - }, - "found_by": { - "type": "string", - "x-nullable": true - }, - "hardcoded": { - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true - }, - "hash": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_action": { - "type": "string", - "x-nullable": true - }, - "level": { - "type": "integer" - }, - "manager": { - "type": "string", - "x-nullable": true - }, - "migrations_count": { - "type": "integer", - "x-nullable": true - }, - "network": { - "type": "string" - }, - "same_count": { - "type": "integer" - }, - "slug": { - "type": "string", - "x-nullable": true - }, - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true - }, - "timestamp": { - "type": "string" - }, - "tx_count": { - "type": "integer", - "x-nullable": true - } - } - }, - "handlers.CountResponse": { - "type": "object", - "properties": { - "count": { - "type": "integer" - } - } - }, - "handlers.EntrypointSchema": { - "type": "object", - "properties": { - "default_model": { - "x-nullable": true, - "$ref": "#/definitions/ast.JSONModel" - }, - "name": { - "type": "string" - }, - "schema": { - "$ref": "#/definitions/ast.JSONSchema" - }, - "typedef": { - "type": "array", - "items": { - "$ref": "#/definitions/ast.Typedef" - } - } - } - }, - "handlers.Error": { - "type": "object", - "properties": { - "message": { - "type": "string", - "example": "text" - } - } - }, - "handlers.Event": { - "type": "object", - "properties": { - "hash": { - "type": "string" - }, - "level": { - "type": "integer" - }, - "payload": { - "type": "array", - "items": { - "$ref": "#/definitions/ast.MiguelNode" - }, - "x-nullable": true - }, - "status": { - "type": "string" - }, - "tag": { - "type": "string" - }, - "timestamp": { - "type": "string" - } - } - }, - "handlers.GetBigMapResponse": { - "type": "object", - "properties": { - "active_keys": { - "type": "integer" - }, - "address": { - "type": "string" - }, - "contract_alias": { - "type": "string", - "x-nullable": true - }, - "network": { - "type": "string" - }, - "ptr": { - "type": "integer" - }, - "total_keys": { - "type": "integer" - }, - "typedef": { - "type": "array", - "items": { - "$ref": "#/definitions/ast.Typedef" - }, - "x-nullable": true - } - } - }, - "handlers.GetErrorLocationResponse": { - "type": "object", - "properties": { - "end_col": { - "type": "integer" - }, - "failed_row": { - "type": "integer" - }, - "first_row": { - "type": "integer" - }, - "start_col": { - "type": "integer" - }, - "text": { - "type": "string" - } - } - }, - "handlers.GlobalConstant": { - "type": "object", - "properties": { - "address": { - "type": "string" - }, - "code": { - "type": "string" - }, - "level": { - "type": "integer" - }, - "timestamp": { - "type": "string" - }, - "value": { - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "handlers.Head": { - "type": "object", - "properties": { - "level": { - "type": "integer" - }, - "network": { - "type": "string" - }, - "protocol": { - "type": "string" - }, - "synced": { - "type": "boolean" - }, - "time": { - "type": "string" - } - } - }, - "handlers.Migration": { - "type": "object", - "properties": { - "hash": { - "type": "string", - "x-nullable": true - }, - "kind": { - "type": "string" - }, - "level": { - "type": "integer" - }, - "prev_protocol": { - "type": "string" - }, - "protocol": { - "type": "string" - }, - "timestamp": { - "type": "string" - } - } - }, - "handlers.OPGResponse": { - "type": "object", - "properties": { - "content_index": { - "type": "integer" - }, - "counter": { - "type": "integer" - }, - "entrypoint": { - "type": "string" - }, - "flow": { - "type": "integer" - }, - "hash": { - "type": "string" - }, - "internals": { - "type": "integer" - }, - "kind": { - "type": "string" - }, - "last_id": { - "type": "integer" - }, - "level": { - "type": "integer" - }, - "status": { - "type": "string" - }, - "timestamp": { - "type": "string" - }, - "total_cost": { - "type": "integer" - } - } - }, - "handlers.Operation": { - "type": "object", - "properties": { - "allocated_destination_contract": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "allocated_destination_contract_burned": { - "type": "integer", - "x-nullable": true - }, - "amount": { - "type": "integer", - "x-nullable": true - }, - "balance": { - "type": "integer", - "x-nullable": true - }, - "burned": { - "type": "integer", - "x-nullable": true - }, - "consumed_gas": { - "type": "integer", - "x-nullable": true, - "example": 100 - }, - "content_index": { - "type": "integer" - }, - "counter": { - "type": "integer", - "x-nullable": true - }, - "delegate": { - "type": "string", - "x-nullable": true - }, - "destination": { - "type": "string", - "x-nullable": true - }, - "destination_alias": { - "type": "string", - "x-nullable": true - }, - "entrypoint": { - "type": "string", - "x-nullable": true - }, - "errors": { - "type": "array", - "items": { - "$ref": "#/definitions/tezerrors.Error" - }, - "x-nullable": true - }, - "event": { - "type": "array", - "items": { - "$ref": "#/definitions/ast.MiguelNode" - }, - "x-nullable": true - }, - "fee": { - "type": "integer", - "x-nullable": true - }, - "gas_limit": { - "type": "integer", - "x-nullable": true - }, - "hash": { - "type": "string", - "x-nullable": true - }, - "id": { - "type": "integer", - "x-nullable": true - }, - "internal": { - "type": "boolean" - }, - "kind": { - "type": "string" - }, - "level": { - "type": "integer", - "x-nullable": true - }, - "manager_pubkey": { - "type": "string", - "x-nullable": true - }, - "mempool": { - "type": "boolean" - }, - "network": { - "type": "string" - }, - "paid_storage_size_diff": { - "type": "integer", - "x-nullable": true, - "example": 300 - }, - "parameters": { - "x-nullable": true - }, - "protocol": { - "type": "string" - }, - "public_key": { - "type": "string", - "x-nullable": true - }, - "rawMempool": { - "x-nullable": true - }, - "source": { - "type": "string", - "x-nullable": true - }, - "source_alias": { - "type": "string", - "x-nullable": true - }, - "status": { - "type": "string" - }, - "storage_diff": { - "x-nullable": true, - "$ref": "#/definitions/ast.MiguelNode" - }, - "storage_limit": { - "type": "integer", - "x-nullable": true - }, - "storage_size": { - "type": "integer", - "x-nullable": true, - "example": 200 - }, - "tag": { - "type": "string", - "x-nullable": true - }, - "timestamp": { - "type": "string" - } - } - }, - "handlers.OperationResponse": { - "type": "object", - "properties": { - "last_id": { - "type": "string", - "x-nullable": true, - "example": "1588640276994159" - }, - "operations": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.Operation" - } - } - } - }, - "handlers.RecentlyCalledContract": { - "type": "object", - "properties": { - "address": { - "type": "string" - }, - "alias": { - "type": "string", - "x-nullable": true - }, - "id": { - "type": "integer" - }, - "last_action": { - "type": "string", - "x-nullable": true - }, - "tx_count": { - "type": "integer", - "x-nullable": true - } - } - }, - "handlers.SameContractsResponse": { - "type": "object", - "properties": { - "contracts": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.ContractWithStats" - } - }, - "count": { - "type": "integer" - } - } - }, - "handlers.ViewSchema": { - "type": "object", - "properties": { - "default_model": { - "x-nullable": true - }, - "description": { - "type": "string" - }, - "error": { - "type": "string" - }, - "implementation": { - "type": "integer" - }, - "kind": { - "type": "string" - }, - "name": { - "type": "string" - }, - "schema": { - "$ref": "#/definitions/ast.JSONSchema" - }, - "typedef": { - "type": "array", - "items": { - "$ref": "#/definitions/ast.Typedef" - } - } - } - }, - "handlers.executeViewRequest": { - "type": "object", - "required": [ - "data", - "kind" - ], - "properties": { - "amount": { - "type": "integer" - }, - "data": { - "type": "object", - "additionalProperties": true - }, - "gas_limit": { - "type": "integer" - }, - "implementation": { - "type": "integer" - }, - "kind": { - "type": "string" - }, - "name": { - "type": "string" - }, - "sender": { - "type": "string" - }, - "source": { - "type": "string" - }, - "view": { - "$ref": "#/definitions/contract.ViewImplementation" - } - } - }, - "handlers.getEntrypointDataRequest": { - "type": "object", - "required": [ - "data", - "name" - ], - "properties": { - "data": { - "type": "object", - "additionalProperties": true - }, - "format": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "handlers.runCodeRequest": { - "type": "object", - "required": [ - "data", - "name" - ], - "properties": { - "amount": { - "type": "integer" - }, - "data": { - "type": "object", - "additionalProperties": true - }, - "gas_limit": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "sender": { - "type": "string" - }, - "source": { - "type": "string" - } - } - }, - "tezerrors.Error": { - "type": "object", - "properties": { - "IError": {}, - "descr": { - "type": "string" - }, - "id": { - "type": "string" - }, - "kind": { - "type": "string" - }, - "title": { - "type": "string" - } - } - } - } -}` - -// SwaggerInfo holds exported Swagger Info so clients can modify it -var SwaggerInfo = &swag.Spec{ - Version: "", - Host: "", - BasePath: "", - Schemes: []string{}, - Title: "Better Call Dev API", - Description: "This is API description for Better Call Dev service.", - InfoInstanceName: "swagger", - SwaggerTemplate: docTemplate, -} - -func init() { - swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) -} diff --git a/cmd/api/docs/swagger.json b/cmd/api/docs/swagger.json deleted file mode 100644 index 00aa236c9..000000000 --- a/cmd/api/docs/swagger.json +++ /dev/null @@ -1,3746 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "description": "This is API description for Better Call Dev service.", - "title": "Better Call Dev API", - "contact": { - "name": "Baking Bad Team", - "url": "https://baking-bad.org/docs", - "email": "hello@baking-bad.org" - }, - "x-logo": { - "altText": "Better Call Dev logo", - "href": "https://better-call.dev", - "url": "https://better-call.dev/img/logo_og.png" - } - }, - "paths": { - "/v1/account/{network}/{address}": { - "get": { - "description": "Get account info", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "account" - ], - "summary": "Get account info", - "operationId": "get-account-info", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "Address", - "name": "address", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.AccountInfo" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/bigmap/{network}/{ptr}": { - "get": { - "description": "Get big map info by pointer", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "bigmap" - ], - "summary": "Get big map info by pointer", - "operationId": "get-bigmap", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Big map pointer", - "name": "ptr", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.GetBigMapResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/bigmap/{network}/{ptr}/count": { - "get": { - "description": "Get big map diffs count info by pointer", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "bigmap" - ], - "summary": "Get big map diffs count info by pointer", - "operationId": "get-bigmapdiff-count", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Big map pointer", - "name": "ptr", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.CountResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/bigmap/{network}/{ptr}/history": { - "get": { - "description": "Get big map actions (alloc/copy/remove)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "bigmap" - ], - "summary": "Get big map actions (alloc/copy/remove)", - "operationId": "get-bigmap-history", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Big map pointer", - "name": "ptr", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.BigMapHistoryResponse" - } - }, - "204": { - "description": "No Content", - "schema": { - "$ref": "#/definitions/gin.H" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/bigmap/{network}/{ptr}/keys": { - "get": { - "description": "Get big map keys by pointer", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "bigmap" - ], - "summary": "Get big map keys by pointer", - "operationId": "get-bigmap-keys", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Big map pointer", - "name": "ptr", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Offset", - "name": "offset", - "in": "query" - }, - { - "maximum": 10, - "type": "integer", - "description": "Requested count", - "name": "size", - "in": "query" - }, - { - "minimum": 0, - "type": "integer", - "description": "Max level filter", - "name": "max_level", - "in": "query" - }, - { - "minimum": 0, - "type": "integer", - "description": "Min level filter", - "name": "min_level", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.BigMapResponseItem" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/bigmap/{network}/{ptr}/keys/{key_hash}": { - "get": { - "description": "Get big map diffs by pointer and key hash", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "bigmap" - ], - "summary": "Get big map diffs by pointer and key hash", - "operationId": "get-bigmap-keyhash", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Big map pointer", - "name": "ptr", - "in": "path", - "required": true - }, - { - "maxLength": 54, - "minLength": 54, - "type": "string", - "description": "Key hash in big map", - "name": "key_hash", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Offset", - "name": "offset", - "in": "query" - }, - { - "maximum": 10, - "type": "integer", - "description": "Requested count", - "name": "size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.BigMapDiffByKeyResponse" - } - }, - "204": { - "description": "No Content", - "schema": { - "$ref": "#/definitions/gin.H" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/bigmap/{network}/{ptr}/keys/{key_hash}/current": { - "get": { - "description": "Get current big map value by pointer and key hash", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "bigmap" - ], - "summary": "Get current big map value by pointer and key hash", - "operationId": "get-bigmap-keyhash-current", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Big map pointer", - "name": "ptr", - "in": "path", - "required": true - }, - { - "maxLength": 54, - "minLength": 54, - "type": "string", - "description": "Key hash in big map", - "name": "key_hash", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.BigMapDiffByKeyResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}": { - "get": { - "description": "Get full contract info", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get contract info", - "operationId": "get-contract", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.ContractWithStats" - } - }, - "204": { - "description": "No Content", - "schema": { - "$ref": "#/definitions/gin.H" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/code": { - "get": { - "description": "Get contract code", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get contract code", - "operationId": "get-contract-code", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Protocol", - "name": "protocol", - "in": "query" - }, - { - "type": "integer", - "description": "Level", - "name": "level", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/entrypoints": { - "get": { - "description": "Get contract entrypoints", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get contract entrypoints", - "operationId": "get-contract-entrypoints", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.EntrypointSchema" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/entrypoints/data": { - "post": { - "description": "Get entrypoint data from schema object", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get entrypoint data from schema object", - "operationId": "get-contract-entrypoints-data", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "description": "Request body", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/handlers.getEntrypointDataRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/gin.H" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/entrypoints/schema": { - "get": { - "description": "Get contract`s entrypoint schema", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get contract`s entrypoint schema", - "operationId": "get-contract-entrypoints-schema", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Entrypoint name", - "name": "entrypoint", - "in": "query", - "required": true - }, - { - "enum": [ - "empty", - "latest" - ], - "type": "string", - "description": "Fill storage type", - "name": "fill_type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.EntrypointSchema" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/entrypoints/trace": { - "post": { - "description": "Execute entrypoint with passed arguments", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Execute entrypoint with passed arguments", - "operationId": "run-code", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "description": "Request body", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/handlers.runCodeRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.Operation" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/events": { - "get": { - "description": "List contract events", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "operations" - ], - "summary": "List contract events", - "operationId": "list-events", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Offset", - "name": "offset", - "in": "query" - }, - { - "maximum": 10, - "type": "integer", - "description": "Expected events count", - "name": "size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.Event" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/global_constants": { - "get": { - "description": "Get global constants used by contract", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get global constants used by contract", - "operationId": "get-contract-global-constants", - "parameters": [ - { - "type": "string", - "description": "network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "maximum": 10, - "type": "integer", - "description": "Constants count", - "name": "size", - "in": "query" - }, - { - "type": "integer", - "description": "Offset", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.GlobalConstant" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/mempool": { - "get": { - "description": "Get contract mempool operations", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get contract mempool operations", - "operationId": "get-contract-mempool", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.Operation" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/migrations": { - "get": { - "description": "Get contract migrations", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get contract migrations", - "operationId": "get-contract-migrations", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.Migration" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/operations": { - "get": { - "description": "Get contract operations", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get contract operations", - "operationId": "get-contract-operations", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Last operation ID", - "name": "last_id", - "in": "query" - }, - { - "type": "integer", - "description": "Timestamp", - "name": "from", - "in": "query" - }, - { - "type": "integer", - "description": "Timestamp", - "name": "to", - "in": "query" - }, - { - "type": "integer", - "description": "Expected OPG count", - "name": "size", - "in": "query" - }, - { - "type": "string", - "description": "Comma-separated operations statuses", - "name": "status", - "in": "query" - }, - { - "type": "string", - "description": "Comma-separated called entrypoints list", - "name": "entrypoints", - "in": "query" - }, - { - "type": "boolean", - "description": "Include storage diff to operations or not", - "name": "with_storage_diff", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.OperationResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/opg": { - "get": { - "description": "Get operation groups by account", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get operation groups by account", - "operationId": "get-operation-groups-by-account", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Last operation ID", - "name": "last_id", - "in": "query" - }, - { - "type": "integer", - "description": "Expected OPG count", - "name": "size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.OPGResponse" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/same": { - "get": { - "description": "Get same contracts", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get same contracts", - "operationId": "get-contract-same", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Offset", - "name": "offset", - "in": "query" - }, - { - "maximum": 10, - "type": "integer", - "description": "Requested count", - "name": "size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.SameContractsResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/storage": { - "get": { - "description": "Get contract storage", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get contract storage", - "operationId": "get-contract-storage", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Level", - "name": "level", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/ast.MiguelNode" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/storage/raw": { - "get": { - "description": "Get contract raw storage", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get contract raw storage", - "operationId": "get-contract-storage-raw", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Level", - "name": "level", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - }, - "204": { - "description": "No Content", - "schema": { - "type": "string" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/storage/rich": { - "get": { - "description": "Get contract rich storage", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get contract rich storage", - "operationId": "get-contract-storage-rich", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Level", - "name": "level", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/gin.H" - } - }, - "204": { - "description": "No Content", - "schema": { - "$ref": "#/definitions/gin.H" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/storage/schema": { - "get": { - "description": "Get contract storage schema", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get contract storage schema", - "operationId": "get-contract-storage-schema", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "enum": [ - "empty", - "current", - "initial" - ], - "type": "string", - "description": "Fill storage type", - "name": "fill_type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.EntrypointSchema" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/views/execute": { - "post": { - "description": "Execute view of contracts metadata", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Execute view of contracts metadata", - "operationId": "contract-execute-view", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "description": "Request body", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/handlers.executeViewRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/ast.MiguelNode" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/contract/{network}/{address}/views/schema": { - "get": { - "description": "Get view schemas of contract metadata", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get view schemas of contract metadata", - "operationId": "get-contract-tzip-views-schema", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 36, - "minLength": 36, - "type": "string", - "description": "KT address", - "name": "address", - "in": "path", - "required": true - }, - { - "enum": [ - "on-chain", - "off-chain" - ], - "type": "string", - "description": "Views kind", - "name": "kind", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.ViewSchema" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/global_constants/{network}": { - "get": { - "description": "List global constants", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "global-constants" - ], - "summary": "List global constants", - "operationId": "list-global-constants", - "parameters": [ - { - "type": "string", - "description": "network", - "name": "network", - "in": "path", - "required": true - }, - { - "maximum": 10, - "type": "integer", - "description": "Constants count", - "name": "size", - "in": "query" - }, - { - "type": "integer", - "description": "Offset", - "name": "offset", - "in": "query" - }, - { - "enum": [ - "level", - "timestamp", - "links_count", - "address" - ], - "type": "string", - "description": "Order by", - "name": "order_by", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "description": "Sort order", - "name": "sort", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/contract.ListGlobalConstantItem" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/global_constants/{network}/{address}": { - "get": { - "description": "Get global constant", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "global-constants" - ], - "summary": "Get global constant", - "operationId": "get-global-constant", - "parameters": [ - { - "type": "string", - "description": "network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 54, - "minLength": 54, - "type": "string", - "description": "expr address of constant", - "name": "address", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.GlobalConstant" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/global_constants/{network}/{address}/contracts": { - "get": { - "description": "Get contracts that use the global constant", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "global-constants" - ], - "summary": "Get contracts that use the global constant", - "operationId": "get-global-constant-contracts", - "parameters": [ - { - "type": "string", - "description": "network", - "name": "network", - "in": "path", - "required": true - }, - { - "maxLength": 54, - "minLength": 54, - "type": "string", - "description": "expr address of constant", - "name": "address", - "in": "path", - "required": true - }, - { - "maximum": 10, - "type": "integer", - "description": "Constants count", - "name": "size", - "in": "query" - }, - { - "type": "integer", - "description": "Offset", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.Contract" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/head": { - "get": { - "description": "Get indexer head for each network", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "head" - ], - "summary": "Show indexer head", - "operationId": "get-indexer-head", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.Head" - } - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/head/{network}": { - "get": { - "description": "Get indexer head for the network", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "head" - ], - "summary": "Show indexer head for the network", - "operationId": "get-indexer-head-by-network", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.Head" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/implicit/{network}/{counter}": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "operations" - ], - "summary": "Get implicit operation", - "operationId": "get-implicit-operation", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Counter", - "name": "counter", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.Operation" - } - } - }, - "204": { - "description": "No Content", - "schema": { - "$ref": "#/definitions/gin.H" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/off_chain_view": { - "post": { - "description": "Get JSON schema for off-chain view", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "contract" - ], - "summary": "Get JSON schema for off-chain view", - "operationId": "get-off-chain-view", - "parameters": [ - { - "description": "Micheline. Limit: 1MB", - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "array", - "items": { - "type": "integer" - } - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.ViewSchema" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/operation/{network}/{id}/diff": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "operations" - ], - "summary": "Get operation storage diff", - "operationId": "get-operation-diff", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Internal BCD operation ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/ast.MiguelNode" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/operation/{network}/{id}/error_location": { - "get": { - "description": "Get code line where operation failed", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "operations" - ], - "summary": "Get code line where operation failed", - "operationId": "get-operation-error-location", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Internal BCD operation ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/handlers.GetErrorLocationResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/opg/{hash}": { - "get": { - "description": "Get operation group by hash", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "operations" - ], - "summary": "Get operation group", - "operationId": "get-opg", - "parameters": [ - { - "maxLength": 51, - "minLength": 51, - "type": "string", - "description": "Operation group hash", - "name": "hash", - "in": "path", - "required": true - }, - { - "type": "boolean", - "description": "Search operation in mempool or not", - "name": "with_mempool", - "in": "query" - }, - { - "type": "boolean", - "description": "Include storage diff to operations or not", - "name": "with_storage_diff", - "in": "query" - }, - { - "type": "string", - "description": "Network", - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.Operation" - } - } - }, - "204": { - "description": "No Content", - "schema": { - "$ref": "#/definitions/gin.H" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/opg/{hash}/{counter}": { - "get": { - "description": "Get operations by hash and counter", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "operations" - ], - "summary": "Get operations by hash and counter", - "operationId": "get-operations-by-hash-and-counter", - "parameters": [ - { - "maxLength": 51, - "minLength": 51, - "type": "string", - "description": "Operation group hash", - "name": "hash", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Counter of main operation", - "name": "counter", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "You can set network field for better performance", - "name": "network", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.Operation" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/stats": { - "get": { - "description": "get indexer states for all networks", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "statistics" - ], - "summary": "Show indexer stats", - "operationId": "get-stats", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.Block" - } - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/stats/{network}/contracts_count": { - "get": { - "description": "Get contracts count", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "statistics" - ], - "summary": "Get contracts count", - "operationId": "get-contracts-count", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "integer" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - }, - "/v1/stats/{network}/recently_called_contracts": { - "get": { - "description": "Show recently called contracts", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "statistics" - ], - "summary": "Show recently called contracts", - "operationId": "get-recenly-called-contracts", - "parameters": [ - { - "type": "string", - "description": "Network", - "name": "network", - "in": "path", - "required": true - }, - { - "maximum": 10, - "type": "integer", - "description": "Contracts count", - "name": "size", - "in": "query" - }, - { - "type": "integer", - "description": "Offset", - "name": "offset", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.RecentlyCalledContract" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/handlers.Error" - } - } - } - } - } - }, - "definitions": { - "ast.JSONModel": { - "type": "object", - "additionalProperties": true - }, - "ast.JSONSchema": { - "type": "object", - "properties": { - "const": { - "type": "string" - }, - "default": {}, - "format": { - "type": "string" - }, - "items": { - "$ref": "#/definitions/ast.JSONSchema" - }, - "maxLength": { - "type": "integer" - }, - "minLength": { - "type": "integer" - }, - "oneOf": { - "type": "array", - "items": { - "$ref": "#/definitions/ast.JSONSchema" - } - }, - "prim": { - "type": "string" - }, - "properties": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/ast.JSONSchema" - } - }, - "required": { - "type": "array", - "items": { - "type": "string" - } - }, - "schemaKey": { - "$ref": "#/definitions/ast.JSONSchema" - }, - "tag": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "type": "string" - }, - "x-itemTitle": { - "type": "string" - }, - "x-options": { - "type": "object", - "additionalProperties": true - } - } - }, - "ast.MiguelNode": { - "type": "object", - "properties": { - "children": { - "type": "array", - "items": { - "$ref": "#/definitions/ast.MiguelNode" - } - }, - "diff_type": { - "type": "string" - }, - "from": {}, - "name": { - "type": "string" - }, - "prim": { - "type": "string" - }, - "type": { - "type": "string" - }, - "value": {} - } - }, - "ast.Typedef": { - "type": "object", - "properties": { - "args": { - "type": "array", - "items": { - "$ref": "#/definitions/ast.TypedefArg" - } - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "typedef": { - "type": "array", - "items": { - "$ref": "#/definitions/ast.Typedef" - } - } - } - }, - "ast.TypedefArg": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, - "contract.ListGlobalConstantItem": { - "type": "object", - "properties": { - "address": { - "type": "string" - }, - "level": { - "type": "integer" - }, - "links_count": { - "type": "integer" - }, - "timestamp": { - "type": "string" - } - } - }, - "contract.Sections": { - "type": "object", - "properties": { - "code": { - "type": "array", - "items": { - "type": "integer" - } - }, - "parameter": { - "type": "array", - "items": { - "type": "integer" - } - }, - "returnType": { - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "contract.ViewImplementation": { - "type": "object", - "properties": { - "michelsonStorageView": { - "$ref": "#/definitions/contract.Sections" - } - } - }, - "gin.H": { - "type": "object", - "additionalProperties": true - }, - "handlers.AccountInfo": { - "type": "object", - "properties": { - "address": { - "type": "string" - }, - "alias": { - "type": "string", - "x-nullable": true - }, - "balance": { - "type": "integer" - }, - "last_action": { - "type": "string" - }, - "network": { - "type": "string" - }, - "tx_count": { - "type": "integer" - } - } - }, - "handlers.BigMapDiffByKeyResponse": { - "type": "object", - "properties": { - "key": { - "x-nullable": true - }, - "key_hash": { - "type": "string" - }, - "total": { - "type": "integer" - }, - "values": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.BigMapDiffItem" - }, - "x-nullable": true - } - } - }, - "handlers.BigMapDiffItem": { - "type": "object", - "properties": { - "level": { - "type": "integer" - }, - "timestamp": { - "type": "string" - }, - "value": {} - } - }, - "handlers.BigMapHistoryItem": { - "type": "object", - "properties": { - "action": { - "type": "string" - }, - "destination_ptr": { - "type": "integer", - "x-nullable": true - }, - "source_ptr": { - "type": "integer", - "x-nullable": true - }, - "timestamp": { - "type": "string" - } - } - }, - "handlers.BigMapHistoryResponse": { - "type": "object", - "properties": { - "address": { - "type": "string" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.BigMapHistoryItem" - }, - "x-nullable": true - }, - "network": { - "type": "string" - }, - "ptr": { - "type": "integer" - } - } - }, - "handlers.BigMapItem": { - "type": "object", - "properties": { - "is_active": { - "type": "boolean" - }, - "key": {}, - "key_hash": { - "type": "string" - }, - "key_string": { - "type": "string" - }, - "level": { - "type": "integer" - }, - "timestamp": { - "type": "string" - } - } - }, - "handlers.BigMapResponseItem": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "data": { - "$ref": "#/definitions/handlers.BigMapItem" - } - } - }, - "handlers.Block": { - "type": "object", - "properties": { - "chain_id": { - "type": "string", - "example": "NetXdQprcVkpaWU" - }, - "cost_per_byte": { - "type": "integer", - "example": 250 - }, - "hard_gas_limit_per_operation": { - "type": "integer", - "example": 1040000 - }, - "hard_storage_limit_per_operation": { - "type": "integer", - "example": 60000 - }, - "hash": { - "type": "string", - "example": "BLyAEwaXShJuZasvUezHUfLqzZ48V8XrPvXF2wRaH15tmzEpsHT" - }, - "level": { - "type": "integer", - "example": 100 - }, - "network": { - "type": "string", - "example": "mainnet" - }, - "predecessor": { - "type": "string", - "example": "BMWVEwEYw9m5iaHzqxDfkPzZTV4rhkSouRh3DkVMVGkxZ3EVaNs" - }, - "protocol": { - "type": "string", - "example": "PtCJ7pwoxe8JasnHY8YonnLYjcVHmhiARPJvqcC6VfHT5s8k8sY" - }, - "time_between_blocks": { - "type": "integer", - "example": 30 - }, - "timestamp": { - "type": "string", - "example": "2018-06-30T18:05:27Z" - } - } - }, - "handlers.Contract": { - "type": "object", - "properties": { - "address": { - "type": "string" - }, - "alias": { - "type": "string", - "x-nullable": true - }, - "annotations": { - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true - }, - "delegate": { - "type": "string", - "x-nullable": true - }, - "delegate_alias": { - "type": "string", - "x-nullable": true - }, - "entrypoints": { - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true - }, - "fail_strings": { - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true - }, - "found_by": { - "type": "string", - "x-nullable": true - }, - "hardcoded": { - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true - }, - "hash": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_action": { - "type": "string", - "x-nullable": true - }, - "level": { - "type": "integer" - }, - "manager": { - "type": "string", - "x-nullable": true - }, - "migrations_count": { - "type": "integer", - "x-nullable": true - }, - "network": { - "type": "string" - }, - "slug": { - "type": "string", - "x-nullable": true - }, - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true - }, - "timestamp": { - "type": "string" - }, - "tx_count": { - "type": "integer", - "x-nullable": true - } - } - }, - "handlers.ContractWithStats": { - "type": "object", - "properties": { - "address": { - "type": "string" - }, - "alias": { - "type": "string", - "x-nullable": true - }, - "annotations": { - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true - }, - "delegate": { - "type": "string", - "x-nullable": true - }, - "delegate_alias": { - "type": "string", - "x-nullable": true - }, - "entrypoints": { - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true - }, - "events_count": { - "type": "integer" - }, - "fail_strings": { - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true - }, - "found_by": { - "type": "string", - "x-nullable": true - }, - "hardcoded": { - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true - }, - "hash": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "last_action": { - "type": "string", - "x-nullable": true - }, - "level": { - "type": "integer" - }, - "manager": { - "type": "string", - "x-nullable": true - }, - "migrations_count": { - "type": "integer", - "x-nullable": true - }, - "network": { - "type": "string" - }, - "same_count": { - "type": "integer" - }, - "slug": { - "type": "string", - "x-nullable": true - }, - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true - }, - "timestamp": { - "type": "string" - }, - "tx_count": { - "type": "integer", - "x-nullable": true - } - } - }, - "handlers.CountResponse": { - "type": "object", - "properties": { - "count": { - "type": "integer" - } - } - }, - "handlers.EntrypointSchema": { - "type": "object", - "properties": { - "default_model": { - "x-nullable": true, - "$ref": "#/definitions/ast.JSONModel" - }, - "name": { - "type": "string" - }, - "schema": { - "$ref": "#/definitions/ast.JSONSchema" - }, - "typedef": { - "type": "array", - "items": { - "$ref": "#/definitions/ast.Typedef" - } - } - } - }, - "handlers.Error": { - "type": "object", - "properties": { - "message": { - "type": "string", - "example": "text" - } - } - }, - "handlers.Event": { - "type": "object", - "properties": { - "hash": { - "type": "string" - }, - "level": { - "type": "integer" - }, - "payload": { - "type": "array", - "items": { - "$ref": "#/definitions/ast.MiguelNode" - }, - "x-nullable": true - }, - "status": { - "type": "string" - }, - "tag": { - "type": "string" - }, - "timestamp": { - "type": "string" - } - } - }, - "handlers.GetBigMapResponse": { - "type": "object", - "properties": { - "active_keys": { - "type": "integer" - }, - "address": { - "type": "string" - }, - "contract_alias": { - "type": "string", - "x-nullable": true - }, - "network": { - "type": "string" - }, - "ptr": { - "type": "integer" - }, - "total_keys": { - "type": "integer" - }, - "typedef": { - "type": "array", - "items": { - "$ref": "#/definitions/ast.Typedef" - }, - "x-nullable": true - } - } - }, - "handlers.GetErrorLocationResponse": { - "type": "object", - "properties": { - "end_col": { - "type": "integer" - }, - "failed_row": { - "type": "integer" - }, - "first_row": { - "type": "integer" - }, - "start_col": { - "type": "integer" - }, - "text": { - "type": "string" - } - } - }, - "handlers.GlobalConstant": { - "type": "object", - "properties": { - "address": { - "type": "string" - }, - "code": { - "type": "string" - }, - "level": { - "type": "integer" - }, - "timestamp": { - "type": "string" - }, - "value": { - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "handlers.Head": { - "type": "object", - "properties": { - "level": { - "type": "integer" - }, - "network": { - "type": "string" - }, - "protocol": { - "type": "string" - }, - "synced": { - "type": "boolean" - }, - "time": { - "type": "string" - } - } - }, - "handlers.Migration": { - "type": "object", - "properties": { - "hash": { - "type": "string", - "x-nullable": true - }, - "kind": { - "type": "string" - }, - "level": { - "type": "integer" - }, - "prev_protocol": { - "type": "string" - }, - "protocol": { - "type": "string" - }, - "timestamp": { - "type": "string" - } - } - }, - "handlers.OPGResponse": { - "type": "object", - "properties": { - "content_index": { - "type": "integer" - }, - "counter": { - "type": "integer" - }, - "entrypoint": { - "type": "string" - }, - "flow": { - "type": "integer" - }, - "hash": { - "type": "string" - }, - "internals": { - "type": "integer" - }, - "kind": { - "type": "string" - }, - "last_id": { - "type": "integer" - }, - "level": { - "type": "integer" - }, - "status": { - "type": "string" - }, - "timestamp": { - "type": "string" - }, - "total_cost": { - "type": "integer" - } - } - }, - "handlers.Operation": { - "type": "object", - "properties": { - "allocated_destination_contract": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "allocated_destination_contract_burned": { - "type": "integer", - "x-nullable": true - }, - "amount": { - "type": "integer", - "x-nullable": true - }, - "balance": { - "type": "integer", - "x-nullable": true - }, - "burned": { - "type": "integer", - "x-nullable": true - }, - "consumed_gas": { - "type": "integer", - "x-nullable": true, - "example": 100 - }, - "content_index": { - "type": "integer" - }, - "counter": { - "type": "integer", - "x-nullable": true - }, - "delegate": { - "type": "string", - "x-nullable": true - }, - "destination": { - "type": "string", - "x-nullable": true - }, - "destination_alias": { - "type": "string", - "x-nullable": true - }, - "entrypoint": { - "type": "string", - "x-nullable": true - }, - "errors": { - "type": "array", - "items": { - "$ref": "#/definitions/tezerrors.Error" - }, - "x-nullable": true - }, - "event": { - "type": "array", - "items": { - "$ref": "#/definitions/ast.MiguelNode" - }, - "x-nullable": true - }, - "fee": { - "type": "integer", - "x-nullable": true - }, - "gas_limit": { - "type": "integer", - "x-nullable": true - }, - "hash": { - "type": "string", - "x-nullable": true - }, - "id": { - "type": "integer", - "x-nullable": true - }, - "internal": { - "type": "boolean" - }, - "kind": { - "type": "string" - }, - "level": { - "type": "integer", - "x-nullable": true - }, - "manager_pubkey": { - "type": "string", - "x-nullable": true - }, - "mempool": { - "type": "boolean" - }, - "network": { - "type": "string" - }, - "paid_storage_size_diff": { - "type": "integer", - "x-nullable": true, - "example": 300 - }, - "parameters": { - "x-nullable": true - }, - "protocol": { - "type": "string" - }, - "public_key": { - "type": "string", - "x-nullable": true - }, - "rawMempool": { - "x-nullable": true - }, - "source": { - "type": "string", - "x-nullable": true - }, - "source_alias": { - "type": "string", - "x-nullable": true - }, - "status": { - "type": "string" - }, - "storage_diff": { - "x-nullable": true, - "$ref": "#/definitions/ast.MiguelNode" - }, - "storage_limit": { - "type": "integer", - "x-nullable": true - }, - "storage_size": { - "type": "integer", - "x-nullable": true, - "example": 200 - }, - "tag": { - "type": "string", - "x-nullable": true - }, - "timestamp": { - "type": "string" - } - } - }, - "handlers.OperationResponse": { - "type": "object", - "properties": { - "last_id": { - "type": "string", - "x-nullable": true, - "example": "1588640276994159" - }, - "operations": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.Operation" - } - } - } - }, - "handlers.RecentlyCalledContract": { - "type": "object", - "properties": { - "address": { - "type": "string" - }, - "alias": { - "type": "string", - "x-nullable": true - }, - "id": { - "type": "integer" - }, - "last_action": { - "type": "string", - "x-nullable": true - }, - "tx_count": { - "type": "integer", - "x-nullable": true - } - } - }, - "handlers.SameContractsResponse": { - "type": "object", - "properties": { - "contracts": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.ContractWithStats" - } - }, - "count": { - "type": "integer" - } - } - }, - "handlers.ViewSchema": { - "type": "object", - "properties": { - "default_model": { - "x-nullable": true - }, - "description": { - "type": "string" - }, - "error": { - "type": "string" - }, - "implementation": { - "type": "integer" - }, - "kind": { - "type": "string" - }, - "name": { - "type": "string" - }, - "schema": { - "$ref": "#/definitions/ast.JSONSchema" - }, - "typedef": { - "type": "array", - "items": { - "$ref": "#/definitions/ast.Typedef" - } - } - } - }, - "handlers.executeViewRequest": { - "type": "object", - "required": [ - "data", - "kind" - ], - "properties": { - "amount": { - "type": "integer" - }, - "data": { - "type": "object", - "additionalProperties": true - }, - "gas_limit": { - "type": "integer" - }, - "implementation": { - "type": "integer" - }, - "kind": { - "type": "string" - }, - "name": { - "type": "string" - }, - "sender": { - "type": "string" - }, - "source": { - "type": "string" - }, - "view": { - "$ref": "#/definitions/contract.ViewImplementation" - } - } - }, - "handlers.getEntrypointDataRequest": { - "type": "object", - "required": [ - "data", - "name" - ], - "properties": { - "data": { - "type": "object", - "additionalProperties": true - }, - "format": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "handlers.runCodeRequest": { - "type": "object", - "required": [ - "data", - "name" - ], - "properties": { - "amount": { - "type": "integer" - }, - "data": { - "type": "object", - "additionalProperties": true - }, - "gas_limit": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "sender": { - "type": "string" - }, - "source": { - "type": "string" - } - } - }, - "tezerrors.Error": { - "type": "object", - "properties": { - "IError": {}, - "descr": { - "type": "string" - }, - "id": { - "type": "string" - }, - "kind": { - "type": "string" - }, - "title": { - "type": "string" - } - } - } - } -} \ No newline at end of file diff --git a/cmd/api/docs/swagger.yaml b/cmd/api/docs/swagger.yaml deleted file mode 100644 index 322b6aa71..000000000 --- a/cmd/api/docs/swagger.yaml +++ /dev/null @@ -1,2553 +0,0 @@ -definitions: - ast.JSONModel: - additionalProperties: true - type: object - ast.JSONSchema: - properties: - const: - type: string - default: {} - format: - type: string - items: - $ref: '#/definitions/ast.JSONSchema' - maxLength: - type: integer - minLength: - type: integer - oneOf: - items: - $ref: '#/definitions/ast.JSONSchema' - type: array - prim: - type: string - properties: - additionalProperties: - $ref: '#/definitions/ast.JSONSchema' - type: object - required: - items: - type: string - type: array - schemaKey: - $ref: '#/definitions/ast.JSONSchema' - tag: - type: string - title: - type: string - type: - type: string - x-itemTitle: - type: string - x-options: - additionalProperties: true - type: object - type: object - ast.MiguelNode: - properties: - children: - items: - $ref: '#/definitions/ast.MiguelNode' - type: array - diff_type: - type: string - from: {} - name: - type: string - prim: - type: string - type: - type: string - value: {} - type: object - ast.Typedef: - properties: - args: - items: - $ref: '#/definitions/ast.TypedefArg' - type: array - name: - type: string - type: - type: string - typedef: - items: - $ref: '#/definitions/ast.Typedef' - type: array - type: object - ast.TypedefArg: - properties: - key: - type: string - value: - type: string - type: object - contract.ListGlobalConstantItem: - properties: - address: - type: string - level: - type: integer - links_count: - type: integer - timestamp: - type: string - type: object - contract.Sections: - properties: - code: - items: - type: integer - type: array - parameter: - items: - type: integer - type: array - returnType: - items: - type: integer - type: array - type: object - contract.ViewImplementation: - properties: - michelsonStorageView: - $ref: '#/definitions/contract.Sections' - type: object - gin.H: - additionalProperties: true - type: object - handlers.AccountInfo: - properties: - address: - type: string - alias: - type: string - x-nullable: true - balance: - type: integer - last_action: - type: string - network: - type: string - tx_count: - type: integer - type: object - handlers.BigMapDiffByKeyResponse: - properties: - key: - x-nullable: true - key_hash: - type: string - total: - type: integer - values: - items: - $ref: '#/definitions/handlers.BigMapDiffItem' - type: array - x-nullable: true - type: object - handlers.BigMapDiffItem: - properties: - level: - type: integer - timestamp: - type: string - value: {} - type: object - handlers.BigMapHistoryItem: - properties: - action: - type: string - destination_ptr: - type: integer - x-nullable: true - source_ptr: - type: integer - x-nullable: true - timestamp: - type: string - type: object - handlers.BigMapHistoryResponse: - properties: - address: - type: string - items: - items: - $ref: '#/definitions/handlers.BigMapHistoryItem' - type: array - x-nullable: true - network: - type: string - ptr: - type: integer - type: object - handlers.BigMapItem: - properties: - is_active: - type: boolean - key: {} - key_hash: - type: string - key_string: - type: string - level: - type: integer - timestamp: - type: string - type: object - handlers.BigMapResponseItem: - properties: - count: - type: integer - data: - $ref: '#/definitions/handlers.BigMapItem' - type: object - handlers.Block: - properties: - chain_id: - example: NetXdQprcVkpaWU - type: string - cost_per_byte: - example: 250 - type: integer - hard_gas_limit_per_operation: - example: 1040000 - type: integer - hard_storage_limit_per_operation: - example: 60000 - type: integer - hash: - example: BLyAEwaXShJuZasvUezHUfLqzZ48V8XrPvXF2wRaH15tmzEpsHT - type: string - level: - example: 100 - type: integer - network: - example: mainnet - type: string - predecessor: - example: BMWVEwEYw9m5iaHzqxDfkPzZTV4rhkSouRh3DkVMVGkxZ3EVaNs - type: string - protocol: - example: PtCJ7pwoxe8JasnHY8YonnLYjcVHmhiARPJvqcC6VfHT5s8k8sY - type: string - time_between_blocks: - example: 30 - type: integer - timestamp: - example: "2018-06-30T18:05:27Z" - type: string - type: object - handlers.Contract: - properties: - address: - type: string - alias: - type: string - x-nullable: true - annotations: - items: - type: string - type: array - x-nullable: true - delegate: - type: string - x-nullable: true - delegate_alias: - type: string - x-nullable: true - entrypoints: - items: - type: string - type: array - x-nullable: true - fail_strings: - items: - type: string - type: array - x-nullable: true - found_by: - type: string - x-nullable: true - hardcoded: - items: - type: string - type: array - x-nullable: true - hash: - type: string - id: - type: integer - last_action: - type: string - x-nullable: true - level: - type: integer - manager: - type: string - x-nullable: true - migrations_count: - type: integer - x-nullable: true - network: - type: string - slug: - type: string - x-nullable: true - tags: - items: - type: string - type: array - x-nullable: true - timestamp: - type: string - tx_count: - type: integer - x-nullable: true - type: object - handlers.ContractWithStats: - properties: - address: - type: string - alias: - type: string - x-nullable: true - annotations: - items: - type: string - type: array - x-nullable: true - delegate: - type: string - x-nullable: true - delegate_alias: - type: string - x-nullable: true - entrypoints: - items: - type: string - type: array - x-nullable: true - events_count: - type: integer - fail_strings: - items: - type: string - type: array - x-nullable: true - found_by: - type: string - x-nullable: true - hardcoded: - items: - type: string - type: array - x-nullable: true - hash: - type: string - id: - type: integer - last_action: - type: string - x-nullable: true - level: - type: integer - manager: - type: string - x-nullable: true - migrations_count: - type: integer - x-nullable: true - network: - type: string - same_count: - type: integer - slug: - type: string - x-nullable: true - tags: - items: - type: string - type: array - x-nullable: true - timestamp: - type: string - tx_count: - type: integer - x-nullable: true - type: object - handlers.CountResponse: - properties: - count: - type: integer - type: object - handlers.EntrypointSchema: - properties: - default_model: - $ref: '#/definitions/ast.JSONModel' - x-nullable: true - name: - type: string - schema: - $ref: '#/definitions/ast.JSONSchema' - typedef: - items: - $ref: '#/definitions/ast.Typedef' - type: array - type: object - handlers.Error: - properties: - message: - example: text - type: string - type: object - handlers.Event: - properties: - hash: - type: string - level: - type: integer - payload: - items: - $ref: '#/definitions/ast.MiguelNode' - type: array - x-nullable: true - status: - type: string - tag: - type: string - timestamp: - type: string - type: object - handlers.GetBigMapResponse: - properties: - active_keys: - type: integer - address: - type: string - contract_alias: - type: string - x-nullable: true - network: - type: string - ptr: - type: integer - total_keys: - type: integer - typedef: - items: - $ref: '#/definitions/ast.Typedef' - type: array - x-nullable: true - type: object - handlers.GetErrorLocationResponse: - properties: - end_col: - type: integer - failed_row: - type: integer - first_row: - type: integer - start_col: - type: integer - text: - type: string - type: object - handlers.GlobalConstant: - properties: - address: - type: string - code: - type: string - level: - type: integer - timestamp: - type: string - value: - items: - type: integer - type: array - type: object - handlers.Head: - properties: - level: - type: integer - network: - type: string - protocol: - type: string - synced: - type: boolean - time: - type: string - type: object - handlers.Migration: - properties: - hash: - type: string - x-nullable: true - kind: - type: string - level: - type: integer - prev_protocol: - type: string - protocol: - type: string - timestamp: - type: string - type: object - handlers.OPGResponse: - properties: - content_index: - type: integer - counter: - type: integer - entrypoint: - type: string - flow: - type: integer - hash: - type: string - internals: - type: integer - kind: - type: string - last_id: - type: integer - level: - type: integer - status: - type: string - timestamp: - type: string - total_cost: - type: integer - type: object - handlers.Operation: - properties: - allocated_destination_contract: - example: true - type: boolean - x-nullable: true - allocated_destination_contract_burned: - type: integer - x-nullable: true - amount: - type: integer - x-nullable: true - balance: - type: integer - x-nullable: true - burned: - type: integer - x-nullable: true - consumed_gas: - example: 100 - type: integer - x-nullable: true - content_index: - type: integer - counter: - type: integer - x-nullable: true - delegate: - type: string - x-nullable: true - destination: - type: string - x-nullable: true - destination_alias: - type: string - x-nullable: true - entrypoint: - type: string - x-nullable: true - errors: - items: - $ref: '#/definitions/tezerrors.Error' - type: array - x-nullable: true - event: - items: - $ref: '#/definitions/ast.MiguelNode' - type: array - x-nullable: true - fee: - type: integer - x-nullable: true - gas_limit: - type: integer - x-nullable: true - hash: - type: string - x-nullable: true - id: - type: integer - x-nullable: true - internal: - type: boolean - kind: - type: string - level: - type: integer - x-nullable: true - manager_pubkey: - type: string - x-nullable: true - mempool: - type: boolean - network: - type: string - paid_storage_size_diff: - example: 300 - type: integer - x-nullable: true - parameters: - x-nullable: true - protocol: - type: string - public_key: - type: string - x-nullable: true - rawMempool: - x-nullable: true - source: - type: string - x-nullable: true - source_alias: - type: string - x-nullable: true - status: - type: string - storage_diff: - $ref: '#/definitions/ast.MiguelNode' - x-nullable: true - storage_limit: - type: integer - x-nullable: true - storage_size: - example: 200 - type: integer - x-nullable: true - tag: - type: string - x-nullable: true - timestamp: - type: string - type: object - handlers.OperationResponse: - properties: - last_id: - example: "1588640276994159" - type: string - x-nullable: true - operations: - items: - $ref: '#/definitions/handlers.Operation' - type: array - type: object - handlers.RecentlyCalledContract: - properties: - address: - type: string - alias: - type: string - x-nullable: true - id: - type: integer - last_action: - type: string - x-nullable: true - tx_count: - type: integer - x-nullable: true - type: object - handlers.SameContractsResponse: - properties: - contracts: - items: - $ref: '#/definitions/handlers.ContractWithStats' - type: array - count: - type: integer - type: object - handlers.ViewSchema: - properties: - default_model: - x-nullable: true - description: - type: string - error: - type: string - implementation: - type: integer - kind: - type: string - name: - type: string - schema: - $ref: '#/definitions/ast.JSONSchema' - typedef: - items: - $ref: '#/definitions/ast.Typedef' - type: array - type: object - handlers.executeViewRequest: - properties: - amount: - type: integer - data: - additionalProperties: true - type: object - gas_limit: - type: integer - implementation: - type: integer - kind: - type: string - name: - type: string - sender: - type: string - source: - type: string - view: - $ref: '#/definitions/contract.ViewImplementation' - required: - - data - - kind - type: object - handlers.getEntrypointDataRequest: - properties: - data: - additionalProperties: true - type: object - format: - type: string - name: - type: string - required: - - data - - name - type: object - handlers.runCodeRequest: - properties: - amount: - type: integer - data: - additionalProperties: true - type: object - gas_limit: - type: integer - name: - type: string - sender: - type: string - source: - type: string - required: - - data - - name - type: object - tezerrors.Error: - properties: - IError: {} - descr: - type: string - id: - type: string - kind: - type: string - title: - type: string - type: object -info: - contact: - email: hello@baking-bad.org - name: Baking Bad Team - url: https://baking-bad.org/docs - description: This is API description for Better Call Dev service. - title: Better Call Dev API - x-logo: - altText: Better Call Dev logo - href: https://better-call.dev - url: https://better-call.dev/img/logo_og.png -paths: - /v1/account/{network}/{address}: - get: - consumes: - - application/json - description: Get account info - operationId: get-account-info - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: Address - in: path - maxLength: 36 - minLength: 36 - name: address - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/handlers.AccountInfo' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get account info - tags: - - account - /v1/bigmap/{network}/{ptr}: - get: - consumes: - - application/json - description: Get big map info by pointer - operationId: get-bigmap - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: Big map pointer - in: path - name: ptr - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/handlers.GetBigMapResponse' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get big map info by pointer - tags: - - bigmap - /v1/bigmap/{network}/{ptr}/count: - get: - consumes: - - application/json - description: Get big map diffs count info by pointer - operationId: get-bigmapdiff-count - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: Big map pointer - in: path - name: ptr - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/handlers.CountResponse' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get big map diffs count info by pointer - tags: - - bigmap - /v1/bigmap/{network}/{ptr}/history: - get: - consumes: - - application/json - description: Get big map actions (alloc/copy/remove) - operationId: get-bigmap-history - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: Big map pointer - in: path - name: ptr - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/handlers.BigMapHistoryResponse' - "204": - description: No Content - schema: - $ref: '#/definitions/gin.H' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get big map actions (alloc/copy/remove) - tags: - - bigmap - /v1/bigmap/{network}/{ptr}/keys: - get: - consumes: - - application/json - description: Get big map keys by pointer - operationId: get-bigmap-keys - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: Big map pointer - in: path - name: ptr - required: true - type: integer - - description: Offset - in: query - name: offset - type: integer - - description: Requested count - in: query - maximum: 10 - name: size - type: integer - - description: Max level filter - in: query - minimum: 0 - name: max_level - type: integer - - description: Min level filter - in: query - minimum: 0 - name: min_level - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/handlers.BigMapResponseItem' - type: array - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get big map keys by pointer - tags: - - bigmap - /v1/bigmap/{network}/{ptr}/keys/{key_hash}: - get: - consumes: - - application/json - description: Get big map diffs by pointer and key hash - operationId: get-bigmap-keyhash - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: Big map pointer - in: path - name: ptr - required: true - type: integer - - description: Key hash in big map - in: path - maxLength: 54 - minLength: 54 - name: key_hash - required: true - type: string - - description: Offset - in: query - name: offset - type: integer - - description: Requested count - in: query - maximum: 10 - name: size - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/handlers.BigMapDiffByKeyResponse' - "204": - description: No Content - schema: - $ref: '#/definitions/gin.H' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get big map diffs by pointer and key hash - tags: - - bigmap - /v1/bigmap/{network}/{ptr}/keys/{key_hash}/current: - get: - consumes: - - application/json - description: Get current big map value by pointer and key hash - operationId: get-bigmap-keyhash-current - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: Big map pointer - in: path - name: ptr - required: true - type: integer - - description: Key hash in big map - in: path - maxLength: 54 - minLength: 54 - name: key_hash - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/handlers.BigMapDiffByKeyResponse' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get current big map value by pointer and key hash - tags: - - bigmap - /v1/contract/{network}/{address}: - get: - consumes: - - application/json - description: Get full contract info - operationId: get-contract - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: KT address - in: path - maxLength: 36 - minLength: 36 - name: address - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/handlers.ContractWithStats' - "204": - description: No Content - schema: - $ref: '#/definitions/gin.H' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get contract info - tags: - - contract - /v1/contract/{network}/{address}/code: - get: - consumes: - - application/json - description: Get contract code - operationId: get-contract-code - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: KT address - in: path - maxLength: 36 - minLength: 36 - name: address - required: true - type: string - - description: Protocol - in: query - name: protocol - type: string - - description: Level - in: query - name: level - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - type: string - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get contract code - tags: - - contract - /v1/contract/{network}/{address}/entrypoints: - get: - consumes: - - application/json - description: Get contract entrypoints - operationId: get-contract-entrypoints - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: KT address - in: path - maxLength: 36 - minLength: 36 - name: address - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/handlers.EntrypointSchema' - type: array - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get contract entrypoints - tags: - - contract - /v1/contract/{network}/{address}/entrypoints/data: - post: - consumes: - - application/json - description: Get entrypoint data from schema object - operationId: get-contract-entrypoints-data - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: KT address - in: path - maxLength: 36 - minLength: 36 - name: address - required: true - type: string - - description: Request body - in: body - name: body - required: true - schema: - $ref: '#/definitions/handlers.getEntrypointDataRequest' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/gin.H' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get entrypoint data from schema object - tags: - - contract - /v1/contract/{network}/{address}/entrypoints/schema: - get: - consumes: - - application/json - description: Get contract`s entrypoint schema - operationId: get-contract-entrypoints-schema - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: KT address - in: path - maxLength: 36 - minLength: 36 - name: address - required: true - type: string - - description: Entrypoint name - in: query - name: entrypoint - required: true - type: string - - description: Fill storage type - enum: - - empty - - latest - in: query - name: fill_type - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/handlers.EntrypointSchema' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get contract`s entrypoint schema - tags: - - contract - /v1/contract/{network}/{address}/entrypoints/trace: - post: - consumes: - - application/json - description: Execute entrypoint with passed arguments - operationId: run-code - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: KT address - in: path - maxLength: 36 - minLength: 36 - name: address - required: true - type: string - - description: Request body - in: body - name: body - required: true - schema: - $ref: '#/definitions/handlers.runCodeRequest' - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/handlers.Operation' - type: array - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Execute entrypoint with passed arguments - tags: - - contract - /v1/contract/{network}/{address}/events: - get: - consumes: - - application/json - description: List contract events - operationId: list-events - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: KT address - in: path - maxLength: 36 - minLength: 36 - name: address - required: true - type: string - - description: Offset - in: query - name: offset - type: string - - description: Expected events count - in: query - maximum: 10 - name: size - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/handlers.Event' - type: array - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: List contract events - tags: - - operations - /v1/contract/{network}/{address}/global_constants: - get: - consumes: - - application/json - description: Get global constants used by contract - operationId: get-contract-global-constants - parameters: - - description: network - in: path - name: network - required: true - type: string - - description: KT address - in: path - maxLength: 36 - minLength: 36 - name: address - required: true - type: string - - description: Constants count - in: query - maximum: 10 - name: size - type: integer - - description: Offset - in: query - name: offset - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/handlers.GlobalConstant' - type: array - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get global constants used by contract - tags: - - contract - /v1/contract/{network}/{address}/mempool: - get: - consumes: - - application/json - description: Get contract mempool operations - operationId: get-contract-mempool - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: KT address - in: path - maxLength: 36 - minLength: 36 - name: address - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/handlers.Operation' - type: array - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get contract mempool operations - tags: - - contract - /v1/contract/{network}/{address}/migrations: - get: - consumes: - - application/json - description: Get contract migrations - operationId: get-contract-migrations - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: KT address - in: path - maxLength: 36 - minLength: 36 - name: address - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/handlers.Migration' - type: array - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get contract migrations - tags: - - contract - /v1/contract/{network}/{address}/operations: - get: - consumes: - - application/json - description: Get contract operations - operationId: get-contract-operations - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: KT address - in: path - maxLength: 36 - minLength: 36 - name: address - required: true - type: string - - description: Last operation ID - in: query - name: last_id - type: string - - description: Timestamp - in: query - name: from - type: integer - - description: Timestamp - in: query - name: to - type: integer - - description: Expected OPG count - in: query - name: size - type: integer - - description: Comma-separated operations statuses - in: query - name: status - type: string - - description: Comma-separated called entrypoints list - in: query - name: entrypoints - type: string - - description: Include storage diff to operations or not - in: query - name: with_storage_diff - type: boolean - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/handlers.OperationResponse' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get contract operations - tags: - - contract - /v1/contract/{network}/{address}/opg: - get: - consumes: - - application/json - description: Get operation groups by account - operationId: get-operation-groups-by-account - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: KT address - in: path - maxLength: 36 - minLength: 36 - name: address - required: true - type: string - - description: Last operation ID - in: query - name: last_id - type: string - - description: Expected OPG count - in: query - name: size - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/handlers.OPGResponse' - type: array - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get operation groups by account - tags: - - contract - /v1/contract/{network}/{address}/same: - get: - consumes: - - application/json - description: Get same contracts - operationId: get-contract-same - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: KT address - in: path - maxLength: 36 - minLength: 36 - name: address - required: true - type: string - - description: Offset - in: query - name: offset - type: integer - - description: Requested count - in: query - maximum: 10 - name: size - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/handlers.SameContractsResponse' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get same contracts - tags: - - contract - /v1/contract/{network}/{address}/storage: - get: - consumes: - - application/json - description: Get contract storage - operationId: get-contract-storage - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: KT address - in: path - maxLength: 36 - minLength: 36 - name: address - required: true - type: string - - description: Level - in: query - name: level - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/ast.MiguelNode' - type: array - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get contract storage - tags: - - contract - /v1/contract/{network}/{address}/storage/raw: - get: - consumes: - - application/json - description: Get contract raw storage - operationId: get-contract-storage-raw - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: KT address - in: path - maxLength: 36 - minLength: 36 - name: address - required: true - type: string - - description: Level - in: query - name: level - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - type: string - "204": - description: No Content - schema: - type: string - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get contract raw storage - tags: - - contract - /v1/contract/{network}/{address}/storage/rich: - get: - consumes: - - application/json - description: Get contract rich storage - operationId: get-contract-storage-rich - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: KT address - in: path - maxLength: 36 - minLength: 36 - name: address - required: true - type: string - - description: Level - in: query - name: level - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/gin.H' - "204": - description: No Content - schema: - $ref: '#/definitions/gin.H' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get contract rich storage - tags: - - contract - /v1/contract/{network}/{address}/storage/schema: - get: - consumes: - - application/json - description: Get contract storage schema - operationId: get-contract-storage-schema - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: KT address - in: path - maxLength: 36 - minLength: 36 - name: address - required: true - type: string - - description: Fill storage type - enum: - - empty - - current - - initial - in: query - name: fill_type - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/handlers.EntrypointSchema' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get contract storage schema - tags: - - contract - /v1/contract/{network}/{address}/views/execute: - post: - consumes: - - application/json - description: Execute view of contracts metadata - operationId: contract-execute-view - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: KT address - in: path - maxLength: 36 - minLength: 36 - name: address - required: true - type: string - - description: Request body - in: body - name: body - required: true - schema: - $ref: '#/definitions/handlers.executeViewRequest' - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/ast.MiguelNode' - type: array - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Execute view of contracts metadata - tags: - - contract - /v1/contract/{network}/{address}/views/schema: - get: - consumes: - - application/json - description: Get view schemas of contract metadata - operationId: get-contract-tzip-views-schema - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: KT address - in: path - maxLength: 36 - minLength: 36 - name: address - required: true - type: string - - description: Views kind - enum: - - on-chain - - off-chain - in: query - name: kind - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/handlers.ViewSchema' - type: array - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get view schemas of contract metadata - tags: - - contract - /v1/global_constants/{network}: - get: - consumes: - - application/json - description: List global constants - operationId: list-global-constants - parameters: - - description: network - in: path - name: network - required: true - type: string - - description: Constants count - in: query - maximum: 10 - name: size - type: integer - - description: Offset - in: query - name: offset - type: integer - - description: Order by - enum: - - level - - timestamp - - links_count - - address - in: query - name: order_by - type: string - - description: Sort order - enum: - - asc - - desc - in: query - name: sort - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/contract.ListGlobalConstantItem' - type: array - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: List global constants - tags: - - global-constants - /v1/global_constants/{network}/{address}: - get: - consumes: - - application/json - description: Get global constant - operationId: get-global-constant - parameters: - - description: network - in: path - name: network - required: true - type: string - - description: expr address of constant - in: path - maxLength: 54 - minLength: 54 - name: address - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/handlers.GlobalConstant' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get global constant - tags: - - global-constants - /v1/global_constants/{network}/{address}/contracts: - get: - consumes: - - application/json - description: Get contracts that use the global constant - operationId: get-global-constant-contracts - parameters: - - description: network - in: path - name: network - required: true - type: string - - description: expr address of constant - in: path - maxLength: 54 - minLength: 54 - name: address - required: true - type: string - - description: Constants count - in: query - maximum: 10 - name: size - type: integer - - description: Offset - in: query - name: offset - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/handlers.Contract' - type: array - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get contracts that use the global constant - tags: - - global-constants - /v1/head: - get: - consumes: - - application/json - description: Get indexer head for each network - operationId: get-indexer-head - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/handlers.Head' - type: array - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Show indexer head - tags: - - head - /v1/head/{network}: - get: - consumes: - - application/json - description: Get indexer head for the network - operationId: get-indexer-head-by-network - parameters: - - description: Network - in: path - name: network - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/handlers.Head' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Show indexer head for the network - tags: - - head - /v1/implicit/{network}/{counter}: - get: - consumes: - - application/json - operationId: get-implicit-operation - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: Counter - in: path - name: counter - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/handlers.Operation' - type: array - "204": - description: No Content - schema: - $ref: '#/definitions/gin.H' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get implicit operation - tags: - - operations - /v1/off_chain_view: - post: - consumes: - - application/json - description: Get JSON schema for off-chain view - operationId: get-off-chain-view - parameters: - - description: 'Micheline. Limit: 1MB' - in: body - name: body - required: true - schema: - items: - type: integer - type: array - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/handlers.ViewSchema' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get JSON schema for off-chain view - tags: - - contract - /v1/operation/{network}/{id}/diff: - get: - consumes: - - application/json - operationId: get-operation-diff - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: Internal BCD operation ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/ast.MiguelNode' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get operation storage diff - tags: - - operations - /v1/operation/{network}/{id}/error_location: - get: - consumes: - - application/json - description: Get code line where operation failed - operationId: get-operation-error-location - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: Internal BCD operation ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/handlers.GetErrorLocationResponse' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get code line where operation failed - tags: - - operations - /v1/opg/{hash}: - get: - consumes: - - application/json - description: Get operation group by hash - operationId: get-opg - parameters: - - description: Operation group hash - in: path - maxLength: 51 - minLength: 51 - name: hash - required: true - type: string - - description: Search operation in mempool or not - in: query - name: with_mempool - type: boolean - - description: Include storage diff to operations or not - in: query - name: with_storage_diff - type: boolean - - description: Network - in: query - name: network - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/handlers.Operation' - type: array - "204": - description: No Content - schema: - $ref: '#/definitions/gin.H' - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get operation group - tags: - - operations - /v1/opg/{hash}/{counter}: - get: - consumes: - - application/json - description: Get operations by hash and counter - operationId: get-operations-by-hash-and-counter - parameters: - - description: Operation group hash - in: path - maxLength: 51 - minLength: 51 - name: hash - required: true - type: string - - description: Counter of main operation - in: path - name: counter - required: true - type: integer - - description: You can set network field for better performance - in: query - name: network - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/handlers.Operation' - type: array - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "404": - description: Not Found - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get operations by hash and counter - tags: - - operations - /v1/stats: - get: - consumes: - - application/json - description: get indexer states for all networks - operationId: get-stats - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/handlers.Block' - type: array - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Show indexer stats - tags: - - statistics - /v1/stats/{network}/contracts_count: - get: - consumes: - - application/json - description: Get contracts count - operationId: get-contracts-count - parameters: - - description: Network - in: path - name: network - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - type: integer - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Get contracts count - tags: - - statistics - /v1/stats/{network}/recently_called_contracts: - get: - consumes: - - application/json - description: Show recently called contracts - operationId: get-recenly-called-contracts - parameters: - - description: Network - in: path - name: network - required: true - type: string - - description: Contracts count - in: query - maximum: 10 - name: size - type: integer - - description: Offset - in: query - name: offset - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/handlers.RecentlyCalledContract' - type: array - "400": - description: Bad Request - schema: - $ref: '#/definitions/handlers.Error' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/handlers.Error' - summary: Show recently called contracts - tags: - - statistics -swagger: "2.0" diff --git a/cmd/api/handlers/swagger.go b/cmd/api/handlers/swagger.go deleted file mode 100644 index a17ec88ca..000000000 --- a/cmd/api/handlers/swagger.go +++ /dev/null @@ -1,25 +0,0 @@ -package handlers - -import ( - "github.com/baking-bad/bcdhub/internal/config" - "github.com/gin-gonic/gin" - "github.com/swaggo/swag" -) - -// GetSwaggerDoc - -func GetSwaggerDoc() gin.HandlerFunc { - return func(c *gin.Context) { - ctx := c.MustGet("context").(*config.Context) - - doc, err := swag.ReadDoc() - if handleError(c, ctx.Storage, err, 0) { - return - } - - c.Header("Content-Type", "application/json") - _, err = c.Writer.Write([]byte(doc)) - if handleError(c, ctx.Storage, err, 0) { - return - } - } -} diff --git a/cmd/api/main.go b/cmd/api/main.go index 22c006f50..6c8a7353f 100644 --- a/cmd/api/main.go +++ b/cmd/api/main.go @@ -5,7 +5,6 @@ import ( "os" "time" - "github.com/baking-bad/bcdhub/cmd/api/docs" "github.com/baking-bad/bcdhub/cmd/api/handlers" "github.com/baking-bad/bcdhub/cmd/api/validations" "github.com/baking-bad/bcdhub/internal/config" @@ -31,8 +30,6 @@ func newApp() *app { panic(err) } - docs.SwaggerInfo.Host = cfg.API.SwaggerHost - if cfg.API.SentryEnabled { helpers.InitSentry(cfg.Sentry.Debug, cfg.Sentry.Environment, cfg.Sentry.URI) helpers.SetTagSentry("project", cfg.API.ProjectName) @@ -85,7 +82,6 @@ func (api *app) makeRouter() { v1 := r.Group("v1") { - v1.GET("swagger.json", handlers.MainnetMiddleware(api.Contexts), handlers.GetSwaggerDoc()) v1.GET("config", handlers.ContextsMiddleware(api.Contexts), handlers.GetConfig()) v1.GET("head", handlers.ContextsMiddleware(api.Contexts), cache.CachePage(store, time.Second*10, handlers.GetHead())) diff --git a/configs/development.yml b/configs/development.yml index 340dc4f50..ecb6a127f 100644 --- a/configs/development.yml +++ b/configs/development.yml @@ -47,7 +47,6 @@ base_url: http://localhost:8080 api: project_name: api bind: "127.0.0.1:14000" - swagger_host: "localhost:14000" cors_enabled: true sentry_enabled: false seed_enabled: false diff --git a/configs/production.yml b/configs/production.yml index ed79d816d..52e2a0e2b 100644 --- a/configs/production.yml +++ b/configs/production.yml @@ -48,7 +48,6 @@ base_url: https://better-call.dev api: project_name: api bind: ":14000" - swagger_host: "api.better-call.dev" cors_enabled: false sentry_enabled: true seed_enabled: false diff --git a/configs/sandbox.yml b/configs/sandbox.yml index 451885100..652737694 100644 --- a/configs/sandbox.yml +++ b/configs/sandbox.yml @@ -21,7 +21,6 @@ base_url: http://localhost:8000 api: project_name: api bind: ":14000" - swagger_host: "localhost:8000" cors_enabled: true sentry_enabled: false seed_enabled: true diff --git a/docs/configuration.md b/docs/configuration.md index ff120f78d..cb2a255f9 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -70,7 +70,6 @@ API service settings api: project_name: api bind: ":14000" - swagger_host: "api.better-call.dev" cors_enabled: false sentry_enabled: true seed_enabled: false diff --git a/go.mod b/go.mod index 1f19f6d5f..f18505174 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,6 @@ require ( github.com/sergi/go-diff v1.2.0 github.com/shopspring/decimal v1.3.1 github.com/stretchr/testify v1.8.0 - github.com/swaggo/swag v1.8.4 github.com/tidwall/gjson v1.14.3 github.com/yhirose/go-peg v0.0.0-20210804202551-de25d6753cf1 golang.org/x/crypto v0.5.0 @@ -38,15 +37,10 @@ require ( ) require ( - github.com/KyleBanks/depth v1.2.1 // indirect github.com/aymerick/douceur v0.2.0 // indirect github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.20.0 // indirect - github.com/go-openapi/spec v0.20.7 // indirect - github.com/go-openapi/swag v0.22.3 // indirect github.com/go-pg/zerochecker v0.2.0 // indirect github.com/go-playground/locales v0.14.0 // indirect github.com/go-playground/universal-translator v0.18.0 // indirect @@ -56,11 +50,9 @@ require ( github.com/gorilla/css v1.0.0 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect - github.com/josharian/intern v1.0.0 // indirect github.com/karlseguin/expect v1.0.8 // indirect github.com/klauspost/cpuid/v2 v2.1.1 // indirect github.com/leodido/go-urn v1.2.1 // indirect - github.com/mailru/easyjson v0.7.7 // indirect github.com/matryer/is v1.4.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.16 // indirect @@ -94,7 +86,6 @@ require ( golang.org/x/sys v0.5.0 // indirect golang.org/x/term v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect - golang.org/x/tools v0.1.12 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect lukechampine.com/blake3 v1.1.6 // indirect diff --git a/go.sum b/go.sum index 0aacc210b..355fdf75e 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,5 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= -github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/aws/aws-sdk-go v1.44.92 h1:ayc8sQntRMX84Ib9Eqntar7knfNsWHJY7wnZUk5018w= github.com/aws/aws-sdk-go v1.44.92/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= @@ -47,17 +45,6 @@ github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= -github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= -github.com/go-openapi/spec v0.20.7 h1:1Rlu/ZrOCCob0n+JKKJAWhNWMPW8bOZRg8FJaY+0SKI= -github.com/go-openapi/spec v0.20.7/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= -github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-pg/pg/v10 v10.10.6 h1:1vNtPZ4Z9dWUw/TjJwOfFUbF5nEq1IkR6yG8Mq/Iwso= github.com/go-pg/pg/v10 v10.10.6/go.mod h1:GLmFXufrElQHf5uzM3BQlcfwV3nsgnHue5uzjQ6Nqxg= github.com/go-pg/zerochecker v0.2.0 h1:pp7f72c3DobMWOb2ErtZsnrPaSvHd2W4o9//8HtF4mU= @@ -118,8 +105,6 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= @@ -147,11 +132,6 @@ github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/machinebox/graphql v0.2.2 h1:dWKpJligYKhYKO5A2gvNhkJdQMNZeChZYyBbrZkBZfo= github.com/machinebox/graphql v0.2.2/go.mod h1:F+kbVMHuwrQ5tYgU9JXlnskM8nOaFxCAEolaQybkjWA= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE= github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -240,8 +220,6 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/swaggo/swag v1.8.4 h1:oGB351qH1JqUqK1tsMYEE5qTBbPk394BhsZxmUfebcI= -github.com/swaggo/swag v1.8.4/go.mod h1:jMLeXOOmYyjk8PvHTsXBdrubsNd9gUJTTCzL5iBnseg= github.com/tidwall/gjson v1.14.3 h1:9jvXn7olKEHU1S9vwoMGliaT8jq1vJ7IH/n9zD9Dnlw= github.com/tidwall/gjson v1.14.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= @@ -283,7 +261,6 @@ golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTk golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -353,8 +330,6 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -398,7 +373,6 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/config/config.go b/internal/config/config.go index f5e8c9e03..b3ba5ff16 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -162,7 +162,6 @@ type SeedConfig struct { type APIConfig struct { ProjectName string `yaml:"project_name"` Bind string `yaml:"bind"` - SwaggerHost string `yaml:"swagger_host"` CorsEnabled bool `yaml:"cors_enabled"` SentryEnabled bool `yaml:"sentry_enabled"` SeedEnabled bool `yaml:"seed_enabled"` diff --git a/scripts/newman/tests.json b/scripts/newman/tests.json index f15a6054b..2f4bd081b 100644 --- a/scripts/newman/tests.json +++ b/scripts/newman/tests.json @@ -5,55 +5,6 @@ "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ - { - "name": "swagger", - "item": [ - { - "name": "swagger.json", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"The response has all properties\", () => {", - " const responseJson = pm.response.json();", - "", - " pm.expect(responseJson.info.description).to.eql(\"This is API description for Better Call Dev service.\");", - " pm.expect(responseJson.info.title).to.eql(\"Better Call Dev API\");", - " pm.expect(responseJson.info.contact).to.eql({", - " \"name\": \"Baking Bad Team\",", - " \"url\": \"https://baking-bad.org/docs\",", - " \"email\": \"hello@baking-bad.org\"", - " })", - " pm.expect(responseJson.info[\"x-logo\"]).to.eql({", - " \"altText\": \"Better Call Dev logo\",", - " \"href\": \"https://better-call.dev\",", - " \"url\": \"https://better-call.dev/img/logo_og.png\"", - " })", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{baseURL}}/v1/swagger.json", - "host": [ - "{{baseURL}}" - ], - "path": [ - "v1", - "swagger.json" - ] - } - }, - "response": [] - } - ] - }, { "name": "opg/:hash", "item": [ diff --git a/scripts/nginx/sitemap.go b/scripts/nginx/sitemap.go index f0fcae063..5f57f599a 100644 --- a/scripts/nginx/sitemap.go +++ b/scripts/nginx/sitemap.go @@ -15,7 +15,6 @@ func makeSitemap(filepath string, cfg config.Config) error { s.AddLocation(fmt.Sprintf("%s/stats", cfg.BaseURL)) s.AddLocation(fmt.Sprintf("%s/search", cfg.BaseURL)) s.AddLocation(fmt.Sprintf("%s/dapps/list", cfg.BaseURL)) - s.AddLocation(fmt.Sprintf("https://%s/v1/docs/index.html", cfg.API.SwaggerHost)) for _, network := range cfg.Scripts.Networks { s.AddLocation(fmt.Sprintf("%s/stats/%s", cfg.BaseURL, network))