@exodus/web3-ethereum 11.7.0 → 11.8.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.
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getNonce as apiGetNonce, getServer } from '@exodus/ethereum-api';
|
|
2
2
|
import { InvalidInputError } from '@exodus/web3-errors';
|
|
3
3
|
import { signMessage, signTypedData, hex0xStringToBuffer, bufferToHex0xString, } from '@exodus/web3-ethereum-utils';
|
|
4
4
|
import { SignTypedDataVersion } from '@metamask/eth-sig-util';
|
|
5
|
-
import BN from 'bn.js';
|
|
6
5
|
async function getDefaultPurposeForLedger(asset) {
|
|
7
6
|
const purposes = await asset.api.getSupportedPurposes({
|
|
8
7
|
compatibilityMode: 'ledger',
|
|
@@ -44,19 +43,10 @@ const createEvmDepsFactory = ({ analytics, blockchainMetadata, }) => {
|
|
|
44
43
|
return `0x${Math.max(walletNonce, blockchainNonce).toString(16)}`;
|
|
45
44
|
};
|
|
46
45
|
const getEstimatedGas = async (transaction) => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
asset,
|
|
51
|
-
amount: amount
|
|
52
|
-
? asset.currency.baseUnit(new BN(amount.slice(2), 'hex'))
|
|
53
|
-
: asset.currency.ZERO,
|
|
54
|
-
fromAddress,
|
|
55
|
-
toAddress,
|
|
56
|
-
txInput,
|
|
57
|
-
extraPercentage: EXTRA_PERCENTAGE_GAS_LIMIT,
|
|
46
|
+
return forwardRequest({
|
|
47
|
+
method: 'eth_estimateGas',
|
|
48
|
+
params: [transaction],
|
|
58
49
|
});
|
|
59
|
-
return `0x${gasLimit.toString(16)}`;
|
|
60
50
|
};
|
|
61
51
|
const getFeeData = async () => {
|
|
62
52
|
const { eip1559Enabled, tipGasPrice, gasPrice: _gasPrice, } = await getFeeConfig({
|
|
@@ -35,11 +35,11 @@ export function validateRequestWithEVMPrefix(request) {
|
|
|
35
35
|
return validateRequest(request);
|
|
36
36
|
}
|
|
37
37
|
const originalMethod = request?.method;
|
|
38
|
-
if (!originalMethod) {
|
|
38
|
+
if (!originalMethod || typeof originalMethod !== 'string') {
|
|
39
39
|
return validateRequest(request);
|
|
40
40
|
}
|
|
41
41
|
const underscorePosition = originalMethod.indexOf('_');
|
|
42
|
-
if (underscorePosition === -1
|
|
42
|
+
if (underscorePosition === -1) {
|
|
43
43
|
return validateRequest(request);
|
|
44
44
|
}
|
|
45
45
|
// 0x1_eth_getAccounts -> eth_getAccounts
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/web3-ethereum",
|
|
3
3
|
"description": "Apps connectivity library for EVM-compatible chains.",
|
|
4
|
-
"version": "11.
|
|
4
|
+
"version": "11.8.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"module": "lib/index.js",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@exodus/assets": "^8.0.95"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "b33885a025250b22c631ee1008af8aa1f8ce03af"
|
|
56
56
|
}
|