forked from EvergreenCrypto/docker-finance
container: php: dfi namespace refactor
Align with project alias, save the eyes and hands.
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\blockchains
|
||||
namespace dfi\blockchains
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'blockchains/internal/base.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'blockchains/internal/blockchains/algorand.php');
|
||||
@@ -33,7 +33,7 @@ namespace docker_finance\blockchains
|
||||
require_once(__DFI_PHP_ROOT__ . 'blockchains/internal/blockchains/tezos.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
|
||||
use docker_finance\utils as utils;
|
||||
use dfi\utils as utils;
|
||||
|
||||
/**
|
||||
* @brief Blockchain fetcher API
|
||||
@@ -167,6 +167,6 @@ namespace docker_finance\blockchains
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace docker_finance\blockchains
|
||||
} // namespace dfi\blockchains
|
||||
|
||||
# vim: sw=4 sts=4 si ai et
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\blockchains\internal
|
||||
namespace dfi\blockchains\internal
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
|
||||
use docker_finance\utils as utils;
|
||||
use dfi\utils as utils;
|
||||
|
||||
/**
|
||||
* @brief Metadata object to be used for all blockchain APIs
|
||||
@@ -260,15 +260,15 @@ namespace docker_finance\blockchains\internal
|
||||
|
||||
abstract public function fetch(Metadata $metadata): void;
|
||||
}
|
||||
} // namespace docker_finance\blockchains\internal
|
||||
} // namespace dfi\blockchains\internal
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\blockchains
|
||||
namespace dfi\blockchains
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
|
||||
use docker_finance\utils as utils;
|
||||
use dfi\utils as utils;
|
||||
|
||||
/**
|
||||
* @brief Top-level abstraction for API
|
||||
@@ -298,6 +298,6 @@ namespace docker_finance\blockchains
|
||||
*/
|
||||
abstract public function fetch(internal\Metadata|null $metadata = null): void;
|
||||
}
|
||||
} // namespace docker_finance\blockchains
|
||||
} // namespace dfi\blockchains
|
||||
|
||||
# vim: sw=4 sts=4 si ai et
|
||||
|
||||
@@ -25,13 +25,13 @@
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\blockchains\internal\blockchains\algorand
|
||||
namespace dfi\blockchains\internal\blockchains\algorand
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'blockchains/internal/base.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
|
||||
use docker_finance\blockchains\internal as internal;
|
||||
use docker_finance\utils as utils;
|
||||
use dfi\blockchains\internal as internal;
|
||||
use dfi\utils as utils;
|
||||
|
||||
/**
|
||||
* @brief Implements client for Algorand Indexer v2 API
|
||||
@@ -264,24 +264,24 @@ namespace docker_finance\blockchains\internal\blockchains\algorand
|
||||
$this->write_transactions($metadata);
|
||||
}
|
||||
}
|
||||
} // namespace docker_finance\blockchains\internal\blockchains\algorand
|
||||
} // namespace dfi\blockchains\internal\blockchains\algorand
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\blockchains\internal\blockchains
|
||||
namespace dfi\blockchains\internal\blockchains
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'blockchains/internal/base.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
|
||||
use docker_finance\blockchains\internal as internal;
|
||||
use docker_finance\utils as utils;
|
||||
use dfi\blockchains\internal as internal;
|
||||
use dfi\utils as utils;
|
||||
|
||||
/**
|
||||
* @brief Facade for Algorand implementation
|
||||
* @ingroup php_blockchains
|
||||
* @since docker-finance 1.0.0
|
||||
*/
|
||||
final class Algorand extends \docker_finance\blockchains\API
|
||||
final class Algorand extends \dfi\blockchains\API
|
||||
{
|
||||
private algorand\AlgoIndexer $explorer; //!< Internal API
|
||||
|
||||
@@ -299,6 +299,6 @@ namespace docker_finance\blockchains\internal\blockchains
|
||||
$this->explorer->fetch($metadata);
|
||||
}
|
||||
}
|
||||
} // namespace docker_finance\blockchains\internal\blockchains
|
||||
} // namespace dfi\blockchains\internal\blockchains
|
||||
|
||||
# vim: sw=4 sts=4 si ai et
|
||||
|
||||
@@ -25,13 +25,13 @@
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\blockchains\internal\blockchains\ethereum
|
||||
namespace dfi\blockchains\internal\blockchains\ethereum
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'blockchains/internal/base.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
|
||||
use docker_finance\blockchains\internal as internal;
|
||||
use docker_finance\utils as utils;
|
||||
use dfi\blockchains\internal as internal;
|
||||
use dfi\utils as utils;
|
||||
|
||||
/**
|
||||
* @brief Etherscan-based API
|
||||
@@ -316,24 +316,24 @@ namespace docker_finance\blockchains\internal\blockchains\ethereum
|
||||
$this->write_transactions($metadata);
|
||||
}
|
||||
}
|
||||
} // namespace docker_finance\blockchains\internal\blockchains\ethereum
|
||||
} // namespace dfi\blockchains\internal\blockchains\ethereum
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\blockchains\internal\blockchains
|
||||
namespace dfi\blockchains\internal\blockchains
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'blockchains/internal/base.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
|
||||
use docker_finance\blockchains\internal as internal;
|
||||
use docker_finance\utils as utils;
|
||||
use dfi\blockchains\internal as internal;
|
||||
use dfi\utils as utils;
|
||||
|
||||
/**
|
||||
* @brief Facade for Ethereum implementation
|
||||
* @ingroup php_blockchains
|
||||
* @since docker-finance 1.0.0
|
||||
*/
|
||||
final class Ethereum extends \docker_finance\blockchains\API
|
||||
final class Ethereum extends \dfi\blockchains\API
|
||||
{
|
||||
private ethereum\Etherscan $explorer; //!< Internal API
|
||||
|
||||
@@ -351,6 +351,6 @@ namespace docker_finance\blockchains\internal\blockchains
|
||||
$this->explorer->fetch($metadata);
|
||||
}
|
||||
}
|
||||
} // namespace docker_finance\blockchains\internal\blockchains
|
||||
} // namespace dfi\blockchains\internal\blockchains
|
||||
|
||||
# vim: sw=4 sts=4 si ai et
|
||||
|
||||
@@ -25,13 +25,13 @@
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\blockchains\internal\blockchains\tezos
|
||||
namespace dfi\blockchains\internal\blockchains\tezos
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'blockchains/internal/base.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
|
||||
use docker_finance\blockchains\internal as internal;
|
||||
use docker_finance\utils as utils;
|
||||
use dfi\blockchains\internal as internal;
|
||||
use dfi\utils as utils;
|
||||
|
||||
/**
|
||||
* @brief TzKt (Tezos Kitty) API
|
||||
@@ -259,28 +259,28 @@ namespace docker_finance\blockchains\internal\blockchains\tezos
|
||||
$this->write_transactions($metadata);
|
||||
}
|
||||
}
|
||||
} // namespace docker_finance\blockchains\internal\blockchains\tezos
|
||||
} // namespace dfi\blockchains\internal\blockchains\tezos
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\blockchains\internal\blockchains
|
||||
namespace dfi\blockchains\internal\blockchains
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'blockchains/internal/base.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
|
||||
use docker_finance\blockchains\internal as internal;
|
||||
use docker_finance\utils as utils;
|
||||
use dfi\blockchains\internal as internal;
|
||||
use dfi\utils as utils;
|
||||
|
||||
/**
|
||||
* @brief Facade for Tezos implementation
|
||||
* @ingroup php_blockchains
|
||||
* @since docker-finance 1.0.0
|
||||
*/
|
||||
final class Tezos extends \docker_finance\blockchains\API
|
||||
final class Tezos extends \dfi\blockchains\API
|
||||
{
|
||||
private tezos\TzKt $explorer; //!< Internal API
|
||||
|
||||
public function __construct(\docker_finance\utils\Env $env)
|
||||
public function __construct(\dfi\utils\Env $env)
|
||||
{
|
||||
$this->explorer = new tezos\TzKt($env);
|
||||
}
|
||||
@@ -294,6 +294,6 @@ namespace docker_finance\blockchains\internal\blockchains
|
||||
$this->explorer->fetch($metadata);
|
||||
}
|
||||
}
|
||||
} // namespace docker_finance\blockchains\internal\blockchains
|
||||
} // namespace dfi\blockchains\internal\blockchains
|
||||
|
||||
# vim: sw=4 sts=4 si ai et
|
||||
|
||||
@@ -25,14 +25,14 @@
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\exchanges
|
||||
namespace dfi\exchanges
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/base.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/exchanges/coinbase.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/exchanges/gemini.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
|
||||
use docker_finance\utils as utils;
|
||||
use dfi\utils as utils;
|
||||
|
||||
/**
|
||||
* @brief Exchanges fetcher API
|
||||
@@ -80,6 +80,6 @@ namespace docker_finance\exchanges
|
||||
$this->api->fetch();
|
||||
}
|
||||
}
|
||||
} // namespace docker_finance\exchanges
|
||||
} // namespace dfi\exchanges
|
||||
|
||||
# vim: sw=4 sts=4 si ai et
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\exchanges\internal
|
||||
namespace dfi\exchanges\internal
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
|
||||
use docker_finance\utils as utils;
|
||||
use dfi\utils as utils;
|
||||
|
||||
/**
|
||||
* @brief Common implementaion interface
|
||||
@@ -116,7 +116,7 @@ namespace docker_finance\exchanges\internal
|
||||
protected function raw_to_csv(array $data, string $file): void
|
||||
{
|
||||
if (!empty($data)) {
|
||||
\docker_finance\utils\Json::write_csv(
|
||||
\dfi\utils\Json::write_csv(
|
||||
json_encode($data, JSON_PRETTY_PRINT),
|
||||
$file
|
||||
);
|
||||
@@ -126,15 +126,15 @@ namespace docker_finance\exchanges\internal
|
||||
//! @brief Wrapper to underlying API request
|
||||
abstract protected function request(string $path): mixed;
|
||||
}
|
||||
} // namespace docker_finance\exchanges\internal
|
||||
} // namespace dfi\exchanges\internal
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\exchanges
|
||||
namespace dfi\exchanges
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
|
||||
use docker_finance\utils as utils;
|
||||
use dfi\utils as utils;
|
||||
|
||||
/**
|
||||
* @brief Top-level abstraction for API
|
||||
@@ -157,6 +157,6 @@ namespace docker_finance\exchanges
|
||||
//! @brief Fetch executor
|
||||
abstract public function fetch(): void;
|
||||
}
|
||||
} // namespace docker_finance\exchanges
|
||||
} // namespace dfi\exchanges
|
||||
|
||||
# vim: sw=4 sts=4 si ai et
|
||||
|
||||
@@ -25,18 +25,18 @@
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\exchanges\internal\exchanges\bittrex
|
||||
namespace dfi\exchanges\internal\exchanges\bittrex
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/base.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
|
||||
use docker_finance\utils as utils;
|
||||
use dfi\utils as utils;
|
||||
|
||||
/**
|
||||
* @brief Common implementaion
|
||||
* @since docker-finance 1.0.0
|
||||
*/
|
||||
abstract class Impl extends \docker_finance\exchanges\internal\Impl
|
||||
abstract class Impl extends \dfi\exchanges\internal\Impl
|
||||
{
|
||||
private string $date_tag; //!< URL tag
|
||||
|
||||
@@ -243,11 +243,11 @@ namespace docker_finance\exchanges\internal\exchanges\bittrex
|
||||
$this->write($this->read(), $this->file);
|
||||
}
|
||||
}
|
||||
} // namespace docker_finance\exchanges\internal\exchanges\bittrex
|
||||
} // namespace dfi\exchanges\internal\exchanges\bittrex
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\exchanges\internal\exchanges
|
||||
namespace dfi\exchanges\internal\exchanges
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/base.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
@@ -257,13 +257,13 @@ namespace docker_finance\exchanges\internal\exchanges
|
||||
* @ingroup php_exchanges
|
||||
* @since docker-finance 1.0.0
|
||||
*/
|
||||
final class Bittrex extends \docker_finance\exchanges\API
|
||||
final class Bittrex extends \dfi\exchanges\API
|
||||
{
|
||||
private bittrex\Trades $trades;
|
||||
private bittrex\Deposits $deposits;
|
||||
private bittrex\Withdrawals $withdrawals;
|
||||
|
||||
public function __construct(\docker_finance\utils\Env $env)
|
||||
public function __construct(\dfi\utils\Env $env)
|
||||
{
|
||||
$this->trades = new bittrex\Trades($env);
|
||||
$this->deposits = new bittrex\Deposits($env);
|
||||
@@ -277,6 +277,6 @@ namespace docker_finance\exchanges\internal\exchanges
|
||||
$this->withdrawals->fetch();
|
||||
}
|
||||
}
|
||||
} // namespace docker_finance\exchanges\internal\exchanges
|
||||
} // namespace dfi\exchanges\internal\exchanges
|
||||
|
||||
# vim: sw=4 sts=4 si ai et
|
||||
|
||||
@@ -25,18 +25,18 @@
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\exchanges\internal\exchanges\celsius
|
||||
namespace dfi\exchanges\internal\exchanges\celsius
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/base.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
|
||||
use docker_finance\utils as utils;
|
||||
use dfi\utils as utils;
|
||||
|
||||
/**
|
||||
* @brief Common implementaion
|
||||
* @since docker-finance 1.0.0
|
||||
*/
|
||||
abstract class Impl extends \docker_finance\exchanges\internal\Impl
|
||||
abstract class Impl extends \dfi\exchanges\internal\Impl
|
||||
{
|
||||
public const BASE_URL = 'https://wallet-api.celsius.network/wallet/transactions'; //!< Base API URL
|
||||
|
||||
@@ -164,11 +164,11 @@ namespace docker_finance\exchanges\internal\exchanges\celsius
|
||||
$this->write($this->read(), $this->file);
|
||||
}
|
||||
}
|
||||
} // namespace docker_finance\exchanges\internal\exchanges\celsius
|
||||
} // namespace dfi\exchanges\internal\exchanges\celsius
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\exchanges\internal\exchanges
|
||||
namespace dfi\exchanges\internal\exchanges
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/base.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
@@ -178,11 +178,11 @@ namespace docker_finance\exchanges\internal\exchanges
|
||||
* @ingroup php_exchanges
|
||||
* @since docker-finance 1.0.0
|
||||
*/
|
||||
final class Celsius extends \docker_finance\exchanges\API
|
||||
final class Celsius extends \dfi\exchanges\API
|
||||
{
|
||||
private celsius\Transactions $transactions;
|
||||
|
||||
public function __construct(\docker_finance\utils\Env $env)
|
||||
public function __construct(\dfi\utils\Env $env)
|
||||
{
|
||||
$this->transactions = new celsius\Transactions($env);
|
||||
}
|
||||
@@ -192,6 +192,6 @@ namespace docker_finance\exchanges\internal\exchanges
|
||||
$this->transactions->fetch();
|
||||
}
|
||||
}
|
||||
} // namespace docker_finance\exchanges\internal\exchanges
|
||||
} // namespace dfi\exchanges\internal\exchanges
|
||||
|
||||
# vim: sw=4 sts=4 si ai et
|
||||
|
||||
@@ -25,20 +25,20 @@
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\exchanges\internal\exchanges\coinbase_pro
|
||||
namespace dfi\exchanges\internal\exchanges\coinbase_pro
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/base.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
|
||||
use MockingMagician\CoinbaseProSdk\CoinbaseFacade;
|
||||
use MockingMagician\CoinbaseProSdk\Contracts\Api\ApiInterface;
|
||||
use docker_finance\utils as utils;
|
||||
use dfi\utils as utils;
|
||||
|
||||
/**
|
||||
* @brief Common implementaion
|
||||
* @since docker-finance 1.0.0
|
||||
*/
|
||||
abstract class Impl extends \docker_finance\exchanges\internal\Impl
|
||||
abstract class Impl extends \dfi\exchanges\internal\Impl
|
||||
{
|
||||
// @phpstan-ignore-next-line // TODO: resolve
|
||||
private $api;
|
||||
@@ -268,11 +268,11 @@ namespace docker_finance\exchanges\internal\exchanges\coinbase_pro
|
||||
$this->get_raw_history();
|
||||
}
|
||||
}
|
||||
} // namespace docker_finance\exchanges\internal\exchanges\coinbase_pro
|
||||
} // namespace dfi\exchanges\internal\exchanges\coinbase_pro
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\exchanges\internal\exchanges
|
||||
namespace dfi\exchanges\internal\exchanges
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/base.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
@@ -282,11 +282,11 @@ namespace docker_finance\exchanges\internal\exchanges
|
||||
* @ingroup php_exchanges
|
||||
* @since docker-finance 1.0.0
|
||||
*/
|
||||
final class CoinbasePro extends \docker_finance\exchanges\API
|
||||
final class CoinbasePro extends \dfi\exchanges\API
|
||||
{
|
||||
private coinbase_pro\Transactions $transactions;
|
||||
|
||||
public function __construct(\docker_finance\utils\Env $env)
|
||||
public function __construct(\dfi\utils\Env $env)
|
||||
{
|
||||
$this->transactions = new coinbase_pro\Transactions($env);
|
||||
}
|
||||
@@ -296,6 +296,6 @@ namespace docker_finance\exchanges\internal\exchanges
|
||||
$this->transactions->fetch();
|
||||
}
|
||||
}
|
||||
} // namespace docker_finance\exchanges\internal\exchanges
|
||||
} // namespace dfi\exchanges\internal\exchanges
|
||||
|
||||
# vim: sw=4 sts=4 si ai et
|
||||
|
||||
@@ -25,18 +25,18 @@
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\exchanges\internal\exchanges\coinbase
|
||||
namespace dfi\exchanges\internal\exchanges\coinbase
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/base.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
|
||||
use docker_finance\utils as utils;
|
||||
use dfi\utils as utils;
|
||||
|
||||
/**
|
||||
* @brief Common implementaion
|
||||
* @since docker-finance 1.0.0
|
||||
*/
|
||||
abstract class Impl extends \docker_finance\exchanges\internal\Impl
|
||||
abstract class Impl extends \dfi\exchanges\internal\Impl
|
||||
{
|
||||
private \ccxt\coinbase $api;
|
||||
|
||||
@@ -272,11 +272,11 @@ namespace docker_finance\exchanges\internal\exchanges\coinbase
|
||||
utils\CLI::print_custom(" \e[32m│\e[0m\n");
|
||||
}
|
||||
}
|
||||
} // namespace docker_finance\exchanges\internal\exchanges\coinbase
|
||||
} // namespace dfi\exchanges\internal\exchanges\coinbase
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\exchanges\internal\exchanges
|
||||
namespace dfi\exchanges\internal\exchanges
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/base.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
@@ -286,11 +286,11 @@ namespace docker_finance\exchanges\internal\exchanges
|
||||
* @ingroup php_exchanges
|
||||
* @since docker-finance 1.0.0
|
||||
*/
|
||||
final class Coinbase extends \docker_finance\exchanges\API
|
||||
final class Coinbase extends \dfi\exchanges\API
|
||||
{
|
||||
private coinbase\Coinbase $api;
|
||||
|
||||
public function __construct(\docker_finance\utils\Env $env)
|
||||
public function __construct(\dfi\utils\Env $env)
|
||||
{
|
||||
$this->api = new coinbase\Coinbase($env);
|
||||
}
|
||||
@@ -300,6 +300,6 @@ namespace docker_finance\exchanges\internal\exchanges
|
||||
$this->api->fetch();
|
||||
}
|
||||
}
|
||||
} // namespace docker_finance\exchanges\internal\exchanges
|
||||
} // namespace dfi\exchanges\internal\exchanges
|
||||
|
||||
# vim: sw=4 sts=4 si ai et
|
||||
|
||||
@@ -25,19 +25,19 @@
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\exchanges\internal\exchanges\gemini
|
||||
namespace dfi\exchanges\internal\exchanges\gemini
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/base.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
|
||||
use docker_finance\utils as utils;
|
||||
use dfi\utils as utils;
|
||||
use DateTime; // PHP
|
||||
|
||||
/**
|
||||
* @brief Common implementaion
|
||||
* @since docker-finance 1.0.0
|
||||
*/
|
||||
abstract class Impl extends \docker_finance\exchanges\internal\Impl
|
||||
abstract class Impl extends \dfi\exchanges\internal\Impl
|
||||
{
|
||||
private \ccxt\gemini $api;
|
||||
|
||||
@@ -483,11 +483,11 @@ namespace docker_finance\exchanges\internal\exchanges\gemini
|
||||
);
|
||||
}
|
||||
}
|
||||
} // namespace docker_finance\exchanges\internal\exchanges\gemini
|
||||
} // namespace dfi\exchanges\internal\exchanges\gemini
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\exchanges\internal\exchanges
|
||||
namespace dfi\exchanges\internal\exchanges
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'exchanges/internal/base.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
@@ -497,13 +497,13 @@ namespace docker_finance\exchanges\internal\exchanges
|
||||
* @ingroup php_exchanges
|
||||
* @since docker-finance 1.0.0
|
||||
*/
|
||||
final class Gemini extends \docker_finance\exchanges\API
|
||||
final class Gemini extends \dfi\exchanges\API
|
||||
{
|
||||
private gemini\Trades $trades;
|
||||
private gemini\Transactions $transactions;
|
||||
private gemini\Earn $earn;
|
||||
|
||||
public function __construct(\docker_finance\utils\Env $env)
|
||||
public function __construct(\dfi\utils\Env $env)
|
||||
{
|
||||
$this->trades = new gemini\Trades($env);
|
||||
$this->transactions = new gemini\Transactions($env);
|
||||
@@ -517,6 +517,6 @@ namespace docker_finance\exchanges\internal\exchanges
|
||||
$this->earn->fetch();
|
||||
}
|
||||
}
|
||||
} // namespace docker_finance\exchanges\internal\exchanges
|
||||
} // namespace dfi\exchanges\internal\exchanges
|
||||
|
||||
# vim: sw=4 sts=4 si ai et
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace {
|
||||
define('__DFI_PHP_ROOT__', getenv('__DFI_PHP_ROOT__') . '/');
|
||||
}
|
||||
|
||||
namespace docker_finance
|
||||
namespace dfi
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'blockchains/fetch.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'exchanges/fetch.php');
|
||||
@@ -135,13 +135,13 @@ namespace docker_finance
|
||||
assert(isset($api));
|
||||
$api->fetch();
|
||||
}
|
||||
} // namespace docker_finance
|
||||
} // namespace dfi
|
||||
|
||||
namespace {
|
||||
try {
|
||||
docker_finance\main($argc, $argv);
|
||||
dfi\main($argc, $argv);
|
||||
} catch (Throwable $e) {
|
||||
docker_finance\utils\CLI::print_fatal(
|
||||
dfi\utils\CLI::print_fatal(
|
||||
"\n\t" . $e->getMessage() . "\n\t" .
|
||||
$e->getFile() . ':' . $e->getLine()
|
||||
);
|
||||
|
||||
@@ -25,13 +25,13 @@
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\prices
|
||||
namespace dfi\prices
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'prices/internal/base.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'prices/internal/prices/crypto.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
|
||||
use docker_finance\utils as utils;
|
||||
use dfi\utils as utils;
|
||||
|
||||
/**
|
||||
* @brief Price fetcher API
|
||||
@@ -71,6 +71,6 @@ namespace docker_finance\prices
|
||||
$this->api->fetch();
|
||||
}
|
||||
}
|
||||
} // namespace docker_finance\prices
|
||||
} // namespace dfi\prices
|
||||
|
||||
# vim: sw=4 sts=4 si ai et
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\prices\internal
|
||||
namespace dfi\prices\internal
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
|
||||
use docker_finance\utils as utils;
|
||||
use dfi\utils as utils;
|
||||
|
||||
/**
|
||||
* @brief Common implementaion interface
|
||||
@@ -437,15 +437,15 @@ namespace docker_finance\prices\internal
|
||||
$this->writer($master, $this->get_env()->get_env('API_PRICES_PATH'));
|
||||
}
|
||||
}
|
||||
} // namespace docker_finance\prices\internal
|
||||
} // namespace dfi\prices\internal
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\prices
|
||||
namespace dfi\prices
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
|
||||
use docker_finance\utils as utils;
|
||||
use dfi\utils as utils;
|
||||
|
||||
/**
|
||||
* @brief Top-level abstraction for API
|
||||
@@ -467,6 +467,6 @@ namespace docker_finance\prices
|
||||
|
||||
abstract public function fetch(): void;
|
||||
}
|
||||
} // namespace docker_finance\prices
|
||||
} // namespace dfi\prices
|
||||
|
||||
# vim: sw=4 sts=4 si ai et
|
||||
|
||||
@@ -25,13 +25,13 @@
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\prices\internal\prices\crypto
|
||||
namespace dfi\prices\internal\prices\crypto
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'prices/internal/base.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
|
||||
use docker_finance\prices\internal as internal;
|
||||
use docker_finance\utils as utils;
|
||||
use dfi\prices\internal as internal;
|
||||
use dfi\utils as utils;
|
||||
|
||||
/**
|
||||
* @brief CoinGecko price aggregator API
|
||||
@@ -233,23 +233,23 @@ namespace docker_finance\prices\internal\prices\crypto
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace docker_finance\prices\internal\prices\crypto
|
||||
} // namespace dfi\prices\internal\prices\crypto
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\prices\internal\prices
|
||||
namespace dfi\prices\internal\prices
|
||||
{
|
||||
require_once(__DFI_PHP_ROOT__ . 'prices/internal/base.php');
|
||||
require_once(__DFI_PHP_ROOT__ . 'utils/utils.php');
|
||||
|
||||
use docker_finance\utils as utils;
|
||||
use dfi\utils as utils;
|
||||
|
||||
/**
|
||||
* @brief Facade for CoinGecko implementation
|
||||
* @ingroup php_prices
|
||||
* @since docker-finance 1.0.0
|
||||
*/
|
||||
final class CoinGecko extends \docker_finance\prices\API
|
||||
final class CoinGecko extends \dfi\prices\API
|
||||
{
|
||||
private crypto\CoinGecko $api; //!< Internal API
|
||||
|
||||
@@ -269,7 +269,7 @@ namespace docker_finance\prices\internal\prices
|
||||
* @ingroup php_prices
|
||||
* @since docker-finance 1.0.0
|
||||
*/
|
||||
final class Mobula extends \docker_finance\prices\API
|
||||
final class Mobula extends \dfi\prices\API
|
||||
{
|
||||
private crypto\Mobula $api; //!< Internal API
|
||||
|
||||
@@ -283,6 +283,6 @@ namespace docker_finance\prices\internal\prices
|
||||
$this->api->fetcher();
|
||||
}
|
||||
}
|
||||
} // namespace docker_finance\prices\internal\prices
|
||||
} // namespace dfi\prices\internal\prices
|
||||
|
||||
# vim: sw=4 sts=4 si ai et
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
//! @since docker-finance 1.0.0
|
||||
|
||||
namespace docker_finance\utils
|
||||
namespace dfi\utils
|
||||
{
|
||||
/**
|
||||
* @brief Environment mapper
|
||||
@@ -150,6 +150,6 @@ namespace docker_finance\utils
|
||||
fclose($tmpfile);
|
||||
}
|
||||
}
|
||||
} // namespace docker_finance\utils\error
|
||||
} // namespace dfi\utils\error
|
||||
|
||||
# vim: sw=4 sts=4 si ai et
|
||||
|
||||
Reference in New Issue
Block a user