{"name":"invoices","version":"6.3.2","keywords":["bolt11","bolt12","invoice","lightning","lightning-network","offer","payment-request"],"author":{"url":"https://x.com/alexbosworth","name":"Alex Bosworth"},"license":"MIT","_id":"invoices@6.3.2","maintainers":[{"name":"alexbosworth","email":"alex.bosworth+npm@gmail.com"}],"homepage":"https://github.com/alexbosworth/invoices#readme","bugs":{"url":"https://github.com/alexbosworth/invoices/issues"},"dist":{"shasum":"34c45eb7fc074962e0af935e86f6ea5a537842de","tarball":"http://registry-npm.ywwl.com/invoices/download/invoices-6.3.2.tgz","fileCount":92,"integrity":"sha512-gZ0qZzQ8FbG03eLH3X46R56NEdjd4SteXiK8wUTIoYdRSQ+Ua3OOVlWPLaaLdmnYL0GJcAYJ3pujxAKaEYypOQ==","signatures":[{"sig":"MEYCIQDguicwnpY+Io5U6NEVS+jvBdGMgGASYe+DHlJSGfB0nwIhAMsntLXsJ580xvY9fmUP7DrkTzecjAzt5YVelJ2eYKHP","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCICU5OprnUzj0B+hErLcl5gscv9UuHHXjy4gTHh9/+GybAiBu/2lcfYbkRBQA6HXTx1LNIeLzoiw2TZ7FbkyMk6gxNA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":243136,"size":50071,"noattachment":false,"key":"/invoices/-/invoices-6.3.2.tgz"},"main":"index.js","engines":{"node":">=22"},"gitHead":"02c8d8a908774a0fedcb847ea95e4ba677eff954","scripts":{"test":"node --experimental-test-coverage --test"},"_npmUser":{"name":"alexbosworth","email":"alex.bosworth+npm@gmail.com"},"repository":{"url":"git+https://github.com/alexbosworth/invoices.git","type":"git"},"_npmVersion":"11.19.0","description":"Methods for working with LN invoices","directories":{},"_nodeVersion":"24.22.1","dependencies":{"bech32":"2.0.0","bolt01":"4.0.1","bolt07":"2.0.0","bolt09":"3.0.0","tiny-secp256k1":"2.2.4","@alexbosworth/blockchain":"4.12.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/invoices_6.3.2_1793114009039_0.9399629221878221","host":"s3://npm-registry-packages-npm-production"},"readme":"# Invoices\n\nUtility methods for Lightning Network invoices: creating, signing and parsing\nBOLT 11 payment requests and BOLT 12 offers, invoice requests and invoices.\n\n## Methods\n\n### byteDecodeRequest\n\nDerive a payment request from request data.\n\n    {\n      encoded: <Payment Request Details Hex String>\n      [mtokens]: <Millitokens Number String>\n      network: <Network Name String>\n      words: <Words Count Number>\n    }\n\n    @throws\n    <Error>\n\n    @returns\n    {\n      request: <BOLT 11 Encoded Payment Request String>\n    }\n\nExample:\n\n```node\nconst {byteDecodeRequest} = require('invoices');\n\n// Get a BOLT 11 payment request for this invoice data\nconst {request} = byteDecodeRequest({\n  encoded: paymentRequestDetailsHexString,\n  mtokens: '0',\n  network: 'bitcoin',\n  words: paymentRequestWordsCount,\n});\n```\n\n### byteEncodeRequest\n\nDerive bytes for payment request details\n\n    {\n      request: <BOLT 11 Encoded Payment Request String>\n    }\n\n    @throws\n    <Error>\n\n    @returns\n    {\n      encoded: <Payment Request Details Hex String>\n      mtokens: <Millitokens Number String>\n      network: <Network Name String>\n      words: <Word Length Number>\n    }\n\nExample:\n\n```node\nconst {byteEncodeRequest} = require('invoices');\n\n// Get the bytes for a payment request\nconst {encoded, mtokens, network, words} = byteEncodeRequest({\n  request: bolt11EncodedPaymentRequestString,\n});\n```\n\n### createInvoiceError\n\nCreate a BOLT 12 invoice error\n\n`suggested_value` requires `erroneous_field`\n\n    {\n      [erroneous_field]: <Erroneous Record Type Number String>\n      message: <Error Message String>\n      [suggested_value]: <Suggested Record Value Hex String>\n    }\n\n    @throws\n    <Error>\n\n    @returns\n    {\n      encoded: <Invoice Error TLV Stream Hex String>\n    }\n\nExample:\n\n```node\nconst {createInvoiceError} = require('invoices');\n\n// Explain that the requested amount was too low, suggesting an amount\nconst {encoded} = createInvoiceError({\n  erroneous_field: '82',\n  message: 'Amount too low',\n  suggested_value: '2710',\n});\n```\n\n### createOffer\n\nCreate a BOLT 12 offer\n\nEither `issuer_id` or `paths` is required, `description` is required with an\namount, and `amount` requires `currency`\n\n    {\n      [amount]: <Amount in Currency Minor Units String>\n      [currency]: <ISO 4217 Currency Code String>\n      [description]: <Description String>\n      [expires_at]: <Offer Expires At ISO 8601 Date String>\n      [features]: [{\n        bit: <BOLT 09 Feature Bit Number>\n      }]\n      [issuer]: <Issuer Identifier String>\n      [issuer_id]: <Issuer Node Public Key Hex String>\n      [max_quantity]: <Maximum Quantity Number> (zero for unlimited)\n      [metadata]: <Metadata Hex String>\n      [mtokens]: <Amount Millitokens String>\n      [networks]: [<Network Name String>]\n      [paths]: [{\n        hops: [{\n          encrypted_data: <Encrypted Recipient Data Hex String>\n          relay_key: <Blinded Relaying Node Public Key Hex String>\n        }]\n        [introduction_edge]: <Introduction Node Edge Format Channel Id String>\n        [introduction_node]: <Introduction Node Public Key Hex String>\n        key: <First Hop Path Key Public Key Hex String>\n      }]\n    }\n\n    @throws\n    <Error>\n\n    @returns\n    {\n      offer: <BOLT 12 Offer String>\n    }\n\nExample:\n\n```node\nconst {createOffer} = require('invoices');\n\n// Offer to sell a coffee for 250 sats to anyone who requests an invoice\nconst {offer} = createOffer({\n  description: 'A cup of coffee',\n  issuer_id: nodePublicKey,\n  mtokens: '250000',\n});\n```\n\n### createSignedInvoice\n\nAssemble a signed BOLT 12 invoice\n\nEither a `secret` key to sign with or a `signature` over the unsigned invoice\n`hash` is required\n\n    {\n      encoded: <Unsigned Invoice TLV Stream Hex String>\n      [secret]: <Node Id Private Key Hex String>\n      [signature]: <Node Id BIP 340 Signature Hex String>\n    }\n\n    @throws\n    <Error>\n\n    @returns\n    {\n      encoded: <Signed Invoice TLV Stream Hex String>\n      invoice: <BOLT 12 Invoice String>\n    }\n\nExample:\n\n```node\nconst {createSignedInvoice} = require('invoices');\n\n// Get encoded, root and tag from createUnsignedInvoice\n// Get signature via LND signBytes with type schnorr, or sign hash directly\nconst {encoded, invoice} = createSignedInvoice({\n  encoded: unsignedInvoiceHex,\n  signature: nodeIdSchnorrSignature,\n});\n```\n\n### createSignedInvoiceRequest\n\nAssemble a signed BOLT 12 invoice request for an offer\n\nEither a `secret` key to sign with or a `signature` over the unsigned request\n`hash` is required\n\nA request that is not for an offer is not signed\n\n    {\n      encoded: <Unsigned Invoice Request TLV Stream Hex String>\n      [secret]: <Payer Id Private Key Hex String>\n      [signature]: <Payer Id BIP 340 Signature Hex String>\n    }\n\n    @throws\n    <Error>\n\n    @returns\n    {\n      encoded: <Signed Invoice Request TLV Stream Hex String>\n      request: <BOLT 12 Invoice Request String>\n    }\n\nExample:\n\n```node\nconst {createSignedInvoiceRequest} = require('invoices');\n\n// Get encoded from createUnsignedInvoiceRequest, sign with the payer key\nconst {encoded, request} = createSignedInvoiceRequest({\n  encoded: unsignedRequestHex,\n  secret: payerPrivateKey,\n});\n```\n\n### createSignedRequest\n\nAssemble a signed payment request\n\n`signature` is not required when using blinded paths in the request\n\n    {\n      [destination]: <Destination Public Key Hex String>\n      hrp: <Request Human Readable Part String>\n      [signature]: <Request Hash Signature Hex String>\n      tags: [<Request Tag Word Number>]\n    }\n\n    @throws\n    <Error>\n\n    @returns\n    {\n      request: <BOLT 11 Encoded Payment Request String>\n    }\n\nExample:\n\n```node\nconst {createSignedRequest} = require('invoices');\n\n// Get hrp and signature from createUnsignedRequest\n// Get signature via standard private key signing, or LND signBytes\nconst {request} = createSignedRequest({\n  destination: nodePublicKey,\n  hrp: amountAndNetworkHrp,\n  signature: signedPreimageHash,\n  tags: paymentRequestTags,\n});\n```\n\n### createUnsignedInvoice\n\nCreate an unsigned BOLT 12 invoice for an invoice request\n\nEither `encoded` or `request` is required\n\n`mtokens` defaults to the requested or offer amount\n\n`node_id` is required when the request offer has no `issuer_id`, otherwise it\ndefaults to the offer `issuer_id`\n\n`records` are experimental invoice records, with types from 3000000000 to\n3999999999\n\n    {\n      [chain_addresses]: [<Fallback Chain Address String>]\n      [created_at]: <Invoice Creation Date ISO 8601 String>\n      [encoded]: <Invoice Request TLV Stream Hex String>\n      [expires_at]: <Invoice Expires At ISO 8601 Date String>\n      [features]: [{\n        bit: <BOLT 09 Feature Bit Number>\n      }]\n      id: <Payment Hash Hex String>\n      [mtokens]: <Invoice Amount Millitokens String>\n      [node_id]: <Invoice Node Public Key Hex String>\n      paths: [{\n        base_fee_mtokens: <Accumulated Base Fee Millitokens String>\n        cltv_delta: <Accumulated CLTV Expiry Delta Number>\n        [features]: [{\n          bit: <BOLT 09 Feature Bit Number>\n        }]\n        fee_rate: <Accumulated Fee Rate Millitokens Per Million Number>\n        hops: [{\n          encrypted_data: <Encrypted Recipient Data Hex String>\n          relay_key: <Blinded Relaying Node Public Key Hex String>\n        }]\n        [introduction_edge]: <Introduction Node Edge Format Channel Id String>\n        [introduction_node]: <Introduction Node Public Key Hex String>\n        key: <First Hop Path Key Public Key Hex String>\n        max_htlc_mtokens: <Maximum HTLC Millitokens String>\n        min_htlc_mtokens: <Minimum HTLC Millitokens String>\n      }]\n      [records]: [{\n        type: <Experimental Invoice Record Type Number String>\n        value: <Experimental Invoice Record Value Hex String>\n      }]\n      [request]: <BOLT 12 Invoice Request String>\n    }\n\n    @throws\n    <Error>\n\n    @returns\n    {\n      encoded: <Unsigned Invoice TLV Stream Hex String>\n      hash: <Tagged Merkle Root Hash To Sign Hex String>\n      root: <Merkle Root Hash Hex String>\n      tag: <Signature Tag String>\n    }\n\nExample:\n\n```node\nconst {createUnsignedInvoice} = require('invoices');\n\n// Get a blinded payment path from bolt04 paymentPathFromChannels\nconst {encoded, hash, root, tag} = createUnsignedInvoice({\n  encoded: receivedInvoiceRequestHex,\n  id: paymentHash,\n  paths: [blindedPaymentPath],\n});\n// Use createSignedInvoice with a signature over hash to complete the invoice\n```\n\n### createUnsignedInvoiceRequest\n\nCreate an unsigned BOLT 12 invoice request\n\nWithout an `offer`, `description` and `mtokens` are required and `request` is\ncomplete without a signature\n\n`description`, `expires_at`, `issuer` and `paths` cannot be set with an `offer`\n\n    {\n      [bip353_name]: <BIP 353 Human Readable Name String>\n      [description]: <Description String>\n      [expires_at]: <Request Expires At ISO 8601 Date String>\n      [features]: [{\n        bit: <BOLT 09 Feature Bit Number>\n      }]\n      [issuer]: <Issuer Identifier String>\n      [metadata]: <Payer Metadata Hex String>\n      [mtokens]: <Requested Amount Millitokens String>\n      [network]: <Network Name String>\n      [offer]: <BOLT 12 Offer String>\n      payer_id: <Payer Public Key Hex String>\n      [payer_note]: <Payer Note String>\n      [paths]: [{\n        hops: [{\n          encrypted_data: <Encrypted Recipient Data Hex String>\n          relay_key: <Blinded Relaying Node Public Key Hex String>\n        }]\n        [introduction_edge]: <Introduction Node Edge Format Channel Id String>\n        [introduction_node]: <Introduction Node Public Key Hex String>\n        key: <First Hop Path Key Public Key Hex String>\n      }]\n      [quantity]: <Requested Quantity Number>\n    }\n\n    @throws\n    <Error>\n\n    @returns\n    {\n      encoded: <Unsigned Invoice Request TLV Stream Hex String>\n      [hash]: <Tagged Merkle Root Hash To Sign Hex String>\n      [request]: <BOLT 12 Invoice Request Without Offer String>\n      [root]: <Merkle Root Hash Hex String>\n      [tag]: <Signature Tag String>\n    }\n\nExample:\n\n```node\nconst {createUnsignedInvoiceRequest} = require('invoices');\n\n// Request an invoice for an offer with a transient payer key\nconst {encoded, hash, root, tag} = createUnsignedInvoiceRequest({\n  offer: bolt12OfferString,\n  payer_id: payerPublicKey,\n});\n// Use createSignedInvoiceRequest with a signature to complete the request\n```\n\n### createUnsignedRequest\n\nCreate an unsigned payment request\n\n`paths` are bLIP 39 blinded paths. If using, omit `destination`, `payment`, and\n`routes`\n\nOmit `cltv_delta` to use the BOLT 11 default of 18 blocks.\n\n    {\n      [chain_addresses]: [<Chain Address String>]\n      [cltv_delta]: <Positive CLTV Delta Number>\n      [created_at]: <Invoice Creation Date ISO 8601 String>\n      [description]: <Description String>\n      [description_hash]: <Description Hash Hex String>\n      [destination]: <Public Key String>\n      [expires_at]: <ISO 8601 Date String>\n      features: [{\n        bit: <BOLT 09 Feature Bit Number>\n      }]\n      id: <Preimage SHA256 Hash Hex String>\n      [mtokens]: <Requested Milli-Tokens Value String> (can exceed Number limit)\n      network: <Network Name String>\n      [paths]: [{\n        base_fee_mtokens: <Accumulated Base Fee Millitokens String>\n        cltv_delta: <Accumulated CLTV Expiry Delta Number>\n        [features]: [{\n          bit: <BOLT 09 Feature Bit Number>\n        }]\n        fee_rate: <Accumulated Fee Rate Millitokens Per Million Number>\n        hops: [{\n          encrypted_data: <Encrypted Recipient Data Hex String>\n          relay_key: <Relaying Node Public Key Hex String>\n        }]\n        [introduction_node]: <Introduction Node Public Key Hex String>\n        key: <First Hop Path Key Public Key Hex String>\n        max_htlc_mtokens: <Maximum HTLC Millitokens String>\n        min_htlc_mtokens: <Minimum HTLC Millitokens String>\n      }]\n      [payment]: <Payment Identifier Hex String>\n      [routes]: [[{\n        [base_fee_mtokens]: <Base Fee Millitokens String>\n        [channel]: <Standard Format Channel Id String>\n        [cltv_delta]: <Final CLTV Expiration Blocks Delta Number>\n        [fee_rate]: <Fee Rate Millitokens Per Million Number>\n        public_key: <Forward Edge Public Key Hex String>\n      }]]\n      [tokens]: <Requested Chain Tokens Number> (note: can differ from mtokens)\n    }\n\n    @returns\n    {\n      hash: <Payment Request Signature Hash Hex String>\n      hrp: <Human Readable Part of Payment Request String>\n      preimage: <Signature Hash Preimage Hex String>\n      tags: [<Data Tag Number>]\n    }\n\nExample:\n\n```node\nconst {createUnsignedRequest} = require('invoices');\n\nconst unsignedComponents = createUnsignedRequest({\n  destination: nodePublicKey,\n  id: rHashHexString,\n  network: 'bitcoin',\n});\n// Use createSignedRequest and a signature to create a complete request\n```\n\n### parseInvoice\n\nParse a BOLT 12 invoice into its component data\n\nEither `encoded` or `invoice` is required\n\n`request` checks that the invoice is for the invoice request that was sent\n\n    {\n      [encoded]: <Invoice TLV Stream Hex String>\n      [invoice]: <BOLT 12 Invoice String>\n      [request]: <Sent BOLT 12 Invoice Request String>\n    }\n\n    @throws\n    <Error>\n\n    @returns\n    {\n      [bip353_name]: <BIP 353 Human Readable Name String>\n      [chain_addresses]: [<Fallback Chain Address String>]\n      created_at: <Invoice Creation Date ISO 8601 String>\n      [description]: <Request Description String>\n      encoded: <Invoice TLV Stream Hex String>\n      expires_at: <Invoice Expires At ISO 8601 Date String>\n      features: [{\n        bit: <BOLT 09 Feature Bit Number>\n        is_required: <Feature Support is Required To Pay Bool>\n        type: <Feature Type String>\n      }]\n      id: <Payment Hash Hex String>\n      invoice: <BOLT 12 Invoice String>\n      is_expired: <Invoice is Expired Bool>\n      [issuer]: <Request Issuer Identifier String>\n      metadata: <Payer Metadata Hex String>\n      mtokens: <Invoice Amount Millitokens String>\n      network: <Network Name String>\n      node_id: <Invoice Node Public Key Hex String>\n      [offer]: <BOLT 12 Offer String>\n      paths: [{\n        base_fee_mtokens: <Accumulated Base Fee Millitokens String>\n        cltv_delta: <Accumulated CLTV Expiry Delta Number>\n        features: [{\n          bit: <BOLT 09 Feature Bit Number>\n          is_required: <Feature Support is Required To Pay Bool>\n          type: <Feature Type String>\n        }]\n        fee_rate: <Accumulated Fee Rate Millitokens Per Million Number>\n        hops: [{\n          encrypted_data: <Encrypted Recipient Data Hex String>\n          relay_key: <Blinded Relaying Node Public Key Hex String>\n        }]\n        [introduction_edge]: <Introduction Node Edge Format Channel Id String>\n        [introduction_node]: <Introduction Node Public Key Hex String>\n        key: <First Hop Path Key Public Key Hex String>\n        max_htlc_mtokens: <Maximum HTLC Millitokens String>\n        min_htlc_mtokens: <Minimum HTLC Millitokens String>\n      }]\n      payer_id: <Payer Public Key Hex String>\n      [payer_note]: <Payer Note String>\n      [quantity]: <Requested Quantity Number>\n      safe_tokens: <Invoice Amount Tokens Rounded Up Number>\n      signature: <Node Id BIP 340 Signature Hex String>\n      tokens: <Invoice Amount Tokens Rounded Down Number>\n    }\n\nExample:\n\n```node\nconst {parseInvoice} = require('invoices');\n\n// Decoded details of the invoice for the invoice request that was sent\nconst invoiceDetails = parseInvoice({\n  encoded: receivedInvoiceHex,\n  request: sentInvoiceRequestString,\n});\n```\n\n### parseInvoiceError\n\nParse a BOLT 12 invoice error into its component data\n\n    {\n      encoded: <Invoice Error TLV Stream Hex String>\n    }\n\n    @throws\n    <Error>\n\n    @returns\n    {\n      [erroneous_field]: <Erroneous Record Type Number String>\n      message: <Error Message String>\n      [suggested_value]: <Suggested Record Value Hex String>\n    }\n\nExample:\n\n```node\nconst {parseInvoiceError} = require('invoices');\n\n// Decoded details of the invoice error\nconst {message} = parseInvoiceError({encoded: receivedInvoiceErrorHex});\n```\n\n### parseInvoiceRequest\n\nParse a BOLT 12 invoice request into its component data\n\nEither `encoded` or `request` is required\n\n`paths` are blinded paths to send the invoice to\n\n    {\n      [encoded]: <Invoice Request TLV Stream Hex String>\n      [request]: <BOLT 12 Invoice Request String>\n    }\n\n    @throws\n    <Error>\n\n    @returns\n    {\n      [bip353_name]: <BIP 353 Human Readable Name String>\n      [description]: <Request Description String>\n      encoded: <Invoice Request TLV Stream Hex String>\n      [expires_at]: <Request Expires At ISO 8601 Date String>\n      features: [{\n        bit: <BOLT 09 Feature Bit Number>\n        is_required: <Feature Support is Required Bool>\n        type: <Feature Type String>\n      }]\n      [issuer]: <Request Issuer Identifier String>\n      metadata: <Payer Metadata Hex String>\n      [mtokens]: <Requested Amount Millitokens String>\n      network: <Network Name String>\n      [offer]: <BOLT 12 Offer String>\n      payer_id: <Payer Public Key Hex String>\n      [payer_note]: <Payer Note String>\n      [paths]: [{\n        hops: [{\n          encrypted_data: <Encrypted Recipient Data Hex String>\n          relay_key: <Blinded Relaying Node Public Key Hex String>\n        }]\n        [introduction_edge]: <Introduction Node Edge Format Channel Id String>\n        [introduction_node]: <Introduction Node Public Key Hex String>\n        key: <First Hop Path Key Public Key Hex String>\n      }]\n      [quantity]: <Requested Quantity Number>\n      request: <BOLT 12 Invoice Request String>\n      [signature]: <Payer Id BIP 340 Signature Hex String>\n    }\n\nExample:\n\n```node\nconst {parseInvoiceRequest} = require('invoices');\n\n// Decoded details of the invoice request\nconst requestDetails = parseInvoiceRequest({encoded: receivedRequestHex});\n```\n\n### parseOffer\n\nParse a BOLT 12 offer into its component data\n\nEither `encoded` or `offer` is required\n\n`paths` are blinded paths to send invoice requests to\n\n    {\n      [encoded]: <Offer TLV Stream Hex String>\n      [offer]: <BOLT 12 Offer String>\n    }\n\n    @throws\n    <Error>\n\n    @returns\n    {\n      [amount]: <Amount in Currency Minor Units String>\n      [currency]: <ISO 4217 Currency Code String>\n      [description]: <Description String>\n      encoded: <Offer TLV Stream Hex String>\n      [expires_at]: <Offer Expires At ISO 8601 Date String>\n      features: [{\n        bit: <BOLT 09 Feature Bit Number>\n        is_required: <Feature Support is Required Bool>\n        type: <Feature Type String>\n      }]\n      is_expired: <Offer is Expired Bool>\n      [issuer]: <Issuer Identifier String>\n      [issuer_id]: <Issuer Node Public Key Hex String>\n      [max_quantity]: <Maximum Quantity Number> (zero for unlimited)\n      [metadata]: <Metadata Hex String>\n      [mtokens]: <Amount Millitokens String>\n      networks: [<Known Network Name String>]\n      offer: <BOLT 12 Offer String>\n      [paths]: [{\n        hops: [{\n          encrypted_data: <Encrypted Recipient Data Hex String>\n          relay_key: <Blinded Relaying Node Public Key Hex String>\n        }]\n        [introduction_edge]: <Introduction Node Edge Format Channel Id String>\n        [introduction_node]: <Introduction Node Public Key Hex String>\n        key: <First Hop Path Key Public Key Hex String>\n      }]\n    }\n\nExample:\n\n```node\nconst {parseOffer} = require('invoices');\n\n// Decoded details of the offer\nconst offerDetails = parseOffer({offer: 'lno1...'});\n```\n\n### parsePaymentRequest\n\nParse a BOLT 11 payment request into its component data\n\nNote: either description or description_hash will be returned\n\n`paths` are bLIP 39 blinded paths.\n\nBOLT 11 payer checks are deliberately left to payment flows. For example,\nparsing can succeed when a request omits a `payment` identifier required for\npayment.\n\n    {\n      request: <BOLT 11 Payment Request String>\n    }\n\n    @throws\n    <Error>\n\n    @returns\n    {\n      [chain_addresses]: [<Chain Address String>]\n      cltv_delta: <CLTV Delta Number>\n      created_at: <Invoice Creation Date ISO 8601 String>\n      [description]: <Description String>\n      [description_hash]: <Description Hash Hex String>\n      destination: <Public Key String>\n      expires_at: <ISO 8601 Date String>\n      features: [{\n        bit: <BOLT 09 Feature Bit Number>\n        is_required: <Feature Support is Required To Pay Bool>\n        type: <Feature Type String>\n      }]\n      id: <Payment Request Hash String>\n      is_expired: <Invoice is Expired Bool>\n      [mtokens]: <Requested Milli-Tokens Value String> (can exceed Number limit)\n      network: <Network Name String>\n      [paths]: [{\n        base_fee_mtokens: <Accumulated Base Fee Millitokens String>\n        cltv_delta: <Accumulated CLTV Expiry Delta Number>\n        features: [{\n          bit: <BOLT 09 Feature Bit Number>\n          is_required: <Feature Support is Required To Pay Bool>\n          type: <Feature Type String>\n        }]\n        fee_rate: <Accumulated Fee Rate Millitokens Per Million Number>\n        hops: [{\n          encrypted_data: <Encrypted Recipient Data Hex String>\n          relay_key: <Relaying Node Public Key Hex String>\n        }]\n        introduction_node: <Introduction Node Public Key Hex String>\n        key: <First Hop Path Key Public Key Hex String>\n        max_htlc_mtokens: <Maximum HTLC Millitokens String>\n        min_htlc_mtokens: <Minimum HTLC Millitokens String>\n      }]\n      [payment]: <Payment Identifier Hex Encoded String>\n      [routes]: [[{\n        [base_fee_mtokens]: <Base Fee Millitokens String>\n        [channel]: <Standard Format Channel Id String>\n        [cltv_delta]: <Final CLTV Expiration Blocks Delta Number>\n        [fee_rate]: <Fee Rate Millitokens Per Million Number>\n        public_key: <Forward Edge Public Key Hex String>\n      }]]\n      [safe_tokens]: <Requested Chain Tokens Rounded Up Number>\n      [tokens]: <Requested Chain Tokens Number> (note: can differ from mtokens)\n    }\n\n```node\nconst {parsePaymentRequest} = require('invoices');\n\n// Decoded details of the payment request\nconst requestDetails = parsePaymentRequest({request: 'paymentRequestString'});\n```\n","publish_time":1793114009140,"_cnpm_publish_time":1793114009140,"dist-tags":{"latest":"6.3.6"}}