From 1a087b4f811c23d48d7bc1b235b8cd43feb5a6c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Mon, 26 Aug 2019 10:20:55 -0300 Subject: [PATCH 01/11] [FEAT] ETH --- .../block-summary-eth/block-summary-eth.html | 18 +++ .../block-summary-eth.module.ts | 10 ++ .../block-summary-eth/block-summary-eth.scss | 2 + .../block-summary-eth/block-summary-eth.ts | 25 ++++ .../block-summary/block-summary.html | 19 +++ .../block-summary/block-summary.module.ts | 10 ++ .../block-summary/block-summary.scss | 2 + .../components/block-summary/block-summary.ts | 25 ++++ .../src/components/coin-list/coin-list.html | 3 +- .../components/coin-list/coin-list.module.ts | 3 +- .../src/components/coin-list/coin-list.ts | 6 +- .../insight/src/components/coin/coin.html | 4 +- packages/insight/src/components/coin/coin.ts | 2 + .../src/components/components.module.ts | 3 +- .../transaction-details-eth.html | 114 ++++++++++++++++++ .../transaction-details-eth.module.ts | 10 ++ .../transaction-details-eth.scss | 70 +++++++++++ .../transaction-details-eth.ts | 55 +++++++++ .../transaction-details.html} | 28 ++++- .../transaction-details.module.ts | 10 ++ .../transaction-details.scss} | 2 +- .../transaction-details.ts} | 15 ++- .../transaction-list/transaction-list.html | 2 +- .../transaction-list.module.ts | 5 +- .../transaction-summary-eth.html | 31 +++++ .../transaction-summary-eth.module.ts | 10 ++ .../transaction-summary-eth.scss | 2 + .../transaction-summary-eth.ts | 25 ++++ .../transaction-summary.html | 12 ++ .../transaction-summary.module.ts | 10 ++ .../transaction-summary.scss | 2 + .../transaction-summary.ts | 25 ++++ .../transaction/transaction.module.ts | 11 -- .../insight/src/pages/address/address.html | 6 +- packages/insight/src/pages/address/address.ts | 4 +- .../src/pages/block-detail/block-detail.html | 36 ++---- .../pages/block-detail/block-detail.module.ts | 4 + .../src/pages/block-detail/block-detail.ts | 12 +- .../src/pages/transaction/transaction.html | 25 +--- .../pages/transaction/transaction.module.ts | 10 +- .../src/pages/transaction/transaction.ts | 15 ++- .../insight/src/providers/address/address.ts | 6 +- .../insight/src/providers/blocks/blocks.ts | 44 +++++-- .../src/providers/currency/currency.ts | 13 +- .../providers/transactions/transactions.ts | 70 ++++++++++- 45 files changed, 703 insertions(+), 113 deletions(-) create mode 100644 packages/insight/src/components/block-summary-eth/block-summary-eth.html create mode 100644 packages/insight/src/components/block-summary-eth/block-summary-eth.module.ts create mode 100644 packages/insight/src/components/block-summary-eth/block-summary-eth.scss create mode 100644 packages/insight/src/components/block-summary-eth/block-summary-eth.ts create mode 100644 packages/insight/src/components/block-summary/block-summary.html create mode 100644 packages/insight/src/components/block-summary/block-summary.module.ts create mode 100644 packages/insight/src/components/block-summary/block-summary.scss create mode 100644 packages/insight/src/components/block-summary/block-summary.ts create mode 100644 packages/insight/src/components/transaction-details-eth/transaction-details-eth.html create mode 100644 packages/insight/src/components/transaction-details-eth/transaction-details-eth.module.ts create mode 100644 packages/insight/src/components/transaction-details-eth/transaction-details-eth.scss create mode 100644 packages/insight/src/components/transaction-details-eth/transaction-details-eth.ts rename packages/insight/src/components/{transaction/transaction.html => transaction-details/transaction-details.html} (85%) create mode 100644 packages/insight/src/components/transaction-details/transaction-details.module.ts rename packages/insight/src/components/{transaction/transaction.scss => transaction-details/transaction-details.scss} (98%) rename packages/insight/src/components/{transaction/transaction.ts => transaction-details/transaction-details.ts} (92%) create mode 100644 packages/insight/src/components/transaction-summary-eth/transaction-summary-eth.html create mode 100644 packages/insight/src/components/transaction-summary-eth/transaction-summary-eth.module.ts create mode 100644 packages/insight/src/components/transaction-summary-eth/transaction-summary-eth.scss create mode 100644 packages/insight/src/components/transaction-summary-eth/transaction-summary-eth.ts create mode 100644 packages/insight/src/components/transaction-summary/transaction-summary.html create mode 100644 packages/insight/src/components/transaction-summary/transaction-summary.module.ts create mode 100644 packages/insight/src/components/transaction-summary/transaction-summary.scss create mode 100644 packages/insight/src/components/transaction-summary/transaction-summary.ts delete mode 100644 packages/insight/src/components/transaction/transaction.module.ts diff --git a/packages/insight/src/components/block-summary-eth/block-summary-eth.html b/packages/insight/src/components/block-summary-eth/block-summary-eth.html new file mode 100644 index 00000000000..a110863e26f --- /dev/null +++ b/packages/insight/src/components/block-summary-eth/block-summary-eth.html @@ -0,0 +1,18 @@ + + Total Difficulty + + {{ block.totalDifficulty }} + + + + Gas Limit + + {{ block.gasLimit }} + + + + Gas Used + + {{ block.gasUsed }} + + \ No newline at end of file diff --git a/packages/insight/src/components/block-summary-eth/block-summary-eth.module.ts b/packages/insight/src/components/block-summary-eth/block-summary-eth.module.ts new file mode 100644 index 00000000000..27dbb8061d7 --- /dev/null +++ b/packages/insight/src/components/block-summary-eth/block-summary-eth.module.ts @@ -0,0 +1,10 @@ +import { NgModule } from '@angular/core'; +import { IonicModule } from 'ionic-angular'; +import { BlockSummaryEthComponent } from './block-summary-eth'; + +@NgModule({ + declarations: [BlockSummaryEthComponent], + imports: [IonicModule], + exports: [BlockSummaryEthComponent] +}) +export class BlockSummaryEthComponentModule {} diff --git a/packages/insight/src/components/block-summary-eth/block-summary-eth.scss b/packages/insight/src/components/block-summary-eth/block-summary-eth.scss new file mode 100644 index 00000000000..b051a665f26 --- /dev/null +++ b/packages/insight/src/components/block-summary-eth/block-summary-eth.scss @@ -0,0 +1,2 @@ +block-summary-eth { +} diff --git a/packages/insight/src/components/block-summary-eth/block-summary-eth.ts b/packages/insight/src/components/block-summary-eth/block-summary-eth.ts new file mode 100644 index 00000000000..1afd3a66431 --- /dev/null +++ b/packages/insight/src/components/block-summary-eth/block-summary-eth.ts @@ -0,0 +1,25 @@ +import { Component, Input } from '@angular/core'; +import { ChainNetwork } from '../../providers/api/api'; +import { CurrencyProvider } from '../../providers/currency/currency'; + +/** + * Generated class for the BlockSummaryEthComponent component. + * + * See https://angular.io/docs/ts/latest/api/core/index/ComponentMetadata-class.html + * for more info on Angular Components. + */ +@Component({ + selector: 'block-summary-eth', + templateUrl: 'block-summary-eth.html' +}) +export class BlockSummaryEthComponent { + @Input() + public block: any = {}; + @Input() + public chainNetwork: ChainNetwork; + + constructor( + public currencyProvider: CurrencyProvider + ) { + } +} diff --git a/packages/insight/src/components/block-summary/block-summary.html b/packages/insight/src/components/block-summary/block-summary.html new file mode 100644 index 00000000000..1e42e756531 --- /dev/null +++ b/packages/insight/src/components/block-summary/block-summary.html @@ -0,0 +1,19 @@ + + Merkle Root + + {{ block.merkleroot }} + + + + + Bits + + {{ block.bits }} + + + + Version + + {{ block.version }} + + \ No newline at end of file diff --git a/packages/insight/src/components/block-summary/block-summary.module.ts b/packages/insight/src/components/block-summary/block-summary.module.ts new file mode 100644 index 00000000000..8655fec917e --- /dev/null +++ b/packages/insight/src/components/block-summary/block-summary.module.ts @@ -0,0 +1,10 @@ +import { NgModule } from '@angular/core'; +import { IonicModule } from 'ionic-angular'; +import { BlockSummaryComponent } from './block-summary'; + +@NgModule({ + declarations: [BlockSummaryComponent], + imports: [IonicModule], + exports: [BlockSummaryComponent] +}) +export class BlockSummaryComponentModule {} diff --git a/packages/insight/src/components/block-summary/block-summary.scss b/packages/insight/src/components/block-summary/block-summary.scss new file mode 100644 index 00000000000..a993f4b7691 --- /dev/null +++ b/packages/insight/src/components/block-summary/block-summary.scss @@ -0,0 +1,2 @@ +block-summary { +} diff --git a/packages/insight/src/components/block-summary/block-summary.ts b/packages/insight/src/components/block-summary/block-summary.ts new file mode 100644 index 00000000000..9f37ca9190a --- /dev/null +++ b/packages/insight/src/components/block-summary/block-summary.ts @@ -0,0 +1,25 @@ +import { Component, Input } from '@angular/core'; +import { ChainNetwork } from '../../providers/api/api'; +import { CurrencyProvider } from '../../providers/currency/currency'; + +/** + * Generated class for the BlockSummaryComponent component. + * + * See https://angular.io/docs/ts/latest/api/core/index/ComponentMetadata-class.html + * for more info on Angular Components. + */ +@Component({ + selector: 'block-summary', + templateUrl: 'block-summary.html' +}) +export class BlockSummaryComponent { + @Input() + public block: any = {}; + @Input() + public chainNetwork: ChainNetwork; + + constructor( + public currencyProvider: CurrencyProvider + ) { + } +} diff --git a/packages/insight/src/components/coin-list/coin-list.html b/packages/insight/src/components/coin-list/coin-list.html index 29a46800272..d68491d95eb 100644 --- a/packages/insight/src/components/coin-list/coin-list.html +++ b/packages/insight/src/components/coin-list/coin-list.html @@ -4,7 +4,8 @@ - + + diff --git a/packages/insight/src/components/coin-list/coin-list.module.ts b/packages/insight/src/components/coin-list/coin-list.module.ts index 5ed7e3420e2..105a07a4b08 100644 --- a/packages/insight/src/components/coin-list/coin-list.module.ts +++ b/packages/insight/src/components/coin-list/coin-list.module.ts @@ -1,12 +1,13 @@ import { NgModule } from '@angular/core'; import { IonicModule } from 'ionic-angular'; +import { TransactionDetailsEthComponentModule } from '../../components/transaction-details-eth/transaction-details-eth.module'; import { CoinComponentModule } from '../coin/coin.module'; import { LoaderComponentModule } from '../loader/loader.module'; import { CoinListComponent } from './coin-list'; @NgModule({ declarations: [CoinListComponent], - imports: [IonicModule, CoinComponentModule, LoaderComponentModule], + imports: [IonicModule, CoinComponentModule,TransactionDetailsEthComponentModule, LoaderComponentModule], exports: [CoinListComponent] }) export class CoinListComponentModule {} diff --git a/packages/insight/src/components/coin-list/coin-list.ts b/packages/insight/src/components/coin-list/coin-list.ts index 5271e1407dd..7d0ea8ce872 100644 --- a/packages/insight/src/components/coin-list/coin-list.ts +++ b/packages/insight/src/components/coin-list/coin-list.ts @@ -3,7 +3,6 @@ import { Events } from 'ionic-angular'; import _ from 'lodash'; import { AddressProvider } from '../../providers/address/address'; import { ChainNetwork } from '../../providers/api/api'; -import { Logger } from '../../providers/logger/logger'; import { TxsProvider } from '../../providers/transactions/transactions'; @Component({ @@ -34,8 +33,9 @@ export class CoinListComponent implements OnInit { this.loading = true; this.addrProvider.getAddressActivity(this.addrStr).subscribe( data => { - const formattedData = data.map(this.txsProvider.toAppCoin); - this.txs = this.processData(formattedData); + const toAppCoin: any = this.chainNetwork.chain !== 'ETH' ? this.txsProvider.toAppCoin: this.txsProvider.toAppEthCoin; + const formattedData = data.map(toAppCoin); + this.txs = this.chainNetwork.chain !== 'ETH' ? this.processData(formattedData): formattedData; this.showTransactions = true; this.loading = false; this.events.publish('CoinList', { length: data.length }); diff --git a/packages/insight/src/components/coin/coin.html b/packages/insight/src/components/coin/coin.html index 60661a1b646..3db5ea9a06d 100644 --- a/packages/insight/src/components/coin/coin.html +++ b/packages/insight/src/components/coin/coin.html @@ -28,7 +28,7 @@ - {{ currencyProvider.getConvertedNumber(coin.value) | number:'1.0-8' }} + {{ currencyProvider.getConvertedNumber(coin.value, chainNetwork.chain) | number:'1.0-8' }} {{ currencyProvider.currencySymbol }} @@ -70,7 +70,7 @@ - - {{ currencyProvider.getConvertedNumber(coin.value) | number:'1.0-8' }} + - {{ currencyProvider.getConvertedNumber(coin.value, chainNetwork.chain) | number:'1.0-8' }} {{ currencyProvider.currencySymbol }} diff --git a/packages/insight/src/components/coin/coin.ts b/packages/insight/src/components/coin/coin.ts index 0e1c07dc57c..66bb9a4a42f 100644 --- a/packages/insight/src/components/coin/coin.ts +++ b/packages/insight/src/components/coin/coin.ts @@ -25,7 +25,9 @@ export class CoinComponent { // tslint:disable-next-line:use-life-cycle-interface ngAfterViewInit() { + if (this.chainNetwork.chain !== 'ETH') { this.getConfirmations(); + } } public getConfirmations() { diff --git a/packages/insight/src/components/components.module.ts b/packages/insight/src/components/components.module.ts index 4e7a58d5fb5..c9936ea10d1 100644 --- a/packages/insight/src/components/components.module.ts +++ b/packages/insight/src/components/components.module.ts @@ -1,9 +1,10 @@ import { NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { IonicModule } from 'ionic-angular'; +import { SplitPipe } from '../pipes/split/split'; @NgModule({ - declarations: [], + declarations: [SplitPipe], imports: [FormsModule, IonicModule, ReactiveFormsModule], exports: [], entryComponents: [], diff --git a/packages/insight/src/components/transaction-details-eth/transaction-details-eth.html b/packages/insight/src/components/transaction-details-eth/transaction-details-eth.html new file mode 100644 index 00000000000..d6445223133 --- /dev/null +++ b/packages/insight/src/components/transaction-details-eth/transaction-details-eth.html @@ -0,0 +1,114 @@ + + + +
+ + {{ tx.txid }} + +
+
+
+ + + + + + Invalid + + + + + Unconfirmed + + + + + 1 Confirmation + + + + + {{ tx.confirmations }} Confirmations + + + + + {{ currencyProvider.getConvertedNumber(tx.valueOut, chainNetwork.chain) | number:'1.0-8' }} {{ currencyProvider.currencySymbol }} + + + + + + + + + + + No Inputs (Newly Generated Coins) + + + + + +
+

+ {{ tx.from }} +

+
+
+
+ +
+ + + + + + + + +
+
+

+ {{ tx.to }} +

+
+
+
+
+
+
+ + + +
+ + Fee + {{ currencyProvider.getConvertedNumber(tx.fee, chainNetwork.chain) | number:'1.0-8' }} + {{ currencyProvider.currencySymbol }} + + +
+
+ + + Invalid + + + Unconfirmed + + + 1 Confirmation + + + {{ tx.confirmations }} Confirmations + + + + {{ currencyProvider.getConvertedNumber(tx.valueOut, chainNetwork.chain) | number:'1.0-8' }} + {{ currencyProvider.currencySymbol }} + + + +
+
\ No newline at end of file diff --git a/packages/insight/src/components/transaction-details-eth/transaction-details-eth.module.ts b/packages/insight/src/components/transaction-details-eth/transaction-details-eth.module.ts new file mode 100644 index 00000000000..87bc02e1ca4 --- /dev/null +++ b/packages/insight/src/components/transaction-details-eth/transaction-details-eth.module.ts @@ -0,0 +1,10 @@ +import { NgModule } from '@angular/core'; +import { IonicModule } from 'ionic-angular'; +import { TransactionDetailsEthComponent } from './transaction-details-eth'; + +@NgModule({ + declarations: [TransactionDetailsEthComponent], + imports: [IonicModule], + exports: [TransactionDetailsEthComponent] +}) +export class TransactionDetailsEthComponentModule {} diff --git a/packages/insight/src/components/transaction-details-eth/transaction-details-eth.scss b/packages/insight/src/components/transaction-details-eth/transaction-details-eth.scss new file mode 100644 index 00000000000..7545381060f --- /dev/null +++ b/packages/insight/src/components/transaction-details-eth/transaction-details-eth.scss @@ -0,0 +1,70 @@ +transaction-details-eth { + // TODO Customize the grid to have 13 columns so that we have 6-col inputs, 6-col outputs, 1 col arrow + // See http://ionicframework.com/docs/api/components/grid/Grid/#customizing-the-grid + + ion-grid { + background-color: #f7f7f7; + border: 1px solid #f3f3f3; + border-radius: 3px; + + ion-row { + + &.small { + font-size: 1.1rem; + } + + ion-col { + ion-note { + font-size: 1.2rem; + } + } + } + } + + ion-icon { + color: rgba(0, 0, 0, 0.25); + } + + .item, + .item p { + font-size: 1.4rem; + } + + $transaction-item-boarder-radius: 3px; + .item:first-of-type { + border-top-left-radius: $transaction-item-boarder-radius; + border-top-right-radius: $transaction-item-boarder-radius; + } + .item:last-of-type { + border-bottom-left-radius: $transaction-item-boarder-radius; + border-bottom-right-radius: $transaction-item-boarder-radius; + } + + .list { + margin-bottom: 5px; + } + + .chip { + padding-left: 1em; + padding-right: 1em; + border-radius: 3px; + -webkit-font-smoothing: subpixel-antialiased; + + &.chip-md-primary { + //background-color: blue; + } + } + + .note-md { + color: #888; + } + + .unlocking-script, + .locking-script { + white-space: normal; + font-family: monospace; + } + .arrow-forward{ + padding: 18px 0px; + } +} diff --git a/packages/insight/src/components/transaction-details-eth/transaction-details-eth.ts b/packages/insight/src/components/transaction-details-eth/transaction-details-eth.ts new file mode 100644 index 00000000000..0ba963c764c --- /dev/null +++ b/packages/insight/src/components/transaction-details-eth/transaction-details-eth.ts @@ -0,0 +1,55 @@ +import { Component, Input } from '@angular/core'; +import { ApiProvider, ChainNetwork } from '../../providers/api/api'; +import { BlocksProvider } from '../../providers/blocks/blocks'; +import { CurrencyProvider } from '../../providers/currency/currency'; +import { RedirProvider } from '../../providers/redir/redir'; +import { + TxsProvider +} from '../../providers/transactions/transactions'; + +/** + * Generated class for the TransactionDetailsEthComponent component. + * + * See https://angular.io/docs/ts/latest/api/core/index/ComponentMetadata-class.html + * for more info on Angular Components. + */ +@Component({ + selector: 'transaction-details-eth', + templateUrl: 'transaction-details-eth.html' +}) +export class TransactionDetailsEthComponent { + @Input() + public tx: any = {}; + @Input() + public showCoins = false; + @Input() + public chainNetwork: ChainNetwork; + public confirmations: number; + + constructor( + public currencyProvider: CurrencyProvider, + public apiProvider: ApiProvider, + public txProvider: TxsProvider, + public redirProvider: RedirProvider, + public blocksProvider: BlocksProvider + ) { + } + + public goToTx(txId: string, vout?: number, fromVout?: boolean): void { + this.redirProvider.redir('transaction', { + txId, + chain: this.chainNetwork.chain, + network: this.chainNetwork.network, + vout, + fromVout + }); + } + + public goToAddress(addrStr: string): void { + this.redirProvider.redir('address', { + addrStr, + chain: this.chainNetwork.chain, + network: this.chainNetwork.network + }); + } +} diff --git a/packages/insight/src/components/transaction/transaction.html b/packages/insight/src/components/transaction-details/transaction-details.html similarity index 85% rename from packages/insight/src/components/transaction/transaction.html rename to packages/insight/src/components/transaction-details/transaction-details.html index 2f64721c621..c03b4e9f5bf 100644 --- a/packages/insight/src/components/transaction/transaction.html +++ b/packages/insight/src/components/transaction-details/transaction-details.html @@ -47,7 +47,7 @@ - {{ currencyProvider.getConvertedNumber(tx.valueOut) | number:'1.0-8' }} {{ currencyProvider.currencySymbol }} + {{ currencyProvider.getConvertedNumber(tx.valueOut, chainNetwork.chain) | number:'1.0-8' }} {{ currencyProvider.currencySymbol }} @@ -91,7 +91,15 @@
- {{ currencyProvider.getConvertedNumber(vin.value) | number:'1.0-8' }} {{ currencyProvider.currencySymbol }} + {{ currencyProvider.getConvertedNumber(vin.value, chainNetwork.chain) | number:'1.0-8' }} {{ currencyProvider.currencySymbol }} +
+
+ + + @@ -127,7 +135,7 @@
- {{ currencyProvider.getConvertedNumber(vout.value) | number:'1.0-8' }} {{ currencyProvider.currencySymbol }} + {{ currencyProvider.getConvertedNumber(vout.value, chainNetwork.chain) | number:'1.0-8' }} {{ currencyProvider.currencySymbol }} (S) (U)
@@ -137,6 +145,16 @@ + + +
+
+

+ {{ tx.to }} +

+
+
+
@@ -146,7 +164,7 @@
Fee - {{ currencyProvider.getConvertedNumber(tx.fee) | number:'1.0-8' }} + {{ currencyProvider.getConvertedNumber(tx.fee, chainNetwork.chain) | number:'1.0-8' }} {{ currencyProvider.currencySymbol }} @@ -167,7 +185,7 @@ - {{ currencyProvider.getConvertedNumber(tx.valueOut) | number:'1.0-8' }} + {{ currencyProvider.getConvertedNumber(tx.valueOut, chainNetwork.chain) | number:'1.0-8' }} {{ currencyProvider.currencySymbol }} diff --git a/packages/insight/src/components/transaction-details/transaction-details.module.ts b/packages/insight/src/components/transaction-details/transaction-details.module.ts new file mode 100644 index 00000000000..362b6e3e78d --- /dev/null +++ b/packages/insight/src/components/transaction-details/transaction-details.module.ts @@ -0,0 +1,10 @@ +import { NgModule } from '@angular/core'; +import { IonicModule } from 'ionic-angular'; +import { TransactionDetailsComponent } from './transaction-details'; + +@NgModule({ + declarations: [TransactionDetailsComponent], + imports: [IonicModule], + exports: [TransactionDetailsComponent] +}) +export class TransactionDetailsComponentModule {} diff --git a/packages/insight/src/components/transaction/transaction.scss b/packages/insight/src/components/transaction-details/transaction-details.scss similarity index 98% rename from packages/insight/src/components/transaction/transaction.scss rename to packages/insight/src/components/transaction-details/transaction-details.scss index 8b8b551a20d..ff5874c89f3 100644 --- a/packages/insight/src/components/transaction/transaction.scss +++ b/packages/insight/src/components/transaction-details/transaction-details.scss @@ -1,4 +1,4 @@ -transaction { +transaction-details { // TODO Customize the grid to have 13 columns so that we have 6-col inputs, 6-col outputs, 1 col arrow // See http://ionicframework.com/docs/api/components/grid/Grid/#customizing-the-grid diff --git a/packages/insight/src/components/transaction/transaction.ts b/packages/insight/src/components/transaction-details/transaction-details.ts similarity index 92% rename from packages/insight/src/components/transaction/transaction.ts rename to packages/insight/src/components/transaction-details/transaction-details.ts index e1a27a3a332..c084bc281ab 100644 --- a/packages/insight/src/components/transaction/transaction.ts +++ b/packages/insight/src/components/transaction-details/transaction-details.ts @@ -9,16 +9,16 @@ import { } from '../../providers/transactions/transactions'; /** - * Generated class for the TransactionComponent component. + * Generated class for the TransactionDetailsComponent component. * * See https://angular.io/docs/ts/latest/api/core/index/ComponentMetadata-class.html * for more info on Angular Components. */ @Component({ - selector: 'transaction', - templateUrl: 'transaction.html' + selector: 'transaction-details', + templateUrl: 'transaction-details.html' }) -export class TransactionComponent implements OnInit { +export class TransactionDetailsComponent implements OnInit { public expanded = false; @Input() public tx: any = {}; @@ -36,10 +36,13 @@ export class TransactionComponent implements OnInit { public txProvider: TxsProvider, public redirProvider: RedirProvider, public blocksProvider: BlocksProvider - ) {} + ) { + } public ngOnInit(): void { - this.showCoins ? this.getCoins() : this.getConfirmations(); + if (this.chainNetwork.chain !== 'ETH') { + this.showCoins ? this.getCoins() : this.getConfirmations(); + } } public getCoins(): void { diff --git a/packages/insight/src/components/transaction-list/transaction-list.html b/packages/insight/src/components/transaction-list/transaction-list.html index 6a403f07f8e..900d22b1fc4 100644 --- a/packages/insight/src/components/transaction-list/transaction-list.html +++ b/packages/insight/src/components/transaction-list/transaction-list.html @@ -4,7 +4,7 @@ - + diff --git a/packages/insight/src/components/transaction-list/transaction-list.module.ts b/packages/insight/src/components/transaction-list/transaction-list.module.ts index 78d6b09f1ac..4797bcd1c9a 100644 --- a/packages/insight/src/components/transaction-list/transaction-list.module.ts +++ b/packages/insight/src/components/transaction-list/transaction-list.module.ts @@ -1,12 +1,13 @@ import { NgModule } from '@angular/core'; import { IonicModule } from 'ionic-angular'; import { LoaderComponentModule } from '../loader/loader.module'; -import { TransactionComponentModule } from '../transaction/transaction.module'; +import { TransactionDetailsEthComponentModule } from '../transaction-details-eth/transaction-details-eth.module'; +import { TransactionDetailsComponentModule } from '../transaction-details/transaction-details.module'; import { TransactionListComponent } from './transaction-list'; @NgModule({ declarations: [TransactionListComponent], - imports: [IonicModule, TransactionComponentModule, LoaderComponentModule], + imports: [IonicModule, TransactionDetailsEthComponentModule, TransactionDetailsComponentModule, LoaderComponentModule], exports: [TransactionListComponent] }) export class TransactionListComponentModule {} diff --git a/packages/insight/src/components/transaction-summary-eth/transaction-summary-eth.html b/packages/insight/src/components/transaction-summary-eth/transaction-summary-eth.html new file mode 100644 index 00000000000..5c189756e29 --- /dev/null +++ b/packages/insight/src/components/transaction-summary-eth/transaction-summary-eth.html @@ -0,0 +1,31 @@ + + Gas Limit + + {{ tx.gasLimit }} + + + + Gas Price + + {{ currencyProvider.getConvertedNumber(tx.gasPrice, chainNetwork.chain) | number:'1.0-8' }} + {{ currencyProvider.currencySymbol }} + + + + From + + {{ tx.from }} + + + + To + + {{ tx.to }} + + + + Mined Time + + {{ tx.blocktime * 1000 | date:'long' }} + + \ No newline at end of file diff --git a/packages/insight/src/components/transaction-summary-eth/transaction-summary-eth.module.ts b/packages/insight/src/components/transaction-summary-eth/transaction-summary-eth.module.ts new file mode 100644 index 00000000000..9f5bcbf54f0 --- /dev/null +++ b/packages/insight/src/components/transaction-summary-eth/transaction-summary-eth.module.ts @@ -0,0 +1,10 @@ +import { NgModule } from '@angular/core'; +import { IonicModule } from 'ionic-angular'; +import { TransactionSummaryEthComponent } from './transaction-summary-eth'; + +@NgModule({ + declarations: [TransactionSummaryEthComponent], + imports: [IonicModule], + exports: [TransactionSummaryEthComponent] +}) +export class TransactionSummaryEthComponentModule {} diff --git a/packages/insight/src/components/transaction-summary-eth/transaction-summary-eth.scss b/packages/insight/src/components/transaction-summary-eth/transaction-summary-eth.scss new file mode 100644 index 00000000000..2be1a2b20de --- /dev/null +++ b/packages/insight/src/components/transaction-summary-eth/transaction-summary-eth.scss @@ -0,0 +1,2 @@ +transaction-summary-eth { +} diff --git a/packages/insight/src/components/transaction-summary-eth/transaction-summary-eth.ts b/packages/insight/src/components/transaction-summary-eth/transaction-summary-eth.ts new file mode 100644 index 00000000000..5898a82757b --- /dev/null +++ b/packages/insight/src/components/transaction-summary-eth/transaction-summary-eth.ts @@ -0,0 +1,25 @@ +import { Component, Input } from '@angular/core'; +import { ChainNetwork } from '../../providers/api/api'; +import { CurrencyProvider } from '../../providers/currency/currency'; + +/** + * Generated class for the TransactionSummaryEthComponent component. + * + * See https://angular.io/docs/ts/latest/api/core/index/ComponentMetadata-class.html + * for more info on Angular Components. + */ +@Component({ + selector: 'transaction-summary-eth', + templateUrl: 'transaction-summary-eth.html' +}) +export class TransactionSummaryEthComponent { + @Input() + public tx: any = {}; + @Input() + public chainNetwork: ChainNetwork; + + constructor( + public currencyProvider: CurrencyProvider + ) { + } +} diff --git a/packages/insight/src/components/transaction-summary/transaction-summary.html b/packages/insight/src/components/transaction-summary/transaction-summary.html new file mode 100644 index 00000000000..67d8325d895 --- /dev/null +++ b/packages/insight/src/components/transaction-summary/transaction-summary.html @@ -0,0 +1,12 @@ + + Size + + {{ tx.size }} (bytes) + + + + Fee Rate + + {{ (tx.fee / tx.size) | number:'1.0-2' }} sats/byte + + \ No newline at end of file diff --git a/packages/insight/src/components/transaction-summary/transaction-summary.module.ts b/packages/insight/src/components/transaction-summary/transaction-summary.module.ts new file mode 100644 index 00000000000..df5b8986421 --- /dev/null +++ b/packages/insight/src/components/transaction-summary/transaction-summary.module.ts @@ -0,0 +1,10 @@ +import { NgModule } from '@angular/core'; +import { IonicModule } from 'ionic-angular'; +import { TransactionSummaryComponent } from './transaction-summary'; + +@NgModule({ + declarations: [TransactionSummaryComponent], + imports: [IonicModule], + exports: [TransactionSummaryComponent] +}) +export class TransactionSummaryComponentModule {} diff --git a/packages/insight/src/components/transaction-summary/transaction-summary.scss b/packages/insight/src/components/transaction-summary/transaction-summary.scss new file mode 100644 index 00000000000..6758cb3a8be --- /dev/null +++ b/packages/insight/src/components/transaction-summary/transaction-summary.scss @@ -0,0 +1,2 @@ +transaction-summary { +} diff --git a/packages/insight/src/components/transaction-summary/transaction-summary.ts b/packages/insight/src/components/transaction-summary/transaction-summary.ts new file mode 100644 index 00000000000..5e4034fb981 --- /dev/null +++ b/packages/insight/src/components/transaction-summary/transaction-summary.ts @@ -0,0 +1,25 @@ +import { Component, Input } from '@angular/core'; +import { ChainNetwork } from '../../providers/api/api'; +import { CurrencyProvider } from '../../providers/currency/currency'; + +/** + * Generated class for the TransactionSummaryComponent component. + * + * See https://angular.io/docs/ts/latest/api/core/index/ComponentMetadata-class.html + * for more info on Angular Components. + */ +@Component({ + selector: 'transaction-summary', + templateUrl: 'transaction-summary.html' +}) +export class TransactionSummaryComponent { + @Input() + public tx: any = {}; + @Input() + public chainNetwork: ChainNetwork; + + constructor( + public currencyProvider: CurrencyProvider + ) { + } +} diff --git a/packages/insight/src/components/transaction/transaction.module.ts b/packages/insight/src/components/transaction/transaction.module.ts deleted file mode 100644 index 7da3ba0ef03..00000000000 --- a/packages/insight/src/components/transaction/transaction.module.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { NgModule } from '@angular/core'; -import { IonicModule } from 'ionic-angular'; -import { SplitPipe } from '../../pipes/split/split'; -import { TransactionComponent } from './transaction'; - -@NgModule({ - declarations: [TransactionComponent, SplitPipe], - imports: [IonicModule], - exports: [TransactionComponent] -}) -export class TransactionComponentModule {} diff --git a/packages/insight/src/pages/address/address.html b/packages/insight/src/pages/address/address.html index 0ca5a5486bc..8a25087aa38 100644 --- a/packages/insight/src/pages/address/address.html +++ b/packages/insight/src/pages/address/address.html @@ -10,7 +10,7 @@
-

Address {{ getConvertedNumber(address.balance) | number:'1.0-8' }} +

Address {{ getConvertedNumber(address.balance, chainNetwork.chain) | number:'1.0-8' }} {{ currencyProvider.currencySymbol }}

{{ address.addrStr }}

diff --git a/packages/insight/src/pages/transaction/transaction.module.ts b/packages/insight/src/pages/transaction/transaction.module.ts index 84c066ab80c..61b8c4d7f15 100644 --- a/packages/insight/src/pages/transaction/transaction.module.ts +++ b/packages/insight/src/pages/transaction/transaction.module.ts @@ -4,7 +4,10 @@ import { ErrorComponentModule } from '../../components/error/error.module'; import { FooterComponentModule } from '../../components/footer/footer.module'; import { HeadNavComponentModule } from '../../components/head-nav/head-nav.module'; import { LoaderComponentModule } from '../../components/loader/loader.module'; -import { TransactionComponentModule } from '../../components/transaction/transaction.module'; +import { TransactionDetailsEthComponentModule } from '../../components/transaction-details-eth/transaction-details-eth.module'; +import { TransactionDetailsComponentModule } from '../../components/transaction-details/transaction-details.module'; +import { TransactionSummaryEthComponentModule } from '../../components/transaction-summary-eth/transaction-summary-eth.module'; +import { TransactionSummaryComponentModule } from '../../components/transaction-summary/transaction-summary.module'; import { CopyToClipboardModule } from '../../directives/copy-to-clipboard/copy-to-clipboard.module'; import { TransactionPage } from './transaction'; @@ -12,7 +15,10 @@ import { TransactionPage } from './transaction'; declarations: [TransactionPage], imports: [ IonicPageModule.forChild(TransactionPage), - TransactionComponentModule, + TransactionSummaryEthComponentModule, + TransactionSummaryComponentModule, + TransactionDetailsComponentModule, + TransactionDetailsEthComponentModule, FooterComponentModule, HeadNavComponentModule, LoaderComponentModule, diff --git a/packages/insight/src/pages/transaction/transaction.ts b/packages/insight/src/pages/transaction/transaction.ts index 6540ef1cc11..24ba8ea8ad7 100644 --- a/packages/insight/src/pages/transaction/transaction.ts +++ b/packages/insight/src/pages/transaction/transaction.ts @@ -23,9 +23,9 @@ export class TransactionPage { public fromVout: boolean; public confirmations: number; public errorMessage: string; + public chainNetwork: ChainNetwork; private txId: string; - private chainNetwork: ChainNetwork; constructor( public navParams: NavParams, @@ -53,8 +53,17 @@ export class TransactionPage { public ionViewDidEnter(): void { this.txProvider.getTx(this.txId, this.chainNetwork).subscribe( - data => { - this.tx = this.txProvider.toAppTx(data); + response => { + let tx; + switch (this.chainNetwork.chain) { + case 'ETH': + tx = this.txProvider.toEthAppTx(response); + break; + default: + tx = this.txProvider.toAppTx(response); + break; + } + this.tx = tx; this.loading = false; this.txProvider .getConfirmations(this.tx.blockheight, this.chainNetwork) diff --git a/packages/insight/src/providers/address/address.ts b/packages/insight/src/providers/address/address.ts index 584853a5106..fa167d9d488 100644 --- a/packages/insight/src/providers/address/address.ts +++ b/packages/insight/src/providers/address/address.ts @@ -4,7 +4,7 @@ import { Observable } from 'rxjs'; import { ApiProvider, ChainNetwork } from '../../providers/api/api'; import { CurrencyProvider } from '../../providers/currency/currency'; import { BlocksProvider } from '../blocks/blocks'; -import { ApiCoin, TxsProvider } from '../transactions/transactions'; +import { ApiCoin, ApiEthCoin, TxsProvider } from '../transactions/transactions'; export interface ApiAddr { confirmed: number; @@ -33,8 +33,8 @@ export class AddressProvider { ); } - public getAddressActivity(addrStr?: string): Observable { - return this.httpClient.get( + public getAddressActivity(addrStr?: string): Observable { + return this.httpClient.get( `${this.apiProvider.getUrl()}/address/${addrStr}/txs?limit=1000` ); } diff --git a/packages/insight/src/providers/blocks/blocks.ts b/packages/insight/src/providers/blocks/blocks.ts index b460022fa42..b0f7f7889a2 100644 --- a/packages/insight/src/providers/blocks/blocks.ts +++ b/packages/insight/src/providers/blocks/blocks.ts @@ -3,7 +3,6 @@ import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { ApiProvider, ChainNetwork } from '../../providers/api/api'; import { CurrencyProvider } from '../../providers/currency/currency'; - export interface ApiBlock { height: number; nonce: number; @@ -21,7 +20,12 @@ export interface ApiBlock { time: Date; timeNormalized: Date; } - +export interface ApiEthBlock extends ApiBlock{ + difficulty: number; + totalDifficulty: number; + gasUsed: number; + gasLimit: number; +} export interface AppBlock { height: number; merkleroot: string; @@ -47,13 +51,33 @@ export interface AppBlock { reward: number; } +export interface AppEthBlock extends AppBlock { + difficulty: number; + totalDifficulty: number; + gasUsed: number; + gasLimit: number; +} +export interface ApiEthBlock extends ApiBlock { + gasUsed: number; + gasLimit: number; +} + +export interface AppEthBlock extends AppBlock { + gasUsed: number; + gasLimit: number; +} + @Injectable() export class BlocksProvider { constructor( public httpClient: HttpClient, public currency: CurrencyProvider, private api: ApiProvider - ) {} + ) { } + + public toEthAppBlock(block: ApiEthBlock): AppEthBlock { + return { ...this.toAppBlock(block), gasLimit: block.gasLimit, gasUsed: block.gasUsed, difficulty: block.difficulty, totalDifficulty: block.totalDifficulty}; + } public toAppBlock(block: ApiBlock): AppBlock { const difficulty: number = 0x1d00ffff / block.bits; @@ -66,7 +90,7 @@ export class BlocksProvider { merkleroot: block.merkleRoot, version: block.version, difficulty, - bits: block.bits.toString(16), + bits: block.bits ? block.bits.toString(16) : null, hash: block.hash, time: new Date(block.time).getTime() / 1000, tx: { @@ -86,7 +110,7 @@ export class BlocksProvider { public getCurrentHeight(chainNetwork: ChainNetwork): Observable { const heightUrl = `${this.api.getUrlPrefix()}/${chainNetwork.chain}/${ chainNetwork.network - }/block/tip`; + }/block/tip`; return this.httpClient.get(heightUrl); } @@ -96,7 +120,7 @@ export class BlocksProvider { ): Observable { const url = `${this.api.getUrlPrefix()}/${chainNetwork.chain}/${ chainNetwork.network - }/block?limit=${numBlocks}`; + }/block?limit=${numBlocks}`; return this.httpClient.get(url); } @@ -110,17 +134,17 @@ export class BlocksProvider { ): Observable { const url = `${this.api.getUrlPrefix()}/${chainNetwork.chain}/${ chainNetwork.network - }/block?since=${since}&limit=${numBlocks}&paging=height&direction=-1`; + }/block?since=${since}&limit=${numBlocks}&paging=height&direction=-1`; return this.httpClient.get(url); } public getBlock( hash: string, chainNetwork: ChainNetwork - ): Observable { + ): Observable { const url = `${this.api.getUrlPrefix()}/${chainNetwork.chain}/${ chainNetwork.network - }/block/${hash}`; - return this.httpClient.get(url); + }/block/${hash}`; + return this.httpClient.get(url); } } diff --git a/packages/insight/src/providers/currency/currency.ts b/packages/insight/src/providers/currency/currency.ts index 7c7e3e018ca..a39c68854d6 100644 --- a/packages/insight/src/providers/currency/currency.ts +++ b/packages/insight/src/providers/currency/currency.ts @@ -35,13 +35,20 @@ export class CurrencyProvider { return this.currencySymbol; } - public getConvertedNumber(value: number): number { + public getConvertedNumber(value: number, chain): number { // TODO: Change this function to make use of satoshis so that we don't have to do all these roundabout conversions. - value = value * 1e-8; + switch (chain) { + case 'ETH': + value = value * 1e-18; + break; + default: + value = value * 1e-8; + break; + } if (value === 0.0) { return 0; } - + let response: number; if (this.currencySymbol === 'USD') { diff --git a/packages/insight/src/providers/transactions/transactions.ts b/packages/insight/src/providers/transactions/transactions.ts index bf80ad1d282..0605f444ae6 100644 --- a/packages/insight/src/providers/transactions/transactions.ts +++ b/packages/insight/src/providers/transactions/transactions.ts @@ -9,6 +9,7 @@ interface CoinsApiResponse { inputs: ApiCoin[]; outputs: ApiCoin[]; } + export interface ApiTx { address: string; chain: string; @@ -32,6 +33,16 @@ export interface ApiTx { version: number; } +export interface ApiEthTx extends ApiTx { + gasLimit: number; + gasPrice: number; + internal: any[]; + nonce: number; + to: string; + from: string; + fee: number; +} + export interface ApiCoin { txid: string; mintTxid: string; @@ -48,6 +59,23 @@ export interface ApiCoin { value: number; } +export interface ApiEthCoin { + blockHash: string; + blockHeight: string; + blockTime: string; + blockTimeNormalized: string; + chain: string; + fee: number; + from: string; + gasLimit: number; + gasPrice: number; + network: string; + nonce: string; + to: string; + txid:string; + value: number; +} + export interface AppCoin { txid: string; valueOut: number; @@ -58,6 +86,14 @@ export interface AppCoin { spentHeight: number; } +export interface AppEthCoin { + to: string, + from: string, + txid: string, + fee: number, + valueOut: number, +} + export interface AppInput { coinbase: boolean; sequence: number; @@ -110,6 +146,14 @@ export interface AppTx { blocktime: number; } +export interface AppEthTx extends AppTx { + gasLimit: number; + gasPrice: number; + to: string; + from: string; + fee: number; +} + @Injectable() export class TxsProvider { constructor( @@ -117,7 +161,7 @@ export class TxsProvider { public currency: CurrencyProvider, public blocksProvider: BlocksProvider, private apiProvider: ApiProvider - ) {} + ) { } public getFee(tx: AppTx): number { const sumSatoshis: any = (arr: any): number => @@ -128,6 +172,10 @@ export class TxsProvider { return fee; } + public toEthAppTx(tx: ApiEthTx): AppEthTx { + return { ...this.toAppTx(tx), fee: tx.fee, to: tx.to, from: tx.from, gasLimit: tx.gasLimit, gasPrice: tx.gasPrice }; + } + public toAppTx(tx: ApiTx): AppTx { return { txid: tx.txid, @@ -147,6 +195,16 @@ export class TxsProvider { }; } + public toAppEthCoin(coin: ApiEthCoin): AppEthCoin { + return { + to: coin.to, + from: coin.from, + txid: coin.txid, + fee: coin.fee, + valueOut: coin.value, + }; + } + public toAppCoin(coin: ApiCoin): AppCoin { return { txid: coin.txid, @@ -169,15 +227,15 @@ export class TxsProvider { } const url = `${this.apiProvider.getUrlPrefix()}/${chainNetwork.chain}/${ chainNetwork.network - }/tx/${queryString}`; + }/tx/${queryString}`; return this.httpClient.get(url); } - public getTx(hash: string, chainNetwork: ChainNetwork): Observable { + public getTx(hash: string, chainNetwork: ChainNetwork): Observable { const url = `${this.apiProvider.getUrlPrefix()}/${chainNetwork.chain}/${ chainNetwork.network - }/tx/${hash}`; - return this.httpClient.get(url); + }/tx/${hash}`; + return this.httpClient.get(url); } public getCoins( @@ -186,7 +244,7 @@ export class TxsProvider { ): Observable { const url = `${this.apiProvider.getUrlPrefix()}/${chainNetwork.chain}/${ chainNetwork.network - }/tx/${txId}/coins`; + }/tx/${txId}/coins`; return this.httpClient.get(url); } From 9f1a4adf79ecbdf6186abfa5f9b236a562791d34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 27 Aug 2019 13:02:43 -0300 Subject: [PATCH 02/11] fix head-nav --- packages/insight/src/components/head-nav/head-nav.ts | 6 +++--- packages/insight/src/pages/home/home.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/insight/src/components/head-nav/head-nav.ts b/packages/insight/src/components/head-nav/head-nav.ts index 0b9da3b11c5..8cc5e5509f1 100644 --- a/packages/insight/src/components/head-nav/head-nav.ts +++ b/packages/insight/src/components/head-nav/head-nav.ts @@ -158,13 +158,13 @@ export class HeadNavComponent implements OnInit { this.setCurrency(data.chainNetwork); this.goHome(data.chainNetwork); } else if (data.currencySymbol !== this.currencyProvider.getCurrency()) { - this.setCurrency(data.currencySymbol); + this.setCurrency(this.chainNetwork, data.currencySymbol); } }); } - private setCurrency(currencySymbol?) { - this.currencyProvider.setCurrency(currencySymbol); + private setCurrency(chainNetwork, currencySymbol?) { + this.currencyProvider.setCurrency(chainNetwork, currencySymbol); this.priceProvider.setCurrency(currencySymbol); } diff --git a/packages/insight/src/pages/home/home.ts b/packages/insight/src/pages/home/home.ts index 43d32cc4ec0..fb2572654fa 100644 --- a/packages/insight/src/pages/home/home.ts +++ b/packages/insight/src/pages/home/home.ts @@ -18,7 +18,7 @@ export class HomePage { @ViewChild('latestBlocks') public latestBlocks: LatestBlocksComponent; public chain: string; - private chainNetwork: ChainNetwork; + public chainNetwork: ChainNetwork; public network: string; constructor( public nav: Nav, From 9c8921fd179a87a49733186c28b178d68d293fbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 27 Aug 2019 13:30:00 -0300 Subject: [PATCH 03/11] fix ratesAPI --- packages/insight/src/providers/api/api.ts | 3 ++- packages/insight/src/providers/price/price.ts | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/packages/insight/src/providers/api/api.ts b/packages/insight/src/providers/api/api.ts index 5afe9ad24b9..4f633a4d941 100644 --- a/packages/insight/src/providers/api/api.ts +++ b/packages/insight/src/providers/api/api.ts @@ -28,7 +28,8 @@ export class ApiProvider { public ratesAPI = { btc: 'https://bitpay.com/api/rates', - bch: 'https://bitpay.com/api/rates/bch' + bch: 'https://bitpay.com/api/rates/bch', + eth: 'https://bitpay.com/api/rates/eth' }; constructor( diff --git a/packages/insight/src/providers/price/price.ts b/packages/insight/src/providers/price/price.ts index 2df6f723053..4ddb51275b6 100644 --- a/packages/insight/src/providers/price/price.ts +++ b/packages/insight/src/providers/price/price.ts @@ -20,10 +20,18 @@ export class PriceProvider { } if (currency === 'USD') { - const ratesAPI = - this.api.getConfig().chain === 'BTC' - ? this.api.ratesAPI.btc - : this.api.ratesAPI.bch; + let ratesAPI; + switch (this.api.getConfig().chain) { + case 'BTC': + ratesAPI = this.api.ratesAPI.btc; + break; + case 'BCH': + ratesAPI = this.api.ratesAPI.bch; + break; + case 'ETH': + ratesAPI = this.api.ratesAPI.eth; + break; + } this.api.httpClient.get(ratesAPI).subscribe( (data: any) => { const currencyParsed: any = data; From 2be42ad67d4ab4201573c905d1125e69be1b67f3 Mon Sep 17 00:00:00 2001 From: Juan Pablo Abuin Date: Tue, 27 Aug 2019 11:55:23 -0300 Subject: [PATCH 04/11] eth icon for chain and network selector --- .../insight/src/assets/img/currency_logos/eth.svg | 8 ++++++++ packages/insight/src/assets/img/ethicon.svg | 13 +++++++++++++ .../insight/src/components/head-nav/head-nav.html | 11 +++++------ .../insight/src/components/head-nav/head-nav.scss | 6 ++++++ 4 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 packages/insight/src/assets/img/currency_logos/eth.svg create mode 100644 packages/insight/src/assets/img/ethicon.svg diff --git a/packages/insight/src/assets/img/currency_logos/eth.svg b/packages/insight/src/assets/img/currency_logos/eth.svg new file mode 100644 index 00000000000..09d4ac80a6c --- /dev/null +++ b/packages/insight/src/assets/img/currency_logos/eth.svg @@ -0,0 +1,8 @@ + + + Currency/Large/Ethereum + + + + + \ No newline at end of file diff --git a/packages/insight/src/assets/img/ethicon.svg b/packages/insight/src/assets/img/ethicon.svg new file mode 100644 index 00000000000..40e7d28df77 --- /dev/null +++ b/packages/insight/src/assets/img/ethicon.svg @@ -0,0 +1,13 @@ + + + + Artboard + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/packages/insight/src/components/head-nav/head-nav.html b/packages/insight/src/components/head-nav/head-nav.html index fe8b5b4d759..9b5db75b402 100644 --- a/packages/insight/src/components/head-nav/head-nav.html +++ b/packages/insight/src/components/head-nav/head-nav.html @@ -5,14 +5,14 @@ -