@exodus/ethereum-lib 5.8.3 → 5.9.1
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 +20 -0
- package/package.json +2 -2
- package/src/get-activity-txs.js +25 -0
- package/src/index.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,26 @@
|
|
|
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
|
+
## [5.9.1](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-lib@5.9.0...@exodus/ethereum-lib@5.9.1) (2025-02-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* fix: ETH activity txs field (#4915)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [5.9.0](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-lib@5.8.3...@exodus/ethereum-lib@5.9.0) (2025-01-22)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
* feat: add activity txs for ethereum (#4875)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
6
26
|
## [5.8.3](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-lib@5.8.2...@exodus/ethereum-lib@5.8.3) (2025-01-09)
|
|
7
27
|
|
|
8
28
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-lib",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.9.1",
|
|
4
4
|
"description": "Ethereum utils, such as for cryptography, address encoding/decoding, transaction building, etc.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"type": "git",
|
|
52
52
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "cf57971cbd487f158f73bc72597a5ddf20c7b36c"
|
|
55
55
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export const getActivityTxs = ({ txs, asset }) => {
|
|
2
|
+
return txs.flatMap((tx) => {
|
|
3
|
+
const { claim, rewards } = tx.data
|
|
4
|
+
const txs = []
|
|
5
|
+
if (claim) {
|
|
6
|
+
const claimAmount = asset.currency.defaultUnit(claim)
|
|
7
|
+
txs.push({
|
|
8
|
+
...tx,
|
|
9
|
+
data: { claim, meta: 'derivedFromGetActivityTxs' },
|
|
10
|
+
coinAmount: claimAmount,
|
|
11
|
+
})
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (rewards) {
|
|
15
|
+
const rewardAmount = asset.currency.defaultUnit(rewards)
|
|
16
|
+
txs.push({
|
|
17
|
+
...tx,
|
|
18
|
+
data: { rewards, meta: 'derivedFromGetActivityTxs' },
|
|
19
|
+
coinAmount: rewardAmount,
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return txs.length > 0 ? txs : [tx]
|
|
24
|
+
})
|
|
25
|
+
}
|
package/src/index.js
CHANGED
|
@@ -10,3 +10,4 @@ export { default as createEthereumLikeAccountState } from './account-state/index
|
|
|
10
10
|
export { default as createContract } from './create-contract/index.js'
|
|
11
11
|
export { default as ABI } from './abi/index.js'
|
|
12
12
|
export { ethStakeAccountState } from './account-state/staking-data.js'
|
|
13
|
+
export { getActivityTxs } from './get-activity-txs.js'
|