Proposals

Proposals queries all proposals based on given status.

GET/cosmos/gov/v1beta1/proposals
Query parameters
Response

A successful response.

Body
proposalsarray of object
paginationobject

PageResponse is to be embedded in gRPC response messages where the corresponding request message has used PageRequest.

message SomeResponse { repeated Bar results = 1; PageResponse page = 2; }

Request
const response = await fetch('/cosmos/gov/v1beta1/proposals', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "proposals": [
    {
      "proposal_id": "text",
      "content": {
        "type_url": "text",
        "value": "Ynl0ZXM="
      },
      "status": "PROPOSAL_STATUS_UNSPECIFIED",
      "final_tally_result": {
        "yes": "text",
        "abstain": "text",
        "no": "text",
        "no_with_veto": "text"
      },
      "submit_time": "2024-12-04T22:13:49.675Z",
      "deposit_end_time": "2024-12-04T22:13:49.675Z",
      "total_deposit": [
        {
          "denom": "text",
          "amount": "text"
        }
      ],
      "voting_start_time": "2024-12-04T22:13:49.675Z",
      "voting_end_time": "2024-12-04T22:13:49.675Z"
    }
  ],
  "pagination": {
    "next_key": "Ynl0ZXM=",
    "total": "text"
  }
}

Proposal queries proposal details based on ProposalID.

GET/cosmos/gov/v1beta1/proposals/{proposal_id}
Path parameters
proposal_id*string (uint64)

proposal_id defines the unique id of the proposal.

Response

A successful response.

Body
proposalobject

Proposal defines the core field members of a governance proposal.

Request
const response = await fetch('/cosmos/gov/v1beta1/proposals/{proposal_id}', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "proposal": {
    "proposal_id": "text",
    "content": {
      "type_url": "text",
      "value": "Ynl0ZXM="
    },
    "status": "PROPOSAL_STATUS_UNSPECIFIED",
    "final_tally_result": {
      "yes": "text",
      "abstain": "text",
      "no": "text",
      "no_with_veto": "text"
    },
    "submit_time": "2024-12-04T22:13:49.675Z",
    "deposit_end_time": "2024-12-04T22:13:49.675Z",
    "total_deposit": [
      {
        "denom": "text",
        "amount": "text"
      }
    ],
    "voting_start_time": "2024-12-04T22:13:49.675Z",
    "voting_end_time": "2024-12-04T22:13:49.675Z"
  }
}

Last updated