nervepay 1.3.6 → 1.3.7
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/bin/nervepay-cli.js +12 -5
- package/package.json +1 -1
package/bin/nervepay-cli.js
CHANGED
|
@@ -380,7 +380,7 @@ program
|
|
|
380
380
|
.option('--code <code>', 'Pairing code from dashboard (legacy flow)')
|
|
381
381
|
.option('--api-url <url>', 'NervePay API URL', DEFAULT_API_URL)
|
|
382
382
|
.option('--gateway-url <url>', 'Gateway URL')
|
|
383
|
-
.option('--gateway-token <token>', 'Gateway token
|
|
383
|
+
.option('--gateway-token <token>', 'Gateway auth token')
|
|
384
384
|
.option('--name <name>', 'Gateway display name', 'OpenClaw Gateway')
|
|
385
385
|
.option('--timeout <seconds>', 'Approval timeout in seconds', '300')
|
|
386
386
|
.action(async (options) => {
|
|
@@ -412,13 +412,17 @@ async function deviceNodePairing(options) {
|
|
|
412
412
|
logOk('Agent loaded');
|
|
413
413
|
field(' DID', agentDid);
|
|
414
414
|
|
|
415
|
-
// Resolve gateway URL
|
|
415
|
+
// Resolve gateway URL and token
|
|
416
416
|
let gatewayUrl = options.gatewayUrl;
|
|
417
|
-
|
|
417
|
+
let gatewayToken = options.gatewayToken;
|
|
418
|
+
if (!gatewayUrl || !gatewayToken) {
|
|
418
419
|
const oc = await readOpenClawConfig();
|
|
419
|
-
|
|
420
|
+
const gwConf = extractGatewayConfig(oc);
|
|
421
|
+
gatewayUrl = gatewayUrl || gwConf.url;
|
|
422
|
+
gatewayToken = gatewayToken || gwConf.token;
|
|
420
423
|
}
|
|
421
424
|
if (!gatewayUrl) die('No gateway URL found', 'Use: nervepay pair --gateway-url <url>');
|
|
425
|
+
if (!gatewayToken) die('No gateway token found', 'Use: nervepay pair --gateway-token <token>');
|
|
422
426
|
|
|
423
427
|
const wsUrl = httpToWs(gatewayUrl);
|
|
424
428
|
field(' Gateway', wsUrl);
|
|
@@ -493,7 +497,7 @@ async function deviceNodePairing(options) {
|
|
|
493
497
|
role,
|
|
494
498
|
scopes.join(','),
|
|
495
499
|
String(signedAtMs),
|
|
496
|
-
|
|
500
|
+
gatewayToken,
|
|
497
501
|
nonce,
|
|
498
502
|
].join('|');
|
|
499
503
|
|
|
@@ -528,6 +532,9 @@ async function deviceNodePairing(options) {
|
|
|
528
532
|
signedAt: signedAtMs,
|
|
529
533
|
nonce,
|
|
530
534
|
},
|
|
535
|
+
auth: {
|
|
536
|
+
token: gatewayToken,
|
|
537
|
+
},
|
|
531
538
|
},
|
|
532
539
|
}));
|
|
533
540
|
return;
|