@exodus/web3-ethereum 13.2.0 → 13.4.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,9 +1,12 @@
|
|
|
1
|
-
import { getNonce as apiGetNonce
|
|
1
|
+
import { getNonce as apiGetNonce } from '@exodus/ethereum-api';
|
|
2
2
|
const createEVMDepsFactory = ({ analytics, blockchainMetadata, }) => {
|
|
3
3
|
return ({ addEthereumChain, assetName, chainId: _chainId, origin, getAsset, getAddress: _getAddress, getSupportedChainIds, getFeeData: getFeeConfig, getCustomFeeRate, getActiveWalletAccount, simulateEthereumTransactions, getActiveWalletAccountData, transactionSigner, messageSigner, onEthWalletWatchAssetRequest: _onEthWalletWatchAssetRequest, }) => {
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const getServer = async () => {
|
|
5
|
+
const asset = await getAsset(assetName);
|
|
6
|
+
return asset.server;
|
|
7
|
+
};
|
|
8
|
+
const forwardRequest = async ({ method, params, }) => {
|
|
9
|
+
const server = await getServer();
|
|
7
10
|
if (server.proxyToCoinNode) {
|
|
8
11
|
return server.proxyToCoinNode({ method, params });
|
|
9
12
|
}
|
|
@@ -11,12 +14,14 @@ const createEVMDepsFactory = ({ analytics, blockchainMetadata, }) => {
|
|
|
11
14
|
return server.sendRequest(request);
|
|
12
15
|
};
|
|
13
16
|
const sendRawTransaction = async (rawTransaction) => {
|
|
17
|
+
const server = await getServer();
|
|
14
18
|
return server.sendRawTransaction(rawTransaction);
|
|
15
19
|
};
|
|
16
20
|
const getAddress = async () => {
|
|
17
21
|
return _getAddress(assetName);
|
|
18
22
|
};
|
|
19
23
|
const getNonce = async () => {
|
|
24
|
+
const asset = await getAsset(assetName);
|
|
20
25
|
const [baseAssetTxLog, blockchainNonce] = await Promise.all([
|
|
21
26
|
blockchainMetadata.getTxLog({
|
|
22
27
|
assetName,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { SignTypedDataVersion } from '@exodus/ethereumjs/eth-sig-util';
|
|
1
2
|
import { AssetNotSupportedError, InvalidInputError, UnauthorizedError, UnsupportedMethodError, UserRejectedRequestError, } from '@exodus/web3-errors';
|
|
2
3
|
import { bufferToHex0xString, hex0xStringToBuffer, } from '@exodus/web3-ethereum-utils';
|
|
3
4
|
import { connect } from '@exodus/web3-rpc-handlers';
|
|
4
5
|
import { hexToBN } from '@exodus/web3-utils';
|
|
5
|
-
import { SignTypedDataVersion } from '@metamask/eth-sig-util';
|
|
6
6
|
import { parseAndValidateTypedData } from './parseAndValidateTypedData.js';
|
|
7
7
|
// See: https://eips.ethereum.org/EIPS/eip-2255.
|
|
8
8
|
const ETH_ACCOUNTS_PERMISSION = 'eth_accounts';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MessageTypes, TypedDataV1, TypedMessage } from '@
|
|
1
|
+
import type { MessageTypes, TypedDataV1, TypedMessage } from '@exodus/ethereumjs/eth-sig-util';
|
|
2
2
|
export declare function convertChainIdToHex(chainId: string): string;
|
|
3
3
|
export declare function parseAndValidateTypedData(typedData: string, { chainId: activeChainId }: {
|
|
4
4
|
chainId: string;
|
package/lib/types.d.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import type { AddEthereumChainParameter, EthereumProvider } from './provider/index.js';
|
|
2
|
+
import type { MessageTypes, TypedDataV1, TypedMessage } from '@exodus/ethereumjs/eth-sig-util';
|
|
4
3
|
import type { EthAggregatedTransactionSimulationResult, EthSimulateTransactionParams, EthTransaction, EthTransactionHash, EthWalletWatchAsset } from '@exodus/web3-ethereum-utils';
|
|
5
4
|
import type { EthTransactionParams } from '@exodus/web3-ethereum-utils';
|
|
6
5
|
import type { WalletStandardCommonDeps } from '@exodus/web3-provider';
|
|
7
6
|
import type { CommonDeps } from '@exodus/web3-rpc-handlers';
|
|
8
7
|
import type { Asset, CreateSimulationServiceParams, EthereumFeeData, GetActiveWalletAccountData, GetFeeDataParams, IAnalyticsModule, IBlockchainMetadataModule, IMessageSignerModule, ITransactionSignerModule, NumberUnit } from '@exodus/web3-types';
|
|
9
|
-
import type { TypedDataV1 } from '@metamask/eth-sig-util';
|
|
10
|
-
import type { MessageTypes, TypedMessage } from '@metamask/eth-sig-util/sign-typed-data';
|
|
11
8
|
/**
|
|
12
9
|
* EVM-compatible chains.
|
|
13
10
|
*/
|
|
@@ -33,7 +30,7 @@ export interface CreateEvmDepsParams {
|
|
|
33
30
|
origin: string;
|
|
34
31
|
getAddress: (assetName: string) => Promise<string>;
|
|
35
32
|
getActiveWalletAccount: () => Promise<string>;
|
|
36
|
-
getAsset: (assetName: string) => Asset
|
|
33
|
+
getAsset: (assetName: string) => Promise<Asset>;
|
|
37
34
|
getFeeData: ({ assetName }: GetFeeDataParams) => Promise<EthereumFeeData>;
|
|
38
35
|
getCustomFeeRate?: () => Promise<NumberUnit>;
|
|
39
36
|
getSupportedChainIds?: () => 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": "13.
|
|
4
|
+
"version": "13.4.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"module": "lib/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@exodus/ethereum-api": "^8.31.0",
|
|
43
43
|
"@exodus/web3-constants": "^1.30.0",
|
|
44
|
-
"@exodus/web3-ethereum-utils": "^4.
|
|
44
|
+
"@exodus/web3-ethereum-utils": "^4.4.0",
|
|
45
45
|
"@exodus/web3-provider": "^3.15.0",
|
|
46
46
|
"@exodus/web3-rpc-handlers": "^2.25.0",
|
|
47
47
|
"@exodus/web3-utils": "^1.48.2",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"eth-rpc-errors": "^4.0.3"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@exodus/assets": "^11.
|
|
53
|
-
"@exodus/ethereum-meta": "^2.
|
|
52
|
+
"@exodus/assets": "^11.3.0",
|
|
53
|
+
"@exodus/ethereum-meta": "^2.8.0",
|
|
54
54
|
"@exodus/json-rpc": "^1.11.0",
|
|
55
55
|
"@exodus/schemasafe": "^1.0.0",
|
|
56
56
|
"@exodus/web3-management": "0.36.1",
|
|
57
|
-
"@exodus/web3-types": "1.
|
|
57
|
+
"@exodus/web3-types": "1.57.1",
|
|
58
58
|
"@exodus/web3-validation": "^1.38.0",
|
|
59
59
|
"@wallet-standard/base": "^1.0.1"
|
|
60
60
|
},
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"url": "https://github.com/ExodusMovement/assets/issues?q=is%3Aissue+is%3Aopen+label%3Aweb3-ethereum"
|
|
64
64
|
},
|
|
65
65
|
"homepage": "https://github.com/ExodusMovement/assets/tree/master/web3/web3-ethereum",
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "45be970be70f9211b8a6489566c352f4caeb82dc"
|
|
67
67
|
}
|