@openocean.finance/wallet 0.4.49 → 0.4.51
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/KeplrWallet.js +1 -1
- package/lib/Wallets/NearWallet.js +17 -13
- package/lib/helper.d.ts +1 -0
- package/lib/helper.js +7 -1
- package/lib/types.d.ts +1 -2
- package/lib/types.js +1 -2
- package/package.json +1 -1
|
@@ -72,7 +72,7 @@ var KeplrWallet = /** @class */ (function (_super) {
|
|
|
72
72
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
73
73
|
_this.name = types_1.EnumWalletName.keplrWallet;
|
|
74
74
|
_this.icon = keplr_png_1.default;
|
|
75
|
-
_this.supportChains = [types_1.EnumChains.
|
|
75
|
+
_this.supportChains = [types_1.EnumChains.Cosmos];
|
|
76
76
|
_this.type = types_1.EnumWalletType.Web;
|
|
77
77
|
_this.sdk = null;
|
|
78
78
|
_this.installUrl = "https://chrome.google.com/webstore/detail/keplr/dmkamcknogkgcdfhhbddcghachkejeap";
|
|
@@ -67,6 +67,7 @@ var BaseWallet_1 = __importDefault(require("./BaseWallet"));
|
|
|
67
67
|
var near_api_js_1 = require("near-api-js");
|
|
68
68
|
var transaction_1 = require("near-api-js/lib/transaction");
|
|
69
69
|
var utils_1 = require("near-api-js/lib/utils");
|
|
70
|
+
var helper_1 = require("../helper");
|
|
70
71
|
var NearWallet = /** @class */ (function (_super) {
|
|
71
72
|
__extends(NearWallet, _super);
|
|
72
73
|
function NearWallet() {
|
|
@@ -119,28 +120,31 @@ var NearWallet = /** @class */ (function (_super) {
|
|
|
119
120
|
var wallet, account;
|
|
120
121
|
return __generator(this, function (_a) {
|
|
121
122
|
switch (_a.label) {
|
|
122
|
-
case 0: return [4 /*yield*/, (0,
|
|
123
|
-
networkId: "mainnet",
|
|
124
|
-
keyStore: new near_api_js_1.keyStores.BrowserLocalStorageKeyStore(),
|
|
125
|
-
nodeUrl: "https://rpc.mainnet.near.org",
|
|
126
|
-
walletUrl: "https://wallet.mainnet.near.org",
|
|
127
|
-
helperUrl: "https://helper.mainnet.near.org",
|
|
128
|
-
headers: {}
|
|
129
|
-
// explorerUrl: "https://explorer.mainnet.near.org",
|
|
130
|
-
})];
|
|
123
|
+
case 0: return [4 /*yield*/, (0, helper_1.sleep)(1000)];
|
|
131
124
|
case 1:
|
|
125
|
+
_a.sent();
|
|
126
|
+
return [4 /*yield*/, (0, near_api_js_1.connect)({
|
|
127
|
+
networkId: "mainnet",
|
|
128
|
+
keyStore: new near_api_js_1.keyStores.BrowserLocalStorageKeyStore(),
|
|
129
|
+
nodeUrl: "https://rpc.mainnet.near.org",
|
|
130
|
+
walletUrl: "https://wallet.mainnet.near.org",
|
|
131
|
+
helperUrl: "https://helper.mainnet.near.org",
|
|
132
|
+
headers: {}
|
|
133
|
+
// explorerUrl: "https://explorer.mainnet.near.org",
|
|
134
|
+
})];
|
|
135
|
+
case 2:
|
|
132
136
|
wallet = _a.sent();
|
|
133
137
|
this.sdk = new near_api_js_1.WalletConnection(wallet, 'openOcen');
|
|
134
138
|
account = this.sdk.account();
|
|
135
|
-
if (!!account.accountId) return [3 /*break*/,
|
|
139
|
+
if (!!account.accountId) return [3 /*break*/, 4];
|
|
136
140
|
return [4 /*yield*/, this.sdk.requestSignIn({
|
|
137
141
|
contractId: 'a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.factory.bridge.near',
|
|
138
142
|
methodNames: [], // optional
|
|
139
143
|
})];
|
|
140
|
-
case 2:
|
|
141
|
-
_a.sent();
|
|
142
|
-
_a.label = 3;
|
|
143
144
|
case 3:
|
|
145
|
+
_a.sent();
|
|
146
|
+
_a.label = 4;
|
|
147
|
+
case 4:
|
|
144
148
|
account = this.sdk.account();
|
|
145
149
|
this.address = account.accountId;
|
|
146
150
|
return [2 /*return*/, this.address || ''];
|
package/lib/helper.d.ts
CHANGED
package/lib/helper.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.autoWalletCheck = void 0;
|
|
3
|
+
exports.sleep = exports.autoWalletCheck = void 0;
|
|
4
4
|
function autoWalletCheck(check, time, count) {
|
|
5
5
|
return new Promise(function (resolve) {
|
|
6
6
|
var i = 0;
|
|
@@ -22,3 +22,9 @@ function autoWalletCheck(check, time, count) {
|
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
exports.autoWalletCheck = autoWalletCheck;
|
|
25
|
+
function sleep(interval) {
|
|
26
|
+
return new Promise(function (resolve) {
|
|
27
|
+
setTimeout(resolve, interval);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
exports.sleep = sleep;
|
package/lib/types.d.ts
CHANGED
package/lib/types.js
CHANGED
|
@@ -33,8 +33,7 @@ var EnumChains;
|
|
|
33
33
|
EnumChains["Aurora"] = "aurora";
|
|
34
34
|
EnumChains["Cronos"] = "cronos";
|
|
35
35
|
EnumChains["Harmony"] = "harmony";
|
|
36
|
-
EnumChains["
|
|
37
|
-
EnumChains["Sifchain"] = "sifchain";
|
|
36
|
+
EnumChains["Cosmos"] = "cosmos";
|
|
38
37
|
EnumChains["Flow"] = "flow";
|
|
39
38
|
EnumChains["Aptos"] = "aptos";
|
|
40
39
|
})(EnumChains = exports.EnumChains || (exports.EnumChains = {}));
|