@openocean.finance/wallet 0.4.4 → 0.4.7
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/lib/Wallets/MetaMask.js
CHANGED
|
@@ -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 (!(
|
|
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(
|
|
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(
|
|
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 (
|
|
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) {
|
|
@@ -93,7 +92,7 @@ var NearWallet = /** @class */ (function (_super) {
|
|
|
93
92
|
config = {
|
|
94
93
|
networkId: "mainnet",
|
|
95
94
|
keyStore: keyStore,
|
|
96
|
-
nodeUrl: "https://rpc.
|
|
95
|
+
nodeUrl: "https://public-rpc.blockpi.io/http/near",
|
|
97
96
|
walletUrl: "https://wallet.mainnet.near.org",
|
|
98
97
|
helperUrl: "https://helper.mainnet.near.org",
|
|
99
98
|
explorerUrl: "https://explorer.mainnet.near.org",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openocean.finance/wallet",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"description": "A multi-chain wallets manager",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"@project-serum/sol-wallet-adapter": "0.2.0",
|
|
47
47
|
"@solana/web3.js": "1.31.0",
|
|
48
48
|
"@terra-money/terra.js": "3.0.8",
|
|
49
|
-
"@walletconnect/web3-provider": "^1.
|
|
50
|
-
"web3": "^1.
|
|
49
|
+
"@walletconnect/web3-provider": "^1.7.8",
|
|
50
|
+
"web3": "^1.7.4",
|
|
51
51
|
"buffer": "^6.0.3",
|
|
52
52
|
"fs": "^0.0.1-security",
|
|
53
53
|
"path-browserify": "^1.0.1",
|