1: <?php
2: namespace Sotr\Crypto;
3:
4: use GuzzleHttp\Client;
5: use GuzzleHttp\ClientInterface;
6:
7: use Sotr\Crypto\CurrencyPair;
8:
9: abstract class AbstractApi implements ExchangeApiInterface
10: {
11: 12: 13: 14: 15:
16: protected $client;
17:
18: 19: 20: 21: 22:
23: protected $resolver = null;
24:
25: 26: 27: 28: 29:
30: protected $key;
31:
32: 33: 34: 35: 36:
37: protected $secret;
38:
39: public function __construct($key = null, $secret = null)
40: {
41: $this->key = $key;
42: $this->secret = $secret;
43: $this->setClient(new Client());
44: }
45:
46: abstract public function getPublicBaseUri();
47:
48: abstract public function getTradingBaseUri();
49:
50: abstract public function getTicker(CurrencyPair $pair = null);
51:
52: abstract public function getBalance();
53:
54: public function setClient(ClientInterface $client)
55: {
56: $this->client = $client;
57: }
58:
59: public function setCurrencyPairResolver(CurrencyPairResolverInterface $resolver)
60: {
61: $this->resolver = $resolver;
62: }
63:
64:
65:
66:
67:
68: }
69: