Working for default proposals
Query for a paginated proposals that match optional filters:
Example:
$ lens query gov proposals --depositor cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk
$ lens query gov proposals --voter cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk
$ lens query gov proposals --status (DepositPeriod|VotingPeriod|Passed|Rejected)
$ lens query gov proposals --page=2 --limit=100
Usage:
lens query governance proposals [flags]
Flags:
--count-total count total number of records in objects to query for (default true)
--depostior string (optional) filter by proposals deposited on by depositor
-h, --help help for proposals
--limit uint pagination limit of objects to query for (default 100)
--offset uint pagination offset of objects to query for
--page uint pagination page of objects to query for. This sets offset to a multiple of limit (default 1)
--page-key string pagination page-key of objects to query for
--reverse results are sorted in descending order
--status string (optional) filter proposals by proposal status, status: deposit_period/voting_period/passed/rejected
--voter string (optional) filter by proposals voted on by voted
Global Flags:
--chain string override default chain
-d, --debug debug output
--home string set home directory (default "C:\\Users\\joeab/.lens")
For example:
$ lens q gov proposals --chain regen | jq .
{
"proposals": [
{
"proposal_id": "8",
"content": {
"@type": "/cosmos.params.v1beta1.ParameterChangeProposal",
"title": "Credit Class Creator - Regen Registry",
"description": "This is a parameter change proposal to add a multisig address for Regen Registry, currently managed by members of Regen Network Development (RND), to the list of allowed credit class creators. The RND staff are applying on behalf of Regen Registry, which we envision will become the first community governed registry program, owned and operated by experts committed to ecological regeneration.\n\nFor more information, see the long-form proposal: https://github.com/regen-network/governance/tree/main/proposals/2021-12-regen-registry-credit-class-creator",
"changes": [
{
"subspace": "ecocredit",
"key": "AllowedClassCreators",
"value": "[\n \"regen123a7e9gvgm53zvswc6daq7c85xtzt8263lgasm\"\n ]"
}
]
},
"status": "PROPOSAL_STATUS_VOTING_PERIOD",
"final_tally_result": {
"yes": "0",
"abstain": "0",
"no": "0",
"no_with_veto": "0"
},
"submit_time": "2021-12-23T23:16:48.618057670Z",
"deposit_end_time": "2022-01-06T23:16:48.618057670Z",
"total_deposit": [
{
"denom": "uregen",
"amount": "200000000"
}
],
"voting_start_time": "2021-12-24T01:40:20.924789916Z",
"voting_end_time": "2022-01-07T01:40:20.924789916Z"
}
],
"pagination": {
"next_key": null,
"total": "1"
}
}
- [x] Handle flags
- [ ] Handle Customs Proposal types.