Additional endpoints for SteemPlus backend
utopian-io·@stoodkev·
0.000 HBDAdditional endpoints for SteemPlus backend
 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/>
👍 hackerzizon, stoodkev, molynar, steemline, analyzer, flugschwein, deanliu, johnson13, algo.coder, ripperone, derasmo, ewq, michaelizer, fanbasefr, bartosz546, jegede, shieha, lydiachan, wargof, estoy, lpv, fabinhocrypto, duke77, tiloupsa, best-of-football, atelierminceur, alucare, voltagrou, curiousshibby, hellofuture, tomlabe, swisschain, pl4ym0re, didizion, imcore, jane83, cryptofrench, studio666, viljacques, albatar, elex17, wazmung, audiodidacte, vianney, diamantnoir, naruitchi, tioneb44, steem-breizh, depereenfils, lilirose, ibellia, olicountry, renac, mapcompass, itharagaian, lebastion, tyjulie, polbot, forexflo, jpchabry, wargofosef, piotr42, irminsoul82, kelos, happydaddyfr, healthykitty, baloox, mayrie28, leguidecrypto, ulisessabeque, make-a-whale, ptoews, clumsysilverdad, loshcat, greenorange, holger80, arcange, raphaelle, grzesiekb, touhidalam69, skarnoze, chudilo, deyts, naberlin, techslut, utopian-1up, mahdiyari, simonluisi, ansonoxy, jamesbarraclough, espoem, moorkedi, nathalie13, bitopia, family.app, maphics, proffgodswill, sweeverdev, thatmemeguy, helo, ronimm, mufasatoldyou, thinkkniht, onos, jesdn16, kslo, not-a-bird, evilest-fiend, navx, sebastiengllmt, zlatkamrs, amosbastian, rhotimee, deejee, yeswanth, howtosteem, roj, nightdragon, jacintoelbarouki, criptokingko, opulence, dyancuex, yandot, luisrod, varja, rezawijaya, yourmercury, acrywhif, layanmarissa, kodeblacc, isacastillor, patatesyiyen, rsteem, onin91, isabella394, lemony-cricket, exploreand, petvalbra, photohunter3, photohunter4, photohunter5, sylinda, livsky, amirdesaingrafis, fai.zul, flinter, donjyde, crispycoinboys, bluestorm, flugbot, ilyastarar, jfuenmayor96, harshallele, xtramedium, smafey, steaknsteem, masud222, kimaben, eleonardo, zohaib715, klizo, checkthisout, handfree42, ilovekrys, carsonroscoe, xplore, solomon507, emailbox19149, hmctrasher, raoul.poenar, aderemi01, killbill73, aliyu-s, nonsqtr, jayo, ayoade96, cryptophunk, instantania.cat, bhim, maneki-neko, silasvogt, not-a-cat, saifannur-mzy, orlandumike, andiepumpgun, muratti, mwfiae, sugandhaseth, ahmad097, lsanek, lykia, realness, vampirgarfield, eraizel, editorspicks, inquiringtimes, mountainjewel, gwys, naturallife, cheesom, pixelproperty, ernoldlvb, gydronium, dave-verreault, joanpablo, alimirza0416, romanleopold, cryptocopy, artsyunicorn, steemfunder, chrome.citizen, swaze, sampath94, ewuoso, studytext, zalandir, lemcriq, toninux, estherekanem, camillius, salahudeen, mrgranville, brusd, odibezeking, mrmaracucho, lauraesfeliz, wealth4good, jdc, animefanrd, devilonwheels, abbyrich, solpaman, steemassistant, bargolis, phasma, carloniere, idlebright, adhew, jrmiller87, kaking, gwapoaller, khairulfahmi92, saksham, shenoy, adasq, j4zz, mdnazmulhasan, steem-plus, sachincool, cedricguillas, thinkingmind, reko, utopian-io, aikochan,