From 409cfe4d738b44067ceed1a9693dca2be20323fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20=C5=BB=C3=B3=C5=82towski?= Date: Wed, 13 Nov 2024 15:20:46 +0100 Subject: [PATCH] feat(SPV-680): standarize delete endpoints returns (#768) --- actions/access_keys/revoke.go | 5 +- actions/admin/contact.go | 8 +- actions/admin/webhooks.go | 4 +- docs/docs.go | 1367 +++++++++++++++++++++++++++++++-- docs/swagger.json | 1367 +++++++++++++++++++++++++++++++-- docs/swagger.yaml | 889 ++++++++++++++++++++- 6 files changed, 3535 insertions(+), 105 deletions(-) diff --git a/actions/access_keys/revoke.go b/actions/access_keys/revoke.go index 8515cccd9..00eeb467a 100644 --- a/actions/access_keys/revoke.go +++ b/actions/access_keys/revoke.go @@ -39,7 +39,7 @@ func oldRevoke(c *gin.Context, userContext *reqctx.UserContext) { // @Tags Access-key // @Produce json // @Param id path string true "id of the access key" -// @Success 200 {object} response.AccessKey "Revoked AccessKey" +// @Success 200 // @Failure 400 "Bad request - Missing required field: id" // @Failure 500 "Internal server error - Error while revoking access key" // @Router /api/v1/users/current/keys/{id} [delete] @@ -78,6 +78,5 @@ func revokeHelper(c *gin.Context, id string, snakeCase bool, xpub string) { return } - contract := mappings.MapToAccessKeyContract(accessKey) - c.JSON(http.StatusCreated, contract) + c.Status(http.StatusOK) } diff --git a/actions/admin/contact.go b/actions/admin/contact.go index 7ec03d2c6..ff7a0f3e8 100644 --- a/actions/admin/contact.go +++ b/actions/admin/contact.go @@ -154,7 +154,7 @@ func contactsDelete(c *gin.Context, _ *reqctx.AdminContext) { // @Tags Admin // @Produce json // @Param id path string false "Contact id" -// @Success 200 {object} response.Contact "Rejected contact" +// @Success 200 // @Failure 400 "Bad request - Error while getting id from path" // @Failure 404 "Not found - Error while getting contact by id" // @Failure 422 "Unprocessable entity - Incorrect status of contact" @@ -165,7 +165,7 @@ func contactsDelete(c *gin.Context, _ *reqctx.AdminContext) { func contactsReject(c *gin.Context, _ *reqctx.AdminContext) { id := c.Param("id") - contact, err := reqctx.Engine(c).AdminChangeContactStatus( + _, err := reqctx.Engine(c).AdminChangeContactStatus( c.Request.Context(), id, engine.ContactRejected, @@ -175,9 +175,7 @@ func contactsReject(c *gin.Context, _ *reqctx.AdminContext) { return } - contract := mappings.MapToContactContract(contact) - - c.JSON(http.StatusOK, contract) + c.Status(http.StatusOK) } // contactsAccept will perform Accept action on contact with the given id diff --git a/actions/admin/webhooks.go b/actions/admin/webhooks.go index e1f707303..f09321279 100644 --- a/actions/admin/webhooks.go +++ b/actions/admin/webhooks.go @@ -42,7 +42,7 @@ func subscribeWebhook(c *gin.Context, _ *reqctx.AdminContext) { // @Tags Admin // @Produce json // @Param UnsubscribeRequestBody body models.UnsubscribeRequestBody false "URL to unsubscribe from" -// @Success 200 {boolean} bool "Success response" +// @Success 200 // @Failure 500 "Internal server error - Error while unsubscribing to the webhook" // @Router /api/v1/admin/webhooks/subscriptions [delete] // @Security x-auth-xpub @@ -59,5 +59,5 @@ func unsubscribeWebhook(c *gin.Context, _ *reqctx.AdminContext) { return } - c.JSON(http.StatusOK, true) + c.Status(http.StatusOK) } diff --git a/docs/docs.go b/docs/docs.go index 0397d373d..e9d78f6e3 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -219,10 +219,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "Rejected contact", - "schema": { - "$ref": "#/definitions/response.Contact" - } + "description": "OK" }, "400": { "description": "Bad request - Error while getting id from path" @@ -728,10 +725,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "Success response", - "schema": { - "type": "boolean" - } + "description": "OK" }, "500": { "description": "Internal server error - Error while unsubscribing to the webhook" @@ -1841,10 +1835,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "Revoked AccessKey", - "schema": { - "$ref": "#/definitions/response.AccessKey" - } + "description": "OK" }, "400": { "description": "Bad request - Missing required field: id" @@ -2026,6 +2017,217 @@ const docTemplate = `{ } } }, + "/v1/access-key": { + "get": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (GET) /api/v1/users/current/keys/{id} instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Access-key" + ], + "summary": "Get access key - Use (GET) /api/v1/users/current/keys/{id} instead.", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "id of the access key", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "AccessKey with given id", + "schema": { + "$ref": "#/definitions/models.AccessKey" + } + }, + "400": { + "description": "Bad request - Missing required field: id" + }, + "403": { + "description": "Forbidden - Access key is not owned by the user" + }, + "500": { + "description": "Internal server error - Error while getting access key" + } + } + }, + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (POST) /api/v1/users/current/keys instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Access-key" + ], + "summary": "Create access key - Use (POST) /api/v1/users/current/keys instead.", + "deprecated": true, + "parameters": [ + { + "description": " ", + "name": "CreateAccessKey", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/accesskeys.CreateAccessKey" + } + } + ], + "responses": { + "201": { + "description": "Created AccessKey", + "schema": { + "$ref": "#/definitions/models.AccessKey" + } + }, + "400": { + "description": "Bad request - Error while parsing CreateAccessKey from request body" + }, + "500": { + "description": "Internal server error - Error while creating new access key" + } + } + }, + "delete": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (DELETE) /api/v1/users/current/keys/{id} instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Access-key" + ], + "summary": "Revoke access key - Use (DELETE) /api/v1/users/current/keys/{id} instead.", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "id of the access key", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "Revoked AccessKey", + "schema": { + "$ref": "#/definitions/models.AccessKey" + } + }, + "400": { + "description": "Bad request - Missing required field: id" + }, + "500": { + "description": "Internal server error - Error while revoking access key" + } + } + } + }, + "/v1/access-key/count": { + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (GET) /api/v1/users/current/keys instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Access-key" + ], + "summary": "Count of access keys - Use (GET) /api/v1/users/current/keys instead.", + "deprecated": true, + "parameters": [ + { + "description": "Enables filtering of elements to be counted", + "name": "CountAccessKeys", + "in": "body", + "schema": { + "$ref": "#/definitions/filter.CountAccessKeys" + } + } + ], + "responses": { + "200": { + "description": "Count of access keys", + "schema": { + "type": "number" + } + }, + "400": { + "description": "Bad request - Error while parsing CountAccessKeys from request body" + }, + "500": { + "description": "Internal Server Error - Error while fetching count of access keys" + } + } + } + }, + "/v1/access-key/search": { + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (GET) /api/v1/users/current/keys instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Access-key" + ], + "summary": "Search access key - Use (GET) /api/v1/users/current/keys instead.", + "deprecated": true, + "parameters": [ + { + "description": "Supports targeted resource searches with filters and metadata, plus options for pagination and sorting to streamline data exploration and analysis", + "name": "SearchAccessKeys", + "in": "body", + "schema": { + "$ref": "#/definitions/filter.SearchAccessKeys" + } + } + ], + "responses": { + "200": { + "description": "List of access keys", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.AccessKey" + } + } + }, + "400": { + "description": "Bad request - Error while SearchAccessKeys from request body" + }, + "500": { + "description": "Internal server error - Error while searching for access keys" + } + } + } + }, "/v1/admin/access-keys/count": { "post": { "security": [ @@ -2335,7 +2537,7 @@ const docTemplate = `{ } } }, - "/v1/admin/destinations/search": { + "/v1/admin/destinations": { "post": { "security": [ { @@ -2350,6 +2552,7 @@ const docTemplate = `{ "Admin" ], "summary": "Search for destinations", + "deprecated": true, "parameters": [ { "description": "Supports targeted resource searches with filters and metadata, plus options for pagination and sorting to streamline data exploration and analysis", @@ -2379,114 +2582,200 @@ const docTemplate = `{ } } }, - "/v1/admin/paymail/create": { + "/v1/admin/destinations/count": { "post": { "security": [ { "x-auth-xpub": [] } ], - "description": "Create paymail", + "description": "Count destinations", "produces": [ "application/json" ], "tags": [ "Admin" ], - "summary": "Create paymail", + "summary": "Count destinations", + "deprecated": true, "parameters": [ { - "description": " ", - "name": "CreatePaymail", + "description": "Enables filtering of elements to be counted", + "name": "CountDestinations", "in": "body", "schema": { - "$ref": "#/definitions/admin.CreatePaymail" + "$ref": "#/definitions/filter.CountDestinations" } } ], "responses": { - "201": { - "description": "Created PaymailAddress", + "200": { + "description": "Count of destinations", "schema": { - "$ref": "#/definitions/models.PaymailAddress" + "type": "number" } }, "400": { - "description": "Bad request - Error while parsing CreatePaymail from request body or if xpub or address are missing" + "description": "Bad request - Error while parsing CountDestinations from request body" }, "500": { - "description": "Internal Server Error - Error while creating new paymail address" + "description": "Internal Server Error - Error while fetching count of destinations" } } } }, - "/v1/admin/paymail/delete": { - "delete": { + "/v1/admin/destinations/search": { + "post": { "security": [ { "x-auth-xpub": [] } ], - "description": "Delete paymail", + "description": "Search for destinations", "produces": [ "application/json" ], "tags": [ "Admin" ], - "summary": "Delete paymail", + "summary": "Search for destinations", "parameters": [ { - "description": "PaymailAddress model containing paymail address to delete", - "name": "PaymailAddress", + "description": "Supports targeted resource searches with filters and metadata, plus options for pagination and sorting to streamline data exploration and analysis", + "name": "SearchDestinations", "in": "body", "schema": { - "$ref": "#/definitions/admin.PaymailAddress" + "$ref": "#/definitions/filter.SearchDestinations" } } ], "responses": { "200": { - "description": "OK" + "description": "List of destinations", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Destination" + } + } }, "400": { - "description": "Bad request - Error while parsing PaymailAddress from request body or if address is missing" + "description": "Bad request - Error while parsing SearchDestinations from request body" }, "500": { - "description": "Internal Server Error - Error while deleting paymail address" + "description": "Internal server error - Error while searching for destinations" } } } }, - "/v1/admin/paymail/get": { + "/v1/admin/paymail/create": { "post": { "security": [ { "x-auth-xpub": [] } ], - "description": "Get paymail", + "description": "Create paymail", "produces": [ "application/json" ], "tags": [ "Admin" ], - "summary": "Get paymail", + "summary": "Create paymail", "parameters": [ { - "description": "PaymailAddress model containing paymail address to get", - "name": "PaymailAddress", + "description": " ", + "name": "CreatePaymail", "in": "body", "schema": { - "$ref": "#/definitions/admin.PaymailAddress" + "$ref": "#/definitions/admin.CreatePaymail" } } ], "responses": { - "200": { - "description": "PaymailAddress with given address", - "schema": { + "201": { + "description": "Created PaymailAddress", + "schema": { + "$ref": "#/definitions/models.PaymailAddress" + } + }, + "400": { + "description": "Bad request - Error while parsing CreatePaymail from request body or if xpub or address are missing" + }, + "500": { + "description": "Internal Server Error - Error while creating new paymail address" + } + } + } + }, + "/v1/admin/paymail/delete": { + "delete": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "Delete paymail", + "produces": [ + "application/json" + ], + "tags": [ + "Admin" + ], + "summary": "Delete paymail", + "parameters": [ + { + "description": "PaymailAddress model containing paymail address to delete", + "name": "PaymailAddress", + "in": "body", + "schema": { + "$ref": "#/definitions/admin.PaymailAddress" + } + } + ], + "responses": { + "200": { + "description": "OK" + }, + "400": { + "description": "Bad request - Error while parsing PaymailAddress from request body or if address is missing" + }, + "500": { + "description": "Internal Server Error - Error while deleting paymail address" + } + } + } + }, + "/v1/admin/paymail/get": { + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "Get paymail", + "produces": [ + "application/json" + ], + "tags": [ + "Admin" + ], + "summary": "Get paymail", + "parameters": [ + { + "description": "PaymailAddress model containing paymail address to get", + "name": "PaymailAddress", + "in": "body", + "schema": { + "$ref": "#/definitions/admin.PaymailAddress" + } + } + ], + "responses": { + "200": { + "description": "PaymailAddress with given address", + "schema": { "$ref": "#/definitions/models.PaymailAddress" } }, @@ -2689,6 +2978,49 @@ const docTemplate = `{ "description": "Internal server error - Error while searching for transactions" } } + }, + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "Search for transactions", + "produces": [ + "application/json" + ], + "tags": [ + "Admin" + ], + "summary": "Search for transactions", + "deprecated": true, + "parameters": [ + { + "description": "Supports targeted resource searches with filters and metadata, plus options for pagination and sorting to streamline data exploration and analysis", + "name": "SearchTransactions", + "in": "body", + "schema": { + "$ref": "#/definitions/filter.SearchTransactions" + } + } + ], + "responses": { + "200": { + "description": "List of transactions", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Transaction" + } + } + }, + "400": { + "description": "Bad request - Error while parsing SearchTransactions from request body" + }, + "500": { + "description": "Internal server error - Error while searching for transactions" + } + } } }, "/v1/admin/transactions/count": { @@ -3132,6 +3464,955 @@ const docTemplate = `{ } } } + }, + "/v1/contact/accepted/{paymail}": { + "patch": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (POST) /api/v1/invitations/{paymail} instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Contact" + ], + "summary": "Accept contact - Use (POST) /api/v1/invitations/{paymail} instead.", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "Paymail address of the contact that the user would like to accept", + "name": "paymail", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK" + }, + "404": { + "description": "Contact not found" + }, + "422": { + "description": "Contact status not awaiting" + }, + "500": { + "description": "Internal server error" + } + } + } + }, + "/v1/contact/confirmed/{paymail}": { + "patch": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (POST) /api/v1/contacts/{paymail}/confirmation instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Contact" + ], + "summary": "Confirm contact - Use (POST) /api/v1/contacts/{paymail}/confirmation instead", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "Paymail address of the contact that the user would like to confirm", + "name": "paymail", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK" + }, + "404": { + "description": "Contact not found" + }, + "422": { + "description": "Contact status not unconfirmed" + }, + "500": { + "description": "Internal server error" + } + } + } + }, + "/v1/contact/rejected/{paymail}": { + "patch": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (DELETE) /api/v1/invitations/{paymail} instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Contact" + ], + "summary": "Reject contact - Use (DELETE) /api/v1/invitations/{paymail} instead.", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "Paymail address of the contact that the user would like to reject", + "name": "paymail", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK" + }, + "404": { + "description": "Contact not found" + }, + "422": { + "description": "Contact status not awaiting" + }, + "500": { + "description": "Internal server error" + } + } + } + }, + "/v1/contact/search": { + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (GET) /api/v1/contacts instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Contact" + ], + "summary": "Search contacts - Use (GET) /api/v1/contacts instead.", + "deprecated": true, + "parameters": [ + { + "description": "Supports targeted resource searches with filters and metadata, plus options for pagination and sorting to streamline data exploration and analysis", + "name": "SearchContacts", + "in": "body", + "schema": { + "$ref": "#/definitions/filter.SearchContacts" + } + } + ], + "responses": { + "200": { + "description": "List of contacts", + "schema": { + "$ref": "#/definitions/models.SearchContactsResponse" + } + }, + "400": { + "description": "Bad request - Error while parsing SearchContacts from request body" + }, + "500": { + "description": "Internal server error - Error while searching for contacts" + } + } + } + }, + "/v1/contact/unconfirmed/{paymail}": { + "patch": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (DELETE) /api/v1/contacts/{paymail}/confirmation instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Contact" + ], + "summary": "Unconfirm contact - Use (DELETE) /api/v1/contacts/{paymail}/confirmation instead.", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "Paymail address of the contact that the user would like to unconfirm", + "name": "paymail", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK" + }, + "404": { + "description": "Contact not found" + }, + "422": { + "description": "Contact status not confirmed" + }, + "500": { + "description": "Internal server error" + } + } + } + }, + "/v1/contact/{paymail}": { + "put": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (PUT) /api/v1/contacts/{paymail} instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Contact" + ], + "summary": "Upsert contact - Use (PUT) /api/v1/contacts/{paymail} instead.", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "Paymail address of the contact that the user would like to add/modify", + "name": "paymail", + "in": "path", + "required": true + }, + { + "description": "Full name and metadata needed to add/modify contact", + "name": "UpsertContact", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/contacts.UpsertContact" + } + } + ], + "responses": { + "201": { + "description": "Created" + } + } + } + }, + "/v1/destination": { + "get": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "Get a destination. This endpoint has been deprecated (it will be removed in the future).", + "produces": [ + "application/json" + ], + "tags": [ + "Destinations" + ], + "summary": "Get a destination. This endpoint has been deprecated (it will be removed in the future).", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "Destination ID", + "name": "id", + "in": "query" + }, + { + "type": "string", + "description": "Destination address", + "name": "address", + "in": "query" + }, + { + "type": "string", + "description": "Destination locking script", + "name": "locking_script", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Destination with given id", + "schema": { + "$ref": "#/definitions/models.Destination" + } + }, + "400": { + "description": "Bad request - All parameters are missing (id, address, locking_script)" + }, + "500": { + "description": "Internal server error - Error while getting destination" + } + } + }, + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "Create a new destination. This endpoint has been deprecated (it will be removed in the future).", + "produces": [ + "application/json" + ], + "tags": [ + "Destinations" + ], + "summary": "Create a new destination. This endpoint has been deprecated (it will be removed in the future).", + "deprecated": true, + "parameters": [ + { + "description": " ", + "name": "CreateDestination", + "in": "body", + "schema": { + "$ref": "#/definitions/destinations.CreateDestination" + } + } + ], + "responses": { + "201": { + "description": "Created Destination", + "schema": { + "$ref": "#/definitions/models.Destination" + } + }, + "400": { + "description": "Bad request - Error while parsing CreateDestination from request body" + }, + "500": { + "description": "Internal Server Error - Error while creating destination" + } + } + }, + "patch": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "Update destination. This endpoint has been deprecated (it will be removed in the future).", + "produces": [ + "application/json" + ], + "tags": [ + "Destinations" + ], + "summary": "Update destination. This endpoint has been deprecated (it will be removed in the future).", + "deprecated": true, + "parameters": [ + { + "description": " ", + "name": "UpdateDestination", + "in": "body", + "schema": { + "$ref": "#/definitions/destinations.UpdateDestination" + } + } + ], + "responses": { + "200": { + "description": "Updated Destination", + "schema": { + "$ref": "#/definitions/models.Destination" + } + }, + "400": { + "description": "Bad request - Error while parsing UpdateDestination from request body" + }, + "500": { + "description": "Internal Server Error - Error while updating destination" + } + } + } + }, + "/v1/destination/count": { + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "Count Destinations. This endpoint has been deprecated (it will be removed in the future).", + "produces": [ + "application/json" + ], + "tags": [ + "Destinations" + ], + "summary": "Count Destinations. This endpoint has been deprecated (it will be removed in the future).", + "deprecated": true, + "parameters": [ + { + "description": "Enables filtering of elements to be counted", + "name": "CountDestinations", + "in": "body", + "schema": { + "$ref": "#/definitions/filter.CountDestinations" + } + } + ], + "responses": { + "200": { + "description": "Count of destinations", + "schema": { + "type": "number" + } + }, + "400": { + "description": "Bad request - Error while parsing CountDestinations from request body" + }, + "500": { + "description": "Internal Server Error - Error while fetching count of destinations" + } + } + } + }, + "/v1/destination/search": { + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "Search for a destination. This endpoint has been deprecated (it will be removed in the future).", + "produces": [ + "application/json" + ], + "tags": [ + "Destinations" + ], + "summary": "Search for a destination. This endpoint has been deprecated (it will be removed in the future).", + "deprecated": true, + "parameters": [ + { + "description": "Supports targeted resource searches with filters and metadata, plus options for pagination and sorting to streamline data exploration and analysis", + "name": "SearchDestinations", + "in": "body", + "schema": { + "$ref": "#/definitions/filter.SearchDestinations" + } + } + ], + "responses": { + "200": { + "description": "List of destinations", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Destination" + } + } + }, + "400": { + "description": "Bad request - Error while parsing SearchDestinations from request body" + }, + "500": { + "description": "Internal server error - Error while searching for destinations" + } + } + } + }, + "/v1/shared-config": { + "get": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (GET) /api/v1/configs/shared instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Configurations" + ], + "summary": "Get shared config - Use (GET) /api/v1/configs/shared instead.", + "deprecated": true, + "responses": { + "200": { + "description": "Shared configuration", + "schema": { + "$ref": "#/definitions/models.SharedConfig" + } + } + } + } + }, + "/v1/transaction": { + "get": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (GET) /api/v1/transactions/{id} instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Transactions" + ], + "summary": "Get transaction by id - Use (GET) /api/v1/transactions/{id} instead.", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "id", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "Transaction", + "schema": { + "$ref": "#/definitions/models.Transaction" + } + }, + "400": { + "description": "Bad request - Transaction not found or associated with another xpub" + }, + "500": { + "description": "Internal Server Error - Error while fetching transaction" + } + } + }, + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (POST) /api/v1/transactions/drafts instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Transactions" + ], + "summary": "New transaction - Use (POST) /api/v1/transactions/drafts instead.", + "deprecated": true, + "parameters": [ + { + "description": "OldNewDraftTransaction model containing the transaction config and metadata", + "name": "OldNewDraftTransaction", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/transactions.OldNewDraftTransaction" + } + } + ], + "responses": { + "201": { + "description": "Created transaction", + "schema": { + "$ref": "#/definitions/transactions.OldNewDraftTransaction" + } + }, + "400": { + "description": "Bad request - Error while parsing OldNewDraftTransaction from request body or xpub not found" + }, + "500": { + "description": "Internal Server Error - Error while creating transaction" + } + } + }, + "patch": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (PATCH) /api/v1/transactions/{id} instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Transactions" + ], + "summary": "Update transaction - Use (PATCH) /api/v1/transactions/{id} instead.", + "deprecated": true, + "parameters": [ + { + "description": "Pass update transaction request model in the body", + "name": "UpdateTransaction", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/transactions.UpdateTransaction" + } + } + ], + "responses": { + "200": { + "description": "Updated transaction", + "schema": { + "$ref": "#/definitions/models.Transaction" + } + }, + "400": { + "description": "Bad request - Error while parsing UpdateTransaction from request body, tx not found or tx is not associated with the xpub" + }, + "500": { + "description": "Internal Server Error - Error while updating transaction" + } + } + } + }, + "/v1/transaction/count": { + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (GET) /api/v1/transactions instead", + "produces": [ + "application/json" + ], + "tags": [ + "Transactions" + ], + "summary": "Count of transactions - Use (GET) /api/v1/transactions instead.", + "deprecated": true, + "parameters": [ + { + "description": "Enables filtering of elements to be counted", + "name": "CountTransactions", + "in": "body", + "schema": { + "$ref": "#/definitions/filter.CountTransactions" + } + } + ], + "responses": { + "200": { + "description": "Count of access keys", + "schema": { + "type": "number" + } + }, + "400": { + "description": "Bad request - Error while parsing CountTransactions from request body" + }, + "500": { + "description": "Internal Server Error - Error while fetching count of transactions" + } + } + } + }, + "/v1/transaction/record": { + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (POST) /api/v1/transactions instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Transactions" + ], + "summary": "Record transaction - Use (POST) /api/v1/transactions instead.", + "deprecated": true, + "parameters": [ + { + "description": "Transaction to be recorded", + "name": "RecordTransaction", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/transactions.RecordTransaction" + } + } + ], + "responses": { + "201": { + "description": "Created transaction", + "schema": { + "$ref": "#/definitions/models.Transaction" + } + }, + "400": { + "description": "Bad request - Error while parsing RecordTransaction from request body or xpub not found" + }, + "500": { + "description": "Internal Server Error - Error while recording transaction" + } + } + } + }, + "/v1/transaction/search": { + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (GET) /api/v1/transactions instead", + "produces": [ + "application/json" + ], + "tags": [ + "Transactions" + ], + "summary": "Search transaction - Use (GET) /api/v1/transactions instead.", + "deprecated": true, + "parameters": [ + { + "description": "Supports targeted resource searches with filters and metadata, plus options for pagination and sorting to streamline data exploration and analysis", + "name": "SearchTransactions", + "in": "body", + "schema": { + "$ref": "#/definitions/filter.SearchTransactions" + } + } + ], + "responses": { + "200": { + "description": "List of transactions", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Transaction" + } + } + }, + "400": { + "description": "Bad request - Error while parsing SearchTransactions from request body" + }, + "500": { + "description": "Internal server error - Error while searching for transactions" + } + } + } + }, + "/v1/utxo": { + "get": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "Get UTXO. This endpoint has been deprecated (it will be removed in the future).", + "produces": [ + "application/json" + ], + "tags": [ + "UTXO" + ], + "summary": "Get UTXO. This endpoint has been deprecated (it will be removed in the future).", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "Id of the transaction", + "name": "tx_id", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "Output index", + "name": "output_index", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "UTXO with given Id and output index", + "schema": { + "$ref": "#/definitions/models.Utxo" + } + }, + "400": { + "description": "Bad request - Error while parsing output_index" + }, + "500": { + "description": "Internal Server Error - Error while fetching utxo" + } + } + } + }, + "/v1/utxo/count": { + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (GET) /api/v1/utxos instead.", + "produces": [ + "application/json" + ], + "tags": [ + "UTXO" + ], + "summary": "Count of UTXOs - Use (GET) /api/v1/utxos instead.", + "deprecated": true, + "parameters": [ + { + "description": "Enables filtering of elements to be counted", + "name": "CountUtxos", + "in": "body", + "schema": { + "$ref": "#/definitions/filter.CountUtxos" + } + } + ], + "responses": { + "200": { + "description": "Count of utxos", + "schema": { + "type": "number" + } + }, + "400": { + "description": "Bad request - Error while parsing CountUtxos from request body" + }, + "500": { + "description": "Internal Server Error - Error while fetching count of utxos" + } + } + } + }, + "/v1/utxo/search": { + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (GET) /api/v1/utxos instead.", + "produces": [ + "application/json" + ], + "tags": [ + "UTXO" + ], + "summary": "Search UTXO - Use (GET) /api/v1/utxos instead.", + "deprecated": true, + "parameters": [ + { + "description": "Supports targeted resource searches with filters and metadata, plus options for pagination and sorting to streamline data exploration and analysis", + "name": "SearchUtxos", + "in": "body", + "schema": { + "$ref": "#/definitions/filter.SearchUtxos" + } + } + ], + "responses": { + "200": { + "description": "List of utxos", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Utxo" + } + } + }, + "400": { + "description": "Bad request - Error while parsing SearchUtxos from request body" + }, + "500": { + "description": "Internal server error - Error while searching for utxos" + } + } + } + }, + "/v1/xpub": { + "get": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (GET) /api/v1/users/current instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Get current user information - Use (GET) /api/v1/users/current instead.", + "deprecated": true, + "responses": { + "200": { + "description": "xPub associated with the given xPub from auth header", + "schema": { + "$ref": "#/definitions/models.Xpub" + } + }, + "500": { + "description": "Internal Server Error - Error while fetching xPub" + } + } + }, + "patch": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (PATCH) /api/v1/users/current instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Update current user information - Use (PATCH) /api/v1/users/current instead.", + "deprecated": true, + "parameters": [ + { + "description": " ", + "name": "Metadata", + "in": "body", + "schema": { + "$ref": "#/definitions/engine.Metadata" + } + } + ], + "responses": { + "200": { + "description": "Updated xPub", + "schema": { + "$ref": "#/definitions/models.Xpub" + } + }, + "400": { + "description": "Bad request - Error while parsing Metadata from request body" + }, + "500": { + "description": "Internal Server Error - Error while updating xPub" + } + } + } } }, "definitions": { diff --git a/docs/swagger.json b/docs/swagger.json index d2ec25ed4..e49a8d9bb 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -210,10 +210,7 @@ ], "responses": { "200": { - "description": "Rejected contact", - "schema": { - "$ref": "#/definitions/response.Contact" - } + "description": "OK" }, "400": { "description": "Bad request - Error while getting id from path" @@ -719,10 +716,7 @@ ], "responses": { "200": { - "description": "Success response", - "schema": { - "type": "boolean" - } + "description": "OK" }, "500": { "description": "Internal server error - Error while unsubscribing to the webhook" @@ -1832,10 +1826,7 @@ ], "responses": { "200": { - "description": "Revoked AccessKey", - "schema": { - "$ref": "#/definitions/response.AccessKey" - } + "description": "OK" }, "400": { "description": "Bad request - Missing required field: id" @@ -2017,6 +2008,217 @@ } } }, + "/v1/access-key": { + "get": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (GET) /api/v1/users/current/keys/{id} instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Access-key" + ], + "summary": "Get access key - Use (GET) /api/v1/users/current/keys/{id} instead.", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "id of the access key", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "AccessKey with given id", + "schema": { + "$ref": "#/definitions/models.AccessKey" + } + }, + "400": { + "description": "Bad request - Missing required field: id" + }, + "403": { + "description": "Forbidden - Access key is not owned by the user" + }, + "500": { + "description": "Internal server error - Error while getting access key" + } + } + }, + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (POST) /api/v1/users/current/keys instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Access-key" + ], + "summary": "Create access key - Use (POST) /api/v1/users/current/keys instead.", + "deprecated": true, + "parameters": [ + { + "description": " ", + "name": "CreateAccessKey", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/accesskeys.CreateAccessKey" + } + } + ], + "responses": { + "201": { + "description": "Created AccessKey", + "schema": { + "$ref": "#/definitions/models.AccessKey" + } + }, + "400": { + "description": "Bad request - Error while parsing CreateAccessKey from request body" + }, + "500": { + "description": "Internal server error - Error while creating new access key" + } + } + }, + "delete": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (DELETE) /api/v1/users/current/keys/{id} instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Access-key" + ], + "summary": "Revoke access key - Use (DELETE) /api/v1/users/current/keys/{id} instead.", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "id of the access key", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "Revoked AccessKey", + "schema": { + "$ref": "#/definitions/models.AccessKey" + } + }, + "400": { + "description": "Bad request - Missing required field: id" + }, + "500": { + "description": "Internal server error - Error while revoking access key" + } + } + } + }, + "/v1/access-key/count": { + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (GET) /api/v1/users/current/keys instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Access-key" + ], + "summary": "Count of access keys - Use (GET) /api/v1/users/current/keys instead.", + "deprecated": true, + "parameters": [ + { + "description": "Enables filtering of elements to be counted", + "name": "CountAccessKeys", + "in": "body", + "schema": { + "$ref": "#/definitions/filter.CountAccessKeys" + } + } + ], + "responses": { + "200": { + "description": "Count of access keys", + "schema": { + "type": "number" + } + }, + "400": { + "description": "Bad request - Error while parsing CountAccessKeys from request body" + }, + "500": { + "description": "Internal Server Error - Error while fetching count of access keys" + } + } + } + }, + "/v1/access-key/search": { + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (GET) /api/v1/users/current/keys instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Access-key" + ], + "summary": "Search access key - Use (GET) /api/v1/users/current/keys instead.", + "deprecated": true, + "parameters": [ + { + "description": "Supports targeted resource searches with filters and metadata, plus options for pagination and sorting to streamline data exploration and analysis", + "name": "SearchAccessKeys", + "in": "body", + "schema": { + "$ref": "#/definitions/filter.SearchAccessKeys" + } + } + ], + "responses": { + "200": { + "description": "List of access keys", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.AccessKey" + } + } + }, + "400": { + "description": "Bad request - Error while SearchAccessKeys from request body" + }, + "500": { + "description": "Internal server error - Error while searching for access keys" + } + } + } + }, "/v1/admin/access-keys/count": { "post": { "security": [ @@ -2326,7 +2528,7 @@ } } }, - "/v1/admin/destinations/search": { + "/v1/admin/destinations": { "post": { "security": [ { @@ -2341,6 +2543,7 @@ "Admin" ], "summary": "Search for destinations", + "deprecated": true, "parameters": [ { "description": "Supports targeted resource searches with filters and metadata, plus options for pagination and sorting to streamline data exploration and analysis", @@ -2370,114 +2573,200 @@ } } }, - "/v1/admin/paymail/create": { + "/v1/admin/destinations/count": { "post": { "security": [ { "x-auth-xpub": [] } ], - "description": "Create paymail", + "description": "Count destinations", "produces": [ "application/json" ], "tags": [ "Admin" ], - "summary": "Create paymail", + "summary": "Count destinations", + "deprecated": true, "parameters": [ { - "description": " ", - "name": "CreatePaymail", + "description": "Enables filtering of elements to be counted", + "name": "CountDestinations", "in": "body", "schema": { - "$ref": "#/definitions/admin.CreatePaymail" + "$ref": "#/definitions/filter.CountDestinations" } } ], "responses": { - "201": { - "description": "Created PaymailAddress", + "200": { + "description": "Count of destinations", "schema": { - "$ref": "#/definitions/models.PaymailAddress" + "type": "number" } }, "400": { - "description": "Bad request - Error while parsing CreatePaymail from request body or if xpub or address are missing" + "description": "Bad request - Error while parsing CountDestinations from request body" }, "500": { - "description": "Internal Server Error - Error while creating new paymail address" + "description": "Internal Server Error - Error while fetching count of destinations" } } } }, - "/v1/admin/paymail/delete": { - "delete": { + "/v1/admin/destinations/search": { + "post": { "security": [ { "x-auth-xpub": [] } ], - "description": "Delete paymail", + "description": "Search for destinations", "produces": [ "application/json" ], "tags": [ "Admin" ], - "summary": "Delete paymail", + "summary": "Search for destinations", "parameters": [ { - "description": "PaymailAddress model containing paymail address to delete", - "name": "PaymailAddress", + "description": "Supports targeted resource searches with filters and metadata, plus options for pagination and sorting to streamline data exploration and analysis", + "name": "SearchDestinations", "in": "body", "schema": { - "$ref": "#/definitions/admin.PaymailAddress" + "$ref": "#/definitions/filter.SearchDestinations" } } ], "responses": { "200": { - "description": "OK" + "description": "List of destinations", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Destination" + } + } }, "400": { - "description": "Bad request - Error while parsing PaymailAddress from request body or if address is missing" + "description": "Bad request - Error while parsing SearchDestinations from request body" }, "500": { - "description": "Internal Server Error - Error while deleting paymail address" + "description": "Internal server error - Error while searching for destinations" } } } }, - "/v1/admin/paymail/get": { + "/v1/admin/paymail/create": { "post": { "security": [ { "x-auth-xpub": [] } ], - "description": "Get paymail", + "description": "Create paymail", "produces": [ "application/json" ], "tags": [ "Admin" ], - "summary": "Get paymail", + "summary": "Create paymail", "parameters": [ { - "description": "PaymailAddress model containing paymail address to get", - "name": "PaymailAddress", + "description": " ", + "name": "CreatePaymail", "in": "body", "schema": { - "$ref": "#/definitions/admin.PaymailAddress" + "$ref": "#/definitions/admin.CreatePaymail" } } ], "responses": { - "200": { - "description": "PaymailAddress with given address", - "schema": { + "201": { + "description": "Created PaymailAddress", + "schema": { + "$ref": "#/definitions/models.PaymailAddress" + } + }, + "400": { + "description": "Bad request - Error while parsing CreatePaymail from request body or if xpub or address are missing" + }, + "500": { + "description": "Internal Server Error - Error while creating new paymail address" + } + } + } + }, + "/v1/admin/paymail/delete": { + "delete": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "Delete paymail", + "produces": [ + "application/json" + ], + "tags": [ + "Admin" + ], + "summary": "Delete paymail", + "parameters": [ + { + "description": "PaymailAddress model containing paymail address to delete", + "name": "PaymailAddress", + "in": "body", + "schema": { + "$ref": "#/definitions/admin.PaymailAddress" + } + } + ], + "responses": { + "200": { + "description": "OK" + }, + "400": { + "description": "Bad request - Error while parsing PaymailAddress from request body or if address is missing" + }, + "500": { + "description": "Internal Server Error - Error while deleting paymail address" + } + } + } + }, + "/v1/admin/paymail/get": { + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "Get paymail", + "produces": [ + "application/json" + ], + "tags": [ + "Admin" + ], + "summary": "Get paymail", + "parameters": [ + { + "description": "PaymailAddress model containing paymail address to get", + "name": "PaymailAddress", + "in": "body", + "schema": { + "$ref": "#/definitions/admin.PaymailAddress" + } + } + ], + "responses": { + "200": { + "description": "PaymailAddress with given address", + "schema": { "$ref": "#/definitions/models.PaymailAddress" } }, @@ -2680,6 +2969,49 @@ "description": "Internal server error - Error while searching for transactions" } } + }, + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "Search for transactions", + "produces": [ + "application/json" + ], + "tags": [ + "Admin" + ], + "summary": "Search for transactions", + "deprecated": true, + "parameters": [ + { + "description": "Supports targeted resource searches with filters and metadata, plus options for pagination and sorting to streamline data exploration and analysis", + "name": "SearchTransactions", + "in": "body", + "schema": { + "$ref": "#/definitions/filter.SearchTransactions" + } + } + ], + "responses": { + "200": { + "description": "List of transactions", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Transaction" + } + } + }, + "400": { + "description": "Bad request - Error while parsing SearchTransactions from request body" + }, + "500": { + "description": "Internal server error - Error while searching for transactions" + } + } } }, "/v1/admin/transactions/count": { @@ -3123,6 +3455,955 @@ } } } + }, + "/v1/contact/accepted/{paymail}": { + "patch": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (POST) /api/v1/invitations/{paymail} instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Contact" + ], + "summary": "Accept contact - Use (POST) /api/v1/invitations/{paymail} instead.", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "Paymail address of the contact that the user would like to accept", + "name": "paymail", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK" + }, + "404": { + "description": "Contact not found" + }, + "422": { + "description": "Contact status not awaiting" + }, + "500": { + "description": "Internal server error" + } + } + } + }, + "/v1/contact/confirmed/{paymail}": { + "patch": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (POST) /api/v1/contacts/{paymail}/confirmation instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Contact" + ], + "summary": "Confirm contact - Use (POST) /api/v1/contacts/{paymail}/confirmation instead", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "Paymail address of the contact that the user would like to confirm", + "name": "paymail", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK" + }, + "404": { + "description": "Contact not found" + }, + "422": { + "description": "Contact status not unconfirmed" + }, + "500": { + "description": "Internal server error" + } + } + } + }, + "/v1/contact/rejected/{paymail}": { + "patch": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (DELETE) /api/v1/invitations/{paymail} instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Contact" + ], + "summary": "Reject contact - Use (DELETE) /api/v1/invitations/{paymail} instead.", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "Paymail address of the contact that the user would like to reject", + "name": "paymail", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK" + }, + "404": { + "description": "Contact not found" + }, + "422": { + "description": "Contact status not awaiting" + }, + "500": { + "description": "Internal server error" + } + } + } + }, + "/v1/contact/search": { + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (GET) /api/v1/contacts instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Contact" + ], + "summary": "Search contacts - Use (GET) /api/v1/contacts instead.", + "deprecated": true, + "parameters": [ + { + "description": "Supports targeted resource searches with filters and metadata, plus options for pagination and sorting to streamline data exploration and analysis", + "name": "SearchContacts", + "in": "body", + "schema": { + "$ref": "#/definitions/filter.SearchContacts" + } + } + ], + "responses": { + "200": { + "description": "List of contacts", + "schema": { + "$ref": "#/definitions/models.SearchContactsResponse" + } + }, + "400": { + "description": "Bad request - Error while parsing SearchContacts from request body" + }, + "500": { + "description": "Internal server error - Error while searching for contacts" + } + } + } + }, + "/v1/contact/unconfirmed/{paymail}": { + "patch": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (DELETE) /api/v1/contacts/{paymail}/confirmation instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Contact" + ], + "summary": "Unconfirm contact - Use (DELETE) /api/v1/contacts/{paymail}/confirmation instead.", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "Paymail address of the contact that the user would like to unconfirm", + "name": "paymail", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK" + }, + "404": { + "description": "Contact not found" + }, + "422": { + "description": "Contact status not confirmed" + }, + "500": { + "description": "Internal server error" + } + } + } + }, + "/v1/contact/{paymail}": { + "put": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (PUT) /api/v1/contacts/{paymail} instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Contact" + ], + "summary": "Upsert contact - Use (PUT) /api/v1/contacts/{paymail} instead.", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "Paymail address of the contact that the user would like to add/modify", + "name": "paymail", + "in": "path", + "required": true + }, + { + "description": "Full name and metadata needed to add/modify contact", + "name": "UpsertContact", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/contacts.UpsertContact" + } + } + ], + "responses": { + "201": { + "description": "Created" + } + } + } + }, + "/v1/destination": { + "get": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "Get a destination. This endpoint has been deprecated (it will be removed in the future).", + "produces": [ + "application/json" + ], + "tags": [ + "Destinations" + ], + "summary": "Get a destination. This endpoint has been deprecated (it will be removed in the future).", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "Destination ID", + "name": "id", + "in": "query" + }, + { + "type": "string", + "description": "Destination address", + "name": "address", + "in": "query" + }, + { + "type": "string", + "description": "Destination locking script", + "name": "locking_script", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Destination with given id", + "schema": { + "$ref": "#/definitions/models.Destination" + } + }, + "400": { + "description": "Bad request - All parameters are missing (id, address, locking_script)" + }, + "500": { + "description": "Internal server error - Error while getting destination" + } + } + }, + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "Create a new destination. This endpoint has been deprecated (it will be removed in the future).", + "produces": [ + "application/json" + ], + "tags": [ + "Destinations" + ], + "summary": "Create a new destination. This endpoint has been deprecated (it will be removed in the future).", + "deprecated": true, + "parameters": [ + { + "description": " ", + "name": "CreateDestination", + "in": "body", + "schema": { + "$ref": "#/definitions/destinations.CreateDestination" + } + } + ], + "responses": { + "201": { + "description": "Created Destination", + "schema": { + "$ref": "#/definitions/models.Destination" + } + }, + "400": { + "description": "Bad request - Error while parsing CreateDestination from request body" + }, + "500": { + "description": "Internal Server Error - Error while creating destination" + } + } + }, + "patch": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "Update destination. This endpoint has been deprecated (it will be removed in the future).", + "produces": [ + "application/json" + ], + "tags": [ + "Destinations" + ], + "summary": "Update destination. This endpoint has been deprecated (it will be removed in the future).", + "deprecated": true, + "parameters": [ + { + "description": " ", + "name": "UpdateDestination", + "in": "body", + "schema": { + "$ref": "#/definitions/destinations.UpdateDestination" + } + } + ], + "responses": { + "200": { + "description": "Updated Destination", + "schema": { + "$ref": "#/definitions/models.Destination" + } + }, + "400": { + "description": "Bad request - Error while parsing UpdateDestination from request body" + }, + "500": { + "description": "Internal Server Error - Error while updating destination" + } + } + } + }, + "/v1/destination/count": { + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "Count Destinations. This endpoint has been deprecated (it will be removed in the future).", + "produces": [ + "application/json" + ], + "tags": [ + "Destinations" + ], + "summary": "Count Destinations. This endpoint has been deprecated (it will be removed in the future).", + "deprecated": true, + "parameters": [ + { + "description": "Enables filtering of elements to be counted", + "name": "CountDestinations", + "in": "body", + "schema": { + "$ref": "#/definitions/filter.CountDestinations" + } + } + ], + "responses": { + "200": { + "description": "Count of destinations", + "schema": { + "type": "number" + } + }, + "400": { + "description": "Bad request - Error while parsing CountDestinations from request body" + }, + "500": { + "description": "Internal Server Error - Error while fetching count of destinations" + } + } + } + }, + "/v1/destination/search": { + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "Search for a destination. This endpoint has been deprecated (it will be removed in the future).", + "produces": [ + "application/json" + ], + "tags": [ + "Destinations" + ], + "summary": "Search for a destination. This endpoint has been deprecated (it will be removed in the future).", + "deprecated": true, + "parameters": [ + { + "description": "Supports targeted resource searches with filters and metadata, plus options for pagination and sorting to streamline data exploration and analysis", + "name": "SearchDestinations", + "in": "body", + "schema": { + "$ref": "#/definitions/filter.SearchDestinations" + } + } + ], + "responses": { + "200": { + "description": "List of destinations", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Destination" + } + } + }, + "400": { + "description": "Bad request - Error while parsing SearchDestinations from request body" + }, + "500": { + "description": "Internal server error - Error while searching for destinations" + } + } + } + }, + "/v1/shared-config": { + "get": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (GET) /api/v1/configs/shared instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Configurations" + ], + "summary": "Get shared config - Use (GET) /api/v1/configs/shared instead.", + "deprecated": true, + "responses": { + "200": { + "description": "Shared configuration", + "schema": { + "$ref": "#/definitions/models.SharedConfig" + } + } + } + } + }, + "/v1/transaction": { + "get": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (GET) /api/v1/transactions/{id} instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Transactions" + ], + "summary": "Get transaction by id - Use (GET) /api/v1/transactions/{id} instead.", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "id", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "Transaction", + "schema": { + "$ref": "#/definitions/models.Transaction" + } + }, + "400": { + "description": "Bad request - Transaction not found or associated with another xpub" + }, + "500": { + "description": "Internal Server Error - Error while fetching transaction" + } + } + }, + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (POST) /api/v1/transactions/drafts instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Transactions" + ], + "summary": "New transaction - Use (POST) /api/v1/transactions/drafts instead.", + "deprecated": true, + "parameters": [ + { + "description": "OldNewDraftTransaction model containing the transaction config and metadata", + "name": "OldNewDraftTransaction", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/transactions.OldNewDraftTransaction" + } + } + ], + "responses": { + "201": { + "description": "Created transaction", + "schema": { + "$ref": "#/definitions/transactions.OldNewDraftTransaction" + } + }, + "400": { + "description": "Bad request - Error while parsing OldNewDraftTransaction from request body or xpub not found" + }, + "500": { + "description": "Internal Server Error - Error while creating transaction" + } + } + }, + "patch": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (PATCH) /api/v1/transactions/{id} instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Transactions" + ], + "summary": "Update transaction - Use (PATCH) /api/v1/transactions/{id} instead.", + "deprecated": true, + "parameters": [ + { + "description": "Pass update transaction request model in the body", + "name": "UpdateTransaction", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/transactions.UpdateTransaction" + } + } + ], + "responses": { + "200": { + "description": "Updated transaction", + "schema": { + "$ref": "#/definitions/models.Transaction" + } + }, + "400": { + "description": "Bad request - Error while parsing UpdateTransaction from request body, tx not found or tx is not associated with the xpub" + }, + "500": { + "description": "Internal Server Error - Error while updating transaction" + } + } + } + }, + "/v1/transaction/count": { + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (GET) /api/v1/transactions instead", + "produces": [ + "application/json" + ], + "tags": [ + "Transactions" + ], + "summary": "Count of transactions - Use (GET) /api/v1/transactions instead.", + "deprecated": true, + "parameters": [ + { + "description": "Enables filtering of elements to be counted", + "name": "CountTransactions", + "in": "body", + "schema": { + "$ref": "#/definitions/filter.CountTransactions" + } + } + ], + "responses": { + "200": { + "description": "Count of access keys", + "schema": { + "type": "number" + } + }, + "400": { + "description": "Bad request - Error while parsing CountTransactions from request body" + }, + "500": { + "description": "Internal Server Error - Error while fetching count of transactions" + } + } + } + }, + "/v1/transaction/record": { + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (POST) /api/v1/transactions instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Transactions" + ], + "summary": "Record transaction - Use (POST) /api/v1/transactions instead.", + "deprecated": true, + "parameters": [ + { + "description": "Transaction to be recorded", + "name": "RecordTransaction", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/transactions.RecordTransaction" + } + } + ], + "responses": { + "201": { + "description": "Created transaction", + "schema": { + "$ref": "#/definitions/models.Transaction" + } + }, + "400": { + "description": "Bad request - Error while parsing RecordTransaction from request body or xpub not found" + }, + "500": { + "description": "Internal Server Error - Error while recording transaction" + } + } + } + }, + "/v1/transaction/search": { + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (GET) /api/v1/transactions instead", + "produces": [ + "application/json" + ], + "tags": [ + "Transactions" + ], + "summary": "Search transaction - Use (GET) /api/v1/transactions instead.", + "deprecated": true, + "parameters": [ + { + "description": "Supports targeted resource searches with filters and metadata, plus options for pagination and sorting to streamline data exploration and analysis", + "name": "SearchTransactions", + "in": "body", + "schema": { + "$ref": "#/definitions/filter.SearchTransactions" + } + } + ], + "responses": { + "200": { + "description": "List of transactions", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Transaction" + } + } + }, + "400": { + "description": "Bad request - Error while parsing SearchTransactions from request body" + }, + "500": { + "description": "Internal server error - Error while searching for transactions" + } + } + } + }, + "/v1/utxo": { + "get": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "Get UTXO. This endpoint has been deprecated (it will be removed in the future).", + "produces": [ + "application/json" + ], + "tags": [ + "UTXO" + ], + "summary": "Get UTXO. This endpoint has been deprecated (it will be removed in the future).", + "deprecated": true, + "parameters": [ + { + "type": "string", + "description": "Id of the transaction", + "name": "tx_id", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "Output index", + "name": "output_index", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "UTXO with given Id and output index", + "schema": { + "$ref": "#/definitions/models.Utxo" + } + }, + "400": { + "description": "Bad request - Error while parsing output_index" + }, + "500": { + "description": "Internal Server Error - Error while fetching utxo" + } + } + } + }, + "/v1/utxo/count": { + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (GET) /api/v1/utxos instead.", + "produces": [ + "application/json" + ], + "tags": [ + "UTXO" + ], + "summary": "Count of UTXOs - Use (GET) /api/v1/utxos instead.", + "deprecated": true, + "parameters": [ + { + "description": "Enables filtering of elements to be counted", + "name": "CountUtxos", + "in": "body", + "schema": { + "$ref": "#/definitions/filter.CountUtxos" + } + } + ], + "responses": { + "200": { + "description": "Count of utxos", + "schema": { + "type": "number" + } + }, + "400": { + "description": "Bad request - Error while parsing CountUtxos from request body" + }, + "500": { + "description": "Internal Server Error - Error while fetching count of utxos" + } + } + } + }, + "/v1/utxo/search": { + "post": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (GET) /api/v1/utxos instead.", + "produces": [ + "application/json" + ], + "tags": [ + "UTXO" + ], + "summary": "Search UTXO - Use (GET) /api/v1/utxos instead.", + "deprecated": true, + "parameters": [ + { + "description": "Supports targeted resource searches with filters and metadata, plus options for pagination and sorting to streamline data exploration and analysis", + "name": "SearchUtxos", + "in": "body", + "schema": { + "$ref": "#/definitions/filter.SearchUtxos" + } + } + ], + "responses": { + "200": { + "description": "List of utxos", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Utxo" + } + } + }, + "400": { + "description": "Bad request - Error while parsing SearchUtxos from request body" + }, + "500": { + "description": "Internal server error - Error while searching for utxos" + } + } + } + }, + "/v1/xpub": { + "get": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (GET) /api/v1/users/current instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Get current user information - Use (GET) /api/v1/users/current instead.", + "deprecated": true, + "responses": { + "200": { + "description": "xPub associated with the given xPub from auth header", + "schema": { + "$ref": "#/definitions/models.Xpub" + } + }, + "500": { + "description": "Internal Server Error - Error while fetching xPub" + } + } + }, + "patch": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "This endpoint has been deprecated. Use (PATCH) /api/v1/users/current instead.", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Update current user information - Use (PATCH) /api/v1/users/current instead.", + "deprecated": true, + "parameters": [ + { + "description": " ", + "name": "Metadata", + "in": "body", + "schema": { + "$ref": "#/definitions/engine.Metadata" + } + } + ], + "responses": { + "200": { + "description": "Updated xPub", + "schema": { + "$ref": "#/definitions/models.Xpub" + } + }, + "400": { + "description": "Bad request - Error while parsing Metadata from request body" + }, + "500": { + "description": "Internal Server Error - Error while updating xPub" + } + } + } } }, "definitions": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index cb746386a..7b4650368 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -2734,9 +2734,7 @@ paths: - application/json responses: "200": - description: Rejected contact - schema: - $ref: '#/definitions/response.Contact' + description: OK "400": description: Bad request - Error while getting id from path "404": @@ -3041,9 +3039,7 @@ paths: - application/json responses: "200": - description: Success response - schema: - type: boolean + description: OK "500": description: Internal server error - Error while unsubscribing to the webhook security: @@ -3774,9 +3770,7 @@ paths: - application/json responses: "200": - description: Revoked AccessKey - schema: - $ref: '#/definitions/response.AccessKey' + description: OK "400": description: 'Bad request - Missing required field: id' "500": @@ -3933,6 +3927,149 @@ paths: summary: Search UTXO tags: - UTXOs + /v1/access-key: + delete: + deprecated: true + description: This endpoint has been deprecated. Use (DELETE) /api/v1/users/current/keys/{id} + instead. + parameters: + - description: id of the access key + in: query + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: Revoked AccessKey + schema: + $ref: '#/definitions/models.AccessKey' + "400": + description: 'Bad request - Missing required field: id' + "500": + description: Internal server error - Error while revoking access key + security: + - x-auth-xpub: [] + summary: Revoke access key - Use (DELETE) /api/v1/users/current/keys/{id} instead. + tags: + - Access-key + get: + deprecated: true + description: This endpoint has been deprecated. Use (GET) /api/v1/users/current/keys/{id} + instead. + parameters: + - description: id of the access key + in: query + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: AccessKey with given id + schema: + $ref: '#/definitions/models.AccessKey' + "400": + description: 'Bad request - Missing required field: id' + "403": + description: Forbidden - Access key is not owned by the user + "500": + description: Internal server error - Error while getting access key + security: + - x-auth-xpub: [] + summary: Get access key - Use (GET) /api/v1/users/current/keys/{id} instead. + tags: + - Access-key + post: + deprecated: true + description: This endpoint has been deprecated. Use (POST) /api/v1/users/current/keys + instead. + parameters: + - description: ' ' + in: body + name: CreateAccessKey + required: true + schema: + $ref: '#/definitions/accesskeys.CreateAccessKey' + produces: + - application/json + responses: + "201": + description: Created AccessKey + schema: + $ref: '#/definitions/models.AccessKey' + "400": + description: Bad request - Error while parsing CreateAccessKey from request + body + "500": + description: Internal server error - Error while creating new access key + security: + - x-auth-xpub: [] + summary: Create access key - Use (POST) /api/v1/users/current/keys instead. + tags: + - Access-key + /v1/access-key/count: + post: + deprecated: true + description: This endpoint has been deprecated. Use (GET) /api/v1/users/current/keys + instead. + parameters: + - description: Enables filtering of elements to be counted + in: body + name: CountAccessKeys + schema: + $ref: '#/definitions/filter.CountAccessKeys' + produces: + - application/json + responses: + "200": + description: Count of access keys + schema: + type: number + "400": + description: Bad request - Error while parsing CountAccessKeys from request + body + "500": + description: Internal Server Error - Error while fetching count of access + keys + security: + - x-auth-xpub: [] + summary: Count of access keys - Use (GET) /api/v1/users/current/keys instead. + tags: + - Access-key + /v1/access-key/search: + post: + deprecated: true + description: This endpoint has been deprecated. Use (GET) /api/v1/users/current/keys + instead. + parameters: + - description: Supports targeted resource searches with filters and metadata, + plus options for pagination and sorting to streamline data exploration and + analysis + in: body + name: SearchAccessKeys + schema: + $ref: '#/definitions/filter.SearchAccessKeys' + produces: + - application/json + responses: + "200": + description: List of access keys + schema: + items: + $ref: '#/definitions/models.AccessKey' + type: array + "400": + description: Bad request - Error while SearchAccessKeys from request body + "500": + description: Internal server error - Error while searching for access keys + security: + - x-auth-xpub: [] + summary: Search access key - Use (GET) /api/v1/users/current/keys instead. + tags: + - Access-key /v1/admin/access-keys/count: post: description: Access Keys Count @@ -4134,6 +4271,64 @@ paths: summary: Search for contacts tags: - Admin + /v1/admin/destinations: + post: + deprecated: true + description: Search for destinations + parameters: + - description: Supports targeted resource searches with filters and metadata, + plus options for pagination and sorting to streamline data exploration and + analysis + in: body + name: SearchDestinations + schema: + $ref: '#/definitions/filter.SearchDestinations' + produces: + - application/json + responses: + "200": + description: List of destinations + schema: + items: + $ref: '#/definitions/models.Destination' + type: array + "400": + description: Bad request - Error while parsing SearchDestinations from request + body + "500": + description: Internal server error - Error while searching for destinations + security: + - x-auth-xpub: [] + summary: Search for destinations + tags: + - Admin + /v1/admin/destinations/count: + post: + deprecated: true + description: Count destinations + parameters: + - description: Enables filtering of elements to be counted + in: body + name: CountDestinations + schema: + $ref: '#/definitions/filter.CountDestinations' + produces: + - application/json + responses: + "200": + description: Count of destinations + schema: + type: number + "400": + description: Bad request - Error while parsing CountDestinations from request + body + "500": + description: Internal Server Error - Error while fetching count of destinations + security: + - x-auth-xpub: [] + summary: Count destinations + tags: + - Admin /v1/admin/destinations/search: post: description: Search for destinations @@ -4363,6 +4558,36 @@ paths: summary: Search for transactions tags: - Admin + post: + deprecated: true + description: Search for transactions + parameters: + - description: Supports targeted resource searches with filters and metadata, + plus options for pagination and sorting to streamline data exploration and + analysis + in: body + name: SearchTransactions + schema: + $ref: '#/definitions/filter.SearchTransactions' + produces: + - application/json + responses: + "200": + description: List of transactions + schema: + items: + $ref: '#/definitions/models.Transaction' + type: array + "400": + description: Bad request - Error while parsing SearchTransactions from request + body + "500": + description: Internal server error - Error while searching for transactions + security: + - x-auth-xpub: [] + summary: Search for transactions + tags: + - Admin /v1/admin/transactions/count: post: description: Count transactions @@ -4647,6 +4872,652 @@ paths: summary: Search for xpubs tags: - Admin + /v1/contact/{paymail}: + put: + deprecated: true + description: This endpoint has been deprecated. Use (PUT) /api/v1/contacts/{paymail} + instead. + parameters: + - description: Paymail address of the contact that the user would like to add/modify + in: path + name: paymail + required: true + type: string + - description: Full name and metadata needed to add/modify contact + in: body + name: UpsertContact + required: true + schema: + $ref: '#/definitions/contacts.UpsertContact' + produces: + - application/json + responses: + "201": + description: Created + security: + - x-auth-xpub: [] + summary: Upsert contact - Use (PUT) /api/v1/contacts/{paymail} instead. + tags: + - Contact + /v1/contact/accepted/{paymail}: + patch: + deprecated: true + description: This endpoint has been deprecated. Use (POST) /api/v1/invitations/{paymail} + instead. + parameters: + - description: Paymail address of the contact that the user would like to accept + in: path + name: paymail + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + "404": + description: Contact not found + "422": + description: Contact status not awaiting + "500": + description: Internal server error + security: + - x-auth-xpub: [] + summary: Accept contact - Use (POST) /api/v1/invitations/{paymail} instead. + tags: + - Contact + /v1/contact/confirmed/{paymail}: + patch: + deprecated: true + description: This endpoint has been deprecated. Use (POST) /api/v1/contacts/{paymail}/confirmation + instead. + parameters: + - description: Paymail address of the contact that the user would like to confirm + in: path + name: paymail + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + "404": + description: Contact not found + "422": + description: Contact status not unconfirmed + "500": + description: Internal server error + security: + - x-auth-xpub: [] + summary: Confirm contact - Use (POST) /api/v1/contacts/{paymail}/confirmation + instead + tags: + - Contact + /v1/contact/rejected/{paymail}: + patch: + deprecated: true + description: This endpoint has been deprecated. Use (DELETE) /api/v1/invitations/{paymail} + instead. + parameters: + - description: Paymail address of the contact that the user would like to reject + in: path + name: paymail + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + "404": + description: Contact not found + "422": + description: Contact status not awaiting + "500": + description: Internal server error + security: + - x-auth-xpub: [] + summary: Reject contact - Use (DELETE) /api/v1/invitations/{paymail} instead. + tags: + - Contact + /v1/contact/search: + post: + deprecated: true + description: This endpoint has been deprecated. Use (GET) /api/v1/contacts instead. + parameters: + - description: Supports targeted resource searches with filters and metadata, + plus options for pagination and sorting to streamline data exploration and + analysis + in: body + name: SearchContacts + schema: + $ref: '#/definitions/filter.SearchContacts' + produces: + - application/json + responses: + "200": + description: List of contacts + schema: + $ref: '#/definitions/models.SearchContactsResponse' + "400": + description: Bad request - Error while parsing SearchContacts from request + body + "500": + description: Internal server error - Error while searching for contacts + security: + - x-auth-xpub: [] + summary: Search contacts - Use (GET) /api/v1/contacts instead. + tags: + - Contact + /v1/contact/unconfirmed/{paymail}: + patch: + deprecated: true + description: This endpoint has been deprecated. Use (DELETE) /api/v1/contacts/{paymail}/confirmation + instead. + parameters: + - description: Paymail address of the contact that the user would like to unconfirm + in: path + name: paymail + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + "404": + description: Contact not found + "422": + description: Contact status not confirmed + "500": + description: Internal server error + security: + - x-auth-xpub: [] + summary: Unconfirm contact - Use (DELETE) /api/v1/contacts/{paymail}/confirmation + instead. + tags: + - Contact + /v1/destination: + get: + deprecated: true + description: Get a destination. This endpoint has been deprecated (it will be + removed in the future). + parameters: + - description: Destination ID + in: query + name: id + type: string + - description: Destination address + in: query + name: address + type: string + - description: Destination locking script + in: query + name: locking_script + type: string + produces: + - application/json + responses: + "200": + description: Destination with given id + schema: + $ref: '#/definitions/models.Destination' + "400": + description: Bad request - All parameters are missing (id, address, locking_script) + "500": + description: Internal server error - Error while getting destination + security: + - x-auth-xpub: [] + summary: Get a destination. This endpoint has been deprecated (it will be removed + in the future). + tags: + - Destinations + patch: + deprecated: true + description: Update destination. This endpoint has been deprecated (it will + be removed in the future). + parameters: + - description: ' ' + in: body + name: UpdateDestination + schema: + $ref: '#/definitions/destinations.UpdateDestination' + produces: + - application/json + responses: + "200": + description: Updated Destination + schema: + $ref: '#/definitions/models.Destination' + "400": + description: Bad request - Error while parsing UpdateDestination from request + body + "500": + description: Internal Server Error - Error while updating destination + security: + - x-auth-xpub: [] + summary: Update destination. This endpoint has been deprecated (it will be removed + in the future). + tags: + - Destinations + post: + deprecated: true + description: Create a new destination. This endpoint has been deprecated (it + will be removed in the future). + parameters: + - description: ' ' + in: body + name: CreateDestination + schema: + $ref: '#/definitions/destinations.CreateDestination' + produces: + - application/json + responses: + "201": + description: Created Destination + schema: + $ref: '#/definitions/models.Destination' + "400": + description: Bad request - Error while parsing CreateDestination from request + body + "500": + description: Internal Server Error - Error while creating destination + security: + - x-auth-xpub: [] + summary: Create a new destination. This endpoint has been deprecated (it will + be removed in the future). + tags: + - Destinations + /v1/destination/count: + post: + deprecated: true + description: Count Destinations. This endpoint has been deprecated (it will + be removed in the future). + parameters: + - description: Enables filtering of elements to be counted + in: body + name: CountDestinations + schema: + $ref: '#/definitions/filter.CountDestinations' + produces: + - application/json + responses: + "200": + description: Count of destinations + schema: + type: number + "400": + description: Bad request - Error while parsing CountDestinations from request + body + "500": + description: Internal Server Error - Error while fetching count of destinations + security: + - x-auth-xpub: [] + summary: Count Destinations. This endpoint has been deprecated (it will be removed + in the future). + tags: + - Destinations + /v1/destination/search: + post: + deprecated: true + description: Search for a destination. This endpoint has been deprecated (it + will be removed in the future). + parameters: + - description: Supports targeted resource searches with filters and metadata, + plus options for pagination and sorting to streamline data exploration and + analysis + in: body + name: SearchDestinations + schema: + $ref: '#/definitions/filter.SearchDestinations' + produces: + - application/json + responses: + "200": + description: List of destinations + schema: + items: + $ref: '#/definitions/models.Destination' + type: array + "400": + description: Bad request - Error while parsing SearchDestinations from request + body + "500": + description: Internal server error - Error while searching for destinations + security: + - x-auth-xpub: [] + summary: Search for a destination. This endpoint has been deprecated (it will + be removed in the future). + tags: + - Destinations + /v1/shared-config: + get: + deprecated: true + description: This endpoint has been deprecated. Use (GET) /api/v1/configs/shared + instead. + produces: + - application/json + responses: + "200": + description: Shared configuration + schema: + $ref: '#/definitions/models.SharedConfig' + security: + - x-auth-xpub: [] + summary: Get shared config - Use (GET) /api/v1/configs/shared instead. + tags: + - Configurations + /v1/transaction: + get: + deprecated: true + description: This endpoint has been deprecated. Use (GET) /api/v1/transactions/{id} + instead. + parameters: + - description: id + in: query + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: Transaction + schema: + $ref: '#/definitions/models.Transaction' + "400": + description: Bad request - Transaction not found or associated with another + xpub + "500": + description: Internal Server Error - Error while fetching transaction + security: + - x-auth-xpub: [] + summary: Get transaction by id - Use (GET) /api/v1/transactions/{id} instead. + tags: + - Transactions + patch: + deprecated: true + description: This endpoint has been deprecated. Use (PATCH) /api/v1/transactions/{id} + instead. + parameters: + - description: Pass update transaction request model in the body + in: body + name: UpdateTransaction + required: true + schema: + $ref: '#/definitions/transactions.UpdateTransaction' + produces: + - application/json + responses: + "200": + description: Updated transaction + schema: + $ref: '#/definitions/models.Transaction' + "400": + description: Bad request - Error while parsing UpdateTransaction from request + body, tx not found or tx is not associated with the xpub + "500": + description: Internal Server Error - Error while updating transaction + security: + - x-auth-xpub: [] + summary: Update transaction - Use (PATCH) /api/v1/transactions/{id} instead. + tags: + - Transactions + post: + deprecated: true + description: This endpoint has been deprecated. Use (POST) /api/v1/transactions/drafts + instead. + parameters: + - description: OldNewDraftTransaction model containing the transaction config + and metadata + in: body + name: OldNewDraftTransaction + required: true + schema: + $ref: '#/definitions/transactions.OldNewDraftTransaction' + produces: + - application/json + responses: + "201": + description: Created transaction + schema: + $ref: '#/definitions/transactions.OldNewDraftTransaction' + "400": + description: Bad request - Error while parsing OldNewDraftTransaction from + request body or xpub not found + "500": + description: Internal Server Error - Error while creating transaction + security: + - x-auth-xpub: [] + summary: New transaction - Use (POST) /api/v1/transactions/drafts instead. + tags: + - Transactions + /v1/transaction/count: + post: + deprecated: true + description: This endpoint has been deprecated. Use (GET) /api/v1/transactions + instead + parameters: + - description: Enables filtering of elements to be counted + in: body + name: CountTransactions + schema: + $ref: '#/definitions/filter.CountTransactions' + produces: + - application/json + responses: + "200": + description: Count of access keys + schema: + type: number + "400": + description: Bad request - Error while parsing CountTransactions from request + body + "500": + description: Internal Server Error - Error while fetching count of transactions + security: + - x-auth-xpub: [] + summary: Count of transactions - Use (GET) /api/v1/transactions instead. + tags: + - Transactions + /v1/transaction/record: + post: + deprecated: true + description: This endpoint has been deprecated. Use (POST) /api/v1/transactions + instead. + parameters: + - description: Transaction to be recorded + in: body + name: RecordTransaction + required: true + schema: + $ref: '#/definitions/transactions.RecordTransaction' + produces: + - application/json + responses: + "201": + description: Created transaction + schema: + $ref: '#/definitions/models.Transaction' + "400": + description: Bad request - Error while parsing RecordTransaction from request + body or xpub not found + "500": + description: Internal Server Error - Error while recording transaction + security: + - x-auth-xpub: [] + summary: Record transaction - Use (POST) /api/v1/transactions instead. + tags: + - Transactions + /v1/transaction/search: + post: + deprecated: true + description: This endpoint has been deprecated. Use (GET) /api/v1/transactions + instead + parameters: + - description: Supports targeted resource searches with filters and metadata, + plus options for pagination and sorting to streamline data exploration and + analysis + in: body + name: SearchTransactions + schema: + $ref: '#/definitions/filter.SearchTransactions' + produces: + - application/json + responses: + "200": + description: List of transactions + schema: + items: + $ref: '#/definitions/models.Transaction' + type: array + "400": + description: Bad request - Error while parsing SearchTransactions from request + body + "500": + description: Internal server error - Error while searching for transactions + security: + - x-auth-xpub: [] + summary: Search transaction - Use (GET) /api/v1/transactions instead. + tags: + - Transactions + /v1/utxo: + get: + deprecated: true + description: Get UTXO. This endpoint has been deprecated (it will be removed + in the future). + parameters: + - description: Id of the transaction + in: query + name: tx_id + required: true + type: string + - description: Output index + in: query + name: output_index + required: true + type: integer + produces: + - application/json + responses: + "200": + description: UTXO with given Id and output index + schema: + $ref: '#/definitions/models.Utxo' + "400": + description: Bad request - Error while parsing output_index + "500": + description: Internal Server Error - Error while fetching utxo + security: + - x-auth-xpub: [] + summary: Get UTXO. This endpoint has been deprecated (it will be removed in + the future). + tags: + - UTXO + /v1/utxo/count: + post: + deprecated: true + description: This endpoint has been deprecated. Use (GET) /api/v1/utxos instead. + parameters: + - description: Enables filtering of elements to be counted + in: body + name: CountUtxos + schema: + $ref: '#/definitions/filter.CountUtxos' + produces: + - application/json + responses: + "200": + description: Count of utxos + schema: + type: number + "400": + description: Bad request - Error while parsing CountUtxos from request body + "500": + description: Internal Server Error - Error while fetching count of utxos + security: + - x-auth-xpub: [] + summary: Count of UTXOs - Use (GET) /api/v1/utxos instead. + tags: + - UTXO + /v1/utxo/search: + post: + deprecated: true + description: This endpoint has been deprecated. Use (GET) /api/v1/utxos instead. + parameters: + - description: Supports targeted resource searches with filters and metadata, + plus options for pagination and sorting to streamline data exploration and + analysis + in: body + name: SearchUtxos + schema: + $ref: '#/definitions/filter.SearchUtxos' + produces: + - application/json + responses: + "200": + description: List of utxos + schema: + items: + $ref: '#/definitions/models.Utxo' + type: array + "400": + description: Bad request - Error while parsing SearchUtxos from request + body + "500": + description: Internal server error - Error while searching for utxos + security: + - x-auth-xpub: [] + summary: Search UTXO - Use (GET) /api/v1/utxos instead. + tags: + - UTXO + /v1/xpub: + get: + deprecated: true + description: This endpoint has been deprecated. Use (GET) /api/v1/users/current + instead. + produces: + - application/json + responses: + "200": + description: xPub associated with the given xPub from auth header + schema: + $ref: '#/definitions/models.Xpub' + "500": + description: Internal Server Error - Error while fetching xPub + security: + - x-auth-xpub: [] + summary: Get current user information - Use (GET) /api/v1/users/current instead. + tags: + - Users + patch: + deprecated: true + description: This endpoint has been deprecated. Use (PATCH) /api/v1/users/current + instead. + parameters: + - description: ' ' + in: body + name: Metadata + schema: + $ref: '#/definitions/engine.Metadata' + produces: + - application/json + responses: + "200": + description: Updated xPub + schema: + $ref: '#/definitions/models.Xpub' + "400": + description: Bad request - Error while parsing Metadata from request body + "500": + description: Internal Server Error - Error while updating xPub + security: + - x-auth-xpub: [] + summary: Update current user information - Use (PATCH) /api/v1/users/current + instead. + tags: + - Users securityDefinitions: callback-auth: in: header