It is PHP API client for Steem/GOLOS/VIZ blockchain
Github or packagist with MIT license. Author @t3ran13 and active contributor
@semasping
It was crashed when connestor was not opened and tried to be closed. It is fixed now with additional checking.
There is easy way to check you Bandwidth before make transaction now:
<?php
use GrapheneNodeClient\Connectors\Http\SteemitHttpConnector;
use GrapheneNodeClient\Commands\CommandQueryData;
use GrapheneNodeClient\Tools\Bandwidth;
use GrapheneNodeClient\Tools\Transaction;
$connector = new SteemitHttpConnector();
/** @var CommandQueryData $tx */
$tx = Transaction::init($connector, 'PT4M');
$tx->setParamByKey(
'0:operations:0',
[
'vote',
[
'voter' => $voter,
'author' => $author,
'permlink' => $permlink,
'weight' => $weight
]
]
);
$command = new BroadcastTransactionSynchronousCommand($connector);
Transaction::sign($chainName, $tx, ['posting' => $publicWif]);
$trxString = mb_strlen(json_encode($tx->getParams()), '8bit');
if (Bandwidth::isEnough($connector, $voter, 'market', $trxString)) {
$answer = $command->execute(
$tx
);
}
It was updated for json sending to node with JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES flags according to Steem/GOLOS/VIZ blockchains rules.
It is mean that slashes and unicode symbols have not to be unescaped.
It can serialize strings with length up to 16kk, it was 16k before.
The parameter $parentPermlink is required now in OpComment class-helper, it is rule for STEEM/GOLOS blockchains.
It was modified for more convenience, there are own class *Api Methods for each blockchain.
VIZ is one more graphene blochchain, it is GOLOS fork. More details viz.world or https://t.me/viz_world
It is availible working with VIZ blockchain, methods were added:
New types were added for serializer:
It gives possibility for adding beneficiaries to posts.
It is availible next broadcast operations for VIZ blockchain
$connector = new VizWSConnector();
$answer = OpContent::doSynchronous(
$connector,
'5_private_posting_key', //VIZ
'guest123',
strtolower(str_replace(' ', '-', Transliterator::encode(mb_strtolower($title2, 'utf-8'), Transliterator::LANG_RU))),
$title2,
$body,
json_encode(['tags' => ['test']], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES), //meta
9000, //$curationPercent only for VIZ
[], //[['account' => 'php-node-client', 'weight' => 9000]], //$beneficiaries only for VIZ
'',
''
);
$answer = OpVote::doSynchronous(
$connector,
'guest123',//voter
// '5_private_posting_key', //viz
'volv',//author
'tikhaya-okhota-otkrytie-sezona-1539526902',//post
10000//weght
);
$answer = OpTransfer::doSynchronous(
$connector,
'5_active_private_key',
'guest123',//from
'php-node-client',//to
'0.010 SBD',//amount
'test php transfer'//memo
);
It is better with each commit
Commits were done by me in master branch
Compare v5.0.1-v5.1.0