database_api.list_proposals
Purpose
返回全部提案(proposal),从指定的创建者或开始日期开始。参数:start:array;limit:int;order:string;order_direction:string;status:string
start取决于order(见下文)creator- 提案的创建者(账户名字符串)start_date- 提案的开始日期(日期字符串)end_date- 提案的结束日期(日期字符串)total_votes- 提案的总票数(int)
limit最大 1000。order可取以下值:by_creator- 按提案创建者排序by_start_date- 按提案开始日期排序by_end_date- 按提案结束日期排序by_total_votes- 按提案总票数排序
order_direction可取以下值:ascendingdescending
statusallinactiveactiveexpiredvotable
start (array) | limit (int) | order (string) | order_direction (string) | status (string) | |
|---|---|---|---|---|---|
[""] | 10 | by_creator | ascending | active | 列出 10 条 active 状态的提案,按创建者升序排列 |
["2019-08-07T16:54:03"] | 1000 | by_start_date | ascending | inactive | 列出自 2019-08-07T16:54:03 起 inactive 状态的 1000 条提案,按开始日期升序排列 |
["a"] | 1 | by_creator | ascending | expired | 列出以 "a" 开头账户的 1 条 expired 状态提案,按创建者升序排列 |
["alice"] | 10 | by_creator | ascending | all | 列出 alice 的 10 条任意状态提案,按创建者升序排列 |
[""] | 1000 | by_creator | ascending | votable | 列出 1000 条 votable 状态的提案,按创建者升序排列 |
[10] | 1000 | by_total_votes | ascending | votable | 列出至少有 10 票的 1000 条 votable 状态提案,按创建者升序排列 |
另见:Paginated API Methods
Parameters
PARAMETERS
json
{
"start": null,
"limit": 0,
"order": "by_name",
"order_direction": "ascending",
"status": "all"
}Example
Example 1
BASH
bash
curl -s https://api.steemit.com \
-H 'Content-Type: application/json' \
--data-binary '{
"jsonrpc": "2.0",
"method": "database_api.list_proposals",
"params": {
"start": [
""
],
"limit": 10,
"order": "by_creator",
"order_direction": "ascending",
"status": "active"
},
"id": 1
}'Example 2
BASH
bash
curl -s https://api.steemit.com \
-H 'Content-Type: application/json' \
--data-binary '{
"jsonrpc": "2.0",
"method": "database_api.list_proposals",
"params": {
"start": [
"2019-08-07T16:54:03"
],
"limit": 1000,
"order": "by_start_date",
"order_direction": "ascending",
"status": "inactive"
},
"id": 1
}'Example 3
BASH
bash
curl -s https://api.steemit.com \
-H 'Content-Type: application/json' \
--data-binary '{
"jsonrpc": "2.0",
"method": "database_api.list_proposals",
"params": {
"start": [
"a"
],
"limit": 1,
"order": "by_creator",
"order_direction": "ascending",
"status": "expired"
},
"id": 1
}'Example 4
BASH
bash
curl -s https://api.steemit.com \
-H 'Content-Type: application/json' \
--data-binary '{
"jsonrpc": "2.0",
"method": "database_api.list_proposals",
"params": {
"start": [
"alice"
],
"limit": 10,
"order": "by_creator",
"order_direction": "ascending",
"status": "all"
},
"id": 1
}'Example 5
BASH
bash
curl -s https://api.steemit.com \
-H 'Content-Type: application/json' \
--data-binary '{
"jsonrpc": "2.0",
"method": "database_api.list_proposals",
"params": {
"start": [
""
],
"limit": 1000,
"order": "by_creator",
"order_direction": "ascending",
"status": "votable"
},
"id": 1
}'Example 6
BASH
bash
curl -s https://api.steemit.com \
-H 'Content-Type: application/json' \
--data-binary '{
"jsonrpc": "2.0",
"method": "database_api.list_proposals",
"params": {
"start": [
10
],
"limit": 1000,
"order": "by_total_votes",
"order_direction": "ascending",
"status": "votable"
},
"id": 1
}'Response
RESPONSE
json
{
"proposals": [
{
"id": 0,
"proposal_id": "1103806595072",
"creator": "alice",
"receiver": "bob",
"start_date": "2019-07-01T00:00:00",
"end_date": "2019-08-01T23:59:59",
"daily_pay": {
"amount": "4800000",
"precision": 3,
"nai": "@@000000013"
},
"subject": "My Proposal",
"permlink": "creator-proposal-permlink",
"total_votes": "77351826710",
"status": "active"
}
]
}