-
Notifications
You must be signed in to change notification settings - Fork 296
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
Allow filtering view service balance queries by asset #2768
Comments
@aubrika Can you comment on feasibility here? It may be too late to get this into 56, but sounds like it'd unblock active work for the SL when it lands. |
Oh I think we can make the RPC changes for 56 if the service just needs to return |
Tremendous news! Thanks for tackling it, I'll me meeting with the SL folks tomorrow and keep them updated on our expected timeline. |
Discussed this approach with SL again today. It seems critical to support that we support passing in human-readable denom strings as args to the At a high level, we cannot expect external devs to know asset_ids. We can expect them to know human-readable denom strings, such as "upenumbra", so we should support the latter in our RPC methods. Or at least, provide a method to convert one to the other. |
I don't think we need to change the Value struct, since the AssetId already has an alt encoding? |
That's helpful, thanks. I think you're right: AssetId is the only place we need the flexibility, and that should cover us everywhere. Unfortunately we can't leverage the |
Is your feature request related to a problem? Please describe.
Currently, the only way to query balances is the
BalanceByAddress
RPC, which has one argument, the address. It would be convenient if it could filter the returned balances by asset ID. In particular, now that theAssetId
proto structure allows alternate encodings, this would allow an RPC user to query balances using a base denom string.We may also want to re-examine the RPC. It's
BalanceByAddress
, but addresses aren't a unit of accounting, accounts are. Also, a user might want to request the total balance across all accounts.Describe the solution you'd like
Change the RPC to
rpc Balances(BalancesRequest) returns (stream BalancesResponse)
.Change
BalanceByAddressRequest
toChange
BalanceByAddressResponse
toUpdate the Rust view server implementation to reflect these changes. For now, I think it's fine for the Rust view server to return
tonic::Status::unimplemented
ifaccount_filter
is unset, to minimize changes to the existing code; if anyone ever complains, we'll know that someone wants to request multiple accounts simultaneously.Additional context
This unblocks work on InterchainTest, by making it easier to write balance tests without having to build asset ID lookup tables.
The text was updated successfully, but these errors were encountered: