@dynamic-labs/viem-extension 4.32.1-preview.0 → 4.33.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,10 +1,31 @@
1
1
 
2
- ### [4.32.1-preview.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.32.0...v4.32.1-preview.0) (2025-09-19)
2
+ ## [4.33.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.32.1...v4.33.0) (2025-09-26)
3
+
4
+
5
+ ### Features
6
+
7
+ * add support for signAndExecuteTransactionBlock and signTransactionBlock legacy sui features ([#9574](https://github.com/dynamic-labs/dynamic-auth/issues/9574)) ([316481f](https://github.com/dynamic-labs/dynamic-auth/commit/316481f9255ccc8873d267e85932df3b9d58184b))
8
+ * add viem account for waas wallets ([#9518](https://github.com/dynamic-labs/dynamic-auth/issues/9518)) ([39b6314](https://github.com/dynamic-labs/dynamic-auth/commit/39b631489a5fc38bf8077a91f7dd36d517e42512))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * unable to use backup codes to delete totp method on dynamics ui ([#9575](https://github.com/dynamic-labs/dynamic-auth/issues/9575)) ([db55161](https://github.com/dynamic-labs/dynamic-auth/commit/db5516191103ba00f3d993db28ec0df630e066b0))
14
+
15
+ ### [4.32.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.32.0...v4.32.1) (2025-09-25)
16
+
17
+
18
+ ### Features
19
+
20
+ * allow connecting multiple WC wallets ([#9493](https://github.com/dynamic-labs/dynamic-auth/issues/9493)) ([350c53c](https://github.com/dynamic-labs/dynamic-auth/commit/350c53cfc2198a565e9a324d9d65c3e57883d772))
21
+ * always use redirect inside MM IAB ([#9535](https://github.com/dynamic-labs/dynamic-auth/issues/9535)) ([8aca796](https://github.com/dynamic-labs/dynamic-auth/commit/8aca7968dfa0ef0f3caee043b415f9f76187112e))
3
22
 
4
23
 
5
24
  ### Bug Fixes
6
25
 
7
26
  * correct naming ([#9513](https://github.com/dynamic-labs/dynamic-auth/issues/9513)) ([5b4e31b](https://github.com/dynamic-labs/dynamic-auth/commit/5b4e31b9bbf2401d377201a4cd12edf79eaef75f))
27
+ * correct Safe Wallet App Store ID to prevent misdirect ([#9531](https://github.com/dynamic-labs/dynamic-auth/issues/9531)) ([b58adc5](https://github.com/dynamic-labs/dynamic-auth/commit/b58adc54de8018bf25011b205b94977da9676c2d))
28
+ * prevent social login popup in headless scenarios ([#9541](https://github.com/dynamic-labs/dynamic-auth/issues/9541)) ([a91c0b0](https://github.com/dynamic-labs/dynamic-auth/commit/a91c0b0d1d09210fa149cae80abab6978f4ae998))
8
29
 
9
30
  ## [4.32.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.31.4...v4.32.0) (2025-09-17)
10
31
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.32.1-preview.0";
6
+ var version = "4.33.0";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.32.1-preview.0";
2
+ var version = "4.33.0";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/viem-extension",
3
- "version": "4.32.1-preview.0",
3
+ "version": "4.33.0",
4
4
  "main": "./src/index.cjs",
5
5
  "module": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -17,10 +17,10 @@
17
17
  "viem": "^2.28.4"
18
18
  },
19
19
  "dependencies": {
20
- "@dynamic-labs/assert-package-version": "4.32.1-preview.0",
21
- "@dynamic-labs/client": "4.32.1-preview.0",
22
- "@dynamic-labs/message-transport": "4.32.1-preview.0",
23
- "@dynamic-labs/types": "4.32.1-preview.0",
24
- "@dynamic-labs/webview-messages": "4.32.1-preview.0"
20
+ "@dynamic-labs/assert-package-version": "4.33.0",
21
+ "@dynamic-labs/client": "4.33.0",
22
+ "@dynamic-labs/message-transport": "4.33.0",
23
+ "@dynamic-labs/types": "4.33.0",
24
+ "@dynamic-labs/webview-messages": "4.33.0"
25
25
  }
26
26
  }
@@ -0,0 +1,29 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var _tslib = require('../../../_virtual/_tslib.cjs');
7
+ var accounts = require('viem/accounts');
8
+ var messageTransport = require('@dynamic-labs/message-transport');
9
+
10
+ const createAccountFromWallet = (messageTransport$1, wallet) => {
11
+ const viemRequestChannel = messageTransport.createRequestChannel(messageTransport$1);
12
+ return accounts.toAccount({
13
+ address: wallet.address,
14
+ signAuthorization: (parameters) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
15
+ var _a;
16
+ const result = yield viemRequestChannel.request('viem_signAuthorization', wallet.id, parameters);
17
+ return Object.assign(Object.assign({}, result), { yParity: (_a = result.yParity) !== null && _a !== void 0 ? _a : 0 });
18
+ }),
19
+ signMessage: (_b) => _tslib.__awaiter(void 0, [_b], void 0, function* ({ message }) { return viemRequestChannel.request('viem_signMessage', wallet.id, message); }),
20
+ signTransaction: (transaction) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
21
+ return viemRequestChannel.request('viem_signTransaction', wallet.id, transaction);
22
+ }),
23
+ signTypedData: (typedData) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
24
+ return viemRequestChannel.request('viem_signTypedData', wallet.id, typedData);
25
+ }),
26
+ });
27
+ };
28
+
29
+ exports.createAccountFromWallet = createAccountFromWallet;
@@ -0,0 +1,225 @@
1
+ import { Wallet } from '@dynamic-labs/client';
2
+ import { MessageTransportWithDefaultOrigin } from '@dynamic-labs/message-transport';
3
+ export declare const createAccountFromWallet: (messageTransport: MessageTransportWithDefaultOrigin, wallet: Wallet) => {
4
+ address: `0x${string}`;
5
+ nonceManager?: import("viem/accounts").NonceManager | undefined;
6
+ sign?: ((parameters: {
7
+ hash: `0x${string}`;
8
+ }) => Promise<`0x${string}`>) | undefined;
9
+ signAuthorization?: ((parameters: import("node_modules/viem/_types/types/authorization").AuthorizationRequest) => Promise<import("viem/accounts").SignAuthorizationReturnType>) | undefined;
10
+ signMessage: ({ message }: {
11
+ message: import("viem").SignableMessage;
12
+ }) => Promise<`0x${string}`>;
13
+ signTransaction: <serializer extends import("viem").SerializeTransactionFn<import("viem").TransactionSerializable> = import("viem").SerializeTransactionFn<import("viem").TransactionSerializable>, transaction extends Parameters<serializer>[0] = Parameters<serializer>[0]>(transaction: transaction, options?: {
14
+ serializer?: serializer | undefined;
15
+ } | undefined) => Promise<import("viem").IsNarrowable<import("viem").TransactionSerialized<import("viem").GetTransactionType<transaction>>, `0x${string}`> extends true ? import("viem").TransactionSerialized<import("viem").GetTransactionType<transaction>> : `0x${string}`>;
16
+ signTypedData: <const typedData extends {
17
+ [x: string]: readonly import("viem").TypedDataParameter[];
18
+ [x: `string[${string}]`]: undefined;
19
+ [x: `function[${string}]`]: undefined;
20
+ [x: `address[${string}]`]: undefined;
21
+ [x: `bool[${string}]`]: undefined;
22
+ [x: `bytes[${string}]`]: undefined;
23
+ [x: `bytes1[${string}]`]: undefined;
24
+ [x: `bytes2[${string}]`]: undefined;
25
+ [x: `bytes3[${string}]`]: undefined;
26
+ [x: `bytes4[${string}]`]: undefined;
27
+ [x: `bytes5[${string}]`]: undefined;
28
+ [x: `bytes6[${string}]`]: undefined;
29
+ [x: `bytes7[${string}]`]: undefined;
30
+ [x: `bytes8[${string}]`]: undefined;
31
+ [x: `bytes9[${string}]`]: undefined;
32
+ [x: `bytes10[${string}]`]: undefined;
33
+ [x: `bytes11[${string}]`]: undefined;
34
+ [x: `bytes12[${string}]`]: undefined;
35
+ [x: `bytes13[${string}]`]: undefined;
36
+ [x: `bytes14[${string}]`]: undefined;
37
+ [x: `bytes15[${string}]`]: undefined;
38
+ [x: `bytes16[${string}]`]: undefined;
39
+ [x: `bytes17[${string}]`]: undefined;
40
+ [x: `bytes18[${string}]`]: undefined;
41
+ [x: `bytes19[${string}]`]: undefined;
42
+ [x: `bytes20[${string}]`]: undefined;
43
+ [x: `bytes21[${string}]`]: undefined;
44
+ [x: `bytes22[${string}]`]: undefined;
45
+ [x: `bytes23[${string}]`]: undefined;
46
+ [x: `bytes24[${string}]`]: undefined;
47
+ [x: `bytes25[${string}]`]: undefined;
48
+ [x: `bytes26[${string}]`]: undefined;
49
+ [x: `bytes27[${string}]`]: undefined;
50
+ [x: `bytes28[${string}]`]: undefined;
51
+ [x: `bytes29[${string}]`]: undefined;
52
+ [x: `bytes30[${string}]`]: undefined;
53
+ [x: `bytes31[${string}]`]: undefined;
54
+ [x: `bytes32[${string}]`]: undefined;
55
+ [x: `int[${string}]`]: undefined;
56
+ [x: `int8[${string}]`]: undefined;
57
+ [x: `int16[${string}]`]: undefined;
58
+ [x: `int24[${string}]`]: undefined;
59
+ [x: `int32[${string}]`]: undefined;
60
+ [x: `int40[${string}]`]: undefined;
61
+ [x: `int48[${string}]`]: undefined;
62
+ [x: `int56[${string}]`]: undefined;
63
+ [x: `int64[${string}]`]: undefined;
64
+ [x: `int72[${string}]`]: undefined;
65
+ [x: `int80[${string}]`]: undefined;
66
+ [x: `int88[${string}]`]: undefined;
67
+ [x: `int96[${string}]`]: undefined;
68
+ [x: `int104[${string}]`]: undefined;
69
+ [x: `int112[${string}]`]: undefined;
70
+ [x: `int120[${string}]`]: undefined;
71
+ [x: `int128[${string}]`]: undefined;
72
+ [x: `int136[${string}]`]: undefined;
73
+ [x: `int144[${string}]`]: undefined;
74
+ [x: `int152[${string}]`]: undefined;
75
+ [x: `int160[${string}]`]: undefined;
76
+ [x: `int168[${string}]`]: undefined;
77
+ [x: `int176[${string}]`]: undefined;
78
+ [x: `int184[${string}]`]: undefined;
79
+ [x: `int192[${string}]`]: undefined;
80
+ [x: `int200[${string}]`]: undefined;
81
+ [x: `int208[${string}]`]: undefined;
82
+ [x: `int216[${string}]`]: undefined;
83
+ [x: `int224[${string}]`]: undefined;
84
+ [x: `int232[${string}]`]: undefined;
85
+ [x: `int240[${string}]`]: undefined;
86
+ [x: `int248[${string}]`]: undefined;
87
+ [x: `int256[${string}]`]: undefined;
88
+ [x: `uint[${string}]`]: undefined;
89
+ [x: `uint8[${string}]`]: undefined;
90
+ [x: `uint16[${string}]`]: undefined;
91
+ [x: `uint24[${string}]`]: undefined;
92
+ [x: `uint32[${string}]`]: undefined;
93
+ [x: `uint40[${string}]`]: undefined;
94
+ [x: `uint48[${string}]`]: undefined;
95
+ [x: `uint56[${string}]`]: undefined;
96
+ [x: `uint64[${string}]`]: undefined;
97
+ [x: `uint72[${string}]`]: undefined;
98
+ [x: `uint80[${string}]`]: undefined;
99
+ [x: `uint88[${string}]`]: undefined;
100
+ [x: `uint96[${string}]`]: undefined;
101
+ [x: `uint104[${string}]`]: undefined;
102
+ [x: `uint112[${string}]`]: undefined;
103
+ [x: `uint120[${string}]`]: undefined;
104
+ [x: `uint128[${string}]`]: undefined;
105
+ [x: `uint136[${string}]`]: undefined;
106
+ [x: `uint144[${string}]`]: undefined;
107
+ [x: `uint152[${string}]`]: undefined;
108
+ [x: `uint160[${string}]`]: undefined;
109
+ [x: `uint168[${string}]`]: undefined;
110
+ [x: `uint176[${string}]`]: undefined;
111
+ [x: `uint184[${string}]`]: undefined;
112
+ [x: `uint192[${string}]`]: undefined;
113
+ [x: `uint200[${string}]`]: undefined;
114
+ [x: `uint208[${string}]`]: undefined;
115
+ [x: `uint216[${string}]`]: undefined;
116
+ [x: `uint224[${string}]`]: undefined;
117
+ [x: `uint232[${string}]`]: undefined;
118
+ [x: `uint240[${string}]`]: undefined;
119
+ [x: `uint248[${string}]`]: undefined;
120
+ [x: `uint256[${string}]`]: undefined;
121
+ string?: undefined;
122
+ address?: undefined;
123
+ bool?: undefined;
124
+ bytes?: undefined;
125
+ bytes1?: undefined;
126
+ bytes2?: undefined;
127
+ bytes3?: undefined;
128
+ bytes4?: undefined;
129
+ bytes5?: undefined;
130
+ bytes6?: undefined;
131
+ bytes7?: undefined;
132
+ bytes8?: undefined;
133
+ bytes9?: undefined;
134
+ bytes10?: undefined;
135
+ bytes11?: undefined;
136
+ bytes12?: undefined;
137
+ bytes13?: undefined;
138
+ bytes14?: undefined;
139
+ bytes15?: undefined;
140
+ bytes16?: undefined;
141
+ bytes17?: undefined;
142
+ bytes18?: undefined;
143
+ bytes19?: undefined;
144
+ bytes20?: undefined;
145
+ bytes21?: undefined;
146
+ bytes22?: undefined;
147
+ bytes23?: undefined;
148
+ bytes24?: undefined;
149
+ bytes25?: undefined;
150
+ bytes26?: undefined;
151
+ bytes27?: undefined;
152
+ bytes28?: undefined;
153
+ bytes29?: undefined;
154
+ bytes30?: undefined;
155
+ bytes31?: undefined;
156
+ bytes32?: undefined;
157
+ int8?: undefined;
158
+ int16?: undefined;
159
+ int24?: undefined;
160
+ int32?: undefined;
161
+ int40?: undefined;
162
+ int48?: undefined;
163
+ int56?: undefined;
164
+ int64?: undefined;
165
+ int72?: undefined;
166
+ int80?: undefined;
167
+ int88?: undefined;
168
+ int96?: undefined;
169
+ int104?: undefined;
170
+ int112?: undefined;
171
+ int120?: undefined;
172
+ int128?: undefined;
173
+ int136?: undefined;
174
+ int144?: undefined;
175
+ int152?: undefined;
176
+ int160?: undefined;
177
+ int168?: undefined;
178
+ int176?: undefined;
179
+ int184?: undefined;
180
+ int192?: undefined;
181
+ int200?: undefined;
182
+ int208?: undefined;
183
+ int216?: undefined;
184
+ int224?: undefined;
185
+ int232?: undefined;
186
+ int240?: undefined;
187
+ int248?: undefined;
188
+ int256?: undefined;
189
+ uint8?: undefined;
190
+ uint16?: undefined;
191
+ uint24?: undefined;
192
+ uint32?: undefined;
193
+ uint40?: undefined;
194
+ uint48?: undefined;
195
+ uint56?: undefined;
196
+ uint64?: undefined;
197
+ uint72?: undefined;
198
+ uint80?: undefined;
199
+ uint88?: undefined;
200
+ uint96?: undefined;
201
+ uint104?: undefined;
202
+ uint112?: undefined;
203
+ uint120?: undefined;
204
+ uint128?: undefined;
205
+ uint136?: undefined;
206
+ uint144?: undefined;
207
+ uint152?: undefined;
208
+ uint160?: undefined;
209
+ uint168?: undefined;
210
+ uint176?: undefined;
211
+ uint184?: undefined;
212
+ uint192?: undefined;
213
+ uint200?: undefined;
214
+ uint208?: undefined;
215
+ uint216?: undefined;
216
+ uint224?: undefined;
217
+ uint232?: undefined;
218
+ uint240?: undefined;
219
+ uint248?: undefined;
220
+ uint256?: undefined;
221
+ } | Record<string, unknown>, primaryType extends "EIP712Domain" | keyof typedData = keyof typedData>(parameters: import("viem").TypedDataDefinition<typedData, primaryType>) => Promise<`0x${string}`>;
222
+ publicKey: `0x${string}`;
223
+ source: string;
224
+ type: "local";
225
+ };
@@ -0,0 +1,25 @@
1
+ 'use client'
2
+ import { __awaiter } from '../../../_virtual/_tslib.js';
3
+ import { toAccount } from 'viem/accounts';
4
+ import { createRequestChannel } from '@dynamic-labs/message-transport';
5
+
6
+ const createAccountFromWallet = (messageTransport, wallet) => {
7
+ const viemRequestChannel = createRequestChannel(messageTransport);
8
+ return toAccount({
9
+ address: wallet.address,
10
+ signAuthorization: (parameters) => __awaiter(void 0, void 0, void 0, function* () {
11
+ var _a;
12
+ const result = yield viemRequestChannel.request('viem_signAuthorization', wallet.id, parameters);
13
+ return Object.assign(Object.assign({}, result), { yParity: (_a = result.yParity) !== null && _a !== void 0 ? _a : 0 });
14
+ }),
15
+ signMessage: (_b) => __awaiter(void 0, [_b], void 0, function* ({ message }) { return viemRequestChannel.request('viem_signMessage', wallet.id, message); }),
16
+ signTransaction: (transaction) => __awaiter(void 0, void 0, void 0, function* () {
17
+ return viemRequestChannel.request('viem_signTransaction', wallet.id, transaction);
18
+ }),
19
+ signTypedData: (typedData) => __awaiter(void 0, void 0, void 0, function* () {
20
+ return viemRequestChannel.request('viem_signTypedData', wallet.id, typedData);
21
+ }),
22
+ });
23
+ };
24
+
25
+ export { createAccountFromWallet };
@@ -0,0 +1 @@
1
+ export { createAccountFromWallet } from './createAccountFromWallet';
@@ -7,6 +7,7 @@ var _tslib = require('../../../_virtual/_tslib.cjs');
7
7
  var viem = require('viem');
8
8
  var chains = require('viem/chains');
9
9
  var messageTransport = require('@dynamic-labs/message-transport');
10
+ var createAccountFromWallet = require('../createAccountFromWallet/createAccountFromWallet.cjs');
10
11
 
11
12
  function _interopNamespace(e) {
12
13
  if (e && e.__esModule) return e;
@@ -47,7 +48,10 @@ const createWalletClientForDynamic = (messageTransport$1, _a) => _tslib.__awaite
47
48
  const { network } = yield walletRequestChannel.request('getNetwork', {
48
49
  wallet,
49
50
  });
50
- return viem.createWalletClient(Object.assign(Object.assign({ account: wallet.address }, params), { chain: (_b = params.chain) !== null && _b !== void 0 ? _b : getChainFromId(network), transport: viem.custom(providerProxy, {
51
+ const account = wallet.key === 'dynamicwaas'
52
+ ? createAccountFromWallet.createAccountFromWallet(messageTransport$1, wallet)
53
+ : wallet.address;
54
+ return viem.createWalletClient(Object.assign(Object.assign({ account }, params), { chain: (_b = params.chain) !== null && _b !== void 0 ? _b : getChainFromId(network), transport: viem.custom(providerProxy, {
51
55
  key: 'dynamic-client-transport',
52
56
  name: 'Dynamic Client Transport',
53
57
  retryCount: 3,
@@ -3,6 +3,7 @@ import { __awaiter, __rest } from '../../../_virtual/_tslib.js';
3
3
  import { createWalletClient, custom } from 'viem';
4
4
  import * as chains from 'viem/chains';
5
5
  import { createRequestChannel } from '@dynamic-labs/message-transport';
6
+ import { createAccountFromWallet } from '../createAccountFromWallet/createAccountFromWallet.js';
6
7
 
7
8
  const getChainFromId = (chainId) => {
8
9
  const idNumber = typeof chainId === 'string' ? parseInt(chainId) : chainId;
@@ -23,7 +24,10 @@ const createWalletClientForDynamic = (messageTransport, _a) => __awaiter(void 0,
23
24
  const { network } = yield walletRequestChannel.request('getNetwork', {
24
25
  wallet,
25
26
  });
26
- return createWalletClient(Object.assign(Object.assign({ account: wallet.address }, params), { chain: (_b = params.chain) !== null && _b !== void 0 ? _b : getChainFromId(network), transport: custom(providerProxy, {
27
+ const account = wallet.key === 'dynamicwaas'
28
+ ? createAccountFromWallet(messageTransport, wallet)
29
+ : wallet.address;
30
+ return createWalletClient(Object.assign(Object.assign({ account }, params), { chain: (_b = params.chain) !== null && _b !== void 0 ? _b : getChainFromId(network), transport: custom(providerProxy, {
27
31
  key: 'dynamic-client-transport',
28
32
  name: 'Dynamic Client Transport',
29
33
  retryCount: 3,