Skip to content

Commit ba67b5b

Browse files
committed
additional coins
1 parent 97462ab commit ba67b5b

File tree

5 files changed

+41
-2
lines changed

5 files changed

+41
-2
lines changed

balances.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ func CryptoBalance(coin, address string) string {
1616
fmt.Println(err)
1717
return "0"
1818
}
19+
case "BCH":
20+
balance, err = BitcoinBalance(BCHapi, address)
21+
if err != nil {
22+
fmt.Println(err)
23+
return "0"
24+
}
25+
case "BCHTEST":
26+
balance, err = BitcoinBalance(BCHTESTapi, address)
27+
if err != nil {
28+
fmt.Println(err)
29+
return "0"
30+
}
1931
case "BTCTEST":
2032
balance, err = BitcoinBalance(BTCTESTapi, address)
2133
if err != nil {
@@ -32,10 +44,22 @@ func CryptoBalance(coin, address string) string {
3244
if err != nil {
3345
return "0"
3446
}
47+
case "DASH":
48+
balance, err = BitcoinBalance(DASHapi, address)
49+
if err != nil {
50+
return "0"
51+
}
52+
case "ZCASH":
53+
balance, err = BitcoinBalance(ZCASHapi, address)
54+
if err != nil {
55+
return "0"
56+
}
3557
case "ETH":
3658
balance = EthBalance(eth, address)
3759
case "ROPSTEN":
3860
balance = EthBalance(ropsten, address)
61+
case "RINKEBY":
62+
balance = EthBalance(rinkeby, address)
3963
default:
4064
balance = "0"
4165
}

ethereum.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
var (
1616
eth *ethclient.Client
1717
ropsten *ethclient.Client
18+
rinkeby *ethclient.Client
1819
)
1920

2021
func LoadEthBlockchains() error {
@@ -27,6 +28,10 @@ func LoadEthBlockchains() error {
2728
if err != nil {
2829
return err
2930
}
31+
rinkeby, err = ethclient.Dial(RINKEBYapi)
32+
if err != nil {
33+
return err
34+
}
3035
return err
3136
}
3237

handlers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ func StartHTTPServer() {
2424
r := Router()
2525
srv := &http.Server{
2626
Addr: "0.0.0.0:9090",
27-
WriteTimeout: time.Second * 5,
28-
ReadTimeout: time.Second * 5,
27+
WriteTimeout: time.Second * 10,
28+
ReadTimeout: time.Second * 10,
2929
IdleTimeout: time.Second * 30,
3030
Handler: r,
3131
}

main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ var (
1111
LTCTESTapi string
1212
ETHapi string
1313
ROPSTENapi string
14+
RINKEBYapi string
15+
DASHapi string
16+
ZCASHapi string
17+
BCHapi string
18+
BCHTESTapi string
1419
statusHourHits int64
1520
)
1621

utils.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ func GetEnv() {
1515
LTCTESTapi = os.Getenv("LTCTEST")
1616
ETHapi = os.Getenv("ETH")
1717
ROPSTENapi = os.Getenv("ROPSTEN")
18+
RINKEBYapi = os.Getenv("RINKEBY")
19+
DASHapi = os.Getenv("DASH")
20+
ZCASHapi = os.Getenv("ZCASH")
21+
BCHapi = os.Getenv("BCH")
22+
BCHTESTapi = os.Getenv("BCHTEST")
1823
}
1924

2025
func CoinMarketCapTicker() {

0 commit comments

Comments
 (0)