Adding Sponsors Class to PHP Client of Utopian API

The project PHP Client of Utopian API wraps the Utopian APIs and yesterday, the sub class Moderators has been added to the project, see Adding Moderator Class to PHP Client of Utopian API. Today, Sponsors have been added to the project so it is now very convenient to know, with a few lines of code, for example, the list of sponsors that are also witnesses or who opt-out receiving steem payout.

PHP Client of Utopian API

  • What is the project about?
    The project is to wrap the public utopian APIs in PHP Class. I have seen @emrebeyler 's contribution on Python client, so I think it is a good idea to provide a PHP implementation.

  • Technology Stack
    PHP 7.0

  • Roadmap
    The next release will be adding more unit tests and more other advance API wrappers such as statistics helpers.

  • How to contribute?
    Github: https://github.com/DoctorLai/utopian-api-php-client

    1. Fork it!
    2. Create your feature branch: git checkout -b my-new-feature
    3. Commit your changes: git commit -am 'Add some feature'
    4. Push to the branch: git push origin my-new-feature
    5. Submit a pull request :D

This Commits

Reload the Data (Sponsors)

This will re-fetch the data from Utopian API.

$sponsors->Reload();

Raw Data (Sponsors)

$sponsors->GetRawData();

Get a list of Sponsors

print_r($sponsors->GetList());

Get Total Number of sponsors

echo "there are " . $sponsors->GetTotal() . " sponsors.";

Find a Sponsor

$ned = $sponsors->GetSponsor('ned');
print_r($ned);

Get Total Paid Rewards

echo "Total Paid Rewards: " . $sponsors->GetTotalPaidRewards();

Get Total of should_receive_rewards

echo "Should Receive Total: " . $sponsors->GetShouldReceiveRewards();

Get Total Sum of total_paid_rewards_steem

echo "Steem: " . $sponsors->GetTotalPaidRewardsSteem();

Get Total Vesting by all sponsors

echo "Total Vesting by all sponsors: " . $sponsors->GetTotalVesting();

Get a list of Witnesses

foreach ($sponsors->GetListOfWitness() as $acc) {
   echo "Witness: " . $acc;
}

Get Total of paid-rewards-steem

echo "Total Paid Rewards Steem: " . $sponsors->GetTotalPaidRewardsSteem();

Get a list of Opted-out sponsors

foreach ($sponsors->GetListOfOptedOutSponsors() as $acc) {
   echo "Opted_out: " . $acc;
}



Posted on Utopian.io - Rewarding Open Source Contributors

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Logo
Center