Skip to content

Commit c6a07e0

Browse files
authored
Delayed refunds (#632)
* delayed refunds * tweak
1 parent 8450ab1 commit c6a07e0

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed

docs/flashbots-auction/advanced/rpc-endpoint.mdx

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -980,6 +980,90 @@ If the first address matches the authentication signature, then a response with
980980

981981
If the signature is invalid or does not match the first address, an appropriate error will be returned instead.
982982

983+
### buildernet_getDelayedRefunds
984+
985+
The `buildernet_getDelayedRefunds` JSON-RPC method returns detailed information about delayed refunds.
986+
987+
```json
988+
{
989+
"jsonrpc": "2.0",
990+
"id": 1,
991+
"method": "buildernet_getDelayedRefunds",
992+
"params": [
993+
{
994+
recipient, // String, the address that receives delayed refunds
995+
blockRangeFrom, // [optional] String, hex-encoded block number for the start of the range (inclusive)
996+
blockRangeTo, // [optional] String, hex-encoded block number for the end of the range (inclusive)
997+
cursor, // [optional] String, the cursor to continue from
998+
hash, // [optional] String, bundle hash; if provided, you must also set both blockRangeFrom and blockRangeTo
999+
}
1000+
]
1001+
}
1002+
```
1003+
1004+
Responses are paginated and contain the following fields:
1005+
1006+
```json
1007+
{
1008+
"refunds": [
1009+
{
1010+
"hash": "0x...",
1011+
"amount": "0x...",
1012+
"blockNumber": "0x13ddaa4",
1013+
"status": "pending",
1014+
"recipient": "0x..."
1015+
},
1016+
...
1017+
],
1018+
"nextCursor": "0x..."
1019+
"indexedUpTo": "0x..."
1020+
}
1021+
```
1022+
1023+
The `"refunds"` field contains an array of per-order fee refunds, each with the following fields:
1024+
1025+
- `hash`: the bundle hash that generated delayed refund
1026+
- `amount`: the amount of the delayed refund, in wei
1027+
- `blockNumber`: the block number the order was contained in
1028+
- `status`: the status of the delayed refund, either "pending" or "received"
1029+
- `recipient`: the address the delayed refund is credited to
1030+
1031+
The `"cursor"` field is only included if there are more delayed refunds to fetch, some data might be avaiable in the future. To continue fetching, include the cursor as the second argument in the next request. If response is empty but contains cursor retry later.
1032+
1033+
`"indexedUpTo"` contains maximum block number for which delayed refunds are indexed
1034+
1035+
### buildernet_getDelayedRefundTotalsByRecipient
1036+
1037+
The `buildernet_getDelayedRefundTotalsByRecipient` JSON-RPC method returns the total amount of delayed refunds that have been earned by a specific address.
1038+
1039+
```json
1040+
{
1041+
"jsonrpc": "2.0",
1042+
"id": 1,
1043+
"method": "buildernet_getDelayedRefundTotalsByRecipient",
1044+
"params": [{
1045+
recipient, // String, the address to query for delayed refunds
1046+
blockRangeFrom, // [optional] String, hex-encoded block number for the start of the range (inclusive)
1047+
blockRangeTo, // [optional] String, hex-encoded block number for the end of the range (inclusive)
1048+
}]
1049+
}
1050+
```
1051+
1052+
The response contains three fields:
1053+
1054+
```json
1055+
{
1056+
"pending":"0x17812ea4fbbe314",
1057+
"received":"0x108d1b27b63a213",
1058+
"indexedUpTo":"0x13ddb08"
1059+
}
1060+
```
1061+
1062+
- `pending`: the total amount of fee refunds that have been earned but not yet received by the recipient
1063+
- `received`: the total amount of fee refunds that have been received by the recipient
1064+
- `indexedUpTo`: the highest block number for which delayed refunds have been processed
1065+
1066+
9831067
### flashbots_getMevRefundTotalByRecipient
9841068

9851069
Returns the total amount of [MEV refunds](/flashbots-protect/mev-refunds) that have been paid to a specific recipient address. This API not require authentication.

0 commit comments

Comments
 (0)