@dynamic-labs/ethereum-aa 3.6.0 → 3.6.1
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 +8 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +9 -9
- package/src/ZeroDevConnector.cjs +31 -6
- package/src/ZeroDevConnector.d.ts +5 -2
- package/src/ZeroDevConnector.js +31 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
|
|
2
|
+
### [3.6.1](https://github.com/dynamic-labs/DynamicAuth/compare/v3.6.0...v3.6.1) (2024-11-08)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* when confirmation ui disabled for solana signall and signTransaction, it was returning a string instead of a transaction ([#7404](https://github.com/dynamic-labs/DynamicAuth/issues/7404)) ([9c17d83](https://github.com/dynamic-labs/DynamicAuth/commit/9c17d83e808f576bd319892b9726e5692534b31d))
|
|
8
|
+
* solana sign transaction was throwing with destination not found for embedded wallets ([#7394](https://github.com/dynamic-labs/DynamicAuth/issues/7394)) ([5bc21cd](https://github.com/dynamic-labs/DynamicAuth/commit/5bc21cdc2aee3dd70fc455e54e586d695392702b))
|
|
9
|
+
|
|
2
10
|
## [3.6.0](https://github.com/dynamic-labs/DynamicAuth/compare/v3.5.1...v3.6.0) (2024-11-07)
|
|
3
11
|
|
|
4
12
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/ethereum-aa",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -26,18 +26,18 @@
|
|
|
26
26
|
"./package.json": "./package.json"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
29
|
+
"@dynamic-labs/sdk-api-core": "0.0.563",
|
|
30
30
|
"@zerodev/ecdsa-validator": "5.3.1",
|
|
31
31
|
"@zerodev/multi-chain-validator": "5.3.3",
|
|
32
32
|
"@zerodev/sdk": "5.3.4",
|
|
33
33
|
"permissionless": "^0.1.20",
|
|
34
|
-
"@dynamic-labs/assert-package-version": "3.6.
|
|
35
|
-
"@dynamic-labs/ethereum-core": "3.6.
|
|
36
|
-
"@dynamic-labs/logger": "3.6.
|
|
37
|
-
"@dynamic-labs/types": "3.6.
|
|
38
|
-
"@dynamic-labs/utils": "3.6.
|
|
39
|
-
"@dynamic-labs/wallet-book": "3.6.
|
|
40
|
-
"@dynamic-labs/wallet-connector-core": "3.6.
|
|
34
|
+
"@dynamic-labs/assert-package-version": "3.6.1",
|
|
35
|
+
"@dynamic-labs/ethereum-core": "3.6.1",
|
|
36
|
+
"@dynamic-labs/logger": "3.6.1",
|
|
37
|
+
"@dynamic-labs/types": "3.6.1",
|
|
38
|
+
"@dynamic-labs/utils": "3.6.1",
|
|
39
|
+
"@dynamic-labs/wallet-book": "3.6.1",
|
|
40
|
+
"@dynamic-labs/wallet-connector-core": "3.6.1"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"viem": "^2.7.6"
|
package/src/ZeroDevConnector.cjs
CHANGED
|
@@ -118,19 +118,30 @@ class ZeroDevConnector extends walletConnectorCore.WalletConnectorBase {
|
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
120
|
registerEoa(_a) {
|
|
121
|
-
return _tslib.__awaiter(this, arguments, void 0, function* ({ smartWalletAddress, eoaAddress, eoaConnector, shouldSetEoaConnector = false, }) {
|
|
121
|
+
return _tslib.__awaiter(this, arguments, void 0, function* ({ smartWalletAddress, eoaAddress, eoaConnector, shouldSetEoaConnector = false, ecdsaProviderType, kernelVersion, entryPointVersion, }) {
|
|
122
|
+
const properties = {
|
|
123
|
+
ecdsaProviderType,
|
|
124
|
+
entryPointVersion,
|
|
125
|
+
kernelVersion,
|
|
126
|
+
};
|
|
122
127
|
this.eoaConnectorMap[smartWalletAddress] = {
|
|
123
128
|
eoaAddress,
|
|
124
129
|
eoaConnector,
|
|
130
|
+
properties,
|
|
125
131
|
};
|
|
126
132
|
// if this is the primary wallet, set the eoa connector and kernel clients
|
|
127
133
|
if (shouldSetEoaConnector && this.eoaAddress !== eoaAddress) {
|
|
128
|
-
yield this.setEoaConnector(
|
|
134
|
+
yield this.setEoaConnector({
|
|
135
|
+
connector: eoaConnector,
|
|
136
|
+
eoaAddress,
|
|
137
|
+
properties,
|
|
138
|
+
});
|
|
129
139
|
}
|
|
130
140
|
});
|
|
131
141
|
}
|
|
132
|
-
setEoaConnector(
|
|
133
|
-
return _tslib.__awaiter(this,
|
|
142
|
+
setEoaConnector(_a) {
|
|
143
|
+
return _tslib.__awaiter(this, arguments, void 0, function* ({ eoaAddress, connector, properties, }) {
|
|
144
|
+
var _b;
|
|
134
145
|
if (!connector) {
|
|
135
146
|
logger.logger.error('No EOA connector provided');
|
|
136
147
|
return;
|
|
@@ -138,6 +149,16 @@ class ZeroDevConnector extends walletConnectorCore.WalletConnectorBase {
|
|
|
138
149
|
this.kernelClientDeferredPromise = new utils.DeferredPromise();
|
|
139
150
|
this.eoaConnector = connector;
|
|
140
151
|
this.eoaAddress = eoaAddress;
|
|
152
|
+
if (properties) {
|
|
153
|
+
this.ecdsaProviderType =
|
|
154
|
+
(_b = properties.ecdsaProviderType) !== null && _b !== void 0 ? _b : this.ecdsaProviderType;
|
|
155
|
+
this.entryPoint = properties.entryPointVersion
|
|
156
|
+
? getEntryPoint.getEntryPoint(properties.entryPointVersion)
|
|
157
|
+
: this.entryPoint;
|
|
158
|
+
this.kernelVersion = properties.entryPointVersion
|
|
159
|
+
? getKernelVersion.getKernelVersion(properties.kernelVersion, this.entryPoint)
|
|
160
|
+
: this.kernelVersion;
|
|
161
|
+
}
|
|
141
162
|
if (ethereumCore.isEthWalletConnector(this.eoaConnector) &&
|
|
142
163
|
!this.eoaConnector.getActiveAccount()) {
|
|
143
164
|
yield this.eoaConnector.getConnectedAccounts();
|
|
@@ -419,9 +440,13 @@ class ZeroDevConnector extends walletConnectorCore.WalletConnectorBase {
|
|
|
419
440
|
if (!eoa) {
|
|
420
441
|
throw new utils.DynamicError('No EOA connector');
|
|
421
442
|
}
|
|
422
|
-
const { eoaAddress, eoaConnector } = eoa;
|
|
443
|
+
const { eoaAddress, eoaConnector, properties } = eoa;
|
|
423
444
|
yield eoaConnector.validateActiveWallet(eoaAddress);
|
|
424
|
-
yield this.setEoaConnector(
|
|
445
|
+
yield this.setEoaConnector({
|
|
446
|
+
connector: eoaConnector,
|
|
447
|
+
eoaAddress,
|
|
448
|
+
properties,
|
|
449
|
+
});
|
|
425
450
|
});
|
|
426
451
|
}
|
|
427
452
|
}
|
|
@@ -5,7 +5,7 @@ import { type Chain as ViemChain } from 'viem/chains';
|
|
|
5
5
|
import { EntryPoint } from 'permissionless/types';
|
|
6
6
|
import { KERNEL_VERSION_TYPE } from '@zerodev/sdk/types';
|
|
7
7
|
import { EthereumWallet } from '@dynamic-labs/ethereum-core';
|
|
8
|
-
import { Provider, ProviderEnum, ProviderMultichainAccountAbstractionProviders } from '@dynamic-labs/sdk-api-core';
|
|
8
|
+
import { EcdsaValidatorOptions, Provider, ProviderEntryPointVersionEnum, ProviderEnum, ProviderKernelVersionEnum, ProviderMultichainAccountAbstractionProviders } from '@dynamic-labs/sdk-api-core';
|
|
9
9
|
import { Chain, IAccountAbstractionWalletConnector, ISendBalanceWalletConnector, InternalWalletConnector, WalletConnectorBase } from '@dynamic-labs/wallet-connector-core';
|
|
10
10
|
import { WalletBookSchema } from '@dynamic-labs/wallet-book';
|
|
11
11
|
import { EvmNetwork, GenericNetwork, IUITransaction, WalletUiUtils } from '@dynamic-labs/types';
|
|
@@ -78,11 +78,14 @@ export declare class ZeroDevConnector extends WalletConnectorBase<typeof Ethereu
|
|
|
78
78
|
withSponsorship?: boolean;
|
|
79
79
|
}): KernelClient | undefined;
|
|
80
80
|
endSession(): Promise<void>;
|
|
81
|
-
registerEoa({ smartWalletAddress, eoaAddress, eoaConnector, shouldSetEoaConnector, }: {
|
|
81
|
+
registerEoa({ smartWalletAddress, eoaAddress, eoaConnector, shouldSetEoaConnector, ecdsaProviderType, kernelVersion, entryPointVersion, }: {
|
|
82
82
|
smartWalletAddress: string;
|
|
83
83
|
eoaAddress: string;
|
|
84
84
|
eoaConnector: InternalWalletConnector;
|
|
85
85
|
shouldSetEoaConnector: boolean;
|
|
86
|
+
ecdsaProviderType?: EcdsaValidatorOptions;
|
|
87
|
+
kernelVersion?: ProviderKernelVersionEnum;
|
|
88
|
+
entryPointVersion?: ProviderEntryPointVersionEnum;
|
|
86
89
|
}): Promise<void>;
|
|
87
90
|
private setEoaConnector;
|
|
88
91
|
private warnIfProjectChainNotEnabled;
|
package/src/ZeroDevConnector.js
CHANGED
|
@@ -114,19 +114,30 @@ class ZeroDevConnector extends WalletConnectorBase {
|
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
registerEoa(_a) {
|
|
117
|
-
return __awaiter(this, arguments, void 0, function* ({ smartWalletAddress, eoaAddress, eoaConnector, shouldSetEoaConnector = false, }) {
|
|
117
|
+
return __awaiter(this, arguments, void 0, function* ({ smartWalletAddress, eoaAddress, eoaConnector, shouldSetEoaConnector = false, ecdsaProviderType, kernelVersion, entryPointVersion, }) {
|
|
118
|
+
const properties = {
|
|
119
|
+
ecdsaProviderType,
|
|
120
|
+
entryPointVersion,
|
|
121
|
+
kernelVersion,
|
|
122
|
+
};
|
|
118
123
|
this.eoaConnectorMap[smartWalletAddress] = {
|
|
119
124
|
eoaAddress,
|
|
120
125
|
eoaConnector,
|
|
126
|
+
properties,
|
|
121
127
|
};
|
|
122
128
|
// if this is the primary wallet, set the eoa connector and kernel clients
|
|
123
129
|
if (shouldSetEoaConnector && this.eoaAddress !== eoaAddress) {
|
|
124
|
-
yield this.setEoaConnector(
|
|
130
|
+
yield this.setEoaConnector({
|
|
131
|
+
connector: eoaConnector,
|
|
132
|
+
eoaAddress,
|
|
133
|
+
properties,
|
|
134
|
+
});
|
|
125
135
|
}
|
|
126
136
|
});
|
|
127
137
|
}
|
|
128
|
-
setEoaConnector(
|
|
129
|
-
return __awaiter(this,
|
|
138
|
+
setEoaConnector(_a) {
|
|
139
|
+
return __awaiter(this, arguments, void 0, function* ({ eoaAddress, connector, properties, }) {
|
|
140
|
+
var _b;
|
|
130
141
|
if (!connector) {
|
|
131
142
|
logger.error('No EOA connector provided');
|
|
132
143
|
return;
|
|
@@ -134,6 +145,16 @@ class ZeroDevConnector extends WalletConnectorBase {
|
|
|
134
145
|
this.kernelClientDeferredPromise = new DeferredPromise();
|
|
135
146
|
this.eoaConnector = connector;
|
|
136
147
|
this.eoaAddress = eoaAddress;
|
|
148
|
+
if (properties) {
|
|
149
|
+
this.ecdsaProviderType =
|
|
150
|
+
(_b = properties.ecdsaProviderType) !== null && _b !== void 0 ? _b : this.ecdsaProviderType;
|
|
151
|
+
this.entryPoint = properties.entryPointVersion
|
|
152
|
+
? getEntryPoint(properties.entryPointVersion)
|
|
153
|
+
: this.entryPoint;
|
|
154
|
+
this.kernelVersion = properties.entryPointVersion
|
|
155
|
+
? getKernelVersion(properties.kernelVersion, this.entryPoint)
|
|
156
|
+
: this.kernelVersion;
|
|
157
|
+
}
|
|
137
158
|
if (isEthWalletConnector(this.eoaConnector) &&
|
|
138
159
|
!this.eoaConnector.getActiveAccount()) {
|
|
139
160
|
yield this.eoaConnector.getConnectedAccounts();
|
|
@@ -415,9 +436,13 @@ class ZeroDevConnector extends WalletConnectorBase {
|
|
|
415
436
|
if (!eoa) {
|
|
416
437
|
throw new DynamicError('No EOA connector');
|
|
417
438
|
}
|
|
418
|
-
const { eoaAddress, eoaConnector } = eoa;
|
|
439
|
+
const { eoaAddress, eoaConnector, properties } = eoa;
|
|
419
440
|
yield eoaConnector.validateActiveWallet(eoaAddress);
|
|
420
|
-
yield this.setEoaConnector(
|
|
441
|
+
yield this.setEoaConnector({
|
|
442
|
+
connector: eoaConnector,
|
|
443
|
+
eoaAddress,
|
|
444
|
+
properties,
|
|
445
|
+
});
|
|
421
446
|
});
|
|
422
447
|
}
|
|
423
448
|
}
|