@dynamic-labs/waas-evm 4.17.0 → 4.18.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 +25 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +9 -9
- package/src/DynamicWaasEVMConnector.cjs +28 -10
- package/src/DynamicWaasEVMConnector.d.ts +6 -3
- package/src/DynamicWaasEVMConnector.js +28 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,29 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.18.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.18.0...v4.18.1) (2025-05-09)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* allow setting zerodev bundler provider from dashboard ([#8548](https://github.com/dynamic-labs/dynamic-auth/issues/8548)) ([d226733](https://github.com/dynamic-labs/dynamic-auth/commit/d2267334db3d9d742833437c81a382742c8d6a74))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* correctly show back button on connect with qr view ([#8668](https://github.com/dynamic-labs/dynamic-auth/issues/8668)) ([3cff309](https://github.com/dynamic-labs/dynamic-auth/commit/3cff309fa35d7201d0c098b793334908716bc0db))
|
|
13
|
+
* display correct app origin when signing message with global wallet ([#8677](https://github.com/dynamic-labs/dynamic-auth/issues/8677)) ([a70eeb3](https://github.com/dynamic-labs/dynamic-auth/commit/a70eeb3ea28a5ad749cb5c14a0d3c49318099712))
|
|
14
|
+
|
|
15
|
+
## [4.18.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.17.0...v4.18.0) (2025-05-07)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* 7702 authorization now happens on the first transaction and could use sponsored user operation if paymaster provided (IMPORTANT: viem need to be upgraded to at least 2.28.4)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* inline email submit button color when active ([#8663](https://github.com/dynamic-labs/dynamic-auth/issues/8663)) ([ea556e9](https://github.com/dynamic-labs/dynamic-auth/commit/ea556e9116e876fb2180870e74b6c8c6a13faecb))
|
|
26
|
+
|
|
2
27
|
## [4.17.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.16.0...v4.17.0) (2025-05-06)
|
|
3
28
|
|
|
4
29
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/waas-evm",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.18.1",
|
|
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",
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
"homepage": "https://www.dynamic.xyz/",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@dynamic-labs-wallet/evm": "0.0.65",
|
|
22
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
23
|
-
"viem": "^2.
|
|
24
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
25
|
-
"@dynamic-labs/ethereum-core": "4.
|
|
26
|
-
"@dynamic-labs/logger": "4.
|
|
27
|
-
"@dynamic-labs/types": "4.
|
|
28
|
-
"@dynamic-labs/utils": "4.
|
|
29
|
-
"@dynamic-labs/wallet-connector-core": "4.
|
|
22
|
+
"@dynamic-labs/sdk-api-core": "0.0.663",
|
|
23
|
+
"viem": "^2.28.4",
|
|
24
|
+
"@dynamic-labs/assert-package-version": "4.18.1",
|
|
25
|
+
"@dynamic-labs/ethereum-core": "4.18.1",
|
|
26
|
+
"@dynamic-labs/logger": "4.18.1",
|
|
27
|
+
"@dynamic-labs/types": "4.18.1",
|
|
28
|
+
"@dynamic-labs/utils": "4.18.1",
|
|
29
|
+
"@dynamic-labs/wallet-connector-core": "4.18.1"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {}
|
|
32
32
|
}
|
|
@@ -176,8 +176,9 @@ class DynamicWaasEVMConnector extends ethereumCore.EthereumWalletConnector {
|
|
|
176
176
|
}
|
|
177
177
|
getViemAccount({ accountAddress }) {
|
|
178
178
|
const client = this.getWaasWalletClient();
|
|
179
|
-
|
|
179
|
+
return accounts.toAccount({
|
|
180
180
|
address: accountAddress,
|
|
181
|
+
signAuthorization: (parameters) => _tslib.__awaiter(this, void 0, void 0, function* () { return this.signAuthorization(parameters); }),
|
|
181
182
|
signMessage: ({ message }) => client.signMessage({ accountAddress, message: message }),
|
|
182
183
|
signTransaction: (transaction) => client
|
|
183
184
|
.signTransaction({
|
|
@@ -190,7 +191,6 @@ class DynamicWaasEVMConnector extends ethereumCore.EthereumWalletConnector {
|
|
|
190
191
|
message: typedData,
|
|
191
192
|
}),
|
|
192
193
|
});
|
|
193
|
-
return customViemAccount;
|
|
194
194
|
}
|
|
195
195
|
getWalletClient(chainId) {
|
|
196
196
|
var _a;
|
|
@@ -347,12 +347,11 @@ class DynamicWaasEVMConnector extends ethereumCore.EthereumWalletConnector {
|
|
|
347
347
|
return activeAccount.address;
|
|
348
348
|
});
|
|
349
349
|
}
|
|
350
|
-
|
|
350
|
+
signAuthorization(parameters) {
|
|
351
351
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
352
|
-
const { contractAddress } = parameters;
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
throw new Error('Chain id not found');
|
|
352
|
+
const { address: contractAddress, nonce, chainId } = parameters;
|
|
353
|
+
if (!contractAddress) {
|
|
354
|
+
throw new Error('Contract address not found');
|
|
356
355
|
}
|
|
357
356
|
const [signer, publicClient] = yield Promise.all([
|
|
358
357
|
this.getSigner(),
|
|
@@ -362,17 +361,20 @@ class DynamicWaasEVMConnector extends ethereumCore.EthereumWalletConnector {
|
|
|
362
361
|
throw new Error('Required clients not found');
|
|
363
362
|
}
|
|
364
363
|
const { address } = signer.account;
|
|
365
|
-
const nonce = yield publicClient.getTransactionCount({ address });
|
|
366
364
|
const walletClient = this.getWaasWalletClient();
|
|
367
365
|
const signature = yield walletClient.sign({
|
|
368
366
|
accountAddress: address,
|
|
369
367
|
chainName: 'EVM',
|
|
370
368
|
isFormatted: true,
|
|
371
|
-
message: utils$1.hashAuthorization({
|
|
369
|
+
message: utils$1.hashAuthorization({
|
|
370
|
+
address: contractAddress,
|
|
371
|
+
chainId,
|
|
372
|
+
nonce,
|
|
373
|
+
}).slice(2),
|
|
372
374
|
});
|
|
373
375
|
return {
|
|
376
|
+
address: contractAddress,
|
|
374
377
|
chainId,
|
|
375
|
-
contractAddress,
|
|
376
378
|
nonce,
|
|
377
379
|
r: `0x${Buffer.from(signature.r).toString('hex')}`,
|
|
378
380
|
s: `0x${Buffer.from(signature.s).toString('hex')}`,
|
|
@@ -381,6 +383,22 @@ class DynamicWaasEVMConnector extends ethereumCore.EthereumWalletConnector {
|
|
|
381
383
|
};
|
|
382
384
|
});
|
|
383
385
|
}
|
|
386
|
+
isAtomicSupported(chainId) {
|
|
387
|
+
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
388
|
+
logger.debug('[DynamicWaasEVMConnector] isAtomicSupported - not supported', {
|
|
389
|
+
chainId,
|
|
390
|
+
});
|
|
391
|
+
return false;
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
isPaymasterServiceSupported(chainId) {
|
|
395
|
+
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
396
|
+
logger.debug('[DynamicWaasEVMConnector] isPaymasterServiceSupported - not supported', {
|
|
397
|
+
chainId,
|
|
398
|
+
});
|
|
399
|
+
return false;
|
|
400
|
+
});
|
|
401
|
+
}
|
|
384
402
|
}
|
|
385
403
|
DynamicWaasEVMConnector.lastUsedChainIdStorageKey = 'dynamic-waas-evm-last-used-chain-id';
|
|
386
404
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Account, Hex, Transport, WalletClient, Chain as ViemChain } from 'viem';
|
|
2
|
-
import { LocalAccount } from 'viem/accounts';
|
|
2
|
+
import { LocalAccount, SignAuthorizationParameters, SignAuthorizationReturnType } from 'viem/accounts';
|
|
3
3
|
import { DynamicEvmWalletClient } from '@dynamic-labs-wallet/evm';
|
|
4
|
-
import {
|
|
4
|
+
import { IDynamicWaasConnector } from '@dynamic-labs/wallet-connector-core';
|
|
5
5
|
import { EthereumWalletConnector, SwitchNetworkOps, EthereumWalletConnectorOpts } from '@dynamic-labs/ethereum-core';
|
|
6
6
|
import { IUITransaction } from '@dynamic-labs/types';
|
|
7
7
|
import { JwtVerifiedCredential } from '@dynamic-labs/sdk-api-core';
|
|
@@ -9,6 +9,7 @@ interface JwtVerifiedCredentialWithSmartWalletRef extends JwtVerifiedCredential
|
|
|
9
9
|
smartWalletRefId?: string;
|
|
10
10
|
smartWalletRefAddress?: string;
|
|
11
11
|
}
|
|
12
|
+
type SignAuthorizationParametersWithoutPrivateKey = Omit<SignAuthorizationParameters, 'privateKey'>;
|
|
12
13
|
export declare class DynamicWaasEVMConnector extends EthereumWalletConnector implements IDynamicWaasConnector {
|
|
13
14
|
name: string;
|
|
14
15
|
overrideKey: string;
|
|
@@ -81,6 +82,8 @@ export declare class DynamicWaasEVMConnector extends EthereumWalletConnector imp
|
|
|
81
82
|
createUiTransaction(from: string): Promise<IUITransaction>;
|
|
82
83
|
getConnectedAccounts(): Promise<string[]>;
|
|
83
84
|
getAddress(): Promise<string>;
|
|
84
|
-
|
|
85
|
+
signAuthorization(parameters: SignAuthorizationParametersWithoutPrivateKey): Promise<SignAuthorizationReturnType>;
|
|
86
|
+
isAtomicSupported(chainId?: number): Promise<boolean>;
|
|
87
|
+
isPaymasterServiceSupported(chainId?: number): Promise<boolean>;
|
|
85
88
|
}
|
|
86
89
|
export {};
|
|
@@ -172,8 +172,9 @@ class DynamicWaasEVMConnector extends EthereumWalletConnector {
|
|
|
172
172
|
}
|
|
173
173
|
getViemAccount({ accountAddress }) {
|
|
174
174
|
const client = this.getWaasWalletClient();
|
|
175
|
-
|
|
175
|
+
return toAccount({
|
|
176
176
|
address: accountAddress,
|
|
177
|
+
signAuthorization: (parameters) => __awaiter(this, void 0, void 0, function* () { return this.signAuthorization(parameters); }),
|
|
177
178
|
signMessage: ({ message }) => client.signMessage({ accountAddress, message: message }),
|
|
178
179
|
signTransaction: (transaction) => client
|
|
179
180
|
.signTransaction({
|
|
@@ -186,7 +187,6 @@ class DynamicWaasEVMConnector extends EthereumWalletConnector {
|
|
|
186
187
|
message: typedData,
|
|
187
188
|
}),
|
|
188
189
|
});
|
|
189
|
-
return customViemAccount;
|
|
190
190
|
}
|
|
191
191
|
getWalletClient(chainId) {
|
|
192
192
|
var _a;
|
|
@@ -343,12 +343,11 @@ class DynamicWaasEVMConnector extends EthereumWalletConnector {
|
|
|
343
343
|
return activeAccount.address;
|
|
344
344
|
});
|
|
345
345
|
}
|
|
346
|
-
|
|
346
|
+
signAuthorization(parameters) {
|
|
347
347
|
return __awaiter(this, void 0, void 0, function* () {
|
|
348
|
-
const { contractAddress } = parameters;
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
throw new Error('Chain id not found');
|
|
348
|
+
const { address: contractAddress, nonce, chainId } = parameters;
|
|
349
|
+
if (!contractAddress) {
|
|
350
|
+
throw new Error('Contract address not found');
|
|
352
351
|
}
|
|
353
352
|
const [signer, publicClient] = yield Promise.all([
|
|
354
353
|
this.getSigner(),
|
|
@@ -358,17 +357,20 @@ class DynamicWaasEVMConnector extends EthereumWalletConnector {
|
|
|
358
357
|
throw new Error('Required clients not found');
|
|
359
358
|
}
|
|
360
359
|
const { address } = signer.account;
|
|
361
|
-
const nonce = yield publicClient.getTransactionCount({ address });
|
|
362
360
|
const walletClient = this.getWaasWalletClient();
|
|
363
361
|
const signature = yield walletClient.sign({
|
|
364
362
|
accountAddress: address,
|
|
365
363
|
chainName: 'EVM',
|
|
366
364
|
isFormatted: true,
|
|
367
|
-
message: hashAuthorization({
|
|
365
|
+
message: hashAuthorization({
|
|
366
|
+
address: contractAddress,
|
|
367
|
+
chainId,
|
|
368
|
+
nonce,
|
|
369
|
+
}).slice(2),
|
|
368
370
|
});
|
|
369
371
|
return {
|
|
372
|
+
address: contractAddress,
|
|
370
373
|
chainId,
|
|
371
|
-
contractAddress,
|
|
372
374
|
nonce,
|
|
373
375
|
r: `0x${Buffer.from(signature.r).toString('hex')}`,
|
|
374
376
|
s: `0x${Buffer.from(signature.s).toString('hex')}`,
|
|
@@ -377,6 +379,22 @@ class DynamicWaasEVMConnector extends EthereumWalletConnector {
|
|
|
377
379
|
};
|
|
378
380
|
});
|
|
379
381
|
}
|
|
382
|
+
isAtomicSupported(chainId) {
|
|
383
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
384
|
+
logger.debug('[DynamicWaasEVMConnector] isAtomicSupported - not supported', {
|
|
385
|
+
chainId,
|
|
386
|
+
});
|
|
387
|
+
return false;
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
isPaymasterServiceSupported(chainId) {
|
|
391
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
392
|
+
logger.debug('[DynamicWaasEVMConnector] isPaymasterServiceSupported - not supported', {
|
|
393
|
+
chainId,
|
|
394
|
+
});
|
|
395
|
+
return false;
|
|
396
|
+
});
|
|
397
|
+
}
|
|
380
398
|
}
|
|
381
399
|
DynamicWaasEVMConnector.lastUsedChainIdStorageKey = 'dynamic-waas-evm-last-used-chain-id';
|
|
382
400
|
|