Skip to content

Latest commit

 

History

History
383 lines (266 loc) · 13.8 KB

RewardsApi.md

File metadata and controls

383 lines (266 loc) · 13.8 KB

Bzzhh\Tzkt\RewardsApi

All URIs are relative to https://api.tzkt.io, except if the operation defines another base path.

Method HTTP request Description
rewardsGetBakerRewards() GET /v1/rewards/bakers/{address} Get baker cycle rewards
rewardsGetBakerRewardsCount() GET /v1/rewards/bakers/{address}/count Get baker cycle rewards count
rewardsGetDelegatorRewards() GET /v1/rewards/delegators/{address} Get delegator cycle rewards
rewardsGetDelegatorRewardsCount() GET /v1/rewards/delegators/{address}/count Get delegator cycle rewards count
rewardsGetRewardSplit() GET /v1/rewards/split/{baker}/{cycle} Get reward split
rewardsGetRewardSplitDelegator() GET /v1/rewards/split/{baker}/{cycle}/{delegator} Get reward split delegator

rewardsGetBakerRewards()

rewardsGetBakerRewards($address, $cycle, $select, $sort, $offset, $limit, $quote): \Bzzhh\Tzkt\Model\BakerRewards[]

Get baker cycle rewards

Returns a list of baker rewards for every cycle, including future cycles.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new Bzzhh\Tzkt\Api\RewardsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$address = 'address_example'; // string | Baker address.
$cycle = new \Bzzhh\Tzkt\Model\AccountsGetIdParameter(); // AccountsGetIdParameter | Filters rewards by cycle.
$select = new \Bzzhh\Tzkt\Model\AccountsGetSelectParameter(); // AccountsGetSelectParameter | Specify comma-separated list of fields to include into response or leave it undefined to return full object. If you select single field, response will be an array of values in both `.fields` and `.values` modes.
$sort = new \Bzzhh\Tzkt\Model\AccountsGetSortParameter(); // AccountsGetSortParameter | Sorts cycle rewards by specified field. Supported fields: `cycle` (default, desc).
$offset = new \Bzzhh\Tzkt\Model\AccountsGetOffsetParameter(); // AccountsGetOffsetParameter | Specifies which or how many items should be skipped
$limit = 100; // int | Maximum number of items to return
$quote = new \Bzzhh\Tzkt\Model\AccountsGetOperationsQuoteParameter(); // AccountsGetOperationsQuoteParameter | Comma-separated list of ticker symbols to inject historical prices into response

try {
    $result = $apiInstance->rewardsGetBakerRewards($address, $cycle, $select, $sort, $offset, $limit, $quote);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling RewardsApi->rewardsGetBakerRewards: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
address string Baker address.
cycle AccountsGetIdParameter Filters rewards by cycle. [optional]
select AccountsGetSelectParameter Specify comma-separated list of fields to include into response or leave it undefined to return full object. If you select single field, response will be an array of values in both `.fields` and `.values` modes. [optional]
sort AccountsGetSortParameter Sorts cycle rewards by specified field. Supported fields: `cycle` (default, desc). [optional]
offset AccountsGetOffsetParameter Specifies which or how many items should be skipped [optional]
limit int Maximum number of items to return [optional] [default to 100]
quote AccountsGetOperationsQuoteParameter Comma-separated list of ticker symbols to inject historical prices into response [optional]

Return type

\Bzzhh\Tzkt\Model\BakerRewards[]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

rewardsGetBakerRewardsCount()

rewardsGetBakerRewardsCount($address): int

Get baker cycle rewards count

Returns total number of cycles where the baker was active

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new Bzzhh\Tzkt\Api\RewardsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$address = 'address_example'; // string | Baker address

try {
    $result = $apiInstance->rewardsGetBakerRewardsCount($address);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling RewardsApi->rewardsGetBakerRewardsCount: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
address string Baker address

Return type

int

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

rewardsGetDelegatorRewards()

rewardsGetDelegatorRewards($address, $cycle, $select, $sort, $offset, $limit, $quote): \Bzzhh\Tzkt\Model\DelegatorRewards[]

Get delegator cycle rewards

Returns a list of delegator rewards for every cycle, including future cycles.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new Bzzhh\Tzkt\Api\RewardsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$address = 'address_example'; // string | Delegator address.
$cycle = new \Bzzhh\Tzkt\Model\AccountsGetIdParameter(); // AccountsGetIdParameter | Filters rewards by cycle.
$select = new \Bzzhh\Tzkt\Model\AccountsGetSelectParameter(); // AccountsGetSelectParameter | Specify comma-separated list of fields to include into response or leave it undefined to return full object. If you select single field, response will be an array of values in both `.fields` and `.values` modes.
$sort = new \Bzzhh\Tzkt\Model\AccountsGetSortParameter(); // AccountsGetSortParameter | Sorts cycle rewards by specified field. Supported fields: `cycle` (default, desc).
$offset = new \Bzzhh\Tzkt\Model\AccountsGetOffsetParameter(); // AccountsGetOffsetParameter | Specifies which or how many items should be skipped
$limit = 100; // int | Maximum number of items to return
$quote = new \Bzzhh\Tzkt\Model\AccountsGetOperationsQuoteParameter(); // AccountsGetOperationsQuoteParameter | Comma-separated list of ticker symbols to inject historical prices into response

try {
    $result = $apiInstance->rewardsGetDelegatorRewards($address, $cycle, $select, $sort, $offset, $limit, $quote);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling RewardsApi->rewardsGetDelegatorRewards: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
address string Delegator address.
cycle AccountsGetIdParameter Filters rewards by cycle. [optional]
select AccountsGetSelectParameter Specify comma-separated list of fields to include into response or leave it undefined to return full object. If you select single field, response will be an array of values in both `.fields` and `.values` modes. [optional]
sort AccountsGetSortParameter Sorts cycle rewards by specified field. Supported fields: `cycle` (default, desc). [optional]
offset AccountsGetOffsetParameter Specifies which or how many items should be skipped [optional]
limit int Maximum number of items to return [optional] [default to 100]
quote AccountsGetOperationsQuoteParameter Comma-separated list of ticker symbols to inject historical prices into response [optional]

Return type

\Bzzhh\Tzkt\Model\DelegatorRewards[]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

rewardsGetDelegatorRewardsCount()

rewardsGetDelegatorRewardsCount($address): int

Get delegator cycle rewards count

Returns total number of cycles where the delegator was delegated to an active baker

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new Bzzhh\Tzkt\Api\RewardsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$address = 'address_example'; // string | Delegator address

try {
    $result = $apiInstance->rewardsGetDelegatorRewardsCount($address);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling RewardsApi->rewardsGetDelegatorRewardsCount: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
address string Delegator address

Return type

int

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

rewardsGetRewardSplit()

rewardsGetRewardSplit($baker, $cycle, $offset, $limit): \Bzzhh\Tzkt\Model\RewardSplit

Get reward split

Returns baker rewards for the specified cycle with all delegator balances at that cycle to allow rewards distribution in proportion to shares.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new Bzzhh\Tzkt\Api\RewardsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$baker = 'baker_example'; // string | Baker address
$cycle = 56; // int | Rewards cycle
$offset = 0; // int | Specifies how many delegators in the reward split should be skipped
$limit = 100; // int | Maximum number of delegators to return

try {
    $result = $apiInstance->rewardsGetRewardSplit($baker, $cycle, $offset, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling RewardsApi->rewardsGetRewardSplit: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
baker string Baker address
cycle int Rewards cycle
offset int Specifies how many delegators in the reward split should be skipped [optional] [default to 0]
limit int Maximum number of delegators to return [optional] [default to 100]

Return type

\Bzzhh\Tzkt\Model\RewardSplit

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

rewardsGetRewardSplitDelegator()

rewardsGetRewardSplitDelegator($baker, $cycle, $delegator): \Bzzhh\Tzkt\Model\SplitDelegator

Get reward split delegator

Returns delegator/staker from the reward split for the specified cycle.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new Bzzhh\Tzkt\Api\RewardsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$baker = 'baker_example'; // string | Baker address
$cycle = 56; // int | Reward split cycle
$delegator = 'delegator_example'; // string | Delegator address

try {
    $result = $apiInstance->rewardsGetRewardSplitDelegator($baker, $cycle, $delegator);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling RewardsApi->rewardsGetRewardSplitDelegator: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
baker string Baker address
cycle int Reward split cycle
delegator string Delegator address

Return type

\Bzzhh\Tzkt\Model\SplitDelegator

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]