@openocean.finance/wallet 1.2.5 → 1.2.6
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.
|
@@ -2,7 +2,7 @@ import BaseWallet from "../Wallets/BaseWallet";
|
|
|
2
2
|
import { Chain } from "./../Chains";
|
|
3
3
|
import { EnumChains, EnumWalletName } from "./../types";
|
|
4
4
|
interface ReqConnectWalletVo {
|
|
5
|
-
|
|
5
|
+
chainName: EnumChains;
|
|
6
6
|
walletName: EnumWalletName;
|
|
7
7
|
localRpcUrl?: string;
|
|
8
8
|
noSwitch?: boolean;
|
|
@@ -337,10 +337,10 @@ function tryWalletConnect(reqConnectWalletVo) {
|
|
|
337
337
|
return __generator(this, function (_a) {
|
|
338
338
|
switch (_a.label) {
|
|
339
339
|
case 0:
|
|
340
|
-
if (!reqConnectWalletVo.
|
|
340
|
+
if (!reqConnectWalletVo.chainName || !reqConnectWalletVo.walletName) {
|
|
341
341
|
throw new Error('Parameter error.');
|
|
342
342
|
}
|
|
343
|
-
chain = Chains_1.chainsObj.chainObj[reqConnectWalletVo.
|
|
343
|
+
chain = Chains_1.chainsObj.chainObj[reqConnectWalletVo.chainName];
|
|
344
344
|
if (!chain)
|
|
345
345
|
throw new Error('Chain error.');
|
|
346
346
|
wallet = {};
|
|
@@ -376,7 +376,7 @@ function tryWalletConnect(reqConnectWalletVo) {
|
|
|
376
376
|
localProvider = null;
|
|
377
377
|
localRpcUrl = '';
|
|
378
378
|
if (chain.compiler == 'EVM') {
|
|
379
|
-
params = Chains_1.EthereumChainParams[reqConnectWalletVo.
|
|
379
|
+
params = Chains_1.EthereumChainParams[reqConnectWalletVo.chainName];
|
|
380
380
|
if (params) {
|
|
381
381
|
localRpcUrl = params[0].rpcUrls[0];
|
|
382
382
|
}
|