@dynamic-labs/ethereum 4.20.11 → 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 +9 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +11 -11
- package/src/injected/InjectedWalletBase.cjs +11 -21
- package/src/injected/InjectedWalletBase.js +11 -21
- package/src/walletConnect/WalletConnectConnector/WalletConnectConnector.cjs +17 -0
- package/src/walletConnect/WalletConnectConnector/WalletConnectConnector.js +18 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
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
|
+
|
|
2
11
|
### [4.20.11](https://github.com/dynamic-labs/dynamic-auth/compare/v4.20.10...v4.20.11) (2025-07-01)
|
|
3
12
|
|
|
4
13
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/ethereum",
|
|
3
|
-
"version": "4.20.
|
|
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.
|
|
27
|
-
"@dynamic-labs/embedded-wallet-evm": "4.20.
|
|
28
|
-
"@dynamic-labs/ethereum-core": "4.20.
|
|
29
|
-
"@dynamic-labs/logger": "4.20.
|
|
30
|
-
"@dynamic-labs/rpc-providers": "4.20.
|
|
31
|
-
"@dynamic-labs/types": "4.20.
|
|
32
|
-
"@dynamic-labs/utils": "4.20.
|
|
33
|
-
"@dynamic-labs/waas-evm": "4.20.
|
|
34
|
-
"@dynamic-labs/wallet-book": "4.20.
|
|
35
|
-
"@dynamic-labs/wallet-connector-core": "4.20.
|
|
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"
|
|
@@ -22,29 +22,19 @@ class InjectedWalletBase extends ethereumCore.EthereumWalletConnector {
|
|
|
22
22
|
return this._ethProviderHelper;
|
|
23
23
|
}
|
|
24
24
|
getMobileOrInstalledWallet() {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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() {
|
|
@@ -18,29 +18,19 @@ class InjectedWalletBase extends EthereumWalletConnector {
|
|
|
18
18
|
return this._ethProviderHelper;
|
|
19
19
|
}
|
|
20
20
|
getMobileOrInstalledWallet() {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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() {
|
|
@@ -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,
|