@dynamic-labs/cosmos 4.47.3 → 4.48.0

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/CHANGELOG.md CHANGED
@@ -1,4 +1,19 @@
1
1
 
2
+ ## [4.48.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.47.3...v4.48.0) (2025-12-01)
3
+
4
+
5
+ ### Features
6
+
7
+ * export share view ([#9973](https://github.com/dynamic-labs/dynamic-auth/issues/9973)) ([41831bf](https://github.com/dynamic-labs/dynamic-auth/commit/41831bf31f5661fae3a6664643f7b2e7875df137))
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * add logout button to MFA verification view ([#9972](https://github.com/dynamic-labs/dynamic-auth/issues/9972)) ([240a286](https://github.com/dynamic-labs/dynamic-auth/commit/240a2864ca92ff2262720797001327b5721bd894))
13
+ * allow user to login with MFA after logout ([#9975](https://github.com/dynamic-labs/dynamic-auth/issues/9975)) ([b404874](https://github.com/dynamic-labs/dynamic-auth/commit/b404874d65ffca166f8f2e8289a6624c685fa257))
14
+ * issue connecting with custom cosmos chain using Keplr wallet ([#9995](https://github.com/dynamic-labs/dynamic-auth/issues/9995)) ([8e045ea](https://github.com/dynamic-labs/dynamic-auth/commit/8e045ea084299f5264ae7a7515fd8d68d4f9caf2))
15
+ * support waas wallet for cookie-auth with optional custom KeyshareRelayBaseUrl ([#9994](https://github.com/dynamic-labs/dynamic-auth/issues/9994)) ([d768378](https://github.com/dynamic-labs/dynamic-auth/commit/d768378693a1cd11e89b0f59f8219ac9fd8690f9))
16
+
2
17
  ### [4.47.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.47.2...v4.47.3) (2025-11-27)
3
18
 
4
19
  ### [4.47.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.47.1...v4.47.2) (2025-11-27)
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.47.3";
6
+ var version = "4.48.0";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.47.3";
2
+ var version = "4.48.0";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/cosmos",
3
- "version": "4.47.3",
3
+ "version": "4.48.0",
4
4
  "description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
5
5
  "author": "Dynamic Labs, Inc.",
6
6
  "license": "MIT",
@@ -19,11 +19,11 @@
19
19
  "homepage": "https://www.dynamic.xyz/",
20
20
  "dependencies": {
21
21
  "@keplr-wallet/types": "0.12.121",
22
- "@dynamic-labs/assert-package-version": "4.47.3",
23
- "@dynamic-labs/types": "4.47.3",
24
- "@dynamic-labs/utils": "4.47.3",
25
- "@dynamic-labs/wallet-book": "4.47.3",
26
- "@dynamic-labs/wallet-connector-core": "4.47.3"
22
+ "@dynamic-labs/assert-package-version": "4.48.0",
23
+ "@dynamic-labs/types": "4.48.0",
24
+ "@dynamic-labs/utils": "4.48.0",
25
+ "@dynamic-labs/wallet-book": "4.48.0",
26
+ "@dynamic-labs/wallet-connector-core": "4.48.0"
27
27
  },
28
28
  "peerDependencies": {}
29
29
  }
@@ -5,15 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var _tslib = require('../../_virtual/_tslib.cjs');
7
7
  var utils = require('@dynamic-labs/utils');
8
+ var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
8
9
  var CosmosWalletConnector = require('./CosmosWalletConnector.cjs');
9
10
 
10
- const isSeiNotEnabledError = (error) => {
11
- if (!error ||
12
- !Object.prototype.hasOwnProperty.call(error, 'message') ||
13
- typeof error.message !== 'string')
14
- return false;
15
- return error.message.includes('There is no modular chain info for pacific-1');
16
- };
17
11
  class KeplrWalletConnector extends CosmosWalletConnector.CosmosWalletConnector {
18
12
  constructor() {
19
13
  super(...arguments);
@@ -29,34 +23,35 @@ class KeplrWalletConnector extends CosmosWalletConnector.CosmosWalletConnector {
29
23
  }
30
24
  return window.keplr;
31
25
  }
32
- connect() {
33
- const _super = Object.create(null, {
34
- connect: { get: () => super.connect }
26
+ enableChains() {
27
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
28
+ var _a, _b;
29
+ // returns all chains that are enabled in Keplr wallet
30
+ const chainsEnabledInWallet = yield ((_a = this.getWallet()) === null || _a === void 0 ? void 0 : _a.getChainInfosWithoutEndpoints());
31
+ walletConnectorCore.logger.logVerboseTroubleshootingMessage(`[KeplrWalletConnector] Chains enabled in wallet: ${chainsEnabledInWallet === null || chainsEnabledInWallet === void 0 ? void 0 : chainsEnabledInWallet.map((chain) => chain.chainId).join(', ')}`);
32
+ const chainsToEnable = this.chainIdMapping
33
+ .filter((mapping) => !mapping.experimental)
34
+ .map((mapping) => mapping.cosmosNetworkId)
35
+ // filters out chains that are not enabled in Keplr wallet
36
+ .filter((chainId) => chainsEnabledInWallet === null || chainsEnabledInWallet === void 0 ? void 0 : chainsEnabledInWallet.some((chain) => chain.chainId === chainId));
37
+ if (chainsToEnable.length < 1) {
38
+ throw new utils.DynamicError('No supported cosmos chains to connect with.');
39
+ }
40
+ walletConnectorCore.logger.logVerboseTroubleshootingMessage(`[KeplrWalletConnector] Chains to enable: ${chainsToEnable.join(', ')}`);
41
+ yield ((_b = this.getWallet()) === null || _b === void 0 ? void 0 : _b.enable(chainsToEnable));
35
42
  });
43
+ }
44
+ connect() {
36
45
  return _tslib.__awaiter(this, void 0, void 0, function* () {
37
46
  var _a;
38
- try {
39
- yield _super.connect.call(this);
40
- if (this.experimentalChainsInfo) {
41
- for (const chain of this.experimentalChainsInfo) {
42
- yield ((_a = this.getWallet()) === null || _a === void 0 ? void 0 : _a.experimentalSuggestChain(chain));
43
- }
44
- }
47
+ const didOpenInAppBrowser = this.openInAppBrowserIfRequired();
48
+ if (didOpenInAppBrowser || !this.isInstalledOnBrowser()) {
49
+ return;
45
50
  }
46
- catch (error) {
47
- if (isSeiNotEnabledError(error)) {
48
- /**
49
- * If only Sei is enabled, throw the error
50
- * to inform the user to enable Sei in Keplr
51
- */
52
- if (this.cosmosNetworks.length === 1) {
53
- throw new utils.SeiNotEnabledInKeplrWalletError();
54
- }
55
- this.cosmosNetworks = this.cosmosNetworks.filter((network) => network.name !== 'pacific-1');
56
- yield _super.connect.call(this);
57
- }
58
- else {
59
- throw error;
51
+ yield this.enableChains();
52
+ if (this.experimentalChainsInfo) {
53
+ for (const chain of this.experimentalChainsInfo) {
54
+ yield ((_a = this.getWallet()) === null || _a === void 0 ? void 0 : _a.experimentalSuggestChain(chain));
60
55
  }
61
56
  }
62
57
  });
@@ -9,6 +9,7 @@ export declare class KeplrWalletConnector extends CosmosWalletConnector {
9
9
  overrideKey: string;
10
10
  supportsNetworkSwitching(): boolean;
11
11
  getWallet(): KeplrWallet | undefined;
12
+ private enableChains;
12
13
  connect(): Promise<void>;
13
14
  setupEventListeners(): void;
14
15
  teardownEventListeners(): void;
@@ -1,15 +1,9 @@
1
1
  'use client'
2
2
  import { __awaiter } from '../../_virtual/_tslib.js';
3
- import { SeiNotEnabledInKeplrWalletError } from '@dynamic-labs/utils';
3
+ import { DynamicError } from '@dynamic-labs/utils';
4
+ import { logger } from '@dynamic-labs/wallet-connector-core';
4
5
  import { CosmosWalletConnector } from './CosmosWalletConnector.js';
5
6
 
6
- const isSeiNotEnabledError = (error) => {
7
- if (!error ||
8
- !Object.prototype.hasOwnProperty.call(error, 'message') ||
9
- typeof error.message !== 'string')
10
- return false;
11
- return error.message.includes('There is no modular chain info for pacific-1');
12
- };
13
7
  class KeplrWalletConnector extends CosmosWalletConnector {
14
8
  constructor() {
15
9
  super(...arguments);
@@ -25,34 +19,35 @@ class KeplrWalletConnector extends CosmosWalletConnector {
25
19
  }
26
20
  return window.keplr;
27
21
  }
28
- connect() {
29
- const _super = Object.create(null, {
30
- connect: { get: () => super.connect }
22
+ enableChains() {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ var _a, _b;
25
+ // returns all chains that are enabled in Keplr wallet
26
+ const chainsEnabledInWallet = yield ((_a = this.getWallet()) === null || _a === void 0 ? void 0 : _a.getChainInfosWithoutEndpoints());
27
+ logger.logVerboseTroubleshootingMessage(`[KeplrWalletConnector] Chains enabled in wallet: ${chainsEnabledInWallet === null || chainsEnabledInWallet === void 0 ? void 0 : chainsEnabledInWallet.map((chain) => chain.chainId).join(', ')}`);
28
+ const chainsToEnable = this.chainIdMapping
29
+ .filter((mapping) => !mapping.experimental)
30
+ .map((mapping) => mapping.cosmosNetworkId)
31
+ // filters out chains that are not enabled in Keplr wallet
32
+ .filter((chainId) => chainsEnabledInWallet === null || chainsEnabledInWallet === void 0 ? void 0 : chainsEnabledInWallet.some((chain) => chain.chainId === chainId));
33
+ if (chainsToEnable.length < 1) {
34
+ throw new DynamicError('No supported cosmos chains to connect with.');
35
+ }
36
+ logger.logVerboseTroubleshootingMessage(`[KeplrWalletConnector] Chains to enable: ${chainsToEnable.join(', ')}`);
37
+ yield ((_b = this.getWallet()) === null || _b === void 0 ? void 0 : _b.enable(chainsToEnable));
31
38
  });
39
+ }
40
+ connect() {
32
41
  return __awaiter(this, void 0, void 0, function* () {
33
42
  var _a;
34
- try {
35
- yield _super.connect.call(this);
36
- if (this.experimentalChainsInfo) {
37
- for (const chain of this.experimentalChainsInfo) {
38
- yield ((_a = this.getWallet()) === null || _a === void 0 ? void 0 : _a.experimentalSuggestChain(chain));
39
- }
40
- }
43
+ const didOpenInAppBrowser = this.openInAppBrowserIfRequired();
44
+ if (didOpenInAppBrowser || !this.isInstalledOnBrowser()) {
45
+ return;
41
46
  }
42
- catch (error) {
43
- if (isSeiNotEnabledError(error)) {
44
- /**
45
- * If only Sei is enabled, throw the error
46
- * to inform the user to enable Sei in Keplr
47
- */
48
- if (this.cosmosNetworks.length === 1) {
49
- throw new SeiNotEnabledInKeplrWalletError();
50
- }
51
- this.cosmosNetworks = this.cosmosNetworks.filter((network) => network.name !== 'pacific-1');
52
- yield _super.connect.call(this);
53
- }
54
- else {
55
- throw error;
47
+ yield this.enableChains();
48
+ if (this.experimentalChainsInfo) {
49
+ for (const chain of this.experimentalChainsInfo) {
50
+ yield ((_a = this.getWallet()) === null || _a === void 0 ? void 0 : _a.experimentalSuggestChain(chain));
56
51
  }
57
52
  }
58
53
  });