@dynamic-labs/ethereum 4.40.0 → 4.40.2
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 +13 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +11 -11
- package/src/coinbase/coinbase.cjs +2 -12
- package/src/coinbase/coinbase.js +2 -12
- package/src/injected/InjectedWalletBase.cjs +5 -15
- package/src/injected/InjectedWalletBase.js +5 -15
- package/src/walletConnect/WalletConnectConnector/WalletConnectConnector.cjs +3 -10
- package/src/walletConnect/WalletConnectConnector/WalletConnectConnector.js +4 -11
- package/src/walletConnect/utils/fetchWalletConnectWallets.cjs +8 -1
- package/src/walletConnect/utils/fetchWalletConnectWallets.js +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.40.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.40.1...v4.40.2) (2025-10-28)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* upgrade node to 20.20 in sanity-yarn-add-sdk job for compatibility ([#9743](https://github.com/dynamic-labs/dynamic-auth/issues/9743)) ([58d7e32](https://github.com/dynamic-labs/dynamic-auth/commit/58d7e32cd3965fba983c91c6345eae3bfe8dd1d5))
|
|
8
|
+
|
|
9
|
+
### [4.40.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.40.0...v4.40.1) (2025-10-24)
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* add support for Keplr in-app browser redirect for cosmos chain ([#9770](https://github.com/dynamic-labs/dynamic-auth/issues/9770)) ([35652f3](https://github.com/dynamic-labs/dynamic-auth/commit/35652f3167a4e768f5d4c634ab1b4f127fd5076a))
|
|
14
|
+
|
|
2
15
|
## [4.40.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.39.0...v4.40.0) (2025-10-22)
|
|
3
16
|
|
|
4
17
|
|
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.40.
|
|
3
|
+
"version": "4.40.2",
|
|
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",
|
|
@@ -24,16 +24,16 @@
|
|
|
24
24
|
"eventemitter3": "5.0.1",
|
|
25
25
|
"buffer": "6.0.3",
|
|
26
26
|
"@metamask/sdk": "0.33.0",
|
|
27
|
-
"@dynamic-labs/assert-package-version": "4.40.
|
|
28
|
-
"@dynamic-labs/embedded-wallet-evm": "4.40.
|
|
29
|
-
"@dynamic-labs/ethereum-core": "4.40.
|
|
30
|
-
"@dynamic-labs/logger": "4.40.
|
|
31
|
-
"@dynamic-labs/rpc-providers": "4.40.
|
|
32
|
-
"@dynamic-labs/types": "4.40.
|
|
33
|
-
"@dynamic-labs/utils": "4.40.
|
|
34
|
-
"@dynamic-labs/waas-evm": "4.40.
|
|
35
|
-
"@dynamic-labs/wallet-book": "4.40.
|
|
36
|
-
"@dynamic-labs/wallet-connector-core": "4.40.
|
|
27
|
+
"@dynamic-labs/assert-package-version": "4.40.2",
|
|
28
|
+
"@dynamic-labs/embedded-wallet-evm": "4.40.2",
|
|
29
|
+
"@dynamic-labs/ethereum-core": "4.40.2",
|
|
30
|
+
"@dynamic-labs/logger": "4.40.2",
|
|
31
|
+
"@dynamic-labs/rpc-providers": "4.40.2",
|
|
32
|
+
"@dynamic-labs/types": "4.40.2",
|
|
33
|
+
"@dynamic-labs/utils": "4.40.2",
|
|
34
|
+
"@dynamic-labs/waas-evm": "4.40.2",
|
|
35
|
+
"@dynamic-labs/wallet-book": "4.40.2",
|
|
36
|
+
"@dynamic-labs/wallet-connector-core": "4.40.2"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"viem": "^2.28.4"
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var _tslib = require('../../_virtual/_tslib.cjs');
|
|
7
7
|
var viem = require('viem');
|
|
8
8
|
var ethereumCore = require('@dynamic-labs/ethereum-core');
|
|
9
|
-
var utils = require('@dynamic-labs/utils');
|
|
10
9
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
11
10
|
var logger = require('../utils/logger.cjs');
|
|
12
11
|
var helpers = require('./helpers.cjs');
|
|
@@ -53,17 +52,8 @@ class Coinbase extends ethereumCore.EthereumWalletConnector {
|
|
|
53
52
|
}
|
|
54
53
|
getAddress() {
|
|
55
54
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
56
|
-
|
|
57
|
-
if (
|
|
58
|
-
!this.isInstalledOnBrowser() &&
|
|
59
|
-
((_a = this.metadata) === null || _a === void 0 ? void 0 : _a.inAppBrowserUrl) &&
|
|
60
|
-
this.mobileExperience === 'in-app-browser') {
|
|
61
|
-
const inAppBrowserCompiledTemplate = utils.template(this.metadata.inAppBrowserUrl);
|
|
62
|
-
const { href } = utils.PlatformService.getUrl();
|
|
63
|
-
const deepLink = inAppBrowserCompiledTemplate({
|
|
64
|
-
encodedDappURI: encodeURIComponent(href),
|
|
65
|
-
});
|
|
66
|
-
utils.PlatformService.openURL(deepLink);
|
|
55
|
+
const didOpenInAppBrowser = this.openInAppBrowserIfRequired();
|
|
56
|
+
if (didOpenInAppBrowser) {
|
|
67
57
|
return;
|
|
68
58
|
}
|
|
69
59
|
const [address] = (yield this.coinbaseProvider.request({
|
package/src/coinbase/coinbase.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { __rest, __awaiter } from '../../_virtual/_tslib.js';
|
|
3
3
|
import { toHex, toBytes, createWalletClient, custom } from 'viem';
|
|
4
4
|
import { EthereumWalletConnector, chainsMap } from '@dynamic-labs/ethereum-core';
|
|
5
|
-
import { isMobile, template, PlatformService } from '@dynamic-labs/utils';
|
|
6
5
|
import { eventListenerHandlers } from '@dynamic-labs/wallet-connector-core';
|
|
7
6
|
import { logger } from '../utils/logger.js';
|
|
8
7
|
import { getCoinbaseProvider } from './helpers.js';
|
|
@@ -49,17 +48,8 @@ class Coinbase extends EthereumWalletConnector {
|
|
|
49
48
|
}
|
|
50
49
|
getAddress() {
|
|
51
50
|
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
-
|
|
53
|
-
if (
|
|
54
|
-
!this.isInstalledOnBrowser() &&
|
|
55
|
-
((_a = this.metadata) === null || _a === void 0 ? void 0 : _a.inAppBrowserUrl) &&
|
|
56
|
-
this.mobileExperience === 'in-app-browser') {
|
|
57
|
-
const inAppBrowserCompiledTemplate = template(this.metadata.inAppBrowserUrl);
|
|
58
|
-
const { href } = PlatformService.getUrl();
|
|
59
|
-
const deepLink = inAppBrowserCompiledTemplate({
|
|
60
|
-
encodedDappURI: encodeURIComponent(href),
|
|
61
|
-
});
|
|
62
|
-
PlatformService.openURL(deepLink);
|
|
51
|
+
const didOpenInAppBrowser = this.openInAppBrowserIfRequired();
|
|
52
|
+
if (didOpenInAppBrowser) {
|
|
63
53
|
return;
|
|
64
54
|
}
|
|
65
55
|
const [address] = (yield this.coinbaseProvider.request({
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../_virtual/_tslib.cjs');
|
|
7
7
|
var ethereumCore = require('@dynamic-labs/ethereum-core');
|
|
8
|
-
var utils = require('@dynamic-labs/utils');
|
|
9
8
|
var ethProviderHelper = require('../ethProviderHelper.cjs');
|
|
10
9
|
var logger = require('../utils/logger.cjs');
|
|
11
10
|
var WalletConnectConnector = require('../walletConnect/WalletConnectConnector/WalletConnectConnector.cjs');
|
|
@@ -60,21 +59,12 @@ class InjectedWalletBase extends ethereumCore.EthereumWalletConnector {
|
|
|
60
59
|
}
|
|
61
60
|
getAddress() {
|
|
62
61
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
63
|
-
var _a
|
|
64
|
-
|
|
65
|
-
|
|
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);
|
|
62
|
+
var _a;
|
|
63
|
+
const didOpenInAppBrowser = this.openInAppBrowserIfRequired();
|
|
64
|
+
if (didOpenInAppBrowser) {
|
|
65
|
+
return;
|
|
76
66
|
}
|
|
77
|
-
return
|
|
67
|
+
return (_a = this.ethProviderHelper) === null || _a === void 0 ? void 0 : _a.getAddress();
|
|
78
68
|
});
|
|
79
69
|
}
|
|
80
70
|
connect() {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../_virtual/_tslib.js';
|
|
3
3
|
import { EthereumWalletConnector } from '@dynamic-labs/ethereum-core';
|
|
4
|
-
import { isMobile, template, PlatformService } from '@dynamic-labs/utils';
|
|
5
4
|
import { EthProviderHelper } from '../ethProviderHelper.js';
|
|
6
5
|
import { logger } from '../utils/logger.js';
|
|
7
6
|
import { WalletConnectConnector } from '../walletConnect/WalletConnectConnector/WalletConnectConnector.js';
|
|
@@ -56,21 +55,12 @@ class InjectedWalletBase extends EthereumWalletConnector {
|
|
|
56
55
|
}
|
|
57
56
|
getAddress() {
|
|
58
57
|
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
-
var _a
|
|
60
|
-
|
|
61
|
-
|
|
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);
|
|
58
|
+
var _a;
|
|
59
|
+
const didOpenInAppBrowser = this.openInAppBrowserIfRequired();
|
|
60
|
+
if (didOpenInAppBrowser) {
|
|
61
|
+
return;
|
|
72
62
|
}
|
|
73
|
-
return
|
|
63
|
+
return (_a = this.ethProviderHelper) === null || _a === void 0 ? void 0 : _a.getAddress();
|
|
74
64
|
});
|
|
75
65
|
}
|
|
76
66
|
connect() {
|
|
@@ -93,22 +93,15 @@ 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
|
|
96
|
+
var _a;
|
|
97
97
|
walletConnectorCore.logger.debug('[WalletConnect] getAddress', opts);
|
|
98
98
|
walletConnectorCore.logger.logVerboseTroubleshootingMessage('[WalletConnectConnector] getAddress', {
|
|
99
99
|
inAppBrowserUrl: (_a = this.metadata) === null || _a === void 0 ? void 0 : _a.inAppBrowserUrl,
|
|
100
100
|
isMobile: utils.isMobile(),
|
|
101
101
|
mobileExperience: this.mobileExperience,
|
|
102
102
|
});
|
|
103
|
-
|
|
104
|
-
|
|
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);
|
|
103
|
+
const didOpenInAppBrowser = this.openInAppBrowserIfRequired();
|
|
104
|
+
if (didOpenInAppBrowser) {
|
|
112
105
|
return;
|
|
113
106
|
}
|
|
114
107
|
const provider = yield WalletConnectProvider.WalletConnectProvider.awaitAndGetProvider();
|
|
@@ -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,
|
|
6
|
+
import { StorageService, parseIntSafe, DynamicError, isMobile, PlatformService } from '@dynamic-labs/utils';
|
|
7
7
|
import { logger, getDeepLink, isSameAddress } from '@dynamic-labs/wallet-connector-core';
|
|
8
8
|
import { WalletConnectProvider } from '../WalletConnectProvider/WalletConnectProvider.js';
|
|
9
9
|
|
|
@@ -89,22 +89,15 @@ class WalletConnectConnector extends EthereumWalletConnector {
|
|
|
89
89
|
}
|
|
90
90
|
getAddress(opts) {
|
|
91
91
|
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
-
var _a
|
|
92
|
+
var _a;
|
|
93
93
|
logger.debug('[WalletConnect] getAddress', opts);
|
|
94
94
|
logger.logVerboseTroubleshootingMessage('[WalletConnectConnector] getAddress', {
|
|
95
95
|
inAppBrowserUrl: (_a = this.metadata) === null || _a === void 0 ? void 0 : _a.inAppBrowserUrl,
|
|
96
96
|
isMobile: isMobile(),
|
|
97
97
|
mobileExperience: this.mobileExperience,
|
|
98
98
|
});
|
|
99
|
-
|
|
100
|
-
|
|
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);
|
|
99
|
+
const didOpenInAppBrowser = this.openInAppBrowserIfRequired();
|
|
100
|
+
if (didOpenInAppBrowser) {
|
|
108
101
|
return;
|
|
109
102
|
}
|
|
110
103
|
const provider = yield WalletConnectProvider.awaitAndGetProvider();
|
|
@@ -8,7 +8,14 @@ var WalletConnectConnector = require('../WalletConnectConnector/WalletConnectCon
|
|
|
8
8
|
const fetchWalletConnectWallets = ({ walletBook, }) => {
|
|
9
9
|
var _a;
|
|
10
10
|
return Object.entries((_a = walletBook === null || walletBook === void 0 ? void 0 : walletBook.wallets) !== null && _a !== void 0 ? _a : {})
|
|
11
|
-
.filter(([, wallet]) =>
|
|
11
|
+
.filter(([, wallet]) => {
|
|
12
|
+
var _a;
|
|
13
|
+
return wallet.walletConnect &&
|
|
14
|
+
!wallet.filterFromWalletConnect &&
|
|
15
|
+
(
|
|
16
|
+
// Exclude wallets that don't support Evm
|
|
17
|
+
(_a = wallet.chains) === null || _a === void 0 ? void 0 : _a.some((chain) => chain.includes('eip155:')));
|
|
18
|
+
})
|
|
12
19
|
.map(([key, wallet]) => {
|
|
13
20
|
const { shortName } = wallet;
|
|
14
21
|
const name = shortName || wallet.name;
|
|
@@ -4,7 +4,14 @@ import { WalletConnectConnector } from '../WalletConnectConnector/WalletConnectC
|
|
|
4
4
|
const fetchWalletConnectWallets = ({ walletBook, }) => {
|
|
5
5
|
var _a;
|
|
6
6
|
return Object.entries((_a = walletBook === null || walletBook === void 0 ? void 0 : walletBook.wallets) !== null && _a !== void 0 ? _a : {})
|
|
7
|
-
.filter(([, wallet]) =>
|
|
7
|
+
.filter(([, wallet]) => {
|
|
8
|
+
var _a;
|
|
9
|
+
return wallet.walletConnect &&
|
|
10
|
+
!wallet.filterFromWalletConnect &&
|
|
11
|
+
(
|
|
12
|
+
// Exclude wallets that don't support Evm
|
|
13
|
+
(_a = wallet.chains) === null || _a === void 0 ? void 0 : _a.some((chain) => chain.includes('eip155:')));
|
|
14
|
+
})
|
|
8
15
|
.map(([key, wallet]) => {
|
|
9
16
|
const { shortName } = wallet;
|
|
10
17
|
const name = shortName || wallet.name;
|