diff --git a/js/pro/exmo.js b/js/pro/exmo.js index e2e2d3da3479..4daa1b3a8256 100644 --- a/js/pro/exmo.js +++ b/js/pro/exmo.js @@ -649,14 +649,14 @@ module.exports = class exmo extends exmoRest { } async authenticate (params = {}) { + const messageHash = 'authenticated'; const [ type, query ] = this.handleMarketTypeAndParams ('authenticate', undefined, params); const url = this.urls['api']['ws'][type]; const client = this.client (url); - const time = this.milliseconds (); - const messageHash = 'authenticated'; const future = client.future ('authenticated'); const authenticated = this.safeValue (client.subscriptions, messageHash); if (authenticated === undefined) { + const time = this.milliseconds (); this.checkRequiredCredentials (); const requestId = this.requestId (); const signData = this.apiKey + time.toString (); diff --git a/php/pro/Client.php b/php/pro/Client.php index 7af211f45c06..fb9b9552c4b0 100644 --- a/php/pro/Client.php +++ b/php/pro/Client.php @@ -69,7 +69,7 @@ public function future($message_hash) { $future->reject($this->rejections[$message_hash]); unset($this->rejections[$message_hash]); } - return $future; + return $future->promise(); } public function resolve($result, $message_hash) { diff --git a/php/pro/ClientTrait.php b/php/pro/ClientTrait.php index 9290d16db813..b7e126827be8 100644 --- a/php/pro/ClientTrait.php +++ b/php/pro/ClientTrait.php @@ -103,7 +103,7 @@ function($result) use ($client, $message_hash, $message, $subscribe_hash, $subsc } } ); - return $future->promise(); + return $future; } public function on_connected($client, $message = null) {