diff --git a/package.json b/package.json index 51ff75a..cf68177 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "husky": "^8.0.3", "jest": "^29.5.0", "jest-fetch-mock": "^3.0.3", - "light-bolt11-decoder": "^3.1.1", + "light-bolt11-decoder": "^3.2.0", "lint-staged": "^14.0.0", "microbundle": "^0.15.1", "nostr-tools": "^1.17.0", diff --git a/src/utils/light-bolt11-decoder.d.ts b/src/utils/light-bolt11-decoder.d.ts deleted file mode 100644 index 31eac3e..0000000 --- a/src/utils/light-bolt11-decoder.d.ts +++ /dev/null @@ -1,90 +0,0 @@ -// TODO: remove when https://github.com/nbd-wtf/light-bolt11-decoder/pull/4 is merged -declare module "light-bolt11-decoder" { - type NetworkSection = { - name: "coin_network"; - letters: string; - value?: { - bech32: string; - pubKeyHash: number; - scriptHash: number; - validWitnessVersions: number[]; - }; - }; - - type FeatureBits = { - option_data_loss_protect: string; - initial_routing_sync: string; - option_upfront_shutdown_script: string; - gossip_queries: string; - var_onion_optin: string; - gossip_queries_ex: string; - option_static_remotekey: string; - payment_secret: string; - basic_mpp: string; - option_support_large_channel: string; - extra_bits: { - start_bit: number; - bits: unknown[]; - has_required: boolean; - }; - }; - - type RouteHint = { - pubkey: string; - short_channel_id: string; - fee_base_msat: number; - fee_proportional_millionths: number; - cltv_expiry_delta: number; - }; - - type RouteHintSection = { - name: "route_hint"; - tag: "r"; - letters: string; - value: RouteHint[]; - }; - - type FeatureBitsSection = { - name: "feature_bits"; - tag: "9"; - letters: string; - value: FeatureBits; - }; - - type Section = - | { name: "paymentRequest"; value: string } - | { name: "expiry"; value: number } - | { name: "checksum"; letters: string } - | NetworkSection - | { name: "amount"; letters: string; value: string } - | { name: "separator"; letters: string } - | { name: "timestamp"; letters: string; value: number } - | { name: "payment_hash"; tag: "p"; letters: string; value: string } - | { name: "description"; tag: "d"; letters: string; value: string } - | { name: "payment_secret"; tag: "s"; letters: string; value: string } - | { - name: "min_final_cltv_expiry"; - tag: "c"; - letters: string; - value: number; - } - | FeatureBitsSection - | RouteHintSection - | { name: "signature"; letters: string; value: string }; - - type PaymentJSON = { - paymentRequest: string; - sections: Section[]; - expiry: number; - route_hints: RouteHint[][]; - }; - - type DecodedInvoice = { - paymentRequest: string; - sections: Section[]; - expiry: number; - route_hints: RouteHint[][]; - }; - - function decode(invoice: string): DecodedInvoice; -} diff --git a/yarn.lock b/yarn.lock index d10e550..65d70e1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4430,10 +4430,10 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -light-bolt11-decoder@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/light-bolt11-decoder/-/light-bolt11-decoder-3.1.1.tgz#2b0d33257026ed2a4678c0980a01dcf827bcb928" - integrity sha512-sLg/KCwYkgsHWkefWd6KqpCHrLFWWaXTOX3cf6yD2hAzL0SLpX+lFcaFK2spkjbgzG6hhijKfORDc9WoUHwX0A== +light-bolt11-decoder@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/light-bolt11-decoder/-/light-bolt11-decoder-3.2.0.tgz#2d48f78386cde526c4131db8f9dfd3250a2d5d4d" + integrity sha512-3QEofgiBOP4Ehs9BI+RkZdXZNtSys0nsJ6fyGeSiAGCBsMwHGUDS/JQlY/sTnWs91A2Nh0S9XXfA8Sy9g6QpuQ== dependencies: "@scure/base" "1.1.1"