{ "openapi": "3.0.0", "servers": [ { "description": "Uniswap Trade APIs", "url": "https://api.uniswap.org/v2/order" } ], "info": { "version": "1.0.0", "title": "Fungibles", "description": "Rest API for orders." }, "paths": { "/prod/dutch-auction/order": { "post": { "tags": ["Dutch Auction"], "summary": "Submit order", "description": "Submits a new signed order to the trading API.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PostOrderRequest" } } } }, "responses": { "201": { "description": "Order submission successful.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PostOrderResponse" } } } }, "400": { "$ref": "#/components/responses/400InvalidOrder" } } } }, "/prod/dutch-auction/orders": { "get": { "tags": ["Dutch Auction"], "summary": "Retrieve orders", "description": "Retrieve orders filtered by query param(s). Some fields on the order can be used as query param.", "parameters": [ { "$ref": "#/components/parameters/limitParam" }, { "$ref": "#/components/parameters/orderStatusParam" }, { "$ref": "#/components/parameters/orderHashParam" }, { "$ref": "#/components/parameters/orderHashesParam" }, { "$ref": "#/components/parameters/swapperParam" }, { "$ref": "#/components/parameters/sortKeyParam" }, { "$ref": "#/components/parameters/sortParam" }, { "$ref": "#/components/parameters/fillerParam" }, { "$ref": "#/components/parameters/cursorParam" } ], "responses": { "200": { "description": "Request Successful", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetOrdersResponse" } } } } } } }, "/prod/dutch-auction/nonce": { "get": { "tags": ["Dutch Auction"], "summary": "Get nonce", "description": "Get current nonce for dutch auction orders. Given an address this endpoint will return the next valid nonce to be used in order creation.", "parameters": [ { "$ref": "#/components/parameters/limitParam" } ], "responses": { "200": { "description": "Request Successful", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Nonce" } } } } } } } }, "components": { "responses": { "400InvalidOrder": { "description": "Invalid Order." } }, "parameters": { "addressParam": { "name": "address", "in": "query", "schema": { "type": "string", "pattern": "^(0x)?[0-9a-fA-F]{40}$", "example": "0x50EC05ADe8280758E2077fcBC08D878D4aef79C3" }, "required": false }, "limitParam": { "name": "limit", "in": "query", "schema": { "type": "number", "default": 1 }, "required": false }, "orderStatusParam": { "name": "orderStatus", "in": "query", "description": "Filter by order status.", "required": false, "schema": { "$ref": "#/components/schemas/OrderStatus" } }, "orderHashParam": { "name": "orderHash", "in": "query", "description": "Filter by order hash.", "required": false, "schema": { "$ref": "#/components/schemas/OrderHash" } }, "orderHashesParam": { "name": "orderHashes", "in": "query", "description": "Filter by comma separated order hashes.", "required": false, "schema": { "type": "string", "pattern": "^(?=([^,]*,){0,49}[^,]*$)0x[0-9a-zA-Z]{64}(,0x[0-9a-zA-Z]{64})*$", "example": "orderHash,orderHash,orderHash" } }, "swapperParam": { "name": "swapper", "in": "query", "description": "Filter by swapper address.", "required": false, "schema": { "type": "string", "pattern": "^(0x)?[0-9a-fA-F]{40}$", "example": "0x50EC05ADe8280758E2077fcBC08D878D4aef79C3" } }, "fillerParam": { "name": "filler", "in": "query", "description": "Filter by filler address.", "required": false, "schema": { "type": "string", "pattern": "^(0x)?[0-9a-fA-F]{40}$", "example": "0x50EC05ADe8280758E2077fcBC08D878D4aef79C3" } }, "sortKeyParam": { "name": "sortKey", "in": "query", "description": "Order the query results by the sort key.", "required": false, "schema": { "$ref": "#/components/schemas/SortKey" } }, "sortParam": { "name": "sort", "in": "query", "description": "Sort query. For example: `sort=gt(UNIX_TIMESTAMP)`, `sort=between(1675872827, 1675872930)`, or `lt(1675872930)`.", "required": false, "schema": { "type": "string" } }, "cursorParam": { "name": "cursor", "in": "query", "description": "Sort query results by sortKey in descending order.", "required": false, "schema": { "type": "boolean" } }, "descParam": { "name": "desc", "in": "query", "description": "Cursor for paginated queries.", "required": false, "schema": { "type": "string" } } }, "schemas": { "Nonce": { "type": "string" }, "OrderInput": { "type": "object", "properties": { "token": { "type": "string" }, "startAmount": { "type": "string" }, "endAmount": { "type": "string" } }, "required": ["token"] }, "OrderOutput": { "type": "object", "properties": { "token": { "type": "string" }, "startAmount": { "type": "string" }, "endAmount": { "type": "string" }, "isFeeOutput": { "type": "boolean" }, "recipient": { "type": "string" } }, "required": ["startAmount", "endAmount", "isFeeOutput", "recipient"] }, "SettledAmount": { "type": "object", "properties": { "tokenOut": { "type": "string", "pattern": "^(0x)?[0-9a-fA-F]{40}$" }, "amountOut": { "type": "string" }, "tokenIn": { "type": "string", "pattern": "^(0x)?[0-9a-fA-F]{40}$" }, "amountIn": { "type": "string" } } }, "OrderType": { "type": "string", "enum": ["Dutch"] }, "OrderEntity": { "type": "object", "properties": { "type": { "$ref": "#/components/schemas/OrderType" }, "encodedOrder": { "type": "string" }, "signature": { "type": "string" }, "nonce": { "type": "string" }, "orderHash": { "type": "string" }, "orderStatus": { "$ref": "#/components/schemas/OrderStatus" }, "chainId": { "$ref": "#/components/schemas/ChainId" }, "swapper": { "type": "string" }, "reactor": { "type": "string" }, "decayStartTime": { "type": "number" }, "decayEndTime": { "type": "number" }, "deadline": { "type": "number" }, "input": { "$ref": "#/components/schemas/OrderInput" }, "outputs": { "type": "array", "items": { "$ref": "#/components/schemas/OrderOutput" } }, "filler": { "description": "Filler field is defined when the order has been filled and the status tracking function has recorded the filler address.", "type": "string" }, "quoteId": { "description": "QuoteId field is defined when the order has a quote associated with it.", "type": "string" }, "txHash": { "description": "TxHash field is defined when the order has been filled and there is a txHash associated with the fill.", "type": "string" }, "settledAmounts": { "description": "SettledAmount field is defined when the order has been filled and the fill amounts have been recorded.", "type": "array", "items": { "$ref": "#/components/schemas/SettledAmount" } } }, "required": [ "ecodedOrder", "signature", "nonce", "orderHash", "orderStatus", "chainId", "swapper", "reactor", "decayStartTime", "decayEndTime", "deadline", "input", "outputs", "type", "encodedOrder" ] }, "GetOrdersResponse": { "type": "object", "properties": { "orders": { "type": "array", "items": { "$ref": "#/components/schemas/OrderEntity" } }, "cursor": { "type": "string" } }, "required": ["orders"] }, "SortKey": { "type": "string", "enum": ["createdAt"] }, "OrderHash": { "type": "string" }, "OrderHashes": { "type": "string" }, "OrderStatus": { "type": "string", "enum": ["open", "expired", "error", "cancelled", "filled", "insufficient-funds"] }, "ChainId": { "type": "number", "enum": [1, 137] }, "PostOrderResponse": { "type": "object", "properties": { "hash": { "type": "string" } } }, "PostOrderRequest": { "type": "object", "properties": { "encodedOrder": { "type": "string" }, "signature": { "type": "string" }, "chainId": { "$ref": "#/components/schemas/ChainId" }, "quoteId": { "type": "string" } } } } } }