Additional endpoints for SteemPlus backend

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@stoodkev·
0.000 HBD
Additional endpoints for SteemPlus backend
![image.png](https://cdn.utopian.io/posts/7fdd842cdc4d2b91f76278e958342e67f926image.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
~~~~
[{"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. It returns a timestamp, the names of delegators, and the number of Vests being delegated.


##### Result for @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's wallet, including incoming and outgoing transfers and claimed rewards.


##### Result for @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

- [/api/get-received-witness-votes/[username]](https://github.com/stoodkev/steemplus-api/commit/1cfa1075dbf0e534fae306f31998478a0fd515ca): This commit contains the definition of this route as well as the IP rate feature.

- [/api/get-incoming-delegations](https://github.com/stoodkev/steemplus-api/commit/71b0ca015535f6308b29ca019664c6f328f4903c) 


- [/api/get-wallet-content](https://github.com/stoodkev/steemplus-api/commit/4f4c6b5f84fa71431e9a685b1a834db67c3d598b)

For more information consult the updated [README](https://github.com/stoodkev/steemplus-api/commit/19bf42caf9cad17dca3c01f53d3b8afa07901758) and the full list of [commits](https://github.com/stoodkev/steemplus-api/commits/master).

### Coming soon

- More wallet transactions
- Rewards information
- User statistics

### Wanna contribute?

Join us on [Discord](https://discord.gg/96JkJSy "This link will take you away from steemit.com")


### 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`.

<br/><br/>

<div class="pull-right">
<a href="https://discord.gg/7mqmx2M" rel="noopener" title="This link will take you away from steemit.com">
<img src="https://steemitimages.com/DQmd5CQG5zLjjm2z8289qcLU6eBHJpC5FmgtR3aC1eXnhsi/Adsactly-Logo-200px.png" alt="Go Adsactly">
</a>
</div>

Big shoutout to [@jerrybanfield](/@jerrybanfield) and his budgets project that allow us the speed up the development of SteemPlus!

[@stoodkev](/@stoodkev) and [@cedricguillas](/@cedricguillas) for [@steem-plus](/@steem-plus)  

#### Powered by [@adsactly](/@adsactly)

#### Powered by [@utopian-io](/@utopian-io)

Like what I do? [Vote @stoodkev for witness!](https://v2.steemconnect.com/sign/account-witness-vote?witness=stoodkev&approve=1 "This link will take you away from steemit.com")

<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@stoodkev/additional-endpoints-for-steemplus-backend">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
👍 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,