Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
lightning-rpc
Advanced tools
Statically generated Lightning gRPC library for Node.js, written in TypeScript.
Statically generated Lightning gRPC library for Node.js, written in TypeScript.
import {
GetInfoRequest,
GetInfoResponse,
Invoice,
InvoiceSubscription,
LightningRpcConfig,
UnlockWalletRequest,
UnlockWalletResponse,
WalletBalanceRequest,
WalletBalanceResponse,
createLightning,
createWalletUnlocker,
} from 'lightning-rpc';
const config = {
host: String(process.env.LND_HOST),
port: String(process.env.LND_PORT),
certPath: String(process.env.LND_CERT_PATH),
macaroonPath: String(process.env.LND_MACAROON_PATH),
};
const walletUnlocker = createWalletUnlocker(config);
walletUnlocker.waitForReady(Infinity, (error: Error | null) => {
if (error) {
console.error(error);
}
const unlockWalletRequest = new UnlockWalletRequest();
if (!process.env.LND_WALLET_PASSWORD) {
throw 'No wallet password. Set the LND_WALLET_PASSWORD enviroment variable.';
}
unlockWalletRequest.setWalletPassword(
Buffer.from(process.env.LND_WALLET_PASSWORD),
);
walletUnlocker.unlockWallet(
unlockWalletRequest,
(error: ServiceError | null, response: UnlockWalletResponse) => {
if (error) {
console.error(error);
}
console.log('Wallet unlocked')
const lightning = await createLightning(config);
lightning.waitForReady(Infinity, (error: Error | null) => {
if (error) {
throw error;
}
const getInfoRequest = new GetInfoRequest();
lightning.getInfo(
getInfoRequest,
(error: ServiceError | null, response: GetInfoResponse) => {
if (error) {
console.error(error);
}
console.log(response);
},
);
const invoiceSubscription = new InvoiceSubscription();
const stream: ClientReadableStream<Invoice> = lightning.subscribeInvoices(
invoiceSubscription,
);
stream.on('data', (invoice: Invoice) => {
console.log('invoice', invoice);
})
})
}
)
});
Requirements: protoc
git clone https://github.com/matthewlilley/lightning-rpc.git
cd lightning-rpc
yarn generate
https://matthewlilley.github.io/lightning-rpc
Want to contribute? Awesome! Feel free to create an issue and/or pull request.
MIT
FAQs
Statically generated Lightning gRPC library for Node.js, written in TypeScript.
We found that lightning-rpc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.