@exodus/ethereum-api 6.3.13 → 6.3.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/ethereum-api",
3
- "version": "6.3.13",
3
+ "version": "6.3.15",
4
4
  "description": "Ethereum Api",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -16,7 +16,7 @@
16
16
  "dependencies": {
17
17
  "@exodus/asset-lib": "^3.7.1",
18
18
  "@exodus/crypto": "^1.0.0-rc.0",
19
- "@exodus/ethereum-lib": "^3.3.32",
19
+ "@exodus/ethereum-lib": "^3.3.33",
20
20
  "@exodus/ethereumjs-util": "^7.1.0-exodus.6",
21
21
  "@exodus/fetch": "^1.3.0-beta.4",
22
22
  "@exodus/simple-retry": "^0.0.6",
@@ -34,5 +34,5 @@
34
34
  "devDependencies": {
35
35
  "@exodus/models": "^8.10.4"
36
36
  },
37
- "gitHead": "3bda147deb846bf356029d43654cee5bb4f78254"
37
+ "gitHead": "f3e3f031b8de37e0540523227469c0991d90c8b3"
38
38
  }
@@ -1,12 +1,6 @@
1
1
  import { EthereumStaking } from './ethereum-staking'
2
2
 
3
- // stake(uint256 source)
4
- const DELEGATE = '0x3a29dbae'
5
- // unstakePending(uint256 amount)
6
- const UNSTAKE_PENDING = '0xed0723d4'
7
-
8
- // unstake(uint256 amount)
9
- const UNSTAKE = '0x215f826b'
3
+ const { DELEGATE, UNSTAKE, UNSTAKE_PENDING } = EthereumStaking.METHODS_IDS
10
4
 
11
5
  const STAKING_MANAGER_CONTRACTS = [
12
6
  EthereumStaking.addresses.ethereum.EVERSTAKE_ADDRESS_CONTRACT_POOL.toLowerCase(),
@@ -21,6 +15,4 @@ export const isEthereumDelegate = (tx) =>
21
15
  tx.data?.methodId === DELEGATE
22
16
  export const isEthereumUndelegate = (tx) => isEthereumStakingTx(tx) && tx.data?.methodId === UNSTAKE
23
17
  export const isEthereumClaimUndelegate = (tx) =>
24
- isEthereumStakingTx(tx) &&
25
- STAKING_MANAGER_CONTRACTS.includes(tx.from[0]) &&
26
- tx.data?.methodId === UNSTAKE_PENDING
18
+ isEthereumStakingTx(tx) && tx.data?.methodId === UNSTAKE_PENDING
@@ -17,6 +17,11 @@ export class EthereumStaking {
17
17
  EVERSTAKE_ADDRESS_CONTRACT_POOL: '0x1F28aD3B3e26192a09c1248D4092c692c32f8Ec0',
18
18
  },
19
19
  }
20
+ static METHODS_IDS = {
21
+ DELEGATE: '0x3a29dbae', // stake(uint256 source)
22
+ UNSTAKE: '0x215f826b', // unstake(uint256 amount)
23
+ UNSTAKE_PENDING: '0x33986ffa', // unstakePending(uint256 amount)
24
+ }
20
25
 
21
26
  constructor(
22
27
  asset, // ethereum or ethereumgoerli for testnet
@@ -29,7 +29,7 @@ export default function getLogItemsFromServerTx({
29
29
  const ourWalletWasSender = serverTx.from === ourWalletAddress
30
30
  const METHOD_ID_LENGTH = 10
31
31
  const methodId = serverTx.data && { methodId: serverTx.data.substring(0, METHOD_ID_LENGTH) }
32
-
32
+ const data = serverTx.data || '0x'
33
33
  const logItemCommonProperties = {
34
34
  confirmations,
35
35
  date,
@@ -60,7 +60,7 @@ export default function getLogItemsFromServerTx({
60
60
  coinAmount,
61
61
  coinName: asset.name,
62
62
  data: {
63
- data: serverTx.data || '0x',
63
+ data,
64
64
  nonce,
65
65
  gasLimit,
66
66
  ...methodId,
@@ -115,7 +115,7 @@ export default function getLogItemsFromServerTx({
115
115
  ...logItemCommonProperties,
116
116
  coinAmount,
117
117
  coinName: tokenName,
118
- data: { nonce, gasLimit, ...methodId },
118
+ data: { data, nonce, gasLimit, ...methodId },
119
119
  ...(isConsideredSent
120
120
  ? { from: [], to: tokenTransferToAddress, feeAmount, feeCoinName: asset.feeAsset.name }
121
121
  : { from: tokenFromAddresses }),