{
  "openapi": "3.0.0",
  "paths": {
    "/api/v1/balance": {
      "get": {
        "operationId": "BalanceController_getBalances",
        "parameters": [
          {
            "name": "flat",
            "required": true,
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "Balance"
        ]
      }
    },
    "/api/v1/quote": {
      "post": {
        "operationId": "QuoteController_getQuote",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteIntentDataDTO"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "Quote"
        ]
      }
    },
    "/api/v1/quote/reverse": {
      "post": {
        "operationId": "QuoteController_getReverseQuote",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteIntentDataDTO"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "Quote"
        ]
      }
    },
    "/api/v2/quote": {
      "post": {
        "operationId": "QuoteV2Controller_getQuote",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteV2RequestDTO"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "QuoteV2"
        ]
      }
    },
    "/api/v2/quote/reverse": {
      "post": {
        "operationId": "QuoteV2Controller_getReverseQuote",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteV2RequestDTO"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "QuoteV2"
        ]
      }
    },
    "/api/v1/intentInitiation/initiateGaslessIntent": {
      "post": {
        "operationId": "IntentInitiationController_initiateGaslessIntent",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GaslessIntentRequestDTO"
              }
            }
          }
        },
        "responses": {
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GaslessIntentExecutionResponseDTO"
                }
              }
            }
          }
        },
        "summary": "Initiate Gasless Intent",
        "tags": [
          "IntentInitiation"
        ]
      }
    },
    "/api/v1/intentInitiation/getGaslessIntentTransactionData": {
      "post": {
        "operationId": "IntentInitiationController_getDestinationChainTransactionHash",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GaslessIntentTransactionDataRequestDTO"
              }
            }
          }
        },
        "responses": {
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GaslessIntentTransactionDataDTO"
                }
              }
            }
          }
        },
        "summary": "Get Gasless Intent Transaction Data",
        "tags": [
          "IntentInitiation"
        ]
      }
    },
    "/api/v2/intentInitiation/initiateGaslessIntent": {
      "post": {
        "operationId": "IntentInitiationV2Controller_initiateGaslessIntent",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GaslessIntentRequestV2DTO"
              }
            }
          }
        },
        "responses": {
          "default": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GaslessIntentExecutionResponseDTO"
                }
              }
            }
          }
        },
        "summary": "Initiate Gasless Intent",
        "tags": [
          "IntentInitiationV2"
        ]
      }
    },
    "/api/v1/blockchain/chains": {
      "get": {
        "operationId": "BlockchainController_getSupportedChainsAndTokens",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "Blockchain"
        ]
      }
    },
    "/api/v1/configuration": {
      "get": {
        "description": "Retrieve all configurations with optional filtering and pagination",
        "operationId": "DynamicConfigController_getAllConfigurations",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Configurations retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedConfigurationResponseDTO"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get all configurations",
        "tags": [
          "Configuration"
        ]
      },
      "post": {
        "description": "Create a new configuration entry (Admin only)",
        "operationId": "DynamicConfigController_createConfiguration",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateConfigurationDTO"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Configuration created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigurationResponseDTO"
                }
              }
            }
          },
          "400": {
            "description": "Invalid configuration data"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "403": {
            "description": "Forbidden - Admin privileges required"
          },
          "409": {
            "description": "Configuration already exists"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Create new configuration",
        "tags": [
          "Configuration"
        ]
      }
    },
    "/api/v1/configuration/{key}": {
      "get": {
        "description": "Retrieve a specific configuration by its key",
        "operationId": "DynamicConfigController_getConfiguration",
        "parameters": [
          {
            "name": "key",
            "required": true,
            "in": "path",
            "description": "Configuration key",
            "schema": {
              "example": "database.maxPoolSize",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Configuration retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigurationResponseDTO"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Configuration not found"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get configuration by key",
        "tags": [
          "Configuration"
        ]
      },
      "put": {
        "description": "Update an existing configuration by key (Admin only)",
        "operationId": "DynamicConfigController_updateConfiguration",
        "parameters": [
          {
            "name": "key",
            "required": true,
            "in": "path",
            "description": "Configuration key",
            "schema": {
              "example": "database.maxPoolSize",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateConfigurationDTO"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Configuration updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigurationResponseDTO"
                }
              }
            }
          },
          "400": {
            "description": "Invalid configuration data"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "403": {
            "description": "Forbidden - Admin privileges required"
          },
          "404": {
            "description": "Configuration not found"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Update configuration",
        "tags": [
          "Configuration"
        ]
      },
      "delete": {
        "description": "Delete a configuration by key (Admin only)",
        "operationId": "DynamicConfigController_deleteConfiguration",
        "parameters": [
          {
            "name": "key",
            "required": true,
            "in": "path",
            "description": "Configuration key",
            "schema": {
              "example": "database.maxPoolSize",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Configuration deleted successfully"
          },
          "400": {
            "description": "Cannot delete required configuration"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "403": {
            "description": "Forbidden - Admin privileges required"
          },
          "404": {
            "description": "Configuration not found"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Delete configuration",
        "tags": [
          "Configuration"
        ]
      }
    },
    "/api/v1/configuration/{key}/audit": {
      "get": {
        "description": "Retrieve audit history for a specific configuration key",
        "operationId": "DynamicConfigController_getConfigurationAuditHistory",
        "parameters": [
          {
            "name": "key",
            "required": true,
            "in": "path",
            "description": "Configuration key",
            "schema": {
              "example": "database.maxPoolSize",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Audit history retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedAuditResponseDTO"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "404": {
            "description": "Configuration not found"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get configuration audit history",
        "tags": [
          "Configuration"
        ]
      }
    },
    "/api/v1/health": {
      "get": {
        "operationId": "HealthController_check",
        "parameters": [],
        "responses": {
          "200": {
            "description": "The Health Check is successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "ok"
                    },
                    "info": {
                      "type": "object",
                      "example": {
                        "database": {
                          "status": "up"
                        }
                      },
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "status"
                        ],
                        "properties": {
                          "status": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true
                      },
                      "nullable": true
                    },
                    "error": {
                      "type": "object",
                      "example": {},
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "status"
                        ],
                        "properties": {
                          "status": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true
                      },
                      "nullable": true
                    },
                    "details": {
                      "type": "object",
                      "example": {
                        "database": {
                          "status": "up"
                        }
                      },
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "status"
                        ],
                        "properties": {
                          "status": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "The Health Check is not successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "error"
                    },
                    "info": {
                      "type": "object",
                      "example": {
                        "database": {
                          "status": "up"
                        }
                      },
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "status"
                        ],
                        "properties": {
                          "status": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true
                      },
                      "nullable": true
                    },
                    "error": {
                      "type": "object",
                      "example": {
                        "redis": {
                          "status": "down",
                          "message": "Could not connect"
                        }
                      },
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "status"
                        ],
                        "properties": {
                          "status": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true
                      },
                      "nullable": true
                    },
                    "details": {
                      "type": "object",
                      "example": {
                        "database": {
                          "status": "up"
                        },
                        "redis": {
                          "status": "down",
                          "message": "Could not connect"
                        }
                      },
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "status"
                        ],
                        "properties": {
                          "status": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Health"
        ]
      }
    }
  },
  "info": {
    "title": "Solver API",
    "description": "The api for the solver queries",
    "version": "0.1",
    "contact": {}
  },
  "tags": [
    {
      "name": "solver",
      "description": ""
    }
  ],
  "servers": [],
  "components": {
    "schemas": {
      "QuoteRouteDataDTO": {
        "type": "object",
        "properties": {
          "source": {
            "format": "int64",
            "type": "integer"
          },
          "destination": {
            "format": "int64",
            "type": "integer"
          },
          "inbox": {
            "type": "string"
          },
          "tokens": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "calls": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "source",
          "destination",
          "inbox",
          "tokens",
          "calls"
        ]
      },
      "QuoteRewardDataDTO": {
        "type": "object",
        "properties": {
          "creator": {
            "type": "string"
          },
          "prover": {
            "type": "string"
          },
          "deadline": {
            "format": "int64",
            "type": "integer"
          },
          "nativeValue": {
            "format": "int64",
            "type": "integer"
          },
          "tokens": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "creator",
          "prover",
          "deadline",
          "nativeValue",
          "tokens"
        ]
      },
      "AllowanceOrTransferDTO": {
        "type": "object",
        "properties": {
          "chainID": {
            "type": "number",
            "description": "The chain ID where the allowance or transfer occurs",
            "example": 1
          },
          "modeOrExpiration": {
            "type": "number",
            "description": "Mode for transfer (0) or expiration timestamp for allowance update",
            "example": 0
          },
          "tokenKey": {
            "type": "string",
            "description": "Encoded tokenKey (ERC20: padded address, NFT: hash of token + tokenId)",
            "example": "0x000000000000000000000000a0b86a33e6441b8ec2c8c7e5b0d77d5fdda0c4e4"
          },
          "account": {
            "type": "string",
            "description": "Account address receiving the allowance or transfer",
            "example": "0x742d35cc6634c0532925a3b8b0eff6a2db3b51a"
          },
          "amountDelta": {
            "format": "int64",
            "type": "integer",
            "description": "Amount delta for the allowance or transfer (in wei)",
            "example": "1000000000000000000"
          }
        },
        "required": [
          "chainID",
          "modeOrExpiration",
          "tokenKey",
          "account",
          "amountDelta"
        ]
      },
      "Permit3DTO": {
        "type": "object",
        "properties": {
          "chainId": {
            "type": "number",
            "description": "The original chain ID where the request is being signed or executed",
            "example": 1
          },
          "permitContract": {
            "type": "string",
            "description": "Address of the Permit3 contract",
            "example": "0x1234567890123456789012345678901234567890"
          },
          "owner": {
            "type": "string",
            "description": "Owner address of the tokens being permitted",
            "example": "0x0987654321098765432109876543210987654321"
          },
          "salt": {
            "type": "string",
            "description": "Unique salt value used for EIP-712 signature and nonce tracking",
            "example": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
          },
          "signature": {
            "type": "string",
            "description": "EIP-712 cryptographic signature from the token owner",
            "example": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1b"
          },
          "deadline": {
            "format": "int64",
            "type": "integer",
            "description": "Expiration timestamp for the permit signature (uint48)",
            "example": 1699999999
          },
          "timestamp": {
            "type": "number",
            "description": "Unix timestamp when the permit was created (uint48)",
            "example": 1699988888
          },
          "merkleRoot": {
            "type": "string",
            "description": "Merkle root hash representing all chain permit leaves",
            "example": "0xabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcd"
          },
          "leaves": {
            "description": "Optional array of Merkle tree leaves (hashed ChainPermits), useful for client-side debugging or proof regeneration",
            "example": [
              "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
              "0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "allowanceOrTransfers": {
            "description": "Flattened list of all permits across chains used to construct ChainPermits and Merkle tree leaves",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AllowanceOrTransferDTO"
            }
          }
        },
        "required": [
          "chainId",
          "permitContract",
          "owner",
          "salt",
          "signature",
          "deadline",
          "timestamp",
          "merkleRoot",
          "leaves",
          "allowanceOrTransfers"
        ]
      },
      "PermitDataDTO": {
        "type": "object",
        "properties": {
          "permit": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "permit2": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "permit3": {
            "$ref": "#/components/schemas/Permit3DTO"
          }
        }
      },
      "GaslessIntentDataDTO": {
        "type": "object",
        "properties": {
          "permitData": {
            "$ref": "#/components/schemas/PermitDataDTO"
          },
          "allowPartial": {
            "type": "boolean"
          }
        }
      },
      "QuoteIntentDataDTO": {
        "type": "object",
        "properties": {
          "quoteID": {
            "type": "string"
          },
          "dAppID": {
            "type": "string"
          },
          "intentExecutionTypes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "SELF_PUBLISH",
                "GASLESS"
              ]
            }
          },
          "route": {
            "$ref": "#/components/schemas/QuoteRouteDataDTO"
          },
          "reward": {
            "$ref": "#/components/schemas/QuoteRewardDataDTO"
          },
          "gaslessIntentData": {
            "$ref": "#/components/schemas/GaslessIntentDataDTO"
          }
        },
        "required": [
          "quoteID",
          "dAppID",
          "intentExecutionTypes",
          "route",
          "reward"
        ]
      },
      "QuoteV2QuoteRequestDTO": {
        "type": "object",
        "properties": {
          "sourceChainID": {
            "type": "number"
          },
          "destinationChainID": {
            "type": "number"
          },
          "sourceToken": {
            "type": "string"
          },
          "destinationToken": {
            "type": "string"
          },
          "sourceAmount": {
            "type": "string"
          },
          "funder": {
            "type": "string"
          },
          "refundRecipient": {
            "type": "string"
          },
          "recipient": {
            "type": "string"
          }
        },
        "required": [
          "sourceChainID",
          "destinationChainID",
          "sourceToken",
          "destinationToken",
          "sourceAmount",
          "funder",
          "recipient"
        ]
      },
      "QuoteV2ContractsRequestDTO": {
        "type": "object",
        "properties": {
          "sourcePortal": {
            "type": "string",
            "description": "Contract address for the intent source (where intents are created and managed)",
            "example": "0x1234567890abcdef1234567890abcdef12345678"
          },
          "destinationPortal": {
            "type": "string",
            "description": "Contract address for the inbox (receives and processes cross-chain messages)",
            "example": "0x567890abcdef1234567890abcdef1234567890ab"
          },
          "prover": {
            "type": "string",
            "description": "Contract address for the prover (handles cross-chain proof verification)",
            "example": "0xabcdef1234567890abcdef1234567890abcdef12"
          }
        }
      },
      "GaslessIntentDataV2DTO": {
        "type": "object",
        "properties": {
          "permit3": {
            "description": "Permit3 signature data for multi-chain token approvals",
            "allOf": [
              {
                "$ref": "#/components/schemas/Permit3DTO"
              }
            ]
          },
          "allowPartial": {
            "type": "boolean",
            "description": "Whether to allow partial funding of the intent",
            "example": false,
            "default": false
          }
        },
        "required": [
          "permit3"
        ]
      },
      "QuoteV2RequestDTO": {
        "type": "object",
        "properties": {
          "quoteID": {
            "type": "string",
            "description": "Unique identifier for the quote request",
            "example": "quote:966ee977-586b-4bca-abf1-e7def508a19c"
          },
          "dAppID": {
            "type": "string"
          },
          "intentExecutionTypes": {
            "type": "array",
            "description": "Array of intent execution types to fetch quotes for",
            "example": [
              "SELF_PUBLISH"
            ],
            "items": {
              "type": "string",
              "enum": [
                "SELF_PUBLISH",
                "GASLESS"
              ]
            }
          },
          "quoteRequest": {
            "$ref": "#/components/schemas/QuoteV2QuoteRequestDTO"
          },
          "contracts": {
            "$ref": "#/components/schemas/QuoteV2ContractsRequestDTO"
          },
          "gaslessIntentData": {
            "description": "Optional gasless intent data containing permit signatures for token approvals and execution configuration",
            "allOf": [
              {
                "$ref": "#/components/schemas/GaslessIntentDataV2DTO"
              }
            ]
          }
        },
        "required": [
          "quoteID",
          "dAppID",
          "intentExecutionTypes",
          "quoteRequest"
        ]
      },
      "GaslessIntentRequestDTO": {
        "type": "object",
        "properties": {
          "intentGroupID": {
            "type": "string"
          },
          "dAppID": {
            "type": "string"
          },
          "intents": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "gaslessIntentData": {
            "$ref": "#/components/schemas/GaslessIntentDataDTO"
          }
        },
        "required": [
          "intentGroupID",
          "dAppID",
          "intents",
          "gaslessIntentData"
        ]
      },
      "GaslessIntentExecutionResponseDTO": {
        "type": "object",
        "properties": {
          "successes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "failures": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "successes",
          "failures"
        ]
      },
      "GaslessIntentTransactionDataRequestDTO": {
        "type": "object",
        "properties": {
          "intentGroupID": {
            "type": "string"
          }
        },
        "required": [
          "intentGroupID"
        ]
      },
      "GaslessIntentTransactionDataDTO": {
        "type": "object",
        "properties": {
          "intentGroupID": {
            "type": "string"
          },
          "destinationChainID": {
            "type": "number"
          },
          "destinationChainTxHash": {
            "type": "string"
          }
        },
        "required": [
          "intentGroupID"
        ]
      },
      "GaslessIntentRequestV2DTO": {
        "type": "object",
        "properties": {
          "intentGroupID": {
            "type": "string"
          },
          "dAppID": {
            "type": "string"
          },
          "intents": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "gaslessIntentData": {
            "$ref": "#/components/schemas/GaslessIntentDataV2DTO"
          }
        },
        "required": [
          "intentGroupID",
          "dAppID",
          "intents",
          "gaslessIntentData"
        ]
      },
      "PaginatedConfigurationResponseDTO": {
        "type": "object",
        "properties": {}
      },
      "ConfigurationResponseDTO": {
        "type": "object",
        "properties": {}
      },
      "CreateConfigurationDTO": {
        "type": "object",
        "properties": {}
      },
      "UpdateConfigurationDTO": {
        "type": "object",
        "properties": {}
      },
      "PaginatedAuditResponseDTO": {
        "type": "object",
        "properties": {}
      }
    }
  }
}