diff --git a/shared/types/api/node.go b/shared/types/api/node.go index 0021356f3..357172086 100644 --- a/shared/types/api/node.go +++ b/shared/types/api/node.go @@ -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"` diff --git a/stader-cli/node/status.go b/stader-cli/node/status.go index e3a4e7918..19cac4262 100644 --- a/stader-cli/node/status.go +++ b/stader-cli/node/status.go @@ -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) } diff --git a/stader/api/node/status.go b/stader/api/node/status.go index aaebd495e..b410a03a3 100644 --- a/stader/api/node/status.go +++ b/stader/api/node/status.go @@ -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" @@ -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 {