nervepay 1.2.8 → 1.3.0
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 +5 -5
- package/package.json +1 -1
package/bin/nervepay-cli.js
CHANGED
|
@@ -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: '
|
|
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 === '
|
|
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: '
|
|
458
|
+
type: 'req',
|
|
459
459
|
id: pairId,
|
|
460
460
|
method: 'node.pair.request',
|
|
461
461
|
params: {
|
|
@@ -474,7 +474,7 @@ async function deviceNodePairing(options) {
|
|
|
474
474
|
}
|
|
475
475
|
|
|
476
476
|
// Pair request response → extract requestId
|
|
477
|
-
if (frame.type === '
|
|
477
|
+
if (frame.type === 'res' && frame.id === pairId) {
|
|
478
478
|
if (frame.ok) {
|
|
479
479
|
requestId = frame.payload?.requestId || '';
|
|
480
480
|
console.log(chalk.green('✓ Pairing request submitted'));
|
|
@@ -512,7 +512,7 @@ async function deviceNodePairing(options) {
|
|
|
512
512
|
}
|
|
513
513
|
|
|
514
514
|
// Log unhandled frames for debugging
|
|
515
|
-
if (frame.type === '
|
|
515
|
+
if (frame.type === 'res' || frame.error) {
|
|
516
516
|
console.log(chalk.gray(' [debug] Unhandled frame:'), JSON.stringify(frame).slice(0, 200));
|
|
517
517
|
}
|
|
518
518
|
} catch (err) {
|