@exodus/activity-txs 6.1.1 → 6.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +12 -12
- package/redux/selectors/create-with-fiat-activity.js +56 -17
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [6.1.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/activity-txs@6.1.1...@exodus/activity-txs@6.1.2) (2026-05-08)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- fix(activity-txs): fiat order duplicates (#16369)
|
|
11
|
+
|
|
6
12
|
## [6.1.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/activity-txs@6.1.0...@exodus/activity-txs@6.1.1) (2026-03-24)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/activity-txs",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.2",
|
|
4
4
|
"description": "The activity-txs feature",
|
|
5
5
|
"author": "Exodus Movement, Inc.",
|
|
6
6
|
"repository": {
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"test": "run -T exodus-test --jest"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@exodus/atoms": "^
|
|
36
|
-
"@exodus/basic-utils": "^
|
|
35
|
+
"@exodus/atoms": "^10.3.3",
|
|
36
|
+
"@exodus/basic-utils": "^5.0.0",
|
|
37
37
|
"@exodus/core-selectors": "^4.0.0",
|
|
38
|
-
"@exodus/models": "^
|
|
38
|
+
"@exodus/models": "^13.0.0",
|
|
39
39
|
"@exodus/multi-account-redux": "^2.0.1",
|
|
40
40
|
"@exodus/safe-string": "^1.3.0",
|
|
41
41
|
"@exodus/typeforce": "^1.19.0",
|
|
@@ -45,19 +45,19 @@
|
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@exodus/assets": "^11.0.0",
|
|
48
|
-
"@exodus/assets-base": "^
|
|
49
|
-
"@exodus/assets-feature": "^9.
|
|
48
|
+
"@exodus/assets-base": "^12.0.0",
|
|
49
|
+
"@exodus/assets-feature": "^9.2.2",
|
|
50
50
|
"@exodus/available-assets": "^8.11.0",
|
|
51
51
|
"@exodus/bitcoin-plugin": "^2.0.0",
|
|
52
52
|
"@exodus/connected-origins": "^4.3.0",
|
|
53
|
-
"@exodus/error-tracking": "^3.
|
|
54
|
-
"@exodus/fiat-ramp": "^15.
|
|
53
|
+
"@exodus/error-tracking": "^3.4.0",
|
|
54
|
+
"@exodus/fiat-ramp": "^15.21.1",
|
|
55
55
|
"@exodus/logger": "^1.2.3",
|
|
56
56
|
"@exodus/nfts": "^9.6.2",
|
|
57
|
-
"@exodus/orders": "^6.
|
|
57
|
+
"@exodus/orders": "^6.1.3",
|
|
58
58
|
"@exodus/personal-notes": "^3.9.0",
|
|
59
|
-
"@exodus/redux-dependency-injection": "^4.
|
|
60
|
-
"@exodus/wallet-accounts": "^20.3
|
|
59
|
+
"@exodus/redux-dependency-injection": "^4.5.0",
|
|
60
|
+
"@exodus/wallet-accounts": "^20.4.3",
|
|
61
61
|
"@types/minimalistic-assert": "^1.0.1",
|
|
62
62
|
"redux": "^4.2.1"
|
|
63
63
|
},
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"access": "public",
|
|
66
66
|
"provenance": false
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "372a71f57099176bee974600b6ca683d60c3b6eb"
|
|
69
69
|
}
|
|
@@ -4,6 +4,45 @@ import assert from 'minimalistic-assert'
|
|
|
4
4
|
import { TX_TYPES } from '../constants/tx-types.js'
|
|
5
5
|
import { ORDER_STATUS, ORDER_TYPES } from '@exodus/models/lib/fiat-order/constants.js'
|
|
6
6
|
|
|
7
|
+
const ORDER_TX_MATCH_WINDOW_MS = 3 * 24 * 60 * 60 * 1000
|
|
8
|
+
|
|
9
|
+
const NON_MATCHABLE_ORDER_STATUSES = new Set([
|
|
10
|
+
ORDER_STATUS.failed,
|
|
11
|
+
ORDER_STATUS.refunded,
|
|
12
|
+
ORDER_STATUS.expired,
|
|
13
|
+
ORDER_STATUS.error,
|
|
14
|
+
])
|
|
15
|
+
|
|
16
|
+
const findMatchingOrderIndex = ({ activityItem, ordersWithoutTx }) => {
|
|
17
|
+
const coinAmount = activityItem.tx?.coinAmount
|
|
18
|
+
if (!coinAmount) {
|
|
19
|
+
return -1
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const txTime = activityItem.date?.getTime?.()
|
|
23
|
+
if (!Number.isFinite(txTime)) {
|
|
24
|
+
return -1
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const absAmount = coinAmount.abs()
|
|
28
|
+
|
|
29
|
+
return ordersWithoutTx.findIndex((order) => {
|
|
30
|
+
const isSell = order.orderType === ORDER_TYPES.sell
|
|
31
|
+
if (isSell !== activityItem.tx.sent) {
|
|
32
|
+
return false
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const orderAmount = isSell ? order.fromAmount : order.toAmount
|
|
36
|
+
if (!orderAmount || !absAmount.equals(orderAmount)) {
|
|
37
|
+
return false
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const orderTime = order.date?.getTime?.()
|
|
41
|
+
|
|
42
|
+
return Number.isFinite(orderTime) && Math.abs(txTime - orderTime) <= ORDER_TX_MATCH_WINDOW_MS
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
|
|
7
46
|
const selectorFactory =
|
|
8
47
|
(visibleOrdersSelector) =>
|
|
9
48
|
({ createActivitySelector }) => {
|
|
@@ -20,8 +59,8 @@ const selectorFactory =
|
|
|
20
59
|
}
|
|
21
60
|
|
|
22
61
|
let hasChanges = false
|
|
23
|
-
const pendingFiatOrdersWithoutTx = []
|
|
24
62
|
const fiatOrdersWithoutTx = []
|
|
63
|
+
const matchableOrdersWithoutTx = []
|
|
25
64
|
|
|
26
65
|
if (displayFiatOrdersWithoutTx) {
|
|
27
66
|
for (const order of fiatOrders) {
|
|
@@ -34,8 +73,8 @@ const selectorFactory =
|
|
|
34
73
|
|
|
35
74
|
if (isRelatedBuyOrder || isRelatedSellOrder) {
|
|
36
75
|
fiatOrdersWithoutTx.push(order)
|
|
37
|
-
if (order.exodusStatus
|
|
38
|
-
|
|
76
|
+
if (!NON_MATCHABLE_ORDER_STATUSES.has(order.exodusStatus)) {
|
|
77
|
+
matchableOrdersWithoutTx.push(order)
|
|
39
78
|
}
|
|
40
79
|
}
|
|
41
80
|
}
|
|
@@ -57,24 +96,24 @@ const selectorFactory =
|
|
|
57
96
|
type: TX_TYPES.FIAT,
|
|
58
97
|
})
|
|
59
98
|
}
|
|
60
|
-
} else {
|
|
61
|
-
if (activityItem.pending && pendingFiatOrdersWithoutTx.length > 0) {
|
|
62
|
-
const matchingOrderIndex = pendingFiatOrdersWithoutTx.findIndex((order) => {
|
|
63
|
-
const orderAmount =
|
|
64
|
-
order.orderType === ORDER_TYPES.sell ? order.fromAmount : order.toAmount
|
|
65
99
|
|
|
66
|
-
|
|
67
|
-
|
|
100
|
+
continue
|
|
101
|
+
}
|
|
68
102
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
103
|
+
if (matchableOrdersWithoutTx.length > 0) {
|
|
104
|
+
const matchingOrderIndex = findMatchingOrderIndex({
|
|
105
|
+
activityItem,
|
|
106
|
+
ordersWithoutTx: matchableOrdersWithoutTx,
|
|
107
|
+
})
|
|
75
108
|
|
|
76
|
-
|
|
109
|
+
if (matchingOrderIndex !== -1) {
|
|
110
|
+
matchableOrdersWithoutTx.splice(matchingOrderIndex, 1)
|
|
111
|
+
hasChanges = true
|
|
112
|
+
continue
|
|
113
|
+
}
|
|
77
114
|
}
|
|
115
|
+
|
|
116
|
+
resultActivity.push(activityItem)
|
|
78
117
|
}
|
|
79
118
|
|
|
80
119
|
for (const fiatOrder of fiatOrdersWithoutTx) {
|