blocktrail-sdk-php
blocktrail-sdk-php copied to clipboard
Getting transaction details
Ehy there, I'm trying to get transaction details with method ->transaction() but I get UnknownEndpointSpecificError. In the method the client sends 2 different requests to the server, the first one with "?verbose=3" and the second one without it. The first one works but the second one obtains an error 403 with empty body. If I put usleep(100 * 1000) between the 2 requests everything works. It's clearly due to the server endpoint.
What is happening with the server APIs?
It was moved to btc.com and now has TONS OF PROBLEMS.
Which version of the SDK are you using? Can you share a code snippet of where in your code you receive the 403?
It seems it doesn't happen anymore. Probabily it was related to the migration to btc.com
Ehy there! The same error came out again :(
I'm using the SDK 3.2.2. Here's the snippet:
$client = new BlocktrailSDK( "*******","*******"); $transaction = $client->transaction('<id>');
I get this error:
The error is thrown in blocktrail\blocktrail-sdk\src\BlocktrailSDK.php
I added usleep() below and If I uncomment it no error comes out.
here there is the response I get debugging it (of course without usleep):
Thx
Looks like ratelimit on server side
It seems so. Who should fix this? xD
i'm waiting for fixes since update, so be patient :D
Any fixes yet? It's almost going to be 2 months.
Nothing yet, I always need to put usleep for now.
it works for me if public function transaction($txhash) { usleep(150 * 5000); $response = $this->dataClient->get($this->converter->getUrlForTransaction($txhash)); $res = $this->converter->convertTx($response->body(), null); usleep(150 * 5000); if ($this->converter instanceof BtccomConverter) { $res['raw'] = \json_decode($this->dataClient->get("tx/{$txhash}/raw")->body(), true)['data']; }
return $res;
}
it should work w/o usleep
not working for me
You have to use usleep for now. It seems it's not fixed yet :(.