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
36213223
Commit
36213223
authored
Nov 07, 2018
by
Maxim Bogdanov
🙉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes and inprovements to work with destream network.
parent
cc4ae9ee
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
270 additions
and
257 deletions
+270
-257
coin-notation.pipe.ts
Breeze.UI/src/app/shared/pipes/coin-notation.pipe.ts
+3
-0
api.service.ts
Breeze.UI/src/app/shared/services/api.service.ts
+224
-214
navigation.service.ts
Breeze.UI/src/app/shared/services/navigation.service.ts
+1
-1
advanced.service.ts
Breeze.UI/src/app/wallet/advanced/advanced.service.ts
+39
-39
history.component.ts
Breeze.UI/src/app/wallet/history/history.component.ts
+2
-2
sidebar.component.ts
Breeze.UI/src/app/wallet/sidebar/sidebar.component.ts
+1
-1
No files found.
Breeze.UI/src/app/shared/pipes/coin-notation.pipe.ts
View file @
36213223
...
@@ -53,6 +53,9 @@ export class CoinNotationPipe implements PipeTransform {
...
@@ -53,6 +53,9 @@ export class CoinNotationPipe implements PipeTransform {
case
"TuSTRAT"
:
case
"TuSTRAT"
:
temp
=
value
/
100
;
temp
=
value
/
100
;
return
temp
.
toFixed
(
this
.
decimalLimit
);
return
temp
.
toFixed
(
this
.
decimalLimit
);
case
"DST"
:
temp
=
value
/
100000000
;
return
temp
.
toFixed
(
this
.
decimalLimit
);
}
}
}
}
}
}
...
...
Breeze.UI/src/app/shared/services/api.service.ts
View file @
36213223
This diff is collapsed.
Click to expand it.
Breeze.UI/src/app/shared/services/navigation.service.ts
View file @
36213223
...
@@ -19,5 +19,5 @@ export class NavigationService {
...
@@ -19,5 +19,5 @@ export class NavigationService {
navigation$
.
filter
(
x
=>
x
===
`
${
this
.
navBase
}
/destream-wallet`
).
subscribe
(
_
=>
this
.
pageSubject
.
next
(
Page
.
DeStream
));
navigation$
.
filter
(
x
=>
x
===
`
${
this
.
navBase
}
/destream-wallet`
).
subscribe
(
_
=>
this
.
pageSubject
.
next
(
Page
.
DeStream
));
}
}
public
pageSubject
=
new
ReplaySubject
(
1
);
public
pageSubject
=
new
ReplaySubject
(
0
);
}
}
Breeze.UI/src/app/wallet/advanced/advanced.service.ts
View file @
36213223
import
{
Injectable
}
from
'@angular/core'
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
Observable
}
from
'rxjs/Observable'
;
import
{
Observable
}
from
'rxjs/Observable'
;
import
{
HttpClient
,
HttpHeaders
}
from
'@angular/common/http'
;
import
{
HttpClient
,
HttpHeaders
}
from
'@angular/common/http'
;
import
'rxjs/add/observable/empty'
;
import
'rxjs/add/observable/empty'
;
import
{
GlobalService
}
from
'../../shared/services/global.service'
;
import
{
GlobalService
}
from
'../../shared/services/global.service'
;
import
{
NavigationService
,
Page
}
from
'../../shared/services/navigation.service'
;
import
{
NavigationService
,
Page
}
from
'../../shared/services/navigation.service'
;
class
dateRequest
{
class
dateRequest
{
constructor
(
public
date
:
Date
){
}
constructor
(
public
date
:
Date
)
{
}
}
}
@
Injectable
()
@
Injectable
()
export
class
AdvancedService
{
export
class
AdvancedService
{
private
urlPrefix
=
''
;
private
urlPrefix
=
''
;
private
readonly
walletName
;
private
readonly
walletName
;
private
readonly
accountName
=
'account 0'
;
private
readonly
accountName
=
'account 0'
;
private
headers
=
new
HttpHeaders
({
'Content-Type'
:
'application/json'
});
private
headers
=
new
HttpHeaders
({
'Content-Type'
:
'application/json'
});
constructor
(
private
httpClient
:
HttpClient
,
private
globalService
:
GlobalService
,
navigationService
:
NavigationService
)
{
constructor
(
private
httpClient
:
HttpClient
,
private
globalService
:
GlobalService
,
navigationService
:
NavigationService
)
{
this
.
walletName
=
this
.
globalService
.
getWalletName
();
this
.
walletName
=
this
.
globalService
.
getWalletName
();
this
.
urlPrefix
=
"http://localhost:56864/api/Wallet/"
;
navigationService
.
pageSubject
.
subscribe
(
x
=>
this
.
urlPrefix
=
`http://localhost:3722
${
x
}
/api/Wallet/`
);
}
}
public
getExtPubKey
():
Observable
<
string
>
{
public
getExtPubKey
():
Observable
<
string
>
{
console
.
info
(
this
.
urlPrefix
);
const
url
=
this
.
makeUrl
(
`extpubkey?WalletName=
${
this
.
walletName
}
&AccountName=
${
this
.
accountName
}
`
);
const
url
=
this
.
makeUrl
(
`extpubkey?WalletName=
${
this
.
walletName
}
&AccountName=
${
this
.
accountName
}
`
);
return
this
.
httpClient
.
get
(
url
).
map
(
x
=>
x
.
toString
());
return
this
.
httpClient
.
get
(
url
).
map
(
x
=>
x
.
toString
());
}
}
public
generateAddresses
(
count
:
number
):
Observable
<
string
[]
>
{
public
generateAddresses
(
count
:
number
):
Observable
<
string
[]
>
{
const
url
=
this
.
makeUrl
(
`unusedaddresses?WalletName=
${
this
.
walletName
}
&AccountName=
${
this
.
accountName
}
&Count=
${
count
}
`
);
const
url
=
this
.
makeUrl
(
`unusedaddresses?WalletName=
${
this
.
walletName
}
&AccountName=
${
this
.
accountName
}
&Count=
${
count
}
`
);
return
this
.
httpClient
.
get
(
url
).
map
(
x
=>
this
.
processAddresses
(
x
));
return
this
.
httpClient
.
get
(
url
).
map
(
x
=>
this
.
processAddresses
(
x
));
}
public
resyncFromDate
(
date
:
Date
):
Observable
<
any
>
{
date
=
new
Date
(
date
.
getFullYear
(),
date
.
getMonth
(),
date
.
getDate
());
//<- Strip any time values
const
url
=
this
.
makeUrl
(
'syncfromdate'
);
const
data
=
JSON
.
stringify
(
new
dateRequest
(
date
));
return
this
.
httpClient
.
post
(
url
,
data
,
{
headers
:
this
.
headers
}).
map
((
x
:
Response
)
=>
x
);
}
private
processAddresses
(
response
:
any
):
string
[]
{
const
addresses
=
new
Array
<
string
>
();
for
(
const
address
of
response
)
{
addresses
.
push
(
address
);
}
}
return
addresses
;
}
public
resyncFromDate
(
date
:
Date
):
Observable
<
any
>
{
private
makeUrl
(
urlPostfix
:
string
):
string
{
date
=
new
Date
(
date
.
getFullYear
(),
date
.
getMonth
(),
date
.
getDate
());
//<- Strip any time values
return
`
${
this
.
urlPrefix
}${
urlPostfix
}
`
;
const
url
=
this
.
makeUrl
(
'syncfromdate'
);
}
const
data
=
JSON
.
stringify
(
new
dateRequest
(
date
));
return
this
.
httpClient
.
post
(
url
,
data
,
{
headers
:
this
.
headers
}).
map
((
x
:
Response
)
=>
x
);
}
private
processAddresses
(
response
:
any
):
string
[]
{
const
addresses
=
new
Array
<
string
>
();
for
(
const
address
of
response
)
{
addresses
.
push
(
address
);
}
return
addresses
;
}
private
makeUrl
(
urlPostfix
:
string
):
string
{
return
`
${
this
.
urlPrefix
}${
urlPostfix
}
`
;
}
}
}
Breeze.UI/src/app/wallet/history/history.component.ts
View file @
36213223
...
@@ -49,8 +49,8 @@ export class HistoryComponent {
...
@@ -49,8 +49,8 @@ export class HistoryComponent {
response
=>
{
response
=>
{
if
(
response
.
status
>=
200
&&
response
.
status
<
400
)
{
if
(
response
.
status
>=
200
&&
response
.
status
<
400
)
{
const
json
=
response
.
json
();
const
json
=
response
.
json
();
if
(
json
&&
json
.
transactionsHistory
)
{
if
(
json
&&
json
.
history
.
length
)
{
historyResponse
=
json
.
transactionsHistory
;
historyResponse
=
json
.
history
[
0
].
transactionsHistory
;
this
.
getTransactionInfo
(
historyResponse
);
this
.
getTransactionInfo
(
historyResponse
);
}
}
}
}
...
...
Breeze.UI/src/app/wallet/sidebar/sidebar.component.ts
View file @
36213223
...
@@ -24,7 +24,7 @@ export class SidebarComponent implements OnInit {
...
@@ -24,7 +24,7 @@ export class SidebarComponent implements OnInit {
ngOnInit
()
{
ngOnInit
()
{
}
}
public
loadDe
s
treamWallet
()
{
public
loadDe
S
treamWallet
()
{
this
.
globalService
.
setCoinName
(
"DeStreamCoin"
);
this
.
globalService
.
setCoinName
(
"DeStreamCoin"
);
this
.
globalService
.
setCoinUnit
(
"DST"
);
this
.
globalService
.
setCoinUnit
(
"DST"
);
...
...
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