1 | <?php |
||
15 | class BittrexClient |
||
16 | { |
||
17 | private const BASE_URI = 'https://api.bittrex.com'; |
||
18 | |||
19 | /** @var Client */ |
||
20 | private $publicClient; |
||
21 | |||
22 | /** @var Client */ |
||
23 | private $privateClient; |
||
24 | |||
25 | /** @var string */ |
||
26 | private $key = ''; |
||
27 | |||
28 | /** @var string */ |
||
29 | private $secret = ''; |
||
30 | |||
31 | /** |
||
32 | * @param string $key |
||
33 | * @param string $secret |
||
34 | */ |
||
35 | public function setCredential(string $key, string $secret): void |
||
40 | |||
41 | /** |
||
42 | * @return string |
||
43 | */ |
||
44 | public function getKey(): string |
||
48 | |||
49 | /** |
||
50 | * @return string |
||
51 | */ |
||
52 | public function getSecret(): string |
||
56 | |||
57 | /** |
||
58 | * @return PublicApi |
||
59 | */ |
||
60 | public function public(): PublicApi |
||
64 | |||
65 | /** |
||
66 | * @return Market |
||
67 | * @throws InvalidCredentialException |
||
68 | */ |
||
69 | public function market(): Market |
||
73 | |||
74 | /** |
||
75 | * @return Account |
||
76 | * @throws InvalidCredentialException |
||
77 | */ |
||
78 | public function account(): Account |
||
82 | |||
83 | /** |
||
84 | * @return Client |
||
85 | */ |
||
86 | private function createPublicClient(): Client |
||
90 | |||
91 | /** |
||
92 | * @return Client |
||
93 | * @throws InvalidCredentialException |
||
94 | */ |
||
95 | private function createPrivateClient(): Client |
||
105 | |||
106 | /** |
||
107 | * @return Client |
||
108 | * @throws InvalidCredentialException |
||
109 | */ |
||
110 | private function getPrivateClient(): Client |
||
114 | |||
115 | /** |
||
116 | * @return Client |
||
117 | */ |
||
118 | private function getPublicClient(): Client |
||
122 | } |
||
123 |