HAF Plug & Play: Delegations API
hive-139531·@freebeings·
0.000 HBDHAF Plug & Play: Delegations API
 --- @imwatsi shares an update on the development of HAF Plug & Play - GitHub: https://github.com/FreeBeings-io/haf-plug-play --- # What’s new? As requested [on GitLab](https://gitlab.syncad.com/hive/tasks_without_projects_yet/-/issues/38#note_108978), I have added a new plug to Plug & Play, that brings endpoints for vesting delegations. This complements the current API [condenser_api.get_vesting_delegations](https://developers.hive.io/apidefinitions/#condenser_api.get_vesting_delegations), which only returns outgoing delegations. Now you can get data about incoming delegations, plus historical delegation data, both incoming and outgoing, for a specified account. --- I have deployed the API here: https://deleg.hpp.freebeings.io --- Anyone can run a server with the same API by installing HAF Plug & Play and running the service with the `deleg` plug enabled. I will post a detailed tutorial shortly on how to use Plug & Play to run available plugs and also how to write code to add new plugs that process specific Hive operations. # Endpoints The following endpoints are avaialble on the server. ### /api/deleg/account This returns a summary of vesting delegation balances for an account, incoming and outgoing, at the time of request. It takes one parameter: `account`; which is the name of the Hive account you want to lookup. **Example request:** ``` curl -X 'GET' \ 'https://deleg.hpp.freebeings.io/api/deleg/account?account=imwatsi' \ -H 'accept: application/json' ``` *Or* ``` https://deleg.hpp.freebeings.io/api/deleg/account?account=imwatsi ``` **Example response body:** ``` { "account": "imwatsi", "balances": { "in": 0, "out": 303499.927927 } } ``` --- ### /api/deleg/in Get a list of delegations that are currently given to an account. **Paramaters:** - `account` - `limit` **Example request:** ``` curl -X 'GET' \ 'https://deleg.hpp.freebeings.io/api/deleg/in?account=imwatsi.test&limit=100' \ -H 'accept: application/json' ``` *Or* ``` https://deleg.hpp.freebeings.io/api/deleg/in?account=imwatsi.test&limit=100 ``` **Example response body:** ``` [ { "id": 1261821, "delegator": "imwatsi", "amount": 39451.307672 } ] ``` --- ### /api/deleg/out Get a list of outgoing delegations from an account. **Paramaters:** - `account` - `limit` **Example request:** ``` curl -X 'GET' \ 'https://deleg.hpp.freebeings.io/api/deleg/out?account=imwatsi&limit=100' \ -H 'accept: application/json' ``` *Or* ``` https://deleg.hpp.freebeings.io/api/deleg/out?account=imwatsi&limit=100 ``` **Example response body:** ``` [ { "id": 1261821, "delegator": "imwatsi.test", "amount": 39451.307672 }, { "id": 1311023, "delegator": "billz-00", "amount": 9664.017574 }, { "id": 1335826, "delegator": "hichem.test", "amount": 18908.004815 } ... ] ``` --- ### /api/deleg/history/in Get a list of **historical incoming** delegations to an account. **Paramaters:** - `account` - `limit`: default `100` - `descending`: default `true` **Example request:** ``` curl -X 'GET' \ 'https://deleg.hpp.freebeings.io/api/deleg/history/in?account=imwatsi&limit=100&descending=true' \ -H 'accept: application/json' ``` *Or* ``` https://deleg.hpp.freebeings.io/api/deleg/history/in?account=imwatsi&limit=100&descending=true ``` **Example response body:** ``` [ { "id": 8435728, "created": "2022-08-19T21:46:48", "delegator": "blocktrades.com", "amount": 160335.403108 }, { "id": 8435518, "created": "2022-08-19T19:36:36", "delegator": "blocktrades.com", "amount": 500870.91407 }, ... ] ``` --- ### /api/deleg/history/out Get a list of **historical outgoing** delegations to an account. **Paramaters:** - `account` - `limit`: default `100` - `descending`: default `true` **Example request:** ``` curl -X 'GET' \ 'https://deleg.hpp.freebeings.io/api/deleg/history/out?account=imwatsi&limit=100&descending=true' \ -H 'accept: application/json' ``` *Or* ``` https://deleg.hpp.freebeings.io/api/deleg/history/out?account=imwatsi&limit=100&descending=true ``` **Example response body:** ``` [ { "id": 8547257, "created": "2022-08-23T12:20:00", "delegator": "nicolemokhethi", "amount": 30000 }, { "id": 8286482, "created": "2022-07-02T15:12:33", "delegator": "freebeings", "amount": 54695.297887 }, { "id": 7850258, "created": "2022-04-24T16:36:45", "delegator": "squigglez", "amount": 30000 }, ... ] ``` --- # What's next? Since it is a new release, I will wait for community feedback to determine what new features/modifications I should work on. Feel free to test it out and give feedback. --- *by @imwatsi - Co-Founder | CEO | Blockchain Developer of [FreeBeings.io LLC](https://freebeings.io)* --- --- # Vote for our witness **Witness Name:** @imwatsi  --- **We're glad to be building on Hive.** *Follow the @freebeings account for more updates.*
👍 gerber, ezzy, exyle, steem.leo, mice-k, dcityrewards, blockbrothers, bestboom, kgswallet, blocktvnews, invest2learn, photo-hive-five, leodis, rafalski, shitsignals, jeanlucsr, unconditionalove, linco, dlike, bobby.madagascar, determine, permaculturedude, haikusailor, steemindian, leo.syndication, one.life, lividseagulls, therealyme, ribary, kgsupport, dpend.active, sketching, hivechat, actordontee, netaterra, hungryharish, hungryanu, drricksanchez, drexlord, kendewitt, meanbees, patronpass, manniman, fitnessgourmet, patlog, razorshark, marvinman, money.finance, mannimanccadm, cconn, tomwafula, minerspost, darkpylon, plusvault, appreciator, xappreciator, lenasveganliving, rakkasan84, sunsea, anikekirsten, ravenmus1c, augusto-cordova, soyunasantacruz, noalys, elgatoshawua, hexagono6, trouvaille, yoieuqudniram, sovebrito, detlev, x30, dynamicrypto, marblely, josehany, emeka4, actioncats, discoveringarni, lucianav, gabilan55, adedayoolumide, power-kappe, fotomaglys, aprasad2325, quycmf8, wendy0520, fairyberry, femcy-willcy, kerokus, bluemist, technicalside, samostically, leighscotford, zeesh, akkann, gaottantacinque, marblesz, noelyss, cribbio, inciter, gasaeightyfive, coolsurfer, kattycrochet, penguinpablo, cryptonized, alphacore, funnyman, hungrybear, awesomeintrigue, thereikiforest, auracraft, getron, edian, vancouverdining, agro-dron, verdesmeralda, hive.friends, beerlover, privex, roadstories, newsflash, kirito-freud, honeymoon-1611, jvphotography, damian-z, roadstories.trib, freebornsociety, diehardknocks, borran, thrasher666, emaxisonline, acidyo, steeminator3000, gniksivart, adamada, kgakakillerg, worldwildflora, mister-meeseeks, empoderat, juanvegetarian, ghaazi, rendrianarma, leveluplifestyle, trasto, tillmea, jazzhero, didutza, romeskie, sgbonus, creodas, markjason, beyonddisability, wannderingsoul, nkechi, russia-btc, ninnu, elyelma, meltysquid, henrycalu, francescomai, helgalubevi, emrebeyler, denizcakmak, bigmoneyman, dpoll.witness, flsfserkan, adacardano, borislavzlatanov, beco132, humbe, zainnyferdhoy, wiseagent, danyst1ne, anacristinasilva, usainvote, bigtakosensei, jphamer1, sharkthelion, some-asshole, simplegame, sofs-su, creacioneslelys, sivehead, photographercr, pvinny69, trafalgar, itinerantph, raindrop, traf, julesquirin, artefactoestudio, xtrafalgar, lisfabian, el-dee-are-es, gledys19, bisayanibai, valorbeats, amitsharma, olaunlimited, resonator, ura-soul, informationwar, ausbitbank, truthforce, risemultiversity, dmwh, empress-eremmy, deepdives, riskneutral, okluvmee, delver, hyun-soo, investinfreedom, stevescoins, v4vapid, clownworld, jimbobbill, ksjegw, bitcoinflood, cryptochroma, galenkp, maxsieg, hive-168869, celestegray, gollumkp, gloriaolar, mrbonkers, wend1go, luciannagy, ahleap, cinqowy, franzpaulie, lichtblick, santigs, breezin, softworld, breelikeatree, spiritabsolute, louis88, louis.random, louis.witness, semennemes, korver, jpistheway2b, phortun, onlavu, velinov86, jelly13, tanzil2024, pokemonsteem, melcaya, reccandra, drag33, mike50, ace108, techcoderx, ahmedsy, devpress, themonetaryfew, ikrahch, tempertantric, fw206, al-leonardo, isabelpena, diodao, mullmull, amerlin, hecates, goldenunicorn, alexft, heron-ua, opanyin, exandozer, invcble, arabisouri,