@openocean.finance/wallet 0.4.4 → 0.4.5

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.
@@ -94,7 +94,6 @@ var MetaMask = /** @class */ (function (_super) {
94
94
  _this.sdk = null;
95
95
  return _this;
96
96
  }
97
- // web3 = new Web3(Web3.givenProvider || window.safepal_wallet_app);
98
97
  /**
99
98
  * connect metamask and get wallet address
100
99
  * @param chainId specific chainId,throw error when not match
@@ -105,10 +104,10 @@ var MetaMask = /** @class */ (function (_super) {
105
104
  return __generator(this, function (_a) {
106
105
  switch (_a.label) {
107
106
  case 0:
108
- if (!((window.ethereum && window.ethereum.isMetaMask) || (web3_1.default && web3_1.default.givenProvider) || window.safepal_wallet_app)) {
107
+ if (!(window.ethereum || (web3_1.default && web3_1.default.givenProvider) || window.safepal_wallet_app)) {
109
108
  throw new Error(types_1.EnumErrors.NotMetamask);
110
109
  }
111
- this.sdk = new web3_1.default(window.ethereum || web3_1.default.givenProvider || window.safepal_wallet_app);
110
+ this.sdk = new web3_1.default(web3_1.default.givenProvider || window.ethereum || window.safepal_wallet_app);
112
111
  return [4 /*yield*/, this.sdk.eth.requestAccounts()];
113
112
  case 1:
114
113
  address = (_a.sent())[0];
@@ -10,6 +10,6 @@ declare class NearWallet extends BaseWallet {
10
10
  * connect metamask and get wallet address
11
11
  * @param chainId specific chainId,throw error when not match
12
12
  */
13
- requestConnect(chainId?: number): Promise<any>;
13
+ requestConnect(): Promise<any>;
14
14
  }
15
15
  export default NearWallet;
@@ -78,12 +78,11 @@ var NearWallet = /** @class */ (function (_super) {
78
78
  _this.sdk = null;
79
79
  return _this;
80
80
  }
81
- // web3 = new Web3(Web3.givenProvider || window.safepal_wallet_app);
82
81
  /**
83
82
  * connect metamask and get wallet address
84
83
  * @param chainId specific chainId,throw error when not match
85
84
  */
86
- NearWallet.prototype.requestConnect = function (chainId) {
85
+ NearWallet.prototype.requestConnect = function () {
87
86
  return __awaiter(this, void 0, void 0, function () {
88
87
  var keyStore, config, near, account, address;
89
88
  return __generator(this, function (_a) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openocean.finance/wallet",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "A multi-chain wallets manager",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {