@exodus/ethereum-lib 4.2.3 → 4.2.5

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-lib",
3
- "version": "4.2.3",
3
+ "version": "4.2.5",
4
4
  "description": "Ethereum Library",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -21,12 +21,13 @@
21
21
  "@exodus/basemainnet-meta": "^1.0.6",
22
22
  "@exodus/basic-utils": "^0.7.0",
23
23
  "@exodus/bsc-meta": "^1.1.2",
24
- "@exodus/cronos-meta": "^1.0.4",
24
+ "@exodus/cronos-meta": "^1.0.5",
25
25
  "@exodus/ethereum-meta": "^1.1.3",
26
26
  "@exodus/ethereumarbnova-meta": "^1.0.2",
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": "932d009fbd44833d111c7b73142f62e671623ab3"
48
+ "gitHead": "6fa73dbdd4ae4ff56f19a7a2854f439deaf99a13"
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
+ })
@@ -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
- import type { ParsedTransaction, SignedTransaction } from '@exodus/models/lib/types'
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
- }): UnsignedTransaction {
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
- import type { UnsignedTransaction, ParsedTransaction } from '@exodus/models/lib/types'
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
@@ -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: string): string {
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: string) => serializedTx.slice(2, 4)
89
- export const isEip1559Tx = (serializedTx: string) => getTxType(serializedTx) === '02'
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