@exodus/ethereum-lib 4.2.3 → 4.2.4
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 +3 -2
- package/src/account-state/staking-data.js +2 -0
- package/src/balances/ethereum-balance.js +1 -1
- package/src/constants.js +6 -0
- package/src/fee-data/ethereumholesky.js +20 -0
- package/src/fee-data/index.js +1 -0
- package/src/unsigned-tx/create-and-sign-tx.js +2 -7
- package/src/unsigned-tx/create-unsigned-tx.js +1 -3
- package/src/unsigned-tx/parse-unsigned-tx.js +1 -7
- package/src/utils/index.js +4 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-lib",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.4",
|
|
4
4
|
"description": "Ethereum Library",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"@exodus/ethereumarbone-meta": "^1.1.5",
|
|
28
28
|
"@exodus/ethereumclassic-meta": "^1.0.1",
|
|
29
29
|
"@exodus/ethereumgoerli-meta": "^1.0.3",
|
|
30
|
+
"@exodus/ethereumholesky-meta": "^1.0.1",
|
|
30
31
|
"@exodus/ethereumjs-common": "^2.4.0-exodus.6",
|
|
31
32
|
"@exodus/ethereumjs-tx": "^3.3.0-exodus.6",
|
|
32
33
|
"@exodus/ethereumjs-util": "^7.1.0-exodus.6",
|
|
@@ -44,5 +45,5 @@
|
|
|
44
45
|
"ms": "^2.1.1",
|
|
45
46
|
"reselect": "~3.0.1"
|
|
46
47
|
},
|
|
47
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "79937b2d5f2fd6268d3fa7b3622fae938dde8aac"
|
|
48
49
|
}
|
|
@@ -25,12 +25,14 @@ const assetStakingData = {
|
|
|
25
25
|
}),
|
|
26
26
|
ethereum: ethStakeAccountState,
|
|
27
27
|
ethereumgoerli: ethStakeAccountState,
|
|
28
|
+
ethereumholesky: ethStakeAccountState,
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
const getAssetStakingData = ({ assetName, assets }) => {
|
|
31
32
|
const stakingAssetsForAsset = {
|
|
32
33
|
ethereum: ['ethereum', 'polygon'],
|
|
33
34
|
ethereumgoerli: ['ethereumgoerli'],
|
|
35
|
+
ethereumholesky: ['ethereumholesky'],
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
const stakingAssetsNames = stakingAssetsForAsset[assetName]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { get } from 'lodash'
|
|
2
2
|
|
|
3
3
|
export const getEthereumBalances = ({ asset, liquidBalance, accountState }) => {
|
|
4
|
-
// asset = ethereum or ethereumgoerli
|
|
4
|
+
// asset = ethereum or ethereumgoerli or ethereumholesky
|
|
5
5
|
const delegatedBalance = get(
|
|
6
6
|
accountState,
|
|
7
7
|
['staking', asset.name, 'delegatedBalance'],
|
package/src/constants.js
CHANGED
|
@@ -19,6 +19,12 @@ const CHAIN_DATA = {
|
|
|
19
19
|
confirmationsNumber: 30,
|
|
20
20
|
tokenType: 'ETHEREUM_GOERLI_ERC20',
|
|
21
21
|
},
|
|
22
|
+
ethereumholesky: {
|
|
23
|
+
chainId: 17000,
|
|
24
|
+
serverUrl: 'https://geth-holesky-testnet-d.a.exodus.io/wallet/v1/',
|
|
25
|
+
confirmationsNumber: 30,
|
|
26
|
+
tokenType: 'ETHEREUM_HOLESKY_ERC20',
|
|
27
|
+
},
|
|
22
28
|
bsc: {
|
|
23
29
|
chainId: 56,
|
|
24
30
|
serverUrl: 'https://bsc-clarity.a.exodus.io/',
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FeeData } from '@exodus/asset-lib'
|
|
2
|
+
import { asset } from '@exodus/ethereumholesky-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 HOETH',
|
|
11
|
+
swapFee: '0.05 HOETH',
|
|
12
|
+
gasPriceEconomicalRate: 0.7,
|
|
13
|
+
gasPriceMinimumRate: 0.5,
|
|
14
|
+
enableFeeDelegation: false,
|
|
15
|
+
tipGasPrice: '2 Gwei',
|
|
16
|
+
eip1559Enabled: true,
|
|
17
|
+
},
|
|
18
|
+
mainKey: 'gasPrice',
|
|
19
|
+
currency: asset.currency,
|
|
20
|
+
})
|
package/src/fee-data/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export { default as ethereumarbnova } from './ethereumarbnova'
|
|
|
3
3
|
export { default as ethereumarbone } from './ethereumarbone'
|
|
4
4
|
export { default as ethereumclassic } from './ethereumclassic'
|
|
5
5
|
export { default as ethereumgoerli } from './ethereumgoerli'
|
|
6
|
+
export { default as ethereumholesky } from './ethereumholesky'
|
|
6
7
|
export { default as bsc } from './bsc'
|
|
7
8
|
export { default as matic } from './polygon'
|
|
8
9
|
export { default as avalanchec } from './avalanchec'
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
/* @flow */
|
|
2
1
|
import createUnsignedTx from './create-unsigned-tx'
|
|
3
2
|
import signUnsignedTx from './sign-unsigned-tx'
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export default function createAndSignTx(
|
|
8
|
-
input: ParsedTransaction,
|
|
9
|
-
privateKey: Buffer
|
|
10
|
-
): SignedTransaction {
|
|
4
|
+
// @param { Buffer } privateKey
|
|
5
|
+
export default function createAndSignTx(input, privateKey) {
|
|
11
6
|
const unsignedTx = createUnsignedTx(input)
|
|
12
7
|
return signUnsignedTx(unsignedTx, privateKey)
|
|
13
8
|
}
|
|
@@ -4,8 +4,6 @@ import { intToBuffer } from 'ethjs-util'
|
|
|
4
4
|
import { isToken, currency2buffer } from '../utils'
|
|
5
5
|
import { CHAIN_IDS } from '../constants'
|
|
6
6
|
|
|
7
|
-
import type { UnsignedTransaction } from '@exodus/models'
|
|
8
|
-
|
|
9
7
|
export default function createUnsignedTx({
|
|
10
8
|
asset,
|
|
11
9
|
address,
|
|
@@ -19,7 +17,7 @@ export default function createUnsignedTx({
|
|
|
19
17
|
fromAddress,
|
|
20
18
|
chainId,
|
|
21
19
|
eip1559Enabled,
|
|
22
|
-
})
|
|
20
|
+
}) {
|
|
23
21
|
const baseAsset = asset.baseAsset
|
|
24
22
|
if (!chainId) chainId = CHAIN_IDS[baseAsset.name] // mainnet
|
|
25
23
|
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
/* @flow */
|
|
2
1
|
import * as ethUtil from '@exodus/ethereumjs-util'
|
|
3
2
|
import { isToken, buffer2currency } from '../utils'
|
|
4
3
|
import { CHAIN_IDS } from '../constants'
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export default function parseUnsignedTx(
|
|
9
|
-
asset: Object,
|
|
10
|
-
unsignedTx: UnsignedTransaction
|
|
11
|
-
): ParsedTransaction {
|
|
5
|
+
export default function parseUnsignedTx(asset, unsignedTx) {
|
|
12
6
|
const { txData } = unsignedTx
|
|
13
7
|
const _isToken = isToken(asset)
|
|
14
8
|
const baseAsset = asset.baseAsset
|
package/src/utils/index.js
CHANGED
|
@@ -15,6 +15,7 @@ const base16 = baseX('0123456789abcdef')
|
|
|
15
15
|
|
|
16
16
|
export const isEthereumToken = (asset) => asset.assetType === 'ETHEREUM_ERC20'
|
|
17
17
|
export const isEthereumGoerliToken = (asset) => asset.assetType === 'ETHEREUM_GOERLI_ERC20'
|
|
18
|
+
export const isEthereumHoleskyToken = (asset) => asset.assetType === 'ETHEREUM_HOLESKY_ERC20'
|
|
18
19
|
export const isBscToken = (asset) => asset.assetType === 'BSC_BEP20'
|
|
19
20
|
export const isPolygonToken = (asset) => asset.assetType === 'MATIC_ERC20'
|
|
20
21
|
export const isAvalancheToken = (asset) => asset.assetType === 'AVAX_ERC20'
|
|
@@ -65,7 +66,7 @@ export function currency2buffer(value) {
|
|
|
65
66
|
return Buffer.from(ethUtil.padToEven(hexValue), 'hex')
|
|
66
67
|
}
|
|
67
68
|
|
|
68
|
-
export function normalizeTxId(txId
|
|
69
|
+
export function normalizeTxId(txId) {
|
|
69
70
|
if (txId.startsWith('0x')) return txId
|
|
70
71
|
else return '0x' + txId
|
|
71
72
|
}
|
|
@@ -85,8 +86,8 @@ export function deserialize(hex) {
|
|
|
85
86
|
: Transaction.fromSerializedTx(buf)
|
|
86
87
|
}
|
|
87
88
|
|
|
88
|
-
const getTxType = (serializedTx
|
|
89
|
-
export const isEip1559Tx = (serializedTx
|
|
89
|
+
const getTxType = (serializedTx) => serializedTx.slice(2, 4)
|
|
90
|
+
export const isEip1559Tx = (serializedTx) => getTxType(serializedTx) === '02'
|
|
90
91
|
|
|
91
92
|
export const APPROVE_METHOD_ID = '0x095ea7b3'
|
|
92
93
|
|