diff --git a/html_source/src/app/pages/wallet/tabs/history/history.component.ts b/html_source/src/app/pages/wallet/tabs/history/history.component.ts index e30916c0..88d7e1eb 100644 --- a/html_source/src/app/pages/wallet/tabs/history/history.component.ts +++ b/html_source/src/app/pages/wallet/tabs/history/history.component.ts @@ -40,11 +40,12 @@ import { zanoAssetInfo } from '@parts/data/assets';
- + + @@ -187,18 +188,20 @@ import { zanoAssetInfo } from '@parts/data/assets';
- - {{ subtransfer.amount.minus(transaction.fee ?? 0).negated() | intToMoney }} - {{ subtransfer.amount.negated() | intToMoney }} - + + {{ subtransfer.amount.minus(transaction.fee ?? 0).negated() | intToMoney }} + {{ subtransfer.amount.negated() | intToMoney }} + - {{ subtransfer.amount | intToMoney }} - + {{ subtransfer.amount | intToMoney }} + {{ (subtransfer.asset_id | getAssetInfo)?.ticker || '???' }}
@@ -468,6 +471,10 @@ export class HistoryComponent implements OnInit, OnDestroy { return true; } + if (asset_id === zanoAssetInfo.asset_id && this.isSwapTransaction(transaction) && this.isFinalizator(transaction)) { + return true; + } + return !(asset_id === zanoAssetInfo.asset_id && is_income === false && amount.eq(fee)); } @@ -479,10 +486,28 @@ export class HistoryComponent implements OnInit, OnDestroy { })); } + isSwapTransaction(transaction: Transaction): boolean { + const { subtransfers } = transaction; + const arr = subtransfers.map(({ is_income }) => is_income); + const condition1 = arr.some((value) => value); + const condition2 = arr.some((value) => !value); + return condition1 && condition2; + } + isFinalizator(transaction: Transaction): boolean { return !this.isInitiator(transaction); } + isSelfTransaction(transaction: Transaction): boolean { + const { remote_addresses, employed_entries: { receive, spent }, subtransfers, fee } = transaction; + + const condition1 = remote_addresses?.includes(this.variablesService.currentWallet?.address); + const condition2 = [...receive, ...spent].map(({ asset_id }) => asset_id === zanoAssetInfo.asset_id).every(Boolean); + const condition3 = subtransfers.length === 1 && subtransfers[0].asset_id === zanoAssetInfo.asset_id && subtransfers[0].amount.eq(fee); + + return condition1 && condition2 && condition3; + } + init(): void { let restore = false; if (hasOwnProperty(this.variablesService.after_sync_request, String(this.variablesService.currentWallet.wallet_id))) {