@exodus/activity-txs 4.2.1 → 4.3.0
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
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
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
|
+
## [4.3.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/activity-txs@4.2.2...@exodus/activity-txs@4.3.0) (2024-06-13)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- optional personal notes for activity ([#7377](https://github.com/ExodusMovement/exodus-hydra/issues/7377)) ([092f07d](https://github.com/ExodusMovement/exodus-hydra/commit/092f07d5d18c1afc2933672af77edd0c5bac98a5))
|
|
11
|
+
|
|
12
|
+
## [4.2.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/activity-txs@4.2.1...@exodus/activity-txs@4.2.2) (2024-06-11)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- activity should support limit prop ([#7330](https://github.com/ExodusMovement/exodus-hydra/issues/7330)) ([687c7d5](https://github.com/ExodusMovement/exodus-hydra/commit/687c7d550d5aaef94f6e29b374944be361197622))
|
|
17
|
+
|
|
6
18
|
## [4.2.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/activity-txs@4.2.0...@exodus/activity-txs@4.2.1) (2024-05-30)
|
|
7
19
|
|
|
8
20
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/activity-txs",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"description": "The activity-txs feature",
|
|
5
5
|
"author": "Exodus Movement, Inc.",
|
|
6
6
|
"repository": {
|
|
@@ -44,16 +44,16 @@
|
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@exodus/assets": "^8.0.95",
|
|
46
46
|
"@exodus/assets-base": "^8.1.10",
|
|
47
|
-
"@exodus/assets-feature": "^5.
|
|
47
|
+
"@exodus/assets-feature": "^5.5.0",
|
|
48
48
|
"@exodus/available-assets": "^8.2.1",
|
|
49
49
|
"@exodus/bitcoin-plugin": "^1.4.2",
|
|
50
|
-
"@exodus/blockchain-metadata": "^15.3.
|
|
50
|
+
"@exodus/blockchain-metadata": "^15.3.3",
|
|
51
51
|
"@exodus/connected-origins": "^3.3.1",
|
|
52
52
|
"@exodus/dependency-injection": "^2.2.0",
|
|
53
|
-
"@exodus/dependency-preprocessors": "^5.
|
|
54
|
-
"@exodus/fiat-ramp": "^10.7.
|
|
53
|
+
"@exodus/dependency-preprocessors": "^5.3.0",
|
|
54
|
+
"@exodus/fiat-ramp": "^10.7.3",
|
|
55
55
|
"@exodus/nfts": "^9.3.0",
|
|
56
|
-
"@exodus/orders": "^4.
|
|
56
|
+
"@exodus/orders": "^4.10.0",
|
|
57
57
|
"@exodus/personal-notes": "^3.6.0",
|
|
58
58
|
"@exodus/redux-dependency-injection": "^3.1.0",
|
|
59
59
|
"@exodus/storage-memory": "^2.1.1",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"@types/minimalistic-assert": "^1.0.1",
|
|
62
62
|
"redux": "^4.2.1"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "e48b5ae7629605f47435335c08af8c1b7a7db68a"
|
|
65
65
|
}
|
|
@@ -47,11 +47,17 @@ const createAssetSourceBaseActivitySelectorDefinition = {
|
|
|
47
47
|
getPersonalNoteByTxIdSelector
|
|
48
48
|
) =>
|
|
49
49
|
memoize(
|
|
50
|
-
({ assetName, walletAccount }) =>
|
|
51
|
-
|
|
50
|
+
({ assetName, walletAccount, ...rest }) => {
|
|
51
|
+
const batchedTxsSelector = createBatchedAssetSourceSelector({
|
|
52
|
+
assetName,
|
|
53
|
+
walletAccount,
|
|
54
|
+
...rest,
|
|
55
|
+
})
|
|
56
|
+
const orderSelector = createOrdersInAccountSelector(walletAccount)
|
|
57
|
+
return createSelector(
|
|
52
58
|
assetsSelector,
|
|
53
|
-
|
|
54
|
-
|
|
59
|
+
batchedTxsSelector,
|
|
60
|
+
orderSelector,
|
|
55
61
|
getPersonalNoteByTxIdSelector,
|
|
56
62
|
(assets, txs = EMPTY, orderSet, getPersonalNoteByTxId) => {
|
|
57
63
|
const activityResult = []
|
|
@@ -60,7 +66,9 @@ const createAssetSourceBaseActivitySelectorDefinition = {
|
|
|
60
66
|
|
|
61
67
|
for (const group of groupedTxs) {
|
|
62
68
|
const { tx, order, type: formatterType } = group
|
|
63
|
-
const personalNote = getPersonalNoteByTxId
|
|
69
|
+
const personalNote = getPersonalNoteByTxId
|
|
70
|
+
? getPersonalNoteByTxId(tx.txId)
|
|
71
|
+
: undefined
|
|
64
72
|
const formattedTx = formattersByType.get(formatterType)({
|
|
65
73
|
asset: assets[tx.coinName],
|
|
66
74
|
order,
|
|
@@ -93,14 +101,16 @@ const createAssetSourceBaseActivitySelectorDefinition = {
|
|
|
93
101
|
|
|
94
102
|
return activityResult.sort((a, b) => b.date.getTime() - a.date.getTime())
|
|
95
103
|
}
|
|
96
|
-
)
|
|
97
|
-
|
|
104
|
+
)
|
|
105
|
+
},
|
|
106
|
+
({ assetName, walletAccount, ...rest }) =>
|
|
107
|
+
`${assetName}_${walletAccount}_${JSON.stringify(rest)}`
|
|
98
108
|
),
|
|
99
109
|
dependencies: [
|
|
100
110
|
{ module: 'assets', selector: 'all' },
|
|
101
111
|
{ selector: 'createBatchedAssetSourceSelector' },
|
|
102
112
|
{ module: 'orders', selector: 'createOrdersInAccount' },
|
|
103
|
-
{ module: 'personalNotes', selector: 'get' },
|
|
113
|
+
{ module: 'personalNotes', selector: 'get', optional: true },
|
|
104
114
|
],
|
|
105
115
|
}
|
|
106
116
|
|
|
@@ -14,13 +14,13 @@ const collapseBatch = ({ batch, assets }) => {
|
|
|
14
14
|
(sum, otherTx) => (otherTx.feeAmount ? sum.add(otherTx.feeAmount) : sum),
|
|
15
15
|
(isToken ? asset.baseAsset : asset).currency.ZERO
|
|
16
16
|
)
|
|
17
|
-
const baseData = batch[0].data ||
|
|
17
|
+
const baseData = batch[0].data || Object.create(null)
|
|
18
18
|
const batchedIds = batch.map((tx) => tx.txId)
|
|
19
19
|
|
|
20
20
|
const txJSON = batch[0].toJSON()
|
|
21
21
|
|
|
22
22
|
return Tx.fromJSON(
|
|
23
|
-
merge(
|
|
23
|
+
merge(Object.create(null), txJSON, {
|
|
24
24
|
coinAmount: totalBatchValue,
|
|
25
25
|
coinName: asset.name,
|
|
26
26
|
feeAmount: totalBatchFee,
|
|
@@ -50,7 +50,7 @@ const createBatchedAssetSourceSelectorDefinition = {
|
|
|
50
50
|
id: 'createBatchedAssetSourceSelector',
|
|
51
51
|
dependencies: [
|
|
52
52
|
{ selector: 'createLimitedAssetSourceSelector' },
|
|
53
|
-
{ module: 'personalNotes', selector: 'withBatchId' },
|
|
53
|
+
{ module: 'personalNotes', selector: 'withBatchId', optional: true },
|
|
54
54
|
{ module: 'assets', selector: 'all' },
|
|
55
55
|
],
|
|
56
56
|
selectorFactory: (
|
|
@@ -60,16 +60,18 @@ const createBatchedAssetSourceSelectorDefinition = {
|
|
|
60
60
|
) =>
|
|
61
61
|
memoize(
|
|
62
62
|
({ assetName, walletAccount, limit }) =>
|
|
63
|
-
|
|
64
|
-
createLimitedAssetSourceSelector({ assetName, walletAccount, limit })
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
63
|
+
personalNotesWithBatchIdSelector.isFallback
|
|
64
|
+
? createLimitedAssetSourceSelector({ assetName, walletAccount, limit })
|
|
65
|
+
: createSelector(
|
|
66
|
+
createLimitedAssetSourceSelector({ assetName, walletAccount, limit }),
|
|
67
|
+
personalNotesWithBatchIdSelector,
|
|
68
|
+
assetsSelector,
|
|
69
|
+
(txs, personalNotesWithBatchId, assets) => {
|
|
70
|
+
return personalNotesWithBatchId.size > 0
|
|
71
|
+
? groupAndCollapseBatched({ txs, personalNotesWithBatchId, assets })
|
|
72
|
+
: txs
|
|
73
|
+
}
|
|
74
|
+
),
|
|
73
75
|
({ assetName, walletAccount, limit }) => `${assetName}_${walletAccount}_${limit}`
|
|
74
76
|
),
|
|
75
77
|
}
|