@openocean.finance/wallet 0.4.45 → 0.4.47
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/Coin98.js
CHANGED
|
@@ -120,7 +120,7 @@ var Coin98 = /** @class */ (function (_super) {
|
|
|
120
120
|
return __generator(this, function (_a) {
|
|
121
121
|
switch (_a.label) {
|
|
122
122
|
case 0: return [4 /*yield*/, (0, helper_1.autoWalletCheck)(function () {
|
|
123
|
-
return window.ethereum.isCoin98 || (window.coin98 && window.coin98.sol);
|
|
123
|
+
return (window.ethereum && window.ethereum.isCoin98) || (window.coin98 && window.coin98.sol);
|
|
124
124
|
}, 3000)];
|
|
125
125
|
case 1:
|
|
126
126
|
result = _a.sent();
|
|
@@ -64,6 +64,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
64
64
|
var martian_svg_1 = __importDefault(require("../assets/martian.svg"));
|
|
65
65
|
var types_1 = require("../types");
|
|
66
66
|
var BaseWallet_1 = __importDefault(require("./BaseWallet"));
|
|
67
|
+
var helper_1 = require("../helper");
|
|
67
68
|
var MartianWallet = /** @class */ (function (_super) {
|
|
68
69
|
__extends(MartianWallet, _super);
|
|
69
70
|
function MartianWallet() {
|
|
@@ -81,33 +82,25 @@ var MartianWallet = /** @class */ (function (_super) {
|
|
|
81
82
|
*/
|
|
82
83
|
MartianWallet.prototype.requestAptosConnect = function () {
|
|
83
84
|
return __awaiter(this, void 0, void 0, function () {
|
|
84
|
-
var
|
|
85
|
+
var result, address;
|
|
85
86
|
return __generator(this, function (_a) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
res(address);
|
|
104
|
-
return [2 /*return*/];
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
}); }, 1000);
|
|
108
|
-
return [2 /*return*/];
|
|
109
|
-
});
|
|
110
|
-
}); })];
|
|
87
|
+
switch (_a.label) {
|
|
88
|
+
case 0: return [4 /*yield*/, (0, helper_1.autoWalletCheck)(function () {
|
|
89
|
+
return window.martian;
|
|
90
|
+
}, 1500)];
|
|
91
|
+
case 1:
|
|
92
|
+
result = _a.sent();
|
|
93
|
+
if (!result) {
|
|
94
|
+
throw new Error(types_1.EnumErrors.NoMartianWallet);
|
|
95
|
+
}
|
|
96
|
+
return [4 /*yield*/, window.martian.connect()];
|
|
97
|
+
case 2:
|
|
98
|
+
address = (_a.sent()).address;
|
|
99
|
+
this.sdk = window.martian;
|
|
100
|
+
this.address = address;
|
|
101
|
+
this.chainId = ""; // todo tron chainId
|
|
102
|
+
return [2 /*return*/, address];
|
|
103
|
+
}
|
|
111
104
|
});
|
|
112
105
|
});
|
|
113
106
|
};
|