@openocean.finance/wallet 0.4.44 → 0.4.46

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.
@@ -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();
@@ -11,6 +11,6 @@ declare class MartianWallet extends BaseWallet {
11
11
  /**
12
12
  * connect metamask and get wallet address
13
13
  */
14
- requestAptosConnect(): Promise<string>;
14
+ requestAptosConnect(): Promise<any>;
15
15
  }
16
16
  export default MartianWallet;
@@ -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 _this = this;
85
+ var result, address;
85
86
  return __generator(this, function (_a) {
86
- return [2 /*return*/, new Promise(function (res) { return __awaiter(_this, void 0, void 0, function () {
87
- var _this = this;
88
- return __generator(this, function (_a) {
89
- setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {
90
- var address;
91
- return __generator(this, function (_a) {
92
- switch (_a.label) {
93
- case 0:
94
- if (!window.martian) {
95
- throw new Error(types_1.EnumErrors.NoMartianWallet);
96
- }
97
- return [4 /*yield*/, window.martian.connect()];
98
- case 1:
99
- address = (_a.sent()).address;
100
- this.sdk = window.martian;
101
- this.address = address;
102
- this.chainId = ""; // todo tron chainId
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
+ }, 3000)];
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
  };
@@ -108,7 +108,8 @@ var UnstoppableDomains = /** @class */ (function (_super) {
108
108
  case 0:
109
109
  uauth = new js_1.default({
110
110
  clientID: "05c3a150-4fef-49c9-a153-af16851c75ba",
111
- redirectUri: window.location.origin + (window.location.pathname || ""),
111
+ redirectUri: "https://app.openocean.finance/CLASSIC",
112
+ // redirectUri: window.location.origin + (window.location.pathname || ""),
112
113
  // responseMode: "fragment",
113
114
  // clientAuthMethod: "none",
114
115
  prompt: "login",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openocean.finance/wallet",
3
- "version": "0.4.44",
3
+ "version": "0.4.46",
4
4
  "description": "A multi-chain wallets manager",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {