nervepay 1.2.8 → 1.3.1

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.
@@ -422,7 +422,7 @@ async function deviceNodePairing(options) {
422
422
  // Step 6: Send connect request as operator with device identity
423
423
  connectId = crypto.randomUUID();
424
424
  const connectReq = {
425
- type: 'request',
425
+ type: 'req',
426
426
  id: connectId,
427
427
  method: 'connect',
428
428
  params: {
@@ -448,14 +448,14 @@ async function deviceNodePairing(options) {
448
448
  }
449
449
 
450
450
  // Connect response
451
- if (frame.type === 'response' && frame.id === connectId) {
451
+ if (frame.type === 'res' && frame.id === connectId) {
452
452
  if (frame.ok) {
453
453
  console.log(chalk.green('✓ Connected to gateway'));
454
454
 
455
455
  // Step 7: Send node.pair.request
456
456
  pairId = crypto.randomUUID();
457
457
  const pairReq = {
458
- type: 'request',
458
+ type: 'req',
459
459
  id: pairId,
460
460
  method: 'node.pair.request',
461
461
  params: {
@@ -465,8 +465,12 @@ async function deviceNodePairing(options) {
465
465
  };
466
466
  ws.send(JSON.stringify(pairReq));
467
467
  } else {
468
- lastError = `Connect rejected: ${frame.error || 'Unknown error'}`;
468
+ const errDetail = typeof frame.error === 'object'
469
+ ? JSON.stringify(frame.error)
470
+ : (frame.error || 'Unknown error');
471
+ lastError = `Connect rejected: ${errDetail}`;
469
472
  console.error(chalk.red(` ${lastError}`));
473
+ if (frame.payload) console.error(chalk.gray(' Payload:'), JSON.stringify(frame.payload));
470
474
  ws.close();
471
475
  settle(reject, new Error(lastError));
472
476
  }
@@ -474,7 +478,7 @@ async function deviceNodePairing(options) {
474
478
  }
475
479
 
476
480
  // Pair request response → extract requestId
477
- if (frame.type === 'response' && frame.id === pairId) {
481
+ if (frame.type === 'res' && frame.id === pairId) {
478
482
  if (frame.ok) {
479
483
  requestId = frame.payload?.requestId || '';
480
484
  console.log(chalk.green('✓ Pairing request submitted'));
@@ -482,8 +486,12 @@ async function deviceNodePairing(options) {
482
486
  console.log(chalk.gray(` Approve with: openclaw devices approve ${requestId}`));
483
487
  console.log(chalk.gray(` Timeout: ${options.timeout}s\n`));
484
488
  } else {
485
- lastError = `Pair request rejected: ${frame.error || 'Unknown error'}`;
489
+ const errDetail = typeof frame.error === 'object'
490
+ ? JSON.stringify(frame.error)
491
+ : (frame.error || 'Unknown error');
492
+ lastError = `Pair request rejected: ${errDetail}`;
486
493
  console.error(chalk.red(` ${lastError}`));
494
+ if (frame.payload) console.error(chalk.gray(' Payload:'), JSON.stringify(frame.payload));
487
495
  ws.close();
488
496
  settle(reject, new Error(lastError));
489
497
  }
@@ -512,7 +520,7 @@ async function deviceNodePairing(options) {
512
520
  }
513
521
 
514
522
  // Log unhandled frames for debugging
515
- if (frame.type === 'response' || frame.error) {
523
+ if (frame.type === 'res' || frame.error) {
516
524
  console.log(chalk.gray(' [debug] Unhandled frame:'), JSON.stringify(frame).slice(0, 200));
517
525
  }
518
526
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nervepay",
3
- "version": "1.2.8",
3
+ "version": "1.3.1",
4
4
  "description": "NervePay plugin for OpenClaw - Self-sovereign identity, vault, and orchestration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",