@dynamic-labs/waas-evm 4.18.8 → 4.19.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 CHANGED
@@ -1,4 +1,27 @@
1
1
 
2
+ ### [4.19.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.19.0...v4.19.1) (2025-05-26)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * **react-native:** reload webview when disconnected ([#8765](https://github.com/dynamic-labs/dynamic-auth/issues/8765)) ([addf90b](https://github.com/dynamic-labs/dynamic-auth/commit/addf90b6fccbe4b883e9778cf7a07e0471f85318))
8
+
9
+ ## [4.19.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.18.8...v4.19.0) (2025-05-23)
10
+
11
+
12
+ ### Features
13
+
14
+ * expose 7702 kernel and add viem controller ([#8786](https://github.com/dynamic-labs/dynamic-auth/issues/8786)) ([eea710e](https://github.com/dynamic-labs/dynamic-auth/commit/eea710e238ccbc36e6be37d8f7493954b99858ef))
15
+ * use browser wallet client & iframe for waas operations ([#8697](https://github.com/dynamic-labs/dynamic-auth/issues/8697)) ([13a47b1](https://github.com/dynamic-labs/dynamic-auth/commit/13a47b1c9a2984f08682e833ca8c87605a3a872f))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **global-wallet:** close popup when page unloads to prevent orphaned popup windows ([#8787](https://github.com/dynamic-labs/dynamic-auth/issues/8787)) ([441b04c](https://github.com/dynamic-labs/dynamic-auth/commit/441b04ca04a02feb37473e43bca0e66c5d772ce2))
21
+ * override network when requesting BTC networks in useTokenBalances ([#8773](https://github.com/dynamic-labs/dynamic-auth/issues/8773)) ([fd07d09](https://github.com/dynamic-labs/dynamic-auth/commit/fd07d09de970c7e6f85b251a88854e8eca57e249))
22
+ * remove libmpc executor dependency global wallet ([#8792](https://github.com/dynamic-labs/dynamic-auth/issues/8792)) ([7502585](https://github.com/dynamic-labs/dynamic-auth/commit/75025859d2f952915322cf65504117ec2506152b))
23
+ * standardize font on headers ([#8734](https://github.com/dynamic-labs/dynamic-auth/issues/8734)) ([9f0900c](https://github.com/dynamic-labs/dynamic-auth/commit/9f0900cb7c4294201cc952ae7538648bdea83ff5))
24
+
2
25
  ### [4.18.8](https://github.com/dynamic-labs/dynamic-auth/compare/v4.18.7...v4.18.8) (2025-05-22)
3
26
 
4
27
  ### Bug Fixes
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.18.8";
6
+ var version = "4.19.1";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.18.8";
2
+ var version = "4.19.1";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/waas-evm",
3
- "version": "4.18.8",
3
+ "version": "4.19.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",
@@ -18,15 +18,15 @@
18
18
  },
19
19
  "homepage": "https://www.dynamic.xyz/",
20
20
  "dependencies": {
21
- "@dynamic-labs-wallet/evm": "0.0.74",
21
+ "@dynamic-labs-wallet/browser-wallet-client": "0.0.76",
22
22
  "@dynamic-labs/sdk-api-core": "0.0.672",
23
23
  "viem": "^2.28.4",
24
- "@dynamic-labs/assert-package-version": "4.18.8",
25
- "@dynamic-labs/ethereum-core": "4.18.8",
26
- "@dynamic-labs/logger": "4.18.8",
27
- "@dynamic-labs/types": "4.18.8",
28
- "@dynamic-labs/utils": "4.18.8",
29
- "@dynamic-labs/wallet-connector-core": "4.18.8"
24
+ "@dynamic-labs/assert-package-version": "4.19.1",
25
+ "@dynamic-labs/ethereum-core": "4.19.1",
26
+ "@dynamic-labs/logger": "4.19.1",
27
+ "@dynamic-labs/types": "4.19.1",
28
+ "@dynamic-labs/utils": "4.19.1",
29
+ "@dynamic-labs/wallet-connector-core": "4.19.1"
30
30
  },
31
31
  "peerDependencies": {}
32
32
  }
@@ -6,7 +6,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
6
6
  var _tslib = require('../_virtual/_tslib.cjs');
7
7
  var viem = require('viem');
8
8
  var accounts = require('viem/accounts');
9
- var evm = require('@dynamic-labs-wallet/evm');
9
+ var browserWalletClient = require('@dynamic-labs-wallet/browser-wallet-client');
10
10
  var utils$1 = require('viem/utils');
11
11
  var logger$1 = require('@dynamic-labs/logger');
12
12
  var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
@@ -161,10 +161,11 @@ class DynamicWaasEVMConnector extends ethereumCore.EthereumWalletConnector {
161
161
  if (!this.environmentId) {
162
162
  throw new Error('Environment ID is required');
163
163
  }
164
- return new evm.DynamicEvmWalletClient({
164
+ return new browserWalletClient.DynamicWalletClient({
165
165
  authToken,
166
- baseApiUrl: this.baseApiUrl,
166
+ baseApiUrl: this.baseApiUrl || 'https://app.dynamicauth.com',
167
167
  baseMPCRelayApiUrl: this.relayUrl || 'relay.dynamic-preprod.xyz',
168
+ chainName: 'EVM',
168
169
  environmentId: this.environmentId,
169
170
  });
170
171
  }
@@ -195,11 +196,14 @@ class DynamicWaasEVMConnector extends ethereumCore.EthereumWalletConnector {
195
196
  return accounts.toAccount({
196
197
  address: accountAddress,
197
198
  signAuthorization: (parameters) => _tslib.__awaiter(this, void 0, void 0, function* () { return this.signAuthorization(parameters); }),
198
- signMessage: ({ message }) => client.signMessage({ accountAddress, message: message }),
199
+ signMessage: ({ message }) => client.signMessage({
200
+ accountAddress,
201
+ message: message,
202
+ }),
199
203
  signTransaction: (transaction) => client
200
204
  .signTransaction({
201
205
  senderAddress: accountAddress,
202
- transaction,
206
+ transaction: viem.serializeTransaction(transaction),
203
207
  })
204
208
  .then((tx) => tx),
205
209
  signTypedData: (typedData) => client.signMessage({
@@ -279,10 +283,9 @@ class DynamicWaasEVMConnector extends ethereumCore.EthereumWalletConnector {
279
283
  return this.__exportHandler;
280
284
  }
281
285
  importPrivateKey(_a) {
282
- return _tslib.__awaiter(this, arguments, void 0, function* ({ privateKey, chainName, thresholdSignatureScheme = 'TWO_OF_TWO', }) {
286
+ return _tslib.__awaiter(this, arguments, void 0, function* ({ privateKey, thresholdSignatureScheme = 'TWO_OF_TWO', }) {
283
287
  const walletClient = this.getWaasWalletClient();
284
288
  yield walletClient.importPrivateKey({
285
- chainName,
286
289
  privateKey,
287
290
  thresholdSignatureScheme: thresholdSignatureScheme,
288
291
  });
@@ -382,24 +385,23 @@ class DynamicWaasEVMConnector extends ethereumCore.EthereumWalletConnector {
382
385
  }
383
386
  const { address } = signer.account;
384
387
  const walletClient = this.getWaasWalletClient();
385
- const signature = yield walletClient.sign({
388
+ const signature = yield walletClient.signRawMessage({
386
389
  accountAddress: address,
387
- chainName: 'EVM',
388
- isFormatted: true,
389
390
  message: utils$1.hashAuthorization({
390
391
  address: contractAddress,
391
392
  chainId,
392
393
  nonce,
393
394
  }).slice(2),
394
395
  });
396
+ const parsedSignature = viem.parseSignature(signature);
395
397
  return {
396
398
  address: contractAddress,
397
399
  chainId,
398
400
  nonce,
399
- r: `0x${Buffer.from(signature.r).toString('hex')}`,
400
- s: `0x${Buffer.from(signature.s).toString('hex')}`,
401
- v: BigInt(signature.v),
402
- yParity: (Number(signature.v) - 27) & 1,
401
+ r: parsedSignature.r,
402
+ s: parsedSignature.s,
403
+ v: parsedSignature.v,
404
+ yParity: parsedSignature.yParity,
403
405
  };
404
406
  });
405
407
  }
@@ -1,6 +1,6 @@
1
1
  import { Account, Hex, Transport, WalletClient, Chain as ViemChain } from 'viem';
2
2
  import { LocalAccount, SignAuthorizationParameters, SignAuthorizationReturnType } from 'viem/accounts';
3
- import { DynamicEvmWalletClient } from '@dynamic-labs-wallet/evm';
3
+ import { DynamicWalletClient } from '@dynamic-labs-wallet/browser-wallet-client';
4
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';
@@ -48,8 +48,8 @@ export declare class DynamicWaasEVMConnector extends EthereumWalletConnector imp
48
48
  private currentEvmNetwork;
49
49
  switchNetwork({ networkChainId, }: SwitchNetworkOps): Promise<void>;
50
50
  private getRpcUrl;
51
- createDynamicWaasClient(): DynamicEvmWalletClient;
52
- getWaasWalletClient(): DynamicEvmWalletClient;
51
+ createDynamicWaasClient(): DynamicWalletClient;
52
+ getWaasWalletClient(): DynamicWalletClient;
53
53
  validateActiveWallet(expectedAddress: string): Promise<void>;
54
54
  getViemAccount({ accountAddress }: {
55
55
  accountAddress: string;
@@ -58,10 +58,10 @@ export declare class DynamicWaasEVMConnector extends EthereumWalletConnector imp
58
58
  createWalletAccount({ thresholdSignatureScheme, }?: {
59
59
  thresholdSignatureScheme?: string;
60
60
  }): Promise<{
61
+ chainName: string;
61
62
  accountAddress: string;
62
63
  publicKeyHex: string;
63
- rawPublicKey: any;
64
- clientKeyShares: any[];
64
+ rawPublicKey: string | Uint8Array | undefined;
65
65
  }>;
66
66
  signMessage(message: string): Promise<Hex>;
67
67
  getSigner(): Promise<any>;
@@ -75,9 +75,8 @@ export declare class DynamicWaasEVMConnector extends EthereumWalletConnector imp
75
75
  getExportHandler(): {
76
76
  clear: () => void;
77
77
  };
78
- importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, }: {
78
+ importPrivateKey({ privateKey, thresholdSignatureScheme, }: {
79
79
  privateKey: string;
80
- chainName: string;
81
80
  thresholdSignatureScheme?: string;
82
81
  }): Promise<void>;
83
82
  exportClientKeyshares({ accountAddress, }: {
@@ -1,8 +1,8 @@
1
1
  'use client'
2
2
  import { __awaiter } from '../_virtual/_tslib.js';
3
- import { http, erc20Abi } from 'viem';
3
+ import { serializeTransaction, http, erc20Abi, parseSignature } from 'viem';
4
4
  import { toAccount } from 'viem/accounts';
5
- import { DynamicEvmWalletClient } from '@dynamic-labs-wallet/evm';
5
+ import { DynamicWalletClient } from '@dynamic-labs-wallet/browser-wallet-client';
6
6
  import { hashAuthorization } from 'viem/utils';
7
7
  import { Logger } from '@dynamic-labs/logger';
8
8
  import { isSameAddress } from '@dynamic-labs/wallet-connector-core';
@@ -157,10 +157,11 @@ class DynamicWaasEVMConnector extends EthereumWalletConnector {
157
157
  if (!this.environmentId) {
158
158
  throw new Error('Environment ID is required');
159
159
  }
160
- return new DynamicEvmWalletClient({
160
+ return new DynamicWalletClient({
161
161
  authToken,
162
- baseApiUrl: this.baseApiUrl,
162
+ baseApiUrl: this.baseApiUrl || 'https://app.dynamicauth.com',
163
163
  baseMPCRelayApiUrl: this.relayUrl || 'relay.dynamic-preprod.xyz',
164
+ chainName: 'EVM',
164
165
  environmentId: this.environmentId,
165
166
  });
166
167
  }
@@ -191,11 +192,14 @@ class DynamicWaasEVMConnector extends EthereumWalletConnector {
191
192
  return toAccount({
192
193
  address: accountAddress,
193
194
  signAuthorization: (parameters) => __awaiter(this, void 0, void 0, function* () { return this.signAuthorization(parameters); }),
194
- signMessage: ({ message }) => client.signMessage({ accountAddress, message: message }),
195
+ signMessage: ({ message }) => client.signMessage({
196
+ accountAddress,
197
+ message: message,
198
+ }),
195
199
  signTransaction: (transaction) => client
196
200
  .signTransaction({
197
201
  senderAddress: accountAddress,
198
- transaction,
202
+ transaction: serializeTransaction(transaction),
199
203
  })
200
204
  .then((tx) => tx),
201
205
  signTypedData: (typedData) => client.signMessage({
@@ -275,10 +279,9 @@ class DynamicWaasEVMConnector extends EthereumWalletConnector {
275
279
  return this.__exportHandler;
276
280
  }
277
281
  importPrivateKey(_a) {
278
- return __awaiter(this, arguments, void 0, function* ({ privateKey, chainName, thresholdSignatureScheme = 'TWO_OF_TWO', }) {
282
+ return __awaiter(this, arguments, void 0, function* ({ privateKey, thresholdSignatureScheme = 'TWO_OF_TWO', }) {
279
283
  const walletClient = this.getWaasWalletClient();
280
284
  yield walletClient.importPrivateKey({
281
- chainName,
282
285
  privateKey,
283
286
  thresholdSignatureScheme: thresholdSignatureScheme,
284
287
  });
@@ -378,24 +381,23 @@ class DynamicWaasEVMConnector extends EthereumWalletConnector {
378
381
  }
379
382
  const { address } = signer.account;
380
383
  const walletClient = this.getWaasWalletClient();
381
- const signature = yield walletClient.sign({
384
+ const signature = yield walletClient.signRawMessage({
382
385
  accountAddress: address,
383
- chainName: 'EVM',
384
- isFormatted: true,
385
386
  message: hashAuthorization({
386
387
  address: contractAddress,
387
388
  chainId,
388
389
  nonce,
389
390
  }).slice(2),
390
391
  });
392
+ const parsedSignature = parseSignature(signature);
391
393
  return {
392
394
  address: contractAddress,
393
395
  chainId,
394
396
  nonce,
395
- r: `0x${Buffer.from(signature.r).toString('hex')}`,
396
- s: `0x${Buffer.from(signature.s).toString('hex')}`,
397
- v: BigInt(signature.v),
398
- yParity: (Number(signature.v) - 27) & 1,
397
+ r: parsedSignature.r,
398
+ s: parsedSignature.s,
399
+ v: parsedSignature.v,
400
+ yParity: parsedSignature.yParity,
399
401
  };
400
402
  });
401
403
  }