Overview

Namespaces

  • Sotr
    • Crypto
      • Bitstamp
      • Btce

Classes

  • Sotr\Crypto\AbstractApi
  • Sotr\Crypto\AbstractRequestSigner
  • Sotr\Crypto\AccountBalance
  • Sotr\Crypto\Bitstamp\BitstampApi
  • Sotr\Crypto\Bitstamp\BitstampRequestSigner
  • Sotr\Crypto\Btce\BtceApi
  • Sotr\Crypto\Btce\BtceCurrencyPairResolver
  • Sotr\Crypto\Btce\BtceRequestSigner
  • Sotr\Crypto\CurrencyPair
  • Sotr\Crypto\Ticker
  • Sotr\Crypto\TimestampNonceGenerator

Interfaces

  • Sotr\Crypto\CurrencyPairResolverInterface
  • Sotr\Crypto\ExchangeApiInterface
  • Sotr\Crypto\NonceGeneratorInterface
  • Sotr\Crypto\RequestSignerInterface
  • Overview
  • Namespace
  • Class
 1: <?php
 2: namespace Sotr\Crypto\Btce;
 3: 
 4: use RuntimeException;
 5: 
 6: use Sotr\Crypto\CurrencyPair;
 7: use Sotr\Crypto\CurrencyPairResolverInterface;
 8: 
 9: class BtceCurrencyPairResolver implements CurrencyPairResolverInterface
10: {
11:     public function resolve(CurrencyPair $pair)
12:     {
13:         $currencies = $pair->getCurrencies();
14:         if (in_array('btc', $currencies) && in_array('usd', $currencies)) {
15:             return 'btc_usd';
16:         }
17:         if (in_array('ltc', $currencies) && in_array('usd', $currencies)) {
18:             return 'ltc_usd';
19:         }
20:         if (in_array('btc', $currencies) && in_array('eur', $currencies)) {
21:             return 'btc_eur';
22:         }
23:         if (in_array('ltc', $currencies) && in_array('eur', $currencies)) {
24:             return 'ltc_eur';
25:         }
26:         throw new RuntimeException("Pair {$currencies[0]}-{$currencies[1]} is not supported or is invalid\n");
27:     }
28: }
29: 
API documentation generated by ApiGen