create account

Hive-PHP - A real PHP library for Hive by mahdiyari

View this thread on: hive.blogpeakd.comecency.com
· @mahdiyari · (edited)
$717.48
Hive-PHP - A real PHP library for Hive
<center>![mugs-hive.png](https://files.peakd.com/file/peakd-hive/mahdiyari/23wC1ZxrRS6LyojwUDQp45BLcjrcuFXSybyB3FVSdhKD4voCnu1ctuaQvWVpdyZFwKZbF.png)
</center>

# Hive-PHP

This one took a while despite having some demand from PHP developers. But it is finally here.

The serialization and signing are done natively on PHP. Every line of code has been written by me.

I did not test all the operations but all the operations should work. Please do test if you can and let me know if there are any problems.

The documentation is available on both gitlab and packagist. But for the sake of keeping them on blockchain will put them here too.
***

### Installation
```
composer require mahdiyari/hive-php
```

### Initialization
```
$hive = new Hive($options?);
```

Example:
```
include 'vendor/autoload.php';

use Hive\Hive;

$hive = new Hive();

// or

// default options - these are already configured
$options = array(
  'rpcNodes'=> [
    'https://api.hive.blog',
    'https://rpc.ausbit.dev',
    'https://rpc.ecency.com',
    'https://api.pharesim.me',
    'https://api.deathwing.me'
  ],
  'chainId'=> 'beeab0de00000000000000000000000000000000000000000000000000000000',
  'timeout'=> 7
);
// Will try the next node after 7 seconds of waiting for response
// Or on a network failure

$hive = new Hive($options);
```

### Usage

### API calls:
```
$hive->call($method, $params);
```

Example:
```
$result = $hive->call('condenser_api.get_accounts', '[["mahdiyari"]]');
// returns the result as an array
echo $result[0]['name']; // "mahdiyari"
echo $result[0]['hbd_balance']; // "123456.000 HBD"
```

### Private Key:
```
$hive->privateKeyFrom($string);
$hive->privateKeyFromLogin($username, $password, $role);
```

Example:
```
$privateKey = $hive->privateKeyFrom('5JRaypasxMx1L97ZUX7YuC5Psb5EAbF821kkAGtBj7xCJFQcbLg');
// or
$privateKey = $hive->privateKeyFromLogin('username', 'hive password', 'role');
// role: "posting" or "active" or etc
echo $privateKey->stringKey; // 5JRaypasxMx1L97ZUX7YuC5Psb5EAbF821kkAGtBj7xCJFQcbLg
```

### Public Key:
```
$hive->publicKeyFrom($string);
$privateKey->createPublic()
```

Example:
```
$publicKey = $hive->publicKeyFrom('STM6aGPtxMUGnTPfKLSxdwCHbximSJxzrRjeQmwRW9BRCdrFotKLs');
// or
$publicKey = $privateKey->createPublic();


echo $publicKey->toString(); // STM6aGPtxMUGnTPfKLSxdwCHbximSJxzrRjeQmwRW9BRCdrFotKLs
```

### Signing
```
$privateKey->sign($hash256);
```

Example:
```
$message = hash('sha256', 'My super cool message to be signed');
$signature = $privateKey->sign($message);
echo $signature;
// 1f8e46aa5cbc215f82119e172e3dd73396ad0d2231619d3d71688eff73f2b83474084eb970955d1f1f9c2a7281681d138ca49fe90ac58bf069549afe961685d932
```

### Verifying
```
$publicKey->verify($hash256, $signature);
```

Example:
```
$verified = $publicKey->verify($message, $signature);
var_dump($verified); // bool(true)
```

### Transactions
There are two ways to broadcast a transaction.

#### Manual broadcast

Example:
```
$vote = new stdClass;
$vote->voter = 'guest123';
$vote->author = 'blocktrades';
$vote->permlink = '11th-update-of-2022-on-blocktrades-work-on-hive-software';
$vote->weight = 5000;
$op = array("vote", $vote);

// transaction built
$trx = $hive->createTransaction([$op]);

// transaction signed
$hive->signTransaction($trx, $privateKey);

// will return trx_id on success
$result = $hive->broadcastTransaction($trx);
var_dump($result);
// array(1) {
//   'trx_id' =>
//   string(40) "2062bb47ed0c4c001843058129470fe5a8211735"
// }
```

#### Inline broadcast

Example:
```
$result = $hive->broadcast($privateKey, 'vote', ['guest123', 'blocktrades', '11th-update-of-2022-on-blocktrades-work-on-hive-software', 5000]);
var_dump($result);
// array(1) {
//   'trx_id' =>
//   string(40) "2062bb47ed0c4c001843058129470fe5a8211735"
// }
```

### Notes for Transactions
Operations are in the following format when broadcasting manually:
```
array('operation_name', object(operation_params))
```

example:
```
$vote = new stdClass;
$vote->voter = 'guest123';
$vote->author = 'blocktrades';
$vote->permlink = '11th-update-of-2022-on-blocktrades-work-on-hive-software';
$vote->weight = 5000;

$op = array("vote", $vote);
```

Any parameter in opreation that is JSON (not to be confused with json strings), should be passed as an object.

Example:

The `beneficiaries` field in `comment_options` is in JSON format like this:
```
$beneficiaries = '[0, {"beneficiaries": [{"account": "mahdiyari","weight": 10000}]}]';
```
We should convert that into an object.
```
$beneficiaries = json_decode($beneficiaries);
```
(beneficiaries go inside the extensions)
```
$result = $hive->broadcast($privateKey, 'comment_options', ['author', 'permlink', '1000000.000 HBD', 10000, true, true, [$beneficiaries]]);
```
***
### How to know the operation parameters
Easiest way is to find the operation on a block explorer.

e.g. https://hiveblocks.com/tx/2062bb47ed0c4c001843058129470fe5a8211735

You can also search the operation in `/lib/Helpers/Serializer.php` to get an idea of what parameters it requires.

***
### Any missing features?
Create an issue or reach out to me.

***
### License
MIT


***
I hope PHP developers enjoy this and get away from the "hacks" they used so far to interact with Hive blockchain.


Composer package: https://packagist.org/packages/mahdiyari/hive-php
Gitlab repository: https://gitlab.com/mahdiyari/hive-php
***

Almost forgot the bonus content!
<center>![cute-kitten.jpg](https://files.peakd.com/file/peakd-hive/mahdiyari/23u69hbZXgiGLqYX8oRkxmTH1CFYbSFSZfNfTABRG8u349MPiZi6j3GrsJwM1kUyDhAfP.jpg)</center>
<sub>Made with ❤️ by @mahdiyari</sub>
<sub>Image source: pixabay.com</sub>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 752 others
👎  , , , , , ,
properties (23)
authormahdiyari
permlinkhive-php-a-real-php-library-for-hive
categoryhive-139531
json_metadata{"app":"peakd/2022.07.1","format":"markdown","tags":["hive-php","php","hive","dev","library"],"users":["mahdiyari"],"image":["https://files.peakd.com/file/peakd-hive/mahdiyari/23wC1ZxrRS6LyojwUDQp45BLcjrcuFXSybyB3FVSdhKD4voCnu1ctuaQvWVpdyZFwKZbF.png","https://files.peakd.com/file/peakd-hive/mahdiyari/23u69hbZXgiGLqYX8oRkxmTH1CFYbSFSZfNfTABRG8u349MPiZi6j3GrsJwM1kUyDhAfP.jpg"]}
created2022-07-26 18:47:03
last_update2022-07-26 19:35:15
depth0
children31
last_payout2022-08-02 18:47:03
cashout_time1969-12-31 23:59:59
total_payout_value358.855 HBD
curator_payout_value358.622 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length5,652
author_reputation199,864,818,197,856
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,182,781
net_rshares902,943,648,081,685
author_curate_reward""
vote details (823)
@ackza ·
Lol is the php elephant related to India?
properties (22)
authorackza
permlinkrfs6l1
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2022-07-29 11:58:18
last_update2022-07-29 11:58:18
depth1
children1
last_payout2022-08-05 11:58:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length41
author_reputation288,294,301,233,384
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd0
post_id115,256,682
net_rshares0
@mahdiyari ·
https://docs.php.earth/php/community/elephpant/
properties (22)
authormahdiyari
permlinkrfs6sc
categoryhive-139531
json_metadata{"links":["https://docs.php.earth/php/community/elephpant/"],"app":"hiveblog/0.1"}
created2022-07-29 12:03:15
last_update2022-07-29 12:03:15
depth2
children0
last_payout2022-08-05 12:03:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length47
author_reputation199,864,818,197,856
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,256,809
net_rshares0
@azamsohrabi ·
Hello good time. Dear friend, is it possible to talk to you on WhatsApp or Telegram? Or should I have a contact number?
properties (22)
authorazamsohrabi
permlinkrg336p
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2022-08-04 09:18:30
last_update2022-08-04 09:18:30
depth1
children1
last_payout2022-08-11 09:18:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length119
author_reputation136,290,973,435,922
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,421,081
net_rshares0
@mahdiyari ·
telegram @mahdi_Edw
properties (22)
authormahdiyari
permlinkrg33d4
categoryhive-139531
json_metadata{"users":["mahdi"],"app":"hiveblog/0.1"}
created2022-08-04 09:23:00
last_update2022-08-04 09:23:00
depth2
children0
last_payout2022-08-11 09:23:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length19
author_reputation199,864,818,197,856
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,421,174
net_rshares0
@cryptosimplify ·
$0.52
That is nice.

Currently, I am working on @hiveland.dapp that uses PHP. In this project we don't need to interact with Hive but we need to interact with Hive Engine and in the beginning it was hard because I needed to implement all the interactions with a Hive Engine node that we need.

It is nice to see some "libraries" be implemented on PHP and other langaunge to help developers to interact with our ecosystem.
👍  ,
properties (23)
authorcryptosimplify
permlinkre-mahdiyari-2022727t103938909z
categoryhive-139531
json_metadata{"tags":["hive-php","php","hive","dev","library"],"app":"ecency/3.0.24-vision","format":"markdown+html"}
created2022-07-27 09:39:39
last_update2022-07-27 09:39:39
depth1
children0
last_payout2022-08-03 09:39:39
cashout_time1969-12-31 23:59:59
total_payout_value0.259 HBD
curator_payout_value0.259 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length415
author_reputation228,708,106,907,016
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,200,385
net_rshares656,626,804,378
author_curate_reward""
vote details (2)
@destampid ·
I didn’t understand a thing but the cat deserve a lovelly Up 💓
properties (22)
authordestampid
permlinkrfoxf6
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2022-07-27 17:47:30
last_update2022-07-27 17:47:30
depth1
children0
last_payout2022-08-03 17:47:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length62
author_reputation36,275,177
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,210,337
net_rshares0
@ecency ·
Your content has been **voted** as a part of [Encouragement program](https://ecency.com/ecency/@good-karma/encouragement-program-continues-82eafcd10a299). Keep up the good work! <br><br>Use Ecency daily to boost your growth on platform! <br><br><b>Support Ecency</b><br>[Vote for new Proposal](https://hivesigner.com/sign/update-proposal-votes?proposal_ids=%5B197%5D&approve=true)<br>[Delegate HP and earn more](https://ecency.com/hive-125125/@ecency/daily-100-curation-rewards)
properties (22)
authorecency
permlinkre-2022726t221833628z
categoryhive-139531
json_metadata{"tags":["ecency"],"app":"ecency/3.0.20-welcome","format":"markdown+html"}
created2022-07-26 22:18:33
last_update2022-07-26 22:18:33
depth1
children0
last_payout2022-08-02 22:18:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length478
author_reputation630,684,164,727,799
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,188,565
net_rshares0
@emeka4 ·
$0.54
This definitely have a lot of work been put into it which is awesome. Keep up the good work progressing.
👍  
properties (23)
authoremeka4
permlinkrfn8y5
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2022-07-26 20:01:24
last_update2022-07-26 20:01:24
depth1
children0
last_payout2022-08-02 20:01:24
cashout_time1969-12-31 23:59:59
total_payout_value0.271 HBD
curator_payout_value0.272 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length104
author_reputation235,996,715,737,750
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,184,493
net_rshares685,799,081,702
author_curate_reward""
vote details (1)
@ernestoacostame ·
Awesome!!
properties (22)
authorernestoacostame
permlinkre-mahdiyari-2022729t5272862z
categoryhive-139531
json_metadata{"tags":["hive-php","php","hive","dev","library"],"app":"ecency/3.0.24-vision","format":"markdown+html"}
created2022-07-29 10:27:03
last_update2022-07-29 10:27:03
depth1
children0
last_payout2022-08-05 10:27:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length9
author_reputation3,155,138,401,230
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,255,113
net_rshares0
@fernandosoder ·
LOVED IT!
properties (22)
authorfernandosoder
permlinkre-mahdiyari-2022727t143527950z
categoryhive-139531
json_metadata{"tags":["hive-php","php","hive","dev","library"],"app":"ecency/3.0.24-vision","format":"markdown+html"}
created2022-07-27 17:35:27
last_update2022-07-27 17:35:27
depth1
children0
last_payout2022-08-03 17:35:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length9
author_reputation43,445,761,642,126
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,210,055
net_rshares0
@hivebuzz ·
Congratulations @mahdiyari! Your post has been a top performer on the Hive blockchain and you have been rewarded with the following badge:

<table><tr><td><img src="https://images.hive.blog/60x60/http://hivebuzz.me/badges/toppayoutday.png"></td><td>Post with the highest payout of the day.</td></tr>
</table>

<sub>_You can view your badges on [your board](https://hivebuzz.me/@mahdiyari) and compare yourself to others in the [Ranking](https://hivebuzz.me/ranking)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>



###### Support the HiveBuzz project. [Vote](https://hivesigner.com/sign/update_proposal_votes?proposal_ids=%5B%22199%22%5D&approve=true) for [our proposal](https://peakd.com/me/proposals/199)!
properties (22)
authorhivebuzz
permlinknotify-mahdiyari-20220727t014352
categoryhive-139531
json_metadata{"image":["http://hivebuzz.me/notify.t6.png"]}
created2022-07-27 01:43:54
last_update2022-07-27 01:43:54
depth1
children0
last_payout2022-08-03 01:43:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length772
author_reputation369,406,393,785,611
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,192,883
net_rshares0
@hivebuzz ·
Congratulations @mahdiyari! Your post has been a top performer on the Hive blockchain and you have been rewarded with the following badge:

<table><tr><td><img src="https://images.hive.blog/60x60/http://hivebuzz.me/badges/toppayoutweek.png"></td><td>Post with the highest payout of the week.</td></tr>
</table>

<sub>_You can view your badges on [your board](https://hivebuzz.me/@mahdiyari) and compare yourself to others in the [Ranking](https://hivebuzz.me/ranking)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>



**Check out the last post from @hivebuzz:**
<table><tr><td><a href="/hive-122221/@hivebuzz/pum-202208"><img src="https://images.hive.blog/64x128/https://i.imgur.com/M9RD8KS.png"></a></td><td><a href="/hive-122221/@hivebuzz/pum-202208">The 8th edition of the Hive Power Up Month starts today!</a></td></tr><tr><td><a href="/hive-122221/@hivebuzz/pud-202208"><img src="https://images.hive.blog/64x128/https://i.imgur.com/805FIIt.jpg"></a></td><td><a href="/hive-122221/@hivebuzz/pud-202208">Hive Power Up Day - August 1st 2022</a></td></tr></table>

###### Support the HiveBuzz project. [Vote](https://hivesigner.com/sign/update_proposal_votes?proposal_ids=%5B%22199%22%5D&approve=true) for [our proposal](https://peakd.com/me/proposals/199)!
properties (22)
authorhivebuzz
permlinknotify-mahdiyari-20220801t005140
categoryhive-139531
json_metadata{"image":["http://hivebuzz.me/notify.t6.png"]}
created2022-08-01 00:51:27
last_update2022-08-01 00:51:27
depth1
children0
last_payout2022-08-08 00:51:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,322
author_reputation369,406,393,785,611
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,323,297
net_rshares0
@immanuel94 ·
Amazing work, thank you! This will help a lot! 👍
properties (22)
authorimmanuel94
permlinkrfq81y
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2022-07-28 10:34:48
last_update2022-07-28 10:34:48
depth1
children0
last_payout2022-08-04 10:34:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length48
author_reputation212,637,383,853,137
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,227,838
net_rshares0
@innerwebbp ·
$0.70
OMG THANKK YOU THANK YOU!!! This is SO GREAT!!! ❤️💛💚💙💜❣️

I just updated my post about verifying signatures in php to point here to your post!!! This is so much better and cleaner if you can install ext-gmp!!! This is so GREAT!!! Thank you again!!!

https://peakd.com/stem/@innerwebbp/solved-php-native-hive-signature-validation-and-the-hivewordpress-sso-single-sign-on
👍  , ,
properties (23)
authorinnerwebbp
permlinkre-mahdiyari-rfnqmn
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2022.07.1"}
created2022-07-27 02:23:15
last_update2022-07-27 02:23:15
depth1
children0
last_payout2022-08-03 02:23:15
cashout_time1969-12-31 23:59:59
total_payout_value0.348 HBD
curator_payout_value0.347 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length370
author_reputation6,494,489,522,266
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,193,510
net_rshares870,120,029,710
author_curate_reward""
vote details (3)
@ismaelrd04 ·
Wooooooow, this is very wonderful buddy. I love you work and the cat
properties (22)
authorismaelrd04
permlinkre-mahdiyari-2022727t202724972z
categoryhive-139531
json_metadata{"tags":["hive-php","php","hive","dev","library"],"app":"ecency/3.0.24-vision","format":"markdown+html"}
created2022-07-28 01:22:42
last_update2022-07-28 01:22:42
depth1
children0
last_payout2022-08-04 01:22:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length68
author_reputation166,904,945,553,366
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,219,581
net_rshares0
@itsostylish ·
$0.62
Oh, wow, now, that was a lot of work, but you can expect devs to storm Hive. There are so many PHP devs
👍  ,
properties (23)
authoritsostylish
permlinkre-mahdiyari-2022726t22758446z
categoryhive-139531
json_metadata{"tags":["hive-139531","hive-php","php","hive","dev","library"],"app":"ecency/3.0.30-mobile","format":"markdown+html"}
created2022-07-26 20:08:00
last_update2022-07-26 20:08:00
depth1
children1
last_payout2022-08-02 20:08:00
cashout_time1969-12-31 23:59:59
total_payout_value0.308 HBD
curator_payout_value0.307 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length103
author_reputation165,430,880,286,048
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,184,697
net_rshares777,224,195,174
author_curate_reward""
vote details (2)
@ackza ·
And build what? Everything on hive all the dapps...they come snd they go...its like the steemit dot com effect... we need one large stakeholder who is famous to give out huge upvotes to make this work again
properties (22)
authorackza
permlinkrfs6ng
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2022-07-29 11:59:45
last_update2022-07-29 11:59:45
depth2
children0
last_payout2022-08-05 11:59:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length206
author_reputation288,294,301,233,384
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd0
post_id115,256,705
net_rshares0
@katirayo ·
This is very beautiful, I love your work and too be honest, I wish you could teach me this beautiful hand work of yours it will be a Honor to receive teachings from you.
properties (22)
authorkatirayo
permlinkre-mahdiyari-rfqv4s
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2022.07.1"}
created2022-07-28 18:53:36
last_update2022-07-28 18:53:36
depth1
children0
last_payout2022-08-04 18:53:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length169
author_reputation19,476,347,900,657
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,238,577
net_rshares0
@mireyalara ·
$0.43
Wow! This is a great work. Thanks for sharing it here. 
👍  
properties (23)
authormireyalara
permlinkre-mahdiyari-2022727t6224499z
categoryhive-139531
json_metadata{"tags":["hive-139531","hive-php","php","hive","dev","library"],"app":"ecency/3.0.30-mobile","format":"markdown+html"}
created2022-07-27 11:02:21
last_update2022-07-27 11:02:21
depth1
children0
last_payout2022-08-03 11:02:21
cashout_time1969-12-31 23:59:59
total_payout_value0.216 HBD
curator_payout_value0.215 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length55
author_reputation7,607,902,438,816
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,201,625
net_rshares544,651,024,435
author_curate_reward""
vote details (1)
@poshtoken · (edited)
https://twitter.com/MahdiYari4/status/1552007676242034689
https://twitter.com/YanPatrick_/status/1552036131616821249
<sub> The rewards earned on this comment will go directly to the people( @mahdiyari, @shiftrox ) sharing the post on Twitter as long as they are registered with @poshtoken. Sign up at https://hiveposh.com.</sub>
👍  , , , , , , , , , ,
properties (23)
authorposhtoken
permlinkre-mahdiyari-hive-php-a-real-php-library-for-hive65016
categoryhive-139531
json_metadata"{"app":"Poshtoken 0.0.1","payoutToUser":["mahdiyari","shiftrox"]}"
created2022-07-26 19:09:03
last_update2022-07-26 21:02:03
depth1
children0
last_payout2022-08-02 19:09:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length329
author_reputation5,736,167,770,478,202
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries
0.
accountreward.app
weight10,000
max_accepted_payout1,000,000.000 HBD
percent_hbd0
post_id115,183,118
net_rshares0
author_curate_reward""
vote details (11)
@reanbooks ·
$0.08
as a beginner doing activities in hive, i have to study this more deeply because it is very important to develop writing performance in hive. Growth in the hive is my goal and the unknown ways will always be learned. thank you friend this is very useful for me.
👍  
properties (23)
authorreanbooks
permlinkrfrgo9
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2022-07-29 02:38:39
last_update2022-07-29 02:38:39
depth1
children0
last_payout2022-08-05 02:38:39
cashout_time1969-12-31 23:59:59
total_payout_value0.041 HBD
curator_payout_value0.042 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length261
author_reputation1,181,982,320,337
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,247,693
net_rshares109,781,647,717
author_curate_reward""
vote details (1)
@silviafx ·
Wow. This is so much effort put into one piece. Well done @mahdiyari 
properties (22)
authorsilviafx
permlinkre-mahdiyari-rgb20q
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2022.07.1"}
created2022-08-08 16:34:03
last_update2022-08-08 16:34:03
depth1
children0
last_payout2022-08-15 16:34:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length69
author_reputation6,431,345,769,811
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,546,505
net_rshares0
@sora-hara ·
Hello.
I am using your library in my project. Does my project need delegation. I tried $hive->broadcast($privateKey ...) for delegation and it didn't work when Amount delegation > 10000 VEST. The error I get is: missing required active authority:Missing Active Authority sora-haraTransaction failed to validate using both new (hf26) and legacy serialization. The key I use is Active Key private. Can you share with me why? Thank you.
properties (22)
authorsora-hara
permlinkrl6bew
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2022-11-11 07:56:57
last_update2022-11-11 07:56:57
depth1
children6
last_payout2022-11-18 07:56:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length433
author_reputation152,158,138
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries
0.
accounthiveonboard
weight100
1.
accountocdb
weight100
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,244,240
net_rshares0
@mahdiyari ·
That error can be because of wrong parameters of the transaction. Send me the full code.
👍  
properties (23)
authormahdiyari
permlinkrl6do6
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2022-11-11 08:45:45
last_update2022-11-11 08:45:45
depth2
children5
last_payout2022-11-18 08:45:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length88
author_reputation199,864,818,197,856
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,244,840
net_rshares151,685,643
author_curate_reward""
vote details (1)
@sora-hara · (edited)
Thanks for your answer. This is my code. 
$ops = [
		"sora-hara",
		"tuanbh",
		"5000.000000 VESTS"
	];
	$hive = new Hive();
	// create Obj privateKey
	$key = $hive->privateKeyFrom(HIVE_DELEGATION_KEY);
	// call API
	$request = $hive->broadcast($key, 'delegate_vesting_shares', $ops);
It succeeds when VEST = 2000. AND >= 5000 then error.
properties (22)
authorsora-hara
permlinkrl6ek1
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2022-11-11 09:04:48
last_update2022-11-11 09:05:36
depth3
children0
last_payout2022-11-18 09:04:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length338
author_reputation152,158,138
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries
0.
accounthiveonboard
weight100
1.
accountocdb
weight100
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,245,147
net_rshares0
@sora-hara ·
I checked with the js library that the sign function to create a signature is giving a different value than your library when putting in the same Transaction. But I can't tell where it's coming from because the encryption libraries of the 2 are different. You code you are correct. Can you give me more information about the sign signature? Version of the library that is associated with it.
properties (22)
authorsora-hara
permlinkrl6jqc
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2022-11-11 10:56:36
last_update2022-11-11 10:56:36
depth3
children3
last_payout2022-11-18 10:56:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length391
author_reputation152,158,138
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries
0.
accounthiveonboard
weight100
1.
accountocdb
weight100
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,246,971
net_rshares0
@szejq ·
Hellow @mahdiyari 
I test signing account_update2 but i keep getting 🙂

```
Fatal error: Uncaught TypeError: property_exists(): Argument #2 ($property) must be of type string, stdClass given in vendor/mahdiyari/hive-php/lib/Helpers/Serializer.php:43
```


```
	    $hive = new Hive();
            #hive settings
            $privateKey = $hive->privateKeyFrom(pass(1)[1]);
            $account_update2 = new stdClass;
            $account_update2->account = ''.pass(1)[0].'';
            $account_update2->json_metadata = '';
            $account_update2->posting_json_metadata = '{"profile":{"about":"'.$text.'","version":2}}';
            $account_update2->extensions = array();
            $op = array("account_update2", $account_update2);
    
            // transaction built
            $trx = $hive->createTransaction([$op]);
    
            // transaction signed
            $hive->signTransaction($trx, $privateKey);
    
            // will return trx_id on success
            return $hive->broadcastTransaction($trx);
```

After modifying Serializer.php I can sign it properly. But this workaround is not good practice, I want to keep your original code. I have PHP 8.1

```
        if($serializer[0] == 'optional') {
          $valueSerializer = $serializer[1];
          if (false) {
            $this->Int8Serializer($buffer, 1);
            $this->$valueSerializer($buffer, $data->$param);
          } else {
            $this->Int8Serializer($buffer, 0);
          }
```

Your original code

```
        if($serializer[0] == 'optional') {
          $valueSerializer = $serializer[1];
          if (\property_exists($param, $data)) {
            $this->Int8Serializer($buffer, 1);
            $this->$valueSerializer($buffer, $data->$param);
          } else {
            $this->Int8Serializer($buffer, 0);
          }
```

Is my query incorrect that this error occurs?
Do I have to provide these parameters, if so, what form is correct? I tried different options and I keep getting the same error.

```
        ['owner', ['optional', 'AuthoritySerializer']],
        ['active', ['optional', 'AuthoritySerializer']],
        ['posting', ['optional', 'AuthoritySerializer']],
        ['memo_key', ['optional', 'PublicKeySerializer']],
```

Thank you for your help 😊
properties (22)
authorszejq
permlinkre-mahdiyari-s06a5j
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2023.7.1"}
created2023-08-29 21:53:42
last_update2023-08-29 21:53:42
depth1
children0
last_payout2023-09-05 21:53:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,282
author_reputation140,010,706,526,845
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id126,705,700
net_rshares0
@vaitengewon ·
Hello @mahdiyari 
I don't know how much time you put into this work, but it is certainly very valuable. 
Thanks for sharing. 
properties (22)
authorvaitengewon
permlinkre-mahdiyari-2022727t23445723z
categoryhive-139531
json_metadata{"tags":["hive-139531","hive-php","php","hive","dev","library"],"app":"ecency/3.0.32-mobile","format":"markdown+html"}
created2022-07-28 04:04:45
last_update2022-07-28 04:04:45
depth1
children0
last_payout2022-08-04 04:04:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length125
author_reputation671,433,234,685
root_title"Hive-PHP - A real PHP library for Hive"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,222,181
net_rshares0