@exodus/web3-ethereum 8.2.0 → 8.2.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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fetchGasLimit, getNonce as apiGetNonce, getServer, } from '@exodus/ethereum-api';
|
|
2
2
|
import BN from 'bn.js';
|
|
3
3
|
const createEvmDepsFactory = ({ analytics, blockchainMetadata, }) => {
|
|
4
|
-
return ({ assetName, origin, getAsset, getAddress: _getAddress, getPrivateKey: _getPrivateKey, getFeeData: getFeeConfig, getActiveWalletAccount,
|
|
4
|
+
return ({ assetName, origin, getAsset, getAddress: _getAddress, getPrivateKey: _getPrivateKey, getFeeData: getFeeConfig, getActiveWalletAccount, simulateEthereumTransactions, }) => {
|
|
5
5
|
const asset = getAsset(assetName);
|
|
6
6
|
const server = getServer(asset);
|
|
7
7
|
const forwardRequest = async ({ method, params }) => {
|
|
@@ -87,7 +87,7 @@ const createEvmDepsFactory = ({ analytics, blockchainMetadata, }) => {
|
|
|
87
87
|
getFeeData,
|
|
88
88
|
getEstimatedGas,
|
|
89
89
|
onEthWalletWatchAssetRequest: trackWalletWatchAssetUse,
|
|
90
|
-
|
|
90
|
+
simulateEthereumTransactions,
|
|
91
91
|
};
|
|
92
92
|
};
|
|
93
93
|
};
|
|
@@ -62,7 +62,7 @@ const isValidGasLimitValue = (value) => {
|
|
|
62
62
|
return proposedGasLimit.lte(maximumBlockGasLimit);
|
|
63
63
|
};
|
|
64
64
|
export function exposeHandlers(rpc, deps) {
|
|
65
|
-
const { chainId, isTrusted, isAutoApproved, ensureTrusted, approveConnection, approveMessage, approveTransactions, forwardRequest, getAddress, getPrivateKey, getEstimatedGas, getFeeData, getNonce, sendRawTransaction,
|
|
65
|
+
const { chainId, isTrusted, isAutoApproved, ensureTrusted, approveConnection, approveMessage, approveTransactions, forwardRequest, getAddress, getPrivateKey, getEstimatedGas, getFeeData, getNonce, sendRawTransaction, simulateEthereumTransactions, scanDomains, onTransactionsSigned = () => { }, onEthWalletWatchAssetRequest = () => { }, isUnlocked = () => true, ensureUnlocked = async () => true, getAsset, getOrigin, } = deps;
|
|
66
66
|
const network = `evm:${chainId}`;
|
|
67
67
|
async function assertTrusted() {
|
|
68
68
|
const trusted = await isTrusted();
|
|
@@ -124,7 +124,7 @@ export function exposeHandlers(rpc, deps) {
|
|
|
124
124
|
const preparedTransaction = await prepareTransaction(transaction);
|
|
125
125
|
validateTransaction(preparedTransaction);
|
|
126
126
|
const origin = getOrigin();
|
|
127
|
-
const simulatedChanges = await
|
|
127
|
+
const simulatedChanges = await simulateEthereumTransactions({
|
|
128
128
|
asset,
|
|
129
129
|
transactions: [preparedTransaction],
|
|
130
130
|
origin,
|
|
@@ -13,7 +13,7 @@ const validateEVMDeps = (evm) => {
|
|
|
13
13
|
'getFeeData',
|
|
14
14
|
'getNonce',
|
|
15
15
|
'sendRawTransaction',
|
|
16
|
-
'
|
|
16
|
+
'simulateEthereumTransactions',
|
|
17
17
|
];
|
|
18
18
|
const optionalKeys = ['onEthWalletWatchAssetRequest'];
|
|
19
19
|
validateDeps(evm, requiredKeys, optionalKeys);
|
package/lib/types.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export interface CreateEvmDepsParams {
|
|
|
30
30
|
getPrivateKey: (assetName: string) => Promise<{
|
|
31
31
|
privateKey: Buffer;
|
|
32
32
|
}>;
|
|
33
|
-
|
|
33
|
+
simulateEthereumTransactions: SimulateTransactionsFn;
|
|
34
34
|
}
|
|
35
35
|
export declare type EVMFactory = (params: CreateEvmDepsParams) => EVMDeps;
|
|
36
36
|
export declare type EVMDeps = {
|
|
@@ -38,7 +38,7 @@ export declare type EVMDeps = {
|
|
|
38
38
|
getAddress: () => Promise<string>;
|
|
39
39
|
getPrivateKey: () => Promise<Buffer>;
|
|
40
40
|
sendRawTransaction: (rawTransaction: string) => Promise<EthTransactionHash>;
|
|
41
|
-
|
|
41
|
+
simulateEthereumTransactions: SimulateTransactionsFn;
|
|
42
42
|
getEstimatedGas: (transaction: EthTransaction) => Promise<string>;
|
|
43
43
|
getFeeData: () => Promise<FeeData>;
|
|
44
44
|
getNonce: () => Promise<string>;
|
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": "8.2.
|
|
4
|
+
"version": "8.2.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"module": "lib/index.js",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"@exodus/currency": "^2.1.2",
|
|
34
34
|
"@exodus/ethereum-api": "^6.0.0",
|
|
35
35
|
"@exodus/web3-constants": "^1.29.0",
|
|
36
|
-
"@exodus/web3-ethereum-utils": "^3.3.
|
|
37
|
-
"@exodus/web3-provider": "^2.35.
|
|
38
|
-
"@exodus/web3-rpc-handlers": "^2.2.
|
|
39
|
-
"@exodus/web3-utils": "^1.25.
|
|
36
|
+
"@exodus/web3-ethereum-utils": "^3.3.1",
|
|
37
|
+
"@exodus/web3-provider": "^2.35.1",
|
|
38
|
+
"@exodus/web3-rpc-handlers": "^2.2.1",
|
|
39
|
+
"@exodus/web3-utils": "^1.25.1",
|
|
40
40
|
"bn.js": "^5.2.0",
|
|
41
41
|
"eth-rpc-errors": "^4.0.3"
|
|
42
42
|
},
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"@exodus/assets": "^8.0.72",
|
|
45
45
|
"@exodus/json-rpc": "^1.11.0",
|
|
46
46
|
"@exodus/schemasafe": "^1.0.0",
|
|
47
|
-
"@exodus/web3-types": "^1.33.
|
|
47
|
+
"@exodus/web3-types": "^1.33.1",
|
|
48
48
|
"@exodus/web3-validation": "^1.36.0",
|
|
49
49
|
"@wallet-standard/base": "^1.0.1"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@exodus/assets": "^8.0.72"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "b185ed84ffba447a3557d317bf0c41e2aab99304"
|
|
55
55
|
}
|