Skip to content

Commit e6827bb

Browse files
authored
feat: add GetRewardsForDistributionRoot to get rewards data by rootIndex (#35)
2 parents 858f377 + 66f17fc commit e6827bb

File tree

12 files changed

+1085
-649
lines changed

12 files changed

+1085
-649
lines changed

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

+8
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ export type GetRewardsForSnapshotResponse = {
7373
rewards?: EigenlayerSidecarV1RewardsCommon.Reward[]
7474
}
7575

76+
export type GetRewardsForDistributionRootRequest = {
77+
rootIndex?: string
78+
}
79+
80+
export type GetRewardsForDistributionRootResponse = {
81+
rewards?: EigenlayerSidecarV1RewardsCommon.Reward[]
82+
}
83+
7684
export type GetAttributableRewardsForSnapshotRequest = {
7785
snapshot?: string
7886
}

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

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ export class Rewards {
2525
static GetRewardsForSnapshot(req: EigenlayerSidecarV1RewardsRewards.GetRewardsForSnapshotRequest, initReq?: fm.InitReq): Promise<EigenlayerSidecarV1RewardsRewards.GetRewardsForSnapshotResponse> {
2626
return fm.fetchReq<EigenlayerSidecarV1RewardsRewards.GetRewardsForSnapshotRequest, EigenlayerSidecarV1RewardsRewards.GetRewardsForSnapshotResponse>(`/rewards/v1/rewards/${req["snapshot"]}?${fm.renderURLSearchParams(req, ["snapshot"])}`, {...initReq, method: "GET"})
2727
}
28+
static GetRewardsForDistributionRoot(req: EigenlayerSidecarV1RewardsRewards.GetRewardsForDistributionRootRequest, initReq?: fm.InitReq): Promise<EigenlayerSidecarV1RewardsRewards.GetRewardsForDistributionRootResponse> {
29+
return fm.fetchReq<EigenlayerSidecarV1RewardsRewards.GetRewardsForDistributionRootRequest, EigenlayerSidecarV1RewardsRewards.GetRewardsForDistributionRootResponse>(`/rewards/v1/distribution-roots/${req["rootIndex"]}/rewards?${fm.renderURLSearchParams(req, ["rootIndex"])}`, {...initReq, method: "GET"})
30+
}
2831
static GetAttributableRewardsForSnapshot(req: EigenlayerSidecarV1RewardsRewards.GetAttributableRewardsForSnapshotRequest, initReq?: fm.InitReq): Promise<EigenlayerSidecarV1RewardsRewards.GetAttributableRewardsForSnapshotResponse> {
2932
return fm.fetchReq<EigenlayerSidecarV1RewardsRewards.GetAttributableRewardsForSnapshotRequest, EigenlayerSidecarV1RewardsRewards.GetAttributableRewardsForSnapshotResponse>(`/rewards/v1/attributable-rewards/${req["snapshot"]}?${fm.renderURLSearchParams(req, ["snapshot"])}`, {...initReq, method: "GET"})
3033
}

gen/openapi/api.public.swagger.json

+17
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,23 @@
832832
}
833833
}
834834
},
835+
"GetRewardsForDistributionRootRequest": {
836+
"type": "object",
837+
"properties": {
838+
"rootIndex": {
839+
"type": "integer",
840+
"format": "uint64"
841+
}
842+
}
843+
},
844+
"GetRewardsForDistributionRootResponse": {
845+
"type": "object",
846+
"properties": {
847+
"rewards": {
848+
"$ref": "#/components/schemas/Reward"
849+
}
850+
}
851+
},
835852
"GetRewardsForSnapshotRequest": {
836853
"type": "object",
837854
"properties": {

gen/openapi/api.swagger.json

+53
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,42 @@
10211021
]
10221022
}
10231023
},
1024+
"/rewards/v1/distribution-roots/{root_index}/rewards": {
1025+
"get": {
1026+
"summary": "GetRewardsForDistributionRoot",
1027+
"operationId": "Rewards_GetRewardsForDistributionRoot",
1028+
"parameters": [
1029+
{
1030+
"name": "root_index",
1031+
"in": "path",
1032+
"required": true,
1033+
"schema": {
1034+
"type": "string"
1035+
}
1036+
}
1037+
],
1038+
"responses": {
1039+
"200": {
1040+
"description": "Successful response",
1041+
"content": {
1042+
"application/json": {
1043+
"schema": {
1044+
"type": "object",
1045+
"properties": {
1046+
"rewards": {
1047+
"$ref": "#/components/schemas/Reward"
1048+
}
1049+
}
1050+
}
1051+
}
1052+
}
1053+
}
1054+
},
1055+
"tags": [
1056+
"rewards"
1057+
]
1058+
}
1059+
},
10241060
"/rewards/v1/earners/{earnerAddress}/historical-rewards": {
10251061
"get": {
10261062
"summary": "ListEarnerHistoricalRewards",
@@ -2567,6 +2603,23 @@
25672603
}
25682604
}
25692605
},
2606+
"GetRewardsForDistributionRootRequest": {
2607+
"type": "object",
2608+
"properties": {
2609+
"rootIndex": {
2610+
"type": "integer",
2611+
"format": "uint64"
2612+
}
2613+
}
2614+
},
2615+
"GetRewardsForDistributionRootResponse": {
2616+
"type": "object",
2617+
"properties": {
2618+
"rewards": {
2619+
"$ref": "#/components/schemas/Reward"
2620+
}
2621+
}
2622+
},
25702623
"GetRewardsForSnapshotRequest": {
25712624
"type": "object",
25722625
"properties": {

gen/openapiv2/apidocs.swagger.json

+43
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,37 @@
918918
]
919919
}
920920
},
921+
"/rewards/v1/distribution-roots/{rootIndex}/rewards": {
922+
"get": {
923+
"operationId": "Rewards_GetRewardsForDistributionRoot",
924+
"responses": {
925+
"200": {
926+
"description": "A successful response.",
927+
"schema": {
928+
"$ref": "#/definitions/rewardsGetRewardsForDistributionRootResponse"
929+
}
930+
},
931+
"default": {
932+
"description": "An unexpected error response.",
933+
"schema": {
934+
"$ref": "#/definitions/rpcStatus"
935+
}
936+
}
937+
},
938+
"parameters": [
939+
{
940+
"name": "rootIndex",
941+
"in": "path",
942+
"required": true,
943+
"type": "string",
944+
"format": "uint64"
945+
}
946+
],
947+
"tags": [
948+
"Rewards"
949+
]
950+
}
951+
},
921952
"/rewards/v1/earners/{earnerAddress}/available-rewards-tokens": {
922953
"get": {
923954
"summary": "GetAvailableRewardsTokens returns the available rewards tokens for the given earner address",
@@ -2803,6 +2834,18 @@
28032834
}
28042835
}
28052836
},
2837+
"rewardsGetRewardsForDistributionRootResponse": {
2838+
"type": "object",
2839+
"properties": {
2840+
"rewards": {
2841+
"type": "array",
2842+
"items": {
2843+
"type": "object",
2844+
"$ref": "#/definitions/rewardsReward"
2845+
}
2846+
}
2847+
}
2848+
},
28062849
"rewardsGetRewardsForSnapshotResponse": {
28072850
"type": "object",
28082851
"properties": {

0 commit comments

Comments
 (0)