Skip to content

Commit

Permalink
added missing enpoints for lastest trade for symbol v2, last quote fo…
Browse files Browse the repository at this point in the history
…r symbol v2 abd forex ticker snapshot (#13)

Co-authored-by: Ersin Demirtas <[email protected]>
  • Loading branch information
ersin-demirtas and ed-bbwmc authored Jun 27, 2021
1 parent f86dfc7 commit 9b4875d
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/Rest/Forex/SnapshotTickerV2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace PolygonIO\Rest\Forex;

use GuzzleHttp\Exception\GuzzleException;
use PolygonIO\Rest\RestResource;

/**
* Class SnapshotAllTickers
*
* @package PolygonIO\Rest\Forex
*/
class SnapshotTickerV2 extends RestResource
{
/**
* @param $tickerSymbol
*
* @return array
*
*/
public function get($tickerSymbol): array
{
return $this->_get('/v2/snapshot/locale/global/markets/forex/tickers/' . $tickerSymbol);
}
}
26 changes: 26 additions & 0 deletions src/Rest/Stocks/LastQuoteForSymbolV2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace PolygonIO\Rest\Stocks;

use GuzzleHttp\Exception\GuzzleException;
use PolygonIO\Rest\RestResource;

/**
* Class LastQuoteForSymbol
*
* @package PolygonIO\Rest\Stocks
*/
class LastQuoteForSymbolV2 extends RestResource
{
/**
* @param $tickerSymbol
*
* @return array
*
* @throws GuzzleException
*/
public function get($tickerSymbol): array
{
return $this->_get('/v2/last/nbbo/' . $tickerSymbol);
}
}
26 changes: 26 additions & 0 deletions src/Rest/Stocks/LastTradeForSymbolV2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace PolygonIO\Rest\Stocks;

use GuzzleHttp\Exception\GuzzleException;
use PolygonIO\Rest\RestResource;

/**
* Class LastTradeForSymbol
*
* @package PolygonIO\Rest\Stocks
*/
class LastTradeForSymbolV2 extends RestResource
{
/**
* @param $tickerSymbol
*
* @return array
*
* @throws GuzzleException
*/
public function get($tickerSymbol): array
{
return $this->_get('/v2/last/trade/' . $tickerSymbol);
}
}

0 comments on commit 9b4875d

Please sign in to comment.