bitcoin-client
bitcoin client library for price ticker and wallet
git clone https://9o.is/git/bitcoin-client.git
BitcoinService.scala
(824B)
1 package inc.pyc.bitcoin
2
3 import service._
4 import akka.actor.Props
5 import provider._
6
7 /**
8 * The different choices of bitcoin services.
9 */
10 object BitcoinService extends Enumeration {
11 type BitcoinService = Value
12 val BitStamp, BlockChain, BtcWallet = Value
13
14 def props(serv: BitcoinService): Props = props(fqcn(serv))
15 def props(fqcn: String): Props = Props(Class forName fqcn)
16
17 /**
18 * All bitcoin services that have a price ticker.
19 */
20 def priceTickers: List[BitcoinService] = List(
21 BitStamp, BlockChain)
22
23 /**
24 * All bitcoin services that have a wallet.
25 */
26 def wallets: List[BitcoinService] = List(
27 BtcWallet, BlockChain)
28
29 /*
30 * Creates FQCN given the `BitcoinService` value.
31 */
32 private def fqcn(serv: BitcoinService) =
33 "inc.pyc.bitcoin.provider."+serv.toString()
34 }