@dynamic-labs/ethereum-core 4.50.4 → 4.51.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 CHANGED
@@ -1,4 +1,29 @@
1
1
 
2
+ ## [4.51.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.50.5...v4.51.0) (2025-12-18)
3
+
4
+
5
+ ### Features
6
+
7
+ * **react-native:** add connectOnly option as a client prop ([#10112](https://github.com/dynamic-labs/dynamic-auth/issues/10112)) ([8cdee00](https://github.com/dynamic-labs/dynamic-auth/commit/8cdee00b249252aee74723f66b8875d6e3d70410))
8
+ * **react-native:** add support for metamask ([#10004](https://github.com/dynamic-labs/dynamic-auth/issues/10004)) ([dcdb52c](https://github.com/dynamic-labs/dynamic-auth/commit/dcdb52c4fd70f1b691c2235be3464e3c25f1ea8b))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * add useExchangeAccounts export ([#10101](https://github.com/dynamic-labs/dynamic-auth/issues/10101)) ([d9051fa](https://github.com/dynamic-labs/dynamic-auth/commit/d9051fa2769f37989e7a38c5035d6a39a6fc38fd))
14
+ * ensure the flutter SDK will not get wallet version field with V3 ([#10115](https://github.com/dynamic-labs/dynamic-auth/issues/10115)) ([f3b80cc](https://github.com/dynamic-labs/dynamic-auth/commit/f3b80ccf070cc1f615c43e60c0681fe28c92e96e))
15
+ * **react-native:** show captcha screen when enabled during signature prompt ([#10113](https://github.com/dynamic-labs/dynamic-auth/issues/10113)) ([12edd1c](https://github.com/dynamic-labs/dynamic-auth/commit/12edd1ca9c7abe3f249930f27a2e3043a7cd3723))
16
+ * solana swap issue with outdated jup api ([#10119](https://github.com/dynamic-labs/dynamic-auth/issues/10119)) ([172a074](https://github.com/dynamic-labs/dynamic-auth/commit/172a074b607c8e25c3d4141e0caedff943aeec15))
17
+
18
+ ### [4.50.5](https://github.com/dynamic-labs/dynamic-auth/compare/v4.50.4...v4.50.5) (2025-12-16)
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * ensure connectWithSocial promise fails on error ([#10105](https://github.com/dynamic-labs/dynamic-auth/issues/10105)) ([2ff57b3](https://github.com/dynamic-labs/dynamic-auth/commit/2ff57b3d6a68c2bb9ae0ce2a41b117598193f0ac))
24
+ * **react-native:** move peer dependencies to regular deps for auto install on yarn ([#10104](https://github.com/dynamic-labs/dynamic-auth/issues/10104)) ([ad2b621](https://github.com/dynamic-labs/dynamic-auth/commit/ad2b6212bb162eb3c0a430bf79d857285440261e))
25
+ * sign raw transaction with zerodev connector ([#10110](https://github.com/dynamic-labs/dynamic-auth/issues/10110)) ([f5f8f88](https://github.com/dynamic-labs/dynamic-auth/commit/f5f8f882136551c382bc5812c0c9499938466866))
26
+
2
27
  ### [4.50.4](https://github.com/dynamic-labs/dynamic-auth/compare/v4.50.3...v4.50.4) (2025-12-15)
3
28
 
4
29
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.50.4";
6
+ var version = "4.51.0";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.50.4";
2
+ var version = "4.51.0";
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.50.4",
3
+ "version": "4.51.0",
4
4
  "description": "Core package for utilities and types for viem",
5
5
  "author": "Dynamic Labs, Inc.",
6
6
  "license": "MIT",
@@ -19,13 +19,13 @@
19
19
  "homepage": "https://www.dynamic.xyz/",
20
20
  "dependencies": {
21
21
  "@dynamic-labs/sdk-api-core": "0.0.831",
22
- "@dynamic-labs/assert-package-version": "4.50.4",
23
- "@dynamic-labs/logger": "4.50.4",
24
- "@dynamic-labs/rpc-providers": "4.50.4",
25
- "@dynamic-labs/types": "4.50.4",
26
- "@dynamic-labs/utils": "4.50.4",
27
- "@dynamic-labs/wallet-book": "4.50.4",
28
- "@dynamic-labs/wallet-connector-core": "4.50.4"
22
+ "@dynamic-labs/assert-package-version": "4.51.0",
23
+ "@dynamic-labs/logger": "4.51.0",
24
+ "@dynamic-labs/rpc-providers": "4.51.0",
25
+ "@dynamic-labs/types": "4.51.0",
26
+ "@dynamic-labs/utils": "4.51.0",
27
+ "@dynamic-labs/wallet-book": "4.51.0",
28
+ "@dynamic-labs/wallet-connector-core": "4.51.0"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "viem": "^2.28.4"
@@ -7,7 +7,7 @@ var viem = require('viem');
7
7
  var interceptTransport = require('../interceptTransport/interceptTransport.cjs');
8
8
  var ViemRpcUiTransaction = require('../ViemRpcUiTransaction/ViemRpcUiTransaction.cjs');
9
9
 
10
- const confirmationTransport = ({ transport, walletUiUtils, getAccounts, onPersonalSign, onSendTransaction, onSignTypedData, walletConnector, provider, }) => interceptTransport.interceptTransport({
10
+ const confirmationTransport = ({ transport, walletUiUtils, getAccounts, onPersonalSign, onSendTransaction, onSignTransaction, onSignTypedData, walletConnector, provider, }) => interceptTransport.interceptTransport({
11
11
  getAccounts,
12
12
  onPersonalSign: onPersonalSign
13
13
  ? (args) => walletUiUtils.signMessage({
@@ -26,6 +26,13 @@ const confirmationTransport = ({ transport, walletUiUtils, getAccounts, onPerson
26
26
  return walletUiUtils.sendTransaction(walletConnector, uiTransaction);
27
27
  }
28
28
  : undefined,
29
+ onSignTransaction: onSignTransaction
30
+ ? (args) => walletUiUtils.signMessage({
31
+ handler: () => onSignTransaction(args),
32
+ message: 'Sign Transaction',
33
+ walletConnector,
34
+ })
35
+ : undefined,
29
36
  onSignTypedData: onSignTypedData
30
37
  ? (args) => walletUiUtils.signMessage({
31
38
  handler: () => onSignTypedData(args),
@@ -7,5 +7,5 @@ type ConfirmationTransportProps = {
7
7
  walletConnector: InternalWalletConnector;
8
8
  walletUiUtils: WalletUiUtils<InternalWalletConnector>;
9
9
  } & InterceptTransportProps;
10
- export declare const confirmationTransport: ({ transport, walletUiUtils, getAccounts, onPersonalSign, onSendTransaction, onSignTypedData, walletConnector, provider, }: ConfirmationTransportProps) => import("viem").CustomTransport;
10
+ export declare const confirmationTransport: ({ transport, walletUiUtils, getAccounts, onPersonalSign, onSendTransaction, onSignTransaction, onSignTypedData, walletConnector, provider, }: ConfirmationTransportProps) => import("viem").CustomTransport;
11
11
  export {};
@@ -3,7 +3,7 @@ import { fromHex } from 'viem';
3
3
  import { interceptTransport } from '../interceptTransport/interceptTransport.js';
4
4
  import { ViemRpcUiTransaction } from '../ViemRpcUiTransaction/ViemRpcUiTransaction.js';
5
5
 
6
- const confirmationTransport = ({ transport, walletUiUtils, getAccounts, onPersonalSign, onSendTransaction, onSignTypedData, walletConnector, provider, }) => interceptTransport({
6
+ const confirmationTransport = ({ transport, walletUiUtils, getAccounts, onPersonalSign, onSendTransaction, onSignTransaction, onSignTypedData, walletConnector, provider, }) => interceptTransport({
7
7
  getAccounts,
8
8
  onPersonalSign: onPersonalSign
9
9
  ? (args) => walletUiUtils.signMessage({
@@ -22,6 +22,13 @@ const confirmationTransport = ({ transport, walletUiUtils, getAccounts, onPerson
22
22
  return walletUiUtils.sendTransaction(walletConnector, uiTransaction);
23
23
  }
24
24
  : undefined,
25
+ onSignTransaction: onSignTransaction
26
+ ? (args) => walletUiUtils.signMessage({
27
+ handler: () => onSignTransaction(args),
28
+ message: 'Sign Transaction',
29
+ walletConnector,
30
+ })
31
+ : undefined,
25
32
  onSignTypedData: onSignTypedData
26
33
  ? (args) => walletUiUtils.signMessage({
27
34
  handler: () => onSignTypedData(args),
@@ -8,7 +8,7 @@ var viem = require('viem');
8
8
  var utils = require('@dynamic-labs/utils');
9
9
  var isTransactionExecutionError = require('../isTransactionExecutionError/isTransactionExecutionError.cjs');
10
10
 
11
- const interceptTransport = ({ getAccounts, onPersonalSign, onSendTransaction, onSignTypedData, onGetCapabilities, onSendCalls, transport, }) => (props) => {
11
+ const interceptTransport = ({ getAccounts, onPersonalSign, onSendTransaction, onSignTransaction, onSignTypedData, onGetCapabilities, onSendCalls, transport, }) => (props) => {
12
12
  const provider = transport(props);
13
13
  return viem.custom({
14
14
  request: (args) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
@@ -42,6 +42,15 @@ const interceptTransport = ({ getAccounts, onPersonalSign, onSendTransaction, on
42
42
  throw error;
43
43
  });
44
44
  }
45
+ if (onSignTransaction && method === 'eth_signTransaction') {
46
+ const [transaction] = params;
47
+ return onSignTransaction({ args, provider, transaction }).catch((error) => {
48
+ if (error instanceof utils.UserRejectedRequestError) {
49
+ throw new viem.UserRejectedRequestError(error);
50
+ }
51
+ throw error;
52
+ });
53
+ }
45
54
  if (onSignTypedData && method === 'eth_signTypedData_v4') {
46
55
  const [, message] = (_a = params) !== null && _a !== void 0 ? _a : [];
47
56
  return onSignTypedData({ args, message, provider }).catch((error) => {
@@ -1,4 +1,4 @@
1
- import { Address, CustomTransport, Hex, RpcTransactionRequest, Transport, GetCapabilitiesReturnType, SendCallsParameters, SendCallsReturnType } from 'viem';
1
+ import { Address, CustomTransport, GetCapabilitiesReturnType, Hex, RpcTransactionRequest, SendCallsParameters, SendCallsReturnType, Transport } from 'viem';
2
2
  type Provider = Pick<ReturnType<CustomTransport>, 'request'>;
3
3
  export type InterceptTransportProps = {
4
4
  transport: Transport;
@@ -15,6 +15,11 @@ export type InterceptTransportProps = {
15
15
  args: Args;
16
16
  provider: Provider;
17
17
  }) => Promise<Hex>;
18
+ onSignTransaction?: (props: {
19
+ transaction: RpcTransactionRequest;
20
+ args: Args;
21
+ provider: Provider;
22
+ }) => Promise<Hex>;
18
23
  onSignTypedData?: (props: {
19
24
  message: string;
20
25
  args: Args;
@@ -32,5 +37,5 @@ type Args = {
32
37
  method: string;
33
38
  params: unknown[];
34
39
  };
35
- export declare const interceptTransport: ({ getAccounts, onPersonalSign, onSendTransaction, onSignTypedData, onGetCapabilities, onSendCalls, transport, }: InterceptTransportProps) => CustomTransport;
40
+ export declare const interceptTransport: ({ getAccounts, onPersonalSign, onSendTransaction, onSignTransaction, onSignTypedData, onGetCapabilities, onSendCalls, transport, }: InterceptTransportProps) => CustomTransport;
36
41
  export {};
@@ -4,7 +4,7 @@ import { custom, UserRejectedRequestError as UserRejectedRequestError$1 } from '
4
4
  import { UserRejectedRequestError, UserRejectedTransactionError } from '@dynamic-labs/utils';
5
5
  import { isTransactionExecutionError } from '../isTransactionExecutionError/isTransactionExecutionError.js';
6
6
 
7
- const interceptTransport = ({ getAccounts, onPersonalSign, onSendTransaction, onSignTypedData, onGetCapabilities, onSendCalls, transport, }) => (props) => {
7
+ const interceptTransport = ({ getAccounts, onPersonalSign, onSendTransaction, onSignTransaction, onSignTypedData, onGetCapabilities, onSendCalls, transport, }) => (props) => {
8
8
  const provider = transport(props);
9
9
  return custom({
10
10
  request: (args) => __awaiter(void 0, void 0, void 0, function* () {
@@ -38,6 +38,15 @@ const interceptTransport = ({ getAccounts, onPersonalSign, onSendTransaction, on
38
38
  throw error;
39
39
  });
40
40
  }
41
+ if (onSignTransaction && method === 'eth_signTransaction') {
42
+ const [transaction] = params;
43
+ return onSignTransaction({ args, provider, transaction }).catch((error) => {
44
+ if (error instanceof UserRejectedRequestError) {
45
+ throw new UserRejectedRequestError$1(error);
46
+ }
47
+ throw error;
48
+ });
49
+ }
41
50
  if (onSignTypedData && method === 'eth_signTypedData_v4') {
42
51
  const [, message] = (_a = params) !== null && _a !== void 0 ? _a : [];
43
52
  return onSignTypedData({ args, message, provider }).catch((error) => {
@@ -15,7 +15,9 @@ var viem = require('viem');
15
15
  */
16
16
  const unFormatTransaction = (transactionRequest) => (Object.assign(Object.assign({}, transactionRequest), { authorizationList: typeof transactionRequest.authorizationList !== 'undefined'
17
17
  ? transactionRequest.authorizationList.map((authorization) => (Object.assign(Object.assign({}, authorization), { chainId: viem.hexToBigInt(authorization.chainId), nonce: viem.hexToBigInt(authorization.nonce), yParity: viem.hexToNumber(authorization.yParity, { size: 1 }) })))
18
- : undefined, gas: typeof transactionRequest.gas !== 'undefined'
18
+ : undefined, chainId: typeof transactionRequest.chainId === 'string'
19
+ ? viem.hexToNumber(transactionRequest.chainId)
20
+ : transactionRequest.chainId, gas: typeof transactionRequest.gas !== 'undefined'
19
21
  ? viem.hexToBigInt(transactionRequest.gas)
20
22
  : undefined, gasPrice: typeof transactionRequest.gasPrice !== 'undefined'
21
23
  ? viem.hexToBigInt(transactionRequest.gasPrice)
@@ -11,7 +11,9 @@ import { hexToBigInt, hexToNumber } from 'viem';
11
11
  */
12
12
  const unFormatTransaction = (transactionRequest) => (Object.assign(Object.assign({}, transactionRequest), { authorizationList: typeof transactionRequest.authorizationList !== 'undefined'
13
13
  ? transactionRequest.authorizationList.map((authorization) => (Object.assign(Object.assign({}, authorization), { chainId: hexToBigInt(authorization.chainId), nonce: hexToBigInt(authorization.nonce), yParity: hexToNumber(authorization.yParity, { size: 1 }) })))
14
- : undefined, gas: typeof transactionRequest.gas !== 'undefined'
14
+ : undefined, chainId: typeof transactionRequest.chainId === 'string'
15
+ ? hexToNumber(transactionRequest.chainId)
16
+ : transactionRequest.chainId, gas: typeof transactionRequest.gas !== 'undefined'
15
17
  ? hexToBigInt(transactionRequest.gas)
16
18
  : undefined, gasPrice: typeof transactionRequest.gasPrice !== 'undefined'
17
19
  ? hexToBigInt(transactionRequest.gasPrice)