Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: improve the inspect query for front-end #2562

Merged
merged 7 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
- [2494](https://github.com/umee-network/umee/pull/2494) Use go 1.22
- [2495](https://github.com/umee-network/umee/pull/2495) (util) `KeyWithUint64` and `KeyWithUint32` helper functions for db keys.
- [2504](https://github.com/umee-network/umee/pull/2504) bump `wasmd` to v0.45.0.
- [2562](https://github.com/umee-network/umee/pull/2562) (x/leverage proto): Add `base_denom` and `base_amount` to `QueryInspectResponse`.
gsk967 marked this conversation as resolved.
Show resolved Hide resolved

### Bug Fixes

Expand Down
32 changes: 26 additions & 6 deletions proto/umee/leverage/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import "umee/leverage/v1/leverage.proto";
import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "cosmos_proto/cosmos.proto";

option go_package = "github.com/umee-network/umee/v6/x/leverage/types";

Expand Down Expand Up @@ -489,13 +490,32 @@ message RiskInfo {
// DecBalances contains an account's position denoted in symbol denom tokens.
message DecBalances {
// Collateral contains all uTokens the account has collateralized. It has been converted from uTokens to tokens.
repeated cosmos.base.v1beta1.DecCoin collateral = 1 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"
repeated PositionBalance collateral = 1 [
(gogoproto.nullable) = false
];
// Borrowed contains all tokens the account has borrowed, including interest owed.
repeated cosmos.base.v1beta1.DecCoin borrowed = 2 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"
repeated PositionBalance borrowed = 2 [
(gogoproto.nullable) = false
];
}

// PositionBalance contains denom, amount with base_denom, base_amount for account position.
message PositionBalance {
// denom will SYMBOL Denom (Ex: AKT, USDT)
string denom = 1;
// base_denom will be ibc_denom or native base denom of umee (Ex: uumee, ibc/XXXX)
string base_denom = 2;
// amount represents the converted base tokens into symbol tokens using exchange rates
// Ex: 1000u/uumee becomes 0.0015UMEE at an exponent of 6 and uToken exchange rate of 1.5
string amount = 3 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false
];
// base_amount will represent base tokens without converting to symbol denominations
string base_amount = 4 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];
}
Loading
Loading