@exodus/web3-ethereum-utils 3.1.0 → 3.2.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,3 +1,3 @@
|
|
|
1
1
|
import type { EthAggregatedTransactionSimulationResult, EthSimulateTransactionParams } from './types.js';
|
|
2
|
-
import type {
|
|
3
|
-
export declare const createSimulateTransactions: ({ apiEndpoint, headers
|
|
2
|
+
import type { CreateSimulateTransactionsParams } from '@exodus/web3-types';
|
|
3
|
+
export declare const createSimulateTransactions: ({ apiEndpoint, headers }: Required<CreateSimulateTransactionsParams>) => ({ transactions, asset, origin, shouldSimulate, }: EthSimulateTransactionParams) => Promise<EthAggregatedTransactionSimulationResult>;
|
|
@@ -3,7 +3,7 @@ import { estimateFee } from './simulation/estimateFee.js';
|
|
|
3
3
|
import { simulateTransactions } from './simulation/simulateTransactions.js';
|
|
4
4
|
import { tryEstimatingChangesLocally } from './simulation/tryEstimatingChangesLocally.js';
|
|
5
5
|
import { getDisplayDetails, getTxFeeDetails } from './transactions.js';
|
|
6
|
-
export const createSimulateTransactions = ({ apiEndpoint, headers
|
|
6
|
+
export const createSimulateTransactions = ({ apiEndpoint, headers }) => async ({ transactions, asset, origin, shouldSimulate = true, }) => {
|
|
7
7
|
// Ethereum transactions from web3 providers are always one item in an array.
|
|
8
8
|
const transaction = transactions[0];
|
|
9
9
|
const simulationResult = createEmptySimulationResult({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EthAggregatedTransactionSimulationResult, EthSimulateTransactionParams } from '../types.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { CreateSimulateTransactionsParams } from '@exodus/web3-types';
|
|
3
3
|
interface BlowfishEvmChain {
|
|
4
4
|
[key: string]: {
|
|
5
5
|
network: string;
|
|
@@ -7,7 +7,7 @@ interface BlowfishEvmChain {
|
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
9
|
export declare const BLOWFISH_EVM_CHAINS: BlowfishEvmChain;
|
|
10
|
-
declare type SimulateTransactionParams = Required<Pick<
|
|
10
|
+
declare type SimulateTransactionParams = Required<Pick<CreateSimulateTransactionsParams, 'apiEndpoint'>> & Required<Pick<EthSimulateTransactionParams, 'transactions' | 'origin'>> & {
|
|
11
11
|
simulationResult: EthAggregatedTransactionSimulationResult;
|
|
12
12
|
headers?: Record<string, string>;
|
|
13
13
|
assetName: string;
|
package/lib/types.d.ts
CHANGED
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.2.0",
|
|
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.32.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.24.0",
|
|
35
35
|
"@metamask/eth-sig-util": "^4.0.1"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "bcd3faa51e2a31d8324d8b107a6bb1327a77fd1d"
|
|
38
38
|
}
|