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 {
response
=>
{
if
(
response
.
status
>=
200
&&
response
.
status
<
400
)
{
// 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
.
setCoinType
(
1
);
}
...
...
Breeze.UI/src/app/shared/pipes/coin-notation.pipe.ts
View file @
9e474442
...
...
@@ -9,7 +9,6 @@ export class CoinNotationPipe implements PipeTransform {
this
.
setCoinUnit
();
}
private
coinName
=
this
.
globalService
.
getCoinName
();
private
coinUnit
:
string
;
private
coinNotation
:
number
;
private
decimalLimit
=
8
;
...
...
@@ -20,37 +19,51 @@ export class CoinNotationPipe implements PipeTransform {
switch
(
this
.
getCoinUnit
())
{
case
"BTC"
:
temp
=
value
/
100000000
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
"
T
BTC"
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" BTC"
;
case
"mBTC"
:
temp
=
value
/
100000
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
"
T
mBTC"
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" mBTC"
;
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
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" TuBTC"
;
case
"STRAT"
:
temp
=
value
/
100000000
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
"
T
STRAT"
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" STRAT"
;
case
"mSTRAT"
:
temp
=
value
/
100000
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
"
T
mSTRAT"
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" mSTRAT"
;
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
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" TuSTRAT"
;
}
}
}
setCoinUnit
()
{
if
(
this
.
coinName
===
"Bitcoin"
)
{
this
.
coinUnit
=
"BTC"
;
}
else
if
(
this
.
coinName
===
"Stratis"
)
{
this
.
coinUnit
=
"STRAT"
}
};
getCoinUnit
()
{
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 {
private
getCurrentCoin
()
{
let
currentCoin
=
this
.
globalService
.
getCoinName
();
if
(
currentCoin
===
"Bitcoin"
)
{
if
(
currentCoin
===
"Bitcoin"
||
currentCoin
===
"TestBitcoin"
)
{
this
.
currentApiUrl
=
this
.
bitcoinApiUrl
;
}
else
if
(
currentCoin
===
"Stratis"
)
{
}
else
if
(
currentCoin
===
"Stratis"
||
currentCoin
===
"TestStratis"
)
{
this
.
currentApiUrl
=
this
.
stratisApiUrl
;
}
}
...
...
Breeze.UI/src/app/shared/services/global.service.ts
View file @
9e474442
...
...
@@ -7,18 +7,24 @@ export class GlobalService {
private
walletPath
:
string
;
private
currentWalletName
:
string
;
private
coinType
:
number
=
0
;
private
coinName
:
string
=
"Bitcoin"
;
private
coinName
:
string
=
"TestBitcoin"
;
private
coinUnit
:
string
=
"TBTC"
;
private
network
:
string
=
"TestNet"
;
getWalletPath
()
{
return
this
.
walletPath
;
}
setWalletPath
(
walletPath
:
string
)
{
this
.
walletPath
=
walletPath
;
}
getNetwork
()
{
return
"TestNet"
;
return
this
.
network
;
}
set
WalletPath
(
walletPath
:
string
)
{
this
.
walletPath
=
walletPath
;
set
Network
(
network
:
string
)
{
this
.
network
=
network
;
}
getWalletName
()
{
...
...
@@ -29,7 +35,7 @@ export class GlobalService {
this
.
currentWalletName
=
currentWalletName
;
}
getCoinType
()
{
getCoinType
()
{
return
this
.
coinType
;
}
...
...
@@ -37,11 +43,19 @@ export class GlobalService {
this
.
coinType
=
coinType
;
}
getCoinName
()
{
getCoinName
()
{
return
this
.
coinName
;
}
setCoinName
(
coinName
:
string
)
{
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 @@
</ul>
<ul
class=
"list-inline row"
>
<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
class=
"list-inline row"
>
<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';
import
{
NgbModal
,
NgbActiveModal
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
GlobalService
}
from
'../../../shared/services/global.service'
;
@
Component
({
selector
:
'app-send-confirmation'
,
templateUrl
:
'./send-confirmation.component.html'
,
...
...
@@ -10,12 +12,13 @@ import { NgbModal, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
export
class
SendConfirmationComponent
implements
OnInit
{
@
Input
()
transaction
:
any
;
constructor
(
public
activeModal
:
NgbActiveModal
)
{
}
constructor
(
p
rivate
globalService
:
GlobalService
,
p
ublic
activeModal
:
NgbActiveModal
)
{
}
private
showDetails
:
boolean
=
false
;
private
coinUnit
:
string
;
ngOnInit
()
{
console
.
log
(
this
.
transaction
);
this
.
coinUnit
=
this
.
globalService
.
getCoinUnit
(
);
}
toggleDetails
()
{
...
...
Breeze.UI/src/app/wallet/send/send.component.html
View file @
9e474442
...
...
@@ -11,7 +11,7 @@
<div
class=
"form-group clearfix"
>
<label
class=
"float-left"
for=
"yourAddress"
>
Amount
</label>
<!--<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>
<!--<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
{
GlobalService
}
from
'../../shared/services/global.service'
;
import
{
FormGroup
,
FormControl
,
Validators
,
FormBuilder
}
from
'@angular/forms'
;
...
...
@@ -16,7 +16,7 @@ import { SendConfirmationComponent } from './send-confirmation/send-confirmation
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
)
{
this
.
buildSendForm
();
}
...
...
@@ -24,8 +24,13 @@ export class SendComponent {
private
sendForm
:
FormGroup
;
private
responseMessage
:
any
;
private
errorMessage
:
string
;
private
coinUnit
:
string
;
private
transaction
:
TransactionBuilding
;
ngOnInit
()
{
this
.
coinUnit
=
this
.
globalService
.
getCoinUnit
();
}
private
buildSendForm
():
void
{
this
.
sendForm
=
this
.
fb
.
group
({
"address"
:
[
""
,
Validators
.
required
],
...
...
Breeze.UI/src/app/wallet/sidebar/sidebar.component.ts
View file @
9e474442
...
...
@@ -16,22 +16,24 @@ export class SidebarComponent implements OnInit {
private
bitcoinActive
:
Boolean
;
ngOnInit
()
{
if
(
this
.
globalService
.
getCoinName
()
===
"Bitcoin"
)
{
if
(
this
.
globalService
.
getCoinName
()
===
"Bitcoin"
||
this
.
globalService
.
getCoinName
()
===
"TestBitcoin"
)
{
this
.
bitcoinActive
=
true
;
}
else
if
(
this
.
globalService
.
getCoinName
()
===
"Stratis"
)
{
}
else
if
(
this
.
globalService
.
getCoinName
()
===
"Stratis"
||
this
.
globalService
.
getCoinName
()
===
"TestStratis"
)
{
this
.
bitcoinActive
=
false
;
}
}
private
loadBitcoinWallet
()
{
this
.
toggleClass
();
this
.
globalService
.
setCoinName
(
"Bitcoin"
);
this
.
globalService
.
setCoinName
(
"TestBitcoin"
);
this
.
globalService
.
setCoinUnit
(
"TBTC"
);
this
.
router
.
navigate
([
'/wallet'
]);
}
private
loadStratisWallet
()
{
this
.
toggleClass
();
this
.
globalService
.
setCoinName
(
"Stratis"
);
this
.
globalService
.
setCoinName
(
"TestStratis"
);
this
.
globalService
.
setCoinUnit
(
"TSTRAT"
);
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