@exodus/ethereum-api 6.3.26 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/ethereum-api",
3
- "version": "6.3.26",
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.40",
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",
@@ -34,5 +34,5 @@
34
34
  "devDependencies": {
35
35
  "@exodus/models": "^8.10.4"
36
36
  },
37
- "gitHead": "f70a8210fbdda74fdd23542faf4f8f124c3a6b4f"
37
+ "gitHead": "3fc086590556bba9bfb369986d8e6c550af790df"
38
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(asset, '"asset" must be provided')
31
- assert(assetValidators[asset], '"invalid" asset')
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[asset],
44
+ validator: assetValidators[assetName],
44
45
  amount,
45
46
  txId,
46
47
  },