From 8442a4f7bcb88338f30b3e2f9807c41c68987d95 Mon Sep 17 00:00:00 2001 From: Madhur Shrimal Date: Mon, 19 Aug 2024 13:29:08 -0700 Subject: [PATCH] fix: claim url fix --- pkg/rewards/show.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/rewards/show.go b/pkg/rewards/show.go index 9d88141..7102023 100644 --- a/pkg/rewards/show.go +++ b/pkg/rewards/show.go @@ -35,6 +35,9 @@ const ( All ClaimType = "all" Unclaimed ClaimType = "unclaimed" Claimed ClaimType = "claimed" + + GetClaimableRewardsEndpoint = "grpc/eigenlayer.RewardsService/GetClaimableRewards" + GetEarnedTokensForStrategyEndpoint = "grpc/eigenlayer.RewardsService/GetEarnedTokensForStrategy" ) type ShowConfig struct { @@ -93,7 +96,7 @@ func ShowRewards(cCtx *cli.Context) error { cCtx.App.Metadata["network"] = config.ChainID.String() url := testnetUrl - if config.Environment == "prod" { + if config.Environment == "mainnet" { url = mainnetUrl } else if config.Environment == "preprod" { url = preprodUrl @@ -105,7 +108,7 @@ func ShowRewards(cCtx *cli.Context) error { "days": fmt.Sprintf("%d", absInt64(config.NumberOfDays)), } resp, err := post( - fmt.Sprintf("%s/%s", url, "grpc/eigenlayer.RewardsService/GetEarnedTokensForStrategy"), + fmt.Sprintf("%s/%s", url, GetEarnedTokensForStrategyEndpoint), requestBody, ) if err != nil { @@ -133,7 +136,8 @@ func ShowRewards(cCtx *cli.Context) error { requestBody := map[string]string{ "earnerAddress": config.EarnerAddress.String(), } - resp, err := post(fmt.Sprintf("%s/%s", url, "grpc/eigenlayer.RewardsService/GetUpcomingRewardDetails"), requestBody) + claimableRewardsUrl := fmt.Sprintf("%s/%s", url, GetClaimableRewardsEndpoint) + resp, err := post(claimableRewardsUrl, requestBody) if err != nil { return err }