Skip to content

Commit 2a3d1f1

Browse files
authored
feat: add ListOperatorsDelegatedStakesForStrategy endpoint (#64)
2 parents 4513638 + f7b0f07 commit 2a3d1f1

File tree

14 files changed

+1202
-603
lines changed

14 files changed

+1202
-603
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,9 @@ export type Withdrawal = {
5858
shares?: string
5959
operatorAddress?: string
6060
blockNumber?: string
61+
}
62+
63+
export type OperatorDelegatedStake = {
64+
operatorAddress?: string
65+
shares?: string
6166
}

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,23 @@ export type GetOperatorDelegatedStakeForStrategyResponse = {
5555
}
5656

5757

58+
type BaseListOperatorsDelegatedStakesForStrategyRequest = {
59+
strategyAddress?: string
60+
}
61+
62+
export type ListOperatorsDelegatedStakesForStrategyRequest = BaseListOperatorsDelegatedStakesForStrategyRequest
63+
& OneOf<{ blockHeight: string }>
64+
& OneOf<{ pagination: EigenlayerSidecarV1CommonTypes.Pagination }>
65+
66+
67+
type BaseListOperatorsDelegatedStakesForStrategyResponse = {
68+
operators?: EigenlayerSidecarV1ProtocolCommon.OperatorDelegatedStake[]
69+
}
70+
71+
export type ListOperatorsDelegatedStakesForStrategyResponse = BaseListOperatorsDelegatedStakesForStrategyResponse
72+
& OneOf<{ nextPage: EigenlayerSidecarV1CommonTypes.Pagination }>
73+
74+
5875
type BaseGetDelegatedStakersForOperatorRequest = {
5976
operatorAddress?: string
6077
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ export class Protocol {
1616
static GetOperatorDelegatedStakeForStrategy(req: EigenlayerSidecarV1ProtocolProtocol.GetOperatorDelegatedStakeForStrategyRequest, initReq?: fm.InitReq): Promise<EigenlayerSidecarV1ProtocolProtocol.GetOperatorDelegatedStakeForStrategyResponse> {
1717
return fm.fetchReq<EigenlayerSidecarV1ProtocolProtocol.GetOperatorDelegatedStakeForStrategyRequest, EigenlayerSidecarV1ProtocolProtocol.GetOperatorDelegatedStakeForStrategyResponse>(`/protocol/v1/operators/${req["operatorAddress"]}/strategies/${req["strategyAddress"]}/delegated-stake?${fm.renderURLSearchParams(req, ["operatorAddress", "strategyAddress"])}`, {...initReq, method: "GET"})
1818
}
19+
static ListOperatorsDelegatedStakesForStrategy(req: EigenlayerSidecarV1ProtocolProtocol.ListOperatorsDelegatedStakesForStrategyRequest, initReq?: fm.InitReq): Promise<EigenlayerSidecarV1ProtocolProtocol.ListOperatorsDelegatedStakesForStrategyResponse> {
20+
return fm.fetchReq<EigenlayerSidecarV1ProtocolProtocol.ListOperatorsDelegatedStakesForStrategyRequest, EigenlayerSidecarV1ProtocolProtocol.ListOperatorsDelegatedStakesForStrategyResponse>(`/protocol/v1/strategies/${req["strategyAddress"]}/delegated-stakes?${fm.renderURLSearchParams(req, ["strategyAddress"])}`, {...initReq, method: "GET"})
21+
}
1922
static GetDelegatedStakersForOperator(req: EigenlayerSidecarV1ProtocolProtocol.GetDelegatedStakersForOperatorRequest, initReq?: fm.InitReq): Promise<EigenlayerSidecarV1ProtocolProtocol.GetDelegatedStakersForOperatorResponse> {
2023
return fm.fetchReq<EigenlayerSidecarV1ProtocolProtocol.GetDelegatedStakersForOperatorRequest, EigenlayerSidecarV1ProtocolProtocol.GetDelegatedStakersForOperatorResponse>(`/protocol/v1/operators/${req["operatorAddress"]}/delegated-stakers?${fm.renderURLSearchParams(req, ["operatorAddress"])}`, {...initReq, method: "GET"})
2124
}

gen/openapi/api.public.swagger.json

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,49 @@
641641
]
642642
}
643643
},
644+
"/protocol/v1/strategies/{strategy_address}/delegated-stakes": {
645+
"get": {
646+
"summary": "ListOperatorsDelegatedStakesForStrategy",
647+
"description": "ListOperatorsDelegatedStakesForStrategy returns delegated stakes for ALL operators in a strategy",
648+
"operationId": "Protocol_ListOperatorsDelegatedStakesForStrategy",
649+
"parameters": [
650+
{
651+
"name": "strategy_address",
652+
"in": "path",
653+
"required": true,
654+
"schema": {
655+
"type": "string"
656+
}
657+
}
658+
],
659+
"responses": {
660+
"200": {
661+
"description": "Successful response",
662+
"content": {
663+
"application/json": {
664+
"schema": {
665+
"type": "object",
666+
"properties": {
667+
"nextPage": {
668+
"$ref": "#/components/schemas/Pagination"
669+
},
670+
"operators": {
671+
"$ref": "#/components/schemas/OperatorDelegatedStake"
672+
}
673+
},
674+
"required": [
675+
"next_page"
676+
]
677+
}
678+
}
679+
}
680+
}
681+
},
682+
"tags": [
683+
"protocol"
684+
]
685+
}
686+
},
644687
"/rewards/v1/avs-rewards-by-root/{root_index}": {
645688
"get": {
646689
"summary": "GetRewardsByAvsForDistributionRoot",
@@ -2626,6 +2669,39 @@
26262669
}
26272670
}
26282671
},
2672+
"ListOperatorsDelegatedStakesForStrategyRequest": {
2673+
"type": "object",
2674+
"properties": {
2675+
"blockHeight": {
2676+
"type": "integer",
2677+
"format": "uint64"
2678+
},
2679+
"pagination": {
2680+
"$ref": "#/components/schemas/Pagination"
2681+
},
2682+
"strategyAddress": {
2683+
"type": "string"
2684+
}
2685+
},
2686+
"required": [
2687+
"block_height",
2688+
"pagination"
2689+
]
2690+
},
2691+
"ListOperatorsDelegatedStakesForStrategyResponse": {
2692+
"type": "object",
2693+
"properties": {
2694+
"nextPage": {
2695+
"$ref": "#/components/schemas/Pagination"
2696+
},
2697+
"operators": {
2698+
"$ref": "#/components/schemas/OperatorDelegatedStake"
2699+
}
2700+
},
2701+
"required": [
2702+
"next_page"
2703+
]
2704+
},
26292705
"ListOperatorsForAvsRequest": {
26302706
"type": "object",
26312707
"properties": {
@@ -3018,6 +3094,17 @@
30183094
"transaction_metadata"
30193095
]
30203096
},
3097+
"OperatorDelegatedStake": {
3098+
"type": "object",
3099+
"properties": {
3100+
"operatorAddress": {
3101+
"type": "string"
3102+
},
3103+
"shares": {
3104+
"type": "string"
3105+
}
3106+
}
3107+
},
30213108
"OperatorDirectedOperatorSetRewardSubmission": {
30223109
"type": "object",
30233110
"properties": {

gen/openapi/api.swagger.json

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,49 @@
758758
]
759759
}
760760
},
761+
"/protocol/v1/strategies/{strategy_address}/delegated-stakes": {
762+
"get": {
763+
"summary": "ListOperatorsDelegatedStakesForStrategy",
764+
"description": "ListOperatorsDelegatedStakesForStrategy returns delegated stakes for ALL operators in a strategy",
765+
"operationId": "Protocol_ListOperatorsDelegatedStakesForStrategy",
766+
"parameters": [
767+
{
768+
"name": "strategy_address",
769+
"in": "path",
770+
"required": true,
771+
"schema": {
772+
"type": "string"
773+
}
774+
}
775+
],
776+
"responses": {
777+
"200": {
778+
"description": "Successful response",
779+
"content": {
780+
"application/json": {
781+
"schema": {
782+
"type": "object",
783+
"properties": {
784+
"nextPage": {
785+
"$ref": "#/components/schemas/Pagination"
786+
},
787+
"operators": {
788+
"$ref": "#/components/schemas/OperatorDelegatedStake"
789+
}
790+
},
791+
"required": [
792+
"next_page"
793+
]
794+
}
795+
}
796+
}
797+
}
798+
},
799+
"tags": [
800+
"protocol"
801+
]
802+
}
803+
},
761804
"/rewards/v1/attributable-rewards-by-root/{distribution_root}": {
762805
"get": {
763806
"summary": "GetAttributableRewardsForDistributionRoot",
@@ -3588,6 +3631,39 @@
35883631
}
35893632
}
35903633
},
3634+
"ListOperatorsDelegatedStakesForStrategyRequest": {
3635+
"type": "object",
3636+
"properties": {
3637+
"blockHeight": {
3638+
"type": "integer",
3639+
"format": "uint64"
3640+
},
3641+
"pagination": {
3642+
"$ref": "#/components/schemas/Pagination"
3643+
},
3644+
"strategyAddress": {
3645+
"type": "string"
3646+
}
3647+
},
3648+
"required": [
3649+
"block_height",
3650+
"pagination"
3651+
]
3652+
},
3653+
"ListOperatorsDelegatedStakesForStrategyResponse": {
3654+
"type": "object",
3655+
"properties": {
3656+
"nextPage": {
3657+
"$ref": "#/components/schemas/Pagination"
3658+
},
3659+
"operators": {
3660+
"$ref": "#/components/schemas/OperatorDelegatedStake"
3661+
}
3662+
},
3663+
"required": [
3664+
"next_page"
3665+
]
3666+
},
35913667
"ListOperatorsForAvsRequest": {
35923668
"type": "object",
35933669
"properties": {
@@ -3980,6 +4056,17 @@
39804056
"transaction_metadata"
39814057
]
39824058
},
4059+
"OperatorDelegatedStake": {
4060+
"type": "object",
4061+
"properties": {
4062+
"operatorAddress": {
4063+
"type": "string"
4064+
},
4065+
"shares": {
4066+
"type": "string"
4067+
}
4068+
}
4069+
},
39834070
"OperatorDirectedOperatorSetRewardSubmission": {
39844071
"type": "object",
39854072
"properties": {

gen/protos/eigenlayer/sidecar/v1/protocol/common.pb.go

Lines changed: 80 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)