-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* offline signing option * decode signed operation hash UI * fix new data structure * update api for operations * Account table re-adjusted * set up zeronet * minor changes * delegator pipe update * truncatePipe * time-ago pipe * tooltips for app-activity * add class for constants * switch to betanet * update betanet chain_id * ActivityComponent revamped * fix signed decoding * move online signing warning * tweak row padding * minor UI fix * minor fix * small change buttons * context-menu for electron * fix TypeError at Menu.popup * allow to unset delegate in integrity check * code cleanup * change walletService to public in home-page * delegate UI fix * minor text changes * minor spelling * spelling * fix account import bug * update to betanet
- Loading branch information
Showing
56 changed files
with
765 additions
and
228 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "kukai", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"license": "MIT", | ||
"scripts": { | ||
"ng": "ng", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,81 @@ | ||
<div *ngIf='accounts'> | ||
<table class="table table-striped"> | ||
<thead> | ||
<tr> | ||
<th>Timestamp</th> | ||
<th>Type</th> | ||
<th>Amount (ꜩ)</th> | ||
<th>Status</th> | ||
</tr> | ||
</thead> | ||
<ng-container *ngFor="let aData of accounts"> | ||
<ng-container *ngIf="aData.pkh === activePkh"> | ||
<tbody *ngFor="let transaction of aData.activities"> | ||
<ng-container *ngFor="let account of accounts"> | ||
<ng-container *ngIf="account.pkh === activePkh && account.activities.length > 0"> | ||
<table class="table table-striped"> | ||
<thead> | ||
<tr> | ||
<td>{{ transaction.timestamp | date:'yyyy-MM-dd HH:mm:ss' }}</td> | ||
<!-- <td>{{ transaction.source }}</td> | ||
<td>{{ transaction.destination }}</td> --> | ||
<td>{{ transaction.type }}</td> | ||
<td> | ||
<ng-container *ngIf="transaction.amount">{{ transaction.amount / 1000000 | number:'1.0' }} ꜩ | ||
<th scope="col">Txn Hash</th> | ||
<th scope="col">Block</th> | ||
<th scope="col">Date</th> | ||
<th scope="col">Type</th> | ||
<th scope="col">Counterparty</th> <!-- To or From --> | ||
<th scope="col">Amount (ꜩ)</th> | ||
<th scope="col">Status</th> | ||
</tr> | ||
</thead> | ||
<tbody *ngFor="let transaction of account.activities"> | ||
<tr class="table-row"> | ||
<!-- Txn Hash --> | ||
<th scope="row" class="row-hash table-cell"> | ||
<span data-toggle="tooltip" [title]="transaction.hash"> | ||
<a href="{{ CONSTANTS.NET.BLOCK_EXPLORER_URL + transaction.hash }}" target="_blank"> {{ transaction.hash | truncate: '4':'true'}} </a> | ||
</span> | ||
</th> | ||
|
||
<!-- Block --> | ||
<td class="table-cell"> | ||
<span data-toggle="tooltip" [title]="transaction.block"> | ||
<a href="{{ CONSTANTS.NET.BLOCK_EXPLORER_URL + transaction.block }}" target="_blank"> {{ transaction.block | truncate: '4':'true'}} </a> | ||
</span> | ||
</td> | ||
|
||
<!-- Date --> | ||
<td class="table-cell"> | ||
<!-- {{ transaction.timestamp | date:'yyyy-MM-dd HH:mm:ss' }} --> | ||
<span data-toggle="tooltip" [title]="transaction.timestamp | date:'yyyy-MM-dd HH:mm:ss'"> | ||
{{ transaction.timestamp | timeAgo }} | ||
</span> | ||
</td> | ||
|
||
<!-- Type --> | ||
<td class="table-cell"> | ||
<span class = "transaction badge badge-secondary" [ngClass]="{'received' : getType(transaction) == 'received', 'sent' : getType(transaction) == 'sent'}"> {{ getType(transaction) }} </span> | ||
</td> | ||
|
||
<!-- Counterparty: `To` or `From` --> | ||
<td class="table-cell"> | ||
<!-- {{ transaction.source.tz }} --> | ||
<span *ngIf="transaction.type != 'activation'"> | ||
<span *ngIf="activePkh === transaction.source;then to else from"> From </span> | ||
<ng-template #from><span class="smallText">from</span></ng-template> | ||
<ng-template #to><span class="smallText">to</span></ng-template> | ||
</span> | ||
<br> | ||
<span class="counterparty"> | ||
{{ getCounterparty(transaction) }} | ||
</span> | ||
</td> | ||
|
||
<!-- Amount --> | ||
<td class="amount table-cell"> | ||
<ng-container *ngIf="transaction.amount"> | ||
{{ transaction.amount / 1000000 | number:'1.0' }} ꜩ | ||
</ng-container> | ||
</td> | ||
<!-- <td>{{ transaction.fee / 100 }}</td> --> | ||
<td> | ||
<a href="https://tzscan.io/{{transaction.hash}}" target="_blank">{{ getStatus(transaction) }}</a> | ||
|
||
<!-- Status --> | ||
<td class="amount table-cell"> | ||
<a href="{{ CONSTANTS.NET.BLOCK_EXPLORER_URL + transaction.hash }}" target="_blank">{{ getStatus(transaction) }}</a> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</ng-container> | ||
</table> | ||
</ng-container> | ||
</table> | ||
</ng-container> | ||
</div> | ||
|
||
<p *ngIf='!accounts'> | ||
Wallet not configured! | ||
</p> | ||
</p> | ||
|
||
<!-- Type of operations: activation, transfers, delegation, origination --- endorsements, baking, rewards --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,64 @@ | ||
import { Component, Input, OnInit, AfterViewInit, SimpleChange } from '@angular/core'; | ||
import { WalletService } from '../../services/wallet.service'; | ||
import { MessageService } from '../../services/message.service'; | ||
import { Constants } from '../../constants'; | ||
|
||
@Component({ | ||
selector: 'app-activity', | ||
templateUrl: './activity.component.html', | ||
styleUrls: ['./activity.component.scss'] | ||
selector: 'app-activity', | ||
templateUrl: './activity.component.html', | ||
styleUrls: ['./activity.component.scss'] | ||
}) | ||
export class ActivityComponent implements OnInit { | ||
accounts = null; | ||
@Input() activePkh: string; | ||
constructor( | ||
private walletService: WalletService, | ||
private messageService: MessageService | ||
) { } | ||
accounts = null; | ||
CONSTANTS = new Constants(); | ||
@Input() activePkh: string; | ||
constructor( | ||
private walletService: WalletService | ||
) {} | ||
|
||
ngOnInit() { if (this.walletService.wallet) { this.init(); } } | ||
init() { | ||
this.accounts = this.walletService.wallet.accounts; | ||
} | ||
getStatus(transaction: any): string { | ||
if (transaction.failed) { | ||
return 'Failed'; | ||
} else if (transaction.block === 'prevalidation') { | ||
return 'Unconfirmed'; | ||
} else { | ||
return 'Confirmed'; | ||
ngOnInit() { if (this.walletService.wallet) { this.init(); } } | ||
init() { | ||
this.accounts = this.walletService.wallet.accounts; | ||
console.log('transaction', this.accounts[0].activities); | ||
} | ||
getStatus(transaction: any): string { | ||
if (transaction.failed) { | ||
return 'Failed'; | ||
} else if (transaction.block === 'prevalidation') { | ||
return 'Unconfirmed'; | ||
} else { | ||
return 'Confirmed'; | ||
} | ||
} | ||
|
||
getType(transaction: any): string { | ||
if (transaction.type !== 'transaction') { | ||
return transaction.type; | ||
} else { | ||
let operationType = ''; | ||
if (transaction.amount > 0) { | ||
operationType = 'received'; | ||
} else { | ||
operationType = 'sent'; | ||
} | ||
return operationType; | ||
} | ||
} | ||
|
||
getCounterparty(transaction: any): string { | ||
console.log('transaction - getCounterparty', transaction); | ||
let counterparty = ''; | ||
|
||
// Checks for delegation as destination is stored in transaction.destination.tz | ||
if (transaction.type === 'delegation') { | ||
return transaction.destination.tz; | ||
} | ||
|
||
if (this.activePkh === transaction.source) { | ||
counterparty = transaction.destination; // to | ||
} else { | ||
counterparty = transaction.source; // from | ||
} | ||
|
||
return counterparty; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.