bip-321 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +2 -2
- package/package.json +3 -3
- package/validators.ts +3 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# BIP-321
|
|
1
|
+
# BIP-321 Parsing and Encoding
|
|
2
2
|
|
|
3
|
-
A TypeScript/JavaScript library for parsing BIP-321 Bitcoin URI scheme. This library validates and extracts payment information from Bitcoin URIs, supporting multiple payment methods including on-chain addresses, Lightning invoices, BOLT12 offers, and silent payments.
|
|
3
|
+
A TypeScript/JavaScript library for parsing and encoding BIP-321 Bitcoin URI scheme. This library validates and extracts payment information from Bitcoin URIs or lets you encode information, supporting multiple payment methods including on-chain addresses, Lightning invoices, BOLT12 offers, and silent payments.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bip-321",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "A TypeScript/JavaScript library for parsing BIP-321 Bitcoin URI scheme with support for multiple payment methods",
|
|
3
|
+
"version": "0.0.10",
|
|
4
|
+
"description": "A TypeScript/JavaScript library for parsing and encoding BIP-321 Bitcoin URI scheme with support for multiple payment methods",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.ts",
|
|
7
7
|
"module": "./index.ts",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"regtest"
|
|
41
41
|
],
|
|
42
42
|
"author": "",
|
|
43
|
-
"license": "
|
|
43
|
+
"license": "MIT",
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@noble/hashes": "^2.0.1",
|
|
46
46
|
"@scure/base": "^2.0.0",
|
package/validators.ts
CHANGED
|
@@ -144,7 +144,9 @@ export function validateLightningInvoice(invoice: string): {
|
|
|
144
144
|
if (
|
|
145
145
|
coinNetworkSection &&
|
|
146
146
|
"value" in coinNetworkSection &&
|
|
147
|
-
coinNetworkSection.value
|
|
147
|
+
coinNetworkSection.value &&
|
|
148
|
+
typeof coinNetworkSection.value === "object" &&
|
|
149
|
+
"bech32" in coinNetworkSection.value
|
|
148
150
|
) {
|
|
149
151
|
const bech32Prefix = coinNetworkSection.value.bech32;
|
|
150
152
|
switch (bech32Prefix) {
|