@exodus/ethereum-api 6.3.31 → 6.3.32
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.
|
|
3
|
+
"version": "6.3.32",
|
|
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": "^4.0.
|
|
19
|
+
"@exodus/ethereum-lib": "^4.0.1",
|
|
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": "
|
|
37
|
+
"gitHead": "8eb47087d7253d18f372baad9fbd8b4b42cb2f1a"
|
|
38
38
|
}
|
|
@@ -21,6 +21,7 @@ export class EthereumStaking {
|
|
|
21
21
|
DELEGATE: '0x3a29dbae', // stake(uint256 source)
|
|
22
22
|
UNSTAKE: '0x76ec871c', // unstake(uint256 amount)
|
|
23
23
|
UNSTAKE_PENDING: '0xed0723d4', // unstakePending(uint256 amount)
|
|
24
|
+
CLAIM_UNSTAKE: '0x33986ffa', // claimWithdrawRequest(uint256 amount)
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
constructor(
|
|
@@ -146,7 +146,9 @@ export function createEthereumStakingService({
|
|
|
146
146
|
let amount, data, fee
|
|
147
147
|
try {
|
|
148
148
|
;({ amount, data } = await delegateOperation(args))
|
|
149
|
-
|
|
149
|
+
const address =
|
|
150
|
+
operation === 'claimUndelegatedBalance' ? staking.accountingAddress : staking.poolAddress
|
|
151
|
+
;({ fee } = await estimateTxFee(delegatorAddress, address, amount, data))
|
|
150
152
|
} catch (e) {
|
|
151
153
|
// If the operation is to unstake and failed retry with unstakePending
|
|
152
154
|
if (operation === 'undelegate') {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EthereumStaking } from './api'
|
|
2
2
|
|
|
3
|
-
const { DELEGATE, UNSTAKE, UNSTAKE_PENDING } = EthereumStaking.METHODS_IDS
|
|
3
|
+
const { DELEGATE, UNSTAKE, UNSTAKE_PENDING, CLAIM_UNSTAKE } = EthereumStaking.METHODS_IDS
|
|
4
4
|
|
|
5
5
|
const STAKING_MANAGER_CONTRACTS = [
|
|
6
6
|
EthereumStaking.addresses.ethereum.EVERSTAKE_ADDRESS_CONTRACT_POOL.toLowerCase(),
|
|
@@ -13,6 +13,9 @@ export const isEthereumDelegate = (tx) =>
|
|
|
13
13
|
isEthereumStakingTx(tx) &&
|
|
14
14
|
STAKING_MANAGER_CONTRACTS.includes(tx.to) &&
|
|
15
15
|
tx.data?.methodId === DELEGATE
|
|
16
|
-
export const
|
|
17
|
-
export const isEthereumClaimUndelegate = (tx) =>
|
|
16
|
+
export const isEthereumUndelegatePending = (tx) =>
|
|
18
17
|
isEthereumStakingTx(tx) && tx.data?.methodId === UNSTAKE_PENDING
|
|
18
|
+
export const isEthereumUndelegate = (tx) =>
|
|
19
|
+
(isEthereumStakingTx(tx) && tx.data?.methodId === UNSTAKE) || isEthereumUndelegatePending(tx)
|
|
20
|
+
export const isEthereumClaimUndelegate = (tx) =>
|
|
21
|
+
isEthereumStakingTx(tx) && tx.data?.methodId === CLAIM_UNSTAKE
|