You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 17, 2019. It is now read-only.
I wrote some Typescript typings for this library, which I am using in my local project. I would be more than happy to open a PR against DefinitelyTyped so they can be published under the npm @types org. Alternatively, they could live in this project.
Let me know your thoughts. Thanks!
Types:
declare module 'lightnode-invoice'{/** * Decodes a bech32 encoded lightning invoice. Exceptions are thrown for invalid invoices. * @param invoice The bech32 encoded lightning invoice. */functiondecode(invoice: string): Invoice;/** * Encodes an invoice into a bech32 encoded lightning invoice. * @param invoice The invoice class instance. * @param privKey The private key used to sign the invoice. */functionencode(invoice: Invoice,privKey: string): string;/** * Represents a payment invoice. */classInvoice{/** * Network prefix. */publicnetwork: 'bc'|'tb'|'crt'|'sm';/** * Amount in bitcoin. */publicamount: number;/** * Timestamp of the invoice. */publictimestamp: number;/** * Raw fields that are known in BOLT 11. */publicfields: any[];/** * Raw fields that are unknown in BOLT 11. */publicunknownFields: any[];/** * Signature that was used to sign the invoice. */publicsignature: Signature;/** * Pubkey that was recovered from the signature or provided in an n field. */publicpubkey: Pubkey/** * SHA256 of the data that was signed. */publichashData: Buffer;/** * Expiry time in seconds, defaults to 3600 (per BOLT 11). */publicreadonlyexpiry: number;/** * SHA256 of the payment_preimage provided in return for payment. */publicpaymentHash: Buffer;/** * Short description. */publicshortDesc: string;/** * Hash of the long description. */publichashDesc: Buffer;/** * Optional pubkey of the payee node. */publicpayeeNode: Buffer;/** * min_final_cltv_expiry to use for the last node, defaults to 9 (per BOLT 11). */publicminFinalCltvExpiry: number;/** * List of on-chain addresses to fall back if payment fails. Supports version 0, 17, 18 addresses. */publicreadonlyfallbackAddresses: FallbackAddress[];/** * List of routes that should be used. */publicreadonlyroutes: Route[];/** * Add a P2PKH or P2SH address in base58check or bech32 encoding. * @param addrStr The address string. */publicaddFallbackAddress(addrStr: string): void;/** * Adds a new private route * @param routes The private routes */publicaddRoute(routes: Route[]): void;}exportinterfaceSignature{r: Buffer;s: Buffer;recoveryFlag: number;}exportinterfacePubkey{x: Buffer;y: Buffer;}exportinterfaceFallbackAddress{version: number;address: Buffer;}exportinterfaceRoute{pubkey: Buffer;short_channel_id: Buffer;fee_base_msat: number;fee_proportional_millionths: number;cltv_expiry_delta: number;}export{decode,encode,Invoice,};}
The text was updated successfully, but these errors were encountered:
I wrote some Typescript typings for this library, which I am using in my local project. I would be more than happy to open a PR against DefinitelyTyped so they can be published under the npm @types org. Alternatively, they could live in this project.
Let me know your thoughts. Thanks!
Types:
The text was updated successfully, but these errors were encountered: