tgerboui / nona-lib

TypeScript library to simplify interactions with the Nano currency node.
MIT License
6 stars 1 forks source link

Nano Name Service Integration #1

Closed luxbe closed 2 months ago

luxbe commented 3 months ago

Hi @tgerboui!

Looks like a promising library! Thank you for your work :heart: I would love to contribute to the project, but would love to know which issues I could help you with. Maybe I could start with the nano.to integration? Or is there any other area I could contribute to? Let me know!

Looking forward to hearing from you!

tgerboui commented 3 months ago

Hello @luxbe,

Thank you for your interest in this library!

You can start by integrating nano.to if you feel like it. Don't hesitate to open a pull request when you have a first version. How do you plan to integrate it? I haven't really thought about it yet.

It's still a young project, so don't hesitate to give feedback on the architecture or the code.

Thank you so much for offering to help.

luxbe commented 3 months ago

I haven't looked deep enough into the codebase yet to give specific feedback, but on the first view it looks really promising! The amount of comments and documentation are impressive - especially for such a young and small project! But I would love to have a deeper look by helping out with features and issues.

For the nano.to integration, I see two possible paths:

  1. Implicitly - right inside the Wallet class we could check if the given address is a valid nano address (nano_xxx) or a username (@yyy). When a username is detected, it could be resolved with a simple fetch call.

  2. Explicitly - we could provide a NanoToResolver or something, that can resolve usernames. The user would call this resolver explicitly and use the resulting address to use the wallet or similar normally.

Which variant would you say works best for you? Or do you see another alternative?

tgerboui commented 3 months ago

Oh right ! I misspoke in the roadmap by integrating nano.to I was thinking of adapting some of the rpc.nano.to calls.

But integrating the Nano Name Service is a great idea! And much simpler for a first PR.

And I think the implicit way would be the best! What do you think?

I'll update the roadmap.

luxbe commented 3 months ago

I think so to and already started implementing a first version. I will open a PR in the coming days!

tgerboui commented 3 months ago

Great, I checked you first commit and it seem well started, adding a format check on the address is good point. Be brave for all the unit test update and don't forget to add you own to maintain 100% code coverage (you can check the coverage using the script yarn coverage).

Thanks again !

tgerboui commented 2 months ago

@luxbe I was thinking of creating a discord server to discuss the project code. Would you be interested?

luxbe commented 2 months ago

I prefer discussion of code changes on GitHub, so others can more easily contribute! If you search on google, you could find these threats way easier than on discord. But we could still chat about the implementation details and related works, if you want to create a discord server :smile: