@exodus/activity-txs 4.6.4 → 4.7.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.7.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/activity-txs@4.6.5...@exodus/activity-txs@4.7.0) (2025-05-14)
7
+
8
+ ### Features
9
+
10
+ - feat: make activity-txs to proper ESM (#12451)
11
+
12
+ ## [4.6.5](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/activity-txs@4.6.4...@exodus/activity-txs@4.6.5) (2025-04-03)
13
+
14
+ ### Bug Fixes
15
+
16
+ - fix: filter out tx activities associated with a spam nft (#11950)
17
+
6
18
  ## [4.6.4](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/activity-txs@4.6.3...@exodus/activity-txs@4.6.4) (2025-02-12)
7
19
 
8
20
  ### Performance
@@ -1,6 +1,6 @@
1
1
  import { combine, compute } from '@exodus/atoms'
2
2
  import { createSelector } from 'reselect'
3
- import { createDeepEqualOutputSelector } from '@exodus/core-selectors/utils/deep-equal'
3
+ import { createDeepEqualOutputSelector } from '@exodus/core-selectors/utils/deep-equal.js'
4
4
  import { memoize } from '@exodus/basic-utils'
5
5
 
6
6
  const createAssetSourceActivityTxsSelector = memoize(
package/atoms/index.js CHANGED
@@ -1 +1 @@
1
- export { default as activityTxsAtomDefinition } from './activity-txs'
1
+ export { default as activityTxsAtomDefinition } from './activity-txs.js'
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { activityTxsAtomDefinition } from './atoms'
2
- import activityTxsPluginDefinition from './plugin'
1
+ import { activityTxsAtomDefinition } from './atoms/index.js'
2
+ import activityTxsPluginDefinition from './plugin/index.js'
3
3
 
4
4
  const activityTxs = () => ({
5
5
  id: 'activityTxs',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/activity-txs",
3
- "version": "4.6.4",
3
+ "version": "4.7.0",
4
4
  "description": "The activity-txs feature",
5
5
  "author": "Exodus Movement, Inc.",
6
6
  "repository": {
@@ -12,6 +12,7 @@
12
12
  "bugs": {
13
13
  "url": "https://github.com/ExodusMovement/exodus-hydra/issues?q=is%3Aissue+is%3Aopen+label%3Aactivity-txs"
14
14
  },
15
+ "type": "module",
15
16
  "main": "index.js",
16
17
  "files": [
17
18
  "api",
@@ -28,12 +29,12 @@
28
29
  "scripts": {
29
30
  "lint": "run -T eslint -c ../../eslint.config.mjs",
30
31
  "lint:fix": "yarn lint --fix",
31
- "test": "run -T exodus-test --jest --esbuild"
32
+ "test": "run -T exodus-test --jest"
32
33
  },
33
34
  "dependencies": {
34
35
  "@exodus/atoms": "^9.0.0",
35
36
  "@exodus/basic-utils": "^3.0.1",
36
- "@exodus/core-selectors": "^1.5.0",
37
+ "@exodus/core-selectors": "^4.0.0",
37
38
  "@exodus/models": "^12.0.1",
38
39
  "@exodus/multi-account-redux": "^2.0.1",
39
40
  "@exodus/typeforce": "^1.19.0",
@@ -42,25 +43,25 @@
42
43
  "reselect": "^3.0.1"
43
44
  },
44
45
  "devDependencies": {
45
- "@exodus/assets": "^8.0.95",
46
- "@exodus/assets-base": "^8.1.10",
47
- "@exodus/assets-feature": "^6.1.0",
46
+ "@exodus/assets": "^11.0.0",
47
+ "@exodus/assets-base": "^10.0.0",
48
+ "@exodus/assets-feature": "^7.4.0",
48
49
  "@exodus/available-assets": "^8.7.0",
49
50
  "@exodus/bitcoin-plugin": "^1.4.2",
50
- "@exodus/connected-origins": "^4.1.1",
51
- "@exodus/error-tracking": "^1.3.1",
52
- "@exodus/fiat-ramp": "^12.2.0",
51
+ "@exodus/connected-origins": "^4.3.0",
52
+ "@exodus/error-tracking": "^2.0.0",
53
+ "@exodus/fiat-ramp": "^12.8.0",
53
54
  "@exodus/logger": "^1.2.3",
54
- "@exodus/nfts": "^9.5.0",
55
- "@exodus/orders": "^4.15.0",
56
- "@exodus/personal-notes": "^3.7.0",
55
+ "@exodus/nfts": "^9.5.1",
56
+ "@exodus/orders": "^5.1.0",
57
+ "@exodus/personal-notes": "^3.8.0",
57
58
  "@exodus/redux-dependency-injection": "^4.1.1",
58
- "@exodus/wallet-accounts": "^17.3.0",
59
+ "@exodus/wallet-accounts": "^17.5.2",
59
60
  "@types/minimalistic-assert": "^1.0.1",
60
61
  "redux": "^4.2.1"
61
62
  },
62
63
  "publishConfig": {
63
64
  "access": "public"
64
65
  },
65
- "gitHead": "16fb1f9330a353da411f5023911cf60075ab0a54"
66
+ "gitHead": "17d1ef8aaa53945779cb0099a0e4d55ceeb59afc"
66
67
  }
package/redux/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import id from './id'
2
- import initialState from './initial-state'
3
- import selectorDefinitions from './selectors'
4
- import helper from './multi-account-helper'
5
- import { setAccounts } from '@exodus/multi-account-redux/src/common'
1
+ import id from './id.js'
2
+ import initialState from './initial-state.js'
3
+ import selectorDefinitions from './selectors/index.js'
4
+ import helper from './multi-account-helper.js'
5
+ import { setAccounts } from '@exodus/multi-account-redux/src/common.js'
6
6
 
7
7
  const activityTxsReduxDefinition = {
8
8
  id,
@@ -1,4 +1,4 @@
1
- import helper from './multi-account-helper'
1
+ import helper from './multi-account-helper.js'
2
2
 
3
3
  const initialState = helper.createInitialState()
4
4
 
@@ -1,7 +1,7 @@
1
1
  import { createSelector } from 'reselect'
2
2
  import { memoize } from '@exodus/basic-utils'
3
- import { formattersByType } from '../utils/activity-formatters'
4
- import { formatUnindexedOrder } from '../utils/activity-formatters/format-swap-activity'
3
+ import { formattersByType } from '../utils/activity-formatters/index.js'
4
+ import { formatUnindexedOrder } from '../utils/activity-formatters/format-swap-activity.js'
5
5
 
6
6
  const EMPTY = Object.freeze([])
7
7
 
@@ -1,8 +1,10 @@
1
- import { get, groupBy, merge } from 'lodash'
1
+ import lodash from 'lodash'
2
2
  import { createSelector } from 'reselect'
3
3
  import { Tx } from '@exodus/models'
4
4
  import { memoize } from '@exodus/basic-utils'
5
5
 
6
+ const { get, groupBy, merge } = lodash
7
+
6
8
  // TODO: Remove in the future.
7
9
  // Batch swapping transactions using personal notes is no longer needed.
8
10
  // Now, we write the `order.txsIds` array, which contains information about setup, swap transactions, and more.
@@ -1,7 +1,9 @@
1
1
  import { memoize } from '@exodus/basic-utils'
2
2
  import { createSelector } from 'reselect'
3
3
  import assert from 'minimalistic-assert'
4
- import { uniqBy } from 'lodash'
4
+ import lodash from 'lodash'
5
+
6
+ const { uniqBy } = lodash
5
7
 
6
8
  const selectorFactory =
7
9
  () =>
@@ -1,7 +1,7 @@
1
1
  import { memoize } from '@exodus/basic-utils'
2
2
  import { createSelector } from 'reselect'
3
3
  import assert from 'minimalistic-assert'
4
- import { TX_TYPES } from '../constants/tx-types'
4
+ import { TX_TYPES } from '../constants/tx-types.js'
5
5
 
6
6
  const selectorFactory =
7
7
  (visibleOrdersSelector, assetsSelector) =>
@@ -1,10 +1,10 @@
1
1
  import { memoize } from '@exodus/basic-utils'
2
2
  import { createSelector } from 'reselect'
3
3
  import assert from 'minimalistic-assert'
4
- import { formatNftTx, formatUnindexedNftTx } from '../utils/activity-formatters/format-nft'
4
+ import { formatNftTx, formatUnindexedNftTx } from '../utils/activity-formatters/format-nft.js'
5
5
 
6
6
  const selectorFactory =
7
- (createAssetSourceNftTxsById, assetsSelector) =>
7
+ (createAssetSourceNftTxsById, activeNftsSelector, assetsSelector) =>
8
8
  ({ createActivitySelector, nftsNetworkNameToAssetName }) => {
9
9
  assert(createActivitySelector, 'please provide activitySelector')
10
10
  assert(nftsNetworkNameToAssetName, 'please provide nftsNetworkNameToAssetName')
@@ -12,7 +12,7 @@ const selectorFactory =
12
12
  return memoize(
13
13
  ({ assetName, walletAccount, ...rest }) => {
14
14
  const activitySelector = createActivitySelector({ assetName, walletAccount, ...rest })
15
- if (createAssetSourceNftTxsById.isFallback) {
15
+ if (createAssetSourceNftTxsById.isFallback || activeNftsSelector.isFallback) {
16
16
  return activitySelector
17
17
  }
18
18
 
@@ -20,9 +20,17 @@ const selectorFactory =
20
20
  assert(nftsSelector, 'nfts redux feature must be installed to use this selector')
21
21
  return createSelector(
22
22
  nftsSelector,
23
+ activeNftsSelector,
23
24
  assetsSelector,
24
25
  activitySelector,
25
- (nftsByTxId, assets, activity) => {
26
+ (nftsByTxId, activeNfts, assets, activity) => {
27
+ const spamNftIdsSet = new Set(
28
+ Object.values(activeNfts)
29
+ .flat()
30
+ .filter((nft) => nft.isSpam)
31
+ .map(({ id }) => id && id.toLowerCase())
32
+ )
33
+
26
34
  const indexedNftTxIds = new Set()
27
35
  const resultActivity = []
28
36
  let hasChanges = false
@@ -30,28 +38,34 @@ const selectorFactory =
30
38
  const nft = nftsByTxId.get(activityItem.txId)
31
39
 
32
40
  if (nft) {
33
- hasChanges = true
34
- indexedNftTxIds.add(nft.txId)
35
- resultActivity.push(
36
- formatNftTx({
37
- ...activityItem,
38
- nft,
39
- asset: assets[activityItem.assetName],
40
- assetName: activityItem.assetName,
41
- })
42
- )
41
+ const nftIdLower = nft.nftId && nft.nftId.toLowerCase()
42
+ if (!nftIdLower || !spamNftIdsSet.has(nftIdLower)) {
43
+ hasChanges = true
44
+ indexedNftTxIds.add(nft.txId)
45
+ resultActivity.push(
46
+ formatNftTx({
47
+ ...activityItem,
48
+ nft,
49
+ asset: assets[activityItem.assetName],
50
+ assetName: activityItem.assetName,
51
+ })
52
+ )
53
+ }
43
54
  } else {
44
55
  resultActivity.push(activityItem)
45
56
  }
46
57
  }
47
58
 
48
59
  ;[...nftsByTxId.values()]
49
- .filter(
50
- (nftTx) =>
60
+ .filter((nftTx) => {
61
+ const nftIdLower = nftTx.nftId && nftTx.nftId.toLowerCase()
62
+ return (
51
63
  Object.hasOwn(nftsNetworkNameToAssetName, nftTx.network) &&
52
64
  assetName === nftsNetworkNameToAssetName[nftTx.network] &&
53
- !indexedNftTxIds.has(nftTx.txId)
54
- )
65
+ !indexedNftTxIds.has(nftTx.txId) &&
66
+ (!nftIdLower || !spamNftIdsSet.has(nftIdLower))
67
+ )
68
+ })
55
69
  .forEach((nftTx) => {
56
70
  hasChanges = true
57
71
  const assetName = nftsNetworkNameToAssetName[nftTx.network]
@@ -77,6 +91,7 @@ const createWithNftsActivitySelectorDefinition = {
77
91
  selectorFactory,
78
92
  dependencies: [
79
93
  { module: 'nfts', selector: 'createAssetSourceNftTxsById', optional: true },
94
+ { module: 'nfts', selector: 'activeNfts', optional: true },
80
95
  { module: 'assets', selector: 'all' },
81
96
  ],
82
97
  }
@@ -1,12 +1,12 @@
1
- import createLimitedAssetSourceSelectorDefinition from './create-limited-asset-source'
2
- import createBatchedAssetSourceSelector from './create-batched-asset-source'
3
- import createBatchedAssetSourceActivityByIdSelector from './create-batched-asset-source-by-id'
4
- import createAssetSourceBaseActivitySelectorDefinition from './create-asset-source-base-activity'
5
- import createWithNftsActivitySelectorDefinition from './create-with-nfts-activity'
6
- import createWithFiatActivitySelectorDefinition from './create-with-fiat-activity'
7
- import createWithConnectionsActivitySelectorDefinition from './create-with-connections-activity'
8
- import createFullActivitySelectorDefinition from './create-full-activity'
9
- import createMultiActivitySelectorDefinition from './create-multi-activity'
1
+ import createLimitedAssetSourceSelectorDefinition from './create-limited-asset-source.js'
2
+ import createBatchedAssetSourceSelector from './create-batched-asset-source.js'
3
+ import createBatchedAssetSourceActivityByIdSelector from './create-batched-asset-source-by-id.js'
4
+ import createAssetSourceBaseActivitySelectorDefinition from './create-asset-source-base-activity.js'
5
+ import createWithNftsActivitySelectorDefinition from './create-with-nfts-activity.js'
6
+ import createWithFiatActivitySelectorDefinition from './create-with-fiat-activity.js'
7
+ import createWithConnectionsActivitySelectorDefinition from './create-with-connections-activity.js'
8
+ import createFullActivitySelectorDefinition from './create-full-activity.js'
9
+ import createMultiActivitySelectorDefinition from './create-multi-activity.js'
10
10
 
11
11
  export default [
12
12
  createLimitedAssetSourceSelectorDefinition,
@@ -1,6 +1,6 @@
1
- import { getSharedProps } from './get-shared-props'
2
- import { TX_TYPES } from '../../constants/tx-types'
3
- import { isPending } from './format-tx-activity'
1
+ import { getSharedProps } from './get-shared-props.js'
2
+ import { TX_TYPES } from '../../constants/tx-types.js'
3
+ import { isPending } from './format-tx-activity.js'
4
4
 
5
5
  export const formatUnindexedNftTx = ({ assetName, nftTx }) => {
6
6
  return {
@@ -1,5 +1,5 @@
1
- import { getSharedProps } from './get-shared-props'
2
- import { TX_TYPES } from '../../constants/tx-types'
1
+ import { getSharedProps } from './get-shared-props.js'
2
+ import { TX_TYPES } from '../../constants/tx-types.js'
3
3
 
4
4
  const FINAL_ORDER_STATUS = {
5
5
  inProgress: 'in-progress',
@@ -1,5 +1,5 @@
1
- import { TX_TYPES } from '../../constants/tx-types'
2
- import { getSharedProps } from './get-shared-props'
1
+ import { TX_TYPES } from '../../constants/tx-types.js'
2
+ import { getSharedProps } from './get-shared-props.js'
3
3
 
4
4
  function getTxType({ tx }) {
5
5
  return tx.sent ? TX_TYPES.SENT : TX_TYPES.RECEIVED
@@ -1,5 +1,5 @@
1
- import { formatSwapActivity } from './format-swap-activity'
2
- import { formatTxActivity } from './format-tx-activity'
1
+ import { formatSwapActivity } from './format-swap-activity.js'
2
+ import { formatTxActivity } from './format-tx-activity.js'
3
3
 
4
4
  export const formattersByType = new Map([
5
5
  ['exchange', formatSwapActivity],