package remote
import (
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/forbole/callisto/v4/utils"
)
func (s Source) GetAccountBalance(address string, height int64) ([]sdk.Coin, error) {
ctx := utils.GetHeightRequestContext(s.Ctx, height)
balRes, err := s.bankClient.AllBalances(ctx, &banktypes.QueryAllBalancesRequest{Address: address})
if err != nil {
return nil, fmt.Errorf("error while getting all balances: %s", err)
}
return balRes.Balances, nil
}