@mentaproject/client 0.1.34 → 0.1.36

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,8 +1,8 @@
1
1
  {
2
2
  "name": "@mentaproject/client",
3
- "version": "0.1.34",
3
+ "version": "0.1.36",
4
4
  "description": "High level EVM library used into the Menta App to facilitate Blockchain interactions. ",
5
- "main": "dist/index.js",
5
+ "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
8
8
  "sideEffects": false,
@@ -11,42 +11,42 @@
11
11
  ".": {
12
12
  "types": "./dist/index.d.ts",
13
13
  "import": "./dist/index.mjs",
14
- "require": "./dist/index.js"
14
+ "require": "./dist/index.cjs"
15
15
  },
16
16
  "./types": {
17
17
  "types": "./dist/types/index.d.ts",
18
18
  "import": "./dist/types/index.mjs",
19
- "require": "./dist/types/index.js"
19
+ "require": "./dist/types/index.cjs"
20
20
  },
21
21
  "./package.json": "./package.json"
22
22
  },
23
23
  "scripts": {
24
24
  "test:file": "tsx test.ts",
25
25
  "test": "jest -i",
26
- "build": "tsc --project tsconfig.json",
27
- "patch": "npm version patch && npm run build && npm publish --access public",
28
- "minor": "npm version minor && npm run build && npm publish --access public",
29
- "major": "npm version major && npm run build && npm publish --access public"
26
+ "build": "tsup && tsc --emitDeclarationOnly",
27
+ "build:fast": "tsup",
28
+ "preversion": "npm whoami && npm run build",
29
+ "postversion": "npm publish --access public && git push --follow-tags || (git tag -d $(git describe --tags --abbrev=0) && git reset --hard HEAD~1 && exit 1)",
30
+ "patch": "npm version patch",
31
+ "minor": "npm version minor",
32
+ "major": "npm version major"
30
33
  },
31
34
  "author": "@mentaproject",
32
35
  "license": "ISC",
33
36
  "dependencies": {
34
37
  "@mentaproject/contracts": "^0.0.11",
35
- "@mentaproject/core": "^0.6.3",
38
+ "@mentaproject/core": "^0.7.3",
36
39
  "@modelcontextprotocol/sdk": "^1.13.0",
37
40
  "@shazow/whatsabi": "^0.21.1"
38
41
  },
39
42
  "devDependencies": {
40
- "@rollup/plugin-commonjs": "^28.0.3",
41
- "@rollup/plugin-node-resolve": "^16.0.1",
42
- "@rollup/plugin-typescript": "^12.1.2",
43
43
  "@types/jest": "^30.0.0",
44
44
  "@types/node": "^22.15.29",
45
45
  "jest": "^30.0.2",
46
46
  "jest-mock-extended": "^4.0.0",
47
- "rollup": "^4.40.1",
48
47
  "ts-jest": "^29.4.0",
49
48
  "tslib": "^2.8.1",
49
+ "tsup": "^8.5.1",
50
50
  "tsx": "^4.19.4",
51
51
  "typescript": "^5.8.3"
52
52
  },
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import type { MentaAccountClient } from "@mentaproject/core/types";
5
5
  import { createMentaAccount } from "@mentaproject/core/clients";
6
+ import { createClient } from "@mentaproject/core";
6
7
 
7
8
  import { BlockManager } from "../managers/BlockManager";
8
9
  import { TransactionManager } from "../managers/TransactionManager";
@@ -15,7 +16,6 @@ import {
15
16
  MentaClientConfig,
16
17
  } from "../types/MentaClient";
17
18
  import { withCache } from "../utils/withCache";
18
- import { createClient } from "@mentaproject/core";
19
19
  import { Account } from "./Account";
20
20
 
21
21
  /**
@@ -150,10 +150,11 @@ export class MentaClient {
150
150
  coreClient = withCache(coreClient, this.params.cache);
151
151
  }
152
152
 
153
- this._rpc = await createMentaAccount(coreClient, {
154
- signer: this.params.signer,
153
+ this._rpc = await createMentaAccount(coreClient as any, {
155
154
  bundlerTransport: this.params.bundlerTransport,
156
155
  publicTransport: this.params.transport,
156
+ signer: this.params.signer,
157
+ validatorAddress: this.params.validatorAddress,
157
158
  });
158
159
 
159
160
  this._account = this.accounts.get(this.rpc.account.address);
@@ -1,14 +1,11 @@
1
1
  /**
2
2
  * @module MentaClientTypes
3
3
  */
4
- import {
5
- CoreClientConfig,
6
- PasskeySigner,
7
- Transport,
8
- } from "@mentaproject/core/types";
4
+ import { Address, CoreClientConfig, Transport } from "@mentaproject/core/types";
9
5
  import { ICache } from "./Cache";
10
6
  import { watchBlockNumber, watchBlocks } from "@mentaproject/core/actions";
11
7
  import { IPersistenceAdapter } from "./PersistenceAdapter";
8
+ import { WebAuthnAccount } from "@mentaproject/core/account-abstraction";
12
9
 
13
10
  /**
14
11
  * Configuration for the client's cache.
@@ -46,7 +43,11 @@ export interface MentaClientConfig extends CoreClientConfig {
46
43
  /**
47
44
  * Passkey compatible signer used for signing user operations
48
45
  */
49
- signer: PasskeySigner;
46
+ signer: WebAuthnAccount;
47
+ /**
48
+ * Validator address used for userOperations
49
+ */
50
+ validatorAddress: Address;
50
51
  }
51
52
 
52
53
  /**
package/tsup.config.ts ADDED
@@ -0,0 +1,18 @@
1
+ import { defineConfig } from "tsup";
2
+
3
+ export default defineConfig({
4
+ entry: {
5
+ index: "src/index.ts",
6
+ "types/index": "src/types/index.ts",
7
+ },
8
+ format: ["cjs", "esm"],
9
+ dts: false,
10
+ sourcemap: true,
11
+ clean: false,
12
+ external: [
13
+ "@mentaproject/contracts",
14
+ "@mentaproject/core",
15
+ "@modelcontextprotocol/sdk",
16
+ "@shazow/whatsabi",
17
+ ],
18
+ });