@openocean.finance/wallet 0.4.43 → 0.4.45

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.
@@ -85,19 +85,30 @@ var TronLink = /** @class */ (function (_super) {
85
85
  var _this = this;
86
86
  return __generator(this, function (_a) {
87
87
  return [2 /*return*/, new Promise(function (res) { return __awaiter(_this, void 0, void 0, function () {
88
- var result, account;
88
+ var result, tronWeb, res_1, account;
89
89
  return __generator(this, function (_a) {
90
90
  switch (_a.label) {
91
91
  case 0: return [4 /*yield*/, (0, helper_1.autoWalletCheck)(function () {
92
- return window.tronWeb && window.tronWeb.defaultAddress && window.tronWeb.defaultAddress.base58;
92
+ return window.tronLink;
93
93
  }, 3000, 30)];
94
94
  case 1:
95
95
  result = _a.sent();
96
96
  if (!result) {
97
97
  throw new Error(types_1.EnumErrors.NoTronLink);
98
98
  }
99
- account = window.tronWeb.defaultAddress.base58;
100
- this.sdk = window.tronWeb;
99
+ if (!window.tronLink.ready) return [3 /*break*/, 2];
100
+ tronWeb = window.tronLink.tronWeb;
101
+ return [3 /*break*/, 4];
102
+ case 2: return [4 /*yield*/, window.tronLink.request({ method: 'tron_requestAccounts' })];
103
+ case 3:
104
+ res_1 = _a.sent();
105
+ if (res_1.code === 200) {
106
+ tronWeb = window.tronLink.tronWeb;
107
+ }
108
+ _a.label = 4;
109
+ case 4:
110
+ account = tronWeb.defaultAddress.base58;
111
+ this.sdk = tronWeb;
101
112
  this.address = account;
102
113
  this.chainId = ''; // todo tron chainId
103
114
  res(account);
@@ -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.43",
3
+ "version": "0.4.45",
4
4
  "description": "A multi-chain wallets manager",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {