@exodus/ethereum-api 6.3.27 → 6.3.28
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/LICENSE.md
ADDED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-api",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.28",
|
|
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.
|
|
19
|
+
"@exodus/ethereum-lib": "^3.3.42",
|
|
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",
|
|
@@ -33,5 +33,6 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@exodus/models": "^8.10.4"
|
|
36
|
-
}
|
|
36
|
+
},
|
|
37
|
+
"gitHead": "3fc086590556bba9bfb369986d8e6c550af790df"
|
|
37
38
|
}
|
|
@@ -142,9 +142,10 @@ export class EthereumStaking {
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
+
/* Unstake funds that are staked into the validator. Once unstaked they need to be claimed (once ready to withdraw) */
|
|
145
146
|
async unstake({ address, amount, allowedInterchangeNum = 0, source = '2' }) {
|
|
146
147
|
const amountWei = amount.toBaseString()
|
|
147
|
-
const balance = await this.autocompoundBalanceOf(address)
|
|
148
|
+
const balance = await this.autocompoundBalanceOf(address) // amount staked into the validator (active balance)
|
|
148
149
|
|
|
149
150
|
if (balance.gte(amount)) {
|
|
150
151
|
return {
|
|
@@ -12,6 +12,7 @@ export const stakingProviderClientFactory = (defaultStakingUrl = DEFAULT_STAKING
|
|
|
12
12
|
|
|
13
13
|
const assetValidators = {
|
|
14
14
|
polygon: '0x3f4ce357b9d61d3b904492b8b5abc69c6c693720',
|
|
15
|
+
ethereum: '0xd523794c879d9ec028960a231f866758e405be34',
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
const setStakingUrl = (newStakingUrl) => {
|
|
@@ -26,21 +27,21 @@ export const stakingProviderClientFactory = (defaultStakingUrl = DEFAULT_STAKING
|
|
|
26
27
|
|
|
27
28
|
const notifyActionFactory = ({ type }) => {
|
|
28
29
|
assert(type, '"type" is required')
|
|
29
|
-
return async ({ asset, txId, delegator, amount, error }) => {
|
|
30
|
-
assert(
|
|
31
|
-
assert(assetValidators[
|
|
30
|
+
return async ({ asset: assetName, txId, delegator, amount, error }) => {
|
|
31
|
+
assert(assetName, '"asset" must be provided')
|
|
32
|
+
assert(assetValidators[assetName], '"invalid" asset')
|
|
32
33
|
assert(txId, '"txId" is required')
|
|
33
34
|
assert(delegator, '"delegator" is required')
|
|
34
35
|
assert(amount, '"amount" is required')
|
|
35
36
|
|
|
36
37
|
const stakingData = {
|
|
37
|
-
asset,
|
|
38
|
+
asset: assetName,
|
|
38
39
|
data: {
|
|
39
40
|
delegator,
|
|
40
41
|
actions: [
|
|
41
42
|
{
|
|
42
43
|
type,
|
|
43
|
-
validator: assetValidators[
|
|
44
|
+
validator: assetValidators[assetName],
|
|
44
45
|
amount,
|
|
45
46
|
txId,
|
|
46
47
|
},
|