@injectivelabs/wallet-cosmos 1.17.2-alpha.0 → 1.17.2-alpha.1

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.
@@ -50,7 +50,7 @@ function _defineProperty(e, r, t) {
50
50
 
51
51
  //#endregion
52
52
  //#region src/wallet.ts
53
- const $window = typeof window !== "undefined" ? window : {};
53
+ const getWindow = () => typeof window !== "undefined" ? window : {};
54
54
  var CosmosWallet = class CosmosWallet {
55
55
  constructor({ wallet, chainId }) {
56
56
  _defineProperty(this, "wallet", void 0);
@@ -209,6 +209,7 @@ var CosmosWallet = class CosmosWallet {
209
209
  }
210
210
  getCosmos() {
211
211
  const { wallet } = this;
212
+ const $window = getWindow();
212
213
  if (!$window) throw new __injectivelabs_exceptions.CosmosWalletException(/* @__PURE__ */ new Error(`Please install ${(0, __injectivelabs_utils.capitalize)(wallet)} extension`), {
213
214
  code: __injectivelabs_exceptions.UnspecifiedErrorCode,
214
215
  type: __injectivelabs_exceptions.ErrorType.WalletNotInstalledError,
@@ -264,12 +265,12 @@ const cosmosWallets$1 = [
264
265
  //#endregion
265
266
  //#region src/utils/index.ts
266
267
  const isCosmosWalletInstalled = (wallet) => {
267
- const $window$1 = typeof window !== "undefined" ? window : {};
268
+ const $window = typeof window !== "undefined" ? window : {};
268
269
  switch (wallet) {
269
- case __injectivelabs_wallet_base.Wallet.Keplr: return $window$1.keplr !== void 0;
270
- case __injectivelabs_wallet_base.Wallet.Ninji: return $window$1.ninji !== void 0;
271
- case __injectivelabs_wallet_base.Wallet.Leap: return $window$1.leap !== void 0;
272
- case __injectivelabs_wallet_base.Wallet.OWallet: return $window$1.oWallet !== void 0;
270
+ case __injectivelabs_wallet_base.Wallet.Keplr: return $window.keplr !== void 0;
271
+ case __injectivelabs_wallet_base.Wallet.Ninji: return $window.ninji !== void 0;
272
+ case __injectivelabs_wallet_base.Wallet.Leap: return $window.leap !== void 0;
273
+ case __injectivelabs_wallet_base.Wallet.OWallet: return $window.oWallet !== void 0;
273
274
  default: return false;
274
275
  }
275
276
  };
package/dist/esm/index.js CHANGED
@@ -50,7 +50,7 @@ function _defineProperty(e, r, t) {
50
50
 
51
51
  //#endregion
52
52
  //#region src/wallet.ts
53
- const $window = typeof window !== "undefined" ? window : {};
53
+ const getWindow = () => typeof window !== "undefined" ? window : {};
54
54
  var CosmosWallet = class CosmosWallet {
55
55
  constructor({ wallet, chainId }) {
56
56
  _defineProperty(this, "wallet", void 0);
@@ -209,6 +209,7 @@ var CosmosWallet = class CosmosWallet {
209
209
  }
210
210
  getCosmos() {
211
211
  const { wallet } = this;
212
+ const $window = getWindow();
212
213
  if (!$window) throw new CosmosWalletException(/* @__PURE__ */ new Error(`Please install ${capitalize(wallet)} extension`), {
213
214
  code: UnspecifiedErrorCode,
214
215
  type: ErrorType.WalletNotInstalledError,
@@ -264,12 +265,12 @@ const cosmosWallets$1 = [
264
265
  //#endregion
265
266
  //#region src/utils/index.ts
266
267
  const isCosmosWalletInstalled = (wallet) => {
267
- const $window$1 = typeof window !== "undefined" ? window : {};
268
+ const $window = typeof window !== "undefined" ? window : {};
268
269
  switch (wallet) {
269
- case Wallet.Keplr: return $window$1.keplr !== void 0;
270
- case Wallet.Ninji: return $window$1.ninji !== void 0;
271
- case Wallet.Leap: return $window$1.leap !== void 0;
272
- case Wallet.OWallet: return $window$1.oWallet !== void 0;
270
+ case Wallet.Keplr: return $window.keplr !== void 0;
271
+ case Wallet.Ninji: return $window.ninji !== void 0;
272
+ case Wallet.Leap: return $window.leap !== void 0;
273
+ case Wallet.OWallet: return $window.oWallet !== void 0;
273
274
  default: return false;
274
275
  }
275
276
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@injectivelabs/wallet-cosmos",
3
- "version": "1.17.2-alpha.0",
3
+ "version": "1.17.2-alpha.1",
4
4
  "description": "Cosmos wallet strategies for use with @injectivelabs/wallet-core.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -41,11 +41,11 @@
41
41
  "@cosmjs/proto-signing": "0.33.0",
42
42
  "@cosmjs/stargate": "0.33.0",
43
43
  "@keplr-wallet/types": "^0.12.296",
44
- "@injectivelabs/exceptions": "1.17.2-alpha.0",
45
- "@injectivelabs/ts-types": "1.17.2-alpha.0",
46
- "@injectivelabs/sdk-ts": "1.17.2-alpha.0",
47
- "@injectivelabs/wallet-base": "1.17.2-alpha.0",
48
- "@injectivelabs/utils": "1.17.2-alpha.0"
44
+ "@injectivelabs/exceptions": "1.17.2-alpha.1",
45
+ "@injectivelabs/ts-types": "1.17.2-alpha.1",
46
+ "@injectivelabs/utils": "1.17.2-alpha.1",
47
+ "@injectivelabs/sdk-ts": "1.17.2-alpha.1",
48
+ "@injectivelabs/wallet-base": "1.17.2-alpha.1"
49
49
  },
50
50
  "publishConfig": {
51
51
  "access": "public"