@dynamic-labs/ethereum 4.20.10 → 4.20.12

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,26 @@
1
1
 
2
+ ### [4.20.12](https://github.com/dynamic-labs/dynamic-auth/compare/v4.20.11...v4.20.12) (2025-07-01)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * bring back braavos mobile deeplink support ([#9041](https://github.com/dynamic-labs/dynamic-auth/issues/9041)) ([90a7eb6](https://github.com/dynamic-labs/dynamic-auth/commit/90a7eb620f6bd27d4560e88fe5542a121e586bed))
8
+ * start exchange funding errors should be logged as error ([#9056](https://github.com/dynamic-labs/dynamic-auth/issues/9056)) ([ba122af](https://github.com/dynamic-labs/dynamic-auth/commit/ba122afb68c462fe8627828bd20f9cc5f92803ff))
9
+ * WC redirect on mobile ([#9063](https://github.com/dynamic-labs/dynamic-auth/issues/9063)) ([f43aa4a](https://github.com/dynamic-labs/dynamic-auth/commit/f43aa4aedea20e3baf012f4778f5e6a47c27515c))
10
+
11
+ ### [4.20.11](https://github.com/dynamic-labs/dynamic-auth/compare/v4.20.10...v4.20.11) (2025-07-01)
12
+
13
+
14
+ ### Features
15
+
16
+ * add signed typed data to waas ([#9050](https://github.com/dynamic-labs/dynamic-auth/issues/9050)) ([19c8fea](https://github.com/dynamic-labs/dynamic-auth/commit/19c8fea2e5448e027cbec2f6158d32247dfcd321))
17
+ * pass jwt to waas operations ([#8981](https://github.com/dynamic-labs/dynamic-auth/issues/8981)) ([6b63394](https://github.com/dynamic-labs/dynamic-auth/commit/6b63394a1a724c2a1499a3d1ff13078d2314b10e))
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * 7702 signature for undeployed contracts ([#9052](https://github.com/dynamic-labs/dynamic-auth/issues/9052)) ([7052149](https://github.com/dynamic-labs/dynamic-auth/commit/7052149aae53524a0ac2bdad0b7ddf68e3c86189))
23
+
2
24
  ### [4.20.10](https://github.com/dynamic-labs/dynamic-auth/compare/v4.20.9...v4.20.10) (2025-06-30)
3
25
 
4
26
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.20.10";
6
+ var version = "4.20.12";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.20.10";
2
+ var version = "4.20.12";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/ethereum",
3
- "version": "4.20.10",
3
+ "version": "4.20.12",
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",
@@ -23,16 +23,16 @@
23
23
  "eventemitter3": "5.0.1",
24
24
  "buffer": "6.0.3",
25
25
  "@metamask/sdk": "0.33.0",
26
- "@dynamic-labs/assert-package-version": "4.20.10",
27
- "@dynamic-labs/embedded-wallet-evm": "4.20.10",
28
- "@dynamic-labs/ethereum-core": "4.20.10",
29
- "@dynamic-labs/logger": "4.20.10",
30
- "@dynamic-labs/rpc-providers": "4.20.10",
31
- "@dynamic-labs/types": "4.20.10",
32
- "@dynamic-labs/utils": "4.20.10",
33
- "@dynamic-labs/waas-evm": "4.20.10",
34
- "@dynamic-labs/wallet-book": "4.20.10",
35
- "@dynamic-labs/wallet-connector-core": "4.20.10"
26
+ "@dynamic-labs/assert-package-version": "4.20.12",
27
+ "@dynamic-labs/embedded-wallet-evm": "4.20.12",
28
+ "@dynamic-labs/ethereum-core": "4.20.12",
29
+ "@dynamic-labs/logger": "4.20.12",
30
+ "@dynamic-labs/rpc-providers": "4.20.12",
31
+ "@dynamic-labs/types": "4.20.12",
32
+ "@dynamic-labs/utils": "4.20.12",
33
+ "@dynamic-labs/waas-evm": "4.20.12",
34
+ "@dynamic-labs/wallet-book": "4.20.12",
35
+ "@dynamic-labs/wallet-connector-core": "4.20.12"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "viem": "^2.28.4"
@@ -11,11 +11,11 @@ require('@dynamic-labs/ethereum-core');
11
11
  require('viem');
12
12
  require('@dynamic-labs/wallet-connector-core');
13
13
  require('@dynamic-labs/wallet-book');
14
+ require('./utils/logger.cjs');
14
15
  require('viem/accounts');
15
16
  require('./walletConnect/WalletConnectProvider/WalletConnectProvider.cjs');
16
17
  var fetchWalletConnectWallets = require('./walletConnect/utils/fetchWalletConnectWallets.cjs');
17
18
  var getWalletConnectConnector = require('./walletConnect/utils/getWalletConnectConnector.cjs');
18
- require('./utils/logger.cjs');
19
19
  var FallbackEvmConnector = require('./injected/FallbackEvmConnector.cjs');
20
20
  var fetchInjectedWalletConnectors = require('./injected/fetchInjectedWalletConnectors.cjs');
21
21
  var coinbase = require('./coinbase/coinbase.cjs');
@@ -7,11 +7,11 @@ import '@dynamic-labs/ethereum-core';
7
7
  import 'viem';
8
8
  import '@dynamic-labs/wallet-connector-core';
9
9
  import '@dynamic-labs/wallet-book';
10
+ import './utils/logger.js';
10
11
  import 'viem/accounts';
11
12
  import './walletConnect/WalletConnectProvider/WalletConnectProvider.js';
12
13
  import { fetchWalletConnectWallets } from './walletConnect/utils/fetchWalletConnectWallets.js';
13
14
  import { getWalletConnectConnector } from './walletConnect/utils/getWalletConnectConnector.js';
14
- import './utils/logger.js';
15
15
  import { FallbackEvmConnector } from './injected/FallbackEvmConnector.js';
16
16
  import { injectedWalletOverrides, fetchInjectedWalletConnector } from './injected/fetchInjectedWalletConnectors.js';
17
17
  import { Coinbase } from './coinbase/coinbase.js';
@@ -4,11 +4,11 @@
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var _tslib = require('../../_virtual/_tslib.cjs');
7
- var utils = require('@dynamic-labs/utils');
8
7
  var ethereumCore = require('@dynamic-labs/ethereum-core');
8
+ var utils = require('@dynamic-labs/utils');
9
9
  var ethProviderHelper = require('../ethProviderHelper.cjs');
10
- var WalletConnectConnector = require('../walletConnect/WalletConnectConnector/WalletConnectConnector.cjs');
11
10
  var logger = require('../utils/logger.cjs');
11
+ var WalletConnectConnector = require('../walletConnect/WalletConnectConnector/WalletConnectConnector.cjs');
12
12
 
13
13
  class InjectedWalletBase extends ethereumCore.EthereumWalletConnector {
14
14
  constructor() {
@@ -22,29 +22,19 @@ class InjectedWalletBase extends ethereumCore.EthereumWalletConnector {
22
22
  return this._ethProviderHelper;
23
23
  }
24
24
  getMobileOrInstalledWallet() {
25
- var _a;
26
- if (this.isInstalledOnBrowser()) {
27
- return this;
28
- }
29
- // this is to handle the case where the user is in a webview.
30
- // when the user is in a webview, customers should set the deepLinkPreference prop to universal,
31
- // in which case this condition will be false, and the SDK will use WalletConnect (if available)
32
- if (((_a = this.metadata) === null || _a === void 0 ? void 0 : _a.inAppBrowserUrl) &&
33
- this.mobileExperience === 'in-app-browser' &&
34
- utils.isMobile()) {
35
- return this;
36
- }
37
- // this is the case where the wallet is not installed on the browser and
38
- // it does not support WalletConnect. in this case, the SDK will instruct
39
- // the user to download the wallet extension
40
- if (!this.walletConnectorFallback) {
41
- return this;
42
- }
43
- // if there is no WC project ID, we should not use WC
44
- if (!this.constructorProps.projectId) {
45
- logger.logger.debug('[InjectedWalletBase] getMobileOrInstalledWallet - No WC project ID');
25
+ // can use WC if the wallet has WC setting in wallet book and projectId is set
26
+ const canUseWalletConnect = this.walletConnectorFallback && this.constructorProps.projectId;
27
+ logger.logger.logVerboseTroubleshootingMessage('[InjectedWalletBase] getMobileOrInstalledWallet', {
28
+ canUseWalletConnect,
29
+ isInstalledOnBrowser: this.isInstalledOnBrowser(),
30
+ projectId: this.constructorProps.projectId,
31
+ walletConnectorFallback: this.walletConnectorFallback,
32
+ });
33
+ // if the wallet is installed on the browser or WC is not available, return the injected connector
34
+ if (this.isInstalledOnBrowser() || !canUseWalletConnect) {
46
35
  return this;
47
36
  }
37
+ // if the wallet is not installed on the browser and WC is available, return the WC connector
48
38
  return new WalletConnectConnector.WalletConnectConnector(Object.assign(Object.assign({}, this.constructorProps), { walletName: this.name }));
49
39
  }
50
40
  findProvider() {
@@ -70,8 +60,21 @@ class InjectedWalletBase extends ethereumCore.EthereumWalletConnector {
70
60
  }
71
61
  getAddress() {
72
62
  return _tslib.__awaiter(this, void 0, void 0, function* () {
73
- var _a;
74
- return (_a = this.ethProviderHelper) === null || _a === void 0 ? void 0 : _a.getAddress();
63
+ var _a, _b;
64
+ if (this.isInstalledOnBrowser()) {
65
+ return (_a = this.ethProviderHelper) === null || _a === void 0 ? void 0 : _a.getAddress();
66
+ }
67
+ if (utils.isMobile() &&
68
+ ((_b = this.metadata) === null || _b === void 0 ? void 0 : _b.inAppBrowserUrl) &&
69
+ this.mobileExperience === 'in-app-browser') {
70
+ const inAppBrowserCompiledTemplate = utils.template(this.metadata.inAppBrowserUrl);
71
+ const { href } = utils.PlatformService.getUrl();
72
+ const deepLink = inAppBrowserCompiledTemplate({
73
+ encodedDappURI: encodeURIComponent(href),
74
+ });
75
+ utils.PlatformService.openURL(deepLink);
76
+ }
77
+ return undefined;
75
78
  });
76
79
  }
77
80
  connect() {
@@ -1,6 +1,6 @@
1
- import { WalletClient, Transport, Account, Chain as ViemChain } from 'viem';
2
- import { EvmNetwork } from '@dynamic-labs/types';
1
+ import { Account, Transport, Chain as ViemChain, WalletClient } from 'viem';
3
2
  import { EthereumWalletConnector } from '@dynamic-labs/ethereum-core';
3
+ import { EvmNetwork } from '@dynamic-labs/types';
4
4
  import { EthProviderHelper } from '../ethProviderHelper';
5
5
  import { IEthereum } from '../types';
6
6
  export declare abstract class InjectedWalletBase extends EthereumWalletConnector {
@@ -1,10 +1,10 @@
1
1
  'use client'
2
2
  import { __awaiter } from '../../_virtual/_tslib.js';
3
- import { isMobile } from '@dynamic-labs/utils';
4
3
  import { EthereumWalletConnector } from '@dynamic-labs/ethereum-core';
4
+ import { isMobile, template, PlatformService } from '@dynamic-labs/utils';
5
5
  import { EthProviderHelper } from '../ethProviderHelper.js';
6
- import { WalletConnectConnector } from '../walletConnect/WalletConnectConnector/WalletConnectConnector.js';
7
6
  import { logger } from '../utils/logger.js';
7
+ import { WalletConnectConnector } from '../walletConnect/WalletConnectConnector/WalletConnectConnector.js';
8
8
 
9
9
  class InjectedWalletBase extends EthereumWalletConnector {
10
10
  constructor() {
@@ -18,29 +18,19 @@ class InjectedWalletBase extends EthereumWalletConnector {
18
18
  return this._ethProviderHelper;
19
19
  }
20
20
  getMobileOrInstalledWallet() {
21
- var _a;
22
- if (this.isInstalledOnBrowser()) {
23
- return this;
24
- }
25
- // this is to handle the case where the user is in a webview.
26
- // when the user is in a webview, customers should set the deepLinkPreference prop to universal,
27
- // in which case this condition will be false, and the SDK will use WalletConnect (if available)
28
- if (((_a = this.metadata) === null || _a === void 0 ? void 0 : _a.inAppBrowserUrl) &&
29
- this.mobileExperience === 'in-app-browser' &&
30
- isMobile()) {
31
- return this;
32
- }
33
- // this is the case where the wallet is not installed on the browser and
34
- // it does not support WalletConnect. in this case, the SDK will instruct
35
- // the user to download the wallet extension
36
- if (!this.walletConnectorFallback) {
37
- return this;
38
- }
39
- // if there is no WC project ID, we should not use WC
40
- if (!this.constructorProps.projectId) {
41
- logger.debug('[InjectedWalletBase] getMobileOrInstalledWallet - No WC project ID');
21
+ // can use WC if the wallet has WC setting in wallet book and projectId is set
22
+ const canUseWalletConnect = this.walletConnectorFallback && this.constructorProps.projectId;
23
+ logger.logVerboseTroubleshootingMessage('[InjectedWalletBase] getMobileOrInstalledWallet', {
24
+ canUseWalletConnect,
25
+ isInstalledOnBrowser: this.isInstalledOnBrowser(),
26
+ projectId: this.constructorProps.projectId,
27
+ walletConnectorFallback: this.walletConnectorFallback,
28
+ });
29
+ // if the wallet is installed on the browser or WC is not available, return the injected connector
30
+ if (this.isInstalledOnBrowser() || !canUseWalletConnect) {
42
31
  return this;
43
32
  }
33
+ // if the wallet is not installed on the browser and WC is available, return the WC connector
44
34
  return new WalletConnectConnector(Object.assign(Object.assign({}, this.constructorProps), { walletName: this.name }));
45
35
  }
46
36
  findProvider() {
@@ -66,8 +56,21 @@ class InjectedWalletBase extends EthereumWalletConnector {
66
56
  }
67
57
  getAddress() {
68
58
  return __awaiter(this, void 0, void 0, function* () {
69
- var _a;
70
- return (_a = this.ethProviderHelper) === null || _a === void 0 ? void 0 : _a.getAddress();
59
+ var _a, _b;
60
+ if (this.isInstalledOnBrowser()) {
61
+ return (_a = this.ethProviderHelper) === null || _a === void 0 ? void 0 : _a.getAddress();
62
+ }
63
+ if (isMobile() &&
64
+ ((_b = this.metadata) === null || _b === void 0 ? void 0 : _b.inAppBrowserUrl) &&
65
+ this.mobileExperience === 'in-app-browser') {
66
+ const inAppBrowserCompiledTemplate = template(this.metadata.inAppBrowserUrl);
67
+ const { href } = PlatformService.getUrl();
68
+ const deepLink = inAppBrowserCompiledTemplate({
69
+ encodedDappURI: encodeURIComponent(href),
70
+ });
71
+ PlatformService.openURL(deepLink);
72
+ }
73
+ return undefined;
71
74
  });
72
75
  }
73
76
  connect() {
@@ -7,12 +7,12 @@ var _tslib = require('../../_virtual/_tslib.cjs');
7
7
  var sdk = require('@metamask/sdk');
8
8
  var viem = require('viem');
9
9
  var ethereumCore = require('@dynamic-labs/ethereum-core');
10
- var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
11
10
  var utils = require('@dynamic-labs/utils');
12
- var logger = require('../utils/logger.cjs');
11
+ var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
13
12
  var InjectedWalletBase = require('../injected/InjectedWalletBase.cjs');
14
- var waitForConnection = require('./utils/waitForConnection.cjs');
13
+ var logger = require('../utils/logger.cjs');
15
14
  var isPendingWalletRequestPermissionError = require('./utils/isPendingWalletRequestPermissionError.cjs');
15
+ var waitForConnection = require('./utils/waitForConnection.cjs');
16
16
 
17
17
  /**
18
18
  * The MetaMask SDK must be initialized only once, so we store the instance
@@ -141,8 +141,13 @@ class MetaMaskConnector extends InjectedWalletBase.InjectedWalletBase {
141
141
  // Deep link to MetaMask app in-app browser
142
142
  if (this.shouldDeepLinkToMetaMaskInAppBrowser() &&
143
143
  this.metadata.inAppBrowserUrl) {
144
+ const inAppBrowserCompiledTemplate = utils.template(this.metadata.inAppBrowserUrl);
145
+ const { href } = utils.PlatformService.getUrl();
146
+ const deepLink = inAppBrowserCompiledTemplate({
147
+ dappURI: href,
148
+ });
144
149
  // Redirect to the in-app browser and append the current url
145
- utils.PlatformService.openURL(`${this.metadata.inAppBrowserUrl}/${window.location.href}`);
150
+ utils.PlatformService.openURL(deepLink);
146
151
  return;
147
152
  }
148
153
  logger.logger.logVerboseTroubleshootingMessage('[MetaMaskConnector] getAddress - getting initial connected accounts');
@@ -1,5 +1,5 @@
1
1
  import { MetaMaskSDK } from '@metamask/sdk';
2
- import { Account, Transport, WalletClient, Chain as ViemChain } from 'viem';
2
+ import { Account, Transport, Chain as ViemChain, WalletClient } from 'viem';
3
3
  import { EthereumWalletConnectorOpts } from '@dynamic-labs/ethereum-core';
4
4
  import { GetAddressOpts, IWalletConnectConnector } from '@dynamic-labs/wallet-connector-core';
5
5
  import { InjectedWalletBase } from '../injected/InjectedWalletBase';
@@ -3,12 +3,12 @@ import { __awaiter } from '../../_virtual/_tslib.js';
3
3
  import { MetaMaskSDK } from '@metamask/sdk';
4
4
  import { createWalletClient, custom, isHex, toHex } from 'viem';
5
5
  import { getOrMapViemChain } from '@dynamic-labs/ethereum-core';
6
+ import { createEventTimeline, PlatformService, isMobile, template, GetAddressCancelledError, MetaMaskError, retryableFn, PlatformEventsService } from '@dynamic-labs/utils';
6
7
  import { eventListenerHandlers } from '@dynamic-labs/wallet-connector-core';
7
- import { createEventTimeline, PlatformService, isMobile, GetAddressCancelledError, MetaMaskError, retryableFn, PlatformEventsService } from '@dynamic-labs/utils';
8
- import { logger } from '../utils/logger.js';
9
8
  import { InjectedWalletBase } from '../injected/InjectedWalletBase.js';
10
- import { waitForConnection } from './utils/waitForConnection.js';
9
+ import { logger } from '../utils/logger.js';
11
10
  import { isPendingWalletRequestPermissionError } from './utils/isPendingWalletRequestPermissionError.js';
11
+ import { waitForConnection } from './utils/waitForConnection.js';
12
12
 
13
13
  /**
14
14
  * The MetaMask SDK must be initialized only once, so we store the instance
@@ -137,8 +137,13 @@ class MetaMaskConnector extends InjectedWalletBase {
137
137
  // Deep link to MetaMask app in-app browser
138
138
  if (this.shouldDeepLinkToMetaMaskInAppBrowser() &&
139
139
  this.metadata.inAppBrowserUrl) {
140
+ const inAppBrowserCompiledTemplate = template(this.metadata.inAppBrowserUrl);
141
+ const { href } = PlatformService.getUrl();
142
+ const deepLink = inAppBrowserCompiledTemplate({
143
+ dappURI: href,
144
+ });
140
145
  // Redirect to the in-app browser and append the current url
141
- PlatformService.openURL(`${this.metadata.inAppBrowserUrl}/${window.location.href}`);
146
+ PlatformService.openURL(deepLink);
142
147
  return;
143
148
  }
144
149
  logger.logVerboseTroubleshootingMessage('[MetaMaskConnector] getAddress - getting initial connected accounts');
@@ -7,7 +7,6 @@ var _tslib = require('../../../_virtual/_tslib.cjs');
7
7
  require('@dynamic-labs/utils');
8
8
  var InjectedWalletBase = require('../../injected/InjectedWalletBase.cjs');
9
9
  require('@dynamic-labs/wallet-connector-core');
10
- require('../logger.cjs');
11
10
 
12
11
  const createInjectedConnector = (customConnectorFn) => (props) => {
13
12
  const delegate = customConnectorFn(props);
@@ -3,7 +3,6 @@ import { __awaiter } from '../../../_virtual/_tslib.js';
3
3
  import '@dynamic-labs/utils';
4
4
  import { InjectedWalletBase } from '../../injected/InjectedWalletBase.js';
5
5
  import '@dynamic-labs/wallet-connector-core';
6
- import '../logger.js';
7
6
 
8
7
  const createInjectedConnector = (customConnectorFn) => (props) => {
9
8
  const delegate = customConnectorFn(props);
@@ -3,10 +3,7 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var _tslib = require('../../../_virtual/_tslib.cjs');
7
- var utils = require('@dynamic-labs/utils');
8
6
  var InjectedWalletBase = require('../../injected/InjectedWalletBase.cjs');
9
- var logger = require('../logger.cjs');
10
7
 
11
8
  const getConnectorConstructorInjectedWallet = (key, wallet) => {
12
9
  const { shortName } = wallet;
@@ -20,26 +17,6 @@ const getConnectorConstructorInjectedWallet = (key, wallet) => {
20
17
  // this is the key from the wallet book entry so that we don't purely rely on the normalized name
21
18
  this.overrideKey = key;
22
19
  }
23
- getAddress() {
24
- const _super = Object.create(null, {
25
- getAddress: { get: () => super.getAddress }
26
- });
27
- return _tslib.__awaiter(this, void 0, void 0, function* () {
28
- var _a;
29
- if (this.isInstalledOnBrowser()) {
30
- return _super.getAddress.call(this);
31
- }
32
- const inAppBrowserBase = (_a = this.metadata) === null || _a === void 0 ? void 0 : _a.inAppBrowserUrl;
33
- if (!inAppBrowserBase) {
34
- const error = new Error(`No inAppBrowserBase found for ${this.name}.`);
35
- logger.logger.error(error.message);
36
- throw error;
37
- }
38
- // TODO: use PlatformService
39
- utils.PlatformService.openURL(`${inAppBrowserBase}/${window.location.href}`);
40
- return undefined;
41
- });
42
- }
43
20
  };
44
21
  };
45
22
 
@@ -1,8 +1,5 @@
1
1
  'use client'
2
- import { __awaiter } from '../../../_virtual/_tslib.js';
3
- import { PlatformService } from '@dynamic-labs/utils';
4
2
  import { InjectedWalletBase } from '../../injected/InjectedWalletBase.js';
5
- import { logger } from '../logger.js';
6
3
 
7
4
  const getConnectorConstructorInjectedWallet = (key, wallet) => {
8
5
  const { shortName } = wallet;
@@ -16,26 +13,6 @@ const getConnectorConstructorInjectedWallet = (key, wallet) => {
16
13
  // this is the key from the wallet book entry so that we don't purely rely on the normalized name
17
14
  this.overrideKey = key;
18
15
  }
19
- getAddress() {
20
- const _super = Object.create(null, {
21
- getAddress: { get: () => super.getAddress }
22
- });
23
- return __awaiter(this, void 0, void 0, function* () {
24
- var _a;
25
- if (this.isInstalledOnBrowser()) {
26
- return _super.getAddress.call(this);
27
- }
28
- const inAppBrowserBase = (_a = this.metadata) === null || _a === void 0 ? void 0 : _a.inAppBrowserUrl;
29
- if (!inAppBrowserBase) {
30
- const error = new Error(`No inAppBrowserBase found for ${this.name}.`);
31
- logger.error(error.message);
32
- throw error;
33
- }
34
- // TODO: use PlatformService
35
- PlatformService.openURL(`${inAppBrowserBase}/${window.location.href}`);
36
- return undefined;
37
- });
38
- }
39
16
  };
40
17
  };
41
18
 
@@ -93,7 +93,24 @@ class WalletConnectConnector extends ethereumCore.EthereumWalletConnector {
93
93
  }
94
94
  getAddress(opts) {
95
95
  return _tslib.__awaiter(this, void 0, void 0, function* () {
96
+ var _a, _b;
96
97
  walletConnectorCore.logger.debug('[WalletConnect] getAddress', opts);
98
+ walletConnectorCore.logger.logVerboseTroubleshootingMessage('[WalletConnectConnector] getAddress', {
99
+ inAppBrowserUrl: (_a = this.metadata) === null || _a === void 0 ? void 0 : _a.inAppBrowserUrl,
100
+ isMobile: utils.isMobile(),
101
+ mobileExperience: this.mobileExperience,
102
+ });
103
+ if (utils.isMobile() &&
104
+ ((_b = this.metadata) === null || _b === void 0 ? void 0 : _b.inAppBrowserUrl) &&
105
+ this.mobileExperience === 'in-app-browser') {
106
+ const inAppBrowserCompiledTemplate = utils.template(this.metadata.inAppBrowserUrl);
107
+ const { href } = utils.PlatformService.getUrl();
108
+ const deepLink = inAppBrowserCompiledTemplate({
109
+ encodedDappURI: encodeURIComponent(href),
110
+ });
111
+ utils.PlatformService.openURL(deepLink);
112
+ return;
113
+ }
97
114
  const provider = yield WalletConnectProvider.WalletConnectProvider.awaitAndGetProvider();
98
115
  walletConnectorCore.logger.debug('[WalletConnect] getAddress - connecting to WalletConnect', {
99
116
  provider,
@@ -3,7 +3,7 @@ import { __awaiter } from '../../../_virtual/_tslib.js';
3
3
  import { createWalletClient, custom } from 'viem';
4
4
  import { toAccount } from 'viem/accounts';
5
5
  import { EthereumWalletConnector, chainsMap, normalizeRpcError } from '@dynamic-labs/ethereum-core';
6
- import { StorageService, parseIntSafe, DynamicError, isMobile, PlatformService } from '@dynamic-labs/utils';
6
+ import { StorageService, parseIntSafe, DynamicError, isMobile, template, PlatformService } from '@dynamic-labs/utils';
7
7
  import { logger, getDeepLink } from '@dynamic-labs/wallet-connector-core';
8
8
  import { WalletConnectProvider } from '../WalletConnectProvider/WalletConnectProvider.js';
9
9
 
@@ -89,7 +89,24 @@ class WalletConnectConnector extends EthereumWalletConnector {
89
89
  }
90
90
  getAddress(opts) {
91
91
  return __awaiter(this, void 0, void 0, function* () {
92
+ var _a, _b;
92
93
  logger.debug('[WalletConnect] getAddress', opts);
94
+ logger.logVerboseTroubleshootingMessage('[WalletConnectConnector] getAddress', {
95
+ inAppBrowserUrl: (_a = this.metadata) === null || _a === void 0 ? void 0 : _a.inAppBrowserUrl,
96
+ isMobile: isMobile(),
97
+ mobileExperience: this.mobileExperience,
98
+ });
99
+ if (isMobile() &&
100
+ ((_b = this.metadata) === null || _b === void 0 ? void 0 : _b.inAppBrowserUrl) &&
101
+ this.mobileExperience === 'in-app-browser') {
102
+ const inAppBrowserCompiledTemplate = template(this.metadata.inAppBrowserUrl);
103
+ const { href } = PlatformService.getUrl();
104
+ const deepLink = inAppBrowserCompiledTemplate({
105
+ encodedDappURI: encodeURIComponent(href),
106
+ });
107
+ PlatformService.openURL(deepLink);
108
+ return;
109
+ }
93
110
  const provider = yield WalletConnectProvider.awaitAndGetProvider();
94
111
  logger.debug('[WalletConnect] getAddress - connecting to WalletConnect', {
95
112
  provider,