Skip to content

Commit cdd8903

Browse files
authored
feat: add ListWithdrawalsForStrategies RPC (#60)
ListWithdrawalsForStrategy - input - strategy - (optional) block_height - output - staker - strategy - shares - operator - block_number
2 parents c4a201f + da0d50f commit cdd8903

File tree

14 files changed

+757
-113
lines changed

14 files changed

+757
-113
lines changed

gen/api-ts/eigenlayer/sidecar/v1/protocol/common.pb.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,12 @@ export type StakerWithdrawal = {
5050
export type QueueStakerStrategyWithdrawal = {
5151
strategy?: string
5252
withdrawals?: StakerWithdrawal[]
53+
}
54+
55+
export type Withdrawal = {
56+
staker?: string
57+
strategy?: string
58+
shares?: string
59+
operatorAddress?: string
60+
blockNumber?: string
5361
}

gen/api-ts/eigenlayer/sidecar/v1/protocol/protocol.pb.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,21 @@ export type ListOperatorStrategyQueuedWithdrawalsRequest = {
158158

159159
export type ListOperatorStrategyQueuedWithdrawalsResponse = {
160160
withdrawals?: EigenlayerSidecarV1ProtocolCommon.StakerWithdrawal[]
161-
}
161+
}
162+
163+
164+
type BaseListWithdrawalsForStrategiesRequest = {
165+
strategyAddresses?: string[]
166+
}
167+
168+
export type ListWithdrawalsForStrategiesRequest = BaseListWithdrawalsForStrategiesRequest
169+
& OneOf<{ blockHeight: string }>
170+
& OneOf<{ pagination: EigenlayerSidecarV1CommonTypes.Pagination }>
171+
172+
173+
type BaseListWithdrawalsForStrategiesResponse = {
174+
withdrawals?: EigenlayerSidecarV1ProtocolCommon.Withdrawal[]
175+
}
176+
177+
export type ListWithdrawalsForStrategiesResponse = BaseListWithdrawalsForStrategiesResponse
178+
& OneOf<{ nextPage: EigenlayerSidecarV1CommonTypes.Pagination }>

gen/api-ts/eigenlayer/sidecar/v1/protocol/rpc.pb.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,7 @@ export class Protocol {
4646
static ListOperatorStrategyQueuedWithdrawals(req: EigenlayerSidecarV1ProtocolProtocol.ListOperatorStrategyQueuedWithdrawalsRequest, initReq?: fm.InitReq): Promise<EigenlayerSidecarV1ProtocolProtocol.ListOperatorStrategyQueuedWithdrawalsResponse> {
4747
return fm.fetchReq<EigenlayerSidecarV1ProtocolProtocol.ListOperatorStrategyQueuedWithdrawalsRequest, EigenlayerSidecarV1ProtocolProtocol.ListOperatorStrategyQueuedWithdrawalsResponse>(`/protocol/v1/operators/${req["operatorAddress"]}/strategies/${req["strategyAddress"]}/queued-withdrawals?${fm.renderURLSearchParams(req, ["operatorAddress", "strategyAddress"])}`, {...initReq, method: "GET"})
4848
}
49+
static ListWithdrawalsForStrategies(req: EigenlayerSidecarV1ProtocolProtocol.ListWithdrawalsForStrategiesRequest, initReq?: fm.InitReq): Promise<EigenlayerSidecarV1ProtocolProtocol.ListWithdrawalsForStrategiesResponse> {
50+
return fm.fetchReq<EigenlayerSidecarV1ProtocolProtocol.ListWithdrawalsForStrategiesRequest, EigenlayerSidecarV1ProtocolProtocol.ListWithdrawalsForStrategiesResponse>(`/protocol/v1/strategies/${req["strategyAddresses"]}/withdrawals?${fm.renderURLSearchParams(req, ["strategyAddresses"])}`, {...initReq, method: "GET"})
51+
}
4952
}

gen/openapi/api.public.swagger.json

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,48 @@
467467
]
468468
}
469469
},
470+
"/protocol/v1/strategies/{strategyAddresses}/withdrawals": {
471+
"get": {
472+
"summary": "ListWithdrawalsForStrategies",
473+
"operationId": "Protocol_ListWithdrawalsForStrategies",
474+
"parameters": [
475+
{
476+
"name": "strategyAddresses",
477+
"in": "path",
478+
"required": true,
479+
"schema": {
480+
"type": "string"
481+
}
482+
}
483+
],
484+
"responses": {
485+
"200": {
486+
"description": "Successful response",
487+
"content": {
488+
"application/json": {
489+
"schema": {
490+
"type": "object",
491+
"properties": {
492+
"nextPage": {
493+
"$ref": "#/components/schemas/Pagination"
494+
},
495+
"withdrawals": {
496+
"$ref": "#/components/schemas/Withdrawal"
497+
}
498+
},
499+
"required": [
500+
"next_page"
501+
]
502+
}
503+
}
504+
}
505+
}
506+
},
507+
"tags": [
508+
"protocol"
509+
]
510+
}
511+
},
470512
"/protocol/v1/strategies/{strategyAddress}/queued-withdrawals": {
471513
"get": {
472514
"summary": "ListStrategyQueuedWithdrawals",
@@ -2574,6 +2616,39 @@
25742616
}
25752617
}
25762618
},
2619+
"ListWithdrawalsForStrategiesRequest": {
2620+
"type": "object",
2621+
"properties": {
2622+
"blockHeight": {
2623+
"type": "integer",
2624+
"format": "uint64"
2625+
},
2626+
"pagination": {
2627+
"$ref": "#/components/schemas/Pagination"
2628+
},
2629+
"strategyAddresses": {
2630+
"type": "string"
2631+
}
2632+
},
2633+
"required": [
2634+
"block_height",
2635+
"pagination"
2636+
]
2637+
},
2638+
"ListWithdrawalsForStrategiesResponse": {
2639+
"type": "object",
2640+
"properties": {
2641+
"nextPage": {
2642+
"$ref": "#/components/schemas/Pagination"
2643+
},
2644+
"withdrawals": {
2645+
"$ref": "#/components/schemas/Withdrawal"
2646+
}
2647+
},
2648+
"required": [
2649+
"next_page"
2650+
]
2651+
},
25772652
"LoadContractRequest": {
25782653
"type": "object",
25792654
"properties": {
@@ -3801,6 +3876,27 @@
38013876
"type": "string"
38023877
}
38033878
}
3879+
},
3880+
"Withdrawal": {
3881+
"type": "object",
3882+
"properties": {
3883+
"blockNumber": {
3884+
"type": "integer",
3885+
"format": "uint64"
3886+
},
3887+
"operatorAddress": {
3888+
"type": "string"
3889+
},
3890+
"shares": {
3891+
"type": "string"
3892+
},
3893+
"staker": {
3894+
"type": "string"
3895+
},
3896+
"strategy": {
3897+
"type": "string"
3898+
}
3899+
}
38043900
}
38053901
}
38063902
},

gen/openapi/api.swagger.json

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,48 @@
677677
]
678678
}
679679
},
680+
"/protocol/v1/strategies/{strategyAddresses}/withdrawals": {
681+
"get": {
682+
"summary": "ListWithdrawalsForStrategies",
683+
"operationId": "Protocol_ListWithdrawalsForStrategies",
684+
"parameters": [
685+
{
686+
"name": "strategyAddresses",
687+
"in": "path",
688+
"required": true,
689+
"schema": {
690+
"type": "string"
691+
}
692+
}
693+
],
694+
"responses": {
695+
"200": {
696+
"description": "Successful response",
697+
"content": {
698+
"application/json": {
699+
"schema": {
700+
"type": "object",
701+
"properties": {
702+
"nextPage": {
703+
"$ref": "#/components/schemas/Pagination"
704+
},
705+
"withdrawals": {
706+
"$ref": "#/components/schemas/Withdrawal"
707+
}
708+
},
709+
"required": [
710+
"next_page"
711+
]
712+
}
713+
}
714+
}
715+
}
716+
},
717+
"tags": [
718+
"protocol"
719+
]
720+
}
721+
},
680722
"/protocol/v1/strategies/{strategyAddress}/queued-withdrawals": {
681723
"get": {
682724
"summary": "ListStrategyQueuedWithdrawals",
@@ -3629,6 +3671,39 @@
36293671
}
36303672
}
36313673
},
3674+
"ListWithdrawalsForStrategiesRequest": {
3675+
"type": "object",
3676+
"properties": {
3677+
"blockHeight": {
3678+
"type": "integer",
3679+
"format": "uint64"
3680+
},
3681+
"pagination": {
3682+
"$ref": "#/components/schemas/Pagination"
3683+
},
3684+
"strategyAddresses": {
3685+
"type": "string"
3686+
}
3687+
},
3688+
"required": [
3689+
"block_height",
3690+
"pagination"
3691+
]
3692+
},
3693+
"ListWithdrawalsForStrategiesResponse": {
3694+
"type": "object",
3695+
"properties": {
3696+
"nextPage": {
3697+
"$ref": "#/components/schemas/Pagination"
3698+
},
3699+
"withdrawals": {
3700+
"$ref": "#/components/schemas/Withdrawal"
3701+
}
3702+
},
3703+
"required": [
3704+
"next_page"
3705+
]
3706+
},
36323707
"LoadContractRequest": {
36333708
"type": "object",
36343709
"properties": {
@@ -4856,6 +4931,27 @@
48564931
"type": "string"
48574932
}
48584933
}
4934+
},
4935+
"Withdrawal": {
4936+
"type": "object",
4937+
"properties": {
4938+
"blockNumber": {
4939+
"type": "integer",
4940+
"format": "uint64"
4941+
},
4942+
"operatorAddress": {
4943+
"type": "string"
4944+
},
4945+
"shares": {
4946+
"type": "string"
4947+
},
4948+
"staker": {
4949+
"type": "string"
4950+
},
4951+
"strategy": {
4952+
"type": "string"
4953+
}
4954+
}
48594955
}
48604956
}
48614957
}

0 commit comments

Comments
 (0)