@exodus/ethereum-lib 2.18.0 → 2.19.1

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": "2.18.0",
3
+ "version": "2.19.1",
4
4
  "description": "Ethereum Library",
5
5
  "main": "src/index.js",
6
6
  "author": "Exodus Movement, Inc.",
@@ -24,5 +24,5 @@
24
24
  "peerDependencies": {
25
25
  "@exodus/assets": "8.0.x"
26
26
  },
27
- "gitHead": "de6258fcd05409586558bbffff54c2c2a3c065b1"
27
+ "gitHead": "d670e5f788be18d425c7213e20da396e5b25b037"
28
28
  }
package/src/constants.js CHANGED
@@ -35,3 +35,15 @@ export const ETHEREUM_LIKE_TOKEN_TYPES = [
35
35
  'FTM_ERC20',
36
36
  ]
37
37
  export const BUMP_RATE = 1.2
38
+
39
+ export const CUSTOM_CHAINS = ['avalanchec', 'matic'].map((name) => ({
40
+ chainId: CHAIN_IDS[name],
41
+ networkId: CHAIN_IDS[name],
42
+ name,
43
+ genesis: {},
44
+ bootstrapNodes: [],
45
+ hardforks: [
46
+ { name: 'berlin', block: null },
47
+ { name: 'london', block: null },
48
+ ],
49
+ }))
@@ -10,6 +10,8 @@ export default new FeeData(
10
10
  fuelThreshold: '20000 nAVAX',
11
11
  gasPriceEconomicalRate: 0.8,
12
12
  gasPriceMinimumRate: 0.6,
13
+ eip1559Enabled: true,
14
+ tipGasPrice: '4 nAVAX',
13
15
  },
14
16
  'gasPrice',
15
17
  'avalanchec'
@@ -8,6 +8,7 @@ export default new FeeData(
8
8
  fuelThreshold: '2500000 Gwei',
9
9
  gasPriceEconomicalRate: 0.8,
10
10
  gasPriceMinimumRate: 0.6,
11
+ eip1559Enabled: false,
11
12
  },
12
13
  'gasPrice',
13
14
  'bsc'
@@ -5,6 +5,7 @@ export default new FeeData(
5
5
  gasPrice: '20 Gwei',
6
6
  max: '250 Gwei',
7
7
  min: '1 Gwei',
8
+ eip1559Enabled: false,
8
9
  },
9
10
  'gasPrice',
10
11
  'ethereumclassic'
@@ -9,6 +9,7 @@ export default new FeeData(
9
9
  fuelThreshold: '2500000 Gwei',
10
10
  gasPriceEconomicalRate: 0.8,
11
11
  gasPriceMinimumRate: 0.6,
12
+ eip1559Enabled: false,
12
13
  },
13
14
  'gasPrice',
14
15
  'fantommainnet'
@@ -8,6 +8,7 @@ export default new FeeData(
8
8
  fuelThreshold: '2500000 Gwei',
9
9
  gasPriceEconomicalRate: 0.8,
10
10
  gasPriceMinimumRate: 0.6,
11
+ eip1559Enabled: false,
11
12
  },
12
13
  'gasPrice',
13
14
  'harmonymainnet'
@@ -5,10 +5,12 @@ export default new FeeData(
5
5
  // https://polygonscan.com/chart/gasprice
6
6
  gasPrice: '5 Gwei',
7
7
  max: '300 Gwei',
8
- min: '30 Gwei',
8
+ min: '40 Gwei',
9
9
  fuelThreshold: '2500000 Gwei',
10
10
  gasPriceEconomicalRate: 0.8,
11
11
  gasPriceMinimumRate: 0.6,
12
+ eip1559Enabled: true,
13
+ tipGasPrice: '35 Gwei',
12
14
  },
13
15
  'gasPrice',
14
16
  'matic'
@@ -4,7 +4,7 @@ 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 '#/app-models'
7
+ import type { UnsignedTransaction } from '@exodus/models'
8
8
 
9
9
  export default function createUnsignedTx({
10
10
  asset,
@@ -3,6 +3,7 @@ import { Transaction, FeeMarketEIP1559Transaction } from '@exodus/ethereumjs-tx'
3
3
  import Common from '@exodus/ethereumjs-common'
4
4
 
5
5
  import type { UnsignedTransaction, SignedTransaction } from '@exodus/models/lib/types'
6
+ import { CUSTOM_CHAINS } from '../constants'
6
7
 
7
8
  export default function signUnsignedTx(
8
9
  unsignedTx: UnsignedTransaction,
@@ -29,7 +30,14 @@ export default function signUnsignedTx(
29
30
  type: '0x02', // https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/tx#gas-fee-market-transactions-eip-1559,
30
31
  ...txData,
31
32
  },
32
- { common: new Common({ chain, hardfork: 'london' }) }
33
+ {
34
+ common: new Common({
35
+ chain,
36
+ hardfork: 'london',
37
+ customChains: CUSTOM_CHAINS,
38
+ eips: [1559],
39
+ }),
40
+ }
33
41
  )
34
42
  } else {
35
43
  // Legacy tx