Skip to content

Commit

Permalink
insight ppc support
Browse files Browse the repository at this point in the history
  • Loading branch information
backpacker69 committed Sep 27, 2019
1 parent 28bcfcc commit a3538c2
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 10 deletions.
1 change: 1 addition & 0 deletions packages/insight/src/assets/img/currency_logos/ppc.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/insight/src/assets/img/ppcicon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/insight/src/components/coin-list/coin-list.html
Expand Up @@ -4,7 +4,7 @@
<ion-grid>
<ion-row *ngFor="let tx of txs; let i = index">
<ion-col col-12 *ngIf="i < limit && (tx.spentTxid !== '' || tx.mintTxid)">
<coin *ngIf="chainNetwork.chain === 'BTC' || chainNetwork.chain === 'BCH'" [coin]="tx" [chainNetwork]="chainNetwork"></coin>
<coin *ngIf="chainNetwork.chain === 'BTC' || chainNetwork.chain === 'BCH' || chainNetwork.chain === 'PPC'" [coin]="tx" [chainNetwork]="chainNetwork"></coin>
<transaction-details-eth *ngIf="chainNetwork.chain === 'ETH'" [tx]="tx" [showCoins]="true" [chainNetwork]="chainNetwork"></transaction-details-eth>
</ion-col>
</ion-row>
Expand Down
1 change: 1 addition & 0 deletions packages/insight/src/components/head-nav/head-nav.html
Expand Up @@ -13,6 +13,7 @@
<ion-icon name="logo-bitcoin" *ngIf="(chainNetwork.chain === 'BTC' || chainNetwork.chain === 'BCH') && currencyProvider?.currencySymbol !== 'USD'"></ion-icon>
<ion-icon name="logo-usd" *ngIf="currencyProvider?.currencySymbol === 'USD'"></ion-icon>
<img class="eth-icon" src="assets/img/ethicon.svg" *ngIf="chainNetwork.chain === 'ETH' && currencyProvider?.currencySymbol !== 'USD'" width="12">
<img class="ppc-icon" src="assets/img/ppcicon.svg" *ngIf="chainNetwork.chain === 'PPC' && currencyProvider?.currencySymbol !== 'USD'" width="12">
&nbsp;
{{ currencyProvider?.currencySymbol }}
&nbsp;
Expand Down
Expand Up @@ -57,7 +57,7 @@ export class LatestBlocksComponent implements OnInit, OnDestroy {
.subscribe(
response => {
const blocks = response.map((block: ApiEthBlock & ApiUtxoCoinBlock ) => {
if(this.chainNetwork.chain === "BTC" || this.chainNetwork.chain === "BCH") {
if(this.chainNetwork.chain === "BTC" || this.chainNetwork.chain === "BCH" || this.chainNetwork.chain === "PPC") {
return this.blocksProvider.toUtxoCoinAppBlock(block);
}
if(this.chainNetwork.chain === "ETH") {
Expand Down Expand Up @@ -86,7 +86,7 @@ export class LatestBlocksComponent implements OnInit, OnDestroy {
.subscribe(
response => {
const blocks = response.map((block: ApiEthBlock & ApiUtxoCoinBlock) => {
if(this.chainNetwork.chain === "BTC" || this.chainNetwork.chain === "BCH") {
if(this.chainNetwork.chain === "BTC" || this.chainNetwork.chain === "BCH" || this.chainNetwork.chain === "PPC") {
return this.blocksProvider.toUtxoCoinAppBlock(block);
}
if(this.chainNetwork.chain === "ETH") {
Expand Down
Expand Up @@ -30,7 +30,7 @@ export class TransactionListComponent implements OnInit {
response => {
// Newly Generated Coins (Coinbase) First
const txs = response.map((tx: ApiEthTx & ApiUtxoCoinTx) => {
if(this.chainNetwork.chain === "BTC" || this.chainNetwork.chain === "BCH") {
if(this.chainNetwork.chain === "BTC" || this.chainNetwork.chain === "BCH" || this.chainNetwork.chain === "PPC") {
return this.txProvider.toUtxoCoinsAppTx(tx)
}
if(this.chainNetwork.chain === "ETH") {
Expand Down
2 changes: 1 addition & 1 deletion packages/insight/src/pages/block-detail/block-detail.html
Expand Up @@ -23,7 +23,7 @@ <h2>Summary</h2>
<ion-grid>
<ion-row>
<ion-col col-12 col-md class="allow-truncated-text">
<block-summary *ngIf="chainNetwork.chain === 'BTC' || chainNetwork.chain === 'BCH'" [block]="block" [chainNetwork]="chainNetwork"></block-summary>
<block-summary *ngIf="chainNetwork.chain === 'BTC' || chainNetwork.chain === 'BCH' || chainNetwork.chain === 'PPC'" [block]="block" [chainNetwork]="chainNetwork"></block-summary>
<block-summary-eth *ngIf="chainNetwork.chain === 'ETH'" [block]="block" [chainNetwork]="chainNetwork"></block-summary-eth>
<ion-item>
Number of Transactions
Expand Down
2 changes: 1 addition & 1 deletion packages/insight/src/pages/block-detail/block-detail.ts
Expand Up @@ -54,7 +54,7 @@ export class BlockDetailPage {
this.blocksProvider.getBlock(this.blockHash, this.chainNetwork).subscribe(
response => {
let block;
if(this.chainNetwork.chain === "BTC" || this.chainNetwork.chain === "BCH") {
if(this.chainNetwork.chain === "BTC" || this.chainNetwork.chain === "BCH" || this.chainNetwork.chain === "PPC") {
block = this.blocksProvider.toUtxoCoinAppBlock(response);
}
if(this.chainNetwork.chain === "ETH") {
Expand Down
4 changes: 2 additions & 2 deletions packages/insight/src/pages/transaction/transaction.html
Expand Up @@ -29,7 +29,7 @@ <h2>Summary</h2>

<ion-list class="list--summary">

<transaction-summary *ngIf="chainNetwork.chain === 'BTC' || chainNetwork.chain === 'BCH'" [tx]="tx" [chainNetwork]="chainNetwork"></transaction-summary>
<transaction-summary *ngIf="chainNetwork.chain === 'BTC' || chainNetwork.chain === 'BCH' || chainNetwork.chain === 'PPC'" [tx]="tx" [chainNetwork]="chainNetwork"></transaction-summary>
<transaction-summary-eth *ngIf="chainNetwork.chain === 'ETH'" [tx]="tx" [chainNetwork]="chainNetwork"></transaction-summary-eth>

<ion-item>
Expand All @@ -54,7 +54,7 @@ <h2>Summary</h2>

<h2>Details</h2>

<transaction-details *ngIf="chainNetwork.chain === 'BTC' || chainNetwork.chain === 'BCH'" [tx]="tx" [showCoins]="true" [chainNetwork]="chainNetwork"></transaction-details>
<transaction-details *ngIf="chainNetwork.chain === 'BTC' || chainNetwork.chain === 'BCH' || chainNetwork.chain === 'PPC'" [tx]="tx" [showCoins]="true" [chainNetwork]="chainNetwork"></transaction-details>
<transaction-details-eth *ngIf="chainNetwork.chain === 'ETH'" [tx]="tx" [showCoins]="true" [chainNetwork]="chainNetwork"></transaction-details-eth>
</div>

Expand Down
2 changes: 1 addition & 1 deletion packages/insight/src/pages/transaction/transaction.ts
Expand Up @@ -55,7 +55,7 @@ export class TransactionPage {
this.txProvider.getTx(this.txId, this.chainNetwork).subscribe(
response => {
let tx;
if(this.chainNetwork.chain === "BTC" || this.chainNetwork.chain === "BCH") {
if(this.chainNetwork.chain === "BTC" || this.chainNetwork.chain === "BCH" || this.chainNetwork.chain === "PPC") {
tx = this.txProvider.toUtxoCoinsAppTx(response);
}
if(this.chainNetwork.chain === "ETH") {
Expand Down
1 change: 1 addition & 0 deletions packages/insight/src/providers/api/api.ts
Expand Up @@ -39,6 +39,7 @@ export class ApiProvider {
public ratesAPI = {
btc: 'https://bitpay.com/api/rates',
bch: 'https://bitpay.com/api/rates/bch',
ppc: 'https://bitpay.com/api/rates/bch',
eth: 'https://bitpay.com/api/rates/eth'
};

Expand Down
3 changes: 3 additions & 0 deletions packages/insight/src/providers/price/price.ts
Expand Up @@ -28,6 +28,9 @@ export class PriceProvider {
case 'BCH':
ratesAPI = this.api.ratesAPI.bch;
break;
case 'PPC':
ratesAPI = this.api.ratesAPI.ppc;
break;
case 'ETH':
ratesAPI = this.api.ratesAPI.eth;
break;
Expand Down
2 changes: 1 addition & 1 deletion packages/insight/src/providers/search/search.ts
Expand Up @@ -58,7 +58,7 @@ export class SearchProvider {
}
private extractAddress(address: string): string {
const extractedAddress = address
.replace(/^(bitcoincash:|bchtest:|bitcoin:)/i, '')
.replace(/^(bitcoincash:|bchtest:|bitcoin:|peercoin:|peercointest:)/i, '')
.replace(/\?.*/, '');
return extractedAddress || address;
}
Expand Down

0 comments on commit a3538c2

Please sign in to comment.