Skip to content

Commit

Permalink
display withdrawable eth in claim vault instead of complete claim bal…
Browse files Browse the repository at this point in the history
…ance
  • Loading branch information
bharath-123 committed Jan 17, 2024
1 parent 1bb8e44 commit 74fb129
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions shared/types/api/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type NodeStatusResponse struct {
OperatorELRewardsAddress common.Address `json:"operatorELRewardsAddress"`
OperatorELRewardsAddressBalance *big.Int `json:"operatorELRewardsAddressBalance"`
OperatorRewardCollectorBalance *big.Int `json:"operatorRewardCollectorBalance"`
OperatorWithdrawableEth *big.Int `json:"operatorWithdrawableEth"`
DepositedSdCollateral *big.Int `json:"depositedSdCollateral"`
SdCollateralWorthValidators *big.Int `json:"sdCollateralWorthValidators"`
Registered bool `json:"registered"`
Expand Down
2 changes: 1 addition & 1 deletion stader-cli/node/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func getNodeStatus(c *cli.Context) error {
if status.OperatorRewardCollectorBalance.Cmp(big.NewInt(0)) > 0 {
fmt.Printf(
"The Operator has aggregated total claims of %s in the claim vault\n",
eth.DisplayAmountInUnits(status.OperatorRewardCollectorBalance, "eth"))
eth.DisplayAmountInUnits(status.OperatorWithdrawableEth, "eth"))
fmt.Printf("To transfer the claims to your operator reward address use the %sstader-cli node claim-rewards%s command\n\n", log.ColorGreen, log.ColorReset)
}

Expand Down
11 changes: 9 additions & 2 deletions stader/api/node/status.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package node

import (
"math/big"
"time"

stader_backend "github.com/stader-labs/stader-node/shared/types/stader-backend"
"github.com/stader-labs/stader-node/shared/utils/eth1"
pool_utils "github.com/stader-labs/stader-node/stader-lib/pool-utils"
socializing_pool "github.com/stader-labs/stader-node/stader-lib/socializing-pool"
stader_config "github.com/stader-labs/stader-node/stader-lib/stader-config"
"github.com/stader-labs/stader-node/stader-lib/types"
"math/big"
"time"

"github.com/stader-labs/stader-node/shared/services"
"github.com/stader-labs/stader-node/shared/types/api"
Expand Down Expand Up @@ -187,6 +188,12 @@ func getStatus(c *cli.Context) (*api.NodeStatusResponse, error) {
}
response.OperatorRewardCollectorBalance = operatorRewardCollectorBalance

operatorWithdrawableEth, err := node.WithdrawableInEth(orc, nodeAccount.Address, nil)
if err != nil {
return nil, err
}
response.OperatorWithdrawableEth = operatorWithdrawableEth

//fmt.Printf("Getting operator reward address balance\n")
operatorReward, err := tokens.GetEthBalance(pnr.Client, operatorRegistry.OperatorRewardAddress, nil)
if err != nil {
Expand Down

0 comments on commit 74fb129

Please sign in to comment.