@dynamic-labs-wallet/node-evm 0.0.182 → 0.0.184

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/index.cjs.js CHANGED
@@ -3,6 +3,7 @@
3
3
  var node = require('@dynamic-labs-wallet/node');
4
4
  var viem = require('viem');
5
5
  var chains = require('viem/chains');
6
+ var utils = require('viem/utils');
6
7
 
7
8
  function _extends() {
8
9
  _extends = Object.assign || function assign(target) {
@@ -20,6 +21,7 @@ const EVM_SIGN_MESSAGE_PREFIX = `\x19Ethereum Signed Message:\n`;
20
21
  const ERROR_KEYGEN_FAILED = 'Error with keygen';
21
22
  const ERROR_CREATE_WALLET_ACCOUNT = 'Error creating evm wallet account';
22
23
  const ERROR_SIGN_MESSAGE = 'Error signing message';
24
+ const ERROR_SIGN_TYPED_DATA = 'Error signing typed data';
23
25
  const ERROR_ACCOUNT_ADDRESS_REQUIRED = 'Account address is required';
24
26
  const ERROR_VERIFY_MESSAGE_SIGNATURE = 'Error verifying message signature';
25
27
 
@@ -35,6 +37,9 @@ const formatEVMMessage = (message_)=>{
35
37
  message
36
38
  ]);
37
39
  };
40
+ const formatTypedData = (typedData)=>{
41
+ return viem.hashTypedData(typedData).slice(2);
42
+ };
38
43
  const serializeECDSASignature = (signature)=>{
39
44
  return viem.serializeSignature({
40
45
  r: `0x${Buffer.from(signature.r).toString('hex')}`,
@@ -79,6 +84,7 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
79
84
  const { rawPublicKey, externalServerKeyShares } = await this.keyGen({
80
85
  chainName: this.chainName,
81
86
  thresholdSignatureScheme,
87
+ skipLock: true,
82
88
  onError,
83
89
  onCeremonyComplete: (accountAddress, walletId)=>{
84
90
  // update wallet map
@@ -160,6 +166,58 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
160
166
  throw new Error(ERROR_SIGN_MESSAGE);
161
167
  }
162
168
  }
169
+ async signAuthorization({ authorization, accountAddress, password = undefined, externalServerKeyShares, onError }) {
170
+ try {
171
+ if (!accountAddress) {
172
+ throw new Error(ERROR_ACCOUNT_ADDRESS_REQUIRED);
173
+ }
174
+ const digest = utils.hashAuthorization(authorization);
175
+ const prehashed = digest.startsWith('0x') ? digest.slice(2) : digest;
176
+ const signatureEcdsa = await this.sign({
177
+ message: prehashed,
178
+ accountAddress: accountAddress,
179
+ chainName: this.chainName,
180
+ password,
181
+ externalServerKeyShares,
182
+ isFormatted: true,
183
+ context: {
184
+ eip7702Auth: authorization
185
+ },
186
+ onError
187
+ });
188
+ const serializedSignature = serializeECDSASignature(signatureEcdsa);
189
+ const signature = viem.parseSignature(serializedSignature);
190
+ return signature;
191
+ } catch (error) {
192
+ this.logger.error(ERROR_SIGN_MESSAGE, error);
193
+ throw new Error(ERROR_SIGN_MESSAGE);
194
+ }
195
+ }
196
+ async signTypedData({ accountAddress, typedData, password = undefined, externalServerKeyShares, onError }) {
197
+ try {
198
+ if (!accountAddress) {
199
+ throw new Error(ERROR_ACCOUNT_ADDRESS_REQUIRED);
200
+ }
201
+ const formattedTypedData = formatTypedData(typedData);
202
+ const signatureEcdsa = await this.sign({
203
+ message: formattedTypedData,
204
+ accountAddress: accountAddress,
205
+ chainName: this.chainName,
206
+ password,
207
+ externalServerKeyShares,
208
+ isFormatted: true,
209
+ context: {
210
+ evmTypedData: typedData
211
+ },
212
+ onError
213
+ });
214
+ const serializedSignature = serializeECDSASignature(signatureEcdsa);
215
+ return serializedSignature;
216
+ } catch (error) {
217
+ this.logger.error(ERROR_SIGN_TYPED_DATA, error);
218
+ throw new Error(ERROR_SIGN_TYPED_DATA);
219
+ }
220
+ }
163
221
  async verifyMessageSignature({ accountAddress, message, signature }) {
164
222
  try {
165
223
  // Verify the signature using the public client
@@ -408,6 +466,7 @@ exports.ERROR_ACCOUNT_ADDRESS_REQUIRED = ERROR_ACCOUNT_ADDRESS_REQUIRED;
408
466
  exports.ERROR_CREATE_WALLET_ACCOUNT = ERROR_CREATE_WALLET_ACCOUNT;
409
467
  exports.ERROR_KEYGEN_FAILED = ERROR_KEYGEN_FAILED;
410
468
  exports.ERROR_SIGN_MESSAGE = ERROR_SIGN_MESSAGE;
469
+ exports.ERROR_SIGN_TYPED_DATA = ERROR_SIGN_TYPED_DATA;
411
470
  exports.ERROR_VERIFY_MESSAGE_SIGNATURE = ERROR_VERIFY_MESSAGE_SIGNATURE;
412
471
  exports.EVM_SIGN_MESSAGE_PREFIX = EVM_SIGN_MESSAGE_PREFIX;
413
472
  exports.createDelegatedEvmWalletClient = createDelegatedEvmWalletClient;
@@ -415,5 +474,6 @@ exports.delegatedSignMessage = delegatedSignMessage;
415
474
  exports.delegatedSignTransaction = delegatedSignTransaction;
416
475
  exports.deriveAccountAddress = deriveAccountAddress;
417
476
  exports.formatEVMMessage = formatEVMMessage;
477
+ exports.formatTypedData = formatTypedData;
418
478
  exports.revokeDelegation = revokeDelegation;
419
479
  exports.serializeECDSASignature = serializeECDSASignature;
package/index.esm.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { MessageHash, DynamicWalletClient, getMPCChainConfig, getExternalServerKeyShareBackupInfo, WalletOperation, createDelegatedWalletClient, delegatedSignMessage as delegatedSignMessage$1, revokeDelegation as revokeDelegation$1 } from '@dynamic-labs-wallet/node';
2
- import { stringToHex, bytesToHex, size, concat, serializeSignature, getAddress, createPublicClient, http, serializeTransaction } from 'viem';
2
+ import { stringToHex, bytesToHex, size, concat, hashTypedData, serializeSignature, getAddress, createPublicClient, http, parseSignature, serializeTransaction } from 'viem';
3
3
  import { mainnet } from 'viem/chains';
4
+ import { hashAuthorization } from 'viem/utils';
4
5
 
5
6
  function _extends() {
6
7
  _extends = Object.assign || function assign(target) {
@@ -18,6 +19,7 @@ const EVM_SIGN_MESSAGE_PREFIX = `\x19Ethereum Signed Message:\n`;
18
19
  const ERROR_KEYGEN_FAILED = 'Error with keygen';
19
20
  const ERROR_CREATE_WALLET_ACCOUNT = 'Error creating evm wallet account';
20
21
  const ERROR_SIGN_MESSAGE = 'Error signing message';
22
+ const ERROR_SIGN_TYPED_DATA = 'Error signing typed data';
21
23
  const ERROR_ACCOUNT_ADDRESS_REQUIRED = 'Account address is required';
22
24
  const ERROR_VERIFY_MESSAGE_SIGNATURE = 'Error verifying message signature';
23
25
 
@@ -33,6 +35,9 @@ const formatEVMMessage = (message_)=>{
33
35
  message
34
36
  ]);
35
37
  };
38
+ const formatTypedData = (typedData)=>{
39
+ return hashTypedData(typedData).slice(2);
40
+ };
36
41
  const serializeECDSASignature = (signature)=>{
37
42
  return serializeSignature({
38
43
  r: `0x${Buffer.from(signature.r).toString('hex')}`,
@@ -77,6 +82,7 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
77
82
  const { rawPublicKey, externalServerKeyShares } = await this.keyGen({
78
83
  chainName: this.chainName,
79
84
  thresholdSignatureScheme,
85
+ skipLock: true,
80
86
  onError,
81
87
  onCeremonyComplete: (accountAddress, walletId)=>{
82
88
  // update wallet map
@@ -158,6 +164,58 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
158
164
  throw new Error(ERROR_SIGN_MESSAGE);
159
165
  }
160
166
  }
167
+ async signAuthorization({ authorization, accountAddress, password = undefined, externalServerKeyShares, onError }) {
168
+ try {
169
+ if (!accountAddress) {
170
+ throw new Error(ERROR_ACCOUNT_ADDRESS_REQUIRED);
171
+ }
172
+ const digest = hashAuthorization(authorization);
173
+ const prehashed = digest.startsWith('0x') ? digest.slice(2) : digest;
174
+ const signatureEcdsa = await this.sign({
175
+ message: prehashed,
176
+ accountAddress: accountAddress,
177
+ chainName: this.chainName,
178
+ password,
179
+ externalServerKeyShares,
180
+ isFormatted: true,
181
+ context: {
182
+ eip7702Auth: authorization
183
+ },
184
+ onError
185
+ });
186
+ const serializedSignature = serializeECDSASignature(signatureEcdsa);
187
+ const signature = parseSignature(serializedSignature);
188
+ return signature;
189
+ } catch (error) {
190
+ this.logger.error(ERROR_SIGN_MESSAGE, error);
191
+ throw new Error(ERROR_SIGN_MESSAGE);
192
+ }
193
+ }
194
+ async signTypedData({ accountAddress, typedData, password = undefined, externalServerKeyShares, onError }) {
195
+ try {
196
+ if (!accountAddress) {
197
+ throw new Error(ERROR_ACCOUNT_ADDRESS_REQUIRED);
198
+ }
199
+ const formattedTypedData = formatTypedData(typedData);
200
+ const signatureEcdsa = await this.sign({
201
+ message: formattedTypedData,
202
+ accountAddress: accountAddress,
203
+ chainName: this.chainName,
204
+ password,
205
+ externalServerKeyShares,
206
+ isFormatted: true,
207
+ context: {
208
+ evmTypedData: typedData
209
+ },
210
+ onError
211
+ });
212
+ const serializedSignature = serializeECDSASignature(signatureEcdsa);
213
+ return serializedSignature;
214
+ } catch (error) {
215
+ this.logger.error(ERROR_SIGN_TYPED_DATA, error);
216
+ throw new Error(ERROR_SIGN_TYPED_DATA);
217
+ }
218
+ }
161
219
  async verifyMessageSignature({ accountAddress, message, signature }) {
162
220
  try {
163
221
  // Verify the signature using the public client
@@ -401,4 +459,4 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
401
459
  return revokeDelegation$1(client, params);
402
460
  };
403
461
 
404
- export { DynamicEvmWalletClient, ERROR_ACCOUNT_ADDRESS_REQUIRED, ERROR_CREATE_WALLET_ACCOUNT, ERROR_KEYGEN_FAILED, ERROR_SIGN_MESSAGE, ERROR_VERIFY_MESSAGE_SIGNATURE, EVM_SIGN_MESSAGE_PREFIX, createDelegatedEvmWalletClient, delegatedSignMessage, delegatedSignTransaction, deriveAccountAddress, formatEVMMessage, revokeDelegation, serializeECDSASignature };
462
+ export { DynamicEvmWalletClient, ERROR_ACCOUNT_ADDRESS_REQUIRED, ERROR_CREATE_WALLET_ACCOUNT, ERROR_KEYGEN_FAILED, ERROR_SIGN_MESSAGE, ERROR_SIGN_TYPED_DATA, ERROR_VERIFY_MESSAGE_SIGNATURE, EVM_SIGN_MESSAGE_PREFIX, createDelegatedEvmWalletClient, delegatedSignMessage, delegatedSignTransaction, deriveAccountAddress, formatEVMMessage, formatTypedData, revokeDelegation, serializeECDSASignature };
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@dynamic-labs-wallet/node-evm",
3
- "version": "0.0.182",
3
+ "version": "0.0.184",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "dependencies": {
7
- "@dynamic-labs-wallet/node": "0.0.182",
7
+ "@dynamic-labs-wallet/node": "0.0.184",
8
8
  "@dynamic-labs/sdk-api-core": "^0.0.801"
9
9
  },
10
10
  "publishConfig": {
@@ -1,6 +1,6 @@
1
- import { type ServerKeyShare, DynamicWalletClient, type EcdsaKeygenResult, type EcdsaPublicKey, type Ed25519KeygenResult, type ThresholdSignatureScheme, type DynamicWalletClientProps } from '@dynamic-labs-wallet/node';
2
- import { type PublicClient, type Chain, type SignableMessage, type TransactionSerializable } from 'viem';
1
+ import { DynamicWalletClient, type DynamicWalletClientProps, type EcdsaKeygenResult, type EcdsaPublicKey, type Ed25519KeygenResult, type ServerKeyShare, type ThresholdSignatureScheme } from '@dynamic-labs-wallet/node';
3
2
  import type { SignMessageContext } from '@dynamic-labs/sdk-api-core';
3
+ import { type Chain, type PublicClient, type SignableMessage, type TransactionSerializable, type TypedData } from 'viem';
4
4
  export declare class DynamicEvmWalletClient extends DynamicWalletClient {
5
5
  readonly chainName = "EVM";
6
6
  constructor({ environmentId, baseApiUrl, baseMPCRelayApiUrl, debug, }: DynamicWalletClientProps);
@@ -36,6 +36,30 @@ export declare class DynamicEvmWalletClient extends DynamicWalletClient {
36
36
  context?: SignMessageContext;
37
37
  onError?: (error: Error) => void;
38
38
  }): Promise<`0x${string}`>;
39
+ signAuthorization({ authorization, accountAddress, password, externalServerKeyShares, onError, }: {
40
+ authorization: any;
41
+ accountAddress: string;
42
+ password?: string;
43
+ externalServerKeyShares?: ServerKeyShare[];
44
+ onError?: (error: Error) => void;
45
+ }): Promise<{
46
+ r: `0x${string}`;
47
+ s: `0x${string}`;
48
+ v: bigint;
49
+ yParity: number;
50
+ } | {
51
+ r: `0x${string}`;
52
+ s: `0x${string}`;
53
+ yParity: number;
54
+ v?: never;
55
+ }>;
56
+ signTypedData({ accountAddress, typedData, password, externalServerKeyShares, onError, }: {
57
+ accountAddress: string;
58
+ typedData: TypedData;
59
+ password?: string;
60
+ externalServerKeyShares?: ServerKeyShare[];
61
+ onError?: (error: Error) => void;
62
+ }): Promise<`0x${string}`>;
39
63
  verifyMessageSignature({ accountAddress, message, signature, }: {
40
64
  accountAddress: string;
41
65
  message: SignableMessage;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAEnB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAI9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,KAAK,EAEV,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAE7B,MAAM,MAAM,CAAC;AAcd,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErE,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC7D,QAAQ,CAAC,SAAS,SAAS;gBAEf,EACV,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,KAAK,GACN,EAAE,wBAAwB;IAS3B,sBAAsB,CAAC,EACrB,KAAK,EACL,MAAM,GACP,EAAE;QACD,KAAK,EAAE,KAAK,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,YAAY;IAOhB;;;;;;;OAOG;IAEG,mBAAmB,CAAC,EACxB,wBAAwB,EACxB,QAAoB,EACpB,OAAO,EACP,0BAAkC,GACnC,EAAE;QACD,wBAAwB,EAAE,wBAAwB,CAAC;QACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;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EAAE,CAAC;QACvD,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB;;;IASD;;;;;;;;;OASG;IACG,gBAAgB,CAAC,EACrB,UAAU,EACV,SAAS,EACT,wBAAwB,EACxB,QAAoB,EACpB,0BAAkC,EAClC,OAAO,GACR,EAAE;QACD,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,wBAAwB,EAAE,wBAAwB,CAAC;QACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,0BAA0B,CAAC,EAAE,OAAO,CAAC;QACrC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;KAClC,GAAG,OAAO,CAAC;QACV,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,cAAc,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;QAC/D,uBAAuB,EAAE,cAAc,EAAE,CAAC;KAC3C,CAAC;IA8DI,aAAa;CAOpB"}
@@ -2,6 +2,7 @@ export declare const EVM_SIGN_MESSAGE_PREFIX = "\u0019Ethereum Signed Message:\n
2
2
  export declare const ERROR_KEYGEN_FAILED = "Error with keygen";
3
3
  export declare const ERROR_CREATE_WALLET_ACCOUNT = "Error creating evm wallet account";
4
4
  export declare const ERROR_SIGN_MESSAGE = "Error signing message";
5
+ export declare const ERROR_SIGN_TYPED_DATA = "Error signing typed data";
5
6
  export declare const ERROR_ACCOUNT_ADDRESS_REQUIRED = "Account address is required";
6
7
  export declare const ERROR_VERIFY_MESSAGE_SIGNATURE = "Error verifying message signature";
7
8
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/client/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,qCAAmC,CAAC;AAGxE,eAAO,MAAM,mBAAmB,sBAAsB,CAAC;AAEvD,eAAO,MAAM,2BAA2B,sCAAsC,CAAC;AAE/E,eAAO,MAAM,kBAAkB,0BAA0B,CAAC;AAE1D,eAAO,MAAM,8BAA8B,gCAAgC,CAAC;AAE5E,eAAO,MAAM,8BAA8B,sCAAsC,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/client/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,qCAAmC,CAAC;AAGxE,eAAO,MAAM,mBAAmB,sBAAsB,CAAC;AAEvD,eAAO,MAAM,2BAA2B,sCAAsC,CAAC;AAE/E,eAAO,MAAM,kBAAkB,0BAA0B,CAAC;AAE1D,eAAO,MAAM,qBAAqB,6BAA6B,CAAC;AAEhE,eAAO,MAAM,8BAA8B,gCAAgC,CAAC;AAE5E,eAAO,MAAM,8BAA8B,sCACN,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type { DelegatedWalletClient, ServerKeyShare } from '@dynamic-labs-wallet/node';
2
- import { type TransactionSerializable } from 'viem';
3
2
  import type { SignMessageContext } from '@dynamic-labs/sdk-api-core';
3
+ import { type TransactionSerializable } from 'viem';
4
4
  export type DelegatedEvmClientConfig = {
5
5
  environmentId: string;
6
6
  baseApiUrl?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"delegatedClient.d.ts","sourceRoot":"","sources":["../../packages/src/delegatedClient.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,qBAAqB,EAErB,cAAc,EACf,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAwB,KAAK,uBAAuB,EAAE,MAAM,MAAM,CAAC;AAE1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErE,MAAM,MAAM,wBAAwB,GAAG;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;CACj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M,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,qBAAqB,GAAG;IAC7D,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,8BAA8B,sEAMxC,wBAAwB,KAAG,wBAe7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,WACvB,wBAAwB,oEAQ7B;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC,KACA,OAAO,CAAC,MAAM,CA0BhB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,WAC3B,wBAAwB,sDAM7B;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,cAAc,CAAC;IACzB,WAAW,EAAE,uBAAuB,CAAC;CACtC,KACA,OAAO,CAAC,MAAM,CA8ChB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,WACnB,wBAAwB,UACxB,GAAG,kBAGZ,CAAC"}
package/src/utils.d.ts CHANGED
@@ -1,7 +1,11 @@
1
- import { type EcdsaSignature, type EcdsaPublicKey } from '@dynamic-labs-wallet/node';
1
+ import { type EcdsaPublicKey, type EcdsaSignature } from '@dynamic-labs-wallet/node';
2
+ import { type TypedData } from 'viem';
2
3
  export declare const formatEVMMessage: (message_: string | {
3
4
  raw: string | Uint8Array;
4
5
  }) => `0x${string}`;
6
+ export declare const formatTypedData: (typedData: TypedData | {
7
+ [key: string]: unknown;
8
+ }) => string;
5
9
  export declare const serializeECDSASignature: (signature: EcdsaSignature) => `0x${string}`;
6
10
  export declare const deriveAccountAddress: ({ rawPublicKey, }: {
7
11
  rawPublicKey: EcdsaPublicKey;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../packages/src/utils.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,cAAc,EAEpB,MAAM,2BAA2B,CAAC;AAGnC,eAAO,MAAM,gBAAgB,aACjB,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;CAAE,kBAShD,CAAC;AAEF,eAAO,MAAM,uBAAuB,cAAe,cAAc,kBAMhE,CAAC;AAEF,eAAO,MAAM,oBAAoB,sBAE9B;IACD,YAAY,EAAE,cAAc,CAAC;CAC9B;;;CAQA,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../packages/src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,cAAc,EAEpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EASL,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AAGd,eAAO,MAAM,gBAAgB,aACjB,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;CAAE,kBAShD,CAAC;AAEF,eAAO,MAAM,eAAe,cACf,SAAS,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,WAGlD,CAAC;AAEF,eAAO,MAAM,uBAAuB,cAAe,cAAc,kBAMhE,CAAC;AAEF,eAAO,MAAM,oBAAoB,sBAE9B;IACD,YAAY,EAAE,cAAc,CAAC;CAC9B;;;CAQA,CAAC"}