Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Narrower return types than P2Ret #21

Open
kyranjamie opened this issue Feb 18, 2023 · 0 comments
Open

Narrower return types than P2Ret #21

kyranjamie opened this issue Feb 18, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@kyranjamie
Copy link
Contributor

kyranjamie commented Feb 18, 2023

Currently P2Ret acts as a catch-all for the payment methods. It'd be more developer/typescript friendly to avoid the optional props, and return narrower payment-specific types.

For example, if I call the p2sh method, the compiler should know that redeemScript is defined. Usage of the library would be cleaner, in that fewer potentially undefined checks are needed.

(and thanks for all the great work Paul, this lib is a godsend)

@paulmillr paulmillr added the enhancement New feature or request label Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants