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

rune-decoder

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rune-decoder

Decode runes

  • 0.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-25%
Maintainers
1
Weekly downloads
 
Created
Source

Rune Decoder

A simple JavaScript libary for decoding runes.

Still in Beta and may have some bugs and may have breaking API changes in future

Install

Install directly from the repo:

Yarn

yarn add https://github.com/clams-tech/rune-decoder

NPM

npm i https://github.com/clams-tech/rune-decoder

Usage

Using the decode method you can get a similar result to that of passing a rune to the Core Lightning Decode method:

import { decode } from 'decode-rune'

const rune =
  'aTEhoWOAllxYDgWSUyGPEKVeUwr-MG_Il1HXZis1MYs9NCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl'

const decoded = decode(rune)

console.log(decoded)

// {
//   id: '4',
//   hash: '693121a16380965c580e059253218f10a55e530aff30ffc89751d7662b35318b',
//   restrictions: [
//     {
//       alternatives: ['method^list', 'method^get', 'method=summary'],
//       summary: 'method starts with list OR method starts with get OR method is equal to summary'
//     },
//     {
//       alternatives: ['method/listdatastore'],
//       summary: 'method is not equal to listdatastore'
//     }
//   ]
// }

If a rune is invalid, null will be returned.

FAQs

Package last updated on 03 Oct 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