File tree Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 75
75
< div >
76
76
< div class ="ellipsis ">
77
77
< p >
78
- < a (click) ="goToAddress(vout.address) "> {{ vout.address }}</ a >
78
+ < a (click) ="goToAddress(vout.address) "> {{ getAddress( vout) }}</ a >
79
79
</ p >
80
80
</ div >
81
81
< div *ngIf ="expanded ">
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { Component } from '@angular/core';
2
2
import { Input } from '@angular/core' ;
3
3
import { NavController } from 'ionic-angular' ;
4
4
import { CurrencyProvider } from '../../providers/currency/currency' ;
5
- import { TxsProvider } from '../../providers/transactions/transactions' ;
5
+ import { TxsProvider , ApiInput } from '../../providers/transactions/transactions' ;
6
6
7
7
/**
8
8
* Generated class for the TransactionComponent component.
@@ -43,12 +43,12 @@ export class TransactionComponent {
43
43
} ) ;
44
44
}
45
45
46
- public getAddress ( vout : any ) : string {
47
- if ( vout . scriptPubKey && vout . scriptPubKey . addresses ) {
48
- return vout . scriptPubKey . addresses [ 0 ] ;
49
- } else {
46
+ public getAddress ( vout : ApiInput ) : string {
47
+ if ( vout . address === 'false' ) {
50
48
return 'Unparsed address' ;
51
49
}
50
+
51
+ return vout . address ;
52
52
}
53
53
54
54
public goToTx ( txId : string ) : void {
Original file line number Diff line number Diff line change @@ -36,10 +36,7 @@ export class TransactionPage {
36
36
data => {
37
37
this . tx = data . tx ;
38
38
this . loading = false ;
39
- this . txProvider . getCoins ( this . txId ) . subscribe ( coinData => {
40
- this . tx . inputs = coinData . inputs ;
41
- this . tx . outputs = coinData . outputs ;
42
- } ) ;
39
+ // Be aware that the tx component is loading data into the tx object
43
40
} ,
44
41
err => {
45
42
console . log ( 'err is' , err ) ;
Original file line number Diff line number Diff line change @@ -40,7 +40,10 @@ export type ApiInput = {
40
40
coinbase : boolean ;
41
41
vout : number ;
42
42
address : string ;
43
- script : string ;
43
+ script : {
44
+ asm : string ;
45
+ type : string
46
+ } ;
44
47
value : number ;
45
48
} ;
46
49
You can’t perform that action at this time.
0 commit comments