Vai al contenuto

database_api.list_proposals ​

Purpose ​

Restituisce tutte le proposte (proposal), a partire dal creatore indicato o dalla data di inizio. Parametri: start:array; limit:int; order:string; order_direction:string; status:string

  • start dipende da order (vedere sotto)
    • creator - creatore della proposta (stringa nome account)
    • start_date - data di inizio della proposta (stringa data)
    • end_date - data di fine della proposta (stringa data)
    • total_votes - voti totali della proposta (int)
  • limit è fino a 1000.
  • order può essere uno tra:
    • by_creator - ordina per creatore della proposta
    • by_start_date - ordina per data di inizio della proposta
    • by_end_date - ordina per data di fine della proposta
    • by_total_votes - ordina per voti totali della proposta
  • order_direction può essere uno tra:
    • ascending
    • descending
  • status
    • all
    • inactive
    • active
    • expired
    • votable
start (array)limit (int)order (string)order_direction (string)status (string)
[""]10by_creatorascendingactiveelenca 10 proposte con stato active, ordinate per creatore, in ordine ascendente
["2019-08-07T16:54:03"]1000by_start_dateascendinginactiveelenca 1000 proposte con stato inactive, ordinate per data di inizio, in ordine ascendente, dal 2019-08-07T16:54:03
["a"]1by_creatorascendingexpiredelenca 1 proposta con stato expired, ordinata per creatore, in ordine ascendente, per gli account che iniziano per "a"
["alice"]10by_creatorascendingallelenca 10 proposte con qualsiasi stato, ordinate per creatore, in ordine ascendente, per alice
[""]1000by_creatorascendingvotableelenca 1000 proposte votabili, ordinate per creatore, in ordine ascendente
[10]1000by_total_votesascendingvotableelenca 1000 proposte votabili, ordinate per creatore, in ordine ascendente, con almeno 10 voti

Vedere anche: 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"
    }
  ]
}