cosmpy
cosmpy copied to clipboard
Feature request: query_account() should return pub_key alongside account_number and sequence
Prerequisites
- [X] I checked the documentation and made sure this feature does not already exist.
- [X] I checked the existing issues to make sure this feature has not already been requested.
- [X] I have read the code of conduct before creating this issue.
Problem
There are cases where the user of cosmpy needs to retrieve the public key of an address from a cosmos blockchain daemon.
To enable this, cosmos blockchain daemons have the /cosmos/auth/v1beta1/accounts/cosmos1yaddayaddayadda
query which retrieves the pub_key
, account_number
, and sequence
values of the specified account
.
Unfortunately, the aerial client's query_account function only returns the account_number
and sequence
values and does not return the pub_key.
Feature / Solution
A solution is to alter the query_account function to return the pub_key
value that it is already retrieving from the server instead of discarding it.
Alternatives
At the moment, the only alternative I can find for a cosmpy dev to retrieve pub_keys from Cosmos daemons is to do it outside of cosmpy and use direct comms with the daemons instead.
Additional Context
The current implementation of query_account
returns an instance of Account()
which does not have the pub_key
field defined.
A proper solution would require either one of the following to accomplish the goal:
- Altering the existing
Account()
definition to make apub_key
field available - Creating a definition of a new data structure that has all fields returned from the
/cosmos/auth/v1beta1/accounts/{account}
call