Skip to content

Commit

Permalink
BASE URI fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhdmitry committed Apr 15, 2021
1 parent a120b78 commit 0fec4b5
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
16 changes: 8 additions & 8 deletions src/Rest/Api/Market.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct(Client $client, ResponseDeserializer $deserializer)
*/
public function getStocks(): MarketInstrumentListResponse
{
$response = $this->client->request('GET', '/market/stocks');
$response = $this->client->request('GET', 'market/stocks');

return $this->deserializer->deserialize($response, MarketInstrumentListResponse::class);
}
Expand All @@ -58,7 +58,7 @@ public function getStocks(): MarketInstrumentListResponse
*/
public function getBonds(): MarketInstrumentListResponse
{
$response = $this->client->request('GET', '/market/bonds');
$response = $this->client->request('GET', 'market/bonds');

return $this->deserializer->deserialize($response, MarketInstrumentListResponse::class);
}
Expand All @@ -72,7 +72,7 @@ public function getBonds(): MarketInstrumentListResponse
*/
public function getEtfs(): MarketInstrumentListResponse
{
$response = $this->client->request('GET', '/market/etfs');
$response = $this->client->request('GET', 'market/etfs');

return $this->deserializer->deserialize($response, MarketInstrumentListResponse::class);
}
Expand All @@ -86,7 +86,7 @@ public function getEtfs(): MarketInstrumentListResponse
*/
public function getCurrencies(): MarketInstrumentListResponse
{
$response = $this->client->request('GET', '/market/currencies');
$response = $this->client->request('GET', 'market/currencies');

return $this->deserializer->deserialize($response, MarketInstrumentListResponse::class);
}
Expand All @@ -103,7 +103,7 @@ public function getCurrencies(): MarketInstrumentListResponse
*/
public function getOrderbook(string $figi, int $depth): OrderbookResponse
{
$response = $this->client->request('GET', '/market/orderbook', [
$response = $this->client->request('GET', 'market/orderbook', [
'figi' => $figi,
'depth' => $depth,
]);
Expand All @@ -125,7 +125,7 @@ public function getOrderbook(string $figi, int $depth): OrderbookResponse
*/
public function getCandles(string $figi, \DateTimeInterface $from, \DateTimeInterface $to, string $interval): CandlesResponse
{
$response = $this->client->request('GET', '/market/candles', [
$response = $this->client->request('GET', 'market/candles', [
'figi' => $figi,
'from' => $from->format(Client::REQUEST_DATE_FORMAT),
'to' => $to->format(Client::REQUEST_DATE_FORMAT),
Expand All @@ -146,7 +146,7 @@ public function getCandles(string $figi, \DateTimeInterface $from, \DateTimeInte
*/
public function searchByFigi(string $figi): SearchMarketInstrumentResponse
{
$response = $this->client->request('GET', '/market/search/by-figi', [
$response = $this->client->request('GET', 'market/search/by-figi', [
'figi' => $figi,
]);

Expand All @@ -164,7 +164,7 @@ public function searchByFigi(string $figi): SearchMarketInstrumentResponse
*/
public function searchByTicker(string $ticker): MarketInstrumentListResponse
{
$response = $this->client->request('GET', '/market/search/by-ticker', [
$response = $this->client->request('GET', 'market/search/by-ticker', [
'ticker' => $ticker,
]);

Expand Down
2 changes: 1 addition & 1 deletion src/Rest/Api/Operations.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function get(\DateTimeInterface $from, \DateTimeInterface $to, ?string $f
$query['brokerAccountId'] = $brokerAccountId;
}

$response = $this->client->request('GET', '/operations', $query);
$response = $this->client->request('GET', 'operations', $query);

return $this->deserializer->deserialize($response, OperationsResponse::class);
}
Expand Down
8 changes: 4 additions & 4 deletions src/Rest/Api/Orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function get(string $brokerAccountId = null): OrdersResponse
$query['brokerAccountId'] = $brokerAccountId;
}

$response = $this->client->request('GET', '/orders', $query);
$response = $this->client->request('GET', 'orders', $query);

return $this->deserializer->deserialize($response, OrdersResponse::class);
}
Expand Down Expand Up @@ -82,7 +82,7 @@ public function postLimitOrder(string $figi, LimitOrderRequest $request, string

$response = $this->client->request(
'POST',
'/orders/limit-order',
'orders/limit-order',
$query,
[
'lots' => $request->getLots(),
Expand Down Expand Up @@ -117,7 +117,7 @@ public function postMarketOrder(string $figi, MarketOrderRequest $request, strin

$response = $this->client->request(
'POST',
'/orders/market-order',
'orders/market-order',
$query,
[
'lots' => $request->getLots(),
Expand Down Expand Up @@ -148,7 +148,7 @@ public function postCancel(string $orderId, string $brokerAccountId = null): Emp
$query['brokerAccountId'] = $brokerAccountId;
}

$response = $this->client->request('POST', '/orders/cancel', $query);
$response = $this->client->request('POST', 'orders/cancel', $query);

return $this->deserializer->deserialize($response, EmptyResponse::class);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Rest/Api/Portfolio.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function get(string $brokerAccountId = null): PortfolioResponse
$query['brokerAccountId'] = $brokerAccountId;
}

$response = $this->client->request('GET', '/portfolio', $query);
$response = $this->client->request('GET', 'portfolio', $query);

return $this->deserializer->deserialize($response, PortfolioResponse::class);
}
Expand All @@ -72,7 +72,7 @@ public function getCurrencies(string $brokerAccountId = null): CurrenciesRespons
$query['brokerAccountId'] = $brokerAccountId;
}

$response = $this->client->request('GET', '/portfolio/currencies', $query);
$response = $this->client->request('GET', 'portfolio/currencies', $query);

return $this->deserializer->deserialize($response, CurrenciesResponse::class);
}
Expand Down
10 changes: 5 additions & 5 deletions src/Rest/Api/Sandbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function postRegister(?string $brokerAccountType = null): SandboxRegister
{
$response = $this->client->request(
'POST',
'/sandbox/sandbox/register',
'sandbox/sandbox/register',
[],
[
'brokerAccountType' => $brokerAccountType,
Expand Down Expand Up @@ -77,7 +77,7 @@ public function postCurrenciesBalance(string $currency, float $balance, string $

$response = $this->client->request(
'POST',
'/sandbox/sandbox/currencies/balance',
'sandbox/sandbox/currencies/balance',
$query,
[
'currency' => $currency,
Expand Down Expand Up @@ -109,7 +109,7 @@ public function postPositionsBalance(string $figi, float $balance, string $broke

$response = $this->client->request(
'POST',
'/sandbox/sandbox/positions/balance',
'sandbox/sandbox/positions/balance',
$query,
[
'figi' => $figi,
Expand Down Expand Up @@ -139,7 +139,7 @@ public function postRemove(string $brokerAccountId = null): EmptyResponse

$response = $this->client->request(
'POST',
'/sandbox/sandbox/remove',
'sandbox/sandbox/remove',
$query
);

Expand All @@ -165,7 +165,7 @@ public function postClear(string $brokerAccountId = null): EmptyResponse

$response = $this->client->request(
'POST',
'/sandbox/sandbox/clear',
'sandbox/sandbox/clear',
$query
);

Expand Down
2 changes: 1 addition & 1 deletion src/Rest/Api/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct(Client $client, ResponseDeserializer $deserializer)
*/
public function getAccounts(): UserAccountsResponse
{
$response = $this->client->request('GET', '/user/accounts');
$response = $this->client->request('GET', 'user/accounts');

return $this->deserializer->deserialize($response, UserAccountsResponse::class);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Rest/ClientFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

class ClientFactory
{
private const URL = 'https://api-invest.tinkoff.ru/openapi';
private const URL_SANDBOX = 'https://api-invest.tinkoff.ru/openapi/sandbox';
private const URL = 'https://api-invest.tinkoff.ru/openapi/';
private const URL_SANDBOX = 'https://api-invest.tinkoff.ru/openapi/sandbox/';

/**
* Создать REST клиент для биржи
Expand Down

0 comments on commit 0fec4b5

Please sign in to comment.