This repository was archived by the owner on Mar 15, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +49
-16
lines changed Expand file tree Collapse file tree 7 files changed +49
-16
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ class Module extends \yii\base\Module
18
18
19
19
public $ allowedUsers ;
20
20
21
+ public $ mainPageCache = 0 ;
22
+
21
23
public function init ()
22
24
{
23
25
parent ::init ();
Original file line number Diff line number Diff line change 1
1
<?php
2
- /**
3
- * Created by PhpStorm.
4
- * User: alexanderzhilyaev
5
- * Date: 02.09.17
6
- * Time: 19:17
7
- */
8
2
9
3
namespace aleksandrzhiliaev \altcoind \clients ;
10
4
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ class Altcoin extends Component
11
11
/**
12
12
* @var EasyBitcoin
13
13
*/
14
- private $ altcoinClient ;
14
+ protected $ altcoinClient ;
15
15
16
16
public $ username ;
17
17
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace aleksandrzhiliaev \altcoind \components ;
4
+
5
+ use ErrorException ;
6
+
7
+ class Zcash extends Altcoin
8
+ {
9
+
10
+ public function generateAddress ($ accountName = '' )
11
+ {
12
+ $ address = $ this ->altcoinClient ->getnewaddress ();
13
+ if ($ this ->altcoinClient ->error == "" ) {
14
+ return $ address ;
15
+ } else {
16
+ throw new ErrorException ('getnewaddress error: ' .$ this ->altcoinClient ->error );
17
+ }
18
+ }
19
+
20
+ public function showAddresses ($ accountName = '' )
21
+ {
22
+ $ datas = $ this ->altcoinClient ->listreceivedbyaddress (0 , true );
23
+ if ($ this ->altcoinClient ->error == "" ) {
24
+ $ onlyAddressesList = [];
25
+ foreach ($ datas as $ data ) {
26
+ $ onlyAddressesList [] = $ data ['address ' ];
27
+ }
28
+
29
+ return $ onlyAddressesList ;
30
+ } else {
31
+ throw new ErrorException ('z_listaddresses error: ' .$ this ->altcoinClient ->error );
32
+ }
33
+ }
34
+
35
+
36
+ }
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ public function behaviors()
30
30
[
31
31
'class ' => 'yii\filters\PageCache ' ,
32
32
'only ' => ['index ' ],
33
- 'duration ' => 60 ,
33
+ 'duration ' => $ this -> module -> mainPageCache ,
34
34
],
35
35
];
36
36
}
@@ -88,8 +88,8 @@ public function actionNewaddress($currency)
88
88
{
89
89
try {
90
90
$ address = Yii::$ app ->get ($ currency )->generateAddress ();
91
- Yii:: $ app -> session -> setFlash ( ' newAddress ' , $ address );
92
-
91
+ $ this -> renderContent ( ' New generated address: ' . $ address );
92
+ Yii:: $ app -> end ();
93
93
} catch (\Exception $ e ) {
94
94
\Yii::error ($ e ->getMessage ());
95
95
}
Original file line number Diff line number Diff line change 33
33
<?php } ?>
34
34
35
35
<?php if ($ currency == 'ethereum ' ) { ?>
36
- <a href="https://etherscan.io/address/<?= $ address ?> "
37
- target="_blank"><?= $ address ?> </a>
36
+ <a href="https://etherscan.io/address/<?= $ address ?> " target="_blank"><?= $ address ?> </a>
37
+ <?php } ?>
38
+
39
+ <?php if ($ currency == 'zcash ' ) { ?>
40
+ <a href="https://zchain.online/address/<?= $ address ?> " target="_blank"><?= $ address ?> </a>
38
41
<?php } ?>
39
42
</td>
40
43
Original file line number Diff line number Diff line change 10
10
/* @var $transferForm TransferForm */
11
11
12
12
13
- $ this ->title = Yii::t ('app ' , 'Wallets ' );
13
+ $ this ->title = Yii::t ('app ' , 'Your wallets ' );
14
14
$ this ->params ['breadcrumbs ' ][] = $ this ->title ;
15
15
?>
16
16
<div class="log-index">
88
88
'litecoin ' => 'LTC ' ,
89
89
'ethereum ' => 'ETH ' ,
90
90
'monero ' => 'XMR ' ,
91
+ 'zcash ' => 'ZEC ' ,
91
92
]) ?>
92
93
93
94
97
98
98
99
<?php ActiveForm::end (); ?>
99
100
100
- <p>
101
- That page is cached in 60 sec, for actual information please use Info buttons.
102
- </p>
103
101
104
102
</div>
You can’t perform that action at this time.
0 commit comments