@dynamic-labs/waas-evm 4.14.0 → 4.16.0
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 +31 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +10 -10
- package/src/DynamicWaasEVMConnector.cjs +51 -0
- package/src/DynamicWaasEVMConnector.d.ts +3 -1
- package/src/DynamicWaasEVMConnector.js +51 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,35 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.16.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.15.0...v4.16.0) (2025-05-03)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* (GVTY-3020) add send balance to waas sui connector ([#8638](https://github.com/dynamic-labs/dynamic-auth/issues/8638)) ([97f0af0](https://github.com/dynamic-labs/dynamic-auth/commit/97f0af0504a0079ebf0958fde1f8edc34c035927))
|
|
8
|
+
* add isAtomicSupported and isPaymasterServiceSupported methods to EthereumWallet ([#8627](https://github.com/dynamic-labs/dynamic-auth/issues/8627)) ([df82b9e](https://github.com/dynamic-labs/dynamic-auth/commit/df82b9e86eafea9dd6c505227722450bc56d7c57))
|
|
9
|
+
* add solana mpc to global wallets ([#8605](https://github.com/dynamic-labs/dynamic-auth/issues/8605)) ([6261bf9](https://github.com/dynamic-labs/dynamic-auth/commit/6261bf9bec45b1d1afa13869cf5d10cda215783e))
|
|
10
|
+
|
|
11
|
+
## [4.15.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.14.0...v4.15.0) (2025-04-30)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* add end session override for waas sui connector ([#8602](https://github.com/dynamic-labs/dynamic-auth/issues/8602)) ([6c9e6fd](https://github.com/dynamic-labs/dynamic-auth/commit/6c9e6fda4581a4e3b9e1544f22d6e5f03723d928))
|
|
17
|
+
* add presets and demo fixes ([#8609](https://github.com/dynamic-labs/dynamic-auth/issues/8609)) ([2201914](https://github.com/dynamic-labs/dynamic-auth/commit/2201914d2029ff0b67dfc2c6e696f728f32f57b3))
|
|
18
|
+
* add ShareConfig component with modal and styling ([74aff97](https://github.com/dynamic-labs/dynamic-auth/commit/74aff97689c9e7c9abc892c1deac4d748b498909))
|
|
19
|
+
* add wallet actions section and update UI components ([#8598](https://github.com/dynamic-labs/dynamic-auth/issues/8598)) ([d6170b7](https://github.com/dynamic-labs/dynamic-auth/commit/d6170b7f6abd963e6a081541e2c674b7141f1c15))
|
|
20
|
+
* dynamic waas to sign 7702 authorization ([#8603](https://github.com/dynamic-labs/dynamic-auth/issues/8603)) ([74e1722](https://github.com/dynamic-labs/dynamic-auth/commit/74e1722f417aab621f4062093e109dc45cf542ea))
|
|
21
|
+
* add signMessage feature to global wallet client ([#8563](https://github.com/dynamic-labs/dynamic-auth/issues/8563)) ([c3f9734](https://github.com/dynamic-labs/dynamic-auth/commit/c3f9734c097f5c9b88c35e0f642632f261e40fe7))
|
|
22
|
+
* allow displaying custom links in the global wallet profile dropdown menu ([#8617](https://github.com/dynamic-labs/dynamic-auth/issues/8617)) ([5fb956c](https://github.com/dynamic-labs/dynamic-auth/commit/5fb956c0c2b681fece56104b330a0e90fc8fb936))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* add default base api url for dynamic waas config on connector initialization ([#8604](https://github.com/dynamic-labs/dynamic-auth/issues/8604)) ([6218a7e](https://github.com/dynamic-labs/dynamic-auth/commit/6218a7edda4feb9028be548acfe8eff64578f0a0))
|
|
28
|
+
* enables caching for sprite.svg ([#8610](https://github.com/dynamic-labs/dynamic-auth/issues/8610)) ([decdb69](https://github.com/dynamic-labs/dynamic-auth/commit/decdb69b4df8bc2d97ee579fa423e9682ab1720b))
|
|
29
|
+
* change mobile experience to redirect ([#8003](https://github.com/dynamic-labs/dynamic-auth/issues/8003)) ([2e8a1d8](https://github.com/dynamic-labs/dynamic-auth/commit/2e8a1d8b54f54386e1abc9f4e6e5e9acf859e5fa))
|
|
30
|
+
* optimize wallet finder when performing eth and sol operations in global wallet popup ([#8564](https://github.com/dynamic-labs/dynamic-auth/issues/8564)) ([2eaf424](https://github.com/dynamic-labs/dynamic-auth/commit/2eaf4244d4aa1b1cc5c6e32574db10ab34f8ed80))
|
|
31
|
+
* loading state for v3 connect-only embedded wallet generation ([#8600](https://github.com/dynamic-labs/dynamic-auth/issues/8600)) ([af34d16](https://github.com/dynamic-labs/dynamic-auth/commit/af34d168a765aa82867116541e73c59672ab2341))
|
|
32
|
+
|
|
2
33
|
## [4.14.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.13.0...v4.14.0) (2025-04-25)
|
|
3
34
|
|
|
4
35
|
|
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.16.0",
|
|
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",
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
},
|
|
19
19
|
"homepage": "https://www.dynamic.xyz/",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@dynamic-labs-wallet/evm": "0.0.
|
|
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.
|
|
21
|
+
"@dynamic-labs-wallet/evm": "0.0.65",
|
|
22
|
+
"@dynamic-labs/sdk-api-core": "0.0.660",
|
|
23
|
+
"viem": "^2.24.2",
|
|
24
|
+
"@dynamic-labs/assert-package-version": "4.16.0",
|
|
25
|
+
"@dynamic-labs/ethereum-core": "4.16.0",
|
|
26
|
+
"@dynamic-labs/logger": "4.16.0",
|
|
27
|
+
"@dynamic-labs/types": "4.16.0",
|
|
28
|
+
"@dynamic-labs/utils": "4.16.0",
|
|
29
|
+
"@dynamic-labs/wallet-connector-core": "4.16.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {}
|
|
32
32
|
}
|
|
@@ -7,6 +7,7 @@ var _tslib = require('../_virtual/_tslib.cjs');
|
|
|
7
7
|
var viem = require('viem');
|
|
8
8
|
var accounts = require('viem/accounts');
|
|
9
9
|
var evm = require('@dynamic-labs-wallet/evm');
|
|
10
|
+
var utils$1 = require('viem/utils');
|
|
10
11
|
var logger$1 = require('@dynamic-labs/logger');
|
|
11
12
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
12
13
|
var ethereumCore = require('@dynamic-labs/ethereum-core');
|
|
@@ -330,6 +331,56 @@ class DynamicWaasEVMConnector extends ethereumCore.EthereumWalletConnector {
|
|
|
330
331
|
return addresses;
|
|
331
332
|
});
|
|
332
333
|
}
|
|
334
|
+
getAddress() {
|
|
335
|
+
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
336
|
+
var _a;
|
|
337
|
+
const activeAccount = this.getActiveAccount();
|
|
338
|
+
if (!activeAccount || !activeAccount.address) {
|
|
339
|
+
// If no active account, try to get one from verified credentials
|
|
340
|
+
if ((_a = this.verifiedCredential) === null || _a === void 0 ? void 0 : _a.address) {
|
|
341
|
+
const { address } = this.verifiedCredential;
|
|
342
|
+
this.setActiveAccount(address);
|
|
343
|
+
return address;
|
|
344
|
+
}
|
|
345
|
+
throw new utils.DynamicError('No active wallet address found');
|
|
346
|
+
}
|
|
347
|
+
return activeAccount.address;
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
experimental_signAuthorization(parameters) {
|
|
351
|
+
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
352
|
+
const { contractAddress } = parameters;
|
|
353
|
+
const chainId = this.currentChainId();
|
|
354
|
+
if (!chainId || typeof chainId !== 'number') {
|
|
355
|
+
throw new Error('Chain id not found');
|
|
356
|
+
}
|
|
357
|
+
const [signer, publicClient] = yield Promise.all([
|
|
358
|
+
this.getSigner(),
|
|
359
|
+
this.getPublicClient(),
|
|
360
|
+
]);
|
|
361
|
+
if (!signer || !publicClient) {
|
|
362
|
+
throw new Error('Required clients not found');
|
|
363
|
+
}
|
|
364
|
+
const { address } = signer.account;
|
|
365
|
+
const nonce = yield publicClient.getTransactionCount({ address });
|
|
366
|
+
const walletClient = this.getWaasWalletClient();
|
|
367
|
+
const signature = yield walletClient.sign({
|
|
368
|
+
accountAddress: address,
|
|
369
|
+
chainName: 'EVM',
|
|
370
|
+
isFormatted: true,
|
|
371
|
+
message: utils$1.hashAuthorization({ chainId, contractAddress, nonce }).slice(2),
|
|
372
|
+
});
|
|
373
|
+
return {
|
|
374
|
+
chainId,
|
|
375
|
+
contractAddress,
|
|
376
|
+
nonce,
|
|
377
|
+
r: `0x${Buffer.from(signature.r).toString('hex')}`,
|
|
378
|
+
s: `0x${Buffer.from(signature.s).toString('hex')}`,
|
|
379
|
+
v: BigInt(signature.v),
|
|
380
|
+
yParity: (Number(signature.v) - 27) & 1,
|
|
381
|
+
};
|
|
382
|
+
});
|
|
383
|
+
}
|
|
333
384
|
}
|
|
334
385
|
DynamicWaasEVMConnector.lastUsedChainIdStorageKey = 'dynamic-waas-evm-last-used-chain-id';
|
|
335
386
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Account, Hex, Transport, WalletClient, Chain as ViemChain } from 'viem';
|
|
2
2
|
import { LocalAccount } from 'viem/accounts';
|
|
3
3
|
import { DynamicEvmWalletClient } from '@dynamic-labs-wallet/evm';
|
|
4
|
-
import { IDynamicWaasConnector } from '@dynamic-labs/wallet-connector-core';
|
|
4
|
+
import { EVMAuthorizationParameters, EVMAuthorizationResult, 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';
|
|
@@ -80,5 +80,7 @@ export declare class DynamicWaasEVMConnector extends EthereumWalletConnector imp
|
|
|
80
80
|
}): Promise<void>;
|
|
81
81
|
createUiTransaction(from: string): Promise<IUITransaction>;
|
|
82
82
|
getConnectedAccounts(): Promise<string[]>;
|
|
83
|
+
getAddress(): Promise<string>;
|
|
84
|
+
experimental_signAuthorization(parameters: EVMAuthorizationParameters): Promise<EVMAuthorizationResult>;
|
|
83
85
|
}
|
|
84
86
|
export {};
|
|
@@ -3,6 +3,7 @@ import { __awaiter } from '../_virtual/_tslib.js';
|
|
|
3
3
|
import { http, erc20Abi } from 'viem';
|
|
4
4
|
import { toAccount } from 'viem/accounts';
|
|
5
5
|
import { DynamicEvmWalletClient } from '@dynamic-labs-wallet/evm';
|
|
6
|
+
import { hashAuthorization } from 'viem/utils';
|
|
6
7
|
import { Logger } from '@dynamic-labs/logger';
|
|
7
8
|
import { isSameAddress } from '@dynamic-labs/wallet-connector-core';
|
|
8
9
|
import { EthereumWalletConnector, createWalletClientWithUiConfirmation, getOrMapViemChain, ViemUiTransaction } from '@dynamic-labs/ethereum-core';
|
|
@@ -326,6 +327,56 @@ class DynamicWaasEVMConnector extends EthereumWalletConnector {
|
|
|
326
327
|
return addresses;
|
|
327
328
|
});
|
|
328
329
|
}
|
|
330
|
+
getAddress() {
|
|
331
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
332
|
+
var _a;
|
|
333
|
+
const activeAccount = this.getActiveAccount();
|
|
334
|
+
if (!activeAccount || !activeAccount.address) {
|
|
335
|
+
// If no active account, try to get one from verified credentials
|
|
336
|
+
if ((_a = this.verifiedCredential) === null || _a === void 0 ? void 0 : _a.address) {
|
|
337
|
+
const { address } = this.verifiedCredential;
|
|
338
|
+
this.setActiveAccount(address);
|
|
339
|
+
return address;
|
|
340
|
+
}
|
|
341
|
+
throw new DynamicError('No active wallet address found');
|
|
342
|
+
}
|
|
343
|
+
return activeAccount.address;
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
experimental_signAuthorization(parameters) {
|
|
347
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
348
|
+
const { contractAddress } = parameters;
|
|
349
|
+
const chainId = this.currentChainId();
|
|
350
|
+
if (!chainId || typeof chainId !== 'number') {
|
|
351
|
+
throw new Error('Chain id not found');
|
|
352
|
+
}
|
|
353
|
+
const [signer, publicClient] = yield Promise.all([
|
|
354
|
+
this.getSigner(),
|
|
355
|
+
this.getPublicClient(),
|
|
356
|
+
]);
|
|
357
|
+
if (!signer || !publicClient) {
|
|
358
|
+
throw new Error('Required clients not found');
|
|
359
|
+
}
|
|
360
|
+
const { address } = signer.account;
|
|
361
|
+
const nonce = yield publicClient.getTransactionCount({ address });
|
|
362
|
+
const walletClient = this.getWaasWalletClient();
|
|
363
|
+
const signature = yield walletClient.sign({
|
|
364
|
+
accountAddress: address,
|
|
365
|
+
chainName: 'EVM',
|
|
366
|
+
isFormatted: true,
|
|
367
|
+
message: hashAuthorization({ chainId, contractAddress, nonce }).slice(2),
|
|
368
|
+
});
|
|
369
|
+
return {
|
|
370
|
+
chainId,
|
|
371
|
+
contractAddress,
|
|
372
|
+
nonce,
|
|
373
|
+
r: `0x${Buffer.from(signature.r).toString('hex')}`,
|
|
374
|
+
s: `0x${Buffer.from(signature.s).toString('hex')}`,
|
|
375
|
+
v: BigInt(signature.v),
|
|
376
|
+
yParity: (Number(signature.v) - 27) & 1,
|
|
377
|
+
};
|
|
378
|
+
});
|
|
379
|
+
}
|
|
329
380
|
}
|
|
330
381
|
DynamicWaasEVMConnector.lastUsedChainIdStorageKey = 'dynamic-waas-evm-last-used-chain-id';
|
|
331
382
|
|