Skip to content

Commit

Permalink
Merge pull request #68 from MinterTeam/dev
Browse files Browse the repository at this point in the history
add page, perPage to /transactions
  • Loading branch information
grkamil authored Aug 14, 2019
2 parents fab59d1 + 41c8b52 commit e0e993d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ estimateTxCommission(string $tx): \stdClass
Return transactions by query.

``
getTransactions(string $query): \stdClass
getTransactions(string $query, ?int $page = null, ?int $perPage = null): \stdClass
``

### getUnconfirmedTxs
Expand Down
17 changes: 15 additions & 2 deletions src/Minter/MinterAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,24 @@ public function estimateTxCommission(string $tx): \stdClass
* Get transactions by query.
*
* @param string $query
* @param int|null $page
* @param int|null $perPage
* @return \stdClass
*/
public function getTransactions(string $query): \stdClass
public function getTransactions(string $query, ?int $page = null, ?int $perPage = null): \stdClass
{
return $this->get('/transactions', ['query' => $query]);
$params = ['query' => $query];

if($page) {
$params['page'] = $page;
}

if($perPage) {
$params['perPage'] = $perPage;
}


return $this->get('/transactions', $params);
}

/**
Expand Down

0 comments on commit e0e993d

Please sign in to comment.