@dynamic-labs/ethereum-core 4.0.0-alpha.48 → 4.0.0-alpha.49

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,33 @@
1
1
 
2
+ ## [4.0.0-alpha.49](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.48...v4.0.0-alpha.49) (2024-12-27)
3
+
4
+
5
+ ### ⚠ BREAKING CHANGES
6
+
7
+ * change openFunding to openExternalFunding (#7684)
8
+
9
+ ### Features
10
+
11
+ * aa blockaid simulations ([#7583](https://github.com/dynamic-labs/dynamic-auth/issues/7583)) ([6436220](https://github.com/dynamic-labs/dynamic-auth/commit/64362204d2c96291a37bf281d62531d6f2384fdf))
12
+ * add ethereum createConnector function ([#7607](https://github.com/dynamic-labs/dynamic-auth/issues/7607)) ([f306537](https://github.com/dynamic-labs/dynamic-auth/commit/f3065372f3c5dfc8bf26173dc722576e614af5e1))
13
+ * add fundWithExternalWallet method to useFunding ([#7688](https://github.com/dynamic-labs/dynamic-auth/issues/7688)) ([d48b1d2](https://github.com/dynamic-labs/dynamic-auth/commit/d48b1d2568ba928b322a4d81b6386e775ae4aa98))
14
+ * change openFunding to openExternalFunding ([#7684](https://github.com/dynamic-labs/dynamic-auth/issues/7684)) ([8efb9cb](https://github.com/dynamic-labs/dynamic-auth/commit/8efb9cb9ca3d7e2273c14e18f7be5892e50b8e12))
15
+ * connect global wallet in ethereum ([#7619](https://github.com/dynamic-labs/dynamic-auth/issues/7619)) ([fdb7f00](https://github.com/dynamic-labs/dynamic-auth/commit/fdb7f00c33f7da3ac95ae13ac674caa64b453cae))
16
+ * create wallet groups dynamically based on wallet options ([#7662](https://github.com/dynamic-labs/dynamic-auth/issues/7662)) ([981affc](https://github.com/dynamic-labs/dynamic-auth/commit/981affce5518f6532d960fe4e879e9cf40a66ce7))
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * **ethereum:** normalize user reject error from injected wallets ([#7702](https://github.com/dynamic-labs/dynamic-auth/issues/7702)) ([ce456a8](https://github.com/dynamic-labs/dynamic-auth/commit/ce456a8592197b07857baf32bb1b38867ffb37fe))
22
+ * fetch nonce when authenticating a user that connected in connect-only mode ([#7689](https://github.com/dynamic-labs/dynamic-auth/issues/7689)) ([f048bb9](https://github.com/dynamic-labs/dynamic-auth/commit/f048bb96b6cb5ae603966b2813f900a082cd158f))
23
+ * filter out wallets for the current network when using external wallet funding ([#7694](https://github.com/dynamic-labs/dynamic-auth/issues/7694)) ([65db665](https://github.com/dynamic-labs/dynamic-auth/commit/65db6652a934561e7d07379a65d2baa8f7813d8e))
24
+ * remove toaccount from signmessage and signtypeddata for zerodev ([#7650](https://github.com/dynamic-labs/dynamic-auth/issues/7650)) ([626e849](https://github.com/dynamic-labs/dynamic-auth/commit/626e849a4af3af51d60b42dd2787edb05126744b))
25
+ * save nonce to storage ([#7698](https://github.com/dynamic-labs/dynamic-auth/issues/7698)) ([93dc65b](https://github.com/dynamic-labs/dynamic-auth/commit/93dc65b7f78040367b85420c1374f3cafbfb598b))
26
+ * **sdk-react-core:** add timeout when getting connected accounts ([#7697](https://github.com/dynamic-labs/dynamic-auth/issues/7697)) ([9a4bd7c](https://github.com/dynamic-labs/dynamic-auth/commit/9a4bd7c02795205ec98d8d71aba75b51b9bbee7c))
27
+ * update auth token from new source ([#7666](https://github.com/dynamic-labs/dynamic-auth/issues/7666)) ([61798de](https://github.com/dynamic-labs/dynamic-auth/commit/61798de26d759db9064f5f84118540346a44ab50))
28
+ * update extension update_url endpoint ([#7655](https://github.com/dynamic-labs/dynamic-auth/issues/7655)) ([46cff3a](https://github.com/dynamic-labs/dynamic-auth/commit/46cff3a80c9efee659a764df47f927ed5a117079))
29
+ * zerodev confirmation UI closes properly ([#7664](https://github.com/dynamic-labs/dynamic-auth/issues/7664)) ([a78aded](https://github.com/dynamic-labs/dynamic-auth/commit/a78adedc054d09134198d22812aa5cab7bbff548))
30
+
2
31
  ## [4.0.0-alpha.48](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.47...v4.0.0-alpha.48) (2024-12-17)
3
32
 
4
33
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.0.0-alpha.48";
6
+ var version = "4.0.0-alpha.49";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.0.0-alpha.48";
2
+ var version = "4.0.0-alpha.49";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/ethereum-core",
3
- "version": "4.0.0-alpha.48",
3
+ "version": "4.0.0-alpha.49",
4
4
  "description": "Core package for utilities and types for viem",
5
5
  "author": "Dynamic Labs, Inc.",
6
6
  "license": "MIT",
@@ -18,16 +18,16 @@
18
18
  },
19
19
  "homepage": "https://www.dynamic.xyz/",
20
20
  "dependencies": {
21
- "@dynamic-labs/sdk-api-core": "0.0.576"
21
+ "@dynamic-labs/sdk-api-core": "0.0.578"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "viem": "^2.7.12",
25
- "@dynamic-labs/assert-package-version": "4.0.0-alpha.48",
26
- "@dynamic-labs/logger": "4.0.0-alpha.48",
27
- "@dynamic-labs/rpc-providers": "4.0.0-alpha.48",
28
- "@dynamic-labs/types": "4.0.0-alpha.48",
29
- "@dynamic-labs/utils": "4.0.0-alpha.48",
30
- "@dynamic-labs/wallet-book": "4.0.0-alpha.48",
31
- "@dynamic-labs/wallet-connector-core": "4.0.0-alpha.48"
25
+ "@dynamic-labs/assert-package-version": "4.0.0-alpha.49",
26
+ "@dynamic-labs/logger": "4.0.0-alpha.49",
27
+ "@dynamic-labs/rpc-providers": "4.0.0-alpha.49",
28
+ "@dynamic-labs/types": "4.0.0-alpha.49",
29
+ "@dynamic-labs/utils": "4.0.0-alpha.49",
30
+ "@dynamic-labs/wallet-book": "4.0.0-alpha.49",
31
+ "@dynamic-labs/wallet-connector-core": "4.0.0-alpha.49"
32
32
  }
33
33
  }
@@ -0,0 +1,103 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var _tslib = require('../../../_virtual/_tslib.cjs');
7
+ var EthereumWalletConnector = require('../EthereumWalletConnector.cjs');
8
+
9
+ const createConnector = (customConnectorFn) => (props) => {
10
+ const delegate = customConnectorFn(props);
11
+ return [
12
+ class extends EthereumWalletConnector.EthereumWalletConnector {
13
+ constructor(props) {
14
+ super(Object.assign(Object.assign({}, props), { metadata: delegate.metadata }));
15
+ this.name = delegate.metadata.name;
16
+ this.overrideKey = `${delegate.metadata.name}evm`;
17
+ }
18
+ connect() {
19
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
20
+ yield delegate.connect();
21
+ });
22
+ }
23
+ endSession() {
24
+ const _super = Object.create(null, {
25
+ endSession: { get: () => super.endSession }
26
+ });
27
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
28
+ if (delegate.disconnect) {
29
+ yield delegate.disconnect();
30
+ }
31
+ return _super.endSession.call(this);
32
+ });
33
+ }
34
+ getAddress() {
35
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
36
+ return delegate.getAddress();
37
+ });
38
+ }
39
+ getConnectedAccounts() {
40
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
41
+ return delegate.getConnectedAccounts();
42
+ });
43
+ }
44
+ getNetwork() {
45
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
46
+ return delegate.getNetwork();
47
+ });
48
+ }
49
+ getPublicClient() {
50
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
51
+ return delegate.getPublicClient();
52
+ });
53
+ }
54
+ getWalletClient(chainId) {
55
+ return delegate.getWalletClient(chainId);
56
+ }
57
+ isInstalledOnBrowser() {
58
+ return delegate.isInstalledOnBrowser();
59
+ }
60
+ signMessage(messageToSign) {
61
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
62
+ return delegate.signMessage(messageToSign);
63
+ });
64
+ }
65
+ filter() {
66
+ if (delegate.filter) {
67
+ return delegate.filter();
68
+ }
69
+ return super.filter();
70
+ }
71
+ init() {
72
+ const _super = Object.create(null, {
73
+ init: { get: () => super.init }
74
+ });
75
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
76
+ if (delegate.init) {
77
+ return delegate.init();
78
+ }
79
+ return _super.init.call(this);
80
+ });
81
+ }
82
+ supportsNetworkSwitching() {
83
+ if (delegate.supportsNetworkSwitching) {
84
+ return delegate.supportsNetworkSwitching();
85
+ }
86
+ return super.supportsNetworkSwitching();
87
+ }
88
+ switchNetwork(_a) {
89
+ const _super = Object.create(null, {
90
+ switchNetwork: { get: () => super.switchNetwork }
91
+ });
92
+ return _tslib.__awaiter(this, arguments, void 0, function* ({ networkName, networkChainId, }) {
93
+ if (delegate.switchNetwork) {
94
+ return delegate.switchNetwork({ networkChainId, networkName });
95
+ }
96
+ return _super.switchNetwork.call(this, { networkChainId, networkName });
97
+ });
98
+ }
99
+ },
100
+ ];
101
+ };
102
+
103
+ exports.createConnector = createConnector;
@@ -0,0 +1,23 @@
1
+ import { WalletClient, Transport, Chain, Account, PublicClient } from 'viem';
2
+ import { WalletConnectorsMethod, WalletMetadata } from '@dynamic-labs/wallet-connector-core';
3
+ type CustomConnectorDelegate = {
4
+ metadata: WalletMetadata;
5
+ connect: () => Promise<void>;
6
+ disconnect: () => Promise<void>;
7
+ getAddress: () => Promise<string>;
8
+ getConnectedAccounts: () => Promise<string[]>;
9
+ getNetwork: () => Promise<number | undefined>;
10
+ getPublicClient: () => Promise<void | PublicClient<Transport, Chain> | undefined>;
11
+ getWalletClient: (chainId?: string) => WalletClient<Transport, Chain, Account> | undefined;
12
+ isInstalledOnBrowser: () => boolean;
13
+ signMessage: (messageToSign: string) => Promise<string>;
14
+ filter?: () => boolean;
15
+ init?: () => Promise<void>;
16
+ supportsNetworkSwitching?: () => boolean;
17
+ switchNetwork?: (props: {
18
+ networkName?: string;
19
+ networkChainId?: number;
20
+ }) => Promise<void>;
21
+ };
22
+ export declare const createConnector: (customConnectorFn: (props: any) => CustomConnectorDelegate) => WalletConnectorsMethod;
23
+ export {};
@@ -0,0 +1,99 @@
1
+ 'use client'
2
+ import { __awaiter } from '../../../_virtual/_tslib.js';
3
+ import { EthereumWalletConnector } from '../EthereumWalletConnector.js';
4
+
5
+ const createConnector = (customConnectorFn) => (props) => {
6
+ const delegate = customConnectorFn(props);
7
+ return [
8
+ class extends EthereumWalletConnector {
9
+ constructor(props) {
10
+ super(Object.assign(Object.assign({}, props), { metadata: delegate.metadata }));
11
+ this.name = delegate.metadata.name;
12
+ this.overrideKey = `${delegate.metadata.name}evm`;
13
+ }
14
+ connect() {
15
+ return __awaiter(this, void 0, void 0, function* () {
16
+ yield delegate.connect();
17
+ });
18
+ }
19
+ endSession() {
20
+ const _super = Object.create(null, {
21
+ endSession: { get: () => super.endSession }
22
+ });
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ if (delegate.disconnect) {
25
+ yield delegate.disconnect();
26
+ }
27
+ return _super.endSession.call(this);
28
+ });
29
+ }
30
+ getAddress() {
31
+ return __awaiter(this, void 0, void 0, function* () {
32
+ return delegate.getAddress();
33
+ });
34
+ }
35
+ getConnectedAccounts() {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ return delegate.getConnectedAccounts();
38
+ });
39
+ }
40
+ getNetwork() {
41
+ return __awaiter(this, void 0, void 0, function* () {
42
+ return delegate.getNetwork();
43
+ });
44
+ }
45
+ getPublicClient() {
46
+ return __awaiter(this, void 0, void 0, function* () {
47
+ return delegate.getPublicClient();
48
+ });
49
+ }
50
+ getWalletClient(chainId) {
51
+ return delegate.getWalletClient(chainId);
52
+ }
53
+ isInstalledOnBrowser() {
54
+ return delegate.isInstalledOnBrowser();
55
+ }
56
+ signMessage(messageToSign) {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ return delegate.signMessage(messageToSign);
59
+ });
60
+ }
61
+ filter() {
62
+ if (delegate.filter) {
63
+ return delegate.filter();
64
+ }
65
+ return super.filter();
66
+ }
67
+ init() {
68
+ const _super = Object.create(null, {
69
+ init: { get: () => super.init }
70
+ });
71
+ return __awaiter(this, void 0, void 0, function* () {
72
+ if (delegate.init) {
73
+ return delegate.init();
74
+ }
75
+ return _super.init.call(this);
76
+ });
77
+ }
78
+ supportsNetworkSwitching() {
79
+ if (delegate.supportsNetworkSwitching) {
80
+ return delegate.supportsNetworkSwitching();
81
+ }
82
+ return super.supportsNetworkSwitching();
83
+ }
84
+ switchNetwork(_a) {
85
+ const _super = Object.create(null, {
86
+ switchNetwork: { get: () => super.switchNetwork }
87
+ });
88
+ return __awaiter(this, arguments, void 0, function* ({ networkName, networkChainId, }) {
89
+ if (delegate.switchNetwork) {
90
+ return delegate.switchNetwork({ networkChainId, networkName });
91
+ }
92
+ return _super.switchNetwork.call(this, { networkChainId, networkName });
93
+ });
94
+ }
95
+ },
96
+ ];
97
+ };
98
+
99
+ export { createConnector };
@@ -0,0 +1 @@
1
+ export * from './createConnector';
@@ -1,2 +1,3 @@
1
1
  export * from './EthereumWalletConnector';
2
2
  export * from './isEthWalletConnector';
3
+ export * from './createConnector';
package/src/index.cjs CHANGED
@@ -7,6 +7,7 @@ var assertPackageVersion = require('@dynamic-labs/assert-package-version');
7
7
  var _package = require('../package.cjs');
8
8
  var EthereumWalletConnector = require('./connector/EthereumWalletConnector.cjs');
9
9
  var isEthWalletConnector = require('./connector/isEthWalletConnector/isEthWalletConnector.cjs');
10
+ var createConnector = require('./connector/createConnector/createConnector.cjs');
10
11
  require('./rpc/RpcProvidersEthereum/RpcProvidersEthereum.cjs');
11
12
  var rpcProviders = require('@dynamic-labs/rpc-providers');
12
13
  var evmProvidersSelector = require('./rpc/evmProvidersSelector/evmProvidersSelector.cjs');
@@ -31,6 +32,7 @@ assertPackageVersion.assertPackageVersion('@dynamic-labs/ethereum-core', _packag
31
32
 
32
33
  exports.EthereumWalletConnector = EthereumWalletConnector.EthereumWalletConnector;
33
34
  exports.isEthWalletConnector = isEthWalletConnector.isEthWalletConnector;
35
+ exports.createConnector = createConnector.createConnector;
34
36
  exports.evmProvidersSelector = evmProvidersSelector.evmProvidersSelector;
35
37
  exports.ViemRpcUiTransaction = ViemRpcUiTransaction.ViemRpcUiTransaction;
36
38
  exports.ViemUiTransaction = ViemUiTransaction.ViemUiTransaction;
package/src/index.js CHANGED
@@ -3,6 +3,7 @@ import { assertPackageVersion } from '@dynamic-labs/assert-package-version';
3
3
  import { version } from '../package.js';
4
4
  export { EthereumWalletConnector } from './connector/EthereumWalletConnector.js';
5
5
  export { isEthWalletConnector } from './connector/isEthWalletConnector/isEthWalletConnector.js';
6
+ export { createConnector } from './connector/createConnector/createConnector.js';
6
7
  import './rpc/RpcProvidersEthereum/RpcProvidersEthereum.js';
7
8
  export * from '@dynamic-labs/rpc-providers';
8
9
  export { evmProvidersSelector } from './rpc/evmProvidersSelector/evmProvidersSelector.js';
@@ -62,10 +62,11 @@ class ViemRpcUiTransaction extends Eip1559FeeFeed.Eip1559FeeFeed {
62
62
  estimateGas() {
63
63
  return _tslib.__awaiter(this, void 0, void 0, function* () {
64
64
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
65
- const _a = this.transaction, transaction = _tslib.__rest(_a, ["from"]);
65
+ const _a = this.transaction, { from } = _a, transaction = _tslib.__rest(_a, ["from"]);
66
+ const transactionWithFrom = Object.assign(Object.assign({}, transaction), { from });
66
67
  const hexResult = (yield this.publicClient.transport.request({
67
68
  method: 'eth_estimateGas',
68
- params: [transaction],
69
+ params: [transactionWithFrom],
69
70
  }));
70
71
  return viem.hexToBigInt(hexResult);
71
72
  });
@@ -58,10 +58,11 @@ class ViemRpcUiTransaction extends Eip1559FeeFeed {
58
58
  estimateGas() {
59
59
  return __awaiter(this, void 0, void 0, function* () {
60
60
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
61
- const _a = this.transaction, transaction = __rest(_a, ["from"]);
61
+ const _a = this.transaction, { from } = _a, transaction = __rest(_a, ["from"]);
62
+ const transactionWithFrom = Object.assign(Object.assign({}, transaction), { from });
62
63
  const hexResult = (yield this.publicClient.transport.request({
63
64
  method: 'eth_estimateGas',
64
- params: [transaction],
65
+ params: [transactionWithFrom],
65
66
  }));
66
67
  return hexToBigInt(hexResult);
67
68
  });