Skip to content

Commit c747dde

Browse files
author
Darren Nelsen
committed
add unparsed addresses
1 parent 75f5545 commit c747dde

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

packages/insight/app/src/components/transaction/transaction.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
<div>
7676
<div class="ellipsis">
7777
<p>
78-
<a (click)="goToAddress(vout.address)">{{ vout.address }}</a>
78+
<a (click)="goToAddress(vout.address)">{{ getAddress(vout) }}</a>
7979
</p>
8080
</div>
8181
<div *ngIf="expanded">

packages/insight/app/src/components/transaction/transaction.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Component } from '@angular/core';
22
import { Input } from '@angular/core';
33
import { NavController } from 'ionic-angular';
44
import { CurrencyProvider } from '../../providers/currency/currency';
5-
import { TxsProvider } from '../../providers/transactions/transactions';
5+
import { TxsProvider, ApiInput } from '../../providers/transactions/transactions';
66

77
/**
88
* Generated class for the TransactionComponent component.
@@ -43,12 +43,12 @@ export class TransactionComponent {
4343
});
4444
}
4545

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') {
5048
return 'Unparsed address';
5149
}
50+
51+
return vout.address;
5252
}
5353

5454
public goToTx(txId: string): void {

packages/insight/app/src/pages/transaction/transaction.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ export class TransactionPage {
3636
data => {
3737
this.tx = data.tx;
3838
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
4340
},
4441
err => {
4542
console.log('err is', err);

packages/insight/app/src/providers/transactions/transactions.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ export type ApiInput = {
4040
coinbase: boolean;
4141
vout: number;
4242
address: string;
43-
script: string;
43+
script: {
44+
asm: string;
45+
type: string
46+
};
4447
value: number;
4548
};
4649

0 commit comments

Comments
 (0)