Skip to content

Commit

Permalink
fix: fixed api after new pr
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikelle committed Jul 10, 2024
1 parent 9b3e416 commit 0c2f954
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 86 deletions.
4 changes: 0 additions & 4 deletions api-reference/bidder/cancelandwithdrawad.mdx

This file was deleted.

4 changes: 4 additions & 0 deletions api-reference/bidder/withdrawfromwindows.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: Withdraw Deposit From Windows
openapi: post /v1/bidder/withdraw_from_windows
---
4 changes: 0 additions & 4 deletions api-reference/bidder/withdrawspecwindows.mdx

This file was deleted.

139 changes: 77 additions & 62 deletions bidder-openapi-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand All @@ -202,7 +173,17 @@
}
}
}
}
},
"parameters": [
{
"name": "withdraw",
"in": "query",
"required": false,
"schema": {
"type": "boolean"
}
}
]
}
},
"/v1/bidder/deposit/{amount}": {
Expand Down Expand Up @@ -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"
}
}
}
Expand Down Expand Up @@ -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.",
Expand Down Expand Up @@ -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
Expand All @@ -521,11 +501,10 @@
"amount": "1000000000000000000",
"window_number": 3
}
],
"isWorking": true
]
},
"properties": {
"amountsAndWindowNumbers": {
"windowBalances": {
"type": "array",
"items": {
"$ref": "#/components/schemas/bidderapiv1AutoDeposit"
Expand All @@ -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",
Expand Down Expand Up @@ -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."
}
}
},
Expand All @@ -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": {
Expand Down
14 changes: 1 addition & 13 deletions get-started/bidders/bidder-node-commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
5 changes: 2 additions & 3 deletions mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand Down

0 comments on commit 0c2f954

Please sign in to comment.