@mentaproject/core 0.6.2 → 0.6.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mentaproject/core",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
4
4
  "description": "Core library for menta packages, it includes all basic evm instances like Account, Transactions, Blocks etc...",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,4 +1,9 @@
1
+ import {
2
+ PasskeyValidatorContractVersion,
3
+ toPasskeyValidator,
4
+ } from "@zerodev/passkey-validator";
1
5
  import { MentaAccountParams } from "../types";
6
+ import { entryPoint07Address } from "../account-abstraction";
2
7
  import { toKernelSmartAccount } from "permissionless/accounts";
3
8
  import { createSmartAccountClient } from "permissionless";
4
9
  import { erc7579Actions } from "permissionless/actions/erc7579";
@@ -9,22 +14,19 @@ export async function createMentaAccount<TChain extends Chain | undefined>(
9
14
  client: Client<Transport, TChain, Account | undefined>,
10
15
  params: MentaAccountParams,
11
16
  ) {
12
- // Get the WebAuthnAccount from the signer
13
- // The signer must have a toWebAuthnAccount() method that returns
14
- // a viem-compatible WebAuthnAccount
15
- if (!("toWebAuthnAccount" in params.signer)) {
16
- throw new Error(
17
- "Signer must have a toWebAuthnAccount() method. " +
18
- "Make sure you're using @mentaproject/signer-react-native >= 0.0.17"
19
- );
20
- }
21
-
22
- const webAuthnAccount = (params.signer as any).toWebAuthnAccount();
17
+ const validator = await toPasskeyValidator(client as any, {
18
+ webAuthnKey: params.signer,
19
+ entryPoint: {
20
+ address: entryPoint07Address,
21
+ version: "0.7",
22
+ },
23
+ kernelVersion: "0.3.3",
24
+ validatorContractVersion: PasskeyValidatorContractVersion.V0_0_3_PATCHED,
25
+ });
23
26
 
24
27
  const kernel = await toKernelSmartAccount({
25
- owners: [webAuthnAccount],
28
+ owners: [validator],
26
29
  client: client as any,
27
- version: "0.3.3",
28
30
  });
29
31
 
30
32
  // Create a routed transport that sends bundler methods to the bundler