Skip to content

Commit

Permalink
fix require is not defined in ES module scope
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardobl committed Nov 4, 2024
1 parent 048c27f commit 571a230
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/lnd.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ import { join } from 'path'
import apiForProto from 'lightning/lnd_grpc/api_for_proto'
import { defaultSocket, grpcSslCipherSuites, packageTypes, protoFiles, protosDir, serviceTypes } from 'lightning/grpc/index'
import grpcCredentials from 'lightning/lnd_grpc/grpc_credentials'
import { createRequire } from 'module'

const { GRPC_SSL_CIPHER_SUITES } = process.env
const { keys } = Object

export function authenticatedLndGrpc ({ cert, macaroon, path, socket }, withProxy) {
const lightningModulePath = require.resolve('lightning')
const req = createRequire(import.meta.url)

const lightningModulePath = req.resolve('lightning')
const pathForProto = proto => join(lightningModulePath, protosDir, proto)

const { credentials } = grpcCredentials({ cert, macaroon })
Expand Down

0 comments on commit 571a230

Please sign in to comment.