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

export U8Array4, U8Array12, U8Array32 and U8Array64 #40

Merged
merged 2 commits into from
Jun 8, 2024

Conversation

kumulynja
Copy link
Contributor

@kumulynja kumulynja commented Apr 6, 2024

Since some functions or classes of the exported API require an U8Array4, U8Array12, U8Array32 or U8Array64 type as a parameter, it is needed to export them too. Otherwise it is not possible to pass a value to those parameters, the type will be wrong.

For example, to retrieve a payment, a PaymentHash PaymentHash({required U8Array32 data}) has to be passed. The parameter named data only accepts an U8Array32. Without the U8Array32 class being exported, it is impossible to create and pass a correct value of that type.

Instead of exporting the types, we could do the conversions to and from List, Uint8List or a hex String in the package, so no special type has to be exported. What do you think about that and which type would be best?

@kumulynja kumulynja changed the title export U8Array64 and U8Array32 export U8Array4, U8Array12, U8Array32 and U8Array64 Apr 7, 2024
@BitcoinZavior
Copy link
Contributor

Thanks!

@BitcoinZavior BitcoinZavior self-requested a review June 8, 2024 23:56
@BitcoinZavior BitcoinZavior merged commit 4e80570 into LtbLightning:main Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants