From 7bdd0fa1875cc3db54daba5d4602b79657bc5e82 Mon Sep 17 00:00:00 2001 From: Ash Bhimasani <16abhimasani@gmail.com> Date: Thu, 31 May 2018 14:35:37 -0400 Subject: [PATCH 1/7] Index Highlighting --- .../components/transaction/transaction.html | 26 ++++++-- .../components/transaction/transaction.scss | 33 ++++++++++ app/src/components/transaction/transaction.ts | 22 +++++++ app/src/pages/input/input.html | 64 +++++++++++++++++++ app/src/pages/input/input.module.ts | 20 ++++++ app/src/pages/input/input.scss | 3 + app/src/pages/input/input.ts | 56 ++++++++++++++++ app/src/pages/output/output.html | 63 ++++++++++++++++++ app/src/pages/output/output.module.ts | 20 ++++++ app/src/pages/output/output.scss | 3 + app/src/pages/output/output.ts | 52 +++++++++++++++ 11 files changed, 357 insertions(+), 5 deletions(-) create mode 100644 app/src/pages/input/input.html create mode 100644 app/src/pages/input/input.module.ts create mode 100644 app/src/pages/input/input.scss create mode 100644 app/src/pages/input/input.ts create mode 100644 app/src/pages/output/output.html create mode 100644 app/src/pages/output/output.module.ts create mode 100644 app/src/pages/output/output.scss create mode 100644 app/src/pages/output/output.ts diff --git a/app/src/components/transaction/transaction.html b/app/src/components/transaction/transaction.html index 7a678c0..e660ea9 100644 --- a/app/src/components/transaction/transaction.html +++ b/app/src/components/transaction/transaction.html @@ -32,16 +32,25 @@ - +
+ + + + + + + {{ printer(vin) }} +

{{ vin.addr }}

- Confirmations {{vin.confirmations}}

+ Confirmations {{vin.confirmations}} +

Unlocking Script

@@ -66,7 +75,7 @@ - + @@ -94,7 +103,14 @@
{{ currency.getConvertedNumber(vout.value) | number:'1.0-8' }} {{ currency.currencySymbol }} - (S) + + + + (S) + + + + (U)
@@ -128,4 +144,4 @@
- \ No newline at end of file + diff --git a/app/src/components/transaction/transaction.scss b/app/src/components/transaction/transaction.scss index eb8f8a0..78d2821 100644 --- a/app/src/components/transaction/transaction.scss +++ b/app/src/components/transaction/transaction.scss @@ -9,6 +9,8 @@ transaction { ion-row { border: 1px solid #f3f3f3; + margin-top: 10px; + margin-bottom: 10px; &.small { font-size: 1.1rem; @@ -24,11 +26,35 @@ transaction { ion-icon { color: rgba(0, 0, 0, 0.25); + margin-right: 5px; } +// New Stuff + +.shiftDown { + padding-top: 1.2em; +} + +.ellipsis { + margin-bottom: .7rem; + margin-top: 8px; +} + +.unlocking-script { + padding-top: .7rem; + max-width: 90%; +} + +.locking-script { + padding-top: .7rem; +} + +//end + .item, .item p { font-size: 1.4rem; + font-weight: bold; } $transaction-item-boarder-radius: 3px; @@ -41,6 +67,13 @@ transaction { border-bottom-right-radius: $transaction-item-boarder-radius; } + .itemHighlight { + background-color: #8dc429; + } + .itemNoLight { + background-color: default; + } + .list { margin-bottom: 5px; } diff --git a/app/src/components/transaction/transaction.ts b/app/src/components/transaction/transaction.ts index 8d5cc19..0218813 100644 --- a/app/src/components/transaction/transaction.ts +++ b/app/src/components/transaction/transaction.ts @@ -19,6 +19,7 @@ export class TransactionComponent { public expanded: boolean = false; @Input() public tx: any = {}; + @Input() public dx?: number; constructor(private navCtrl: NavController, public currency: CurrencyProvider) { } @@ -37,6 +38,24 @@ export class TransactionComponent { }); } + public goToInput(txId: string, dxNm: number): void { + this.navCtrl.push('input', { + 'txId': txId, + 'dxNm': dxNm + }); + } + + public goToOutput(txId: string, dxNm: number): void { + this.navCtrl.push('output', { + 'txId': txId, + 'dxNm': dxNm + }); + } + + public printer(obj: any): void { + console.log(obj); + } + public goToAddress(addrStr: string): void { this.navCtrl.push('address', { 'addrStr': addrStr @@ -48,6 +67,9 @@ export class TransactionComponent { } public aggregateItems(items: Array): Array { + + console.log(this.dx); + if (!items) return []; let l: number = items.length; diff --git a/app/src/pages/input/input.html b/app/src/pages/input/input.html new file mode 100644 index 0000000..d5bede7 --- /dev/null +++ b/app/src/pages/input/input.html @@ -0,0 +1,64 @@ + + + + + + + + +
+ +
+ +
+

Input Transaction | Index #{{ dxNm }}

+

+ 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

+ + +
+ +
diff --git a/app/src/pages/input/input.module.ts b/app/src/pages/input/input.module.ts new file mode 100644 index 0000000..9729a23 --- /dev/null +++ b/app/src/pages/input/input.module.ts @@ -0,0 +1,20 @@ +import { NgModule } from '@angular/core'; +import { IonicPageModule } from 'ionic-angular'; +import { InputPage } from './input'; +import { TransactionComponentModule } from '../../components/transaction/transaction.module'; +import { HeadNavComponentModule } from '../../components/head-nav/head-nav.module'; + +@NgModule({ + declarations: [ + InputPage + ], + imports: [ + IonicPageModule.forChild(InputPage), + TransactionComponentModule, + HeadNavComponentModule + ], + exports: [ + InputPage + ] +}) +export class InputPageModule {} diff --git a/app/src/pages/input/input.scss b/app/src/pages/input/input.scss new file mode 100644 index 0000000..019e5fd --- /dev/null +++ b/app/src/pages/input/input.scss @@ -0,0 +1,3 @@ +page-input { + +} diff --git a/app/src/pages/input/input.ts b/app/src/pages/input/input.ts new file mode 100644 index 0000000..8abd2b0 --- /dev/null +++ b/app/src/pages/input/input.ts @@ -0,0 +1,56 @@ +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 InputPage page. + * + * See http://ionicframework.com/docs/components/#navigation for more info + * on Ionic pages and navigation. + */ + @IonicPage({ + name: 'input', + segment: 'tx/:txId/:dxNm' + }) +@Component({ + selector: 'page-input', + templateUrl: 'input.html' +}) +export class InputPage { + + public loading: boolean = true; + private txId: string; + public dxNm: number; + public tx: any = {}; + + constructor(public navCtrl: NavController, public navParams: NavParams, private http: Http, private api: ApiProvider) { + this.txId = navParams.get('txId'); + this.dxNm = Number(navParams.get('dxNm')); + console.log(this.dxNm); + } + + // ionViewDidLoad() { + // console.log('ionViewDidLoad InputPage'); + // } + + 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 + }); + } + +} diff --git a/app/src/pages/output/output.html b/app/src/pages/output/output.html new file mode 100644 index 0000000..0a62959 --- /dev/null +++ b/app/src/pages/output/output.html @@ -0,0 +1,63 @@ + + + + + + + +
+ +
+ +
+

Output Transaction | Index #{{ dxNm }}

+

+ 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

+ + +
+ +
diff --git a/app/src/pages/output/output.module.ts b/app/src/pages/output/output.module.ts new file mode 100644 index 0000000..298d9c7 --- /dev/null +++ b/app/src/pages/output/output.module.ts @@ -0,0 +1,20 @@ +import { NgModule } from '@angular/core'; +import { IonicPageModule } from 'ionic-angular'; +import { OutputPage } from './output'; +import { TransactionComponentModule } from '../../components/transaction/transaction.module'; +import { HeadNavComponentModule } from '../../components/head-nav/head-nav.module'; + +@NgModule({ + declarations: [ + OutputPage + ], + imports: [ + IonicPageModule.forChild(OutputPage), + TransactionComponentModule, + HeadNavComponentModule + ], + exports: [ + OutputPage + ] +}) +export class OutputPageModule {} diff --git a/app/src/pages/output/output.scss b/app/src/pages/output/output.scss new file mode 100644 index 0000000..eba3892 --- /dev/null +++ b/app/src/pages/output/output.scss @@ -0,0 +1,3 @@ +page-output { + +} diff --git a/app/src/pages/output/output.ts b/app/src/pages/output/output.ts new file mode 100644 index 0000000..eba3c6a --- /dev/null +++ b/app/src/pages/output/output.ts @@ -0,0 +1,52 @@ +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 OutputPage page. + * + * See http://ionicframework.com/docs/components/#navigation for more info + * on Ionic pages and navigation. + */ + @IonicPage({ + name: 'output', + segment: 'tx/:txId/:dxNm' + }) +@Component({ + selector: 'page-output', + templateUrl: 'output.html' +}) +export class OutputPage { + + public loading: boolean = true; + private txId: string; + public dxNm: number; + public tx: any = {}; + + constructor(public navCtrl: NavController, public navParams: NavParams, private http: Http, private api: ApiProvider) { + this.txId = navParams.get('txId'); + this.dxNm = Number(navParams.get('dxNm')); + console.log(this.dxNm); + } + + 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 + }); + } + +} From 64aa9445de4567a9f69349a8e5ed75fb7b5f9547 Mon Sep 17 00:00:00 2001 From: Ash Bhimasani <16abhimasani@gmail.com> Date: Fri, 1 Jun 2018 10:30:16 -0400 Subject: [PATCH 2/7] added index highlighting on input-output pages --- .../components/transaction/transaction.html | 23 +++++--- app/src/components/transaction/transaction.ts | 8 ++- app/src/pages/input-output/input-output.html | 59 +++++++++++++++++++ .../pages/input-output/input-output.module.ts | 20 +++++++ app/src/pages/input-output/input-output.scss | 3 + app/src/pages/input-output/input-output.ts | 53 +++++++++++++++++ 6 files changed, 155 insertions(+), 11 deletions(-) create mode 100644 app/src/pages/input-output/input-output.html create mode 100644 app/src/pages/input-output/input-output.module.ts create mode 100644 app/src/pages/input-output/input-output.scss create mode 100644 app/src/pages/input-output/input-output.ts diff --git a/app/src/components/transaction/transaction.html b/app/src/components/transaction/transaction.html index e660ea9..100a9ad 100644 --- a/app/src/components/transaction/transaction.html +++ b/app/src/components/transaction/transaction.html @@ -32,14 +32,14 @@ - +
@@ -80,7 +87,7 @@ - +

diff --git a/app/src/components/transaction/transaction.ts b/app/src/components/transaction/transaction.ts index 0218813..c3dd62c 100644 --- a/app/src/components/transaction/transaction.ts +++ b/app/src/components/transaction/transaction.ts @@ -19,6 +19,7 @@ export class TransactionComponent { public expanded: boolean = false; @Input() public tx: any = {}; + @Input() public dr?: string; @Input() public dx?: number; constructor(private navCtrl: NavController, public currency: CurrencyProvider) { @@ -39,15 +40,17 @@ export class TransactionComponent { } public goToInput(txId: string, dxNm: number): void { - this.navCtrl.push('input', { + this.navCtrl.push('input-output', { 'txId': txId, + 'dir': '<', 'dxNm': dxNm }); } public goToOutput(txId: string, dxNm: number): void { - this.navCtrl.push('output', { + this.navCtrl.push('input-output', { 'txId': txId, + 'dir': '>', 'dxNm': dxNm }); } @@ -68,7 +71,6 @@ export class TransactionComponent { public aggregateItems(items: Array): Array { - console.log(this.dx); if (!items) return []; diff --git a/app/src/pages/input-output/input-output.html b/app/src/pages/input-output/input-output.html new file mode 100644 index 0000000..0f559f1 --- /dev/null +++ b/app/src/pages/input-output/input-output.html @@ -0,0 +1,59 @@ + + + + + + +

+ +
+ +
+

Output Transaction | Index #{{ dxNm }}

+

Input Transaction | Index #{{ dxNm }}

+

+ 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/input-output/input-output.module.ts b/app/src/pages/input-output/input-output.module.ts new file mode 100644 index 0000000..c8021c1 --- /dev/null +++ b/app/src/pages/input-output/input-output.module.ts @@ -0,0 +1,20 @@ +import { NgModule } from '@angular/core'; +import { IonicPageModule } from 'ionic-angular'; +import { InputOutputPage } from './input-output'; +import { TransactionComponentModule } from '../../components/transaction/transaction.module'; +import { HeadNavComponentModule } from '../../components/head-nav/head-nav.module'; + +@NgModule({ + declarations: [ + InputOutputPage, + ], + imports: [ + IonicPageModule.forChild(InputOutputPage), + TransactionComponentModule, + HeadNavComponentModule + ], + exports: [ + InputOutputPage + ] +}) +export class InputOutputPageModule {} diff --git a/app/src/pages/input-output/input-output.scss b/app/src/pages/input-output/input-output.scss new file mode 100644 index 0000000..a447548 --- /dev/null +++ b/app/src/pages/input-output/input-output.scss @@ -0,0 +1,3 @@ +page-input-output { + +} diff --git a/app/src/pages/input-output/input-output.ts b/app/src/pages/input-output/input-output.ts new file mode 100644 index 0000000..e7215ff --- /dev/null +++ b/app/src/pages/input-output/input-output.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: 'input-output', + segment: 'tx/:txId/:dir/:dxNm' +}) +@Component({ + selector: 'page-input-output', + templateUrl: 'input-output.html', +}) +export class InputOutputPage { + + public loading: boolean = true; + private txId: string; + public dxNm: number; + public dir: string; + public tx: any = {}; + + constructor(public navCtrl: NavController, public navParams: NavParams, private http: Http, private api: ApiProvider) { + this.txId = navParams.get('txId'); + this.dxNm = Number(navParams.get('dxNm')); + this.dir = navParams.get('dir'); + } + + 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 + }); + } + +} From 8734cf618a9c40317cdc980a877866d21c26ebd2 Mon Sep 17 00:00:00 2001 From: Ash Bhimasani <16abhimasani@gmail.com> Date: Fri, 1 Jun 2018 11:02:01 -0400 Subject: [PATCH 3/7] fixed lint + cleaning up --- app/src/components/transaction/transaction.ts | 1 - .../pages/input-output/input-output.module.ts | 2 +- app/src/pages/input-output/input-output.ts | 2 +- app/src/pages/input/input.html | 64 ------------------- app/src/pages/input/input.module.ts | 20 ------ app/src/pages/input/input.scss | 3 - app/src/pages/input/input.ts | 56 ---------------- app/src/pages/output/output.html | 63 ------------------ app/src/pages/output/output.module.ts | 20 ------ app/src/pages/output/output.scss | 3 - app/src/pages/output/output.ts | 52 --------------- 11 files changed, 2 insertions(+), 284 deletions(-) delete mode 100644 app/src/pages/input/input.html delete mode 100644 app/src/pages/input/input.module.ts delete mode 100644 app/src/pages/input/input.scss delete mode 100644 app/src/pages/input/input.ts delete mode 100644 app/src/pages/output/output.html delete mode 100644 app/src/pages/output/output.module.ts delete mode 100644 app/src/pages/output/output.scss delete mode 100644 app/src/pages/output/output.ts diff --git a/app/src/components/transaction/transaction.ts b/app/src/components/transaction/transaction.ts index c3dd62c..98928bc 100644 --- a/app/src/components/transaction/transaction.ts +++ b/app/src/components/transaction/transaction.ts @@ -71,7 +71,6 @@ export class TransactionComponent { public aggregateItems(items: Array): Array { - if (!items) return []; let l: number = items.length; diff --git a/app/src/pages/input-output/input-output.module.ts b/app/src/pages/input-output/input-output.module.ts index c8021c1..f2a3401 100644 --- a/app/src/pages/input-output/input-output.module.ts +++ b/app/src/pages/input-output/input-output.module.ts @@ -6,7 +6,7 @@ import { HeadNavComponentModule } from '../../components/head-nav/head-nav.modul @NgModule({ declarations: [ - InputOutputPage, + InputOutputPage ], imports: [ IonicPageModule.forChild(InputOutputPage), diff --git a/app/src/pages/input-output/input-output.ts b/app/src/pages/input-output/input-output.ts index e7215ff..d94751b 100644 --- a/app/src/pages/input-output/input-output.ts +++ b/app/src/pages/input-output/input-output.ts @@ -15,7 +15,7 @@ import { ApiProvider } from '../../providers/api/api'; }) @Component({ selector: 'page-input-output', - templateUrl: 'input-output.html', + templateUrl: 'input-output.html' }) export class InputOutputPage { diff --git a/app/src/pages/input/input.html b/app/src/pages/input/input.html deleted file mode 100644 index d5bede7..0000000 --- a/app/src/pages/input/input.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - -
- -
- -
-

Input Transaction | Index #{{ dxNm }}

-

- 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

- - -
- -
diff --git a/app/src/pages/input/input.module.ts b/app/src/pages/input/input.module.ts deleted file mode 100644 index 9729a23..0000000 --- a/app/src/pages/input/input.module.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { NgModule } from '@angular/core'; -import { IonicPageModule } from 'ionic-angular'; -import { InputPage } from './input'; -import { TransactionComponentModule } from '../../components/transaction/transaction.module'; -import { HeadNavComponentModule } from '../../components/head-nav/head-nav.module'; - -@NgModule({ - declarations: [ - InputPage - ], - imports: [ - IonicPageModule.forChild(InputPage), - TransactionComponentModule, - HeadNavComponentModule - ], - exports: [ - InputPage - ] -}) -export class InputPageModule {} diff --git a/app/src/pages/input/input.scss b/app/src/pages/input/input.scss deleted file mode 100644 index 019e5fd..0000000 --- a/app/src/pages/input/input.scss +++ /dev/null @@ -1,3 +0,0 @@ -page-input { - -} diff --git a/app/src/pages/input/input.ts b/app/src/pages/input/input.ts deleted file mode 100644 index 8abd2b0..0000000 --- a/app/src/pages/input/input.ts +++ /dev/null @@ -1,56 +0,0 @@ -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 InputPage page. - * - * See http://ionicframework.com/docs/components/#navigation for more info - * on Ionic pages and navigation. - */ - @IonicPage({ - name: 'input', - segment: 'tx/:txId/:dxNm' - }) -@Component({ - selector: 'page-input', - templateUrl: 'input.html' -}) -export class InputPage { - - public loading: boolean = true; - private txId: string; - public dxNm: number; - public tx: any = {}; - - constructor(public navCtrl: NavController, public navParams: NavParams, private http: Http, private api: ApiProvider) { - this.txId = navParams.get('txId'); - this.dxNm = Number(navParams.get('dxNm')); - console.log(this.dxNm); - } - - // ionViewDidLoad() { - // console.log('ionViewDidLoad InputPage'); - // } - - 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 - }); - } - -} diff --git a/app/src/pages/output/output.html b/app/src/pages/output/output.html deleted file mode 100644 index 0a62959..0000000 --- a/app/src/pages/output/output.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - -
- -
- -
-

Output Transaction | Index #{{ dxNm }}

-

- 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

- - -
- -
diff --git a/app/src/pages/output/output.module.ts b/app/src/pages/output/output.module.ts deleted file mode 100644 index 298d9c7..0000000 --- a/app/src/pages/output/output.module.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { NgModule } from '@angular/core'; -import { IonicPageModule } from 'ionic-angular'; -import { OutputPage } from './output'; -import { TransactionComponentModule } from '../../components/transaction/transaction.module'; -import { HeadNavComponentModule } from '../../components/head-nav/head-nav.module'; - -@NgModule({ - declarations: [ - OutputPage - ], - imports: [ - IonicPageModule.forChild(OutputPage), - TransactionComponentModule, - HeadNavComponentModule - ], - exports: [ - OutputPage - ] -}) -export class OutputPageModule {} diff --git a/app/src/pages/output/output.scss b/app/src/pages/output/output.scss deleted file mode 100644 index eba3892..0000000 --- a/app/src/pages/output/output.scss +++ /dev/null @@ -1,3 +0,0 @@ -page-output { - -} diff --git a/app/src/pages/output/output.ts b/app/src/pages/output/output.ts deleted file mode 100644 index eba3c6a..0000000 --- a/app/src/pages/output/output.ts +++ /dev/null @@ -1,52 +0,0 @@ -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 OutputPage page. - * - * See http://ionicframework.com/docs/components/#navigation for more info - * on Ionic pages and navigation. - */ - @IonicPage({ - name: 'output', - segment: 'tx/:txId/:dxNm' - }) -@Component({ - selector: 'page-output', - templateUrl: 'output.html' -}) -export class OutputPage { - - public loading: boolean = true; - private txId: string; - public dxNm: number; - public tx: any = {}; - - constructor(public navCtrl: NavController, public navParams: NavParams, private http: Http, private api: ApiProvider) { - this.txId = navParams.get('txId'); - this.dxNm = Number(navParams.get('dxNm')); - console.log(this.dxNm); - } - - 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 - }); - } - -} From 7297a232bcc7c6de60b61be23df69b6e1c7d09e3 Mon Sep 17 00:00:00 2001 From: Ash Bhimasani <16abhimasani@gmail.com> Date: Fri, 1 Jun 2018 11:11:12 -0400 Subject: [PATCH 4/7] Removed logging and comments --- app/src/components/transaction/transaction.html | 10 ---------- app/src/components/transaction/transaction.ts | 4 ---- 2 files changed, 14 deletions(-) diff --git a/app/src/components/transaction/transaction.html b/app/src/components/transaction/transaction.html index 100a9ad..429b159 100644 --- a/app/src/components/transaction/transaction.html +++ b/app/src/components/transaction/transaction.html @@ -35,14 +35,6 @@
- - - {{ printer(vin) }} -

{{ vin.addr }}

@@ -110,9 +102,7 @@
{{ currency.getConvertedNumber(vout.value) | number:'1.0-8' }} {{ currency.currencySymbol }} - - (S) diff --git a/app/src/components/transaction/transaction.ts b/app/src/components/transaction/transaction.ts index 98928bc..a854007 100644 --- a/app/src/components/transaction/transaction.ts +++ b/app/src/components/transaction/transaction.ts @@ -55,10 +55,6 @@ export class TransactionComponent { }); } - public printer(obj: any): void { - console.log(obj); - } - public goToAddress(addrStr: string): void { this.navCtrl.push('address', { 'addrStr': addrStr From d021d5183719f0f29f874e9575da3c525540ea63 Mon Sep 17 00:00:00 2001 From: Ash Bhimasani <16abhimasani@gmail.com> Date: Fri, 1 Jun 2018 14:57:33 -0400 Subject: [PATCH 5/7] Fixed Problems --- .../components/transaction/transaction.html | 14 +++----- .../components/transaction/transaction.scss | 30 ++-------------- app/src/components/transaction/transaction.ts | 35 ++++++++++--------- app/src/pages/input-output/input-output.scss | 3 -- .../outpoint.html} | 9 +++-- .../outpoint.module.ts} | 10 +++--- app/src/pages/outpoint/outpoint.scss | 3 ++ .../input-output.ts => outpoint/outpoint.ts} | 18 +++++----- 8 files changed, 48 insertions(+), 74 deletions(-) delete mode 100644 app/src/pages/input-output/input-output.scss rename app/src/pages/{input-output/input-output.html => outpoint/outpoint.html} (80%) rename app/src/pages/{input-output/input-output.module.ts => outpoint/outpoint.module.ts} (69%) create mode 100644 app/src/pages/outpoint/outpoint.scss rename app/src/pages/{input-output/input-output.ts => outpoint/outpoint.ts} (77%) diff --git a/app/src/components/transaction/transaction.html b/app/src/components/transaction/transaction.html index 429b159..1c59366 100644 --- a/app/src/components/transaction/transaction.html +++ b/app/src/components/transaction/transaction.html @@ -32,7 +32,7 @@ - +

@@ -48,18 +48,12 @@

- - -
- +

{{ item.scriptSig.asm }}

- - -
@@ -79,7 +73,7 @@ - +

@@ -104,7 +98,7 @@ {{ currency.getConvertedNumber(vout.value) | number:'1.0-8' }} {{ currency.currencySymbol }} (S) - + diff --git a/app/src/components/transaction/transaction.scss b/app/src/components/transaction/transaction.scss index 78d2821..3021c0f 100644 --- a/app/src/components/transaction/transaction.scss +++ b/app/src/components/transaction/transaction.scss @@ -9,8 +9,6 @@ transaction { ion-row { border: 1px solid #f3f3f3; - margin-top: 10px; - margin-bottom: 10px; &.small { font-size: 1.1rem; @@ -26,35 +24,11 @@ transaction { ion-icon { color: rgba(0, 0, 0, 0.25); - margin-right: 5px; } -// New Stuff - -.shiftDown { - padding-top: 1.2em; -} - -.ellipsis { - margin-bottom: .7rem; - margin-top: 8px; -} - -.unlocking-script { - padding-top: .7rem; - max-width: 90%; -} - -.locking-script { - padding-top: .7rem; -} - -//end - .item, .item p { font-size: 1.4rem; - font-weight: bold; } $transaction-item-boarder-radius: 3px; @@ -67,10 +41,10 @@ transaction { border-bottom-right-radius: $transaction-item-boarder-radius; } - .itemHighlight { + .item--state-highlight { background-color: #8dc429; } - .itemNoLight { + .item--state-nolight { background-color: default; } diff --git a/app/src/components/transaction/transaction.ts b/app/src/components/transaction/transaction.ts index a854007..9a7b027 100644 --- a/app/src/components/transaction/transaction.ts +++ b/app/src/components/transaction/transaction.ts @@ -19,8 +19,8 @@ export class TransactionComponent { public expanded: boolean = false; @Input() public tx: any = {}; - @Input() public dr?: string; - @Input() public dx?: number; + @Input() public txDirection?: string; + @Input() public txIndex?: number; constructor(private navCtrl: NavController, public currency: CurrencyProvider) { } @@ -39,20 +39,23 @@ export class TransactionComponent { }); } - public goToInput(txId: string, dxNm: number): void { - this.navCtrl.push('input-output', { - 'txId': txId, - 'dir': '<', - 'dxNm': dxNm - }); - } - - public goToOutput(txId: string, dxNm: number): void { - this.navCtrl.push('input-output', { - 'txId': txId, - 'dir': '>', - 'dxNm': dxNm - }); + public goToOutpoint(txId: string, txDirection: string, txIndex: number): void { + // output page + if (txDirection === '>') { + this.navCtrl.push('outpoint', { + 'txId': txId, + 'txDirection': '>', + 'txIndex': txIndex + }); + } + // input page + if (txDirection === '<') { + this.navCtrl.push('outpoint', { + 'txId': txId, + 'txDirection': '<', + 'txIndex': txIndex + }); + } } public goToAddress(addrStr: string): void { diff --git a/app/src/pages/input-output/input-output.scss b/app/src/pages/input-output/input-output.scss deleted file mode 100644 index a447548..0000000 --- a/app/src/pages/input-output/input-output.scss +++ /dev/null @@ -1,3 +0,0 @@ -page-input-output { - -} diff --git a/app/src/pages/input-output/input-output.html b/app/src/pages/outpoint/outpoint.html similarity index 80% rename from app/src/pages/input-output/input-output.html rename to app/src/pages/outpoint/outpoint.html index 0f559f1..313917c 100644 --- a/app/src/pages/input-output/input-output.html +++ b/app/src/pages/outpoint/outpoint.html @@ -9,8 +9,11 @@

-

Output Transaction | Index #{{ dxNm }}

-

Input Transaction | Index #{{ dxNm }}

+

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

Transaction Hash {{ tx.txid }}

@@ -52,7 +55,7 @@

Details

- +
diff --git a/app/src/pages/input-output/input-output.module.ts b/app/src/pages/outpoint/outpoint.module.ts similarity index 69% rename from app/src/pages/input-output/input-output.module.ts rename to app/src/pages/outpoint/outpoint.module.ts index f2a3401..c53cd70 100644 --- a/app/src/pages/input-output/input-output.module.ts +++ b/app/src/pages/outpoint/outpoint.module.ts @@ -1,20 +1,20 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; -import { InputOutputPage } from './input-output'; +import { OutpointPage } from './outpoint'; import { TransactionComponentModule } from '../../components/transaction/transaction.module'; import { HeadNavComponentModule } from '../../components/head-nav/head-nav.module'; @NgModule({ declarations: [ - InputOutputPage + OutpointPage ], imports: [ - IonicPageModule.forChild(InputOutputPage), + IonicPageModule.forChild(OutpointPage), TransactionComponentModule, HeadNavComponentModule ], exports: [ - InputOutputPage + OutpointPage ] }) -export class InputOutputPageModule {} +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/input-output/input-output.ts b/app/src/pages/outpoint/outpoint.ts similarity index 77% rename from app/src/pages/input-output/input-output.ts rename to app/src/pages/outpoint/outpoint.ts index d94751b..b64a75a 100644 --- a/app/src/pages/input-output/input-output.ts +++ b/app/src/pages/outpoint/outpoint.ts @@ -10,25 +10,25 @@ import { ApiProvider } from '../../providers/api/api'; * on Ionic pages and navigation. */ @IonicPage({ - name: 'input-output', - segment: 'tx/:txId/:dir/:dxNm' + name: 'outpoint', + segment: 'tx/:txId/:txDirection/:txIndex' }) @Component({ - selector: 'page-input-output', - templateUrl: 'input-output.html' + selector: 'page-outpoint', + templateUrl: 'outpoint.html' }) -export class InputOutputPage { +export class OutpointPage { public loading: boolean = true; private txId: string; - public dxNm: number; - public dir: 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.dxNm = Number(navParams.get('dxNm')); - this.dir = navParams.get('dir'); + this.txIndex = Number(navParams.get('txIndex')); + this.txDirection = navParams.get('txDirection'); } public ionViewDidLoad(): void { From 75e951dcc1f06dfa1a428b5785021663c7eaa027 Mon Sep 17 00:00:00 2001 From: Ash Bhimasani <16abhimasani@gmail.com> Date: Fri, 1 Jun 2018 15:16:43 -0400 Subject: [PATCH 6/7] fix --- app/src/components/transaction/transaction.html | 4 ++-- app/src/components/transaction/transaction.scss | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/src/components/transaction/transaction.html b/app/src/components/transaction/transaction.html index 1c59366..7ec54e1 100644 --- a/app/src/components/transaction/transaction.html +++ b/app/src/components/transaction/transaction.html @@ -32,7 +32,7 @@ - +

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

diff --git a/app/src/components/transaction/transaction.scss b/app/src/components/transaction/transaction.scss index 3021c0f..d66414c 100644 --- a/app/src/components/transaction/transaction.scss +++ b/app/src/components/transaction/transaction.scss @@ -44,9 +44,6 @@ transaction { .item--state-highlight { background-color: #8dc429; } - .item--state-nolight { - background-color: default; - } .list { margin-bottom: 5px; From 651629bd5dbd4d92cca9cdbac310fb127862a03a Mon Sep 17 00:00:00 2001 From: Ash Bhimasani <16abhimasani@gmail.com> Date: Fri, 8 Jun 2018 10:29:30 -0400 Subject: [PATCH 7/7] Cleaning up Transaction Component --- app/src/components/transaction/transaction.html | 2 +- app/src/components/transaction/transaction.ts | 17 +++-------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/app/src/components/transaction/transaction.html b/app/src/components/transaction/transaction.html index 7ec54e1..456130b 100644 --- a/app/src/components/transaction/transaction.html +++ b/app/src/components/transaction/transaction.html @@ -68,7 +68,7 @@ - + diff --git a/app/src/components/transaction/transaction.ts b/app/src/components/transaction/transaction.ts index 9a7b027..8df9792 100644 --- a/app/src/components/transaction/transaction.ts +++ b/app/src/components/transaction/transaction.ts @@ -40,22 +40,11 @@ export class TransactionComponent { } public goToOutpoint(txId: string, txDirection: string, txIndex: number): void { - // output page - if (txDirection === '>') { - this.navCtrl.push('outpoint', { + this.navCtrl.push('outpoint', { 'txId': txId, - 'txDirection': '>', + 'txDirection': txDirection, 'txIndex': txIndex - }); - } - // input page - if (txDirection === '<') { - this.navCtrl.push('outpoint', { - 'txId': txId, - 'txDirection': '<', - 'txIndex': txIndex - }); - } + }); } public goToAddress(addrStr: string): void {