hashflare-0.1.0.0: A library for working with HashFlare.io contracts and hashrates

Safe HaskellSafe
LanguageHaskell2010

Data.HashFlare

Description

A simple model of HashFlare.io services

Synopsis

Documentation

type MEFTable = Map TypeRep (Money USD, Double) Source #

Type representing costs for the hardware MEFs: key is algo type, value is (costs, rate quantity)

makeMEFTable :: [(TypeRep, (Money USD, Double))] -> MEFTable Source #

Construct MEF table

type PayoutTable = Map TypeRep (Money BTC, Double) Source #

Type representing actual (or projected) payouts wrt algo from mining pools XXX

makePayoutTable :: [(TypeRep, (Money BTC, Double))] -> PayoutTable Source #

Construct mining payouts table

data MiningContract Source #

HashFlare.io mining contract

makeMiningContract :: MiningAlgorithm a => Hashrate a -> Money USD -> Int -> MiningContract Source #

Construct a new mining contract with hashrate, cost and expiration days

makeMiningContractSimple :: MiningAlgorithm a => Hashrate a -> MiningContract Source #

Make the contract without costs and expiration (suppose you didn't invest your money..)

data UserAccount Source #

HashFlare.io account

makeUserAccount :: Money BTC -> [MiningContract] -> UserAccount Source #

Construct a new HashFlare.io user account model with start balance and the list of mining contracts

contractHashrate :: MiningContract -> Hashrate a Source #

Hashrate provided by the contract

contractCost :: MiningContract -> Money USD Source #

Base cost of the contract

contractExpiration :: MiningContract -> Int Source #

Contract expiration, in days (or 0 for n/a)

contractMEF :: MEFTable -> MiningContract -> Money USD Source #

Calculate MEF costs for the contract

contractPayout :: PayoutTable -> MiningContract -> Money BTC Source #

Calculate contract's hashrate payout

accountBalance :: UserAccount -> Money BTC Source #

Current account balance (in Bitcoins)

accountContracts :: UserAccount -> [MiningContract] Source #

List of current mining contracts

userAccountMEF :: MEFTable -> UserAccount -> Money USD Source #

Total MEF for the account (in USD)

userAccountPayout :: PayoutTable -> UserAccount -> Money BTC Source #

Total payout for the account

infoUserAccount :: UserAccount -> String Source #

Pretty-print info on the user account

defaultMEFTable :: MEFTable Source #

Default HashFlare.io MEF prices (no record means no MEF)