Skip to content

Commit

Permalink
Rename to now/at receipt
Browse files Browse the repository at this point in the history
  • Loading branch information
felixbrucker committed Feb 20, 2024
1 parent b9ed483 commit 5c7ffcf
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
</th>
<th scope="col">{{snippetService.getSnippet('payouts-component.headers.transaction')}}</th>
<th scope="col">{{snippetService.getSnippet('payouts-component.headers.amount')}}</th>
<th scope="col">Fiat Amount (Hold)</th>
<th scope="col">Fiat Amount (Sold)</th>
<th scope="col">Fiat Amount (Now)</th>
<th scope="col">Fiat Amount (At receipt)</th>
<th scope="col">{{snippetService.getSnippet('payouts-component.headers.state')}}</th>
</tr>
</thead>
Expand All @@ -45,8 +45,8 @@
<span *ngIf="payout.blockExplorerUrl === undefined">{{payout.coinId}}</span>
</td>
<td style="white-space: nowrap">{{payout.amountFormatted}} {{statsService.ticker$ | async}}</td>
<td style="white-space: nowrap">{{payout.fiatHoldAmountFormatted}}</td>
<td style="white-space: nowrap">{{payout.fiatSoldAmountFormatted}}</td>
<td style="white-space: nowrap">{{payout.fiatAmountNowFormatted}}</td>
<td style="white-space: nowrap">{{payout.fiatAmountAtReceiptFormatted}}</td>
<td>{{payout.state}}</td>
</tr>
</tbody>
Expand Down
20 changes: 10 additions & 10 deletions src/app/farmer-payout-history/farmer-payout-history.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,19 @@ export class FarmerPayoutHistoryComponent implements OnInit, OnDestroy {
'Date',
'Coin',
'Amount',
'Fiat Amount (Hold)',
'Fiat Amount (Sold)',
'Fiat Amount (Now)',
'Fiat Amount (At receipt)',
'State',
], this.payouts.getValue().map(payout => {
const amountFiatHold = this.ratesService.getFiatAmount(payout.amount)
const amountFiatSold = this.ratesService.getHistoricalFiatAmount(payout.amount, payout.historicalRate)
const amountFiatNow = this.ratesService.getFiatAmount(payout.amount)
const amountFiatAtReceipt = this.ratesService.getHistoricalFiatAmount(payout.amount, payout.historicalRate)

return [
moment(payout.createdAt).format('YYYY-MM-DD HH:mm'),
payout.coinId,
payout.amount,
amountFiatHold?.toString(),
amountFiatSold?.toString(),
amountFiatNow?.toString(),
amountFiatAtReceipt?.toString(),
payout.state,
]
}))
Expand All @@ -132,8 +132,8 @@ export class FarmerPayoutHistoryComponent implements OnInit, OnDestroy {
amountFormatted: (new BigNumber(accountPayout.amount))
.decimalPlaces(this.coinConfig.decimalPlaces, BigNumber.ROUND_FLOOR)
.toString(),
fiatHoldAmountFormatted: this.ratesService.getValuesInFiatFormatted(amount),
fiatSoldAmountFormatted: this.ratesService.getValueInHistoricalFiatFormatted(amount, accountPayout.historicalRate),
fiatAmountNowFormatted: this.ratesService.getValuesInFiatFormatted(amount),
fiatAmountAtReceiptFormatted: this.ratesService.getValueInHistoricalFiatFormatted(amount, accountPayout.historicalRate),
state: this.getFormattedPaymentState(accountPayout.state),
formattedPayoutDate: this.formatDate(moment(accountPayout.createdAt), payoutDateFormatting),
blockExplorerUrl: this.getBlockExplorerCoinLink(accountPayout.coinId),
Expand Down Expand Up @@ -204,8 +204,8 @@ export class FarmerPayoutHistoryComponent implements OnInit, OnDestroy {
interface FormattedAccountPayout {
coinId: string,
amountFormatted: string,
fiatHoldAmountFormatted: string,
fiatSoldAmountFormatted: string,
fiatAmountNowFormatted: string,
fiatAmountAtReceiptFormatted: string,
state: string,
formattedPayoutDate: string,
blockExplorerUrl?: string,
Expand Down
2 changes: 1 addition & 1 deletion src/app/farmer-won-blocks/farmer-won-blocks.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<td *ngIf="!(statsService.poolConfig$ | async)?.blockExplorerBlockUrlTemplate">{{block.height}}</td>
<td><span [class]="getEffortColor(block)">{{getBlockEffort(block)}}</span></td>
<td>
<span ngbTooltip="Hold: {{ratesService.getValuesInFiatFormatted(getFarmerRewardAmount(block))}} | Sold: {{ratesService.getValueInHistoricalFiatFormatted(getFarmerRewardAmount(block), block.historicalRate)}}">
<span ngbTooltip="Now: {{ratesService.getValuesInFiatFormatted(getFarmerRewardAmount(block))}} | At receipt: {{ratesService.getValueInHistoricalFiatFormatted(getFarmerRewardAmount(block), block.historicalRate)}}">
{{getFarmerRewardFormatted(block)}}
</span>
</td>
Expand Down
12 changes: 6 additions & 6 deletions src/app/farmer-won-blocks/farmer-won-blocks.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,22 +263,22 @@ export class FarmerWonBlocksComponent implements OnInit, OnDestroy {
'Hash',
'Effort',
'Farmer Reward',
'Farmer Reward Fiat (Hold)',
'Farmer Reward Fiat (Sold)',
'Farmer Reward Fiat (Now)',
'Farmer Reward Fiat (At receipt)',
'Remarks',
], this.wonBlocksSubject.getValue().map(wonBlock => {
const farmerRewardAmount = this.getFarmerRewardAmount(wonBlock)
const farmerRewardAmountFiatHold = this.ratesService.getFiatAmount(farmerRewardAmount)
const farmerRewardAmountFiatSold = this.ratesService.getHistoricalFiatAmount(farmerRewardAmount, wonBlock.historicalRate)
const farmerRewardAmountFiatNow = this.ratesService.getFiatAmount(farmerRewardAmount)
const farmerRewardAmountFiatAtReceipt = this.ratesService.getHistoricalFiatAmount(farmerRewardAmount, wonBlock.historicalRate)

return [
moment(wonBlock.createdAt).format('YYYY-MM-DD HH:mm'),
wonBlock.height,
wonBlock.hash,
wonBlock.effort,
farmerRewardAmount?.toString(),
farmerRewardAmountFiatHold?.toString(),
farmerRewardAmountFiatSold?.toString(),
farmerRewardAmountFiatNow?.toString(),
farmerRewardAmountFiatAtReceipt?.toString(),
wonBlock.remarks.map(remark => remark.type).join(', '),
]
}))
Expand Down

0 comments on commit 5c7ffcf

Please sign in to comment.