Hive PHP Lib - First production version update

in HiveDevslast year

Hello everyone! This time, I've made some things to attract more PHP developers on Hive. Ladies and Gentlemen, please welcome the first production version of Hive-PHP-Lib!

<p dir="auto"><img src="https://images.hive.blog/768x0/https://images.ecency.com/DQmW31Q3CfHqb8BHphGW6CLUba3JD1ezB4gViaeXVdzTwgR/gbsn.png" alt="Light Hive PHP Lib logo on dark background" srcset="https://images.hive.blog/768x0/https://images.ecency.com/DQmW31Q3CfHqb8BHphGW6CLUba3JD1ezB4gViaeXVdzTwgR/gbsn.png 1x, https://images.hive.blog/1536x0/https://images.ecency.com/DQmW31Q3CfHqb8BHphGW6CLUba3JD1ezB4gViaeXVdzTwgR/gbsn.png 2x" /> <p dir="auto">For those who don't know, <a href="https://gitlab.syncad.com/hive/hive-php-lib" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link"><strong>Hive-PHP-Lib is a PHP Library made to interact more easily with HIVE blockchain. Instead of writing many lines of code with cURL and use a "raw style" every time you made a query, this library use easier functions/method for that. <p dir="auto">This project is release under the open-source <a href="https://opensource.org/license/mit/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">MIT license. Many things are added, and it's time to take a tour of the news features. You can download it now : <a href="https://gitlab.syncad.com/hive/[**Hive-PHP-Lib**](https://gitlab.syncad.com/hive/hive-php-lib)/-/releases/v1.0.1" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Last release <h2>New Condenser API methods <p dir="auto">To bring <a href="https://gitlab.syncad.com/hive/hive-php-lib" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link"><strong>Hive-PHP-Lib in a production version, I add more methods for Condenser API (the production API used by Hive): <ul> <li>get_market_history <li>get_market_history_buckets <li>get_order_book <li>get_recent_trades <li>get_trade_history <li>get_volume <li>list_proposal_votes <li>list_proposals <li>verify_authority <p dir="auto">So, almost all methods for Condenser API are implemented in PHP. Of course, each method have his phpDoc block. <hr /> <p dir="auto"><center><br /> <strong>Any PHP developer can now create a Hive project with PHP!<br /> <hr /> <h2>New APIs <p dir="auto">It's OK for production but I also add some tests API for new devs: <strong>Rewards API and <strong>RC API. <p dir="auto">Each API is now implemented in PHP and can be used right now. As every method in <a href="https://gitlab.syncad.com/hive/hive-php-lib" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link"><strong>Hive-PHP-Lib, you can check the phpDoc for each function. <p dir="auto">Don't forget: the Rewards API is for testing purpose only, don't use it on production. <h2>Raw style example <p dir="auto">Remember the start of this post? I've talked about "Raw style.". Do you know you can do that too on <a href="https://gitlab.syncad.com/hive/hive-php-lib" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link"><strong>Hive-PHP-Lib? For only one reason: If HIVE blockchain will have a new HardFork, and if I don't have time to update this lib before the HF, you can still use it for new functions with Raw style. <p dir="auto">If you need to use it, don't panic, I add a documented example file (in <code>/resources/example). <h2>More docs & examples <p dir="auto">I want to bring HIVE to new PHP developers (some beginners or students). That's why I added phpDoc blocks everywhere in the code. The documentation can be generated with any phpDoc software (Like <a href="https://www.phpdoc.org/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">phpDocumentor, <a href="https://phpdox.net/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">phpDox, ...). <p dir="auto">Also, each Hive method have a <code>@link tag which leads to Hive Developer portal. It's useful when you need more information about parameters or return data. <p dir="auto">To finish with documentation, I fixed some typo errors or bad comments. <p dir="auto">Why I do that? It's simple, just go to the <code>/docs/ folder and you'll see the entire developer documentation for each function in <a href="https://gitlab.syncad.com/hive/hive-php-lib" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link"><strong>Hive-PHP-Lib! <h2>Hive-Engine History integration <p dir="auto">Hive-Engine has two types of nodes: Standard node and History node. In <a href="https://gitlab.syncad.com/hive/hive-php-lib" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link"><strong>Hive-PHP-Lib, we can now interact with the second one. The three methods are implemented: <ul> <li>accountHistory($account, $limit) <li>marketHistory($symbol) <li>nftHistory($nfts, $symbol) <h2>NetworkStatus integration <p dir="auto">Maybe you don't know, but I've a project who checks the Hive-Engine nodes health. It's <a href="https://netstat.hivelive.me/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">NetworkStatus, a small API for developers who need to avoid node errors. Now, you can take the best online node before sending your query. <p dir="auto">What does that have to do with <a href="https://gitlab.syncad.com/hive/hive-php-lib" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link"><strong>Hive-PHP-Lib? It's simple, the API calls are embedded is this library! Write three lines of code, and you get the best online node to interact with Hive-Engine: <pre><code>use Hive\PhpLib\NetStat; $api = new netStat(); $result = $api->getEngineBestNode(); <p dir="auto"><img src="https://images.hive.blog/768x0/https://images.ecency.com/DQmcHBLQwmSrbJyJh96bGVBSmrpeYayF6AwVeXMrGrdbon3/software_developer_6521720_1280.jpg" alt="Developer by Innovalabs" srcset="https://images.hive.blog/768x0/https://images.ecency.com/DQmcHBLQwmSrbJyJh96bGVBSmrpeYayF6AwVeXMrGrdbon3/software_developer_6521720_1280.jpg 1x, https://images.hive.blog/1536x0/https://images.ecency.com/DQmcHBLQwmSrbJyJh96bGVBSmrpeYayF6AwVeXMrGrdbon3/software_developer_6521720_1280.jpg 2x" /> <h2>Code Quality <p dir="auto">To bring the best possible quality, <a href="https://gitlab.syncad.com/hive/hive-php-lib" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link"><strong>Hive-PHP-Lib use static analysis tools. I do my best to follow the PHP Standard Recommendations to create this API. The code must be clear and understandable by every PHP developer. <p dir="auto">To start, I follow <a href="http://php-pds.com/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">PHP-PDS standard filesystem skeleton, and you can check that with the <code>composer pds command. <p dir="auto">About the code, every file is <a href="https://www.php-fig.org/psr/psr-1" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">PSR-1 and <a href="https://www.php-fig.org/psr/psr-12" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">PSR-12 compliant. You can also check that with a command: <code>composer psr <p dir="auto">I implement a <a href="https://psalm.dev/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Psalm config file for those who use this static analysis tool, but it's not the only one! You can also use <code>composer phpstan command to create a <a href="https://phpstan.org/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">PHPStan instant report. <p dir="auto">At this time, I bring Psalm to level 3 and PHPStan to level 5 but the target is to have level 1 for both. <h2>Fixes <p dir="auto">Small features/fixes are also added : <ul> <li>[Feature] Add encodePublicKey() and decodePublicKey() functions <li>[Feature] Add Hive-Engine getRichList() shortcut function <li>[Fix] Hive-engine getBlockInfo() bad type bug <li>[Fix] Default values for config array when not declared by user <li>[Fix] Debug message Display <li>[Fix] Extra slash in NetworkStatus endpoints <li>[Fix] HiveSQL status typo in endpoint <h2>Conclusion <p dir="auto">It's been awhile from the <a href="https://peakd.com/hive-139531/@bambukah/hive-php-lib-update-new" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">last update (Jul 14, 2023) and I hope this one will attract more developers to Hive Blockchain. Before this version, <a href="https://gitlab.syncad.com/hive/hive-php-lib" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link"><strong>Hive-PHP-Lib had more than 150 downloads. <p dir="auto">If you want to support this project and all the <a href="https://hivelive.me/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">HiveLive universe projects: <ul> <li>Upvote and/or reblog this post <li>Comment if you have feedback / question or feature request <li>Please consider to make a <a href="https://stream.hivelive.me/donate/bambukah" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">donation <p dir="auto">Also, if you want to talk with me and many other great members, you can join the official <a href="https://discord.gg/u2qfuaFMwt" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">HiveLive Discord Server <hr /> <p dir="auto">Photo credit : Image by <a href="https://pixabay.com/fr/users/innovalabs-22783312/?utm_source=link-attribution&utm_medium=referral&utm_campaign=image&utm_content=6521720" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Innova Labs from <a href="https://pixabay.com/fr//?utm_source=link-attribution&utm_medium=referral&utm_campaign=image&utm_content=6521720" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Pixabay
Sort:  

Congrats on your development! Will this be used in Superhive?

It's already that :)
I use it for every project I made for Hive!

Great to see you developing on Hive!

Thank you very much. This looks like something I need to help me integrate my Web2 services to Web3 ecosystem. Will explore some more later today.

I'll be back !lol

I went to the doctors to see him about my memory loss.
But I forgot to mention it to him.

Credit: reddit
$LOLZ on behalf of fjworld

(2/10)

PLAY & EARN $DOOM

@bambukah, I sent you an

Really nice project !
!PGM
!LOLZ

How do you fix a damaged jack-o-lantern?
You use a pumpkin patch.

Credit: reddit
$LOLZ on behalf of phanty

(4/10)
Farm LOLZ tokens when you Delegate Hive or Hive Tokens.
Click to delegate: 10 - 20 - 50 - 100 HP@bambukah, I sent you an

Sent 0.1 PGM - 0.1 LVL- 1 STARBITS - 0.05 DEC - 1 SBT - 0.1 THG - 0.000001 SQM - 0.1 BUDS - 0.01 WOO - 0.005 SCRAP tokens

remaining commands 0

BUY AND STAKE THE PGM TO SEND A LOT OF TOKENS!

The tokens that the command sends are: 0.1 PGM-0.1 LVL-0.1 THGAMING-0.05 DEC-15 SBT-1 STARBITS-[0.00000001 BTC (SWAP.BTC) only if you have 2500 PGM in stake or more ]

5000 PGM IN STAKE = 2x rewards!

image.png
Discord image.png

Support the curation account @ pgm-curator with a delegation 10 HP - 50 HP - 100 HP - 500 HP - 1000 HP

Get potential votes from @ pgm-curator by paying in PGM, here is a guide

I'm a bot, if you want a hand ask @ zottone444


💚💪
!WEED

Thank you very much, you are great!

untitled.gif

Yay! 🤗
Your content has been boosted with Ecency Points
Use Ecency daily to boost your growth on platform!

Support Ecency
Vote for new Proposal
Delegate HP and earn more, by @seckorama.

!PGM

Curation par La Principauté du Bastion.

PS: Vous aussi pouvez aider cette curation (@hive-143869) en suivant notre trail ou en déléguant,
si vous choisissez la seconde option, vous recevrez des ECU (token stable) chaque semaine.


ItharaGaian

Sélection Manuelle Principauté du Bastion (@hive-143869 Community)

BlasonPrincipautéBastionTransparentSmall.png

Sent 0.1 PGM - 0.1 LVL- 1 STARBITS - 0.05 DEC - 1 SBT - 0.1 THG - 0.000001 SQM - 0.1 BUDS - 0.01 WOO - 0.005 SCRAP tokens

remaining commands 2

BUY AND STAKE THE PGM TO SEND A LOT OF TOKENS!

The tokens that the command sends are: 0.1 PGM-0.1 LVL-0.1 THGAMING-0.05 DEC-15 SBT-1 STARBITS-[0.00000001 BTC (SWAP.BTC) only if you have 2500 PGM in stake or more ]

5000 PGM IN STAKE = 2x rewards!

image.png
Discord image.png

Support the curation account @ pgm-curator with a delegation 10 HP - 50 HP - 100 HP - 500 HP - 1000 HP

Get potential votes from @ pgm-curator by paying in PGM, here is a guide

I'm a bot, if you want a hand ask @ zottone444


@bambukah!


If you do not want to receive these comments, please reply with !STOP@loonatic passed you the virtual joint!

Congratulations @bambukah! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

<table><tr><td><img src="https://images.hive.blog/60x70/http://hivebuzz.me/@bambukah/upvotes.png?202312122133" /><td>You distributed more than 57000 upvotes.<br />Your next target is to reach 58000 upvotes. <p dir="auto"><sub><em>You can view your badges on <a href="https://hivebuzz.me/@bambukah" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">your board and compare yourself to others in the <a href="https://hivebuzz.me/ranking" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Ranking<br /> <sub><em>If you no longer want to receive notifications, reply to this comment with the word <code>STOP <p dir="auto"><strong>Check out our last posts: <table><tr><td><a href="/hive-122221/@hivebuzz/lpud-202312"><img src="https://images.hive.blog/64x128/https://i.imgur.com/pVZi2Md.png" /><td><a href="/hive-122221/@hivebuzz/lpud-202312">LEO Power Up Day - December 15, 2023