Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

225
Vistas
ln-service (npm-package) [ 400, 'ExpectedLndToCreateNewInvoice' ]

I'm using ln-service package and I'm connected to a local instance of lnd node (created with polar). I'm using plain js.

import lnservice from 'ln-service';


let lndz = lnservice.authenticatedLndGrpc({
    cert: tls,
    macaroon: adminMacaroon,
    socket: socket
})

try {
    let res = await lnservice.createInvoice({mtokens: "500", description: "new invoice", lnd:lndz})
} catch (error) {
    console.log("ERROR",error);
}   

Error:

[ 400, 'ExpectedLndToCreateNewInvoice' ]

The only hint I'm getting from IDE is that lndz should have these fields, but I don't know what I should put in these fields, since it's not mentioned in the docs.

  autopilot: any;
  chain: any;
  default: any;
  invoices: any;
  router: any;
  signer: any;
  tower_client: any;
  tower_server: any;
  wallet: any;
  version: any;

What does 400 mean? How can I debug this? I looked at LND logs but no help there. How would I know what to put in those fields, since only 3 of the fields were mentioned

If I run a different method:

lnservice.getHeight(lndz)

I'm getting the correct block height, so it seems that I'm able to make a connection to the LND node.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Have to use object destructuring.

let {lnd} = lnservice.authenticatedLndGrpc({
    cert: tls,
    macaroon: adminMacaroon,
    socket: socket
})
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda