Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
Breeze
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
Breeze
Commits
9e474442
Commit
9e474442
authored
Sep 26, 2017
by
dev0tion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show correct abbreviation everywhere, prepare mainnet abbreviations
parent
8ff8f864
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
70 additions
and
32 deletions
+70
-32
login.component.ts
Breeze.UI/src/app/login/login.component.ts
+2
-1
coin-notation.pipe.ts
Breeze.UI/src/app/shared/pipes/coin-notation.pipe.ts
+26
-13
api.service.ts
Breeze.UI/src/app/shared/services/api.service.ts
+2
-2
global.service.ts
Breeze.UI/src/app/shared/services/global.service.ts
+20
-6
send-confirmation.component.html
...t/send/send-confirmation/send-confirmation.component.html
+1
-1
send-confirmation.component.ts
...let/send/send-confirmation/send-confirmation.component.ts
+5
-2
send.component.html
Breeze.UI/src/app/wallet/send/send.component.html
+1
-1
send.component.ts
Breeze.UI/src/app/wallet/send/send.component.ts
+7
-2
sidebar.component.ts
Breeze.UI/src/app/wallet/sidebar/sidebar.component.ts
+6
-4
No files found.
Breeze.UI/src/app/login/login.component.ts
View file @
9e474442
...
@@ -126,7 +126,8 @@ export class LoginComponent implements OnInit {
...
@@ -126,7 +126,8 @@ export class LoginComponent implements OnInit {
response
=>
{
response
=>
{
if
(
response
.
status
>=
200
&&
response
.
status
<
400
)
{
if
(
response
.
status
>=
200
&&
response
.
status
<
400
)
{
// Set Bitcoin as the default wallet
// Set Bitcoin as the default wallet
this
.
globalService
.
setCoinName
(
"Bitcoin"
);
this
.
globalService
.
setCoinName
(
"TestBitcoin"
);
this
.
globalService
.
setCoinUnit
(
"TBTC"
);
this
.
globalService
.
setWalletName
(
walletLoad
.
name
);
this
.
globalService
.
setWalletName
(
walletLoad
.
name
);
this
.
globalService
.
setCoinType
(
1
);
this
.
globalService
.
setCoinType
(
1
);
}
}
...
...
Breeze.UI/src/app/shared/pipes/coin-notation.pipe.ts
View file @
9e474442
...
@@ -9,7 +9,6 @@ export class CoinNotationPipe implements PipeTransform {
...
@@ -9,7 +9,6 @@ export class CoinNotationPipe implements PipeTransform {
this
.
setCoinUnit
();
this
.
setCoinUnit
();
}
}
private
coinName
=
this
.
globalService
.
getCoinName
();
private
coinUnit
:
string
;
private
coinUnit
:
string
;
private
coinNotation
:
number
;
private
coinNotation
:
number
;
private
decimalLimit
=
8
;
private
decimalLimit
=
8
;
...
@@ -20,37 +19,51 @@ export class CoinNotationPipe implements PipeTransform {
...
@@ -20,37 +19,51 @@ export class CoinNotationPipe implements PipeTransform {
switch
(
this
.
getCoinUnit
())
{
switch
(
this
.
getCoinUnit
())
{
case
"BTC"
:
case
"BTC"
:
temp
=
value
/
100000000
;
temp
=
value
/
100000000
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
"
T
BTC"
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" BTC"
;
case
"mBTC"
:
case
"mBTC"
:
temp
=
value
/
100000
;
temp
=
value
/
100000
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
"
T
mBTC"
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" mBTC"
;
case
"uBTC"
:
case
"uBTC"
:
temp
=
value
/
100
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" uBTC"
;
case
"TBTC"
:
temp
=
value
/
100000000
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" TBTC"
;
case
"TmBTC"
:
temp
=
value
/
100000
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" TmBTC"
;
case
"TuBTC"
:
temp
=
value
/
100
;
temp
=
value
/
100
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" TuBTC"
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" TuBTC"
;
case
"STRAT"
:
case
"STRAT"
:
temp
=
value
/
100000000
;
temp
=
value
/
100000000
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
"
T
STRAT"
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" STRAT"
;
case
"mSTRAT"
:
case
"mSTRAT"
:
temp
=
value
/
100000
;
temp
=
value
/
100000
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
"
T
mSTRAT"
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" mSTRAT"
;
case
"uSTRAT"
:
case
"uSTRAT"
:
temp
=
value
/
100
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" uSTRAT"
;
case
"TSTRAT"
:
temp
=
value
/
100000000
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" TSTRAT"
;
case
"TmSTRAT"
:
temp
=
value
/
100000
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" TmSTRAT"
;
case
"TuSTRAT"
:
temp
=
value
/
100
;
temp
=
value
/
100
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" TuSTRAT"
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" TuSTRAT"
;
}
}
}
}
}
}
setCoinUnit
()
{
if
(
this
.
coinName
===
"Bitcoin"
)
{
this
.
coinUnit
=
"BTC"
;
}
else
if
(
this
.
coinName
===
"Stratis"
)
{
this
.
coinUnit
=
"STRAT"
}
};
getCoinUnit
()
{
getCoinUnit
()
{
return
this
.
coinUnit
;
return
this
.
coinUnit
;
}
}
setCoinUnit
()
{
this
.
coinUnit
=
this
.
globalService
.
getCoinUnit
();
};
}
}
Breeze.UI/src/app/shared/services/api.service.ts
View file @
9e474442
...
@@ -32,9 +32,9 @@ export class ApiService {
...
@@ -32,9 +32,9 @@ export class ApiService {
private
getCurrentCoin
()
{
private
getCurrentCoin
()
{
let
currentCoin
=
this
.
globalService
.
getCoinName
();
let
currentCoin
=
this
.
globalService
.
getCoinName
();
if
(
currentCoin
===
"Bitcoin"
)
{
if
(
currentCoin
===
"Bitcoin"
||
currentCoin
===
"TestBitcoin"
)
{
this
.
currentApiUrl
=
this
.
bitcoinApiUrl
;
this
.
currentApiUrl
=
this
.
bitcoinApiUrl
;
}
else
if
(
currentCoin
===
"Stratis"
)
{
}
else
if
(
currentCoin
===
"Stratis"
||
currentCoin
===
"TestStratis"
)
{
this
.
currentApiUrl
=
this
.
stratisApiUrl
;
this
.
currentApiUrl
=
this
.
stratisApiUrl
;
}
}
}
}
...
...
Breeze.UI/src/app/shared/services/global.service.ts
View file @
9e474442
...
@@ -7,18 +7,24 @@ export class GlobalService {
...
@@ -7,18 +7,24 @@ export class GlobalService {
private
walletPath
:
string
;
private
walletPath
:
string
;
private
currentWalletName
:
string
;
private
currentWalletName
:
string
;
private
coinType
:
number
=
0
;
private
coinType
:
number
=
0
;
private
coinName
:
string
=
"Bitcoin"
;
private
coinName
:
string
=
"TestBitcoin"
;
private
coinUnit
:
string
=
"TBTC"
;
private
network
:
string
=
"TestNet"
;
getWalletPath
()
{
getWalletPath
()
{
return
this
.
walletPath
;
return
this
.
walletPath
;
}
}
setWalletPath
(
walletPath
:
string
)
{
this
.
walletPath
=
walletPath
;
}
getNetwork
()
{
getNetwork
()
{
return
"TestNet"
;
return
this
.
network
;
}
}
set
WalletPath
(
walletPath
:
string
)
{
set
Network
(
network
:
string
)
{
this
.
walletPath
=
walletPath
;
this
.
network
=
network
;
}
}
getWalletName
()
{
getWalletName
()
{
...
@@ -29,7 +35,7 @@ export class GlobalService {
...
@@ -29,7 +35,7 @@ export class GlobalService {
this
.
currentWalletName
=
currentWalletName
;
this
.
currentWalletName
=
currentWalletName
;
}
}
getCoinType
()
{
getCoinType
()
{
return
this
.
coinType
;
return
this
.
coinType
;
}
}
...
@@ -37,11 +43,19 @@ export class GlobalService {
...
@@ -37,11 +43,19 @@ export class GlobalService {
this
.
coinType
=
coinType
;
this
.
coinType
=
coinType
;
}
}
getCoinName
()
{
getCoinName
()
{
return
this
.
coinName
;
return
this
.
coinName
;
}
}
setCoinName
(
coinName
:
string
)
{
setCoinName
(
coinName
:
string
)
{
this
.
coinName
=
coinName
;
this
.
coinName
=
coinName
;
}
}
getCoinUnit
()
{
return
this
.
coinUnit
;
}
setCoinUnit
(
coinUnit
:
string
)
{
this
.
coinUnit
=
coinUnit
;
}
}
}
Breeze.UI/src/app/wallet/send/send-confirmation/send-confirmation.component.html
View file @
9e474442
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
</ul>
</ul>
<ul
class=
"list-inline row"
>
<ul
class=
"list-inline row"
>
<li
class=
"list-inline-item col blockLabel"
>
Amount
</li>
<li
class=
"list-inline-item col blockLabel"
>
Amount
</li>
<li
class=
"list-inline-item col-9 blockText text-danger"
>
-{{ transaction.amount | number:'1.8-8' }}
TBTC
</li>
<li
class=
"list-inline-item col-9 blockText text-danger"
>
-{{ transaction.amount | number:'1.8-8' }}
{{ coinUnit }}
</li>
</ul>
</ul>
<ul
class=
"list-inline row"
>
<ul
class=
"list-inline row"
>
<li
class=
"list-inline-item col blockLabel"
>
Destination
</li>
<li
class=
"list-inline-item col blockLabel"
>
Destination
</li>
...
...
Breeze.UI/src/app/wallet/send/send-confirmation/send-confirmation.component.ts
View file @
9e474442
...
@@ -2,6 +2,8 @@ import { Component, OnInit, Input } from '@angular/core';
...
@@ -2,6 +2,8 @@ import { Component, OnInit, Input } from '@angular/core';
import
{
NgbModal
,
NgbActiveModal
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
NgbModal
,
NgbActiveModal
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
GlobalService
}
from
'../../../shared/services/global.service'
;
@
Component
({
@
Component
({
selector
:
'app-send-confirmation'
,
selector
:
'app-send-confirmation'
,
templateUrl
:
'./send-confirmation.component.html'
,
templateUrl
:
'./send-confirmation.component.html'
,
...
@@ -10,12 +12,13 @@ import { NgbModal, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
...
@@ -10,12 +12,13 @@ import { NgbModal, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
export
class
SendConfirmationComponent
implements
OnInit
{
export
class
SendConfirmationComponent
implements
OnInit
{
@
Input
()
transaction
:
any
;
@
Input
()
transaction
:
any
;
constructor
(
public
activeModal
:
NgbActiveModal
)
{
}
constructor
(
p
rivate
globalService
:
GlobalService
,
p
ublic
activeModal
:
NgbActiveModal
)
{
}
private
showDetails
:
boolean
=
false
;
private
showDetails
:
boolean
=
false
;
private
coinUnit
:
string
;
ngOnInit
()
{
ngOnInit
()
{
console
.
log
(
this
.
transaction
);
this
.
coinUnit
=
this
.
globalService
.
getCoinUnit
(
);
}
}
toggleDetails
()
{
toggleDetails
()
{
...
...
Breeze.UI/src/app/wallet/send/send.component.html
View file @
9e474442
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
<div
class=
"form-group clearfix"
>
<div
class=
"form-group clearfix"
>
<label
class=
"float-left"
for=
"yourAddress"
>
Amount
</label>
<label
class=
"float-left"
for=
"yourAddress"
>
Amount
</label>
<!--<span class="float-right"><a href="#">max</a></span>-->
<!--<span class="float-right"><a href="#">max</a></span>-->
<input
type=
"text"
class=
"form-control form-control-danger"
formControlName=
"amount"
id=
"Amount"
placeholder=
"0.00
BTC
"
>
<input
type=
"text"
class=
"form-control form-control-danger"
formControlName=
"amount"
id=
"Amount"
placeholder=
"0.00
{{ coinUnit }}
"
>
<div
*
ngIf=
"formErrors.amount"
class=
"form-control-feedback"
>
{{ formErrors.amount }}
</div>
<div
*
ngIf=
"formErrors.amount"
class=
"form-control-feedback"
>
{{ formErrors.amount }}
</div>
</div>
</div>
<!--<div class="form-group has-success">-->
<!--<div class="form-group has-success">-->
...
...
Breeze.UI/src/app/wallet/send/send.component.ts
View file @
9e474442
import
{
Component
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
ApiService
}
from
'../../shared/services/api.service'
;
import
{
ApiService
}
from
'../../shared/services/api.service'
;
import
{
GlobalService
}
from
'../../shared/services/global.service'
;
import
{
GlobalService
}
from
'../../shared/services/global.service'
;
import
{
FormGroup
,
FormControl
,
Validators
,
FormBuilder
}
from
'@angular/forms'
;
import
{
FormGroup
,
FormControl
,
Validators
,
FormBuilder
}
from
'@angular/forms'
;
...
@@ -16,7 +16,7 @@ import { SendConfirmationComponent } from './send-confirmation/send-confirmation
...
@@ -16,7 +16,7 @@ import { SendConfirmationComponent } from './send-confirmation/send-confirmation
styleUrls
:
[
'./send.component.css'
],
styleUrls
:
[
'./send.component.css'
],
})
})
export
class
SendComponent
{
export
class
SendComponent
implements
OnInit
{
constructor
(
private
apiService
:
ApiService
,
private
globalService
:
GlobalService
,
private
modalService
:
NgbModal
,
public
activeModal
:
NgbActiveModal
,
private
fb
:
FormBuilder
)
{
constructor
(
private
apiService
:
ApiService
,
private
globalService
:
GlobalService
,
private
modalService
:
NgbModal
,
public
activeModal
:
NgbActiveModal
,
private
fb
:
FormBuilder
)
{
this
.
buildSendForm
();
this
.
buildSendForm
();
}
}
...
@@ -24,8 +24,13 @@ export class SendComponent {
...
@@ -24,8 +24,13 @@ export class SendComponent {
private
sendForm
:
FormGroup
;
private
sendForm
:
FormGroup
;
private
responseMessage
:
any
;
private
responseMessage
:
any
;
private
errorMessage
:
string
;
private
errorMessage
:
string
;
private
coinUnit
:
string
;
private
transaction
:
TransactionBuilding
;
private
transaction
:
TransactionBuilding
;
ngOnInit
()
{
this
.
coinUnit
=
this
.
globalService
.
getCoinUnit
();
}
private
buildSendForm
():
void
{
private
buildSendForm
():
void
{
this
.
sendForm
=
this
.
fb
.
group
({
this
.
sendForm
=
this
.
fb
.
group
({
"address"
:
[
""
,
Validators
.
required
],
"address"
:
[
""
,
Validators
.
required
],
...
...
Breeze.UI/src/app/wallet/sidebar/sidebar.component.ts
View file @
9e474442
...
@@ -16,22 +16,24 @@ export class SidebarComponent implements OnInit {
...
@@ -16,22 +16,24 @@ export class SidebarComponent implements OnInit {
private
bitcoinActive
:
Boolean
;
private
bitcoinActive
:
Boolean
;
ngOnInit
()
{
ngOnInit
()
{
if
(
this
.
globalService
.
getCoinName
()
===
"Bitcoin"
)
{
if
(
this
.
globalService
.
getCoinName
()
===
"Bitcoin"
||
this
.
globalService
.
getCoinName
()
===
"TestBitcoin"
)
{
this
.
bitcoinActive
=
true
;
this
.
bitcoinActive
=
true
;
}
else
if
(
this
.
globalService
.
getCoinName
()
===
"Stratis"
)
{
}
else
if
(
this
.
globalService
.
getCoinName
()
===
"Stratis"
||
this
.
globalService
.
getCoinName
()
===
"TestStratis"
)
{
this
.
bitcoinActive
=
false
;
this
.
bitcoinActive
=
false
;
}
}
}
}
private
loadBitcoinWallet
()
{
private
loadBitcoinWallet
()
{
this
.
toggleClass
();
this
.
toggleClass
();
this
.
globalService
.
setCoinName
(
"Bitcoin"
);
this
.
globalService
.
setCoinName
(
"TestBitcoin"
);
this
.
globalService
.
setCoinUnit
(
"TBTC"
);
this
.
router
.
navigate
([
'/wallet'
]);
this
.
router
.
navigate
([
'/wallet'
]);
}
}
private
loadStratisWallet
()
{
private
loadStratisWallet
()
{
this
.
toggleClass
();
this
.
toggleClass
();
this
.
globalService
.
setCoinName
(
"Stratis"
);
this
.
globalService
.
setCoinName
(
"TestStratis"
);
this
.
globalService
.
setCoinUnit
(
"TSTRAT"
);
this
.
router
.
navigate
([
'/wallet/stratis-wallet'
]);
this
.
router
.
navigate
([
'/wallet/stratis-wallet'
]);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment