@@ -1986,7 +1986,7 @@ public function keepAlive()
1986
1986
{
1987
1987
$ loop = \React \EventLoop \Factory::create ();
1988
1988
$ loop ->addPeriodicTimer (30 , function () {
1989
- $ listenKey = $ this ->options [ ' listenKey ' ] ;
1989
+ $ listenKey = $ this ->listenKey ;
1990
1990
$ this ->httpRequest ("v1/userDataStream?listenKey= {$ listenKey }" , "PUT " , []);
1991
1991
});
1992
1992
$ loop ->run ();
@@ -2033,15 +2033,15 @@ public function keepAlive()
2033
2033
public function userData (&$ balance_callback , &$ execution_callback = false )
2034
2034
{
2035
2035
$ response = $ this ->httpRequest ("v1/userDataStream " , "POST " , []);
2036
- $ listenKey = $ this ->options [ ' listenKey ' ] = $ response ['listenKey ' ];
2036
+ $ this ->listenKey = $ response ['listenKey ' ];
2037
2037
$ this ->info ['balanceCallback ' ] = $ balance_callback ;
2038
2038
$ this ->info ['executionCallback ' ] = $ execution_callback ;
2039
2039
2040
2040
$ this ->subscriptions ['@userdata ' ] = true ;
2041
2041
2042
2042
// @codeCoverageIgnoreStart
2043
2043
// phpunit can't cover async function
2044
- \Ratchet \Client \connect ($ this ->stream . $ listenKey )->then (function ($ ws ) {
2044
+ \Ratchet \Client \connect ($ this ->stream . $ this -> listenKey )->then (function ($ ws ) {
2045
2045
$ ws ->on ('message ' , function ($ data ) use ($ ws ) {
2046
2046
if ($ this ->subscriptions ['@userdata ' ] === false ) {
2047
2047
//$this->subscriptions[$endpoint] = null;
0 commit comments