-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client instance error #66
Comments
Hey, can you share the code you are having error with? |
Hi, i just run this `<?php require DIR . '/../vendor/autoload.php'; use Timirey\XApi\Client; $client = new Client( /**
var_dump($response); |
Can i text you somewhere else ? |
You dont need to login. When you create the client, the connection is already made. Try to send commands right after the client instance is created. |
Yes but problem is with making client instance MacBook-Pro:~ danielbedensky$ curl -v https://xapi.xtb.com:5124
the endpoint of xtb cant answer |
It could be that their servers are down due to holiday. I will check tomorrow ASAP and let you know.
|
thanks a lot ... i will be waiting for your info |
Please check that you are using proper credentials. I just did this and it worked without any issues. I have checked: both demo and real environment are operational, can you confirm that it works for you as well? If no, you can contact XTB developers, as issue is whether on your side or their. XTB support: [email protected] This repository is only a wrapper around their API. <?php
require_once "vendor/autoload.php";
$client = new \Timirey\XApi\Client(
1234567,
'MyVerySecurePassword',
\Timirey\XApi\Enums\Host::REAL
);
$response = $client->getSymbol('EURUSD');
var_dump($response); This gives me the following response:
|
Hi, I found an error, it works. Thanks a lot. |
Dont forget to star the repository so you dont miss any updates :) |
can u call getAllSymbols() ? without fattal error ? maybe is problem only on my side i got error like this Fatal error: Uncaught ValueError: 6 is not a valid backing value for enum Timirey\XApi\Enums\QuoteId in /var/www/html/src/Responses/Data/SymbolRecord.php:154 Stack trace: #0 /var/www/html/src/Responses/Data/SymbolRecord.php(154): Timirey\XApi\Enums\QuoteId::from(6) #1 /var/www/html/src/Responses/GetAllSymbolsResponse.php(29): Timirey\XApi\Responses\Data\SymbolRecord->__construct('TGNA.US_9', 'USD', 'STC', 'USD', 6, 15, 104, 6, 2, 1, 1, 1735246799778, NULL, 0, 2, 2, 12, 2724, 2147483647, 'US', 'TEGNA Inc ', true, false, false, true, 100.0, 18.54, 18.55, 18.55, 18.18, 1.0, 1000000.0, 1.0, 0.01, 0.01, 0.0, 0.0, 100.0, 0.01, 1.0, NULL, 0, 0, 0, 0, 'Thu Dec 26 21:5...', false, false) #2 [internal function]: Timirey\XApi\Responses\GetAllSymbolsResponse::Timirey\XApi\Responses{closure}(Array) #3 /var/www/html/src/Responses/GetAllSymbolsResponse.php(28): array_map(Object(Closure), Array) #4 /var/www/html/src/Responses/AbstractResponse.php(33): Timirey\XApi\Responses\GetAllSymbolsResponse::create(Array) #5 /var/www/html/src/Client.php(791): Timirey\XApi\Responses\AbstractResponse::instantiate('{"status":true,...') #6 /var/www/html/src/Client.php(194): Timirey\XApi\Client->request(Object(Timirey\XApi\Payloads\GetAllSymbolsPayload), 'Timirey\XApi\Re...') #7 /var/www/html/public/index.php(19): Timirey\XApi\Client->getAllSymbols() #8 {main} thrown in /var/www/html/src/Responses/Data/SymbolRecord.php on line 154 another calls are fine. |
I think they added a new type of Quote. I will update it. |
Here is a new release: https://github.com/timirey/xapi-php/releases/tag/6.2.0 Their documentation is outdated, so there are more things to consider. |
Try to update to the latest version. And dont forget that the market is closed on weekend.Sent from my iPhoneOn 4 Jan 2025, at 14:34, isdevelop-sk ***@***.***> wrote:
in receive function first chunk is this string(97) "{"status":true,"streamSessionId":"005056fffebf4b2c-00014d71-000677cf-8cafe56b766de32d-0cd51eee"} " and this throw an exception
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you modified the open/close state.Message ID: ***@***.***>
|
Hello, please help, after localy try to run the code and make instance of client i got error like this
**Warning: stream_socket_client(): Unable to connect to ssl://xapi.xtb.com:5112 (Connection timed out) in /var/www/html/src/Connections/SocketConnection.php on line 53
Fatal error: Uncaught Timirey\XApi\Exceptions\SocketException: 110: Connection timed out in /var/www/html/src/Connections/SocketConnection.php:56 Stack trace: #0 /var/www/html/src/Connections/SocketConnection.php(32): Timirey\XApi\Connections\SocketConnection->open() #1 /var/www/html/src/Client.php(761): Timirey\XApi\Connections\SocketConnection->__construct('ssl://xapi.xtb....') #2 /var/www/html/src/Client.php(129): Timirey\XApi\Client->connect() #3 /var/www/html/public/index.php(9): Timirey\XApi\Client->__construct(, '', Object(Timirey\XApi\Enums\Host), 'My Test App') #4 {main} thrown in /var/www/html/src/Connections/SocketConnection.php on line 56**
:/
The text was updated successfully, but these errors were encountered: