interface Account \ AccountType

All known implementing classes:
SimpleAccountType, AbstractMMCFEAccount, AbstractMPOSAccount, AbstractMiner, BTCGuild, Beeeeer, BitMinter, CoinHuntr, CryptoPoolsDGC, CryptoTrollDOGE, D2WDC, DedicatedPoolDOGE, DogechainPool, DogepoolPw, EcoiningPeercoin, Eligius, ElitistJerks, Eobot, FiftyBTC, GHashIO, GiveMeCoins, HashFasterDOGE, HashFasterFTC, HashFasterLTC, HashToCoins, HypernovaPw, Kattare, KhoreNVC, LTCMineRu, LiteGuardian, Lite_CoinPool, LitecoinPool, LitepoolEu, MiningForemanFTC, MiningForemanLTC, MiningPoolCo, MuPool, Multipool, NiceHash, Nut2PoolsFTC, OzCoinBTC, OzCoinLTC, PoolX, RapidHashDOGE, RapidHashVTC, ScryptGuild, ScryptPools, ShibePool, Slush, SmallTimeMinerMEC, TeamDoge, TripleMining, WeMineFTC, WeMineLTC, WestHash, YPool, AbstractAnx, AbstractWallet, Anxpro, BTCLevels, BTCe, Bips, Bit2c, BitMarketPl, BitNZ, BitcurexEUR, BitcurexPLN, Bitstamp, Bittrex, CEXio, Coinbase, CryptoTrade, Cryptsy, Justcoin, JustcoinAnx, Kraken, MtGox, Poloniex, VaultOfSatoshi, Vircurex

Represents some type of third-party account, for example a mining pool, exchange, wallet, miner.

Instances of this account may be represented as an Account, and can be used to obtain current balances for this account. For example, get the current wallet balances for a mining pool or exchange wallet.

In theory this could also be extended to cryptocurrency addresses?


Method Summary

Name Description
checkFields($account) Check that all of these given account fields satisfy the requirements of #getFields().
fetchBalance($currency, $account, CurrencyFactory $factory, Logger $logger) Helper function to get all balances for the given currency for this account, or null if there is no balance for this currency. May block.
fetchBalances($account, CurrencyFactory $factory, Logger $logger) Get all balances for this account. May block.
fetchConfirmedBalance($currency, $account, CurrencyFactory $factory, Logger $logger) Helper function to get the current, confirmed, available balance of the given currency for this account. May block.
fetchSupportedCurrencies(CurrencyFactory $factory, Logger $logger) Get a list of all the currencies supported by this account (e.g. "btc", "ltc", ...). Uses currency codes from openclerk/currencies. May block.
getCode()
getFields()
getName()

public function checkFields($account)

Check that all of these given account fields satisfy the requirements of #getFields().

Returns:
empty array on success, or an array of (key => array(errors)) if not successful

public function fetchBalance($currency, $account, CurrencyFactory $factory, Logger $logger)

Helper function to get all balances for the given currency for this account, or null if there is no balance for this currency. May block.

We need to have a reference to a CurrencyFactory because we might need to find out runtime properties of a currency in order to correctly distinguish hash rates, currency codes etc.

Parameters:
$account - fields that satisfy #getFields()
Returns:
array('confirmed', 'unconfirmed', 'hashrate', ...) or null

public function fetchBalances($account, CurrencyFactory $factory, Logger $logger)

Get all balances for this account. May block.

We need to have a reference to a CurrencyFactory because we might need to find out runtime properties of a currency in order to correctly distinguish hash rates, currency codes etc.

Returned results may include: - confirmed: raw confirmed currency balance (e.g. 1.0 = 1 BTC) - unconfirmed: raw unconfirmed balance (e.g. 1.0 = 1 BTC) - hashrate: raw hash rate per second (e.g. 1.0 = 1 H/s) - workers: number of workers

Parameters:
$account - fields that satisfy #getFields()
Returns:
an array of ('cur' => ('confirmed', 'unconfirmed', 'hashrate', ...))

public function fetchConfirmedBalance($currency, $account, CurrencyFactory $factory, Logger $logger)

Helper function to get the current, confirmed, available balance of the given currency for this account. May block.

We need to have a reference to a CurrencyFactory because we might need to find out runtime properties of a currency in order to correctly distinguish hash rates, currency codes etc.

Parameters:
$account - fields that satisfy #getFields()

public function fetchSupportedCurrencies(CurrencyFactory $factory, Logger $logger)

Get a list of all the currencies supported by this account (e.g. "btc", "ltc", ...). Uses currency codes from openclerk/currencies. May block.

We need to have a reference to a CurrencyFactory because we might need to find out runtime properties of a currency in order to correctly distinguish hash rates, currency codes etc.


public function getCode()

Returns:
a unique string representing this account type; must be lowercase and 1-32 characters

public function getFields()

Returns:
an array of fields that need to be provided in order to get balances, e.g. API keys

public function getName()

Returns:
the full name of the account type