Skip to content

Commit

Permalink
Update default API url
Browse files Browse the repository at this point in the history
  • Loading branch information
miguilimzero committed Nov 8, 2021
1 parent 420c9c2 commit 74bdd1f
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/Api/BaseAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,31 @@

abstract class BaseAPI
{
protected Client $client;
protected string $defaultUrl = 'https://cryptounifier.io/api/v1/';

protected string $baseEndpoint = 'https://next.cryptounifier.io/api/v1/';
protected Client $client;

protected string $apiKey;

protected string $secretKey;

protected string $suffix;

protected array $headers;

public function __construct(string $suffix, array $headers)
{
$this->suffix = $suffix;
$this->headers = $headers;

$this->setApiUrl($this->defaultUrl);
}

public function setApiUrl(string $apiUrl): void
{
$this->client = new Client([
'base_uri' => $this->baseEndpoint . $suffix . '/',
'headers' => $headers,
'base_uri' => $apiUrl . $this->suffix . '/',
'headers' => $this->headers,
]);
}

Expand Down

0 comments on commit 74bdd1f

Please sign in to comment.