{"name":"bolt09","version":"0.2.1","keywords":["bolt","feature-bits","lightning","lightning-network"],"author":{"name":"Alex Bosworth"},"license":"MIT","_id":"bolt09@0.2.1","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":"1b03b6731faaa60e274bf8854a675d074cae52a0","tarball":"http://registry-npm.ywwl.com/bolt09/download/bolt09-0.2.1.tgz","fileCount":21,"integrity":"sha512-ON1CY0awM/VsOxcmCtz7WggxjGRH+G5rSEAdWp1UoU43BHiGw1T6eEt1t4gFvLi8eUSV0hB7vF1QOba65k/7FA==","signatures":[{"sig":"MEUCIQC0f/1Z7FsjPOYLjUO07rbVm0TBs53rT3sZbSScAMxQZQIgTvb76qnkMppScKl9tpXwAGUbtKOgS5r4o2zzUAkReRw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16253,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh37bWCRA9TVsSAnZWagAASMgP/14DbhVxCYL7aFdKJxZI\n1NTWgyT+12h4OxWhuHEn5IcZammmjt/IgxJeP+SkBRuIMQDZxG1nZvZH2fBS\n7awRiE7OO+k7IR3lsiHerVZtLZQVanvDKX28gXMfsTnfOE7ed2ZU4L0qZDcj\nY8IiIZ7i2GfbukU6mRSijwMpRZ/c0eFpkZdhW2y03O9NobY+zxt44/nfDy27\nmckuQDCtG2ZzITb4zaP5j3uH0JIe3ibhlUagiZr1WIdIX+wM3czKSLh9IqQv\nUWrZF0FklsM9VrAH4Sk4XaeJrjkvo+WvcSCVy8ZX401ThqreQ/vBBtbLBDLj\n3qX4mUxh3mJ+uM2KTIKxZZ8Myu5U7ChFuv2bEeA28KWm62XY63yF7I8Yyj6Z\nRO3F6C7FkDvQJ4TU/toj2OBhkGjHWC1veFnXB/5uQdkPjXEXnCBnJGuF06v6\ne3x3mJEuuGIlN/JmPl088funjgv214cNVcM/wosaYmm5SKscWnvtkPch/EHn\nUuduDUaJrNhnkdqmngxr3sVRC7lvso6frCSHhnI4xPEWOjo2wXHCRQD1DpSl\nASk1ldV1RfBw4ixJSmlpQRLI3RIQQpaTM0d16bThTrCn0mBGcpgSPfXyjb/+\nS6dPLhZ/W6RnEBpUR0hHF9cuwlMPkrdNfzsyoCnx4Oig+zHOXz1atlF9Ka+p\nECwA\r\n=/ayZ\r\n-----END PGP SIGNATURE-----\r\n","size":4646,"noattachment":false,"key":"/bolt09/-/bolt09-0.2.1.tgz"},"main":"index.js","engines":{"node":">=10.4.0"},"gitHead":"a9d6af8c01bcbc50678d5f31a59a440178fcb0af","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.3.0","description":"BOLT 09 helper methods","directories":{},"_nodeVersion":"16.13.1","_hasShrinkwrap":false,"devDependencies":{"@alexbosworth/tap":"15.0.10"},"_npmOperationalInternal":{"tmp":"tmp/bolt09_0.2.1_1642051286177_0.5852775574838802","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":1642051286343,"_cnpm_publish_time":1642051286343,"dist-tags":{"latest":"3.0.0"}}