@exodus/activity-txs 4.4.3 → 4.6.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,22 @@
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.6.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/activity-txs@4.5.0...@exodus/activity-txs@4.6.0) (2025-01-28)
7
+
8
+ ### Features
9
+
10
+ - feat: add placeholder types files (#11228)
11
+
12
+ ### Bug Fixes
13
+
14
+ - fix: isolate getActivityTxs api call error (#11264)
15
+
16
+ ## [4.5.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/activity-txs@4.4.3...@exodus/activity-txs@4.5.0) (2025-01-15)
17
+
18
+ ### Features
19
+
20
+ - feat: add account to activity (#11090)
21
+
6
22
  ## [4.4.3](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/activity-txs@4.4.1...@exodus/activity-txs@4.4.3) (2025-01-05)
7
23
 
8
24
  ### Bug Fixes
package/README.md CHANGED
@@ -16,7 +16,7 @@ Additionally, it offers extra Redux selectors to retrieve activity, limited by s
16
16
 
17
17
  ## Usage
18
18
 
19
- This feature is designed to be used together with `@exodus/headless`. See [Using the SDK](../../docs/docs-website/docs/development/using-the-sdk.md) for more details.
19
+ This feature is designed to be used together with `@exodus/headless`. See [Using the SDK](../../docs/development/using-the-sdk.md) for more details.
20
20
 
21
21
  ### API Side
22
22
 
@@ -49,7 +49,7 @@ selectors.activityTxs.createMultiActivity({
49
49
 
50
50
  ### UI Side
51
51
 
52
- See [using the sdk](../../docs/docs-website/docs/development/using-the-sdk.md#events) for more details on basic UI-side setup.
52
+ See [using the sdk](../../docs/development/using-the-sdk.md#events) for more details on basic UI-side setup.
53
53
 
54
54
  ```js
55
55
  import selectors from '~/ui/flux/selectors'
@@ -1,7 +1,7 @@
1
1
  import { combine, compute } from '@exodus/atoms'
2
2
  import { createSelector } from 'reselect'
3
- import { memoize } from 'lodash' // eslint-disable-line @exodus/restricted-imports/prefer-basic-utils -- TODO: fix next time we touch this file
4
3
  import { createDeepEqualOutputSelector } from '@exodus/core-selectors/utils/deep-equal'
4
+ import { memoize } from '@exodus/basic-utils'
5
5
 
6
6
  const createAssetSourceActivityTxsSelector = memoize(
7
7
  ({ assetName, walletAccount }) =>
@@ -85,7 +85,13 @@ const areActivitiesEqual = (obj1 = {}, obj2 = {}) => {
85
85
  return true
86
86
  }
87
87
 
88
- const createActivityTxsAtom = ({ txLogsAtom, accountStatesAtom, assetsModule }) => {
88
+ const createActivityTxsAtom = ({
89
+ txLogsAtom,
90
+ accountStatesAtom,
91
+ assetsModule,
92
+ logger,
93
+ errorTracking,
94
+ }) => {
89
95
  const inputAtom = combine({
90
96
  txLogs: txLogsAtom,
91
97
  accountStates: accountStatesAtom,
@@ -132,13 +138,19 @@ const createActivityTxsAtom = ({ txLogsAtom, accountStatesAtom, assetsModule })
132
138
  walletAccount,
133
139
  })
134
140
 
135
- const activityTxs = await getActivityForAssetSource({
136
- asset,
137
- txs,
138
- activityOptions,
139
- })
141
+ try {
142
+ const activityTxs = await getActivityForAssetSource({
143
+ asset,
144
+ txs,
145
+ activityOptions,
146
+ })
140
147
 
141
- return [assetName, activityTxs]
148
+ return [assetName, activityTxs]
149
+ } catch (e) {
150
+ errorTracking.track({ error: e, namespace: 'activityTxs', context: { assetName } })
151
+ logger.warn(`failed to get activity txs for asset: ${assetName}`, e)
152
+ return [assetName, []]
153
+ }
142
154
  }
143
155
 
144
156
  const txs = createAssetSourceTxsSelector({ assetName, walletAccount })({
@@ -174,7 +186,7 @@ const activityTxsAtomDefinition = {
174
186
  id: 'activityTxsAtom',
175
187
  type: 'atom',
176
188
  factory: createActivityTxsAtom,
177
- dependencies: ['txLogsAtom', 'accountStatesAtom', 'assetsModule'],
189
+ dependencies: ['txLogsAtom', 'accountStatesAtom', 'assetsModule', 'logger', 'errorTracking'],
178
190
  public: true,
179
191
  }
180
192
 
package/index.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ declare const activityTxs: () => {
2
+ id: 'activityTxs'
3
+ definitions: []
4
+ }
5
+
6
+ export default activityTxs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/activity-txs",
3
- "version": "4.4.3",
3
+ "version": "4.6.0",
4
4
  "description": "The activity-txs feature",
5
5
  "author": "Exodus Movement, Inc.",
6
6
  "repository": {
@@ -14,13 +14,14 @@
14
14
  },
15
15
  "main": "index.js",
16
16
  "files": [
17
- "module",
18
- "atoms",
19
17
  "api",
18
+ "atoms",
19
+ "module",
20
20
  "plugin",
21
21
  "redux",
22
- "README.md",
22
+ "index.d.ts",
23
23
  "CHANGELOG.md",
24
+ "README.md",
24
25
  "!**/__tests__/**",
25
26
  "!**/*.test.js"
26
27
  ],
@@ -43,14 +44,15 @@
43
44
  "devDependencies": {
44
45
  "@exodus/assets": "^8.0.95",
45
46
  "@exodus/assets-base": "^8.1.10",
46
- "@exodus/assets-feature": "^6.0.1",
47
+ "@exodus/assets-feature": "^6.0.4",
47
48
  "@exodus/available-assets": "^8.7.0",
48
49
  "@exodus/bitcoin-plugin": "^1.4.2",
49
50
  "@exodus/connected-origins": "^4.1.1",
50
- "@exodus/fiat-ramp": "^11.0.1",
51
+ "@exodus/error-tracking": "^1.3.1",
52
+ "@exodus/fiat-ramp": "^12.0.0",
51
53
  "@exodus/logger": "^1.2.3",
52
54
  "@exodus/nfts": "^9.4.2",
53
- "@exodus/orders": "^4.13.0",
55
+ "@exodus/orders": "^4.15.0",
54
56
  "@exodus/personal-notes": "^3.7.0",
55
57
  "@exodus/redux-dependency-injection": "^4.1.1",
56
58
  "@exodus/wallet-accounts": "^17.1.3",
@@ -60,5 +62,5 @@
60
62
  "publishConfig": {
61
63
  "access": "public"
62
64
  },
63
- "gitHead": "901c220173a58839ad07917f573fe0752d4bbd70"
65
+ "gitHead": "210a89e8e00a4c1837680d7f54d9611cb1b32ba8"
64
66
  }
@@ -83,7 +83,7 @@ const createAssetSourceBaseActivitySelectorDefinition = {
83
83
  personalNote,
84
84
  })
85
85
 
86
- activityResult.push(formattedTx)
86
+ activityResult.push({ ...formattedTx, walletAccount })
87
87
  }
88
88
  }
89
89
 
@@ -101,9 +101,10 @@ const createAssetSourceBaseActivitySelectorDefinition = {
101
101
  // Prevent dups by checking if this order already exists.
102
102
  if (orderIdsFromActivity.has(order.orderId)) return
103
103
 
104
- const formattedItem = formatUnindexedOrder({ assetName, assets, order })
105
-
106
- activityResult.push(formattedItem)
104
+ activityResult.push({
105
+ ...formatUnindexedOrder({ assetName, assets, order }),
106
+ walletAccount,
107
+ })
107
108
  })
108
109
  }
109
110
 
@@ -1,4 +1,4 @@
1
- import { memoize } from 'lodash' // eslint-disable-line @exodus/restricted-imports/prefer-basic-utils -- TODO: fix next time we touch this file
1
+ import { memoize } from '@exodus/basic-utils'
2
2
  import { createSelector } from 'reselect'
3
3
 
4
4
  const createBatchedAssetSourceActivityByIdSelector = {
@@ -1,7 +1,13 @@
1
- import { memoize, get, groupBy, merge } from 'lodash' // eslint-disable-line @exodus/restricted-imports/prefer-basic-utils -- TODO: fix next time we touch this file
1
+ import { get, groupBy, merge } from 'lodash'
2
2
  import { createSelector } from 'reselect'
3
3
  import { Tx } from '@exodus/models'
4
+ import { memoize } from '@exodus/basic-utils'
4
5
 
6
+ // TODO: Remove in the future.
7
+ // Batch swapping transactions using personal notes is no longer needed.
8
+ // Now, we write the `order.txsIds` array, which contains information about setup, swap transactions, and more.
9
+ // An order can be matched using any transaction ID from this array.
10
+ // Each transaction will match the order, but we can deduplicate them later using `order.id` to display single activity item
5
11
  const collapseBatch = ({ batch, assets }) => {
6
12
  const asset = assets[batch[0].coinName]
7
13
  const isToken = asset.baseAsset.name !== asset.name
@@ -1,4 +1,4 @@
1
- import { memoize } from 'lodash' // eslint-disable-line @exodus/restricted-imports/prefer-basic-utils -- TODO: fix next time we touch this file
1
+ import { memoize } from '@exodus/basic-utils'
2
2
  import { createSelector } from 'reselect'
3
3
 
4
4
  const createLimitedAssetSourceSelectorDefinition = {