@exodus/web3-ethereum-utils 3.17.0 → 3.18.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/lib/signatures.js
CHANGED
|
@@ -8,9 +8,7 @@ export function signTypedData(typedData, privateKey, version = SignTypedDataVers
|
|
|
8
8
|
return ethSigUtilSignTypedData({ privateKey, data: typedData, version });
|
|
9
9
|
}
|
|
10
10
|
export function signTransaction(transactionParams, privateKey) {
|
|
11
|
-
const { chainId
|
|
12
|
-
const chainId = Number.parseInt(hexChainId, 16);
|
|
13
|
-
const transactionData = { ...rest, gasLimit: gas };
|
|
11
|
+
const { chainId, ...transactionData } = transactionParams;
|
|
14
12
|
const isEIP1559Enabled = !!transactionParams.maxFeePerGas;
|
|
15
13
|
const transaction = isEIP1559Enabled
|
|
16
14
|
? FeeMarketEIP1559Transaction.fromTxData(transactionData, {
|
|
@@ -50,7 +50,7 @@ const createBalanceAmount = (amount, { decimals, symbol }) => {
|
|
|
50
50
|
});
|
|
51
51
|
return beforeAmount.sub(afterAmount);
|
|
52
52
|
};
|
|
53
|
-
const handleExpectedBalanceChange = (expectedBalanceChange, simulationResult) => {
|
|
53
|
+
const handleExpectedBalanceChange = (expectedBalanceChange, simulationResult, { network }) => {
|
|
54
54
|
const { willApprove, willSend, willReceive } = simulationResult.balanceChanges;
|
|
55
55
|
const { data, kind } = expectedBalanceChange.rawInfo;
|
|
56
56
|
const { asset } = data;
|
|
@@ -84,8 +84,10 @@ const handleExpectedBalanceChange = (expectedBalanceChange, simulationResult) =>
|
|
|
84
84
|
};
|
|
85
85
|
if (isNftTransfer) {
|
|
86
86
|
const tokenId = data.tokenId;
|
|
87
|
+
const compositeId = `${asset.address}/${tokenId}`;
|
|
87
88
|
balanceChange.nft = {
|
|
88
|
-
id:
|
|
89
|
+
id: `${network}:${compositeId}`,
|
|
90
|
+
compositeId,
|
|
89
91
|
title: asset.name,
|
|
90
92
|
};
|
|
91
93
|
}
|
|
@@ -147,6 +149,6 @@ export const simulateTransactions = async ({ transactions, apiEndpoint, origin,
|
|
|
147
149
|
return;
|
|
148
150
|
}
|
|
149
151
|
userExpectedChanges.forEach((expectedChange) => {
|
|
150
|
-
handleExpectedBalanceChange(expectedChange, simulationResult);
|
|
152
|
+
handleExpectedBalanceChange(expectedChange, simulationResult, { network });
|
|
151
153
|
});
|
|
152
154
|
};
|
package/lib/types.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { AggregatedTransactionSimulationResult, BN, SimulateTransactionParams } from '@exodus/web3-types';
|
|
2
2
|
export interface EthTransactionParams {
|
|
3
|
-
chainId:
|
|
3
|
+
chainId: number;
|
|
4
4
|
from: string;
|
|
5
5
|
to?: string;
|
|
6
6
|
gas?: string;
|
|
7
|
+
gasLimit?: string;
|
|
7
8
|
gasPrice?: string;
|
|
8
9
|
value?: string;
|
|
9
10
|
data: string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/web3-ethereum-utils",
|
|
3
3
|
"description": "Web3 Ethereum utils.",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.18.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"module": "lib/index.js",
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"build": "yarn clean && tsc"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@exodus/web3-types": "^1.
|
|
29
|
+
"@exodus/web3-types": "^1.46.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@exodus/ethereumjs-common": "^2.4.0-exodus.6",
|
|
33
33
|
"@exodus/ethereumjs-tx": "^3.3.0-exodus.6",
|
|
34
|
-
"@exodus/web3-utils": "^1.
|
|
34
|
+
"@exodus/web3-utils": "^1.40.0",
|
|
35
35
|
"@metamask/eth-sig-util": "^4.0.1"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "556ef966fd45fe2460c861602a1c1e781171cf34"
|
|
38
38
|
}
|