@@ -154,6 +154,6 @@ |
||
| 154 | 154 | */ |
| 155 | 155 | public function toRequest() |
| 156 | 156 | { |
| 157 | - return new Request(null, MiningClient::MINING_SUBSCRIBE, [$this->job_id, $this->prevhash, $this->coinb1, $this->coinb2, $this->merkle_branch, $this->version, $this->nbits, $this->ntime, $this->clean_jobs]); |
|
| 157 | + return new Request(null, MiningClient::MINING_SUBSCRIBE, [ $this->job_id, $this->prevhash, $this->coinb1, $this->coinb2, $this->merkle_branch, $this->version, $this->nbits, $this->ntime, $this->clean_jobs ]); |
|
| 158 | 158 | } |
| 159 | 159 | } |
@@ -34,6 +34,6 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | public function toRequest() |
| 36 | 36 | { |
| 37 | - return new Request(null, MiningClient::SET_DIFFICULTY, [$this->difficulty]); |
|
| 37 | + return new Request(null, MiningClient::SET_DIFFICULTY, [ $this->difficulty ]); |
|
| 38 | 38 | } |
| 39 | 39 | } |
@@ -21,17 +21,17 @@ |
||
| 21 | 21 | $clientFactory = new Factory($loop, $connector, $requestFactory); |
| 22 | 22 | $stratum = $clientFactory->create($host, $port); |
| 23 | 23 | |
| 24 | -$v = $stratum->request('server.version', ['1.9.7', ' 0.6'])->then(function (Response $r) { |
|
| 25 | - echo "Server version: " . $r->getResult() . "\n"; |
|
| 24 | +$v = $stratum->request('server.version', [ '1.9.7', ' 0.6' ])->then(function(Response $r) { |
|
| 25 | + echo "Server version: ".$r->getResult()."\n"; |
|
| 26 | 26 | }); |
| 27 | 27 | |
| 28 | 28 | // Make the query, receive a Promise |
| 29 | -$t = $stratum->request('blockchain.address.get_balance', ['1NfcqVqW4f6tACwaqjyKXRV75aqt3VEVPE']); |
|
| 30 | -$t->then(function (Response $response) { |
|
| 29 | +$t = $stratum->request('blockchain.address.get_balance', [ '1NfcqVqW4f6tACwaqjyKXRV75aqt3VEVPE' ]); |
|
| 30 | +$t->then(function(Response $response) { |
|
| 31 | 31 | var_dump($response); |
| 32 | -}, function (\BitWasp\Stratum\Exceptions\ApiError $error) { |
|
| 32 | +}, function(\BitWasp\Stratum\Exceptions\ApiError $error) { |
|
| 33 | 33 | echo sprintf(" [id: %s] error: %s", $error->getId(), $error->getMessage()); |
| 34 | -}, function () { |
|
| 34 | +}, function() { |
|
| 35 | 35 | |
| 36 | 36 | }); |
| 37 | 37 | |
@@ -48,6 +48,6 @@ |
||
| 48 | 48 | return json_encode([ |
| 49 | 49 | 'id' => $this->id, |
| 50 | 50 | 'result' => $this->result |
| 51 | - ]) . "\n"; |
|
| 51 | + ])."\n"; |
|
| 52 | 52 | } |
| 53 | 53 | } |