{"name":"bolt09","version":"0.2.5","keywords":["bolt","feature-bits","lightning","lightning-network"],"author":{"name":"Alex Bosworth"},"license":"MIT","_id":"bolt09@0.2.5","maintainers":[{"name":"alexbosworth","email":"alex.bosworth+npm@gmail.com"}],"homepage":"https://github.com/alexbosworth/bolt09#readme","bugs":{"url":"https://github.com/alexbosworth/bolt09/issues"},"dist":{"shasum":"924de4a95aad5ca507d25b38e1b20e3bb9bc680b","tarball":"http://registry-npm.ywwl.com/bolt09/download/bolt09-0.2.5.tgz","fileCount":21,"integrity":"sha512-LH8wb3KbVP62SUpnwqUWqoyTUhda3JFQh4TSe6urt2mEAC0w53PSwqB4wqnHdG7QpE209Q2WQl/QH1XtVIsD3g==","signatures":[{"sig":"MEQCIDgK0rB/aLVwE4+ubeHx8S3e7UNBGlP+KM65FnD3j8HBAiAiEk3MMDoxscwrqmu+HulwJ04tdwXqds50Ge12bw9Aew==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16831,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjt4G6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrDXw//XRJkXWntuNZm77KUAp1jWeyTpghvrQhjRDvH7Dz55VcBBISV\r\n3kIj14GOaxQYaUzxqjq40E2+o4NSUXJsxZobzbsHe91RSyBFF1ks/rS3R/Ze\r\neqrbKR/XDxIU9gNwooBwoepAjlmi4K25O+hSC+J7e6zXksIwHjqOqwOTHTZI\r\nfL5HdJPSBMI/GA9mpOnvBNHGOX30BixL13knXQR5BVjBl3M7ZfB+79JhJbuD\r\nd5H0MESiYfOI8MS/1zIBtushKgLW+DmMQOaDCpuo8Ker7VV7U7R/98lK1ENb\r\n0NM/hU8aifBkpGhuItWEBuv+14bXpwv3vaDhmUIOPkO7C4gRQcpzqsx5ksPK\r\nt8PN7x70vTvpeo3Zf1CXR61r5tfBZZ5HL7ItB0e5MeQ+JD7uVMpGMXujragl\r\np6/1mtou9SedC7hhVJGkJSNJU/XxjeCOAqbr78BU+gHtHVY9OV7z1PTll0WA\r\n/RfPRHLSZ1xn5/oboy6HY4Vnje50Cw8xN0KzNMcfqh9hD8munb0bADx0AK37\r\nWntADHLY3PrC5z5R7AodfmHNhThcGmYT4+A48agVF9yLcPHwZQlzfbLcWNlB\r\nTTyrTuDLiWBOtkwRsJebjKhYd+POkG+csPI63pYiB4/W5knQbqIXgCPoyIac\r\n/vmIadnogGdAIrNm+zxGlV80aScSkUGx3v0=\r\n=0jFF\r\n-----END PGP SIGNATURE-----\r\n","size":4747,"noattachment":false,"key":"/bolt09/-/bolt09-0.2.5.tgz"},"main":"index.js","engines":{"node":">=12.20.0"},"gitHead":"d734819d3e1bb8b516bdc3c80d3544aa324bd0d3","scripts":{"test":"tap test/*.js"},"_npmUser":{"name":"alexbosworth","email":"alex.bosworth+npm@gmail.com"},"repository":{"url":"git+https://github.com/alexbosworth/bolt09.git","type":"git"},"_npmVersion":"8.13.1","description":"BOLT 09 helper methods","directories":{},"_nodeVersion":"18.12.1","_hasShrinkwrap":false,"devDependencies":{"@alexbosworth/tap":"15.0.12"},"_npmOperationalInternal":{"tmp":"tmp/bolt09_0.2.5_1672970682465_0.4995799147117981","host":"s3://npm-registry-packages"},"readme":"# Bolt 09\n\n[![npm version](https://badge.fury.io/js/bolt09.svg)](https://badge.fury.io/js/bolt09)\n[![Coverage Status](https://coveralls.io/repos/github/alexbosworth/bolt09/badge.svg?branch=master)](https://coveralls.io/github/alexbosworth/bolt09?branch=master)\n[![Build Status](https://travis-ci.org/alexbosworth/bolt09.svg?branch=master)](https://travis-ci.org/alexbosworth/bolt09)\n\nUtility methods for working with [BOLT 09](https://github.com/lightningnetwork/lightning-rfc/blob/master/09-features.md)\n\n## Methods\n\n### featureFlagDetails\n\nFeature flag details for feature flag bit\n\n    {\n      bit: <Feature Flag Bit Number>\n    }\n\n    @throws\n    <Error>\n\n    @returns\n    {\n      [type]: <Feature Flag Type String>\n    }\n\nExample:\n\n```node\nconst {featureFlagDetails} = require('bolt09');\n\nconst {type} = featureFlagDetails({bit: 0});\n// Type is string descriptor of feature bit\n```\n\n### featureFlagsAsHex\n\nEncode feature flags into hex serialized bytes\n\n    {\n      features: [<Feature Bit Number>]\n    }\n\n    @throws\n    <Error>\n\n    @returns\n    {\n      encoded: <Serialized Feature Bits Hex Encoded String>\n    }\n\nExample:\n\n```node\nconst {featureFlagsAsHex} = require('bolt09');\n\nconst {encoded} = featureFlagsAsHex({features: [0]});\n// Encoded is hex encoded string with a length uint16 prefix\n```\n\n### featureFlagsAsWords\n\nEncode feature flags into a serialized data buffer\n\n    {\n      features: [<Feature Bit Number>]\n    }\n\n    @throws\n    <Error>\n\n    @returns\n    {\n      words: [<Bech32 Word Number>]\n    }\n\nExample:\n\n```node\nconst {featureFlagsAsWords} = require('bolt09');\n\nconst {words} = featureFlagsAsWords({features: [0]});\n// Words are word numbers that can be used for encoding in a bolt11 payment req\n```\n\n### featureFlagsFromHex\n\nFeature flags from hex serialized feature flags\n\n    {\n      [hex]: <Data Length Prefixed Hex Encoded String>\n    }\n\n    @throws\n    <Error>\n\n    @returns\n    {\n      features: [{\n        bit: <Feature Bit Number>\n        is_required: <Feature Bit is Required Bool>\n        type: <Feature Bit Type String>\n      }]\n    }\n\nExample:\n\n```node\nconst {featureFlagsFromHex} = require('bolt09');\n\nconst {features} = featureFlagsFromHex({hex: '00018C'});\n// Features is an array of supported features\n```\n\n### featureFlagsFromWords\n\nFeature flags from BOLT 11 tag words\n\n    {\n      words: [<BOLT11 Tag Word Number>]\n    }\n\n    @throws\n    <Error>\n\n    @returns\n    {\n      features: [{\n        bit: <Feature Bit Number>\n        is_required: <Feature Bit is Required Bool>\n        type: <Feature Bit Type String>\n      }]\n    }\n\nExample:\n\n```node\nconst {featureFlagsFromWords} = require('bolt09');\n\nconst {features} = featureFlagsFromWords({words: [16, 0]});\n// Features is an array of supported features\n```\n","publish_time":1672970682611,"_cnpm_publish_time":1672970682611,"dist-tags":{"latest":"3.0.0"}}