viem 3.0.0-next.1 → 3.0.0-next.3

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.
Files changed (58) hide show
  1. package/dist/core/actions/decorators/public.d.ts +52 -48
  2. package/dist/core/actions/decorators/public.d.ts.map +1 -1
  3. package/dist/core/actions/decorators/public.js +8 -4
  4. package/dist/core/actions/decorators/public.js.map +1 -1
  5. package/dist/core/actions/decorators/wallet.d.ts +25 -23
  6. package/dist/core/actions/decorators/wallet.d.ts.map +1 -1
  7. package/dist/core/actions/decorators/wallet.js +4 -2
  8. package/dist/core/actions/decorators/wallet.js.map +1 -1
  9. package/dist/core/actions/index.d.ts +2 -3
  10. package/dist/core/actions/index.d.ts.map +1 -1
  11. package/dist/core/actions/index.js +2 -3
  12. package/dist/core/actions/index.js.map +1 -1
  13. package/dist/core/actions/siwe/index.d.ts +2 -0
  14. package/dist/core/actions/siwe/index.d.ts.map +1 -0
  15. package/dist/core/actions/siwe/index.js +2 -0
  16. package/dist/core/actions/siwe/index.js.map +1 -0
  17. package/dist/core/actions/{verifySiweMessage.d.ts → siwe/verify.d.ts} +6 -6
  18. package/dist/core/actions/siwe/verify.d.ts.map +1 -0
  19. package/dist/core/actions/{verifySiweMessage.js → siwe/verify.js} +4 -4
  20. package/dist/core/actions/siwe/verify.js.map +1 -0
  21. package/dist/core/actions/typedData/index.d.ts +3 -0
  22. package/dist/core/actions/typedData/index.d.ts.map +1 -0
  23. package/dist/core/actions/typedData/index.js +3 -0
  24. package/dist/core/actions/typedData/index.js.map +1 -0
  25. package/dist/core/actions/{signTypedData.d.ts → typedData/sign.d.ts} +6 -6
  26. package/dist/core/actions/typedData/sign.d.ts.map +1 -0
  27. package/dist/core/actions/{signTypedData.js → typedData/sign.js} +4 -4
  28. package/dist/core/actions/typedData/sign.js.map +1 -0
  29. package/dist/core/actions/{verifyTypedData.d.ts → typedData/verify.d.ts} +6 -6
  30. package/dist/core/actions/typedData/verify.d.ts.map +1 -0
  31. package/dist/core/actions/{verifyTypedData.js → typedData/verify.js} +4 -4
  32. package/dist/core/actions/typedData/verify.js.map +1 -0
  33. package/dist/erc4337/internal/erc7739.js +1 -1
  34. package/dist/erc4337/internal/erc7739.js.map +1 -1
  35. package/dist/node/index.d.ts +2 -2
  36. package/dist/node/index.d.ts.map +1 -1
  37. package/dist/node/index.js +2 -2
  38. package/dist/node/index.js.map +1 -1
  39. package/dist/version.d.ts +1 -1
  40. package/dist/version.js +1 -1
  41. package/package.json +2 -2
  42. package/src/core/actions/decorators/public.ts +64 -57
  43. package/src/core/actions/decorators/wallet.ts +34 -29
  44. package/src/core/actions/index.ts +2 -3
  45. package/src/core/actions/siwe/index.ts +1 -0
  46. package/src/core/actions/{verifySiweMessage.ts → siwe/verify.ts} +7 -7
  47. package/src/core/actions/typedData/index.ts +2 -0
  48. package/src/core/actions/{signTypedData.ts → typedData/sign.ts} +8 -8
  49. package/src/core/actions/{verifyTypedData.ts → typedData/verify.ts} +8 -8
  50. package/src/erc4337/internal/erc7739.ts +1 -1
  51. package/src/node/index.ts +2 -2
  52. package/src/version.ts +1 -1
  53. package/dist/core/actions/signTypedData.d.ts.map +0 -1
  54. package/dist/core/actions/signTypedData.js.map +0 -1
  55. package/dist/core/actions/verifySiweMessage.d.ts.map +0 -1
  56. package/dist/core/actions/verifySiweMessage.js.map +0 -1
  57. package/dist/core/actions/verifyTypedData.d.ts.map +0 -1
  58. package/dist/core/actions/verifyTypedData.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { TypedData } from 'ox';
2
2
  import type { Address, Errors, Hex } from 'ox';
3
- import * as Account from '../Account.js';
4
- import type * as Client from '../Client.js';
3
+ import * as Account from '../../Account.js';
4
+ import type * as Client from '../../Client.js';
5
5
  type RequestOptions = Parameters<Client.Client['request']>[1];
6
6
  /**
7
7
  * Signs [EIP-712](https://eips.ethereum.org/EIPS/eip-712) typed data.
@@ -19,7 +19,7 @@ type RequestOptions = Parameters<Client.Client['request']>[1];
19
19
  * chain: mainnet,
20
20
  * transport: http(),
21
21
  * })
22
- * const signature = await Actions.signTypedData(client, {
22
+ * const signature = await Actions.typedData.sign(client, {
23
23
  * domain: { name: 'Ether Mail', version: '1' },
24
24
  * types: {
25
25
  * Mail: [{ name: 'contents', type: 'string' }],
@@ -29,8 +29,8 @@ type RequestOptions = Parameters<Client.Client['request']>[1];
29
29
  * })
30
30
  * ```
31
31
  */
32
- export declare function signTypedData<const typedData extends TypedData.TypedData | Record<string, unknown>, primaryType extends keyof typedData | 'EIP712Domain' = keyof typedData>(client: Client.Client, options: signTypedData.Options<typedData, primaryType>): Promise<signTypedData.ReturnType>;
33
- export declare namespace signTypedData {
32
+ export declare function sign<const typedData extends TypedData.TypedData | Record<string, unknown>, primaryType extends keyof typedData | 'EIP712Domain' = keyof typedData>(client: Client.Client, options: sign.Options<typedData, primaryType>): Promise<sign.ReturnType>;
33
+ export declare namespace sign {
34
34
  type Options<typedData extends TypedData.TypedData | Record<string, unknown> = TypedData.TypedData, primaryType extends keyof typedData | 'EIP712Domain' = keyof typedData> = TypedData.encode.Value<typedData, primaryType> & {
35
35
  /** Account (or address) to sign with. @default client.account */
36
36
  account?: Account.Account | Address.Address | undefined;
@@ -41,4 +41,4 @@ export declare namespace signTypedData {
41
41
  type ErrorType = Account.NotFoundError | Errors.GlobalErrorType;
42
42
  }
43
43
  export {};
44
- //# sourceMappingURL=signTypedData.d.ts.map
44
+ //# sourceMappingURL=sign.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sign.d.ts","sourceRoot":"","sources":["../../../../src/core/actions/typedData/sign.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAA;AAC9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,IAAI,CAAA;AAE9C,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAA;AAC3C,OAAO,KAAK,KAAK,MAAM,MAAM,iBAAiB,CAAA;AAE9C,KAAK,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,IAAI,CACxB,KAAK,CAAC,SAAS,SAAS,SAAS,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrE,WAAW,SAAS,MAAM,SAAS,GAAG,cAAc,GAAG,MAAM,SAAS,EAEtE,MAAM,EAAE,MAAM,CAAC,MAAM,EACrB,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,WAAW,CAAC,GAC5C,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAuB1B;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,KAAK,OAAO,CACV,SAAS,SAAS,SAAS,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7D,SAAS,CAAC,SAAS,EACrB,WAAW,SAAS,MAAM,SAAS,GAAG,cAAc,GAAG,MAAM,SAAS,IACpE,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,WAAW,CAAC,GAAG;QACnD,iEAAiE;QACjE,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAA;QACvD,qDAAqD;QACrD,cAAc,CAAC,EAAE,cAAc,GAAG,SAAS,CAAA;KAC5C,CAAA;IAED,KAAK,UAAU,GAAG,GAAG,CAAC,GAAG,CAAA;IAEzB,KAAK,SAAS,GAAG,OAAO,CAAC,aAAa,GAAG,MAAM,CAAC,eAAe,CAAA;CAChE"}
@@ -1,5 +1,5 @@
1
1
  import { TypedData } from 'ox';
2
- import * as Account from '../Account.js';
2
+ import * as Account from '../../Account.js';
3
3
  /**
4
4
  * Signs [EIP-712](https://eips.ethereum.org/EIPS/eip-712) typed data.
5
5
  *
@@ -16,7 +16,7 @@ import * as Account from '../Account.js';
16
16
  * chain: mainnet,
17
17
  * transport: http(),
18
18
  * })
19
- * const signature = await Actions.signTypedData(client, {
19
+ * const signature = await Actions.typedData.sign(client, {
20
20
  * domain: { name: 'Ether Mail', version: '1' },
21
21
  * types: {
22
22
  * Mail: [{ name: 'contents', type: 'string' }],
@@ -26,7 +26,7 @@ import * as Account from '../Account.js';
26
26
  * })
27
27
  * ```
28
28
  */
29
- export async function signTypedData(client, options) {
29
+ export async function sign(client, options) {
30
30
  const { account: account_ = client.account, requestOptions, ...value } = options;
31
31
  if (!account_)
32
32
  throw new Account.NotFoundError();
@@ -39,4 +39,4 @@ export async function signTypedData(client, options) {
39
39
  params: [account.address, TypedData.serialize(value)],
40
40
  }, { retryCount: 0, ...requestOptions });
41
41
  }
42
- //# sourceMappingURL=signTypedData.js.map
42
+ //# sourceMappingURL=sign.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sign.js","sourceRoot":"","sources":["../../../../src/core/actions/typedData/sign.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAA;AAG9B,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAA;AAK3C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAIxB,MAAqB,EACrB,OAA6C;IAE7C,MAAM,EACJ,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,cAAc,EACd,GAAG,KAAK,EACT,GAAG,OAAuB,CAAA;IAE3B,IAAI,CAAC,QAAQ;QAAE,MAAM,IAAI,OAAO,CAAC,aAAa,EAAE,CAAA;IAChD,MAAM,OAAO,GACX,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAA;IAElE,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAEvB,IAAI,OAAO,CAAC,IAAI,KAAK,OAAO;QAC1B,OAAO,OAAO,CAAC,aAAa,CAAC,KAA+B,CAAC,CAAA;IAE/D,OAAO,MAAM,CAAC,OAAO,CACnB;QACE,MAAM,EAAE,sBAAsB;QAC9B,MAAM,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;KACtD,EACD,EAAE,UAAU,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CACrC,CAAA;AACH,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { TypedData } from 'ox';
2
2
  import type { Errors } from 'ox';
3
- import type * as Client from '../Client.js';
4
- import { verifyHash } from './verifyHash.js';
3
+ import type * as Client from '../../Client.js';
4
+ import { verifyHash } from '../verifyHash.js';
5
5
  /**
6
6
  * Verifies that typed data was signed by the provided address, supporting
7
7
  * Smart Contract Accounts (ERC-1271/6492/8010) and Externally Owned Accounts.
@@ -15,7 +15,7 @@ import { verifyHash } from './verifyHash.js';
15
15
  * chain: mainnet,
16
16
  * transport: http(),
17
17
  * })
18
- * const valid = await Actions.verifyTypedData(client, {
18
+ * const valid = await Actions.typedData.verify(client, {
19
19
  * address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
20
20
  * domain: { name: 'Ether Mail', version: '1', chainId: 1 },
21
21
  * types: {
@@ -27,10 +27,10 @@ import { verifyHash } from './verifyHash.js';
27
27
  * })
28
28
  * ```
29
29
  */
30
- export declare function verifyTypedData<const typedData extends TypedData.TypedData | Record<string, unknown>, primaryType extends keyof typedData | 'EIP712Domain' = keyof typedData>(client: Client.Client, options: verifyTypedData.Options<typedData, primaryType>): Promise<verifyTypedData.ReturnType>;
31
- export declare namespace verifyTypedData {
30
+ export declare function verify<const typedData extends TypedData.TypedData | Record<string, unknown>, primaryType extends keyof typedData | 'EIP712Domain' = keyof typedData>(client: Client.Client, options: verify.Options<typedData, primaryType>): Promise<verify.ReturnType>;
31
+ export declare namespace verify {
32
32
  type Options<typedData extends TypedData.TypedData | Record<string, unknown> = TypedData.TypedData, primaryType extends keyof typedData | 'EIP712Domain' = keyof typedData> = TypedData.encode.Value<typedData, primaryType> & Omit<verifyHash.Options, 'hash'>;
33
33
  type ReturnType = boolean;
34
34
  type ErrorType = TypedData.getSignPayload.ErrorType | verifyHash.ErrorType | Errors.GlobalErrorType;
35
35
  }
36
- //# sourceMappingURL=verifyTypedData.d.ts.map
36
+ //# sourceMappingURL=verify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../../src/core/actions/typedData/verify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,IAAI,CAAA;AAEhC,OAAO,KAAK,KAAK,MAAM,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,MAAM,CAC1B,KAAK,CAAC,SAAS,SAAS,SAAS,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrE,WAAW,SAAS,MAAM,SAAS,GAAG,cAAc,GAAG,MAAM,SAAS,EAEtE,MAAM,EAAE,MAAM,CAAC,MAAM,EACrB,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,WAAW,CAAC,GAC9C,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAgC5B;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,KAAK,OAAO,CACV,SAAS,SAAS,SAAS,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7D,SAAS,CAAC,SAAS,EACrB,WAAW,SAAS,MAAM,SAAS,GAAG,cAAc,GAAG,MAAM,SAAS,IACpE,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,WAAW,CAAC,GAChD,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IAElC,KAAK,UAAU,GAAG,OAAO,CAAA;IAEzB,KAAK,SAAS,GACV,SAAS,CAAC,cAAc,CAAC,SAAS,GAClC,UAAU,CAAC,SAAS,GACpB,MAAM,CAAC,eAAe,CAAA;CAC3B"}
@@ -1,5 +1,5 @@
1
1
  import { TypedData } from 'ox';
2
- import { verifyHash } from './verifyHash.js';
2
+ import { verifyHash } from '../verifyHash.js';
3
3
  /**
4
4
  * Verifies that typed data was signed by the provided address, supporting
5
5
  * Smart Contract Accounts (ERC-1271/6492/8010) and Externally Owned Accounts.
@@ -13,7 +13,7 @@ import { verifyHash } from './verifyHash.js';
13
13
  * chain: mainnet,
14
14
  * transport: http(),
15
15
  * })
16
- * const valid = await Actions.verifyTypedData(client, {
16
+ * const valid = await Actions.typedData.verify(client, {
17
17
  * address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
18
18
  * domain: { name: 'Ether Mail', version: '1', chainId: 1 },
19
19
  * types: {
@@ -25,7 +25,7 @@ import { verifyHash } from './verifyHash.js';
25
25
  * })
26
26
  * ```
27
27
  */
28
- export async function verifyTypedData(client, options) {
28
+ export async function verify(client, options) {
29
29
  const { address, blockHash, blockNumber, blockTag, erc6492VerifierAddress, factory, factoryData, mode, multicallAddress, requestOptions, requireCanonical, signature, ...typedData } = options;
30
30
  return verifyHash(client, {
31
31
  address,
@@ -43,4 +43,4 @@ export async function verifyTypedData(client, options) {
43
43
  signature,
44
44
  });
45
45
  }
46
- //# sourceMappingURL=verifyTypedData.js.map
46
+ //# sourceMappingURL=verify.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify.js","sourceRoot":"","sources":["../../../../src/core/actions/typedData/verify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAA;AAI9B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAI1B,MAAqB,EACrB,OAA+C;IAE/C,MAAM,EACJ,OAAO,EACP,SAAS,EACT,WAAW,EACX,QAAQ,EACR,sBAAsB,EACtB,OAAO,EACP,WAAW,EACX,IAAI,EACJ,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,GAAG,SAAS,EACb,GAAG,OAAyB,CAAA;IAE7B,OAAO,UAAU,CAAC,MAAM,EAAE;QACxB,OAAO;QACP,SAAS;QACT,WAAW;QACX,QAAQ;QACR,sBAAsB;QACtB,OAAO;QACP,WAAW;QACX,IAAI,EAAE,SAAS,CAAC,cAAc,CAAC,SAAmC,CAAC;QACnE,IAAI;QACJ,gBAAgB;QAChB,cAAc;QACd,gBAAgB;QAChB,SAAS;KACY,CAAC,CAAA;AAC1B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { AbiParameters, Hex, PersonalMessage, TypedData } from 'ox';
2
2
  import { getEip712Domain } from '../../core/actions/contract/getEip712Domain.js';
3
- import { signTypedData as signTypedData_ } from '../../core/actions/signTypedData.js';
3
+ import { sign as signTypedData_ } from '../../core/actions/typedData/sign.js';
4
4
  /** Signs a personal message with ERC-7739 nested EIP-712. */
5
5
  export async function signMessage(client, options) {
6
6
  const { account, factory, factoryData, message, verifier } = options;
@@ -1 +1 @@
1
- {"version":3,"file":"erc7739.js","sourceRoot":"","sources":["../../../src/erc4337/internal/erc7739.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,IAAI,CAAA;AAKnE,OAAO,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAA;AAChF,OAAO,EAAE,aAAa,IAAI,cAAc,EAAE,MAAM,qCAAqC,CAAA;AASrF,6DAA6D;AAC7D,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B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AA;IAC1D,MAAM,YAAY,GAAG,SAAS,CAAC,UAAU,CAAC;QACxC,IAAI,EAAE,OAAO;QACb,WAAW;QACX,KAAK;KACN,CAAC,CAAA;IACF,MAAM,WAAW,GAAG,GAAG,CAAC,UAAU,CAChC,SAAS,CAAC,UAAU,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAC7C,CAAA;IAED,OAAO,aAAa,CAAC,YAAY,CAC/B,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC,EAClD,CAAC,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAC1E,CAAA;AACH,CAAC;AAED,SAAS,SAAS,CAAC,OAAgC;IACjD,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;IAC/D,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;AAC9B,CAAC"}
@@ -9,8 +9,8 @@
9
9
  * ```
10
10
  */
11
11
  export { Engine } from 'ox/node';
12
- /** KZG trusted setups for EIP-4844 blobs. Re-exports `ox/trusted-setups`. */
13
- export * from 'ox/trusted-setups';
12
+ /** File-system paths for KZG trusted setups. */
13
+ export { Paths } from 'ox/trusted-setups';
14
14
  /** Creates an IPC JSON-RPC transport (Node only). */
15
15
  export { ipc } from './transports/ipc.js';
16
16
  /** IPC JSON-RPC transport types. */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEhC,6EAA6E;AAC7E,cAAc,mBAAmB,CAAA;AAEjC,qDAAqD;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AAEzC,oCAAoC;AACpC,YAAY,EAAE,GAAG,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEhC,gDAAgD;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzC,qDAAqD;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AAEzC,oCAAoC;AACpC,YAAY,EAAE,GAAG,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA"}
@@ -9,8 +9,8 @@
9
9
  * ```
10
10
  */
11
11
  export { Engine } from 'ox/node';
12
- /** KZG trusted setups for EIP-4844 blobs. Re-exports `ox/trusted-setups`. */
13
- export * from 'ox/trusted-setups';
12
+ /** File-system paths for KZG trusted setups. */
13
+ export { Paths } from 'ox/trusted-setups';
14
14
  /** Creates an IPC JSON-RPC transport (Node only). */
15
15
  export { ipc } from './transports/ipc.js';
16
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEhC,6EAA6E;AAC7E,cAAc,mBAAmB,CAAA;AAEjC,qDAAqD;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEhC,gDAAgD;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzC,qDAAqD;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA"}
package/dist/version.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  /** @internal */
2
- export declare const version = "3.0.0-next.1";
2
+ export declare const version = "3.0.0-next.3";
3
3
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  /** @internal */
2
- export const version = '3.0.0-next.1';
2
+ export const version = '3.0.0-next.3';
3
3
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "viem",
3
3
  "description": "TypeScript Interface for Ethereum",
4
- "version": "3.0.0-next.1",
4
+ "version": "3.0.0-next.3",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -55,7 +55,7 @@
55
55
  },
56
56
  "dependencies": {
57
57
  "abitype": "1.3.0",
58
- "ox": "1.1.2"
58
+ "ox": "1.2.0"
59
59
  },
60
60
  "exports": {
61
61
  ".": {
@@ -20,12 +20,12 @@ import * as filter from '../filter/index.js'
20
20
  import * as event from '../event/index.js'
21
21
  import * as fee from '../fee/index.js'
22
22
  import { multicall } from '../multicall.js'
23
+ import * as siwe from '../siwe/index.js'
23
24
  import * as token from '../token/index.js'
24
25
  import * as transaction from '../transaction/index.js'
26
+ import * as typedData from '../typedData/index.js'
25
27
  import { verifyHash } from '../verifyHash.js'
26
28
  import { verifyMessage } from '../verifyMessage.js'
27
- import { verifySiweMessage } from '../verifySiweMessage.js'
28
- import { verifyTypedData } from '../verifyTypedData.js'
29
29
 
30
30
  /**
31
31
  * Bag of public actions bound to a {@link Client}. Pass to `Client.create`'s
@@ -111,6 +111,9 @@ export function publicActions() {
111
111
  getHistory: (options) => fee.getHistory(client, options),
112
112
  },
113
113
  multicall: (options) => multicall(client, options),
114
+ siwe: {
115
+ verify: (options) => siwe.verify(client, options),
116
+ },
114
117
  token: {
115
118
  getAllowance: Object.assign(
116
119
  (options: never) => token.getAllowance(client, options),
@@ -141,10 +144,11 @@ export function publicActions() {
141
144
  waitForReceipt: (options) => transaction.waitForReceipt(client, options),
142
145
  watchPending: (options) => transaction.watchPending(client, options),
143
146
  },
147
+ typedData: {
148
+ verify: (options) => typedData.verify(client, options),
149
+ },
144
150
  verifyHash: (options) => verifyHash(client, options),
145
151
  verifyMessage: (options) => verifyMessage(client, options),
146
- verifySiweMessage: (options) => verifySiweMessage(client, options),
147
- verifyTypedData: (options) => verifyTypedData(client, options),
148
152
  })
149
153
  }
150
154
 
@@ -1565,58 +1569,61 @@ export declare namespace publicActions {
1565
1569
  verifyMessage: (
1566
1570
  options: verifyMessage.Options,
1567
1571
  ) => Promise<verifyMessage.ReturnType>
1568
- /**
1569
- * Verifies that an EIP-4361 formatted message was signed, supporting
1570
- * Smart Contract Accounts (ERC-1271/6492/8010) and Externally Owned
1571
- * Accounts.
1572
- *
1573
- * @example
1574
- * ```ts
1575
- * import { Client, http, publicActions } from 'viem'
1576
- * import { mainnet } from 'viem/chains'
1577
- *
1578
- * const client = Client.create({
1579
- * chain: mainnet,
1580
- * transport: http(),
1581
- * }).extend(publicActions())
1582
- * const valid = await client.verifySiweMessage({
1583
- * message: 'example.com wants you to sign in with your Ethereum account…',
1584
- * signature: '0x…',
1585
- * })
1586
- * ```
1587
- */
1588
- verifySiweMessage: (
1589
- options: verifySiweMessage.Options,
1590
- ) => Promise<verifySiweMessage.ReturnType>
1591
- /**
1592
- * Verifies that typed data was signed by the provided address, supporting
1593
- * Smart Contract Accounts (ERC-1271/6492/8010) and Externally Owned
1594
- * Accounts.
1595
- *
1596
- * @example
1597
- * ```ts
1598
- * import { Client, http, publicActions } from 'viem'
1599
- * import { mainnet } from 'viem/chains'
1600
- *
1601
- * const client = Client.create({
1602
- * chain: mainnet,
1603
- * transport: http(),
1604
- * }).extend(publicActions())
1605
- * const valid = await client.verifyTypedData({
1606
- * address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
1607
- * domain: { name: 'Ether Mail', version: '1', chainId: 1 },
1608
- * types: { Mail: [{ name: 'contents', type: 'string' }] },
1609
- * primaryType: 'Mail',
1610
- * message: { contents: 'hello world' },
1611
- * signature: '0x…',
1612
- * })
1613
- * ```
1614
- */
1615
- verifyTypedData: <
1616
- const typedData extends TypedData.TypedData | Record<string, unknown>,
1617
- primaryType extends keyof typedData | 'EIP712Domain' = keyof typedData,
1618
- >(
1619
- options: verifyTypedData.Options<typedData, primaryType>,
1620
- ) => Promise<verifyTypedData.ReturnType>
1572
+ siwe: {
1573
+ /**
1574
+ * Verifies that an EIP-4361 formatted message was signed, supporting
1575
+ * Smart Contract Accounts (ERC-1271/6492/8010) and Externally Owned
1576
+ * Accounts.
1577
+ *
1578
+ * @example
1579
+ * ```ts
1580
+ * import { Client, http, publicActions } from 'viem'
1581
+ * import { mainnet } from 'viem/chains'
1582
+ *
1583
+ * const client = Client.create({
1584
+ * chain: mainnet,
1585
+ * transport: http(),
1586
+ * }).extend(publicActions())
1587
+ * const valid = await client.siwe.verify({
1588
+ * message: 'example.com wants you to sign in with your Ethereum account…',
1589
+ * signature: '0x…',
1590
+ * })
1591
+ * ```
1592
+ */
1593
+ verify: (options: siwe.verify.Options) => Promise<siwe.verify.ReturnType>
1594
+ }
1595
+ typedData: {
1596
+ /**
1597
+ * Verifies that typed data was signed by the provided address, supporting
1598
+ * Smart Contract Accounts (ERC-1271/6492/8010) and Externally Owned
1599
+ * Accounts.
1600
+ *
1601
+ * @example
1602
+ * ```ts
1603
+ * import { Client, http, publicActions } from 'viem'
1604
+ * import { mainnet } from 'viem/chains'
1605
+ *
1606
+ * const client = Client.create({
1607
+ * chain: mainnet,
1608
+ * transport: http(),
1609
+ * }).extend(publicActions())
1610
+ * const valid = await client.typedData.verify({
1611
+ * address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
1612
+ * domain: { name: 'Ether Mail', version: '1', chainId: 1 },
1613
+ * types: { Mail: [{ name: 'contents', type: 'string' }] },
1614
+ * primaryType: 'Mail',
1615
+ * message: { contents: 'hello world' },
1616
+ * signature: '0x…',
1617
+ * })
1618
+ * ```
1619
+ */
1620
+ verify: <
1621
+ const definition extends TypedData.TypedData | Record<string, unknown>,
1622
+ primaryType extends keyof definition | 'EIP712Domain' =
1623
+ keyof definition,
1624
+ >(
1625
+ options: typedData.verify.Options<definition, primaryType>,
1626
+ ) => Promise<typedData.verify.ReturnType>
1627
+ }
1621
1628
  }
1622
1629
  }
@@ -13,9 +13,9 @@ import type {
13
13
  import * as chains from '../chains/index.js'
14
14
  import * as contract from '../contract/index.js'
15
15
  import { signMessage } from '../signMessage.js'
16
- import { signTypedData } from '../signTypedData.js'
17
16
  import * as token from '../token/index.js'
18
17
  import * as transaction from '../transaction/index.js'
18
+ import * as typedData from '../typedData/index.js'
19
19
  import * as wallet from '../wallet/index.js'
20
20
 
21
21
  /**
@@ -90,6 +90,9 @@ export function walletActions() {
90
90
  sendSync: (options) => transaction.sendSync(client, options),
91
91
  sign: (options) => transaction.sign(client, options),
92
92
  },
93
+ typedData: {
94
+ sign: (options) => typedData.sign(client, options),
95
+ },
93
96
  wallet: {
94
97
  connect: (options) => wallet.connect(client, options),
95
98
  disconnect: () => wallet.disconnect(client),
@@ -113,7 +116,6 @@ export function walletActions() {
113
116
  },
114
117
  signMessage: (options) => signMessage(client, options),
115
118
  signTransaction: (options) => transaction.sign(client, options),
116
- signTypedData: (options) => signTypedData(client, options),
117
119
  })
118
120
  }
119
121
 
@@ -932,32 +934,35 @@ export declare namespace walletActions {
932
934
  signTransaction: (
933
935
  options: transaction.sign.Options<chain>,
934
936
  ) => Promise<transaction.sign.ReturnType>
935
- /**
936
- * Signs [EIP-712](https://eips.ethereum.org/EIPS/eip-712) typed data.
937
- *
938
- * @example
939
- * ```ts
940
- * import { Account, Client, http, walletActions } from 'viem'
941
- * import { mainnet } from 'viem/chains'
942
- *
943
- * const client = Client.create({
944
- * account: Account.fromPrivateKey('0x…'),
945
- * chain: mainnet,
946
- * transport: http(),
947
- * }).extend(walletActions())
948
- * const signature = await client.signTypedData({
949
- * domain: { name: 'Ether Mail', version: '1' },
950
- * types: { Mail: [{ name: 'contents', type: 'string' }] },
951
- * primaryType: 'Mail',
952
- * message: { contents: 'hello world' },
953
- * })
954
- * ```
955
- */
956
- signTypedData: <
957
- const typedData extends TypedData | Record<string, unknown>,
958
- primaryType extends keyof typedData | 'EIP712Domain' = keyof typedData,
959
- >(
960
- options: signTypedData.Options<typedData, primaryType>,
961
- ) => Promise<signTypedData.ReturnType>
937
+ typedData: {
938
+ /**
939
+ * Signs [EIP-712](https://eips.ethereum.org/EIPS/eip-712) typed data.
940
+ *
941
+ * @example
942
+ * ```ts
943
+ * import { Account, Client, http, walletActions } from 'viem'
944
+ * import { mainnet } from 'viem/chains'
945
+ *
946
+ * const client = Client.create({
947
+ * account: Account.fromPrivateKey('0x…'),
948
+ * chain: mainnet,
949
+ * transport: http(),
950
+ * }).extend(walletActions())
951
+ * const signature = await client.typedData.sign({
952
+ * domain: { name: 'Ether Mail', version: '1' },
953
+ * types: { Mail: [{ name: 'contents', type: 'string' }] },
954
+ * primaryType: 'Mail',
955
+ * message: { contents: 'hello world' },
956
+ * })
957
+ * ```
958
+ */
959
+ sign: <
960
+ const definition extends TypedData | Record<string, unknown>,
961
+ primaryType extends keyof definition | 'EIP712Domain' =
962
+ keyof definition,
963
+ >(
964
+ options: typedData.sign.Options<definition, primaryType>,
965
+ ) => Promise<typedData.sign.ReturnType>
966
+ }
962
967
  }
963
968
  }
@@ -18,17 +18,16 @@ export * as filter from './filter/index.js'
18
18
  /** Resolves Client-attached action overrides, falling back to standalone actions. */
19
19
  export { getAction } from './getAction.js'
20
20
  export * as node from './node/index.js'
21
+ export * as siwe from './siwe/index.js'
21
22
  export * as state from './state/index.js'
22
23
  export * as token from './token/index.js'
23
24
  export * as transaction from './transaction/index.js'
25
+ export * as typedData from './typedData/index.js'
24
26
  export * as txpool from './txpool/index.js'
25
27
  export * as wallet from './wallet/index.js'
26
28
 
27
29
  export { multicall } from './multicall.js'
28
30
  export { signMessage } from './signMessage.js'
29
31
  export { sign as signTransaction } from './transaction/sign.js'
30
- export { signTypedData } from './signTypedData.js'
31
32
  export { verifyHash } from './verifyHash.js'
32
33
  export { verifyMessage } from './verifyMessage.js'
33
- export { verifySiweMessage } from './verifySiweMessage.js'
34
- export { verifyTypedData } from './verifyTypedData.js'
@@ -0,0 +1 @@
1
+ export { verify } from './verify.js'
@@ -1,8 +1,8 @@
1
1
  import { Hex, PersonalMessage, Siwe } from 'ox'
2
2
  import type { Address, Errors } from 'ox'
3
3
 
4
- import type * as Client from '../Client.js'
5
- import { verifyHash } from './verifyHash.js'
4
+ import type * as Client from '../../Client.js'
5
+ import { verifyHash } from '../verifyHash.js'
6
6
 
7
7
  /**
8
8
  * Verifies that an [EIP-4361](https://eips.ethereum.org/EIPS/eip-4361)
@@ -18,16 +18,16 @@ import { verifyHash } from './verifyHash.js'
18
18
  * chain: mainnet,
19
19
  * transport: http(),
20
20
  * })
21
- * const valid = await Actions.verifySiweMessage(client, {
21
+ * const valid = await Actions.siwe.verify(client, {
22
22
  * message: 'example.com wants you to sign in with your Ethereum account…',
23
23
  * signature: '0x…',
24
24
  * })
25
25
  * ```
26
26
  */
27
- export async function verifySiweMessage(
27
+ export async function verify(
28
28
  client: Client.Client,
29
- options: verifySiweMessage.Options,
30
- ): Promise<verifySiweMessage.ReturnType> {
29
+ options: verify.Options,
30
+ ): Promise<verify.ReturnType> {
31
31
  const {
32
32
  address,
33
33
  domain,
@@ -58,7 +58,7 @@ export async function verifySiweMessage(
58
58
  } as verifyHash.Options)
59
59
  }
60
60
 
61
- export declare namespace verifySiweMessage {
61
+ export declare namespace verify {
62
62
  type Options = Omit<verifyHash.Options, 'address' | 'hash'> & {
63
63
  /** Ethereum address to check against (defaults to the address in the message). */
64
64
  address?: Address.Address | undefined
@@ -0,0 +1,2 @@
1
+ export { sign } from './sign.js'
2
+ export { verify } from './verify.js'
@@ -1,8 +1,8 @@
1
1
  import { TypedData } from 'ox'
2
2
  import type { Address, Errors, Hex } from 'ox'
3
3
 
4
- import * as Account from '../Account.js'
5
- import type * as Client from '../Client.js'
4
+ import * as Account from '../../Account.js'
5
+ import type * as Client from '../../Client.js'
6
6
 
7
7
  type RequestOptions = Parameters<Client.Client['request']>[1]
8
8
 
@@ -22,7 +22,7 @@ type RequestOptions = Parameters<Client.Client['request']>[1]
22
22
  * chain: mainnet,
23
23
  * transport: http(),
24
24
  * })
25
- * const signature = await Actions.signTypedData(client, {
25
+ * const signature = await Actions.typedData.sign(client, {
26
26
  * domain: { name: 'Ether Mail', version: '1' },
27
27
  * types: {
28
28
  * Mail: [{ name: 'contents', type: 'string' }],
@@ -32,18 +32,18 @@ type RequestOptions = Parameters<Client.Client['request']>[1]
32
32
  * })
33
33
  * ```
34
34
  */
35
- export async function signTypedData<
35
+ export async function sign<
36
36
  const typedData extends TypedData.TypedData | Record<string, unknown>,
37
37
  primaryType extends keyof typedData | 'EIP712Domain' = keyof typedData,
38
38
  >(
39
39
  client: Client.Client,
40
- options: signTypedData.Options<typedData, primaryType>,
41
- ): Promise<signTypedData.ReturnType> {
40
+ options: sign.Options<typedData, primaryType>,
41
+ ): Promise<sign.ReturnType> {
42
42
  const {
43
43
  account: account_ = client.account,
44
44
  requestOptions,
45
45
  ...value
46
- } = options as signTypedData.Options
46
+ } = options as sign.Options
47
47
 
48
48
  if (!account_) throw new Account.NotFoundError()
49
49
  const account =
@@ -63,7 +63,7 @@ export async function signTypedData<
63
63
  )
64
64
  }
65
65
 
66
- export declare namespace signTypedData {
66
+ export declare namespace sign {
67
67
  type Options<
68
68
  typedData extends TypedData.TypedData | Record<string, unknown> =
69
69
  TypedData.TypedData,