API added: expiring-delegations

in Witness Activities2 months ago (edited)

API

List of APIs provided by @justyy can be found here

Design

image.png

API expiring-delegations added, now you can use:

curl -s "https://api.justyy.workers.dev/api/steemit/expiring-delegations/?cached&id=justyy"

[
  {
    "id": 14543680,
    "delegator": "justyy",
    "vesting_shares": 296459748.408969,
    "expiration": "2024-08-21T08:00:09",
    "sp": 173784.16767793059
  },
  {
    "id": 14544169,
    "delegator": "justyy",
    "vesting_shares": 25905305.416771,
    "expiration": "2024-08-22T14:00:09",
    "sp": 15185.64312510202
  },
  {
    "id": 14544207,
    "delegator": "justyy",
    "vesting_shares": 69199641.724364,
    "expiration": "2024-08-22T15:00:09",
    "sp": 40564.70466975466
  }
]

Parameters:

Required id: the steem account name
Optional limit: default to 100
Optional start: default to current timestamp "YYYY-MM-DDT00:11:22" for example "2023-01-02T01:02:03"

Error cases:

If the limit is invalid

{
  "name": "RPCError",
  "code": -32003,
  "data": {
    "code": 10,
    "name": "assert_exception",
    "message": "Assert Exception",
    "stack": [
      {
        "context": {
          "level": "error",
          "file": "database_api.cpp",
          "line": 821,
          "method": "list_vesting_delegation_expirations",
          "hostname": "",
          "timestamp": "2024-08-19T07:24:27"
        },
        "format": "args.limit <= DATABASE_API_SINGLE_QUERY_LIMIT: ",
        "data": {}
      }
    ]
  }
}

If the account is invalid: it returns null.
If the account is not found or no expiring delegations are found, it will return empty array [].
If the start parameter is invalid: it will return "Invalid Time Stamp"

Steem to the Moon🚀!

Coin Marketplace

STEEM 0.16
TRX 0.16
JST 0.028
BTC 68208.41
ETH 2447.71
USDT 1.00
SBD 2.57