@exodus/ethereum-plugin 1.2.0 → 2.0.0
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 +9 -6
- package/src/fee-data.js +21 -0
- package/src/index.js +6 -2
- package/src/staking.js +26 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Exodus ethereum-plugin",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -18,14 +18,17 @@
|
|
|
18
18
|
"lint:fix": "yarn lint --fix"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@exodus/
|
|
22
|
-
"@exodus/ethereum-
|
|
23
|
-
"@exodus/ethereum-
|
|
21
|
+
"@exodus/asset-lib": "^4.1.0",
|
|
22
|
+
"@exodus/ethereum-api": "^8.0.0",
|
|
23
|
+
"@exodus/ethereum-lib": "^5.0.0",
|
|
24
|
+
"@exodus/ethereum-meta": "^1.5.1"
|
|
24
25
|
},
|
|
25
26
|
"devDependencies": {
|
|
27
|
+
"@exodus/assets": "^9.1.1",
|
|
26
28
|
"@exodus/assets-testing": "^1.0.0",
|
|
27
29
|
"@exodus/ethereumjs-util": "^7.1.0-exodus.7",
|
|
28
|
-
"@exodus/fetch": "^1.3.0"
|
|
30
|
+
"@exodus/fetch": "^1.3.0",
|
|
31
|
+
"lodash": "^4.17.21"
|
|
29
32
|
},
|
|
30
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "a5992c8a158d486d6e95c03b17136b67ee06459c"
|
|
31
34
|
}
|
package/src/fee-data.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FeeData } from '@exodus/asset-lib'
|
|
2
|
+
import { asset } from '@exodus/ethereum-meta'
|
|
3
|
+
|
|
4
|
+
export default new FeeData({
|
|
5
|
+
config: {
|
|
6
|
+
gasPrice: '75 Gwei',
|
|
7
|
+
baseFeePerGas: '50 Gwei',
|
|
8
|
+
max: '250 Gwei',
|
|
9
|
+
min: '1 Gwei',
|
|
10
|
+
fuelThreshold: '0.025 ETH',
|
|
11
|
+
swapFee: '0.05 ETH',
|
|
12
|
+
gasPriceEconomicalRate: 0.7,
|
|
13
|
+
gasPriceMinimumRate: 0.5,
|
|
14
|
+
enableFeeDelegation: false,
|
|
15
|
+
tipGasPrice: '2 Gwei',
|
|
16
|
+
eip1559Enabled: true,
|
|
17
|
+
rbfEnabled: true,
|
|
18
|
+
},
|
|
19
|
+
mainKey: 'gasPrice',
|
|
20
|
+
currency: asset.currency,
|
|
21
|
+
})
|
package/src/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import assetsList from '@exodus/ethereum-meta'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
import { ethereum as feeData } from '@exodus/ethereum-lib/src/fee-data'
|
|
3
|
+
import feeData from './fee-data'
|
|
5
4
|
|
|
6
5
|
// Move EthereumFeeMonitor to ethereum-plugin or better replace with serverBasedFeeMonitorFactoryFactory
|
|
7
6
|
import { createAssetFactory } from '@exodus/ethereum-api'
|
|
7
|
+
import { stakingConfiguration } from './staking'
|
|
8
8
|
|
|
9
9
|
const createAsset = createAssetFactory({
|
|
10
10
|
assetsList,
|
|
@@ -13,6 +13,10 @@ const createAsset = createAssetFactory({
|
|
|
13
13
|
isMaxFeeAsset: true,
|
|
14
14
|
erc20FuelBuffer: 1.1, // 10% more than the required fee
|
|
15
15
|
fuelThreshold: '0.005',
|
|
16
|
+
stakingConfiguration,
|
|
17
|
+
serverUrl: 'https://geth.a.exodus.io/wallet/v1/',
|
|
18
|
+
confirmationsNumber: 30,
|
|
19
|
+
tokenType: 'ETHEREUM_ERC20',
|
|
16
20
|
})
|
|
17
21
|
|
|
18
22
|
const assetPlugin = { createAsset }
|
package/src/staking.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { asset, tokens } from '@exodus/ethereum-meta'
|
|
2
|
+
import { ethStakeAccountState } from '@exodus/ethereum-lib'
|
|
3
|
+
|
|
4
|
+
const polygon = tokens.find(({ name: tokenName }) => tokenName === 'polygon')
|
|
5
|
+
|
|
6
|
+
export const polygonStakeAccountState = ({ currency }) => ({
|
|
7
|
+
isDelegating: false,
|
|
8
|
+
// Unstaking takes ~3-4 days, after that, user needs to
|
|
9
|
+
// claim the unstaked amount (initial staked amount)
|
|
10
|
+
isUndelegateInProgress: false,
|
|
11
|
+
canClaimUndelegatedBalance: false,
|
|
12
|
+
minRewardsToWithdraw: currency.defaultUnit(1),
|
|
13
|
+
minDelegateAmount: currency.defaultUnit(1),
|
|
14
|
+
unclaimedUndelegatedBalance: currency.ZERO,
|
|
15
|
+
delegatedBalance: currency.ZERO,
|
|
16
|
+
rewardsBalance: currency.ZERO,
|
|
17
|
+
withdrawable: currency.ZERO,
|
|
18
|
+
unbondNonce: '0',
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
export const stakingConfiguration = {
|
|
22
|
+
ethereum: { accountStateExtraData: ethStakeAccountState(asset) },
|
|
23
|
+
polygon: {
|
|
24
|
+
accountStateExtraData: polygonStakeAccountState(polygon),
|
|
25
|
+
},
|
|
26
|
+
}
|