{"name":"bolt09","version":"0.1.0","keywords":["bolt","feature-bits","lightning","lightning-network"],"author":{"name":"Alex Bosworth"},"license":"MIT","_id":"bolt09@0.1.0","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":"c4b97addb3defd449b796ca59004b54332deb858","tarball":"http://registry-npm.ywwl.com/bolt09/download/bolt09-0.1.0.tgz","fileCount":21,"integrity":"sha512-n1jBGRip56E3SXQ+4KdzV/EcJ3Ls4R8Qyd0KTgNzCaSV+2SyNVsr0w0lKYzTBzwoctEBKHsytGjZ3qNxnt02nw==","signatures":[{"sig":"MEQCIAgPbDW4O+2iJ4grnLSat1uOnoY93VKxBVpIfJW+id6rAiAW6ytyymvBJz5kxWTxNyg2GuVCFfOfT7ZP/J2Pz1We5g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe5pQWCRA9TVsSAnZWagAAoJsP/3urQMm4MlDOLMHjFKO+\nZ7i8Pv7uOBlW7FBlfQKWCHlxwYwEfJRXmsQQ2vzMmQkS+9TaTfATcOUpeNgO\nAPl//umXrIcS3osEGh1uNxRejs6zIdsmyFyBAAjF91qEMIlrqU/7zvb6UyQm\nGMJ370aLRAt4gqJNOIMSLJ26vb0KacoQRdK/fQGW0qEy1oaNi0TVDCyPVr+m\nOew6ZeazeQyiyJFlzdMRXNYpMA27/o+se3WyCYW6aLs24OQlkggjCmn9d81/\nCCZcxztoHwflpAOyi1ctRCoBGyVvHmvMASfpozVPOB1F8b2USqZy84r3pTo+\nwNvPZ5UfEWAyxD1ALVmrYp6Y/hAMS8yBDMTR233KTatHrkChcRwYevCoohlo\nULJrVR9TYl9fIlvbkqLhzh03XiPzZ0y6x7PTds53L0uk/svmkUIw7cG1onjl\n5AwSDjLSJiJxJmQb/IUs+yIOqXht6/4StPh62OhGz3eVi++93JyisBd5KnJL\nSOTIWcTiTcbcwDeFWSD/56hSmhKVWFMYBfkOCMH0/bp+4W2Yo8sC4eryUU01\nwPTdOJRfYdDCK9PAUYQmyibc1Ux7N2kn4nabTjqAw+5LlnbcjMUx1U2jkEe1\nnF3m0tjirX3Dlx2+UtmWDGzZ7XQ/aPJGJHlU2Bfh4NpwiqqSjqeOjrEnio/5\nmdXb\r\n=eMCQ\r\n-----END PGP SIGNATURE-----\r\n","size":4566,"noattachment":false,"key":"/bolt09/-/bolt09-0.1.0.tgz"},"main":"index.js","engines":{"node":">=10.4.0"},"gitHead":"f1b29ac2ed81aa02fc965e185efd4ef15a2956f3","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":"6.14.5","description":"BOLT 09 helper methods","directories":{},"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"tap":"14.10.7"},"_npmOperationalInternal":{"tmp":"tmp/bolt09_0.1.0_1592169494055_0.8342564539121571","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":1592169494268,"_cnpm_publish_time":1592169494268,"dist-tags":{"latest":"3.0.0"}}