Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pass query parameters to 2.0 endpoints #24

Merged
merged 1 commit into from Dec 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## Unreleased

## 0.1.5 - 2018-12-02

### Fixed:

- Pass `query` parameters to 2.0 endpoints

## 0.1.4 - 2018-11-23

### Changed:
Expand Down
9 changes: 6 additions & 3 deletions src/API/Two/Blocks.php
Expand Up @@ -25,11 +25,13 @@ class Blocks extends AbstractAPI
/**
* Get all blocks.
*
* @param array $query
*
* @return array
*/
public function all(): array
public function all(array $query = []): array
{
return $this->get('blocks');
return $this->get('blocks', $query);
}

/**
Expand All @@ -48,10 +50,11 @@ public function show(string $id): array
* Get all transactions by the given block.
*
* @param string $id
* @param array $query
*
* @return array
*/
public function transactions(string $id): array
public function transactions(string $id, array $query = []): array
{
return $this->get("blocks/{$id}/transactions");
}
Expand Down
12 changes: 8 additions & 4 deletions src/API/Two/Delegates.php
Expand Up @@ -25,11 +25,13 @@ class Delegates extends AbstractAPI
/**
* Get all accounts.
*
* @param array $query
*
* @return array
*/
public function all(): array
public function all(array $query = []): array
{
return $this->get('delegates');
return $this->get('delegates', $query);
}

/**
Expand All @@ -48,10 +50,11 @@ public function show(string $id): array
* Get all blocks for the given delegate.
*
* @param string $id
* @param array $query
*
* @return array
*/
public function blocks(string $id): array
public function blocks(string $id, array $query = []): array
{
return $this->get("delegates/{$id}/blocks");
}
Expand All @@ -60,10 +63,11 @@ public function blocks(string $id): array
* Get all voters for the given delegate.
*
* @param string $id
* @param array $query
*
* @return array
*/
public function voters(string $id): array
public function voters(string $id, array $query = []): array
{
return $this->get("delegates/{$id}/voters");
}
Expand Down
6 changes: 4 additions & 2 deletions src/API/Two/Transactions.php
Expand Up @@ -25,11 +25,13 @@ class Transactions extends AbstractAPI
/**
* Get all transactions.
*
* @param array $query
*
* @return array
*/
public function all(): array
public function all(array $query = []): array
{
return $this->get('transactions');
return $this->get('transactions', $query);
}

/**
Expand Down
6 changes: 4 additions & 2 deletions src/API/Two/Votes.php
Expand Up @@ -25,11 +25,13 @@ class Votes extends AbstractAPI
/**
* Get all votes.
*
* @param array $query
*
* @return array
*/
public function all(): array
public function all(array $query = []): array
{
return $this->get('votes');
return $this->get('votes', $query);
}

/**
Expand Down
18 changes: 12 additions & 6 deletions src/API/Two/Wallets.php
Expand Up @@ -25,11 +25,13 @@ class Wallets extends AbstractAPI
/**
* Get all wallets.
*
* @param array $query
*
* @return array
*/
public function all(): array
public function all(array $query = []): array
{
return $this->get('wallets');
return $this->get('wallets', $query);
}

/**
Expand All @@ -48,10 +50,11 @@ public function show(string $id): array
* Get all transactions for the given wallet.
*
* @param string $id
* @param array $query
*
* @return array
*/
public function transactions(string $id): array
public function transactions(string $id, array $query = []): array
{
return $this->get("wallets/{$id}/transactions");
}
Expand All @@ -60,10 +63,11 @@ public function transactions(string $id): array
* Get all transactions sent by the given wallet.
*
* @param string $id
* @param array $query
*
* @return array
*/
public function sentTransactions(string $id): array
public function sentTransactions(string $id, array $query = []): array
{
return $this->get("wallets/{$id}/transactions/sent");
}
Expand All @@ -72,10 +76,11 @@ public function sentTransactions(string $id): array
* Get all transactions received by the given wallet.
*
* @param string $id
* @param array $query
*
* @return array
*/
public function receivedTransactions(string $id): array
public function receivedTransactions(string $id, array $query = []): array
{
return $this->get("wallets/{$id}/transactions/received");
}
Expand All @@ -84,10 +89,11 @@ public function receivedTransactions(string $id): array
* Get all votes by the given wallet.
*
* @param string $id
* @param array $query
*
* @return array
*/
public function votes(string $id): array
public function votes(string $id, array $query = []): array
{
return $this->get("wallets/{$id}/votes");
}
Expand Down