nodpay 0.2.38 → 0.2.39
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 +1 -1
- package/scripts/propose.mjs +5 -34
package/package.json
CHANGED
package/scripts/propose.mjs
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* The agent signs first (1 of 2). The serialized SafeOperation is
|
|
7
7
|
* output so the web app can have the user co-sign and submit.
|
|
8
8
|
*
|
|
9
|
-
* Agent key: from process.env.NODPAY_AGENT_KEY (real env > ~/.nodpay/.env file
|
|
9
|
+
* Agent key: from process.env.NODPAY_AGENT_KEY (real env > ~/.nodpay/.env file), or remote_wallet proxy.
|
|
10
10
|
* Chain config: resolved via --chain from @nodpay/core networks registry.
|
|
11
11
|
* Bundler: NodPay public proxy (override with OP_STORE_URL for self-hosted).
|
|
12
12
|
*
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
* --safe <address> - Wallet (Safe) address
|
|
18
18
|
* --counterfactual - Safe not yet deployed; include deployment in UserOp
|
|
19
19
|
* --human-signer-eoa <address> - Human's EOA signer address (for EOA mode)
|
|
20
|
-
* --remote-signer <url> - SafeClaw proxy URL for remote signing (mutually exclusive with --human-signer-eoa)
|
|
21
20
|
* --salt <nonce> - Salt nonce (required for counterfactual)
|
|
22
21
|
* --reuse-gas-from <shortHash> - Reuse gas values from a previous op (shortHash prefix of safeOpHash)
|
|
23
22
|
* --nonce <n> - Required. Use `txs` to find current nonce.
|
|
@@ -86,12 +85,9 @@ const DEFAULT_SAFE = null; // always use --safe flag
|
|
|
86
85
|
const opStoreBase = env('OP_STORE_URL', 'https://nodpay.ai/api');
|
|
87
86
|
const BUNDLER_URL = `${opStoreBase}/bundler/${CHAIN_ID}`;
|
|
88
87
|
|
|
89
|
-
// --- Agent key resolution: remote_wallet (config.json)
|
|
88
|
+
// --- Agent key resolution: remote_wallet (config.json) or local key ---
|
|
90
89
|
const _config = loadConfig();
|
|
91
90
|
const _remoteWalletUrl = _config.remote_wallet || null;
|
|
92
|
-
const _remoteSignerUrl = process.argv.includes('--remote-signer')
|
|
93
|
-
? process.argv[process.argv.indexOf('--remote-signer') + 1]
|
|
94
|
-
: undefined;
|
|
95
91
|
|
|
96
92
|
let AGENT_ADDRESS;
|
|
97
93
|
let signHash;
|
|
@@ -129,31 +125,6 @@ if (_remoteWalletUrl) {
|
|
|
129
125
|
}
|
|
130
126
|
return (await signRes.json()).signature;
|
|
131
127
|
};
|
|
132
|
-
} else if (_remoteSignerUrl) {
|
|
133
|
-
// Legacy --remote-signer mode (deprecated, use config.json remote_wallet)
|
|
134
|
-
const addrRes = await fetch(`${_remoteSignerUrl}/address`);
|
|
135
|
-
if (!addrRes.ok) {
|
|
136
|
-
const err = await addrRes.json().catch(() => ({}));
|
|
137
|
-
console.error(JSON.stringify({
|
|
138
|
-
error: err.error || 'Failed to get agent address from remote signer',
|
|
139
|
-
code: err.code || 'REMOTE_SIGNER_ERROR'
|
|
140
|
-
}));
|
|
141
|
-
process.exit(1);
|
|
142
|
-
}
|
|
143
|
-
AGENT_ADDRESS = (await addrRes.json()).address;
|
|
144
|
-
|
|
145
|
-
signHash = async (hash) => {
|
|
146
|
-
const signRes = await fetch(`${_remoteSignerUrl}/sign/${AGENT_ADDRESS}`, {
|
|
147
|
-
method: 'POST',
|
|
148
|
-
headers: { 'Content-Type': 'application/json' },
|
|
149
|
-
body: JSON.stringify({ hash })
|
|
150
|
-
});
|
|
151
|
-
if (!signRes.ok) {
|
|
152
|
-
const err = await signRes.json().catch(() => ({}));
|
|
153
|
-
throw new Error(err.error || 'Remote signing failed');
|
|
154
|
-
}
|
|
155
|
-
return (await signRes.json()).signature;
|
|
156
|
-
};
|
|
157
128
|
} else {
|
|
158
129
|
// Local mode: read key from process.env (loaded from real env or ~/.nodpay/.env)
|
|
159
130
|
const NODPAY_AGENT_KEY = env('NODPAY_AGENT_KEY');
|
|
@@ -195,9 +166,9 @@ const passkeyVerifier = getArg('--passkey-verifier') || '0x445a0683e494ea0c5AF3E
|
|
|
195
166
|
const recoverySigner = getArg('--recovery-signer');
|
|
196
167
|
const isPasskey = !!(passkeyX && passkeyY);
|
|
197
168
|
|
|
198
|
-
//
|
|
199
|
-
if (
|
|
200
|
-
console.error(JSON.stringify({ error: '
|
|
169
|
+
// remote_wallet + --human-signer-eoa is not supported
|
|
170
|
+
if (_remoteWalletUrl && humanSigner) {
|
|
171
|
+
console.error(JSON.stringify({ error: 'remote_wallet and --human-signer-eoa cannot be combined. Remote mode only supports passkey wallets.' }));
|
|
201
172
|
process.exit(1);
|
|
202
173
|
}
|
|
203
174
|
|