@openocean.finance/wallet 0.4.16 → 0.4.19

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.
@@ -103,6 +103,7 @@ var WalletConnect = /** @class */ (function (_super) {
103
103
  _this.type = types_1.EnumWalletType.WalletConnect;
104
104
  _this.sdk = null;
105
105
  _this.provider = new web3_provider_1.default({
106
+ infuraId: '2c7c4d86c2c746c89de722551b606119',
106
107
  chainId: 1,
107
108
  rpc: {
108
109
  69: "https://kovan.optimism.io",
@@ -150,10 +151,12 @@ var WalletConnect = /** @class */ (function (_super) {
150
151
  return __generator(this, function (_a) {
151
152
  switch (_a.label) {
152
153
  case 0:
153
- if (!this.infuraId) {
154
- throw new Error("infuraId not set");
155
- }
156
- this.provider.infuraId = this.infuraId;
154
+ // this.provider.infuraId = this.infuraId
155
+ // await this.provider.disconnect()
156
+ // await new Promise(r => {
157
+ // setTimeout(r, 200);
158
+ // })
159
+ this.provider.chainId = chainId;
157
160
  this.provider.updateRpcUrl(chainId);
158
161
  return [4 /*yield*/, this.provider.enable()];
159
162
  case 1:
@@ -162,13 +165,13 @@ var WalletConnect = /** @class */ (function (_super) {
162
165
  return [4 /*yield*/, this.sdk.eth.getChainId()];
163
166
  case 2:
164
167
  currentChainId = _a.sent();
165
- if (!(chainId && currentChainId != chainId && (this.sdk.currentProvider.walletMeta && this.sdk.currentProvider.walletMeta.name != "MetaMask"))) return [3 /*break*/, 6];
168
+ if (!(chainId && currentChainId != chainId)) return [3 /*break*/, 6];
166
169
  if (!(config || !config.isTow)) return [3 /*break*/, 6];
167
170
  return [4 /*yield*/, this.provider.disconnect()];
168
171
  case 3:
169
172
  _a.sent();
170
173
  return [4 /*yield*/, new Promise(function (r) {
171
- setTimeout(r, 1000);
174
+ setTimeout(r, 500);
172
175
  })];
173
176
  case 4:
174
177
  _a.sent();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openocean.finance/wallet",
3
- "version": "0.4.16",
3
+ "version": "0.4.19",
4
4
  "description": "A multi-chain wallets manager",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {