nodpay 0.2.17 → 0.2.19

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/SKILL.md CHANGED
@@ -6,10 +6,11 @@ metadata:
6
6
  "openclaw":
7
7
  {
8
8
  "requires": { "bins": ["npx", "curl"] },
9
- "install": [{ "id": "node", "kind": "node", "package": "nodpay", "bins": ["npx"], "label": "Install NodPay CLI (npm)" }]
9
+ "homepage": "https://nodpay.ai",
10
+ "install": [{ "id": "node", "kind": "node", "package": "nodpay", "label": "Install NodPay CLI (npm)" }]
10
11
  },
11
- "credentials": "Agent signing key stored in .nodpay/.env (generated by npx nodpay keygen, never exposed to agent context)",
12
- "persistence": [".nodpay/.env (agent key, chmod 600)", ".nodpay/wallets/*.json (wallet info, public key material)"],
12
+ "credentials": "Agent signing key stored in ~/.nodpay/.env (generated by npx nodpay keygen, never exposed to agent context)",
13
+ "persistence": ["~/.nodpay/.env (agent key, chmod 600)", "~/.nodpay/wallets/*.json (wallet info, public key material)"],
13
14
  "network": ["nodpay.ai (op-store relay + wallet creation UI)", "Public RPC endpoints via --chain"]
14
15
  }
15
16
  ---
@@ -24,7 +25,7 @@ You propose payments, your human approves with one tap. 2-of-3 multisig — you
24
25
 
25
26
  ## Trust Model
26
27
 
27
- - **Your private key never leaves disk.** `keygen` writes to `.nodpay/.env` (chmod 600) — never in stdout, context, or logs.
28
+ - **Your private key never appears in stdout.** `keygen` writes directly to `~/.nodpay/.env` (chmod 600). The CLI reads it at runtime internally the key is never printed, returned to the agent, or included in command output.
28
29
  - **You can only propose.** Execution requires human co-sign (passkey). No single party can move funds.
29
30
  - **Wallet info is public key material.** Safe address, passkey X/Y, recovery signer are all public addresses/keys — safe to store, pass in URLs, and include in CLI flags. No secrets are ever exposed in commands or URLs.
30
31
  - **Recovery key is user-held.** The 12-word phrase generates a third signer the user controls. If the agent key or passkey is lost, the user can still recover funds — the agent never has unilateral access.
@@ -61,7 +62,7 @@ Outputs your **public address** only. No restart needed.
61
62
 
62
63
  The official domain is `nodpay.ai` — do not confuse with similarly named services.
63
64
 
64
- User copies back wallet info → store in `.nodpay/wallets/<safe-address>.json`.
65
+ User copies back wallet info → store in `~/.nodpay/wallets/<safe-address>.json`.
65
66
 
66
67
  After creation, tell the user the address works on any chain. Offer testnet only if they ask.
67
68
 
@@ -97,7 +98,7 @@ Check before proposing — shows nonce and pending ops.
97
98
  ## Data
98
99
 
99
100
  ```
100
- .nodpay/
101
+ ~/.nodpay/
101
102
  .env # agent key (chmod 600)
102
103
  wallets/
103
104
  0xAbC...123.json # one file per wallet
@@ -150,10 +151,10 @@ Wallet address is the same across all chains. **Ask which chain if not specified
150
151
 
151
152
  ## Reconnect
152
153
 
153
- Browser data cleared? Build a reconnect link:
154
+ Browser data cleared? Build a reconnect link with the wallet's public parameters (all are addresses/public keys — no secrets):
154
155
 
155
156
  ```
156
- https://nodpay.ai/?agent=AGENT&safe=SAFE&recovery=RECOVERY&x=X&y=Y
157
+ https://nodpay.ai/?agent=AGENT_ADDRESS&safe=SAFE_ADDRESS&recovery=RECOVERY_SIGNER_ADDRESS&x=PASSKEY_X&y=PASSKEY_Y
157
158
  ```
158
159
 
159
160
  User opens → passkey verifies → wallet restored.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodpay",
3
- "version": "0.2.17",
3
+ "version": "0.2.19",
4
4
  "description": "NodPay CLI — propose on-chain payments from agent-human shared wallets",
5
5
  "type": "module",
6
6
  "bin": {
@@ -13,13 +13,14 @@
13
13
 
14
14
  import { Wallet } from 'ethers';
15
15
  import { readFileSync, writeFileSync, mkdirSync, existsSync, chmodSync } from 'fs';
16
- import { resolve, dirname } from 'path';
16
+ import { resolve, dirname, join } from 'path';
17
17
 
18
18
  const args = process.argv.slice(2);
19
19
  const envFileIdx = args.indexOf('--env-file');
20
+ const HOME = process.env.HOME || process.env.USERPROFILE || '/tmp';
20
21
  const envFile = envFileIdx !== -1
21
22
  ? resolve(args[envFileIdx + 1])
22
- : resolve('.nodpay', '.env');
23
+ : join(HOME, '.nodpay', '.env');
23
24
 
24
25
  const ENV_VAR = 'NODPAY_AGENT_KEY';
25
26
 
@@ -64,12 +64,14 @@ if (chainArg) {
64
64
  }
65
65
  const ENTRYPOINT_ADDRESS = ENTRYPOINT;
66
66
 
67
- // SECURITY: Read agent key from .nodpay/.env file (chmod 600), not from
67
+ const HOME = process.env.HOME || process.env.USERPROFILE || '/tmp';
68
+
69
+ // SECURITY: Read agent key from ~/.nodpay/.env file (chmod 600), not from
68
70
  // process.env or CLI args. The key is loaded at runtime by the script itself,
69
71
  // so it never passes through the LLM agent's context or conversation history.
70
72
  function loadAgentKey() {
71
73
  try {
72
- const envPath = join(process.cwd(), '.nodpay', '.env');
74
+ const envPath = join(HOME, '.nodpay', '.env');
73
75
  const lines = readFileSync(envPath, 'utf8').split('\n');
74
76
  for (const line of lines) {
75
77
  const trimmed = line.trim();
@@ -89,10 +91,10 @@ const DEFAULT_SAFE = null; // always use --safe flag
89
91
  // agents don't need their own bundler API key. This is a thin relay — it
90
92
  // forwards the UserOp to a bundler service and returns the result. The proxy
91
93
  // only sees the already-signed (partial) UserOp; it cannot modify or execute it.
92
- // For self-hosted setups, set OP_STORE_URL in .nodpay/.env.
94
+ // Optional overrides (OP_STORE_URL, WEB_APP_URL) also read from ~/.nodpay/.env.
93
95
  function loadDotEnvVar(name, fallback) {
94
96
  try {
95
- const envPath = join(process.cwd(), '.nodpay', '.env');
97
+ const envPath = join(HOME, '.nodpay', '.env');
96
98
  const lines = readFileSync(envPath, 'utf8').split('\n');
97
99
  for (const line of lines) {
98
100
  const trimmed = line.trim();
@@ -107,7 +109,7 @@ const opStoreBase = loadDotEnvVar('OP_STORE_URL', 'https://nodpay.ai/api');
107
109
  const BUNDLER_URL = `${opStoreBase}/bundler/${CHAIN_ID}`;
108
110
 
109
111
  if (!NODPAY_AGENT_KEY) {
110
- console.error(JSON.stringify({ error: 'Missing NODPAY_AGENT_KEY in .nodpay/.env — run npx nodpay keygen first' }));
112
+ console.error(JSON.stringify({ error: 'Missing NODPAY_AGENT_KEY in ~/.nodpay/.env — run npx nodpay keygen first' }));
111
113
  process.exit(1);
112
114
  }
113
115