@openfort/cli 0.1.3 → 0.1.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.
Files changed (2) hide show
  1. package/dist/cli.js +32 -37
  2. package/package.json +3 -2
package/dist/cli.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-QJGHQ7ID.js";
6
6
 
7
7
  // src/cli.ts
8
- import { Cli as Cli12, z as z14, Errors as Errors4 } from "incur";
8
+ import { Cli as Cli13, z as z15, Errors as Errors4 } from "incur";
9
9
  import Openfort from "@openfort/openfort-node";
10
10
 
11
11
  // src/vars.ts
@@ -397,35 +397,6 @@ evm.command("get", {
397
397
  });
398
398
  }
399
399
  });
400
- evm.command("sign", {
401
- description: "Sign data with an EVM backend wallet.",
402
- args: z3.object({
403
- id: z3.string().describe("Account ID (acc_...)")
404
- }),
405
- options: z3.object({
406
- data: z3.string().describe("Data to sign (hex-encoded)")
407
- }),
408
- alias: { data: "d" },
409
- output: z3.object({
410
- account: z3.string(),
411
- signature: z3.string()
412
- }),
413
- examples: [
414
- {
415
- args: { id: "acc_abc123" },
416
- options: { data: "0x1234abcd" },
417
- description: "Sign a message hash with a backend wallet"
418
- }
419
- ],
420
- async run(c) {
421
- requireWalletCredentials();
422
- const signature = await c.var.openfort.accounts.evm.backend.sign({
423
- id: c.args.id,
424
- data: c.options.data
425
- });
426
- return c.ok({ account: c.args.id, signature });
427
- }
428
- });
429
400
  evm.command("delete", {
430
401
  description: "Delete an EVM backend wallet.",
431
402
  args: z3.object({
@@ -2835,16 +2806,40 @@ ${publicKey}
2835
2806
  }
2836
2807
  });
2837
2808
 
2809
+ // src/commands/message.ts
2810
+ import { Cli as Cli12, z as z14 } from "incur";
2811
+ import { keccak256, toBytes } from "viem";
2812
+ var message = Cli12.create("message", {
2813
+ description: "Message utilities.",
2814
+ vars: varsSchema
2815
+ });
2816
+ message.command("hash", {
2817
+ description: "Hash a message using keccak256.",
2818
+ args: z14.object({
2819
+ message: z14.string().describe("The message to hash")
2820
+ }),
2821
+ examples: [
2822
+ { args: { message: "Hello World" }, description: "Hash a message" }
2823
+ ],
2824
+ output: z14.object({
2825
+ hash: z14.string()
2826
+ }),
2827
+ async run(c) {
2828
+ const hash = keccak256(toBytes(c.args.message));
2829
+ return c.ok({ hash });
2830
+ }
2831
+ });
2832
+
2838
2833
  // src/cli.ts
2839
- var cli = Cli12.create("openfort", {
2834
+ var cli = Cli13.create("openfort", {
2840
2835
  version: "0.1.0",
2841
2836
  description: "Openfort CLI \u2014 manage wallets, policies, and transactions. If you are LLM read this doc first https://www.openfort.io/docs/overview/building-with-cli",
2842
2837
  vars: varsSchema,
2843
- env: z14.object({
2844
- OPENFORT_API_KEY: z14.string().optional().describe("Openfort secret API key (sk_test_... or sk_live_...)"),
2845
- OPENFORT_WALLET_SECRET: z14.string().optional().describe("Wallet encryption secret"),
2846
- OPENFORT_PUBLISHABLE_KEY: z14.string().optional().describe("Publishable key for client-side ops"),
2847
- OPENFORT_BASE_URL: z14.string().optional().describe("Custom API base URL")
2838
+ env: z15.object({
2839
+ OPENFORT_API_KEY: z15.string().optional().describe("Openfort secret API key (sk_test_... or sk_live_...)"),
2840
+ OPENFORT_WALLET_SECRET: z15.string().optional().describe("Wallet encryption secret"),
2841
+ OPENFORT_PUBLISHABLE_KEY: z15.string().optional().describe("Publishable key for client-side ops"),
2842
+ OPENFORT_BASE_URL: z15.string().optional().describe("Custom API base URL")
2848
2843
  }),
2849
2844
  sync: {
2850
2845
  depth: 2,
@@ -2880,7 +2875,7 @@ cli.use(async (c, next) => {
2880
2875
  }));
2881
2876
  await next();
2882
2877
  });
2883
- cli.command(accounts).command(contracts).command(paymasters).command(policies).command(shield).command(sponsorship).command(sessions).command(subscriptions).command(transactions).command(users).command(walletKeys);
2878
+ cli.command(accounts).command(contracts).command(paymasters).command(policies).command(shield).command(sponsorship).command(sessions).command(subscriptions).command(transactions).command(users).command(walletKeys).command(message);
2884
2879
  var cli_default = cli;
2885
2880
  export {
2886
2881
  cli_default as default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfort/cli",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Openfort CLI — manage wallets, policies, and transactions from the terminal.",
5
5
  "author": "Openfort (https://www.openfort.io)",
6
6
  "bugs": "https://github.com/openfort-xyz/cli/issues",
@@ -17,7 +17,8 @@
17
17
  "main": "./dist/cli.js",
18
18
  "dependencies": {
19
19
  "@openfort/openfort-node": "^0.10.2",
20
- "incur": "^0.3.2"
20
+ "incur": "^0.3.2",
21
+ "viem": "^2.47.2"
21
22
  },
22
23
  "devDependencies": {
23
24
  "@changesets/changelog-github": "^0.5.1",