-
-
No Inputs (Newly Generated Coins)
+
+
+
+ {{ tx.txid }}
+
+
+
+ first seen at
+
-
-
-
- >
-
-
-
+
+
-
-
-
-
{{ vin.value + ' BTC' }}
-
-
-
- >
-
-
-
-
+
+
+
+
+
{{ vin.value + ' BTC' }}
+
+
+
+
+
+ >
+
+
+
+
+
+
+
+
+
+ Fee
+
+
+ Confirmations
+
+
+
diff --git a/app/src/pages/address/address.html b/app/src/pages/address/address.html
index 8c0d204..7399a57 100644
--- a/app/src/pages/address/address.html
+++ b/app/src/pages/address/address.html
@@ -49,5 +49,5 @@
-
+
diff --git a/app/src/pages/address/address.ts b/app/src/pages/address/address.ts
index 453678c..e392a33 100644
--- a/app/src/pages/address/address.ts
+++ b/app/src/pages/address/address.ts
@@ -1,6 +1,7 @@
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 AddressPage page.
@@ -22,14 +23,12 @@ export class AddressPage {
private addrStr: string;
public address: any = {};
- constructor(public navCtrl: NavController, public navParams: NavParams, private http: Http) {
+ constructor(public navCtrl: NavController, public navParams: NavParams, private http: Http, private api: ApiProvider) {
this.addrStr = navParams.get('addrStr');
}
public ionViewDidLoad(): void {
- let apiPrefix: string = 'http://localhost:3001/insight-api/';
-
- this.http.get(apiPrefix + 'addr/' + this.addrStr + '/?noTxList=1').subscribe(
+ this.http.get(this.api.apiPrefix + 'addr/' + this.addrStr + '/?noTxList=1').subscribe(
(data) => {
this.address = JSON.parse(data['_body']);
this.loading = false;
diff --git a/app/src/pages/block-detail/block-detail.ts b/app/src/pages/block-detail/block-detail.ts
index bcd5983..66053d5 100644
--- a/app/src/pages/block-detail/block-detail.ts
+++ b/app/src/pages/block-detail/block-detail.ts
@@ -1,6 +1,7 @@
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 BlockDetailPage page.
@@ -24,12 +25,10 @@ export class BlockDetailPage {
tx: []
};
- constructor(public navCtrl: NavController, private http: Http, public navParams: NavParams) {
+ constructor(public navCtrl: NavController, private http: Http, public navParams: NavParams, private api: ApiProvider) {
this.blockHash = navParams.get('blockHash');
- let apiPrefix: string = 'http://localhost:3001/insight-api/';
-
- this.http.get(apiPrefix + 'block/' + this.blockHash).subscribe(
+ this.http.get(this.api.apiPrefix + 'block/' + this.blockHash).subscribe(
(data) => {
this.block = JSON.parse(data['_body']);
this.loading = false;
diff --git a/app/src/pages/blocksPage/blocksPage.ts b/app/src/pages/blocksPage/blocksPage.ts
index cd06daf..4d5bd44 100644
--- a/app/src/pages/blocksPage/blocksPage.ts
+++ b/app/src/pages/blocksPage/blocksPage.ts
@@ -4,6 +4,7 @@ import { Observable } from 'rxjs';
import { Block } from '../../models';
import { BlocksService } from '../../services';
import { Http } from '@angular/http';
+import { ApiProvider } from '../../providers/api/api';
@Component({
templateUrl: './blocksPage.html'
@@ -17,7 +18,7 @@ export class BlocksPage {
public q: string;
public badQuery: boolean = false;
- constructor(private navCtrl: NavController, private http: Http, private blocksService: BlocksService) {
+ constructor(private navCtrl: NavController, private http: Http, private blocksService: BlocksService, private api: ApiProvider) {
this.title = 'Blocks';
this.blocks = blocksService.latestBlocks;
// this.blocks.subscribe((blocks) => {
@@ -27,8 +28,8 @@ export class BlocksPage {
}
public search(): void {
- console.log('q is', this.q);
- let apiPrefix: string = 'http://localhost:3001/insight-api/';
+ let apiPrefix: string = this.api.apiPrefix;
+
this.http.get(apiPrefix + 'block/' + this.q).subscribe(
(data) => {
this.resetSearch();
diff --git a/app/src/pages/transaction/transaction.ts b/app/src/pages/transaction/transaction.ts
index 37c4b74..8e817ea 100644
--- a/app/src/pages/transaction/transaction.ts
+++ b/app/src/pages/transaction/transaction.ts
@@ -1,6 +1,7 @@
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 TransactionPage page.
@@ -22,14 +23,12 @@ export class TransactionPage {
private txId: string;
public tx: any = {};
- constructor(public navCtrl: NavController, public navParams: NavParams, private http: Http) {
+ constructor(public navCtrl: NavController, public navParams: NavParams, private http: Http, private api: ApiProvider) {
this.txId = navParams.get('txId');
}
public ionViewDidLoad(): void {
- let apiPrefix: string = 'http://localhost:3001/insight-api/';
-
- this.http.get(apiPrefix + 'tx/' + this.txId).subscribe(
+ this.http.get(this.api.apiPrefix + 'tx/' + this.txId).subscribe(
(data) => {
this.tx = JSON.parse(data['_body']);
console.log('tx', this.tx);
diff --git a/app/src/providers/api/api.ts b/app/src/providers/api/api.ts
new file mode 100644
index 0000000..31c1966
--- /dev/null
+++ b/app/src/providers/api/api.ts
@@ -0,0 +1,19 @@
+import { Injectable } from '@angular/core';
+import { Http } from '@angular/http';
+import 'rxjs/add/operator/map';
+
+/*
+ Generated class for the ApiProvider provider.
+
+ See https://angular.io/docs/ts/latest/guide/dependency-injection.html
+ for more info on providers and Angular DI.
+*/
+@Injectable()
+export class ApiProvider {
+
+ public apiPrefix: string = 'http://localhost:3001/insight-api/';
+
+ constructor(public http: Http) {
+ }
+
+}