{"_id":"bolt01@4.0.1","bugs":{"url":"https://github.com/alexbosworth/bolt01/issues"},"dist":{"shasum":"35dbc5f606a9fe8a9ba8f3bd499b1bbcebfcdfe1","tarball":"http://registry-npm.ywwl.com/bolt01/download/bolt01-4.0.1.tgz","fileCount":17,"integrity":"sha512-HBln+/vfU9CM1e470ejL/uMervRo6aRuPmtixBPoUfJqR3LW+X85YzBp6s/2LInFwNJa5pTVsIpx62RbYIFDUA==","signatures":[{"sig":"MEUCIQD7ni26CtrfX9QdMHJZProIRc4vmBGw1/WztR1hPnHpqAIgA4vv6bf3yqHoNsa4dk4pHPF0m2tMUyvLX6tQL510iVo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFRU0OFGOk0KbBbAUMcpVd1a/vmA7j1c9CqRA+w/yKiiAiEA4qttZTpe8QOdO+DhhWGti6b0fyRWkVnKIngl8ekieN8="}],"unpackedSize":17257,"size":5152,"noattachment":false,"key":"/bolt01/-/bolt01-4.0.1.tgz"},"main":"index.js","name":"bolt01","author":{"url":"https://x.com/alexbosworth","name":"Alex Bosworth"},"engines":{"node":">=22"},"gitHead":"3468764dd100693d75e8a18af5e6cbd6e84c1a8b","license":"MIT","scripts":{"test":"node --experimental-test-coverage --test test/arrays/*.js test/big_size/*.js test/tlv_record/*.js test/tlv_stream/*.js"},"version":"4.0.1","_npmUser":{"name":"alexbosworth","email":"alex.bosworth+npm@gmail.com"},"homepage":"https://github.com/alexbosworth/bolt01#readme","keywords":["lightning-network"],"repository":{"url":"git+https://github.com/alexbosworth/bolt01.git","type":"git"},"_npmVersion":"11.19.0","description":"Lightning Network BOLT-01 methods","directories":{},"maintainers":[{"name":"alexbosworth","email":"alex.bosworth+npm@gmail.com"}],"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bolt01_4.0.1_1791330157300_0.8301075516937895"},"readme":"# BOLT 01\n\n[![npm version](https://badge.fury.io/js/bolt01.svg)](https://badge.fury.io/js/bolt01)\n\nMethods relating to Lightning Network\n[BOLT 01](https://github.com/lightningnetwork/lightning-rfc/blob/master/01-messaging.md).\n\n## decodeBigSize\n\nGiven BOLT 01 \"BigSize\" bytes, return a corresponding numeric value\n\n    {\n      encoded: <BigSize Encoded Value Hex String>\n    }\n\n    @throws\n    <Error>\n\n    @returns\n    {\n      decoded: <Decoded Number String>\n      length: <Encoding Byte Length Number>\n    }\n\nExample:\n\n```node\nconst {decodeBigSize} = require('bolt01');\n\n// Decode a zero value BigSize number\nconst {decoded} = decodeBigSize({encoded: '00'});\n```\n\n## decodeTlvRecord\n\nDecode an encoded TLV record\n\n    {\n      encoded: <Encoded TLV Record Hex String>\n      [offset]: <Record Offset By Bytes Number>\n    }\n\n    @throws\n    <Error>\n\n    @returns\n    {\n      length: <Total Record Byte Length Number>\n      type: <Message Type Number String>\n      value: <Raw Value Hex String>\n    }\n\nExample:\n\n```node\nconst {decodeTlvRecord} = require('bolt01');\n\n// Type '1' and value '01'\nconst {type, value} = decodeTlvRecord({encoded: '010101'});\n```\n\n## decodeTlvStream\n\nDecode a TLV stream as key value pairs\n\n    {\n      encoded: <TLV Records Stream Hex Encoded String>\n    }\n\n    @throws\n    <Error>\n\n    @returns\n    {\n      records: [{\n        type: <Message Type Number String>\n        value: <Raw Value Hex String>\n      }]\n    }\n\nExample:\n\n```node\nconst {decodeTlvStream} = require('bolt01');\n\n// {records: [{type: '1', value: '01}]}\nconst {records} = decodeTlvRecord({encoded: '010101'});\n```\n\n## encodeBigSize\n\nGiven a numeric value, encode it as BOLT 01 \"BigSize\" bytes\n\n    {\n      number: <Number String>\n    }\n\n    @throws\n    <Error>\n\n    @returns\n    {\n      encoded: <BigSize Encoded Value Hex String>\n    }\n\nExample:\n\n```node\nconst {encodeBigSize} = require('bolt01');\n\n// Encode a zero value BigSize number\nconst {encoded} = encodeBigSize({number: '0'});\n```\n\n## encodeTlvRecord\n\nEncode data as a TLV record\n\n    {\n      type: <Message Type Number String>\n      value: <Raw Value Hex String>\n    }\n\n    @throws\n    <Error>\n\n    @returns\n    {\n      encoded: <Encoded TLV Record Hex String>\n    }\n\nExample:\n\n```node\nconst {encodeTlvRecord} = require('bolt01');\n\n// encoded: '010101'\nconst {encoded} = encodeTlvRecord({type: '1', value: '01'});\n```\n\n## encodeTlvStream\n\nEncode key value pairs as a TLV stream\n\n    {\n      records: [{\n        type: <Message Type Number String>\n        value: <Raw Value Hex String>\n      }]\n    }\n\n    @throws\n    <Error>\n\n    @returns\n    {\n      encoded: <TLV Records Stream Hex Encoded String>\n    }\n\nExample:\n\n```node\nconst {encodeTlvStream} = require('bolt01');\n\n// encoded: '010101'\nconst {encoded} = encodeTlvStream({records: [{type: '1', value: '01'}]});\n```\n","publish_time":1791330157374,"_cnpm_publish_time":1791330157374,"dist-tags":{"latest":"4.0.1"}}