Releases: t3ran13/php-graphene-node-client
Releases · t3ran13/php-graphene-node-client
New commands and bugs fixes
fixed commands:
- BroadcastTransactionCommand
- BroadcastTransactionSynchronousCommand
added commands:
- GetWitnessesByVoteCommand
- GetActiveWitnessesCommand
New API, commands and bug fix
- CommandQueryData.php bug was fixed
- new API
- new commands
new API and commands
login_api
- GetVersionCommand
- LoginCommand
broadcast_api
- BroadcastTransactionCommand
- BroadcastTransactionSynchronousCommand
New APIs and updates
- updated abstract commands classes
- APIs commands updates
- added new Reputation viewer tool
New APIs commands
database_api
- GetAccountCommand
- GetBlockCommand
- GetDynamicGlobalPropertiesCommand
login_api
- GetApiByNameCommand
follow_api
- GetFollowersCommand
New DB commands added
New Database commands was added
- GetDiscussionsByFeedCommand
- GetDiscussionsByTrendingCommand
Data Transfer Object CommandQueryData for all DataBase commands
Changes
- Data Transfer Object CommandQueryData for all DataBase commands
- DataBase commands in own namespace
Basic Usage
<?php
use GrapheneNodeClient\Commands\CommandQueryData;
use GrapheneNodeClient\Commands\DataBase\GetDiscussionsByCreatedCommand;
use GrapheneNodeClient\Connectors\WebSocket\GolosWSConnector;
use GrapheneNodeClient\Connectors\WebSocket\SteemitWSConnector;
//Set params for query
$commandQuery = new CommandQueryData();
$data = [
[
'limit' => $limit,
'select_tags' => ['golos'], // for GOLOS
'tag' => 'steemit', // for STEEMIT
]
];
$commandQuery->setParams($data);
//OR
$commandQuery = new CommandQueryData();
$commandQuery->setParamByKey('0:limit', $limit);
$commandQuery->setParamByKey('0:select_tags', [$tag]);
$commandQuery->setParamByKey('0:tag', $tag);
$command = new GetDiscussionsByCreatedCommand(new GolosWSConnector());
$golosPosts = $command->execute(
$commandQuery
);
// will return
// [
// "id" => 1,
// "result" => [
// [
// "id": 466628,
// "author": "piranya",
// "permlink": "devyatyi-krug",
// ...
// ],
// ...
// ]
// ]
$command = new GetDiscussionsByCreatedCommand(new SteemitWSConnector());
$steemitPosts = $command->execute(
$commandQuery,
'result',
SteemitWSConnector::ANSWER_FORMAT_ARRAY // or SteemitWSConnector::ANSWER_FORMAT_OBJECT
);
// will return
// [
// [
// "id": 466628,
// "author": "piranya",
// "permlink": "devyatyi-krug",
// ...
// ],
// ...
// ]
Transliterator was dded
Tools
Transliterator
<?php
use GrapheneNodeClient\Tools\Transliterator;
//Encode tags
$tag = Transliterator::encode('пол', Transliterator::LANG_RU); // return 'pol';
//Decode tags
$tag = Transliterator::encode('ru--pol', Transliterator::LANG_RU); // return 'пол';
start project
Implemented Commands List
- GetContentCommand
- GetDiscussionsByAuthorBeforeDateCommand
- GetDiscussionsByBlogCommand
- GetDiscussionsByCreatedCommand
- GetTrendingCategoriesCommand
Implemented Connectors List
- GolosWSConnector (wss://ws.golos.io)
- SteemitWSConnector (wss://ws.steemit.com)