Additional endpoints for SteemPlus backend

Words
320
Reading
2 min
Listen
Play
8y

image.png

We have added three new endpoints to help us get data from SteemSQL, for a better flexibility in our extension. It might look like there is not much code behind this update, but I can guarantee that the complex SQL request kept us sweating for a good while.

New Features

Here are the new routes pushed in this update:

  • /api/get-received-witness-votes/[username] : Get all the votes received by a witness along with a timestamp, voters Vests and Proxied Vests, for further filtering and sorting.
Result for stoodkev@stoodkev
[{"timestamp":"2018-03-12T19:35:39.000Z","account":"ahugehug","totalVests":1741.36062,"accountVests":1741.36062,"proxiedVests":0}, ...]
  • /api/get-incoming-delegations/[username] : Gets incoming delegations for username@username. It returns a timestamp, the names of delegators, and the number of Vests being delegated.
Result for stoodkev@stoodkev
[{"delegator":"steem-plus","vesting_shares":1026195.2327,"delegation_date":"2017-11-30T18:29:48.000Z"}, ... ]
  • /api/get-wallet-content/[username] : Gets the 500 last items from username@username's wallet, including incoming and outgoing transfers and claimed rewards.
Result for stoodkev@stoodkev
[{"timestamp":"2018-04-23T09:58:27.000Z","reward_steem":0,"reward_sbd":0,"reward_vests":0,"amount":110.276,"amount_symbol":"SBD","type":"transfer_to","memo":"","to_from":"steem-plus"}, ... ]

Additionally, in order to protect the API from abuses, we implemented express-rate-limit. It allows us to control the maximum number of calls to the API possible from the same IP address during a certain timeframe.

Commits

For more information consult the updated README and the full list of commits.

Coming soon

  • More wallet transactions
  • Rewards information
  • User statistics

Wanna contribute?

Join us on Discord

Installation procedures

  • Subscribe to SteemSQL (10 SBD/month)
  • Clone this repository
  • npm install
  • Set the environment variables (information received by transfer when you subscribe to SteemSQL). These environment variables are LOGIN, PASSWORD, SQL_API and DB.
  • npm run start
  • You should be able to test it on localhost:3000.



Big shoutout to @jerrybanfield and his budgets project that allow us the speed up the development of SteemPlus!

@stoodkev and @cedricguillas for @steem-plus

Powered by @adsactly

Powered by @utopian-io

Like what I do? Vote @stoodkev for witness!



Posted on Utopian.io - Rewarding Open Source Contributors

Additional endpoints for SteemPlus backend | Ecency