2020-07-08 04:12:38 -07:00
|
|
|
syntax = "proto3";
|
2020-08-11 04:49:45 -07:00
|
|
|
package cosmos.auth.v1beta1;
|
2020-07-08 04:12:38 -07:00
|
|
|
|
2021-02-22 06:21:46 -08:00
|
|
|
import "cosmos/base/query/v1beta1/pagination.proto";
|
2020-07-08 04:12:38 -07:00
|
|
|
import "gogoproto/gogo.proto";
|
|
|
|
import "google/protobuf/any.proto";
|
2020-08-14 03:05:35 -07:00
|
|
|
import "google/api/annotations.proto";
|
2020-08-11 04:49:45 -07:00
|
|
|
import "cosmos/auth/v1beta1/auth.proto";
|
2020-07-08 04:12:38 -07:00
|
|
|
import "cosmos_proto/cosmos.proto";
|
|
|
|
|
|
|
|
option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types";
|
|
|
|
|
2020-08-10 01:12:59 -07:00
|
|
|
// Query defines the gRPC querier service.
|
2020-09-08 15:06:54 -07:00
|
|
|
service Query {
|
2021-02-22 06:21:46 -08:00
|
|
|
// Accounts returns all the existing accounts
|
|
|
|
rpc Accounts(QueryAccountsRequest) returns (QueryAccountsResponse) {
|
|
|
|
option (google.api.http).get = "/cosmos/auth/v1beta1/accounts";
|
|
|
|
}
|
|
|
|
|
2020-09-08 15:06:54 -07:00
|
|
|
// Account returns account details based on address.
|
|
|
|
rpc Account(QueryAccountRequest) returns (QueryAccountResponse) {
|
|
|
|
option (google.api.http).get = "/cosmos/auth/v1beta1/accounts/{address}";
|
|
|
|
}
|
|
|
|
|
|
|
|
// Params queries all parameters.
|
|
|
|
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
|
|
|
|
option (google.api.http).get = "/cosmos/auth/v1beta1/params";
|
|
|
|
}
|
feat: Add cli for listing all module accounts (#9812)
## Description
This PR adds a CLI for querying all module accounts, `module-accounts`, in the auth module.
Using this command would display all the account information, including human readable name of the module, module account address, account number, permissions, etc.
This command would be especially useful for developers using cosmos-sdk as there are lots of instances where a developer would have to look into the module account, but only to do so by getting the module account address after getting the module name, hashing it and bech32fying it in the status quo. By using this command, users would be able to get a quick look on the list of all module accounts' information.
---
### Author Checklist
*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*
I have...
- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed
### Reviewers Checklist
*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*
I have...
- [x] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [x] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [x] reviewed tests and test coverage
- [x] manually tested (if applicable)
2021-08-02 11:47:43 -07:00
|
|
|
|
|
|
|
// ModuleAccounts returns all the existing module accounts.
|
|
|
|
rpc ModuleAccounts(QueryModuleAccountsRequest) returns (QueryModuleAccountsResponse) {
|
|
|
|
option (google.api.http).get = "/cosmos/auth/v1beta1/module_accounts";
|
|
|
|
}
|
2021-08-25 04:17:18 -07:00
|
|
|
|
|
|
|
// Bech32 queries bech32Prefix
|
|
|
|
rpc Bech32Prefix(Bech32PrefixRequest) returns (Bech32PrefixResponse) {
|
|
|
|
option (google.api.http).get = "/cosmos/auth/v1beta1/bech32";
|
|
|
|
}
|
|
|
|
|
|
|
|
// AddressBytesToString converts Account Address bytes to string
|
|
|
|
rpc AddressBytesToString(AddressBytesToStringRequest) returns (AddressBytesToStringResponse) {
|
|
|
|
option (google.api.http).get = "/cosmos/auth/v1beta1/bech32/{address_bytes}";
|
|
|
|
}
|
|
|
|
|
|
|
|
// AddressStringToBytes converts Address string to bytes
|
|
|
|
rpc AddressStringToBytes(AddressStringToBytesRequest) returns (AddressStringToBytesResponse) {
|
|
|
|
option (google.api.http).get = "/cosmos/auth/v1beta1/bech32/{address_string}";
|
|
|
|
}
|
2020-07-08 04:12:38 -07:00
|
|
|
}
|
|
|
|
|
2021-02-22 06:21:46 -08:00
|
|
|
// QueryAccountsRequest is the request type for the Query/Accounts RPC method.
|
|
|
|
message QueryAccountsRequest {
|
|
|
|
// pagination defines an optional pagination for the request.
|
|
|
|
cosmos.base.query.v1beta1.PageRequest pagination = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryAccountsResponse is the response type for the Query/Accounts RPC method.
|
|
|
|
message QueryAccountsResponse {
|
|
|
|
// accounts are the existing accounts
|
|
|
|
repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "AccountI"];
|
|
|
|
|
|
|
|
// pagination defines the pagination in the response.
|
|
|
|
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
|
|
|
}
|
|
|
|
|
2020-08-10 01:12:59 -07:00
|
|
|
// QueryAccountRequest is the request type for the Query/Account RPC method.
|
2020-09-08 15:06:54 -07:00
|
|
|
message QueryAccountRequest {
|
2020-09-25 03:25:37 -07:00
|
|
|
option (gogoproto.equal) = false;
|
|
|
|
option (gogoproto.goproto_getters) = false;
|
|
|
|
|
2020-08-10 01:12:59 -07:00
|
|
|
// address defines the address to query for.
|
2020-09-25 03:25:37 -07:00
|
|
|
string address = 1;
|
2020-07-08 04:12:38 -07:00
|
|
|
}
|
|
|
|
|
2021-08-25 04:17:18 -07:00
|
|
|
// QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method.
|
|
|
|
message QueryModuleAccountsRequest {}
|
|
|
|
|
|
|
|
// QueryParamsResponse is the response type for the Query/Params RPC method.
|
|
|
|
message QueryParamsResponse {
|
|
|
|
// params defines the parameters of the module.
|
|
|
|
Params params = 1 [(gogoproto.nullable) = false];
|
|
|
|
}
|
|
|
|
|
2020-08-10 01:12:59 -07:00
|
|
|
// QueryAccountResponse is the response type for the Query/Account RPC method.
|
2020-09-08 15:06:54 -07:00
|
|
|
message QueryAccountResponse {
|
2020-08-10 01:12:59 -07:00
|
|
|
// account defines the account of the corresponding address.
|
2020-07-08 04:12:38 -07:00
|
|
|
google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "AccountI"];
|
|
|
|
}
|
|
|
|
|
2020-08-10 01:12:59 -07:00
|
|
|
// QueryParamsRequest is the request type for the Query/Params RPC method.
|
2020-09-08 15:06:54 -07:00
|
|
|
message QueryParamsRequest {}
|
2020-07-08 04:12:38 -07:00
|
|
|
|
feat: Add cli for listing all module accounts (#9812)
## Description
This PR adds a CLI for querying all module accounts, `module-accounts`, in the auth module.
Using this command would display all the account information, including human readable name of the module, module account address, account number, permissions, etc.
This command would be especially useful for developers using cosmos-sdk as there are lots of instances where a developer would have to look into the module account, but only to do so by getting the module account address after getting the module name, hashing it and bech32fying it in the status quo. By using this command, users would be able to get a quick look on the list of all module accounts' information.
---
### Author Checklist
*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*
I have...
- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed
### Reviewers Checklist
*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*
I have...
- [x] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [x] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [x] reviewed tests and test coverage
- [x] manually tested (if applicable)
2021-08-02 11:47:43 -07:00
|
|
|
// QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method.
|
|
|
|
message QueryModuleAccountsResponse {
|
|
|
|
repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "ModuleAccountI"];
|
2021-08-25 04:17:18 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// Bech32PrefixRequest is the request type for Bech32Prefix rpc method
|
|
|
|
message Bech32PrefixRequest {}
|
|
|
|
|
|
|
|
// Bech32PrefixResponse is the response type for Bech32Prefix rpc method
|
|
|
|
message Bech32PrefixResponse {
|
|
|
|
string bech32_prefix = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// AddressBytesToStringRequest is the request type for AddressString rpc method
|
|
|
|
message AddressBytesToStringRequest {
|
|
|
|
bytes address_bytes = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// AddressBytesToStringResponse is the response type for AddressString rpc method
|
|
|
|
message AddressBytesToStringResponse {
|
|
|
|
string address_string = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// AddressStringToBytesRequest is the request type for AccountBytes rpc method
|
|
|
|
message AddressStringToBytesRequest {
|
|
|
|
string address_string = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// AddressStringToBytesResponse is the response type for AddressBytes rpc method
|
|
|
|
message AddressStringToBytesResponse {
|
|
|
|
bytes address_bytes = 1;
|
|
|
|
}
|