@dynamic-labs/ethereum-core 4.9.4 → 4.9.6
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 +28 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +9 -9
- package/src/connector/EthereumWalletConnector.cjs +3 -2
- package/src/connector/EthereumWalletConnector.d.ts +5 -4
- package/src/connector/EthereumWalletConnector.js +3 -2
- package/src/rpc/RpcProvidersEthereum/RpcProvidersEthereum.cjs +1 -1
- package/src/rpc/RpcProvidersEthereum/RpcProvidersEthereum.d.ts +4 -0
- package/src/rpc/RpcProvidersEthereum/RpcProvidersEthereum.js +1 -1
- package/src/wallet/EthereumWallet.cjs +12 -4
- package/src/wallet/EthereumWallet.d.ts +2 -1
- package/src/wallet/EthereumWallet.js +12 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,32 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.9.6](https://github.com/dynamic-labs/dynamic-auth/compare/v4.9.5...v4.9.6) (2025-03-21)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add initial sui support ([#8317](https://github.com/dynamic-labs/dynamic-auth/issues/8317)) ([88c0234](https://github.com/dynamic-labs/dynamic-auth/commit/88c023483bad5736f38cb313b035279460f6e256))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* allow metmask sdk to retry connection ([#8322](https://github.com/dynamic-labs/dynamic-auth/issues/8322)) ([603ed99](https://github.com/dynamic-labs/dynamic-auth/commit/603ed99de3b5d90ac4f5eabcdcd3b2e90863298f))
|
|
13
|
+
* css for profile page without embedded wallets ([#8339](https://github.com/dynamic-labs/dynamic-auth/issues/8339)) ([7f696e9](https://github.com/dynamic-labs/dynamic-auth/commit/7f696e9986ddd899d140640f9af7cfd2dcd7c37a))
|
|
14
|
+
* ensure metamask connector can get display uri for multiple connections ([#8324](https://github.com/dynamic-labs/dynamic-auth/issues/8324)) ([1d95f08](https://github.com/dynamic-labs/dynamic-auth/commit/1d95f089589779e8ef078b80bd84fa0754179696))
|
|
15
|
+
* pass HttpTransportConfig to WalletClient, not just PublicClient ([#8333](https://github.com/dynamic-labs/dynamic-auth/issues/8333)) ([a0ddd10](https://github.com/dynamic-labs/dynamic-auth/commit/a0ddd10f1df57555cf0a3ed777f5d354eb140582))
|
|
16
|
+
|
|
17
|
+
### [4.9.5](https://github.com/dynamic-labs/dynamic-auth/compare/v4.9.4...v4.9.5) (2025-03-19)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* add support for AA to Global Wallet ([#8294](https://github.com/dynamic-labs/dynamic-auth/issues/8294)) ([173dfb9](https://github.com/dynamic-labs/dynamic-auth/commit/173dfb9c00e4307feec6ab11913f1a80310885eb))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* Remove the usage of random uuid in Global Wallet ([#8314](https://github.com/dynamic-labs/dynamic-auth/issues/8314)) ([79a7a64](https://github.com/dynamic-labs/dynamic-auth/commit/79a7a640b9ce470051a3c877ea46e8d4c94ea542))
|
|
28
|
+
* Fix UI when token balance is 0 ([#8299](https://github.com/dynamic-labs/dynamic-auth/issues/8299)) ([e8a2eca](https://github.com/dynamic-labs/dynamic-auth/commit/e8a2eca9876d914db738557a74751537eee2e129))
|
|
29
|
+
|
|
2
30
|
### [4.9.4](https://github.com/dynamic-labs/dynamic-auth/compare/v4.9.3...v4.9.4) (2025-03-17)
|
|
3
31
|
|
|
4
32
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/ethereum-core",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.6",
|
|
4
4
|
"description": "Core package for utilities and types for viem",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
},
|
|
19
19
|
"homepage": "https://www.dynamic.xyz/",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
22
|
-
"@dynamic-labs/assert-package-version": "4.9.
|
|
23
|
-
"@dynamic-labs/logger": "4.9.
|
|
24
|
-
"@dynamic-labs/rpc-providers": "4.9.
|
|
25
|
-
"@dynamic-labs/types": "4.9.
|
|
26
|
-
"@dynamic-labs/utils": "4.9.
|
|
27
|
-
"@dynamic-labs/wallet-book": "4.9.
|
|
28
|
-
"@dynamic-labs/wallet-connector-core": "4.9.
|
|
21
|
+
"@dynamic-labs/sdk-api-core": "0.0.644",
|
|
22
|
+
"@dynamic-labs/assert-package-version": "4.9.6",
|
|
23
|
+
"@dynamic-labs/logger": "4.9.6",
|
|
24
|
+
"@dynamic-labs/rpc-providers": "4.9.6",
|
|
25
|
+
"@dynamic-labs/types": "4.9.6",
|
|
26
|
+
"@dynamic-labs/utils": "4.9.6",
|
|
27
|
+
"@dynamic-labs/wallet-book": "4.9.6",
|
|
28
|
+
"@dynamic-labs/wallet-connector-core": "4.9.6"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"viem": "^2.21.55"
|
|
@@ -19,7 +19,7 @@ var EthereumWallet = require('../wallet/EthereumWallet.cjs');
|
|
|
19
19
|
|
|
20
20
|
class EthereumWalletConnector extends walletConnectorCore.WalletConnectorBase {
|
|
21
21
|
constructor(props) {
|
|
22
|
-
var _a, _b;
|
|
22
|
+
var _a, _b, _c;
|
|
23
23
|
super(props);
|
|
24
24
|
this.supportedChains = ['EVM', 'ETH'];
|
|
25
25
|
this.connectedChain = 'EVM';
|
|
@@ -33,8 +33,9 @@ class EthereumWalletConnector extends walletConnectorCore.WalletConnectorBase {
|
|
|
33
33
|
}, {});
|
|
34
34
|
this.walletUiUtils = props.walletUiUtils;
|
|
35
35
|
this.evmNetworks = utils.parseEvmNetworks(props.evmNetworks);
|
|
36
|
+
this.providersConfig = (_a = props.providersConfig) !== null && _a !== void 0 ? _a : {};
|
|
36
37
|
this.chainRpcProviders = props.chainRpcProviders;
|
|
37
|
-
(
|
|
38
|
+
(_b = this.chainRpcProviders) === null || _b === void 0 ? void 0 : _b.registerEvmProviders((_c = this.providersConfig) !== null && _c !== void 0 ? _c : {});
|
|
38
39
|
}
|
|
39
40
|
getPublicClient() {
|
|
40
41
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -23,6 +23,7 @@ export declare abstract class EthereumWalletConnector extends WalletConnectorBas
|
|
|
23
23
|
supportedChains: Chain[];
|
|
24
24
|
connectedChain: Chain;
|
|
25
25
|
evmNetworks: EvmNetwork[];
|
|
26
|
+
providersConfig: RegisterEvmProvidersConfig;
|
|
26
27
|
ChainWallet: typeof EthereumWallet;
|
|
27
28
|
private activeAccount;
|
|
28
29
|
private activeChain;
|
|
@@ -7471,7 +7472,7 @@ export declare abstract class EthereumWalletConnector extends WalletConnectorBas
|
|
|
7471
7472
|
[x: `address[${string}]`]: undefined;
|
|
7472
7473
|
[x: `bool[${string}]`]: undefined;
|
|
7473
7474
|
[x: `bytes[${string}]`]: undefined;
|
|
7474
|
-
[x: `
|
|
7475
|
+
[x: `bytes11[${string}]`]: undefined;
|
|
7475
7476
|
[x: `bytes1[${string}]`]: undefined;
|
|
7476
7477
|
[x: `bytes32[${string}]`]: undefined;
|
|
7477
7478
|
[x: `bytes31[${string}]`]: undefined;
|
|
@@ -7495,7 +7496,7 @@ export declare abstract class EthereumWalletConnector extends WalletConnectorBas
|
|
|
7495
7496
|
[x: `bytes14[${string}]`]: undefined;
|
|
7496
7497
|
[x: `bytes13[${string}]`]: undefined;
|
|
7497
7498
|
[x: `bytes12[${string}]`]: undefined;
|
|
7498
|
-
[x: `
|
|
7499
|
+
[x: `bytes10[${string}]`]: undefined;
|
|
7499
7500
|
[x: `bytes9[${string}]`]: undefined;
|
|
7500
7501
|
[x: `bytes8[${string}]`]: undefined;
|
|
7501
7502
|
[x: `bytes7[${string}]`]: undefined;
|
|
@@ -7573,7 +7574,7 @@ export declare abstract class EthereumWalletConnector extends WalletConnectorBas
|
|
|
7573
7574
|
address?: undefined;
|
|
7574
7575
|
bool?: undefined;
|
|
7575
7576
|
bytes?: undefined;
|
|
7576
|
-
|
|
7577
|
+
bytes11?: undefined;
|
|
7577
7578
|
bytes1?: undefined;
|
|
7578
7579
|
bytes32?: undefined;
|
|
7579
7580
|
bytes31?: undefined;
|
|
@@ -7597,7 +7598,7 @@ export declare abstract class EthereumWalletConnector extends WalletConnectorBas
|
|
|
7597
7598
|
bytes14?: undefined;
|
|
7598
7599
|
bytes13?: undefined;
|
|
7599
7600
|
bytes12?: undefined;
|
|
7600
|
-
|
|
7601
|
+
bytes10?: undefined;
|
|
7601
7602
|
bytes9?: undefined;
|
|
7602
7603
|
bytes8?: undefined;
|
|
7603
7604
|
bytes7?: undefined;
|
|
@@ -15,7 +15,7 @@ import { EthereumWallet } from '../wallet/EthereumWallet.js';
|
|
|
15
15
|
|
|
16
16
|
class EthereumWalletConnector extends WalletConnectorBase {
|
|
17
17
|
constructor(props) {
|
|
18
|
-
var _a, _b;
|
|
18
|
+
var _a, _b, _c;
|
|
19
19
|
super(props);
|
|
20
20
|
this.supportedChains = ['EVM', 'ETH'];
|
|
21
21
|
this.connectedChain = 'EVM';
|
|
@@ -29,8 +29,9 @@ class EthereumWalletConnector extends WalletConnectorBase {
|
|
|
29
29
|
}, {});
|
|
30
30
|
this.walletUiUtils = props.walletUiUtils;
|
|
31
31
|
this.evmNetworks = parseEvmNetworks(props.evmNetworks);
|
|
32
|
+
this.providersConfig = (_a = props.providersConfig) !== null && _a !== void 0 ? _a : {};
|
|
32
33
|
this.chainRpcProviders = props.chainRpcProviders;
|
|
33
|
-
(
|
|
34
|
+
(_b = this.chainRpcProviders) === null || _b === void 0 ? void 0 : _b.registerEvmProviders((_c = this.providersConfig) !== null && _c !== void 0 ? _c : {});
|
|
34
35
|
}
|
|
35
36
|
getPublicClient() {
|
|
36
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -23,7 +23,7 @@ rpcProviders.ChainRpcProviders.registerEvmProviders = (providersConfig) => {
|
|
|
23
23
|
const rpcUrl = ((_a = network.privateCustomerRpcUrls) === null || _a === void 0 ? void 0 : _a[0]) || network.rpcUrls[0];
|
|
24
24
|
const provider = viem.createPublicClient({
|
|
25
25
|
chain: getOrMapViemChain.getOrMapViemChain(network),
|
|
26
|
-
transport: viem.http(rpcUrl, providersConfig === null || providersConfig === void 0 ? void 0 : providersConfig.
|
|
26
|
+
transport: viem.http(rpcUrl, providersConfig === null || providersConfig === void 0 ? void 0 : providersConfig.httpTransportConfig),
|
|
27
27
|
});
|
|
28
28
|
return {
|
|
29
29
|
chainId: network.chainId,
|
|
@@ -6,7 +6,11 @@ type IEvmRpcProvider = {
|
|
|
6
6
|
provider: PublicClient<Transport, Chain>;
|
|
7
7
|
};
|
|
8
8
|
export type RegisterEvmProvidersConfig = {
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use `httpTransportConfig` instead.
|
|
11
|
+
*/
|
|
9
12
|
publicClientHttpTransportConfig?: HttpTransportConfig;
|
|
13
|
+
httpTransportConfig?: HttpTransportConfig;
|
|
10
14
|
};
|
|
11
15
|
declare module '@dynamic-labs/rpc-providers' {
|
|
12
16
|
type EvmRpcProvider = IEvmRpcProvider;
|
|
@@ -21,7 +21,7 @@ ChainRpcProviders.registerEvmProviders = (providersConfig) => {
|
|
|
21
21
|
const rpcUrl = ((_a = network.privateCustomerRpcUrls) === null || _a === void 0 ? void 0 : _a[0]) || network.rpcUrls[0];
|
|
22
22
|
const provider = createPublicClient({
|
|
23
23
|
chain: getOrMapViemChain(network),
|
|
24
|
-
transport: http(rpcUrl, providersConfig === null || providersConfig === void 0 ? void 0 : providersConfig.
|
|
24
|
+
transport: http(rpcUrl, providersConfig === null || providersConfig === void 0 ? void 0 : providersConfig.httpTransportConfig),
|
|
25
25
|
});
|
|
26
26
|
return {
|
|
27
27
|
chainId: network.chainId,
|
|
@@ -76,23 +76,28 @@ class EthereumWallet extends walletConnectorCore.Wallet {
|
|
|
76
76
|
*/
|
|
77
77
|
getWalletClient(chainId) {
|
|
78
78
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
var _a;
|
|
80
|
+
// Set active account if connector supports it, not AA atm
|
|
81
|
+
if ('setActiveAccount' in this._connector) {
|
|
82
|
+
this._connector.setActiveAccount(this.address);
|
|
83
|
+
}
|
|
79
84
|
const walletClient = this._connector.getWalletClient(chainId);
|
|
80
85
|
if (!walletClient) {
|
|
81
86
|
throw new Error('Unable to retrieve WalletClient');
|
|
82
87
|
}
|
|
83
88
|
return viem.createWalletClient({
|
|
84
|
-
account: this.address,
|
|
89
|
+
account: (_a = walletClient.account) !== null && _a !== void 0 ? _a : this.address,
|
|
85
90
|
chain: walletClient.chain,
|
|
86
91
|
transport: interceptTransport.interceptTransport({
|
|
87
|
-
onPersonalSign: (
|
|
92
|
+
onPersonalSign: (_b) => _tslib.__awaiter(this, [_b], void 0, function* ({ provider, args }) {
|
|
88
93
|
yield this.sync();
|
|
89
94
|
return provider.request(args);
|
|
90
95
|
}),
|
|
91
|
-
onSendTransaction: (
|
|
96
|
+
onSendTransaction: (_c) => _tslib.__awaiter(this, [_c], void 0, function* ({ provider, args }) {
|
|
92
97
|
yield this.sync();
|
|
93
98
|
return provider.request(args);
|
|
94
99
|
}),
|
|
95
|
-
onSignTypedData: (
|
|
100
|
+
onSignTypedData: (_d) => _tslib.__awaiter(this, [_d], void 0, function* ({ provider, args }) {
|
|
96
101
|
yield this.sync();
|
|
97
102
|
return provider.request(args);
|
|
98
103
|
}),
|
|
@@ -101,6 +106,9 @@ class EthereumWallet extends walletConnectorCore.Wallet {
|
|
|
101
106
|
});
|
|
102
107
|
});
|
|
103
108
|
}
|
|
109
|
+
getTransportConfig() {
|
|
110
|
+
return this._connector.providersConfig.httpTransportConfig;
|
|
111
|
+
}
|
|
104
112
|
}
|
|
105
113
|
|
|
106
114
|
exports.EthereumWallet = EthereumWallet;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Account, Chain, PublicClient, Transport, WalletClient } from 'viem';
|
|
1
|
+
import { Account, Chain, HttpTransportConfig, PublicClient, Transport, WalletClient } from 'viem';
|
|
2
2
|
import { Wallet, WalletProps } from '@dynamic-labs/wallet-connector-core';
|
|
3
3
|
import { EthereumWalletConnector } from '../connector';
|
|
4
4
|
export declare class EthereumWallet extends Wallet<EthereumWalletConnector> {
|
|
@@ -33,4 +33,5 @@ export declare class EthereumWallet extends Wallet<EthereumWalletConnector> {
|
|
|
33
33
|
* or throws if the client cannot be retrieved.
|
|
34
34
|
*/
|
|
35
35
|
getWalletClient(chainId?: string): Promise<WalletClient<Transport, Chain, Account>>;
|
|
36
|
+
getTransportConfig(): HttpTransportConfig | undefined;
|
|
36
37
|
}
|
|
@@ -72,23 +72,28 @@ class EthereumWallet extends Wallet {
|
|
|
72
72
|
*/
|
|
73
73
|
getWalletClient(chainId) {
|
|
74
74
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
var _a;
|
|
76
|
+
// Set active account if connector supports it, not AA atm
|
|
77
|
+
if ('setActiveAccount' in this._connector) {
|
|
78
|
+
this._connector.setActiveAccount(this.address);
|
|
79
|
+
}
|
|
75
80
|
const walletClient = this._connector.getWalletClient(chainId);
|
|
76
81
|
if (!walletClient) {
|
|
77
82
|
throw new Error('Unable to retrieve WalletClient');
|
|
78
83
|
}
|
|
79
84
|
return createWalletClient({
|
|
80
|
-
account: this.address,
|
|
85
|
+
account: (_a = walletClient.account) !== null && _a !== void 0 ? _a : this.address,
|
|
81
86
|
chain: walletClient.chain,
|
|
82
87
|
transport: interceptTransport({
|
|
83
|
-
onPersonalSign: (
|
|
88
|
+
onPersonalSign: (_b) => __awaiter(this, [_b], void 0, function* ({ provider, args }) {
|
|
84
89
|
yield this.sync();
|
|
85
90
|
return provider.request(args);
|
|
86
91
|
}),
|
|
87
|
-
onSendTransaction: (
|
|
92
|
+
onSendTransaction: (_c) => __awaiter(this, [_c], void 0, function* ({ provider, args }) {
|
|
88
93
|
yield this.sync();
|
|
89
94
|
return provider.request(args);
|
|
90
95
|
}),
|
|
91
|
-
onSignTypedData: (
|
|
96
|
+
onSignTypedData: (_d) => __awaiter(this, [_d], void 0, function* ({ provider, args }) {
|
|
92
97
|
yield this.sync();
|
|
93
98
|
return provider.request(args);
|
|
94
99
|
}),
|
|
@@ -97,6 +102,9 @@ class EthereumWallet extends Wallet {
|
|
|
97
102
|
});
|
|
98
103
|
});
|
|
99
104
|
}
|
|
105
|
+
getTransportConfig() {
|
|
106
|
+
return this._connector.providersConfig.httpTransportConfig;
|
|
107
|
+
}
|
|
100
108
|
}
|
|
101
109
|
|
|
102
110
|
export { EthereumWallet };
|