From 0c2f95495b883c81fb56d844aaf7692a7bfb871a Mon Sep 17 00:00:00 2001 From: Mikhail Wall Date: Wed, 10 Jul 2024 15:15:46 +0200 Subject: [PATCH] fix: fixed api after new pr --- api-reference/bidder/cancelandwithdrawad.mdx | 4 - api-reference/bidder/withdrawfromwindows.mdx | 4 + api-reference/bidder/withdrawspecwindows.mdx | 4 - bidder-openapi-spec.json | 139 ++++++++++--------- get-started/bidders/bidder-node-commands.mdx | 14 +- mint.json | 5 +- 6 files changed, 84 insertions(+), 86 deletions(-) delete mode 100644 api-reference/bidder/cancelandwithdrawad.mdx create mode 100644 api-reference/bidder/withdrawfromwindows.mdx delete mode 100644 api-reference/bidder/withdrawspecwindows.mdx diff --git a/api-reference/bidder/cancelandwithdrawad.mdx b/api-reference/bidder/cancelandwithdrawad.mdx deleted file mode 100644 index 3810d54e..00000000 --- a/api-reference/bidder/cancelandwithdrawad.mdx +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Cancel and Withdraw Auto Deposit -openapi: post /v1/bidder/cancel_and_withdraw_auto_deposit ---- \ No newline at end of file diff --git a/api-reference/bidder/withdrawfromwindows.mdx b/api-reference/bidder/withdrawfromwindows.mdx new file mode 100644 index 00000000..7b5cd7e1 --- /dev/null +++ b/api-reference/bidder/withdrawfromwindows.mdx @@ -0,0 +1,4 @@ +--- +title: Withdraw Deposit From Windows +openapi: post /v1/bidder/withdraw_from_windows +--- \ No newline at end of file diff --git a/api-reference/bidder/withdrawspecwindows.mdx b/api-reference/bidder/withdrawspecwindows.mdx deleted file mode 100644 index 2f269729..00000000 --- a/api-reference/bidder/withdrawspecwindows.mdx +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Withdraw Deposit From Specific Windows -openapi: post /v1/bidder/withdraw_from_specific_windows ---- \ No newline at end of file diff --git a/bidder-openapi-spec.json b/bidder-openapi-spec.json index 15c41306..75855b76 100644 --- a/bidder-openapi-spec.json +++ b/bidder-openapi-spec.json @@ -2,7 +2,7 @@ "openapi": "3.0.0", "info": { "title": "Bidder API", - "version": "1.0.0", + "version": "1.0.0-oas3", "license": { "name": "Business Source License 1.1", "url": "https://github.com/primev/mev-commit/blob/main/LICENSE" @@ -147,35 +147,6 @@ } } }, - "/v1/bidder/cancel_and_withdraw_auto_deposit": { - "post": { - "summary": "CancelAndWithdrawAutoDeposit", - "description": "CancelAndWithdrawAutoDeposit is called by the bidder node to cancel the auto deposit and withdraw the funds.", - "operationId": "Bidder_CancelAndWithdrawAutoDeposit", - "responses": { - "200": { - "description": "A successful response.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/v1CancelAutoDepositResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/googlerpcStatus" - } - } - } - } - } - } - }, "/v1/bidder/cancel_auto_deposit": { "post": { "summary": "CancelAutoDeposit", @@ -202,7 +173,17 @@ } } } - } + }, + "parameters": [ + { + "name": "withdraw", + "in": "query", + "required": false, + "schema": { + "type": "boolean" + } + } + ] } }, "/v1/bidder/deposit/{amount}": { @@ -347,18 +328,18 @@ ] } }, - "/v1/bidder/withdraw_from_specific_windows": { + "/v1/bidder/withdraw_from_windows": { "post": { - "summary": "WithdrawFromSpecificWindows", - "description": "WithdrawFromSpecificWindows is called by the bidder node to withdraw funds from specific windows.", - "operationId": "Bidder_WithdrawFromSpecificWindows", + "summary": "WithdrawFromWindows", + "description": "WithdrawFromWindows is called by the bidder node to withdraw funds from multiple windows.", + "operationId": "Bidder_WithdrawFromWindows", "responses": { "200": { "description": "A successful response.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/v1AutoDepositResponse" + "$ref": "#/components/schemas/v1WithdrawFromWindowsResponse" } } } @@ -445,6 +426,13 @@ "type": "string", "format": "int64", "description": "Timestamp at which the bid ends decaying." + }, + "revertingTxHashes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Optional array of tx hashes that are allowed to revert or be discarded." } }, "description": "Unsigned bid message from bidders to the bidder mev-commit node.", @@ -480,35 +468,27 @@ }, "v1AutoDepositResponse": { "type": "object", - "example": [ - { - "amount": "1000000000000000000", - "window_number": 1 - }, - { - "amount": "1000000000000000000", - "window_number": 2 - }, - { - "amount": "1000000000000000000", - "window_number": 3 - } - ], + "example": { + "amount_per_window": "1000000000000000000", + "start_block_number": "1" + }, "properties": { - "amountsAndWindowNumbers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/bidderapiv1AutoDeposit" - } + "startBlockNumber": { + "type": "string", + "format": "uint64" + }, + "amountPerWindow": { + "type": "string" } }, - "description": "AutoDeposit deposit from the bidder registry.", + "description": "Response on AutoDeposit request.", "title": "AutoDeposit response" }, "v1AutoDepositStatusResponse": { "type": "object", "example": { - "amounts_and_window_numbers": [ + "isWorking": true, + "window_balances": [ { "amount": "1000000000000000000", "window_number": 1 @@ -521,11 +501,10 @@ "amount": "1000000000000000000", "window_number": 3 } - ], - "isWorking": true + ] }, "properties": { - "amountsAndWindowNumbers": { + "windowBalances": { "type": "array", "items": { "$ref": "#/components/schemas/bidderapiv1AutoDeposit" @@ -535,8 +514,8 @@ "type": "boolean" } }, - "description": "AutoDeposit deposit from the bidder registry.", - "title": "AutoDeposit response" + "description": "AutoDeposit status from the bidder registry.", + "title": "AutoDeposit status response" }, "v1CancelAutoDepositResponse": { "type": "object", @@ -609,6 +588,13 @@ "type": "string", "format": "int64", "description": "Timestamp at which the commitment is published." + }, + "revertingTxHashes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Optional array of tx hashes that are allowed to revert or be discarded." } } }, @@ -630,6 +616,35 @@ "description": "Get deposit for bidder in the bidder registry.", "title": "Deposit response" }, + "v1WithdrawFromWindowsResponse": { + "type": "object", + "example": { + "withdraw_responses": [ + { + "amount": "1000000000000000000", + "window_number": 1 + }, + { + "amount": "1000000000000000000", + "window_number": 2 + }, + { + "amount": "1000000000000000000", + "window_number": 3 + } + ] + }, + "properties": { + "withdrawResponses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/v1WithdrawResponse" + } + } + }, + "description": "Withdraw deposit from the bidder registry.", + "title": "Withdraw from multiple windows response" + }, "v1WithdrawResponse": { "type": "object", "example": { diff --git a/get-started/bidders/bidder-node-commands.mdx b/get-started/bidders/bidder-node-commands.mdx index 803abd66..155a6c72 100644 --- a/get-started/bidders/bidder-node-commands.mdx +++ b/get-started/bidders/bidder-node-commands.mdx @@ -81,24 +81,12 @@ curl -X POST http://localhost:13523/v1/bidder/cancel_auto_deposit This will stop the ongoing auto deposit process. -## Cancel And Withdraw Auto Deposit - -To cancel the auto deposit process and withdraw the funds: - -```shell ❯_ terminal -curl -X POST http://localhost:13523/v1/bidder/cancel_and_withdraw_auto_deposit -``` - -This will stop the ongoing auto deposit process and withdraw the funds deposited for the current windows. - -The funds will be withdrawn when the current window is greater than the last window for which funds were deposited. - ## Withdraw Funds To withdraw funds from the several windows, you can use the following command: ```shell ❯_ terminal -curl -X POST http://localhost:13523/v1/bidder/withdraw_from_specific_windows +curl -X POST http://localhost:13523/v1/bidder/withdraw_from_windows -H "Content-Type: application/json" \ -d '{ "windows": [1, 2, 3] diff --git a/mint.json b/mint.json index 14a49fef..c49feeb8 100644 --- a/mint.json +++ b/mint.json @@ -132,11 +132,10 @@ "api-reference/bidder/getdeposit", "api-reference/bidder/deposit", "api-reference/bidder/withdraw", - "api-reference/bidder/withdrawspecwindows", + "api-reference/bidder/withdrawfromwindows", "api-reference/bidder/autodeposit", "api-reference/bidder/autodepositstatus", - "api-reference/bidder/cancelautodeposit", - "api-reference/bidder/cancelandwithdrawad" + "api-reference/bidder/cancelautodeposit" ] }, {