swagger.json


Overview

This file is an **OpenAPI 3.0 specification document** describing the RESTful API interface for the [@shapeshiftoss/unchained-proxy](/projects/291/69191) service, version 10.0.0. Its primary purpose is to define the structure, endpoints, request parameters, response formats, and error schemas related to address validation functionality exposed by the service.

The API specification enables automatic generation of client/server code, API documentation, and validation tools. This particular file focuses on a single endpoint `/api/v1/validate/{address}` which checks if a given blockchain address is valid.


Detailed Description

OpenAPI Metadata


Components

The [components](/projects/291/69205) section defines reusable schemas for responses and errors used throughout the API:

Schemas

Schema Name

Description

Properties

Required

Notes

**ValidationResult**

Response indicating validity of an address

`valid` (boolean)

`valid`

No additional properties allowed

**BadRequestError**

Details about a 400 Bad Request error

`error` (string)

`error`

No additional properties allowed

**ValidationError**

Details about a 422 Validation Error

`message` (string, enum: "Validation failed"), `details` (object with arbitrary properties)

`message`, `details`

No additional properties allowed

**InternalServerError**

Details about a 500 Internal Server Error

`message` (string)

`message`

No additional properties allowed


Paths

GET /api/v1/validate/{address}

Responses:

HTTP Code

Description

Schema Reference

Notes

200

Transaction payload

`ValidationResult`

Returns whether the address is valid (`valid: true

400

Bad Request

`BadRequestError`

Client sent malformed or invalid request

422

Validation Error

`ValidationError`

Address validation failed with details

500

Internal Server Error

`InternalServerError`

Unexpected server error occurred

Example Response (200 OK):
{
  "valid": true
}

Usage Example

To validate an address `0x1234...abcd`, a client would perform:

GET /api/v1/validate/0x1234...abcd
Accept: application/json

Possible JSON response on success:

{
  "valid": true
}

If the address is malformed:

{
  "error": "Invalid address format"
}

Important Implementation Details


Interaction with Other System Components


Visual Diagram

Below is a **flowchart** representing the main endpoint and related response schemas defined in this OpenAPI file.

flowchart TD
    A[GET /api/v1/validate/{address}] --> B{Validate Address}
    B -->|Valid| C[200 OK: ValidationResult { valid: true }]
    B -->|Invalid Input| D[400 Bad Request: BadRequestError { error }]
    B -->|Validation Failed| E[422 Validation Error: ValidationError { message, details }]
    B -->|Server Error| F[500 Internal Server Error: InternalServerError { message }]

Summary

The [swagger.json](/projects/291/68851) file is a concise but fully specified OpenAPI 3.0 document for the address validation endpoint of the [@shapeshiftoss/unchained-proxy](/projects/291/69191) service. It defines the API interface, response contracts, and error handling, facilitating seamless integration and reliable usage by clients and other system components.