1 | <?php |
||
7 | class MiningClient |
||
8 | { |
||
9 | const MINING_SUBSCRIBE = 'mining.subscribe'; |
||
10 | const SET_DIFFICULTY = 'mining.set_difficulty'; |
||
11 | const NOTIFY = 'mining.notify'; |
||
12 | const AUTHORIZE = 'mining.authorize'; |
||
13 | const SUBMIT = 'mining.submit'; |
||
14 | |||
15 | /** |
||
16 | * @var Connection |
||
17 | */ |
||
18 | private $conn; |
||
19 | |||
20 | /** |
||
21 | * MiningServer constructor. |
||
22 | * @param Connection $connection |
||
23 | */ |
||
24 | 3 | public function __construct(Connection $connection) |
|
28 | |||
29 | /** |
||
30 | * @return \React\Promise\Promise|\React\Promise\PromiseInterface |
||
31 | */ |
||
32 | 1 | public function subscribeMining() |
|
36 | |||
37 | /** |
||
38 | * @param string $user |
||
39 | * @param string $password |
||
40 | * @return \React\Promise\Promise|\React\Promise\PromiseInterface |
||
41 | */ |
||
42 | 1 | public function authorize($user, $password) |
|
46 | |||
47 | /** |
||
48 | * @param string $worker_name |
||
49 | * @param string $job_id |
||
50 | * @param int $extranonce2 |
||
51 | * @param int $ntime |
||
52 | * @param int $nonce |
||
53 | * @return \React\Promise\Promise|\React\Promise\PromiseInterface |
||
54 | */ |
||
55 | 1 | public function submit($worker_name, $job_id, $extranonce2, $ntime, $nonce) |
|
59 | } |
||
60 |