Hanisch-IT /
kraken-api
| 1 | <?php |
||||
| 2 | /** |
||||
| 3 | * @author Fabian Hanisch |
||||
| 4 | * @since 16.07.2017 02:55 |
||||
| 5 | * @version 1.0 |
||||
| 6 | */ |
||||
| 7 | |||||
| 8 | require_once(__DIR__ . '/../vendor/autoload.php'); |
||||
| 9 | |||||
| 10 | try { |
||||
| 11 | $api = new \HanischIt\KrakenApi\KrakenApi( |
||||
| 12 | "Your-API-Key", |
||||
| 13 | "Your-API-Sign" |
||||
| 14 | ); |
||||
| 15 | |||||
| 16 | $orderBookResponse = $api->getOrderBook("XETHZEUR", 20); |
||||
| 17 | |||||
| 18 | echo "Aks :\n"; |
||||
| 19 | foreach ($orderBookResponse->getAsks() as $ask) { |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 20 | echo "- Price: " . $ask->getPrice() . " / Volume: " . $ask->getVolume() . " / Timestamp: " . $ask->getTimestamp() . "\n"; |
||||
| 21 | } |
||||
| 22 | echo "Bids :\n"; |
||||
| 23 | foreach ($orderBookResponse->getBids() as $bids) { |
||||
|
0 ignored issues
–
show
The method
getBids() does not exist on HanischIt\KrakenApi\Model\ResponseInterface. It seems like you code against a sub-type of HanischIt\KrakenApi\Model\ResponseInterface such as HanischIt\KrakenApi\Call...Model\OrderBookResponse.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 24 | echo "- Price: " . $bids->getPrice() . " / Volume: " . $bids->getVolume() . " / Timestamp: " . $bids->getTimestamp() . "\n"; |
||||
| 25 | } |
||||
| 26 | |||||
| 27 | } catch (Exception $e) { |
||||
| 28 | echo $e->getMessage(); |
||||
| 29 | } |
||||
| 30 |