Comparing version 1.1.7 to 1.2.0
@@ -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, |
@@ -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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
92531
53
2377
201