@exodus/activity-txs
Advanced tools
Comparing version 3.2.1 to 4.0.0
@@ -11,9 +11,9 @@ import { combine, compute } from '@exodus/atoms' | ||
(args) => args.txs, | ||
(args) => args.baseAssetAccountState, | ||
(args) => args.activityOptions, | ||
(args) => args.asset, | ||
(txs, baseAssetAccountState, asset) => | ||
(txs, activityOptions, asset) => | ||
asset.api.getActivityTxs({ | ||
txs, | ||
asset, | ||
accountState: baseAssetAccountState, | ||
options: activityOptions, | ||
}) | ||
@@ -24,2 +24,15 @@ ), | ||
const createAssetSourceActivityOptionsSelector = memoize( | ||
({ assetName, walletAccount }) => | ||
createDeepEqualOutputSelector( | ||
(args) => args.accountState, | ||
(args) => args.asset, | ||
(accountState, asset) => | ||
asset.api.getActivityOptions({ | ||
accountState, | ||
}) | ||
), | ||
({ assetName, walletAccount }) => `${assetName}_${walletAccount}` | ||
) | ||
const createAssetSourceTxsSelector = memoize( | ||
@@ -100,2 +113,15 @@ ({ assetName, walletAccount }) => | ||
if (asset?.api?.getActivityTxs) { | ||
let activityOptions | ||
if (asset?.api?.getActivityOptions) { | ||
const baseAssetAccountState = accountStatesValue?.[walletAccount]?.[baseAssetName] | ||
activityOptions = createAssetSourceActivityOptionsSelector({ | ||
assetName, | ||
walletAccount, | ||
})({ | ||
accountState: baseAssetAccountState, | ||
asset, | ||
}) | ||
} | ||
return createAssetSourceActivityTxsSelector({ assetName, walletAccount })({ | ||
@@ -106,3 +132,3 @@ asset, | ||
}), | ||
baseAssetAccountState: accountStatesValue?.[walletAccount]?.[baseAssetName], | ||
activityOptions, | ||
}) | ||
@@ -109,0 +135,0 @@ } |
@@ -6,2 +6,12 @@ # Change Log | ||
## [4.0.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/activity-txs@3.2.1...@exodus/activity-txs@4.0.0) (2023-12-18) | ||
### ⚠ BREAKING CHANGES | ||
- pre-calc activity options (#5121) | ||
### Features | ||
- pre-calc activity options ([#5121](https://github.com/ExodusMovement/exodus-hydra/issues/5121)) ([cc3a906](https://github.com/ExodusMovement/exodus-hydra/commit/cc3a906e77b1f1c05d297efcb9aa0ba7eae6d5ca)) | ||
## [3.2.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/activity-txs@3.2.0...@exodus/activity-txs@3.2.1) (2023-12-18) | ||
@@ -8,0 +18,0 @@ |
{ | ||
"name": "@exodus/activity-txs", | ||
"version": "3.2.1", | ||
"version": "4.0.0", | ||
"description": "The activity-txs feature", | ||
@@ -58,3 +58,3 @@ "author": "Exodus Movement Inc.", | ||
}, | ||
"gitHead": "d59906035f7209f175274e5864fdc62a38b5a2fe" | ||
"gitHead": "182ee0ccc51c52b6dcbc0da97523ee9d0740aa0a" | ||
} |
16200
301