diff --git a/app/src/components/transaction/transaction.html b/app/src/components/transaction/transaction.html index 48f38a7..655ea4c 100644 --- a/app/src/components/transaction/transaction.html +++ b/app/src/components/transaction/transaction.html @@ -32,7 +32,7 @@ - +

@@ -41,14 +41,18 @@

- Confirmations {{vin.confirmations}}

+ Confirmations {{vin.confirmations}} +

Unlocking Script

-

{{ item.scriptSig.asm }} + + + +

{{ item.scriptSig.asm }}

@@ -69,7 +73,7 @@ - +

@@ -92,7 +96,12 @@

{{ currency.getConvertedNumber(vout.value) | number:'1.0-8' }} {{ currency.currencySymbol }} - (S) + + (S) + + + + (U)
diff --git a/app/src/components/transaction/transaction.scss b/app/src/components/transaction/transaction.scss index eb8f8a0..d66414c 100644 --- a/app/src/components/transaction/transaction.scss +++ b/app/src/components/transaction/transaction.scss @@ -41,6 +41,10 @@ transaction { border-bottom-right-radius: $transaction-item-boarder-radius; } + .item--state-highlight { + background-color: #8dc429; + } + .list { margin-bottom: 5px; } diff --git a/app/src/components/transaction/transaction.ts b/app/src/components/transaction/transaction.ts index 8d5cc19..8df9792 100644 --- a/app/src/components/transaction/transaction.ts +++ b/app/src/components/transaction/transaction.ts @@ -19,6 +19,8 @@ export class TransactionComponent { public expanded: boolean = false; @Input() public tx: any = {}; + @Input() public txDirection?: string; + @Input() public txIndex?: number; constructor(private navCtrl: NavController, public currency: CurrencyProvider) { } @@ -37,6 +39,14 @@ export class TransactionComponent { }); } + public goToOutpoint(txId: string, txDirection: string, txIndex: number): void { + this.navCtrl.push('outpoint', { + 'txId': txId, + 'txDirection': txDirection, + 'txIndex': txIndex + }); + } + public goToAddress(addrStr: string): void { this.navCtrl.push('address', { 'addrStr': addrStr @@ -48,6 +58,7 @@ export class TransactionComponent { } public aggregateItems(items: Array): Array { + if (!items) return []; let l: number = items.length; diff --git a/app/src/pages/outpoint/outpoint.html b/app/src/pages/outpoint/outpoint.html new file mode 100644 index 0000000..313917c --- /dev/null +++ b/app/src/pages/outpoint/outpoint.html @@ -0,0 +1,62 @@ + + + + + + +
+ +
+ +
+

+ Input + Output + Transaction | Index #{{ txIndex }} +

+

+ Transaction Hash {{ tx.txid }} +

+

+

Summary

+ + + + Size + + {{ tx.size }} (bytes) + + + + Fee Rate + + {{ (tx.fees / tx.size) * 1E8 | number:'1.0-8' }} sats/byte + + + + Received Time + + {{ tx.time * 1000 | date:'medium' }} + + + + Mined Time + + {{ tx.blocktime * 1000 | date:'medium' }} + + + + Included in Block + + {{ tx.blockhash }} + + + +
+

Details

+ + +
+ +
+ \ No newline at end of file diff --git a/app/src/pages/outpoint/outpoint.module.ts b/app/src/pages/outpoint/outpoint.module.ts new file mode 100644 index 0000000..c53cd70 --- /dev/null +++ b/app/src/pages/outpoint/outpoint.module.ts @@ -0,0 +1,20 @@ +import { NgModule } from '@angular/core'; +import { IonicPageModule } from 'ionic-angular'; +import { OutpointPage } from './outpoint'; +import { TransactionComponentModule } from '../../components/transaction/transaction.module'; +import { HeadNavComponentModule } from '../../components/head-nav/head-nav.module'; + +@NgModule({ + declarations: [ + OutpointPage + ], + imports: [ + IonicPageModule.forChild(OutpointPage), + TransactionComponentModule, + HeadNavComponentModule + ], + exports: [ + OutpointPage + ] +}) +export class OutpointPageModule {} diff --git a/app/src/pages/outpoint/outpoint.scss b/app/src/pages/outpoint/outpoint.scss new file mode 100644 index 0000000..adade81 --- /dev/null +++ b/app/src/pages/outpoint/outpoint.scss @@ -0,0 +1,3 @@ +page-outpoint { + +} diff --git a/app/src/pages/outpoint/outpoint.ts b/app/src/pages/outpoint/outpoint.ts new file mode 100644 index 0000000..b64a75a --- /dev/null +++ b/app/src/pages/outpoint/outpoint.ts @@ -0,0 +1,53 @@ +import { Component } from '@angular/core'; +import { IonicPage, NavController, NavParams } from 'ionic-angular'; +import { Http } from '@angular/http'; +import { ApiProvider } from '../../providers/api/api'; + +/** + * Generated class for the InputOutputPage page. + * + * See http://ionicframework.com/docs/components/#navigation for more info + * on Ionic pages and navigation. + */ +@IonicPage({ + name: 'outpoint', + segment: 'tx/:txId/:txDirection/:txIndex' +}) +@Component({ + selector: 'page-outpoint', + templateUrl: 'outpoint.html' +}) +export class OutpointPage { + + public loading: boolean = true; + private txId: string; + public txIndex: number; + public txDirection: string; + public tx: any = {}; + + constructor(public navCtrl: NavController, public navParams: NavParams, private http: Http, private api: ApiProvider) { + this.txId = navParams.get('txId'); + this.txIndex = Number(navParams.get('txIndex')); + this.txDirection = navParams.get('txDirection'); + } + + public ionViewDidLoad(): void { + this.http.get(this.api.apiPrefix + 'tx/' + this.txId).subscribe( + (data) => { + this.tx = JSON.parse(data['_body']); + this.loading = false; + }, + (err) => { + console.log('err is', err); + this.loading = false; + } + ); + } + + public goToBlock(blockHash: string): void { + this.navCtrl.push('block-detail', { + 'blockHash': blockHash + }); + } + +}