{
  "openapi": "3.1.0",
  "info": {
    "title": "AllSwap Public Catalog API",
    "version": "2.0.0",
    "summary": "Unauthenticated multi-chain asset catalog and routing metadata for AllSwap.",
    "description": "Public machine-readable specification for AllSwap's unauthenticated asset catalog endpoint (GET /api/v2/assets). Consumer swaps use single-use deposit addresses with an application-layer service fee capped at 0.25%, already included in quoted expected output.",
    "termsOfService": "https://allswap.io/docs/legal/terms",
    "contact": {
      "name": "AllSwap",
      "url": "https://allswap.io/docs/contact",
      "email": "service@allswap.io"
    },
    "x-logo": {
      "url": "https://allswap.io/brand/c1/icon-512.png",
      "altText": "AllSwap"
    }
  },
  "externalDocs": {
    "description": "AllSwap Developer Documentation",
    "url": "https://allswap.io/docs"
  },
  "servers": [
    {
      "url": "https://allswap.io",
      "description": "Production public origin"
    }
  ],
  "tags": [
    {
      "name": "Public Catalog",
      "description": "Read-only public asset and chain discovery requiring no API key or session cookie."
    }
  ],
  "paths": {
    "/api/v2/assets": {
      "get": {
        "tags": [
          "Public Catalog"
        ],
        "operationId": "getPublicAssetCatalog",
        "summary": "List supported multi-chain assets and catalog freshness",
        "description": "Returns the current CAIP-19/CAIP-2 asset catalog snapshot, UTC observation timestamp (observedAt), staleness indicator, routing group membership, and per-asset minimum input quantities when published.",
        "security": [],
        "responses": {
          "200": {
            "description": "Current public asset catalog snapshot.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssetsResponse"
                },
                "example": {
                  "version": "catalog-v2",
                  "observedAt": "2026-11-20T00:00:00Z",
                  "stale": false,
                  "assets": [
                    {
                      "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7",
                      "version": 1,
                      "chainId": "eip155:1",
                      "decimals": 6,
                      "symbol": "USDT",
                      "quotable": true,
                      "sourceGroups": [
                        "evm"
                      ],
                      "destinationGroups": [
                        "evm"
                      ],
                      "minAmountIn": "10000000"
                    }
                  ],
                  "nextCursor": null
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Catalog service temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Asset": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "assetId",
          "version",
          "chainId",
          "decimals",
          "symbol",
          "quotable",
          "sourceGroups",
          "destinationGroups"
        ],
        "properties": {
          "assetId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "CAIP-19 canonical asset identifier.",
            "example": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7"
          },
          "version": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2147483647,
            "description": "Catalog entry revision number."
          },
          "chainId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "CAIP-2 canonical network identifier.",
            "example": "eip155:1"
          },
          "decimals": {
            "type": "integer",
            "minimum": 0,
            "maximum": 77,
            "description": "Smallest-unit decimal precision."
          },
          "symbol": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32,
            "description": "Display ticker symbol."
          },
          "quotable": {
            "type": "boolean",
            "description": "Whether the asset is currently eligible for live route quotes."
          },
          "sourceGroups": {
            "type": "array",
            "maxItems": 8,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^[a-z]{1,8}$"
            },
            "description": "Routing groups where this asset can act as swap origin."
          },
          "destinationGroups": {
            "type": "array",
            "maxItems": 8,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^[a-z]{1,8}$"
            },
            "description": "Routing groups where this asset can act as swap destination."
          },
          "minAmountIn": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[1-9][0-9]{0,77}$",
            "description": "Optional positive minimum source amount in atomic base units."
          }
        }
      },
      "AssetsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "observedAt",
          "stale",
          "assets",
          "nextCursor"
        ],
        "properties": {
          "version": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "Catalog snapshot revision identifier."
          },
          "observedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$",
            "description": "UTC ISO-8601 timestamp when the catalog snapshot was observed."
          },
          "stale": {
            "type": "boolean",
            "description": "True when the cached catalog snapshot has exceeded its freshness window."
          },
          "assets": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/Asset"
            }
          },
          "nextCursor": {
            "type": "null",
            "description": "Pagination cursor (currently null; full snapshot is returned in a single response)."
          }
        }
      },
      "ErrorDetail": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "message",
          "retryable",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "INVALID_REQUEST",
              "MODE_NOT_ENABLED",
              "AUTH_REQUIRED",
              "SCOPE_DENIED",
              "NOT_FOUND",
              "IDEMPOTENCY_CONFLICT",
              "INTENT_ALREADY_USED",
              "POLICY_CHANGED",
              "STATE_VERSION_CHANGED",
              "QUOTE_EXPIRED",
              "NO_ROUTE",
              "REFUND_POLICY_UNAVAILABLE",
              "PRICE_CONDITION_UNSUPPORTED",
              "AMOUNT_OUT_OF_RANGE",
              "RATE_LIMITED",
              "TEMPORARILY_UNAVAILABLE",
              "RECOVERY_PENDING",
              "INTERNAL_ERROR",
              "METHOD_NOT_ALLOWED"
            ]
          },
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "retryable": {
            "type": "boolean"
          },
          "requestId": {
            "type": "string",
            "pattern": "^[0-9a-f]{32}$"
          },
          "orderId": {
            "type": "string",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorDetail"
          }
        }
      }
    }
  }
}
