@toruslabs/ethereum-controllers 8.0.0 → 8.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.
- package/dist/ethereumControllers.umd.min.js +1 -1
- package/dist/lib.cjs/Network/createEthereumMiddleware.js +2 -1
- package/dist/lib.cjs/Nfts/NftsController.js +1 -1
- package/dist/lib.cjs/Preferences/PreferencesController.js +8 -6
- package/dist/lib.cjs/Tokens/TokensController.js +1 -1
- package/dist/lib.cjs/index.js +4 -2
- package/dist/lib.cjs/types/Network/createEthereumMiddleware.d.ts +1 -0
- package/dist/lib.cjs/types/utils/constants.d.ts +6 -2
- package/dist/lib.cjs/types/utils/interfaces.d.ts +12 -0
- package/dist/lib.cjs/utils/constants.js +33 -15
- package/dist/lib.esm/Network/createEthereumMiddleware.js +3 -2
- package/dist/lib.esm/Nfts/NftsController.js +2 -2
- package/dist/lib.esm/Preferences/PreferencesController.js +9 -7
- package/dist/lib.esm/Tokens/TokensController.js +2 -2
- package/dist/lib.esm/index.js +1 -1
- package/dist/lib.esm/utils/constants.js +30 -14
- package/package.json +7 -21
|
@@ -282,6 +282,7 @@ function createEthereumMiddleware(providerHandlers) {
|
|
|
282
282
|
const {
|
|
283
283
|
requestAccounts,
|
|
284
284
|
getAccounts,
|
|
285
|
+
getPrivateKey,
|
|
285
286
|
processTransaction,
|
|
286
287
|
processEstimateUserOperationGas,
|
|
287
288
|
processEthSignMessage,
|
|
@@ -302,7 +303,7 @@ function createEthereumMiddleware(providerHandlers) {
|
|
|
302
303
|
requestAccounts
|
|
303
304
|
}), createGetAccountsMiddleware({
|
|
304
305
|
getAccounts
|
|
305
|
-
}), createProcessTransactionMiddleware({
|
|
306
|
+
}), baseControllers.createGenericJRPCMiddleware(constants.METHOD_TYPES.ETH_PRIVATE_KEY, getPrivateKey), baseControllers.createGenericJRPCMiddleware(constants.METHOD_TYPES.PRIVATE_KEY, getPrivateKey), createProcessTransactionMiddleware({
|
|
306
307
|
processTransaction
|
|
307
308
|
}), createProcessEstimateUserOperationGasMiddleware({
|
|
308
309
|
processEstimateUserOperationGas
|
|
@@ -164,7 +164,7 @@ class NftsController extends baseControllers.BaseController {
|
|
|
164
164
|
const nonZeroNfts = [];
|
|
165
165
|
try {
|
|
166
166
|
const currentChainId = this.config.chainId;
|
|
167
|
-
if (constants.
|
|
167
|
+
if (constants.MM_NFT_API_SUPPORTED_CHAINS.includes(currentChainId)) {
|
|
168
168
|
const simpleHashBalances = await this.getSimpleHashNfts(userAddress, currentChainId, skipCache);
|
|
169
169
|
nonZeroNfts.push(...simpleHashBalances);
|
|
170
170
|
this.update({
|
|
@@ -96,7 +96,7 @@ class PreferencesController extends baseControllers.BasePreferencesController {
|
|
|
96
96
|
});
|
|
97
97
|
const {
|
|
98
98
|
groupedAuthConnectionId,
|
|
99
|
-
|
|
99
|
+
authConnectionId,
|
|
100
100
|
userId
|
|
101
101
|
} = userInfo || {};
|
|
102
102
|
const userExists = await this.sync(address);
|
|
@@ -105,8 +105,9 @@ class PreferencesController extends baseControllers.BasePreferencesController {
|
|
|
105
105
|
await this.createUser({
|
|
106
106
|
selectedCurrency: accountState.selectedCurrency,
|
|
107
107
|
theme: accountState.theme,
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
groupedAuthConnectionId,
|
|
109
|
+
authConnectionId,
|
|
110
|
+
userId,
|
|
110
111
|
locale,
|
|
111
112
|
address,
|
|
112
113
|
type,
|
|
@@ -122,8 +123,9 @@ class PreferencesController extends baseControllers.BasePreferencesController {
|
|
|
122
123
|
eoaAddress
|
|
123
124
|
}, address);
|
|
124
125
|
this.storeUserLogin({
|
|
125
|
-
|
|
126
|
-
|
|
126
|
+
groupedAuthConnectionId,
|
|
127
|
+
authConnectionId,
|
|
128
|
+
userId,
|
|
127
129
|
options: {
|
|
128
130
|
calledFromEmbed,
|
|
129
131
|
rehydrate
|
|
@@ -233,7 +235,7 @@ class PreferencesController extends baseControllers.BasePreferencesController {
|
|
|
233
235
|
const {
|
|
234
236
|
chainId
|
|
235
237
|
} = this.getProviderConfig();
|
|
236
|
-
if (constants.
|
|
238
|
+
if (constants.MM_TOKEN_API_SUPPORTED_CHAINS.includes(chainId)) {
|
|
237
239
|
const etherscanTxn = await this.fetchEtherscanTx({
|
|
238
240
|
selectedAddress,
|
|
239
241
|
chainId: this.getProviderConfig().chainId
|
|
@@ -166,7 +166,7 @@ class TokensController extends baseControllers.BaseController {
|
|
|
166
166
|
try {
|
|
167
167
|
const nonZeroTokens = [];
|
|
168
168
|
const currentChainId = this.config.chainId;
|
|
169
|
-
if (constants.
|
|
169
|
+
if (constants.MM_TOKEN_API_SUPPORTED_CHAINS.includes(currentChainId)) {
|
|
170
170
|
const etherscanBalances = await this.getEtherScanTokens(userAddress, currentChainId, skipCache);
|
|
171
171
|
nonZeroTokens.push(...etherscanBalances);
|
|
172
172
|
}
|
package/dist/lib.cjs/index.js
CHANGED
|
@@ -135,18 +135,20 @@ exports.ERC1155_INTERFACE_ID = constants.ERC1155_INTERFACE_ID;
|
|
|
135
135
|
exports.ERC721_ENUMERABLE_INTERFACE_ID = constants.ERC721_ENUMERABLE_INTERFACE_ID;
|
|
136
136
|
exports.ERC721_INTERFACE_ID = constants.ERC721_INTERFACE_ID;
|
|
137
137
|
exports.ERC721_METADATA_INTERFACE_ID = constants.ERC721_METADATA_INTERFACE_ID;
|
|
138
|
-
exports.ETHERSCAN_SUPPORTED_CHAINS = constants.ETHERSCAN_SUPPORTED_CHAINS;
|
|
139
138
|
exports.GAS_ESTIMATE_TYPES = constants.GAS_ESTIMATE_TYPES;
|
|
139
|
+
exports.LINEA_CHAIN_ID = constants.LINEA_CHAIN_ID;
|
|
140
|
+
exports.LINEA_SEPOLIA_CHAIN_ID = constants.LINEA_SEPOLIA_CHAIN_ID;
|
|
140
141
|
exports.LOCALHOST = constants.LOCALHOST;
|
|
141
142
|
exports.MAINNET_CHAIN_ID = constants.MAINNET_CHAIN_ID;
|
|
142
143
|
exports.METHOD_TYPES = constants.METHOD_TYPES;
|
|
144
|
+
exports.MM_NFT_API_SUPPORTED_CHAINS = constants.MM_NFT_API_SUPPORTED_CHAINS;
|
|
145
|
+
exports.MM_TOKEN_API_SUPPORTED_CHAINS = constants.MM_TOKEN_API_SUPPORTED_CHAINS;
|
|
143
146
|
exports.OLD_ERC721_LIST = constants.OLD_ERC721_LIST;
|
|
144
147
|
exports.OPTIMISM_MAINNET_CHAIN_ID = constants.OPTIMISM_MAINNET_CHAIN_ID;
|
|
145
148
|
exports.OPTIMISM_TESTNET_CHAIN_ID = constants.OPTIMISM_TESTNET_CHAIN_ID;
|
|
146
149
|
exports.POLYGON_AMOY_CHAIN_ID = constants.POLYGON_AMOY_CHAIN_ID;
|
|
147
150
|
exports.POLYGON_CHAIN_ID = constants.POLYGON_CHAIN_ID;
|
|
148
151
|
exports.SEPOLIA_CHAIN_ID = constants.SEPOLIA_CHAIN_ID;
|
|
149
|
-
exports.SIMPLEHASH_SUPPORTED_CHAINS = constants.SIMPLEHASH_SUPPORTED_CHAINS;
|
|
150
152
|
exports.SMART_ACCOUNT = constants.SMART_ACCOUNT;
|
|
151
153
|
exports.SUPPORTED_NETWORKS = constants.SUPPORTED_NETWORKS;
|
|
152
154
|
exports.TEST_CHAINS = constants.TEST_CHAINS;
|
|
@@ -5,6 +5,7 @@ export interface IProviderHandlers {
|
|
|
5
5
|
version: string;
|
|
6
6
|
requestAccounts?: (req: JRPCRequest<string[]>) => Promise<string[]>;
|
|
7
7
|
getAccounts: (req: JRPCRequest<string[]>) => Promise<string[]>;
|
|
8
|
+
getPrivateKey?: (req: JRPCRequest<unknown>) => Promise<string>;
|
|
8
9
|
processTransaction?: (txParams: TransactionParams, req: JRPCRequest<TransactionParams> & UserRequestApprovalParams) => Promise<string>;
|
|
9
10
|
processEthSignMessage?: (msgParams: MessageParams, req: JRPCRequest<unknown> & UserRequestApprovalParams) => Promise<string>;
|
|
10
11
|
processTypedMessageV4?: (msgParams: TypedMessageParams, req: JRPCRequest<unknown> & UserRequestApprovalParams) => Promise<string>;
|
|
@@ -17,6 +17,7 @@ export declare const ARBITRUM_MAINNET_CHAIN_ID = "0xa4b1";
|
|
|
17
17
|
export declare const OPTIMISM_MAINNET_CHAIN_ID = "0xa";
|
|
18
18
|
export declare const CELO_MAINNET_CHAIN_ID = "0xa4ec";
|
|
19
19
|
export declare const BASE_CHAIN_ID = "0x2105";
|
|
20
|
+
export declare const LINEA_CHAIN_ID = "0xe708";
|
|
20
21
|
export declare const SEPOLIA_CHAIN_ID = "0xaa36a7";
|
|
21
22
|
export declare const POLYGON_AMOY_CHAIN_ID = "0x13882";
|
|
22
23
|
export declare const BSC_TESTNET_CHAIN_ID = "0x61";
|
|
@@ -24,6 +25,7 @@ export declare const AVALANCHE_TESTNET_CHAIN_ID = "0xa869";
|
|
|
24
25
|
export declare const ARBITRUM_TESTNET_CHAIN_ID = "0x66eee";
|
|
25
26
|
export declare const OPTIMISM_TESTNET_CHAIN_ID = "0xaa37dc";
|
|
26
27
|
export declare const BASE_TESTNET_CHAIN_ID = "0x14a34";
|
|
28
|
+
export declare const LINEA_SEPOLIA_CHAIN_ID = "0xe705";
|
|
27
29
|
export declare const SUPPORTED_NETWORKS: Record<string, EthereumProviderConfig>;
|
|
28
30
|
export declare const METHOD_TYPES: {
|
|
29
31
|
readonly GET_ACCOUNTS: "eth_accounts";
|
|
@@ -41,6 +43,8 @@ export declare const METHOD_TYPES: {
|
|
|
41
43
|
readonly ETH_GET_BLOCK_BY_HASH: "eth_getBlockByHash";
|
|
42
44
|
readonly ETH_GET_CODE: "eth_getCode";
|
|
43
45
|
readonly ETH_GET_GAS_PRICE: "eth_gasPrice";
|
|
46
|
+
readonly ETH_PRIVATE_KEY: "eth_privateKey";
|
|
47
|
+
readonly PRIVATE_KEY: "private_key";
|
|
44
48
|
readonly SWITCH_CHAIN: "wallet_switchEthereumChain";
|
|
45
49
|
readonly ADD_CHAIN: "wallet_addEthereumChain";
|
|
46
50
|
};
|
|
@@ -64,8 +68,8 @@ export declare const OLD_ERC721_LIST: Record<string, {
|
|
|
64
68
|
decimals?: number;
|
|
65
69
|
}>;
|
|
66
70
|
export declare const TEST_CHAINS: string[];
|
|
67
|
-
export declare const
|
|
68
|
-
export declare const
|
|
71
|
+
export declare const MM_TOKEN_API_SUPPORTED_CHAINS: string[];
|
|
72
|
+
export declare const MM_NFT_API_SUPPORTED_CHAINS: string[];
|
|
69
73
|
export declare const COINGECKO_SUPPORTED_CURRENCIES: Set<string>;
|
|
70
74
|
export declare const COINGECKO_PLATFORMS_CHAIN_CODE_MAP: Record<string, {
|
|
71
75
|
platform: string;
|
|
@@ -450,6 +450,9 @@ export interface ISmartAccount {
|
|
|
450
450
|
}
|
|
451
451
|
export type SmartAccountType = (typeof SMART_ACCOUNT)[keyof typeof SMART_ACCOUNT];
|
|
452
452
|
export type SmartAccountConfig = BiconomySmartAccountConfig | KernelSmartAccountConfig | NexusSmartAccountConfig | SafeSmartAccountConfig | TrustSmartAccountConfig;
|
|
453
|
+
/**
|
|
454
|
+
* @deprecated Use MultiChainAccountAbstractionConfig instead, will be deprecated in v8
|
|
455
|
+
*/
|
|
453
456
|
export interface AccountAbstractionConfig {
|
|
454
457
|
smartAccountType: SmartAccountType;
|
|
455
458
|
smartAccountAddress?: string;
|
|
@@ -457,6 +460,15 @@ export interface AccountAbstractionConfig {
|
|
|
457
460
|
paymasterConfig?: PaymasterConfig;
|
|
458
461
|
smartAccountConfig?: SmartAccountConfig;
|
|
459
462
|
}
|
|
463
|
+
export type AccountAbstractionMultiChainConfig = {
|
|
464
|
+
smartAccountType: SmartAccountType;
|
|
465
|
+
chains: {
|
|
466
|
+
chainId: string;
|
|
467
|
+
bundlerConfig: BundlerConfig;
|
|
468
|
+
paymasterConfig?: PaymasterConfig;
|
|
469
|
+
smartAccountConfig?: SmartAccountConfig;
|
|
470
|
+
}[];
|
|
471
|
+
};
|
|
460
472
|
export interface UserOperationGas {
|
|
461
473
|
callGasLimit: string;
|
|
462
474
|
preVerificationGas: string;
|
|
@@ -20,6 +20,7 @@ const ARBITRUM_MAINNET_CHAIN_ID = "0xa4b1";
|
|
|
20
20
|
const OPTIMISM_MAINNET_CHAIN_ID = "0xa";
|
|
21
21
|
const CELO_MAINNET_CHAIN_ID = "0xa4ec";
|
|
22
22
|
const BASE_CHAIN_ID = "0x2105";
|
|
23
|
+
const LINEA_CHAIN_ID = "0xe708";
|
|
23
24
|
const SEPOLIA_CHAIN_ID = "0xaa36a7";
|
|
24
25
|
const POLYGON_AMOY_CHAIN_ID = "0x13882";
|
|
25
26
|
const BSC_TESTNET_CHAIN_ID = "0x61";
|
|
@@ -27,6 +28,7 @@ const AVALANCHE_TESTNET_CHAIN_ID = "0xa869";
|
|
|
27
28
|
const ARBITRUM_TESTNET_CHAIN_ID = "0x66eee";
|
|
28
29
|
const OPTIMISM_TESTNET_CHAIN_ID = "0xaa37dc";
|
|
29
30
|
const BASE_TESTNET_CHAIN_ID = "0x14a34";
|
|
31
|
+
const LINEA_SEPOLIA_CHAIN_ID = "0xe705";
|
|
30
32
|
const INFURA_KEY = process.env.VITE_APP_INFURA_PROJECT_KEY;
|
|
31
33
|
const SUPPORTED_NETWORKS = {
|
|
32
34
|
[MAINNET_CHAIN_ID]: {
|
|
@@ -106,17 +108,6 @@ const SUPPORTED_NETWORKS = {
|
|
|
106
108
|
ticker: "ETH",
|
|
107
109
|
tickerName: "Ethereum"
|
|
108
110
|
},
|
|
109
|
-
[XDAI_CHAIN_ID]: {
|
|
110
|
-
chainNamespace: baseControllers.CHAIN_NAMESPACES.EIP155,
|
|
111
|
-
decimals: 18,
|
|
112
|
-
blockExplorerUrl: "https://gnosis.blockscout.com",
|
|
113
|
-
chainId: XDAI_CHAIN_ID,
|
|
114
|
-
displayName: "xDai",
|
|
115
|
-
logo: "xDai.svg",
|
|
116
|
-
rpcTarget: `https://rpc.gnosischain.com`,
|
|
117
|
-
ticker: "DAI",
|
|
118
|
-
tickerName: "xDai Token"
|
|
119
|
-
},
|
|
120
111
|
[BASE_CHAIN_ID]: {
|
|
121
112
|
chainNamespace: baseControllers.CHAIN_NAMESPACES.EIP155,
|
|
122
113
|
decimals: 18,
|
|
@@ -128,6 +119,17 @@ const SUPPORTED_NETWORKS = {
|
|
|
128
119
|
ticker: "ETH",
|
|
129
120
|
tickerName: "Ethereum"
|
|
130
121
|
},
|
|
122
|
+
[LINEA_CHAIN_ID]: {
|
|
123
|
+
chainNamespace: baseControllers.CHAIN_NAMESPACES.EIP155,
|
|
124
|
+
decimals: 18,
|
|
125
|
+
blockExplorerUrl: "https://lineascan.build",
|
|
126
|
+
chainId: LINEA_CHAIN_ID,
|
|
127
|
+
displayName: "Linea",
|
|
128
|
+
logo: "linea.svg",
|
|
129
|
+
rpcTarget: `https://linea-mainnet.infura.io/v3/${INFURA_KEY}`,
|
|
130
|
+
ticker: "ETH",
|
|
131
|
+
tickerName: "Ethereum"
|
|
132
|
+
},
|
|
131
133
|
[SEPOLIA_CHAIN_ID]: {
|
|
132
134
|
chainNamespace: baseControllers.CHAIN_NAMESPACES.EIP155,
|
|
133
135
|
decimals: 18,
|
|
@@ -140,6 +142,18 @@ const SUPPORTED_NETWORKS = {
|
|
|
140
142
|
tickerName: "Ethereum",
|
|
141
143
|
isTestnet: true
|
|
142
144
|
},
|
|
145
|
+
[LINEA_SEPOLIA_CHAIN_ID]: {
|
|
146
|
+
chainNamespace: baseControllers.CHAIN_NAMESPACES.EIP155,
|
|
147
|
+
decimals: 18,
|
|
148
|
+
blockExplorerUrl: "https://sepolia.lineascan.build",
|
|
149
|
+
chainId: LINEA_SEPOLIA_CHAIN_ID,
|
|
150
|
+
displayName: "Linea Sepolia Testnet",
|
|
151
|
+
logo: "linea.svg",
|
|
152
|
+
rpcTarget: `https://linea-sepolia.infura.io/v3/${INFURA_KEY}`,
|
|
153
|
+
ticker: "ETH",
|
|
154
|
+
tickerName: "Ethereum",
|
|
155
|
+
isTestnet: true
|
|
156
|
+
},
|
|
143
157
|
[POLYGON_AMOY_CHAIN_ID]: {
|
|
144
158
|
chainNamespace: baseControllers.CHAIN_NAMESPACES.EIP155,
|
|
145
159
|
decimals: 18,
|
|
@@ -229,6 +243,8 @@ const METHOD_TYPES = {
|
|
|
229
243
|
ETH_GET_BLOCK_BY_HASH: "eth_getBlockByHash",
|
|
230
244
|
ETH_GET_CODE: "eth_getCode",
|
|
231
245
|
ETH_GET_GAS_PRICE: "eth_gasPrice",
|
|
246
|
+
ETH_PRIVATE_KEY: "eth_privateKey",
|
|
247
|
+
PRIVATE_KEY: "private_key",
|
|
232
248
|
SWITCH_CHAIN: "wallet_switchEthereumChain",
|
|
233
249
|
ADD_CHAIN: "wallet_addEthereumChain"
|
|
234
250
|
};
|
|
@@ -269,8 +285,8 @@ const OLD_ERC721_LIST = {
|
|
|
269
285
|
}
|
|
270
286
|
};
|
|
271
287
|
const TEST_CHAINS = [SEPOLIA_CHAIN_ID];
|
|
272
|
-
const
|
|
273
|
-
const
|
|
288
|
+
const MM_TOKEN_API_SUPPORTED_CHAINS = [MAINNET_CHAIN_ID, SEPOLIA_CHAIN_ID, BSC_MAINNET_CHAIN_ID, BSC_TESTNET_CHAIN_ID, OPTIMISM_MAINNET_CHAIN_ID, OPTIMISM_TESTNET_CHAIN_ID, AVALANCHE_MAINNET_CHAIN_ID, AVALANCHE_TESTNET_CHAIN_ID, ARBITRUM_MAINNET_CHAIN_ID, ARBITRUM_TESTNET_CHAIN_ID, POLYGON_CHAIN_ID, POLYGON_AMOY_CHAIN_ID, CELO_MAINNET_CHAIN_ID, BASE_CHAIN_ID, BASE_TESTNET_CHAIN_ID, LINEA_CHAIN_ID, LINEA_SEPOLIA_CHAIN_ID];
|
|
289
|
+
const MM_NFT_API_SUPPORTED_CHAINS = [MAINNET_CHAIN_ID, POLYGON_CHAIN_ID, BSC_MAINNET_CHAIN_ID, AVALANCHE_MAINNET_CHAIN_ID, LINEA_CHAIN_ID, BASE_CHAIN_ID];
|
|
274
290
|
const COINGECKO_SUPPORTED_CURRENCIES = new Set(["btc", "eth", "ltc", "bch", "bnb", "eos", "xrp", "xlm", "link", "dot", "yfi", "usd", "aed", "ars", "aud", "bdt", "bhd", "bmd", "brl", "cad", "chf", "clp", "cny", "czk", "dkk", "eur", "gbp", "hkd", "huf", "idr", "ils", "inr", "jpy", "krw", "kwd", "lkr", "mmk", "mxn", "myr", "ngn", "nok", "nzd", "php", "pkr", "pln", "rub", "sar", "sek", "sgd", "thb", "try", "twd", "uah", "vef", "vnd", "zar", "xdr", "xag", "xau", "bits", "sats"]);
|
|
275
291
|
const COINGECKO_PLATFORMS_CHAIN_CODE_MAP = {
|
|
276
292
|
[POLYGON_CHAIN_ID]: {
|
|
@@ -341,18 +357,20 @@ exports.ERC1155_INTERFACE_ID = ERC1155_INTERFACE_ID;
|
|
|
341
357
|
exports.ERC721_ENUMERABLE_INTERFACE_ID = ERC721_ENUMERABLE_INTERFACE_ID;
|
|
342
358
|
exports.ERC721_INTERFACE_ID = ERC721_INTERFACE_ID;
|
|
343
359
|
exports.ERC721_METADATA_INTERFACE_ID = ERC721_METADATA_INTERFACE_ID;
|
|
344
|
-
exports.ETHERSCAN_SUPPORTED_CHAINS = ETHERSCAN_SUPPORTED_CHAINS;
|
|
345
360
|
exports.GAS_ESTIMATE_TYPES = GAS_ESTIMATE_TYPES;
|
|
361
|
+
exports.LINEA_CHAIN_ID = LINEA_CHAIN_ID;
|
|
362
|
+
exports.LINEA_SEPOLIA_CHAIN_ID = LINEA_SEPOLIA_CHAIN_ID;
|
|
346
363
|
exports.LOCALHOST = LOCALHOST;
|
|
347
364
|
exports.MAINNET_CHAIN_ID = MAINNET_CHAIN_ID;
|
|
348
365
|
exports.METHOD_TYPES = METHOD_TYPES;
|
|
366
|
+
exports.MM_NFT_API_SUPPORTED_CHAINS = MM_NFT_API_SUPPORTED_CHAINS;
|
|
367
|
+
exports.MM_TOKEN_API_SUPPORTED_CHAINS = MM_TOKEN_API_SUPPORTED_CHAINS;
|
|
349
368
|
exports.OLD_ERC721_LIST = OLD_ERC721_LIST;
|
|
350
369
|
exports.OPTIMISM_MAINNET_CHAIN_ID = OPTIMISM_MAINNET_CHAIN_ID;
|
|
351
370
|
exports.OPTIMISM_TESTNET_CHAIN_ID = OPTIMISM_TESTNET_CHAIN_ID;
|
|
352
371
|
exports.POLYGON_AMOY_CHAIN_ID = POLYGON_AMOY_CHAIN_ID;
|
|
353
372
|
exports.POLYGON_CHAIN_ID = POLYGON_CHAIN_ID;
|
|
354
373
|
exports.SEPOLIA_CHAIN_ID = SEPOLIA_CHAIN_ID;
|
|
355
|
-
exports.SIMPLEHASH_SUPPORTED_CHAINS = SIMPLEHASH_SUPPORTED_CHAINS;
|
|
356
374
|
exports.SMART_ACCOUNT = SMART_ACCOUNT;
|
|
357
375
|
exports.SUPPORTED_NETWORKS = SUPPORTED_NETWORKS;
|
|
358
376
|
exports.TEST_CHAINS = TEST_CHAINS;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PROVIDER_JRPC_METHODS } from '@toruslabs/base-controllers';
|
|
1
|
+
import { PROVIDER_JRPC_METHODS, createGenericJRPCMiddleware } from '@toruslabs/base-controllers';
|
|
2
2
|
import { createAsyncMiddleware, mergeMiddleware, createScaffoldMiddleware } from '@web3auth/auth';
|
|
3
3
|
import { METHOD_TYPES, TRANSACTION_ENVELOPE_TYPES } from '../utils/constants.js';
|
|
4
4
|
|
|
@@ -280,6 +280,7 @@ function createEthereumMiddleware(providerHandlers) {
|
|
|
280
280
|
const {
|
|
281
281
|
requestAccounts,
|
|
282
282
|
getAccounts,
|
|
283
|
+
getPrivateKey,
|
|
283
284
|
processTransaction,
|
|
284
285
|
processEstimateUserOperationGas,
|
|
285
286
|
processEthSignMessage,
|
|
@@ -300,7 +301,7 @@ function createEthereumMiddleware(providerHandlers) {
|
|
|
300
301
|
requestAccounts
|
|
301
302
|
}), createGetAccountsMiddleware({
|
|
302
303
|
getAccounts
|
|
303
|
-
}), createProcessTransactionMiddleware({
|
|
304
|
+
}), createGenericJRPCMiddleware(METHOD_TYPES.ETH_PRIVATE_KEY, getPrivateKey), createGenericJRPCMiddleware(METHOD_TYPES.PRIVATE_KEY, getPrivateKey), createProcessTransactionMiddleware({
|
|
304
305
|
processTransaction
|
|
305
306
|
}), createProcessEstimateUserOperationGasMiddleware({
|
|
306
307
|
processEstimateUserOperationGas
|
|
@@ -4,7 +4,7 @@ import { BaseController, idleTimeTracker } from '@toruslabs/base-controllers';
|
|
|
4
4
|
import deepmerge from 'deepmerge';
|
|
5
5
|
import { BrowserProvider } from 'ethers';
|
|
6
6
|
import log from 'loglevel';
|
|
7
|
-
import {
|
|
7
|
+
import { MM_NFT_API_SUPPORTED_CHAINS } from '../utils/constants.js';
|
|
8
8
|
import { NftHandler } from './NftHandler.js';
|
|
9
9
|
|
|
10
10
|
const DEFAULT_INTERVAL = 180 * 1000;
|
|
@@ -163,7 +163,7 @@ class NftsController extends BaseController {
|
|
|
163
163
|
const nonZeroNfts = [];
|
|
164
164
|
try {
|
|
165
165
|
const currentChainId = this.config.chainId;
|
|
166
|
-
if (
|
|
166
|
+
if (MM_NFT_API_SUPPORTED_CHAINS.includes(currentChainId)) {
|
|
167
167
|
const simpleHashBalances = await this.getSimpleHashNfts(userAddress, currentChainId, skipCache);
|
|
168
168
|
nonZeroNfts.push(...simpleHashBalances);
|
|
169
169
|
this.update({
|
|
@@ -3,7 +3,7 @@ import { stripHexPrefix } from '@ethereumjs/util';
|
|
|
3
3
|
import { BasePreferencesController, CHAIN_NAMESPACES, isUnauthorizedError, TransactionStatus } from '@toruslabs/base-controllers';
|
|
4
4
|
import { Mutex } from 'async-mutex';
|
|
5
5
|
import log from 'loglevel';
|
|
6
|
-
import {
|
|
6
|
+
import { MM_TOKEN_API_SUPPORTED_CHAINS, SUPPORTED_NETWORKS } from '../utils/constants.js';
|
|
7
7
|
import { formatPastTx, addEtherscanTransactions, getEthTxStatus, formatTime, formatDate } from '../utils/helpers.js';
|
|
8
8
|
|
|
9
9
|
class PreferencesController extends BasePreferencesController {
|
|
@@ -94,7 +94,7 @@ class PreferencesController extends BasePreferencesController {
|
|
|
94
94
|
});
|
|
95
95
|
const {
|
|
96
96
|
groupedAuthConnectionId,
|
|
97
|
-
|
|
97
|
+
authConnectionId,
|
|
98
98
|
userId
|
|
99
99
|
} = userInfo || {};
|
|
100
100
|
const userExists = await this.sync(address);
|
|
@@ -103,8 +103,9 @@ class PreferencesController extends BasePreferencesController {
|
|
|
103
103
|
await this.createUser({
|
|
104
104
|
selectedCurrency: accountState.selectedCurrency,
|
|
105
105
|
theme: accountState.theme,
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
groupedAuthConnectionId,
|
|
107
|
+
authConnectionId,
|
|
108
|
+
userId,
|
|
108
109
|
locale,
|
|
109
110
|
address,
|
|
110
111
|
type,
|
|
@@ -120,8 +121,9 @@ class PreferencesController extends BasePreferencesController {
|
|
|
120
121
|
eoaAddress
|
|
121
122
|
}, address);
|
|
122
123
|
this.storeUserLogin({
|
|
123
|
-
|
|
124
|
-
|
|
124
|
+
groupedAuthConnectionId,
|
|
125
|
+
authConnectionId,
|
|
126
|
+
userId,
|
|
125
127
|
options: {
|
|
126
128
|
calledFromEmbed,
|
|
127
129
|
rehydrate
|
|
@@ -233,7 +235,7 @@ class PreferencesController extends BasePreferencesController {
|
|
|
233
235
|
const {
|
|
234
236
|
chainId
|
|
235
237
|
} = this.getProviderConfig();
|
|
236
|
-
if (
|
|
238
|
+
if (MM_TOKEN_API_SUPPORTED_CHAINS.includes(chainId)) {
|
|
237
239
|
const etherscanTxn = await this.fetchEtherscanTx({
|
|
238
240
|
selectedAddress,
|
|
239
241
|
chainId: this.getProviderConfig().chainId
|
|
@@ -4,7 +4,7 @@ import { BaseController, idleTimeTracker } from '@toruslabs/base-controllers';
|
|
|
4
4
|
import { BrowserProvider, Contract, toQuantity } from 'ethers';
|
|
5
5
|
import log from 'loglevel';
|
|
6
6
|
import { singleBalanceCheckerAbi } from '../utils/abis.js';
|
|
7
|
-
import {
|
|
7
|
+
import { MM_TOKEN_API_SUPPORTED_CHAINS } from '../utils/constants.js';
|
|
8
8
|
import { SINGLE_CALL_BALANCES_ADDRESSES } from '../utils/contractAddresses.js';
|
|
9
9
|
import { TokenHandler } from './TokenHandler.js';
|
|
10
10
|
|
|
@@ -165,7 +165,7 @@ class TokensController extends BaseController {
|
|
|
165
165
|
try {
|
|
166
166
|
const nonZeroTokens = [];
|
|
167
167
|
const currentChainId = this.config.chainId;
|
|
168
|
-
if (
|
|
168
|
+
if (MM_TOKEN_API_SUPPORTED_CHAINS.includes(currentChainId)) {
|
|
169
169
|
const etherscanBalances = await this.getEtherScanTokens(userAddress, currentChainId, skipCache);
|
|
170
170
|
nonZeroTokens.push(...etherscanBalances);
|
|
171
171
|
}
|
package/dist/lib.esm/index.js
CHANGED
|
@@ -27,7 +27,7 @@ export { generateHistoryEntry, replayHistory, snapshotFromTxMeta } from './Trans
|
|
|
27
27
|
export { TransactionStateManager } from './Transaction/TransactionStateManager.js';
|
|
28
28
|
export { determineTransactionType, ensureFieldIsString, ensureMutuallyExclusiveFieldsNotProvided, getFinalStates, isEIP1559Transaction, isLegacyTransaction, normalizeAndValidateTxParams, normalizeTxParameters, parseStandardTokenTransactionData, readAddressAsContract, transactionMatchesNetwork, validateFrom, validateRecipient, validateTxParameters } from './Transaction/TransactionUtils.js';
|
|
29
29
|
export { erc1155Abi, erc20Abi, erc721Abi, singleBalanceCheckerAbi } from './utils/abis.js';
|
|
30
|
-
export { ARBITRUM_MAINNET_CHAIN_ID, ARBITRUM_TESTNET_CHAIN_ID, AVALANCHE_MAINNET_CHAIN_ID, AVALANCHE_TESTNET_CHAIN_ID, BASE_CHAIN_ID, BASE_TESTNET_CHAIN_ID, BSC_MAINNET_CHAIN_ID, BSC_TESTNET_CHAIN_ID, CELO_MAINNET_CHAIN_ID, CHAIN_ID_TO_GAS_LIMIT_BUFFER_MAP, COINGECKO_PLATFORMS_CHAIN_CODE_MAP, COINGECKO_SUPPORTED_CURRENCIES, CONTRACT_TYPE_ERC1155, CONTRACT_TYPE_ERC20, CONTRACT_TYPE_ERC721, CONTRACT_TYPE_ETH, ERC1155_INTERFACE_ID, ERC721_ENUMERABLE_INTERFACE_ID, ERC721_INTERFACE_ID, ERC721_METADATA_INTERFACE_ID,
|
|
30
|
+
export { ARBITRUM_MAINNET_CHAIN_ID, ARBITRUM_TESTNET_CHAIN_ID, AVALANCHE_MAINNET_CHAIN_ID, AVALANCHE_TESTNET_CHAIN_ID, BASE_CHAIN_ID, BASE_TESTNET_CHAIN_ID, BSC_MAINNET_CHAIN_ID, BSC_TESTNET_CHAIN_ID, CELO_MAINNET_CHAIN_ID, CHAIN_ID_TO_GAS_LIMIT_BUFFER_MAP, COINGECKO_PLATFORMS_CHAIN_CODE_MAP, COINGECKO_SUPPORTED_CURRENCIES, CONTRACT_TYPE_ERC1155, CONTRACT_TYPE_ERC20, CONTRACT_TYPE_ERC721, CONTRACT_TYPE_ETH, ERC1155_INTERFACE_ID, ERC721_ENUMERABLE_INTERFACE_ID, ERC721_INTERFACE_ID, ERC721_METADATA_INTERFACE_ID, GAS_ESTIMATE_TYPES, LINEA_CHAIN_ID, LINEA_SEPOLIA_CHAIN_ID, LOCALHOST, MAINNET_CHAIN_ID, METHOD_TYPES, MM_NFT_API_SUPPORTED_CHAINS, MM_TOKEN_API_SUPPORTED_CHAINS, OLD_ERC721_LIST, OPTIMISM_MAINNET_CHAIN_ID, OPTIMISM_TESTNET_CHAIN_ID, POLYGON_AMOY_CHAIN_ID, POLYGON_CHAIN_ID, SEPOLIA_CHAIN_ID, SMART_ACCOUNT, SUPPORTED_NETWORKS, TEST_CHAINS, TRANSACTION_ENVELOPE_TYPES, XDAI_CHAIN_ID } from './utils/constants.js';
|
|
31
31
|
export { addCurrencies, conversionGTE, conversionGreaterThan, conversionLTE, conversionLessThan, conversionMax, conversionUtil, decGWEIToHexWEI, getBigNumber, hexWEIToDecGWEI, multiplyCurrencies, subtractCurrencies, toNegative } from './utils/conversionUtils.js';
|
|
32
32
|
export { BNToHex, GAS_LIMITS, addEtherscanTransactions, bnLessThan, formatDate, formatPastTx, formatTime, getChainType, getEthTxStatus, getEtherScanHashLink, getIpfsEndpoint, hexToBn, isAddressByChainId, sanitizeNftMetdataUrl, toChecksumAddressByChainId } from './utils/helpers.js';
|
|
33
33
|
export { BiconomySmartAccount } from './AccountAbstraction/smartAccounts/BiconomySmartAccount.js';
|
|
@@ -18,6 +18,7 @@ const ARBITRUM_MAINNET_CHAIN_ID = "0xa4b1";
|
|
|
18
18
|
const OPTIMISM_MAINNET_CHAIN_ID = "0xa";
|
|
19
19
|
const CELO_MAINNET_CHAIN_ID = "0xa4ec";
|
|
20
20
|
const BASE_CHAIN_ID = "0x2105";
|
|
21
|
+
const LINEA_CHAIN_ID = "0xe708";
|
|
21
22
|
const SEPOLIA_CHAIN_ID = "0xaa36a7";
|
|
22
23
|
const POLYGON_AMOY_CHAIN_ID = "0x13882";
|
|
23
24
|
const BSC_TESTNET_CHAIN_ID = "0x61";
|
|
@@ -25,6 +26,7 @@ const AVALANCHE_TESTNET_CHAIN_ID = "0xa869";
|
|
|
25
26
|
const ARBITRUM_TESTNET_CHAIN_ID = "0x66eee";
|
|
26
27
|
const OPTIMISM_TESTNET_CHAIN_ID = "0xaa37dc";
|
|
27
28
|
const BASE_TESTNET_CHAIN_ID = "0x14a34";
|
|
29
|
+
const LINEA_SEPOLIA_CHAIN_ID = "0xe705";
|
|
28
30
|
const INFURA_KEY = process.env.VITE_APP_INFURA_PROJECT_KEY;
|
|
29
31
|
const SUPPORTED_NETWORKS = {
|
|
30
32
|
[MAINNET_CHAIN_ID]: {
|
|
@@ -104,17 +106,6 @@ const SUPPORTED_NETWORKS = {
|
|
|
104
106
|
ticker: "ETH",
|
|
105
107
|
tickerName: "Ethereum"
|
|
106
108
|
},
|
|
107
|
-
[XDAI_CHAIN_ID]: {
|
|
108
|
-
chainNamespace: CHAIN_NAMESPACES.EIP155,
|
|
109
|
-
decimals: 18,
|
|
110
|
-
blockExplorerUrl: "https://gnosis.blockscout.com",
|
|
111
|
-
chainId: XDAI_CHAIN_ID,
|
|
112
|
-
displayName: "xDai",
|
|
113
|
-
logo: "xDai.svg",
|
|
114
|
-
rpcTarget: `https://rpc.gnosischain.com`,
|
|
115
|
-
ticker: "DAI",
|
|
116
|
-
tickerName: "xDai Token"
|
|
117
|
-
},
|
|
118
109
|
[BASE_CHAIN_ID]: {
|
|
119
110
|
chainNamespace: CHAIN_NAMESPACES.EIP155,
|
|
120
111
|
decimals: 18,
|
|
@@ -126,6 +117,17 @@ const SUPPORTED_NETWORKS = {
|
|
|
126
117
|
ticker: "ETH",
|
|
127
118
|
tickerName: "Ethereum"
|
|
128
119
|
},
|
|
120
|
+
[LINEA_CHAIN_ID]: {
|
|
121
|
+
chainNamespace: CHAIN_NAMESPACES.EIP155,
|
|
122
|
+
decimals: 18,
|
|
123
|
+
blockExplorerUrl: "https://lineascan.build",
|
|
124
|
+
chainId: LINEA_CHAIN_ID,
|
|
125
|
+
displayName: "Linea",
|
|
126
|
+
logo: "linea.svg",
|
|
127
|
+
rpcTarget: `https://linea-mainnet.infura.io/v3/${INFURA_KEY}`,
|
|
128
|
+
ticker: "ETH",
|
|
129
|
+
tickerName: "Ethereum"
|
|
130
|
+
},
|
|
129
131
|
[SEPOLIA_CHAIN_ID]: {
|
|
130
132
|
chainNamespace: CHAIN_NAMESPACES.EIP155,
|
|
131
133
|
decimals: 18,
|
|
@@ -138,6 +140,18 @@ const SUPPORTED_NETWORKS = {
|
|
|
138
140
|
tickerName: "Ethereum",
|
|
139
141
|
isTestnet: true
|
|
140
142
|
},
|
|
143
|
+
[LINEA_SEPOLIA_CHAIN_ID]: {
|
|
144
|
+
chainNamespace: CHAIN_NAMESPACES.EIP155,
|
|
145
|
+
decimals: 18,
|
|
146
|
+
blockExplorerUrl: "https://sepolia.lineascan.build",
|
|
147
|
+
chainId: LINEA_SEPOLIA_CHAIN_ID,
|
|
148
|
+
displayName: "Linea Sepolia Testnet",
|
|
149
|
+
logo: "linea.svg",
|
|
150
|
+
rpcTarget: `https://linea-sepolia.infura.io/v3/${INFURA_KEY}`,
|
|
151
|
+
ticker: "ETH",
|
|
152
|
+
tickerName: "Ethereum",
|
|
153
|
+
isTestnet: true
|
|
154
|
+
},
|
|
141
155
|
[POLYGON_AMOY_CHAIN_ID]: {
|
|
142
156
|
chainNamespace: CHAIN_NAMESPACES.EIP155,
|
|
143
157
|
decimals: 18,
|
|
@@ -227,6 +241,8 @@ const METHOD_TYPES = {
|
|
|
227
241
|
ETH_GET_BLOCK_BY_HASH: "eth_getBlockByHash",
|
|
228
242
|
ETH_GET_CODE: "eth_getCode",
|
|
229
243
|
ETH_GET_GAS_PRICE: "eth_gasPrice",
|
|
244
|
+
ETH_PRIVATE_KEY: "eth_privateKey",
|
|
245
|
+
PRIVATE_KEY: "private_key",
|
|
230
246
|
SWITCH_CHAIN: "wallet_switchEthereumChain",
|
|
231
247
|
ADD_CHAIN: "wallet_addEthereumChain"
|
|
232
248
|
};
|
|
@@ -268,8 +284,8 @@ const OLD_ERC721_LIST = {
|
|
|
268
284
|
}
|
|
269
285
|
};
|
|
270
286
|
const TEST_CHAINS = [SEPOLIA_CHAIN_ID];
|
|
271
|
-
const
|
|
272
|
-
const
|
|
287
|
+
const MM_TOKEN_API_SUPPORTED_CHAINS = [MAINNET_CHAIN_ID, SEPOLIA_CHAIN_ID, BSC_MAINNET_CHAIN_ID, BSC_TESTNET_CHAIN_ID, OPTIMISM_MAINNET_CHAIN_ID, OPTIMISM_TESTNET_CHAIN_ID, AVALANCHE_MAINNET_CHAIN_ID, AVALANCHE_TESTNET_CHAIN_ID, ARBITRUM_MAINNET_CHAIN_ID, ARBITRUM_TESTNET_CHAIN_ID, POLYGON_CHAIN_ID, POLYGON_AMOY_CHAIN_ID, CELO_MAINNET_CHAIN_ID, BASE_CHAIN_ID, BASE_TESTNET_CHAIN_ID, LINEA_CHAIN_ID, LINEA_SEPOLIA_CHAIN_ID];
|
|
288
|
+
const MM_NFT_API_SUPPORTED_CHAINS = [MAINNET_CHAIN_ID, POLYGON_CHAIN_ID, BSC_MAINNET_CHAIN_ID, AVALANCHE_MAINNET_CHAIN_ID, LINEA_CHAIN_ID, BASE_CHAIN_ID];
|
|
273
289
|
const COINGECKO_SUPPORTED_CURRENCIES = new Set(["btc", "eth", "ltc", "bch", "bnb", "eos", "xrp", "xlm", "link", "dot", "yfi", "usd", "aed", "ars", "aud", "bdt", "bhd", "bmd", "brl", "cad", "chf", "clp", "cny", "czk", "dkk", "eur", "gbp", "hkd", "huf", "idr", "ils", "inr", "jpy", "krw", "kwd", "lkr", "mmk", "mxn", "myr", "ngn", "nok", "nzd", "php", "pkr", "pln", "rub", "sar", "sek", "sgd", "thb", "try", "twd", "uah", "vef", "vnd", "zar", "xdr", "xag", "xau", "bits", "sats"]);
|
|
274
290
|
const COINGECKO_PLATFORMS_CHAIN_CODE_MAP = {
|
|
275
291
|
[POLYGON_CHAIN_ID]: {
|
|
@@ -320,4 +336,4 @@ const SMART_ACCOUNT = {
|
|
|
320
336
|
NEXUS: "nexus"
|
|
321
337
|
};
|
|
322
338
|
|
|
323
|
-
export { ARBITRUM_MAINNET_CHAIN_ID, ARBITRUM_TESTNET_CHAIN_ID, AVALANCHE_MAINNET_CHAIN_ID, AVALANCHE_TESTNET_CHAIN_ID, BASE_CHAIN_ID, BASE_TESTNET_CHAIN_ID, BSC_MAINNET_CHAIN_ID, BSC_TESTNET_CHAIN_ID, CELO_MAINNET_CHAIN_ID, CHAIN_ID_TO_GAS_LIMIT_BUFFER_MAP, COINGECKO_PLATFORMS_CHAIN_CODE_MAP, COINGECKO_SUPPORTED_CURRENCIES, CONTRACT_TYPE_ERC1155, CONTRACT_TYPE_ERC20, CONTRACT_TYPE_ERC721, CONTRACT_TYPE_ETH, ERC1155_INTERFACE_ID, ERC721_ENUMERABLE_INTERFACE_ID, ERC721_INTERFACE_ID, ERC721_METADATA_INTERFACE_ID,
|
|
339
|
+
export { ARBITRUM_MAINNET_CHAIN_ID, ARBITRUM_TESTNET_CHAIN_ID, AVALANCHE_MAINNET_CHAIN_ID, AVALANCHE_TESTNET_CHAIN_ID, BASE_CHAIN_ID, BASE_TESTNET_CHAIN_ID, BSC_MAINNET_CHAIN_ID, BSC_TESTNET_CHAIN_ID, CELO_MAINNET_CHAIN_ID, CHAIN_ID_TO_GAS_LIMIT_BUFFER_MAP, COINGECKO_PLATFORMS_CHAIN_CODE_MAP, COINGECKO_SUPPORTED_CURRENCIES, CONTRACT_TYPE_ERC1155, CONTRACT_TYPE_ERC20, CONTRACT_TYPE_ERC721, CONTRACT_TYPE_ETH, ERC1155_INTERFACE_ID, ERC721_ENUMERABLE_INTERFACE_ID, ERC721_INTERFACE_ID, ERC721_METADATA_INTERFACE_ID, GAS_ESTIMATE_TYPES, LINEA_CHAIN_ID, LINEA_SEPOLIA_CHAIN_ID, LOCALHOST, MAINNET_CHAIN_ID, METHOD_TYPES, MM_NFT_API_SUPPORTED_CHAINS, MM_TOKEN_API_SUPPORTED_CHAINS, OLD_ERC721_LIST, OPTIMISM_MAINNET_CHAIN_ID, OPTIMISM_TESTNET_CHAIN_ID, POLYGON_AMOY_CHAIN_ID, POLYGON_CHAIN_ID, SEPOLIA_CHAIN_ID, SMART_ACCOUNT, SUPPORTED_NETWORKS, TEST_CHAINS, TRANSACTION_ENVELOPE_TYPES, XDAI_CHAIN_ID };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toruslabs/ethereum-controllers",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.2.0",
|
|
4
4
|
"homepage": "https://github.com/torusresearch/controllers#readme",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -11,17 +11,16 @@
|
|
|
11
11
|
"types": "dist/lib.cjs/types/index.d.ts",
|
|
12
12
|
"author": "Torus Labs",
|
|
13
13
|
"scripts": {
|
|
14
|
-
"test": "TS_NODE_PROJECT=./tsconfig.test.json mocha -r dotenv/config --config ../../.mocharc.json test/**/*.ts",
|
|
15
|
-
"test-debugger": "TS_NODE_PROJECT=./tsconfig.test.json mocha -r dotenv/config --config ../../.mocharc.json --inspect-brk test/**/*.ts",
|
|
16
14
|
"dev": "rimraf dist/ && cross-env NODE_ENV=development torus-scripts start",
|
|
17
15
|
"build": "rimraf dist/ && cross-env NODE_ENV=production torus-scripts build",
|
|
18
16
|
"lint": "eslint --fix 'src/**/*.ts' 'test/**/*.ts'",
|
|
19
17
|
"prepack": "npm run build",
|
|
20
|
-
"pre-commit": "lint-staged --cwd ."
|
|
18
|
+
"pre-commit": "lint-staged --cwd .",
|
|
19
|
+
"test": "vitest run --config test/configs/browsers.config.mts --coverage"
|
|
21
20
|
},
|
|
22
21
|
"dependencies": {
|
|
23
22
|
"@ethereumjs/util": "^9.1.0",
|
|
24
|
-
"@toruslabs/base-controllers": "^8.
|
|
23
|
+
"@toruslabs/base-controllers": "^8.1.0",
|
|
25
24
|
"@toruslabs/http-helpers": "^8.1.1",
|
|
26
25
|
"@web3auth/auth": "^10.2.3",
|
|
27
26
|
"async-mutex": "^0.5.0",
|
|
@@ -34,7 +33,7 @@
|
|
|
34
33
|
"jsonschema": "^1.5.0",
|
|
35
34
|
"loglevel": "^1.9.2",
|
|
36
35
|
"permissionless": "^0.2.38",
|
|
37
|
-
"viem": "^2.23.
|
|
36
|
+
"viem": "^2.23.15"
|
|
38
37
|
},
|
|
39
38
|
"peerDependencies": {
|
|
40
39
|
"@babel/runtime": "7.x"
|
|
@@ -63,22 +62,9 @@
|
|
|
63
62
|
"publishConfig": {
|
|
64
63
|
"access": "public"
|
|
65
64
|
},
|
|
66
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "ca2533b18b1b9783d87b76f412d2a9ef0873f8c8",
|
|
67
66
|
"devDependencies": {
|
|
68
|
-
"@nomicfoundation/hardhat-chai-matchers": "^2.0.8",
|
|
69
|
-
"@nomicfoundation/hardhat-ethers": "^3.0.8",
|
|
70
|
-
"@nomicfoundation/hardhat-ignition-ethers": "^0.15.10",
|
|
71
|
-
"@nomicfoundation/hardhat-network-helpers": "^1.0.12",
|
|
72
|
-
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
|
|
73
|
-
"@nomicfoundation/hardhat-verify": "^2.0.13",
|
|
74
67
|
"@typechain/ethers-v6": "^0.5.1",
|
|
75
|
-
"
|
|
76
|
-
"@types/proxyquire": "^1.3.31",
|
|
77
|
-
"@types/sinon": "^17.0.4",
|
|
78
|
-
"hardhat": "^2.22.19",
|
|
79
|
-
"proxyquire": "^2.1.3",
|
|
80
|
-
"solidity-coverage": "^0.8.14",
|
|
81
|
-
"typechain": "^8.3.2",
|
|
82
|
-
"undici": "^7.5.0"
|
|
68
|
+
"typechain": "^8.3.2"
|
|
83
69
|
}
|
|
84
70
|
}
|