Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@synonymdev/lightning-channel-id

Package Overview
Dependencies
Maintainers
7
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@synonymdev/lightning-channel-id

Convert lightning channel id formats

  • 0.0.2
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
7
Weekly downloads
 
Created
Source

lightning-channel-id-js

Convert between various channel id formats in Lightning network.

Usage


npm install lightning-channel-js

const {clnToLnd, lndToCln} = require("lightning-channel-js")

lndToCln("807896954914930688")
clnToLnd("734778:1235:0")

// All of the above should output same result
{
  block: '734778',
  tx: '1235',
  output: '0',
  lnd_notation: '807896954914930688',
  cln_format: '734778:1235:0'
}


Functions

lndToCln(channelId : String)

Converts from LND format to CLN format

clnToLnd(channelId : String, marker: String)

Converts from CLN to LND format. Accepts an optional marker string, which is used incase your channel format has a different seperator

clnToLnd("734778x1235x0","x")

{
  block: '734778',
  tx: '1235',
  output: '0',
  lnd_format: '807896954914930688',
  cln_format: '734778x1235x0'
}

FAQs

Package last updated on 20 May 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc