forked from lthn/blockchain
Merge remote-tracking branch 'origin/frontend'
This commit is contained in:
commit
7cb6bfbb2a
28 changed files with 521 additions and 246 deletions
|
|
@ -184,6 +184,18 @@
|
|||
"INPUTS": "Inputs",
|
||||
"OUTPUTS": "Outputs",
|
||||
"COMMENT": "Comment"
|
||||
},
|
||||
"TYPE_MESSAGES": {
|
||||
"HIDDEN": "hidden",
|
||||
"UNDEFINED": "Undefined",
|
||||
"COMPLETE_BUYER": "Successfully complete contract, return remaining pledge",
|
||||
"COMPLETE_SELLER": "Successfully complete contract, receive payment on contract, and return pledge",
|
||||
"MINED": "Mined funds",
|
||||
"CREATE_CONTRACT": "Send contract offer",
|
||||
"PLEDGE_CONTRACT": "Make pledge on offer",
|
||||
"NULLIFY_CONTRACT": "Nullify pledges for contract",
|
||||
"PROPOSAL_CANCEL_CONTRACT": "Send proposal to cancel contract",
|
||||
"CANCEL_CONTRACT": "Cancel contract, return pledges"
|
||||
}
|
||||
},
|
||||
"CONTRACTS": {
|
||||
|
|
@ -208,6 +220,46 @@
|
|||
"REMAINING_ONE_WAITING": "Remaining {{time}} hour waiting",
|
||||
"REMAINING_MANY_WAITING": "Remaining {{time}} hours waiting",
|
||||
"REMAINING_MANY_ALT_WAITING": "Remaining {{time}} hours waiting"
|
||||
},
|
||||
"STATUS_MESSAGES": {
|
||||
"SELLER": {
|
||||
"NEW_CONTRACT": "New contract proposal",
|
||||
"IGNORED": "You ignored the contract proposal",
|
||||
"ACCEPTED": "You have accepted the contract proposal",
|
||||
"WAIT": "Please wait for the pledges to be made",
|
||||
"BUYER_WAIT": "The buyer is waiting for the item to be delivered",
|
||||
"PLEDGES_MADE": "Pledges made",
|
||||
"COMPLETED": "Contract completed successfully",
|
||||
"RECEIVED": "Item received, payment transferred, pledges returned",
|
||||
"NOT_RECEIVED": "Item not received",
|
||||
"NULLIFIED": "All pledges nullified",
|
||||
"PROPOSAL_CANCEL": "New proposal to cancel contract and return pledges",
|
||||
"BEING_CANCELLED": "The contract is being cancelled. Please wait for the pledge to be returned",
|
||||
"CANCELLED": "Contract canceled",
|
||||
"PLEDGES_RETURNED": "Pledges returned",
|
||||
"IGNORED_CANCEL": "You ignored the proposal to cancel the contract",
|
||||
"EXPIRED": "The contract proposal has expired"
|
||||
},
|
||||
"BUYER": {
|
||||
"WAITING": "Waiting for seller respond to contract proposal",
|
||||
"PLEDGE_RESERVED": "Pledge amount reserved",
|
||||
"IGNORED": "The seller ignored your contract proposal",
|
||||
"PLEDGE_UNBLOCKED": "Pledge amount unblocked",
|
||||
"ACCEPTED": "The seller accepted your contract proposal",
|
||||
"WAIT": "Please wait for the pledges to be made",
|
||||
"PLEDGES_MADE": "Pledges made",
|
||||
"WAITING_SELLER": "Waiting for seller to ship item",
|
||||
"COMPLETED": "Contract completed successfully",
|
||||
"RECEIVED": "Item received, payment transferred, pledges returned",
|
||||
"NOT_RECEIVED": "Item not received",
|
||||
"NULLIFIED": "All pledges nullified",
|
||||
"WAITING_CANCEL": "Waiting for seller to respond to proposal to cancel contract and return pledges",
|
||||
"BEING_CANCELLED": "The contract is being cancelled. Please wait for the pledge to be returned",
|
||||
"CANCELLED": "Contract canceled",
|
||||
"PLEDGES_RETURNED": "Pledges returned",
|
||||
"IGNORED_CANCEL": "The seller ignored your proposal to cancel the contract",
|
||||
"EXPIRED": "The contract proposal has expired"
|
||||
}
|
||||
}
|
||||
},
|
||||
"PURCHASE": {
|
||||
|
|
@ -231,9 +283,6 @@
|
|||
"SELLER_SAME": "The seller's and buyer's accounts are identical. The seller and buyer must use different wallet for the contract.",
|
||||
"COMMENT_MAXIMUM": "Maximum field length reached."
|
||||
},
|
||||
"CANCEL_BUTTON": "Cancel and return deposits",
|
||||
"TERMINATE_BUTTON": "Terminate and burn deposits",
|
||||
"COMPLETE_BUTTON": "Complete and release deposits",
|
||||
"PROGRESS_NEW": "New purchase",
|
||||
"PROGRESS_WAIT": "Awaiting reply",
|
||||
"PROGRESS_RECEIVE": "Reply received",
|
||||
|
|
@ -247,7 +296,36 @@
|
|||
"SEND_CANCEL_PROPOSAL": "Proposal to cancel contract sent to seller",
|
||||
"IGNORED_CANCEL": "You have ignored the proposal to cancel the contract",
|
||||
"DEALS_CANCELED_WAIT": "The contract is being cancelled. Please wait for the deposit to be returned",
|
||||
"WAITING_TIME": "Time until response"
|
||||
"WAITING_TIME": "Time until response",
|
||||
"NEED_MONEY": "There are insufficient funds in the wallet. Add funds to the wallet to continue",
|
||||
"WAITING_SELLER": "Waiting for seller respond to contract proposal",
|
||||
"IGNORED_SELLER": "The seller ignored your contract proposal",
|
||||
"PLEDGE_UNBLOCKED": "Pledge amount unblocked",
|
||||
"WAITING_SHIP": "Waiting for seller to ship item",
|
||||
"IGNORED_CANCEL_SELLER": "The seller ignored your proposal to cancel the contract",
|
||||
"EXPIRED": "The contract proposal has expired",
|
||||
"WAIT": "Please wait for the pledges to be made",
|
||||
"COMPLETED": "Contract completed successfully",
|
||||
"RECEIVED": "Item received, payment transferred, pledges returned",
|
||||
"NOT_RECEIVED": "Item not received",
|
||||
"NULLIFIED": "All pledges nullified",
|
||||
"PROPOSAL_CANCEL_SELLER": "You have made a proposal to cancel the contract",
|
||||
"BEING_CANCELLED": "The contract is being cancelled. Please wait for the pledge to be returned",
|
||||
"CANCELLED": "Contract canceled",
|
||||
"PLEDGES_RETURNED": "Pledges returned",
|
||||
"WAITING_BUYER": "The buyer is proposing a contract",
|
||||
"IGNORED_BUYER": "You ignored the contract proposal",
|
||||
"IGNORED_CANCEL_BUYER": "You ignored the proposal to cancel the contract",
|
||||
"BUYER_WAIT": "The buyer is waiting for the item to be delivered",
|
||||
"PLEDGES_MADE": "Pledges made",
|
||||
"PROPOSAL_CANCEL_BUYER": "The buyer is offering to cancel the contract and return the pledge",
|
||||
"BUTTON_MAKE_PLEDGE": "Accept (Make pledge)",
|
||||
"BUTTON_IGNORE": "Ignore",
|
||||
"BUTTON_NULLIFY": "Item not received (Nullify pledges)",
|
||||
"BUTTON_RECEIVED": "Item received (Transfer payment and return pledge to seller)",
|
||||
"BUTTON_CANCEL_BUYER": "Cancel contract (Return pledge)",
|
||||
"BUTTON_NOT_CANCEL": "Do not cancel (Item shipped)",
|
||||
"BUTTON_CANCEL_SELLER": "Cancel contract (Return pledge)"
|
||||
},
|
||||
"MESSAGES": {
|
||||
"ADDRESS": "Address",
|
||||
|
|
@ -258,7 +336,23 @@
|
|||
"MODALS": {
|
||||
"ERROR": "Error",
|
||||
"SUCCESS": "Success",
|
||||
"INFO": "Information"
|
||||
"INFO": "Information",
|
||||
"OK": "OK"
|
||||
},
|
||||
"STAKING": {
|
||||
"TITLE": "Staking",
|
||||
"TITLE_PENDING": "Pending",
|
||||
"TITLE_TOTAL": "Total",
|
||||
"TITLE_PERIOD": "Time period:",
|
||||
"DAY": "1 day",
|
||||
"WEEK": "1 week",
|
||||
"MONTH": "1 month",
|
||||
"YEAR": "1 year",
|
||||
"ALL": "All",
|
||||
"SWITCH": {
|
||||
"ON": "ON",
|
||||
"OFF": "OFF"
|
||||
}
|
||||
},
|
||||
"ERRORS": {
|
||||
"NOT_ENOUGH_MONEY": "Insufficient funds in account",
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ table {
|
|||
padding: 0 1rem;
|
||||
vertical-align: middle;
|
||||
white-space: nowrap;
|
||||
max-width: 20rem;
|
||||
|
||||
&:first-child {
|
||||
padding-left: 3rem;
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -6,6 +6,6 @@
|
|||
<span class="message" [innerHTML]="message"></span>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="action-button" (click)="onClose()" #btn>OK</button>
|
||||
<button type="button" class="action-button" (click)="onClose()" #btn>{{ 'MODALS.OK' | translate }}</button>
|
||||
<button type="button" class="close-button" (click)="onClose()"><i class="icon close"></i></button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@ export class ModalContainerComponent implements OnInit {
|
|||
ngOnInit() {
|
||||
this.button.nativeElement.focus();
|
||||
switch (this.type) {
|
||||
case 'error': this.title = this.translate.instant("MODALS.ERROR"); break;
|
||||
case 'success': this.title = this.translate.instant("MODALS.SUCCESS"); break;
|
||||
case 'info': this.title = this.translate.instant("MODALS.INFO"); break;
|
||||
case 'error': this.title = this.translate.instant('MODALS.ERROR'); break;
|
||||
case 'success': this.title = this.translate.instant('MODALS.SUCCESS'); break;
|
||||
case 'info': this.title = this.translate.instant('MODALS.INFO'); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<div class="switch" (click)="toggleStaking(); $event.stopPropagation()">
|
||||
<span class="option" *ngIf="staking">ON</span>
|
||||
<span class="option" *ngIf="staking">{{ 'STAKING.SWITCH.ON' | translate }}</span>
|
||||
<span class="circle" [class.on]="staking" [class.off]="!staking"></span>
|
||||
<span class="option" *ngIf="!staking">OFF</span>
|
||||
<span class="option" *ngIf="!staking">{{ 'STAKING.SWITCH.OFF' | translate }}</span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import {Component, OnInit, OnDestroy, Input} from '@angular/core';
|
||||
import {Transaction} from '../../models/transaction.model';
|
||||
import {VariablesService} from "../../services/variables.service";
|
||||
import {VariablesService} from '../../services/variables.service';
|
||||
import {BackendService} from '../../services/backend.service';
|
||||
import {IntToMoneyPipe} from '../../pipes/int-to-money.pipe';
|
||||
|
||||
|
|
@ -19,12 +19,12 @@ export class TransactionDetailsComponent implements OnInit, OnDestroy {
|
|||
constructor(private variablesService: VariablesService, private backendService: BackendService, private intToMoneyPipe: IntToMoneyPipe) {}
|
||||
|
||||
ngOnInit() {
|
||||
for (let input in this.transaction.td['rcv']) {
|
||||
for (const input in this.transaction.td['rcv']) {
|
||||
if (this.transaction.td['rcv'].hasOwnProperty(input)) {
|
||||
this.inputs.push(this.intToMoneyPipe.transform(this.transaction.td['rcv'][input]));
|
||||
}
|
||||
}
|
||||
for (let output in this.transaction.td['spn']) {
|
||||
for (const output in this.transaction.td['spn']) {
|
||||
if (this.transaction.td['spn'].hasOwnProperty(output)) {
|
||||
this.outputs.push(this.intToMoneyPipe.transform(this.transaction.td['spn'][output]));
|
||||
}
|
||||
|
|
@ -32,8 +32,7 @@ export class TransactionDetailsComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
|
||||
openInBrowser(tr) {
|
||||
let link = 'explorer.zano.org/transaction/' + tr;
|
||||
this.backendService.openUrlInBrowser(link);
|
||||
this.backendService.openUrlInBrowser('explorer.zano.org/transaction/' + tr);
|
||||
}
|
||||
|
||||
ngOnDestroy() {}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import {BigNumber} from "bignumber.js";
|
||||
import {BigNumber} from 'bignumber.js';
|
||||
|
||||
export class Transaction {
|
||||
amount: BigNumber;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ export class Wallet {
|
|||
progress?: number;
|
||||
loaded?: boolean;
|
||||
|
||||
send_data?:any = {
|
||||
send_data?: any = {
|
||||
address: null,
|
||||
amount: null,
|
||||
comment: null,
|
||||
|
|
|
|||
|
|
@ -1,110 +1,112 @@
|
|||
import {Pipe, PipeTransform} from '@angular/core';
|
||||
import {TranslateService} from '@ngx-translate/core';
|
||||
|
||||
@Pipe({
|
||||
name: 'contractStatusMessages'
|
||||
})
|
||||
export class ContractStatusMessagesPipe implements PipeTransform {
|
||||
|
||||
constructor(private translate: TranslateService) {}
|
||||
|
||||
getStateSeller(stateNum: number): string {
|
||||
const state = {part1: '', part2: ''};
|
||||
switch (stateNum) {
|
||||
case 1:
|
||||
state.part1 = 'New contract proposal';
|
||||
state.part1 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.SELLER.NEW_CONTRACT');
|
||||
break;
|
||||
case 110:
|
||||
state.part1 = 'You ignored the contract proposal';
|
||||
state.part1 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.SELLER.IGNORED');
|
||||
break;
|
||||
case 201:
|
||||
state.part1 = 'You have accepted the contract proposal';
|
||||
state.part2 = 'Please wait for the pledges to be made';
|
||||
state.part1 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.SELLER.ACCEPTED');
|
||||
state.part2 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.SELLER.WAIT');
|
||||
break;
|
||||
case 2:
|
||||
state.part1 = 'The buyer is waiting for the item to be delivered';
|
||||
state.part2 = 'Pledges made';
|
||||
state.part1 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.SELLER.BUYER_WAIT');
|
||||
state.part2 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.SELLER.PLEDGES_MADE');
|
||||
break;
|
||||
case 3:
|
||||
state.part1 = 'Contract completed successfully';
|
||||
state.part2 = 'Item received, payment transferred, pledges returned';
|
||||
state.part1 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.SELLER.COMPLETED');
|
||||
state.part2 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.SELLER.RECEIVED');
|
||||
break;
|
||||
case 4:
|
||||
state.part1 = 'Item not received';
|
||||
state.part2 = 'All pledges nullified';
|
||||
state.part1 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.SELLER.NOT_RECEIVED');
|
||||
state.part2 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.SELLER.NULLIFIED');
|
||||
break;
|
||||
case 5:
|
||||
state.part1 = 'New proposal to cancel contract and return pledges';
|
||||
state.part1 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.SELLER.PROPOSAL_CANCEL');
|
||||
break;
|
||||
case 601:
|
||||
state.part1 = 'The contract is being cancelled. Please wait for the pledge to be returned';
|
||||
state.part1 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.SELLER.BEING_CANCELLED');
|
||||
break;
|
||||
case 6:
|
||||
state.part1 = 'Contract canceled';
|
||||
state.part2 = 'Pledges returned';
|
||||
state.part1 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.SELLER.CANCELLED');
|
||||
state.part2 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.SELLER.PLEDGES_RETURNED');
|
||||
break;
|
||||
case 130:
|
||||
state.part1 = 'You ignored the proposal to cancel the contract';
|
||||
state.part1 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.SELLER.IGNORED_CANCEL');
|
||||
break;
|
||||
case 140:
|
||||
state.part1 = 'The contract proposal has expired';
|
||||
state.part1 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.SELLER.EXPIRED');
|
||||
break;
|
||||
}
|
||||
return state.part1 + ' ' + state.part2;
|
||||
}
|
||||
|
||||
getStateCustomer(stateNum: number): string {
|
||||
getStateBuyer(stateNum: number): string {
|
||||
const state = {part1: '', part2: ''};
|
||||
switch (stateNum) {
|
||||
case 1:
|
||||
state.part1 = 'Waiting for seller respond to contract proposal';
|
||||
state.part2 = 'Pledge amount reserved';
|
||||
state.part1 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.BUYER.WAITING');
|
||||
state.part2 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.BUYER.PLEDGE_RESERVED');
|
||||
break;
|
||||
case 110:
|
||||
state.part1 = 'The seller ignored your contract proposal';
|
||||
state.part2 = 'Pledge amount unblocked';
|
||||
state.part1 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.BUYER.IGNORED');
|
||||
state.part2 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.BUYER.PLEDGE_UNBLOCKED');
|
||||
break;
|
||||
case 201:
|
||||
state.part1 = 'The seller accepted your contract proposal';
|
||||
state.part2 = 'Please wait for the pledges to be made';
|
||||
state.part1 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.BUYER.ACCEPTED');
|
||||
state.part2 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.BUYER.WAIT');
|
||||
break;
|
||||
case 2:
|
||||
state.part1 = 'The seller accepted your contract proposal';
|
||||
state.part2 = 'Pledges made';
|
||||
state.part1 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.BUYER.ACCEPTED');
|
||||
state.part2 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.BUYER.PLEDGES_MADE');
|
||||
break;
|
||||
case 120:
|
||||
state.part1 = 'Waiting for seller to ship item';
|
||||
state.part2 = 'Pledges made';
|
||||
state.part1 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.BUYER.WAITING_SELLER');
|
||||
state.part2 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.BUYER.PLEDGES_MADE');
|
||||
break;
|
||||
case 3:
|
||||
state.part1 = 'Contract completed successfully';
|
||||
state.part2 = 'Item received, payment transferred, pledges returned';
|
||||
state.part1 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.BUYER.COMPLETED');
|
||||
state.part2 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.BUYER.RECEIVED');
|
||||
break;
|
||||
case 4:
|
||||
state.part1 = 'Item not received';
|
||||
state.part2 = 'All pledges nullified';
|
||||
state.part1 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.BUYER.NOT_RECEIVED');
|
||||
state.part2 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.BUYER.NULLIFIED');
|
||||
break;
|
||||
case 5:
|
||||
state.part1 = 'Waiting for seller to respond to proposal to cancel contract and return pledges';
|
||||
state.part1 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.BUYER.WAITING_CANCEL');
|
||||
break;
|
||||
case 601:
|
||||
state.part1 = 'The contract is being cancelled. Please wait for the pledge to be returned';
|
||||
state.part1 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.BUYER.BEING_CANCELLED');
|
||||
break;
|
||||
case 6:
|
||||
state.part1 = 'Contract canceled';
|
||||
state.part2 = 'Pledges returned';
|
||||
state.part1 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.BUYER.CANCELLED');
|
||||
state.part2 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.BUYER.PLEDGES_RETURNED');
|
||||
break;
|
||||
case 130:
|
||||
state.part1 = 'The seller ignored your proposal to cancel the contract';
|
||||
state.part1 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.BUYER.IGNORED_CANCEL');
|
||||
break;
|
||||
case 140:
|
||||
state.part1 = 'The contract proposal has expired';
|
||||
state.part1 = this.translate.instant('CONTRACTS.STATUS_MESSAGES.BUYER.EXPIRED');
|
||||
break;
|
||||
}
|
||||
return state.part1 + ' ' + state.part2;
|
||||
}
|
||||
|
||||
transform(item: any, args?: any): any {
|
||||
|
||||
if (item.is_a) {
|
||||
return this.getStateCustomer(item.state);
|
||||
return this.getStateBuyer(item.state);
|
||||
} else {
|
||||
return this.getStateSeller(item.state);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,13 @@
|
|||
import {Pipe, PipeTransform} from '@angular/core';
|
||||
import {TranslateService} from '@ngx-translate/core';
|
||||
|
||||
@Pipe({
|
||||
name: 'historyTypeMessages'
|
||||
})
|
||||
export class HistoryTypeMessagesPipe implements PipeTransform {
|
||||
|
||||
constructor(private translate: TranslateService) {}
|
||||
|
||||
transform(item: any, args?: any): any {
|
||||
|
||||
if (item.tx_type === 0) {
|
||||
|
|
@ -12,53 +15,51 @@ export class HistoryTypeMessagesPipe implements PipeTransform {
|
|||
return item.remote_addresses[0];
|
||||
} else {
|
||||
if (item.is_income) {
|
||||
return 'hidden';
|
||||
return this.translate.instant('HISTORY.TYPE_MESSAGES.HIDDEN');
|
||||
} else {
|
||||
return 'Undefined';
|
||||
return this.translate.instant('HISTORY.TYPE_MESSAGES.UNDEFINED');
|
||||
}
|
||||
}
|
||||
} else if (item.tx_type === 6 && item.height === 0) {
|
||||
return 'unknown';
|
||||
} else if (item.tx_type === 9) {
|
||||
if (item.hasOwnProperty('contract') && item.contract[0].is_a) {
|
||||
return 'Successfully complete contract, return remaining pledge';
|
||||
return this.translate.instant('HISTORY.TYPE_MESSAGES.COMPLETE_BUYER');
|
||||
} else {
|
||||
return 'Successfully complete contract, receive payment on contract, and return pledge';
|
||||
return this.translate.instant('HISTORY.TYPE_MESSAGES.COMPLETE_SELLER');
|
||||
}
|
||||
} else {
|
||||
switch (item.tx_type) {
|
||||
// case 0:
|
||||
// return $filter('translate')('GUI_TX_TYPE_NORMAL');
|
||||
// break;
|
||||
// return '';
|
||||
// case 1:
|
||||
// return $filter('translate')('GUI_TX_TYPE_PUSH_OFFER');
|
||||
// return '';
|
||||
// case 2:
|
||||
// return $filter('translate')('GUI_TX_TYPE_UPDATE_OFFER');
|
||||
// return '';
|
||||
// case 3:
|
||||
// return $filter('translate')('GUI_TX_TYPE_CANCEL_OFFER');
|
||||
// return '';
|
||||
// case 4:
|
||||
// return $filter('translate')('GUI_TX_TYPE_NEW_ALIAS');
|
||||
// return '';
|
||||
// case 5:
|
||||
// return $filter('translate')('GUI_TX_TYPE_UPDATE_ALIAS');
|
||||
// return '';
|
||||
case 6:
|
||||
return 'Mined funds';
|
||||
return this.translate.instant('HISTORY.TYPE_MESSAGES.MINED');
|
||||
case 7:
|
||||
return 'Send contract offer';
|
||||
return this.translate.instant('HISTORY.TYPE_MESSAGES.CREATE_CONTRACT');
|
||||
case 8:
|
||||
return 'Make pledge on offer';
|
||||
return this.translate.instant('HISTORY.TYPE_MESSAGES.PLEDGE_CONTRACT');
|
||||
// case 9:
|
||||
// return $filter('translate')('GUI_TX_TYPE_ESCROW_RELEASE_NORMAL');
|
||||
// break;
|
||||
// return '';
|
||||
case 10:
|
||||
return 'Nullify pledges for contract';
|
||||
return this.translate.instant('HISTORY.TYPE_MESSAGES.NULLIFY_CONTRACT');
|
||||
case 11:
|
||||
return 'Send proposal to cancel contract';
|
||||
return this.translate.instant('HISTORY.TYPE_MESSAGES.PROPOSAL_CANCEL_CONTRACT');
|
||||
case 12:
|
||||
return 'Cancel contract, return pledges';
|
||||
return this.translate.instant('HISTORY.TYPE_MESSAGES.CANCEL_CONTRACT');
|
||||
}
|
||||
}
|
||||
|
||||
return 'Undefined';
|
||||
return this.translate.instant('HISTORY.TYPE_MESSAGES.UNDEFINED');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ export class IntToMoneyPipe implements PipeTransform {
|
|||
maxFraction = parseInt(args, 10);
|
||||
}
|
||||
const power = Math.pow(10, this.variablesService.digits);
|
||||
// let str = (value / power).toFixed(maxFraction);
|
||||
let str = (new BigNumber(value)).div(power).toFixed(maxFraction);
|
||||
|
||||
for (let i = str.length - 1; i >= 0; i--) {
|
||||
|
|
|
|||
|
|
@ -21,18 +21,22 @@
|
|||
<i class="icon alert" *ngIf="!item.is_new"></i>
|
||||
<i class="icon new" *ngIf="item.is_new"></i>
|
||||
<i class="icon" [class.purchase]="item.is_a" [class.sell]="!item.is_a"></i>
|
||||
<span>{{item.private_detailes.t}}</span>
|
||||
<span tooltip="{{ item.private_detailes.t }}" placement="top" tooltipClass="table-tooltip" [delay]="500">{{item.private_detailes.t}}</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>{{item.timestamp * 1000 | date : 'dd-MM-yyyy HH:mm'}}</td>
|
||||
<td>{{item.private_detailes.to_pay | intToMoney}} {{variablesService.defaultCurrency}}</td>
|
||||
<td>
|
||||
<div>{{item.timestamp * 1000 | date : 'dd-MM-yyyy HH:mm'}}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>{{item.private_detailes.to_pay | intToMoney}} {{variablesService.defaultCurrency}}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="status" tooltip="{{ item | contractStatusMessages }}" placement="top" tooltipClass="table-tooltip" [delay]="500">
|
||||
{{item | contractStatusMessages}}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="comment">
|
||||
<div class="comment" tooltip="{{ item.private_detailes.c }}" placement="top" tooltipClass="table-tooltip" [delay]="500">
|
||||
{{item.private_detailes.c}}
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -64,14 +64,12 @@
|
|||
span {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
max-width: 20vw;
|
||||
}
|
||||
}
|
||||
|
||||
.status, .comment {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
max-width: 20vw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,69 +124,69 @@
|
|||
<div class="purchase-states" *ngIf="!newPurchase">
|
||||
|
||||
<ng-container *ngIf="currentContract.state == 1 && !currentContract.is_a && currentContract.private_detailes.b_pledge.plus(variablesService.default_fee_big).plus(variablesService.default_fee_big).isGreaterThan(variablesService.currentWallet.unlocked_balance)">
|
||||
<span>{{ 'There are insufficient funds in the wallet. Add funds to the wallet to continue' | translate }}</span>
|
||||
<span>{{ 'PURCHASE.NEED_MONEY' | translate }}</span>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="currentContract.is_a">
|
||||
<span *ngIf="currentContract.state == 1">{{ 'Waiting for seller respond to contract proposal' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 1">{{ 'PURCHASE.WAITING_SELLER' | translate }}</span>
|
||||
<!--<span *ngIf="currentContract.state == 1" ng-bind="'(' + (currentContract.expiration_time | buyingTime : 0) + ')'"></span>-->
|
||||
|
||||
<span *ngIf="currentContract.state == 110">{{ 'The seller ignored your contract proposal' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 110">{{ 'Pledge amount unblocked' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 110">{{ 'PURCHASE.IGNORED_SELLER' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 110">{{ 'PURCHASE.PLEDGE_UNBLOCKED' | translate }}</span>
|
||||
|
||||
<span *ngIf="currentContract.state == 120">{{ 'Waiting for seller to ship item' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 120">{{ 'PURCHASE.WAITING_SHIP' | translate }}</span>
|
||||
|
||||
<span *ngIf="currentContract.state == 130">{{ 'The seller ignored your proposal to cancel the contract' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 130">{{ 'PURCHASE.IGNORED_CANCEL_SELLER' | translate }}</span>
|
||||
|
||||
<span *ngIf="currentContract.state == 140">{{ 'The contract proposal has expired' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 140">{{ 'PURCHASE.EXPIRED' | translate }}</span>
|
||||
|
||||
<span *ngIf="currentContract.state == 201">{{ 'Please wait for the pledges to be made' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 201">{{ 'PURCHASE.WAIT' | translate }}</span>
|
||||
|
||||
<span *ngIf="currentContract.state == 2">{{ 'Waiting for seller to ship item' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 2">{{ 'PURCHASE.WAITING_SELLER' | translate }}</span>
|
||||
|
||||
<span *ngIf="currentContract.state == 3">{{ 'Contract completed successfully' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 3">{{ 'Item received, payment transferred, pledges returned' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 3">{{ 'PURCHASE.COMPLETED' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 3">{{ 'PURCHASE.RECEIVED' | translate }}</span>
|
||||
|
||||
<span *ngIf="currentContract.state == 4">{{ 'Item not received' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 4">{{ 'All pledges nullified' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 4">{{ 'PURCHASE.NOT_RECEIVED' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 4">{{ 'PURCHASE.NULLIFIED' | translate }}</span>
|
||||
|
||||
<span *ngIf="currentContract.state == 5">{{ 'You have made a proposal to cancel the contract' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 5">{{ 'PURCHASE.PROPOSAL_CANCEL_SELLER' | translate }}</span>
|
||||
<!--<span *ngIf="currentContract.state == 5" ng-bind="'(' + (contract.cancel_expiration_time | buyingTime : 2) + ')'"></span>-->
|
||||
|
||||
<span *ngIf="currentContract.state == 601">{{ 'The contract is being cancelled. Please wait for the pledge to be returned' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 601">{{ 'PURCHASE.BEING_CANCELLED' | translate }}</span>
|
||||
|
||||
<span *ngIf="currentContract.state == 6">{{ 'Contract canceled' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 6">{{ 'Pledges returned' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 6">{{ 'PURCHASE.CANCELLED' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 6">{{ 'PURCHASE.PLEDGES_RETURNED' | translate }}</span>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="!currentContract.is_a">
|
||||
<span *ngIf="currentContract.state == 1">{{ 'The buyer is proposing a contract' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 1">{{ 'PURCHASE.WAITING_BUYER' | translate }}</span>
|
||||
<!--<span *ngIf="currentContract.state == 1" ng-bind="'(' + (contract.expiration_time | buyingTime : 1) + ')'"></span>-->
|
||||
|
||||
<span *ngIf="currentContract.state == 110">{{ 'You ignored the contract proposal' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 110">{{ 'PURCHASE.IGNORED_BUYER' | translate }}</span>
|
||||
|
||||
<span *ngIf="currentContract.state == 130">{{ 'You ignored the proposal to cancel the contract' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 130">{{ 'PURCHASE.IGNORED_CANCEL_BUYER' | translate }}</span>
|
||||
|
||||
<span *ngIf="currentContract.state == 140">{{ 'The contract proposal has expired' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 140">{{ 'PURCHASE.EXPIRED' | translate }}</span>
|
||||
|
||||
<span *ngIf="currentContract.state == 201">{{ 'Please wait for the pledges to be made' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 201">{{ 'PURCHASE.WAIT' | translate }}</span>
|
||||
|
||||
<span *ngIf="currentContract.state == 2">{{ 'The buyer is waiting for the item to be delivered' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 2">{{ 'Pledges made' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 2">{{ 'PURCHASE.BUYER_WAIT' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 2">{{ 'PURCHASE.PLEDGES_MADE' | translate }}</span>
|
||||
|
||||
<span *ngIf="currentContract.state == 3">{{ 'Contract completed successfully' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 3">{{ 'Item received, payment transferred, pledges returned' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 3">{{ 'PURCHASE.COMPLETED' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 3">{{ 'PURCHASE.RECEIVED' | translate }}</span>
|
||||
|
||||
<span *ngIf="currentContract.state == 4">{{ 'Item not received' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 4">{{ 'All pledges nullified' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 4">{{ 'PURCHASE.NOT_RECEIVED' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 4">{{ 'PURCHASE.NULLIFIED' | translate }}</span>
|
||||
|
||||
<span *ngIf="currentContract.state == 5">{{ 'The buyer is offering to cancel the contract and return the pledge' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 5">{{ 'PURCHASE.PROPOSAL_CANCEL_BUYER' | translate }}</span>
|
||||
<!--<span *ngIf="currentContract.state == 5" ng-bind="'(' + (contract.cancel_expiration_time | buyingTime : 1) + ')'"></span>-->
|
||||
|
||||
<span *ngIf="currentContract.state == 601">{{ 'The contract is being cancelled. Please wait for the pledge to be returned' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 601">{{ 'PURCHASE.BEING_CANCELLED' | translate }}</span>
|
||||
|
||||
<span *ngIf="currentContract.state == 6">{{ 'Contract canceled' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 6">{{ 'Pledges returned' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 6">{{ 'PURCHASE.CANCELLED' | translate }}</span>
|
||||
<span *ngIf="currentContract.state == 6">{{ 'PURCHASE.PLEDGES_RETURNED' | translate }}</span>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="currentContract.state == 201 || currentContract.state == 601">
|
||||
|
|
@ -198,32 +198,29 @@
|
|||
</div>
|
||||
|
||||
<div class="purchase-buttons" *ngIf="!newPurchase">
|
||||
<!--<button type="button" class="blue-button">{{ 'PURCHASE.CANCEL_BUTTON' | translate }}</button>-->
|
||||
<!--<button type="button" class="turquoise-button">{{ 'PURCHASE.TERMINATE_BUTTON' | translate }}</button>-->
|
||||
<!--<button type="button" class="green-button">{{ 'PURCHASE.COMPLETE_BUTTON' | translate }}</button>-->
|
||||
|
||||
<ng-container *ngIf="!currentContract.is_a && currentContract.state == 1">
|
||||
<button type="button" class="blue-button" (click)="acceptState();" [disabled]="currentContract.private_detailes.b_pledge.plus(variablesService.default_fee_big).plus(variablesService.default_fee_big).isGreaterThan(variablesService.currentWallet.unlocked_balance)">
|
||||
{{'Accept (Make pledge)' | translate}}
|
||||
{{'PURCHASE.BUTTON_MAKE_PLEDGE' | translate}}
|
||||
</button>
|
||||
<button type="button" class="turquoise-button" (click)="ignoredContract();">{{'Ignore' | translate}}</button>
|
||||
<button type="button" class="turquoise-button" (click)="ignoredContract();">{{'PURCHASE.BUTTON_IGNORE' | translate}}</button>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="currentContract.is_a && (currentContract.state == 201 || currentContract.state == 2 || currentContract.state == 120 || currentContract.state == 130)">
|
||||
<button type="button" class="blue-button" (click)="productNotGot();" [disabled]="currentContract.cancel_expiration_time == 0 && (currentContract.height == 0 || (variablesService.height_app - currentContract.height) < 10)">
|
||||
{{'Item not received (Nullify pledges)' | translate}}
|
||||
{{'PURCHASE.BUTTON_NULLIFY' | translate}}
|
||||
</button>
|
||||
<button type="button" class="turquoise-button" (click)="dealsDetailsFinish();" [disabled]="currentContract.cancel_expiration_time == 0 && (currentContract.height == 0 || (variablesService.height_app - currentContract.height) < 10)">
|
||||
{{'Item received (Transfer payment and return pledge to seller)' | translate}}
|
||||
{{'PURCHASE.BUTTON_RECEIVED' | translate}}
|
||||
</button>
|
||||
<button type="button" class="green-button" (click)="dealsDetailsCancel();" [disabled]="currentContract.cancel_expiration_time == 0 && (currentContract.height == 0 || (variablesService.height_app - currentContract.height) < 10)">
|
||||
{{'Cancel contract (Return pledge)' | translate}}
|
||||
{{'PURCHASE.BUTTON_CANCEL_BUYER' | translate}}
|
||||
</button>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="!currentContract.is_a && currentContract.state == 5">
|
||||
<button type="button" class="blue-button" (click)="dealsDetailsDontCanceling();">{{'Do not cancel (Item shipped)' | translate}}</button>
|
||||
<button type="button" class="turquoise-button" (click)="dealsDetailsSellerCancel();">{{'Cancel contract (Return pledge)' | translate}}</button>
|
||||
<button type="button" class="blue-button" (click)="dealsDetailsDontCanceling();">{{'PURCHASE.BUTTON_NOT_CANCEL' | translate}}</button>
|
||||
<button type="button" class="turquoise-button" (click)="dealsDetailsSellerCancel();">{{'PURCHASE.BUTTON_CANCEL_SELLER' | translate}}</button>
|
||||
</ng-container>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,6 @@
|
|||
<img src="{{qrImageSrc}}" alt="qr-code">
|
||||
<div class="wrap-address">
|
||||
<div class="address">{{variablesService.currentWallet.address}}</div>
|
||||
<button type="button" class="btn-copy-address" (click)="copyAddress()"></button>
|
||||
<button #copyButton type="button" class="btn-copy-address copy" (click)="copyAddress()"></button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -18,10 +18,21 @@
|
|||
line-height: 2.7rem;
|
||||
|
||||
.btn-copy-address {
|
||||
mask: url(../../assets/icons/copy.svg) no-repeat center;
|
||||
margin-left: 1.2rem;
|
||||
width: 1.7rem;
|
||||
height: 1.7rem;
|
||||
|
||||
&.copy {
|
||||
mask: url(../../assets/icons/copy.svg) no-repeat center;
|
||||
|
||||
&:hover {
|
||||
opacity: 0.75;
|
||||
}
|
||||
}
|
||||
|
||||
&.copied {
|
||||
mask: url(../../assets/icons/complete-testwallet.svg) no-repeat center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import {Component, OnInit, OnDestroy} from '@angular/core';
|
||||
import {Component, OnInit, OnDestroy, ViewChild, ElementRef, Renderer2} from '@angular/core';
|
||||
import QRCode from 'qrcode';
|
||||
import {BackendService} from '../_helpers/services/backend.service';
|
||||
import {VariablesService} from '../_helpers/services/variables.service';
|
||||
|
|
@ -12,9 +12,11 @@ import {ActivatedRoute} from '@angular/router';
|
|||
export class ReceiveComponent implements OnInit, OnDestroy {
|
||||
qrImageSrc: string;
|
||||
parentRouting;
|
||||
@ViewChild('copyButton') copy: ElementRef;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private renderer: Renderer2,
|
||||
private backend: BackendService,
|
||||
private variablesService: VariablesService
|
||||
) {
|
||||
|
|
@ -35,6 +37,12 @@ export class ReceiveComponent implements OnInit, OnDestroy {
|
|||
|
||||
public copyAddress() {
|
||||
this.backend.setClipboard(this.variablesService.currentWallet.address);
|
||||
this.renderer.removeClass(this.copy.nativeElement, 'copy');
|
||||
this.renderer.addClass(this.copy.nativeElement, 'copied');
|
||||
window.setTimeout(() => {
|
||||
this.renderer.removeClass(this.copy.nativeElement, 'copied');
|
||||
this.renderer.addClass(this.copy.nativeElement, 'copy');
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
<div class="chart-header">
|
||||
<div class="general">
|
||||
<div>
|
||||
<span class="label">Staking</span>
|
||||
<span class="label">{{ 'STAKING.TITLE' | translate }}</span>
|
||||
<span class="value">
|
||||
<app-staking-switch [(wallet_id)]="variablesService.currentWallet.wallet_id" [(staking)]="variablesService.currentWallet.staking"></app-staking-switch>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="label">Pending</span>
|
||||
<span class="label">{{ 'STAKING.TITLE_PENDING' | translate }}</span>
|
||||
<span class="value">{{pending.total | intToMoney}} {{variablesService.defaultCurrency}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="label">Total</span>
|
||||
<span class="label">{{ 'STAKING.TITLE_TOTAL' | translate }}</span>
|
||||
<span class="value">{{total | intToMoney}} {{variablesService.defaultCurrency}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -22,14 +22,12 @@
|
|||
</div>
|
||||
|
||||
<div class="chart">
|
||||
|
||||
<div [chart]="chart"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="chart-options">
|
||||
<div class="title">
|
||||
Time period:
|
||||
{{ 'STAKING.TITLE_PERIOD' | translate }}
|
||||
</div>
|
||||
<div class="options">
|
||||
<ng-container *ngFor="let period of periods">
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import {Chart} from 'angular-highcharts';
|
|||
import {BackendService} from '../_helpers/services/backend.service';
|
||||
import {ActivatedRoute} from '@angular/router';
|
||||
import {IntToMoneyPipe} from '../_helpers/pipes/int-to-money.pipe';
|
||||
import {TranslateService} from '@ngx-translate/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-staking',
|
||||
|
|
@ -18,23 +19,28 @@ export class StakingComponent implements OnInit, OnDestroy {
|
|||
|
||||
periods = [
|
||||
{
|
||||
title: '1 day',
|
||||
title: this.translate.instant('STAKING.DAY'),
|
||||
key: '1 day',
|
||||
active: false
|
||||
},
|
||||
{
|
||||
title: '1 week',
|
||||
title: this.translate.instant('STAKING.WEEK'),
|
||||
key: '1 week',
|
||||
active: false
|
||||
},
|
||||
{
|
||||
title: '1 month',
|
||||
title: this.translate.instant('STAKING.MONTH'),
|
||||
key: '1 month',
|
||||
active: false
|
||||
},
|
||||
{
|
||||
title: '1 year',
|
||||
title: this.translate.instant('STAKING.YEAR'),
|
||||
key: '1 year',
|
||||
active: false
|
||||
},
|
||||
{
|
||||
title: 'All',
|
||||
title: this.translate.instant('STAKING.ALL'),
|
||||
key: 'All',
|
||||
active: true
|
||||
}
|
||||
];
|
||||
|
|
@ -59,7 +65,8 @@ export class StakingComponent implements OnInit, OnDestroy {
|
|||
private variablesService: VariablesService,
|
||||
private backend: BackendService,
|
||||
private ngZone: NgZone,
|
||||
private intToMoneyPipe: IntToMoneyPipe
|
||||
private intToMoneyPipe: IntToMoneyPipe,
|
||||
private translate: TranslateService
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
@ -248,7 +255,7 @@ export class StakingComponent implements OnInit, OnDestroy {
|
|||
let min = null;
|
||||
const newData = [];
|
||||
|
||||
if (period.title === '1 day') {
|
||||
if (period.key === '1 day') {
|
||||
this.originalData.forEach((item) => {
|
||||
const time = (new Date(item[0])).setUTCMinutes(0, 0, 0);
|
||||
const find = newData.find(itemNew => itemNew[0] === time);
|
||||
|
|
@ -260,7 +267,7 @@ export class StakingComponent implements OnInit, OnDestroy {
|
|||
});
|
||||
this.chart.ref.series[0].setData(newData, true);
|
||||
min = Date.UTC(d.getFullYear(), d.getMonth(), d.getDate() - 1, 0, 0, 0, 0);
|
||||
} else if (period.title === '1 week') {
|
||||
} else if (period.key === '1 week') {
|
||||
this.originalData.forEach((item) => {
|
||||
const time = (new Date(item[0])).setUTCHours(0, 0, 0, 0);
|
||||
const find = newData.find(itemNew => itemNew[0] === time);
|
||||
|
|
@ -272,7 +279,7 @@ export class StakingComponent implements OnInit, OnDestroy {
|
|||
});
|
||||
this.chart.ref.series[0].setData(newData, true);
|
||||
min = Date.UTC(d.getFullYear(), d.getMonth(), d.getDate() - 7, 0, 0, 0, 0);
|
||||
} else if (period.title === '1 month') {
|
||||
} else if (period.key === '1 month') {
|
||||
this.originalData.forEach((item) => {
|
||||
const time = (new Date(item[0])).setUTCHours(0, 0, 0, 0);
|
||||
const find = newData.find(itemNew => itemNew[0] === time);
|
||||
|
|
@ -284,7 +291,7 @@ export class StakingComponent implements OnInit, OnDestroy {
|
|||
});
|
||||
this.chart.ref.series[0].setData(newData, true);
|
||||
min = Date.UTC(d.getFullYear(), d.getMonth() - 1, d.getDate(), 0, 0, 0, 0);
|
||||
} else if (period.title === '1 year') {
|
||||
} else if (period.key === '1 year') {
|
||||
this.originalData.forEach((item) => {
|
||||
const time = (new Date(item[0])).setUTCHours(0, 0, 0, 0);
|
||||
const find = newData.find(itemNew => itemNew[0] === time);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
</div>
|
||||
<div class="address">
|
||||
<span>{{variablesService.currentWallet.address}}</span>
|
||||
<i class="icon copy" (click)="copyAddress()"></i>
|
||||
<i #copyIcon class="icon copy" (click)="copyAddress()"></i>
|
||||
</div>
|
||||
<div class="balance">
|
||||
<span [tooltip]="getTooltip()" [placement]="'bottom'" [tooltipClass]="'balance-tooltip'" [delay]="500" [timeout]="1000">{{variablesService.currentWallet.balance | intToMoney : '3'}} {{variablesService.defaultCurrency}}</span>
|
||||
|
|
|
|||
|
|
@ -74,6 +74,14 @@
|
|||
|
||||
&.copy {
|
||||
mask: url(../../assets/icons/copy.svg) no-repeat center;
|
||||
|
||||
&:hover {
|
||||
opacity: 0.75;
|
||||
}
|
||||
}
|
||||
|
||||
&.copied {
|
||||
mask: url(../../assets/icons/complete-testwallet.svg) no-repeat center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import {Component, OnInit, OnDestroy, NgZone} from '@angular/core';
|
||||
import {Component, OnInit, OnDestroy, NgZone, ViewChild, ElementRef, Renderer2} from '@angular/core';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {VariablesService} from '../_helpers/services/variables.service';
|
||||
import {BackendService} from '../_helpers/services/backend.service';
|
||||
|
|
@ -14,6 +14,7 @@ import {BigNumber} from 'bignumber.js';
|
|||
export class WalletComponent implements OnInit, OnDestroy {
|
||||
subRouting;
|
||||
walletID;
|
||||
@ViewChild('copyIcon') copy: ElementRef;
|
||||
tabs = [
|
||||
{
|
||||
title: 'WALLET.TABS.HISTORY',
|
||||
|
|
@ -62,6 +63,7 @@ export class WalletComponent implements OnInit, OnDestroy {
|
|||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private renderer: Renderer2,
|
||||
private backend: BackendService,
|
||||
private variablesService: VariablesService,
|
||||
private ngZone: NgZone,
|
||||
|
|
@ -93,6 +95,12 @@ export class WalletComponent implements OnInit, OnDestroy {
|
|||
|
||||
copyAddress() {
|
||||
this.backend.setClipboard(this.variablesService.currentWallet.address);
|
||||
this.renderer.removeClass(this.copy.nativeElement, 'copy');
|
||||
this.renderer.addClass(this.copy.nativeElement, 'copied');
|
||||
window.setTimeout(() => {
|
||||
this.renderer.removeClass(this.copy.nativeElement, 'copied');
|
||||
this.renderer.addClass(this.copy.nativeElement, 'copy');
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
getTooltip() {
|
||||
|
|
|
|||
|
|
@ -184,6 +184,18 @@
|
|||
"INPUTS": "Inputs",
|
||||
"OUTPUTS": "Outputs",
|
||||
"COMMENT": "Comment"
|
||||
},
|
||||
"TYPE_MESSAGES": {
|
||||
"HIDDEN": "hidden",
|
||||
"UNDEFINED": "Undefined",
|
||||
"COMPLETE_BUYER": "Successfully complete contract, return remaining pledge",
|
||||
"COMPLETE_SELLER": "Successfully complete contract, receive payment on contract, and return pledge",
|
||||
"MINED": "Mined funds",
|
||||
"CREATE_CONTRACT": "Send contract offer",
|
||||
"PLEDGE_CONTRACT": "Make pledge on offer",
|
||||
"NULLIFY_CONTRACT": "Nullify pledges for contract",
|
||||
"PROPOSAL_CANCEL_CONTRACT": "Send proposal to cancel contract",
|
||||
"CANCEL_CONTRACT": "Cancel contract, return pledges"
|
||||
}
|
||||
},
|
||||
"CONTRACTS": {
|
||||
|
|
@ -208,6 +220,46 @@
|
|||
"REMAINING_ONE_WAITING": "Remaining {{time}} hour waiting",
|
||||
"REMAINING_MANY_WAITING": "Remaining {{time}} hours waiting",
|
||||
"REMAINING_MANY_ALT_WAITING": "Remaining {{time}} hours waiting"
|
||||
},
|
||||
"STATUS_MESSAGES": {
|
||||
"SELLER": {
|
||||
"NEW_CONTRACT": "New contract proposal",
|
||||
"IGNORED": "You ignored the contract proposal",
|
||||
"ACCEPTED": "You have accepted the contract proposal",
|
||||
"WAIT": "Please wait for the pledges to be made",
|
||||
"BUYER_WAIT": "The buyer is waiting for the item to be delivered",
|
||||
"PLEDGES_MADE": "Pledges made",
|
||||
"COMPLETED": "Contract completed successfully",
|
||||
"RECEIVED": "Item received, payment transferred, pledges returned",
|
||||
"NOT_RECEIVED": "Item not received",
|
||||
"NULLIFIED": "All pledges nullified",
|
||||
"PROPOSAL_CANCEL": "New proposal to cancel contract and return pledges",
|
||||
"BEING_CANCELLED": "The contract is being cancelled. Please wait for the pledge to be returned",
|
||||
"CANCELLED": "Contract canceled",
|
||||
"PLEDGES_RETURNED": "Pledges returned",
|
||||
"IGNORED_CANCEL": "You ignored the proposal to cancel the contract",
|
||||
"EXPIRED": "The contract proposal has expired"
|
||||
},
|
||||
"BUYER": {
|
||||
"WAITING": "Waiting for seller respond to contract proposal",
|
||||
"PLEDGE_RESERVED": "Pledge amount reserved",
|
||||
"IGNORED": "The seller ignored your contract proposal",
|
||||
"PLEDGE_UNBLOCKED": "Pledge amount unblocked",
|
||||
"ACCEPTED": "The seller accepted your contract proposal",
|
||||
"WAIT": "Please wait for the pledges to be made",
|
||||
"PLEDGES_MADE": "Pledges made",
|
||||
"WAITING_SELLER": "Waiting for seller to ship item",
|
||||
"COMPLETED": "Contract completed successfully",
|
||||
"RECEIVED": "Item received, payment transferred, pledges returned",
|
||||
"NOT_RECEIVED": "Item not received",
|
||||
"NULLIFIED": "All pledges nullified",
|
||||
"WAITING_CANCEL": "Waiting for seller to respond to proposal to cancel contract and return pledges",
|
||||
"BEING_CANCELLED": "The contract is being cancelled. Please wait for the pledge to be returned",
|
||||
"CANCELLED": "Contract canceled",
|
||||
"PLEDGES_RETURNED": "Pledges returned",
|
||||
"IGNORED_CANCEL": "The seller ignored your proposal to cancel the contract",
|
||||
"EXPIRED": "The contract proposal has expired"
|
||||
}
|
||||
}
|
||||
},
|
||||
"PURCHASE": {
|
||||
|
|
@ -231,9 +283,6 @@
|
|||
"SELLER_SAME": "The seller's and buyer's accounts are identical. The seller and buyer must use different wallet for the contract.",
|
||||
"COMMENT_MAXIMUM": "Maximum field length reached."
|
||||
},
|
||||
"CANCEL_BUTTON": "Cancel and return deposits",
|
||||
"TERMINATE_BUTTON": "Terminate and burn deposits",
|
||||
"COMPLETE_BUTTON": "Complete and release deposits",
|
||||
"PROGRESS_NEW": "New purchase",
|
||||
"PROGRESS_WAIT": "Awaiting reply",
|
||||
"PROGRESS_RECEIVE": "Reply received",
|
||||
|
|
@ -247,7 +296,36 @@
|
|||
"SEND_CANCEL_PROPOSAL": "Proposal to cancel contract sent to seller",
|
||||
"IGNORED_CANCEL": "You have ignored the proposal to cancel the contract",
|
||||
"DEALS_CANCELED_WAIT": "The contract is being cancelled. Please wait for the deposit to be returned",
|
||||
"WAITING_TIME": "Time until response"
|
||||
"WAITING_TIME": "Time until response",
|
||||
"NEED_MONEY": "There are insufficient funds in the wallet. Add funds to the wallet to continue",
|
||||
"WAITING_SELLER": "Waiting for seller respond to contract proposal",
|
||||
"IGNORED_SELLER": "The seller ignored your contract proposal",
|
||||
"PLEDGE_UNBLOCKED": "Pledge amount unblocked",
|
||||
"WAITING_SHIP": "Waiting for seller to ship item",
|
||||
"IGNORED_CANCEL_SELLER": "The seller ignored your proposal to cancel the contract",
|
||||
"EXPIRED": "The contract proposal has expired",
|
||||
"WAIT": "Please wait for the pledges to be made",
|
||||
"COMPLETED": "Contract completed successfully",
|
||||
"RECEIVED": "Item received, payment transferred, pledges returned",
|
||||
"NOT_RECEIVED": "Item not received",
|
||||
"NULLIFIED": "All pledges nullified",
|
||||
"PROPOSAL_CANCEL_SELLER": "You have made a proposal to cancel the contract",
|
||||
"BEING_CANCELLED": "The contract is being cancelled. Please wait for the pledge to be returned",
|
||||
"CANCELLED": "Contract canceled",
|
||||
"PLEDGES_RETURNED": "Pledges returned",
|
||||
"WAITING_BUYER": "The buyer is proposing a contract",
|
||||
"IGNORED_BUYER": "You ignored the contract proposal",
|
||||
"IGNORED_CANCEL_BUYER": "You ignored the proposal to cancel the contract",
|
||||
"BUYER_WAIT": "The buyer is waiting for the item to be delivered",
|
||||
"PLEDGES_MADE": "Pledges made",
|
||||
"PROPOSAL_CANCEL_BUYER": "The buyer is offering to cancel the contract and return the pledge",
|
||||
"BUTTON_MAKE_PLEDGE": "Accept (Make pledge)",
|
||||
"BUTTON_IGNORE": "Ignore",
|
||||
"BUTTON_NULLIFY": "Item not received (Nullify pledges)",
|
||||
"BUTTON_RECEIVED": "Item received (Transfer payment and return pledge to seller)",
|
||||
"BUTTON_CANCEL_BUYER": "Cancel contract (Return pledge)",
|
||||
"BUTTON_NOT_CANCEL": "Do not cancel (Item shipped)",
|
||||
"BUTTON_CANCEL_SELLER": "Cancel contract (Return pledge)"
|
||||
},
|
||||
"MESSAGES": {
|
||||
"ADDRESS": "Address",
|
||||
|
|
@ -258,7 +336,23 @@
|
|||
"MODALS": {
|
||||
"ERROR": "Error",
|
||||
"SUCCESS": "Success",
|
||||
"INFO": "Information"
|
||||
"INFO": "Information",
|
||||
"OK": "OK"
|
||||
},
|
||||
"STAKING": {
|
||||
"TITLE": "Staking",
|
||||
"TITLE_PENDING": "Pending",
|
||||
"TITLE_TOTAL": "Total",
|
||||
"TITLE_PERIOD": "Time period:",
|
||||
"DAY": "1 day",
|
||||
"WEEK": "1 week",
|
||||
"MONTH": "1 month",
|
||||
"YEAR": "1 year",
|
||||
"ALL": "All",
|
||||
"SWITCH": {
|
||||
"ON": "ON",
|
||||
"OFF": "OFF"
|
||||
}
|
||||
},
|
||||
"ERRORS": {
|
||||
"NOT_ENOUGH_MONEY": "Insufficient funds in account",
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ table {
|
|||
padding: 0 1rem;
|
||||
vertical-align: middle;
|
||||
white-space: nowrap;
|
||||
max-width: 20rem;
|
||||
|
||||
&:first-child {
|
||||
padding-left: 3rem;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue