diff options
| author | Adam Soltys <[email protected]> | 2024-02-23 21:32:37 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-02-23 21:32:37 -0800 |
| commit | f0e144cfe7b4a7a49e9533ffaa6c61000a19bd32 (patch) | |
| tree | cf6f31e97c741f2299f2c175d840018ba5dd1d8a | |
| parent | d5d15b1a9f89e7cf621faf96d11e2fd139037a54 (diff) | |
| download | coinos-server-f0e144cfe7b4a7a49e9533ffaa6c61000a19bd32.tar.gz coinos-server-f0e144cfe7b4a7a49e9533ffaa6c61000a19bd32.zip | |
tips total
| -rw-r--r-- | routes/payments.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/routes/payments.js b/routes/payments.js index 9891c661..9338b3a2 100644 --- a/routes/payments.js +++ b/routes/payments.js @@ -99,6 +99,11 @@ export default { (a, b) => ({ ...a, [b.currency]: { + tips: (a[b.currency] ? a[b.currency].tips : 0) + (b.tip || 0), + fiatTips: ( + parseFloat(a[b.currency] ? a[b.currency].fiatTips : 0) + + ((b.tip || 0) * b.rate) / SATS + ).toFixed(2), sats: (a[b.currency] ? a[b.currency].sats : 0) + (b.amount || 0) + |
