Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

invoices

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

invoices - npm Package Compare versions

Comparing version 1.1.7 to 1.2.0

bolt11/byte_decode_request.js

4

bolt11/index.js

@@ -0,1 +1,3 @@

const byteDecodeRequest = require('./byte_decode_request');
const byteEncodeRequest = require('./byte_encode_request');
const createSignedRequest = require('./create_signed_request');

@@ -6,2 +8,4 @@ const createUnsignedRequest = require('./create_unsigned_request');

module.exports = {
byteDecodeRequest,
byteEncodeRequest,
createSignedRequest,

@@ -8,0 +12,0 @@ createUnsignedRequest,

# Versions
## 1.2.0
- `byteDecodeRequest`: Add method to derive a payment request from request bytes
- `byteEncodeRequest`: Add method to derive bytes from a payment request
## 1.1.7

@@ -4,0 +9,0 @@

@@ -0,1 +1,3 @@

const {byteDecodeRequest} = require('./bolt11');
const {byteEncodeRequest} = require('./bolt11');
const {createSignedRequest} = require('./bolt11');

@@ -6,2 +8,4 @@ const {createUnsignedRequest} = require('./bolt11');

module.exports = {
byteDecodeRequest,
byteEncodeRequest,
createSignedRequest,

@@ -8,0 +12,0 @@ createUnsignedRequest,

4

package.json

@@ -16,3 +16,3 @@ {

"devDependencies": {
"tap": "15.0.1"
"tap": "15.0.2"
},

@@ -39,3 +39,3 @@ "engines": {

},
"version": "1.1.7"
"version": "1.2.0"
}

@@ -8,2 +8,62 @@ # Invoices

### byteDecodeRequest
Derive a payment request from request data.
{
encoded: <Payment Request Details Hex String>
mtokens: <Millitokens Number String>
network: <Network Name String>
}
@throws
<Error>
@returns
{
request: <BOLT 11 Encoded Payment Request String>
}
Example:
```node
const {byteDecodeRequest} = require('invoices');
// Get a BOLT 11 payment request for this invoice data
const {request} = byteDecodeRequest({
encoded: paymentRequestDetailsHexString,
mtokens: '0',
network: 'bitcoin',
});
```
### byteEncodeRequest
Derive bytes for payment request details
{
request: <BOLT 11 Encoded Payment Request String>
}
@throws
<Error>
@returns
{
encoded: <Payment Request Details Hex String>
mtokens: <Millitokens Number String>
network: <Network Name String>
}
Example:
```node
const {byteEncodeRequest} = require('invoices');
// Get the bytes for a payment request
const {encoded, mtokens, network} = byteEncodeRequest({
request: bolt11EncodedPaymentRequestString,
});
```
### createSignedRequest

@@ -10,0 +70,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc