Skip to content

Commit

Permalink
fix: pass query parameters to 2.0 endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
faustbrian committed Dec 2, 2018
1 parent bd03cbe commit 204310f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/API/Two/Blocks.php
Expand Up @@ -56,7 +56,7 @@ public function show(string $id): array
*/
public function transactions(string $id, array $query = []): array
{
return $this->get("blocks/{$id}/transactions");
return $this->get("blocks/{$id}/transactions", $query);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/API/Two/Delegates.php
Expand Up @@ -56,7 +56,7 @@ public function show(string $id): array
*/
public function blocks(string $id, array $query = []): array
{
return $this->get("delegates/{$id}/blocks");
return $this->get("delegates/{$id}/blocks", $query);
}

/**
Expand All @@ -69,6 +69,6 @@ public function blocks(string $id, array $query = []): array
*/
public function voters(string $id, array $query = []): array
{
return $this->get("delegates/{$id}/voters");
return $this->get("delegates/{$id}/voters", $query);
}
}
6 changes: 4 additions & 2 deletions src/API/Two/Peers.php
Expand Up @@ -25,11 +25,13 @@ class Peers extends AbstractAPI
/**
* Get all peers.
*
* @param array $query
*
* @return array
*/
public function all(): array
public function all(array $query = []): array
{
return $this->get('peers');
return $this->get('peers', $query);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/API/Two/Wallets.php
Expand Up @@ -56,7 +56,7 @@ public function show(string $id): array
*/
public function transactions(string $id, array $query = []): array
{
return $this->get("wallets/{$id}/transactions");
return $this->get("wallets/{$id}/transactions", $query);
}

/**
Expand All @@ -69,7 +69,7 @@ public function transactions(string $id, array $query = []): array
*/
public function sentTransactions(string $id, array $query = []): array
{
return $this->get("wallets/{$id}/transactions/sent");
return $this->get("wallets/{$id}/transactions/sent", $query);
}

/**
Expand All @@ -82,7 +82,7 @@ public function sentTransactions(string $id, array $query = []): array
*/
public function receivedTransactions(string $id, array $query = []): array
{
return $this->get("wallets/{$id}/transactions/received");
return $this->get("wallets/{$id}/transactions/received", $query);
}

/**
Expand All @@ -95,7 +95,7 @@ public function receivedTransactions(string $id, array $query = []): array
*/
public function votes(string $id, array $query = []): array
{
return $this->get("wallets/{$id}/votes");
return $this->get("wallets/{$id}/votes", $query);
}

/**
Expand Down

0 comments on commit 204310f

Please sign in to comment.