Skip to content
New issue

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

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

Already on GitHub? # to your account

Add support for African currencies to CurrencyUnit enum #518

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Gudnessuche
Copy link
Contributor

  • Added Nigerian Naira (NGN), Ghanaian Cedis (GHS), Kenyan Shillings (KES), and South African Rands (ZAR) to the CurrencyUnit enum.
  • Updated the derivation_index method to include these new currencies.
  • Modified the FromStr and Display implementations to recognize and handle the new currency codes.
  • Enhanced serialization and deserialization to support the new currencies.

This change is aimed at improving inclusivity and supporting the growing adoption of the Cashu protocol in African countries. By adding these currencies, users in Nigeria, Ghana, Kenya, and South Africa can now utilize the protocol more effectively with their local currencies.

- Added Nigerian Naira (NGN), Ghanaian Cedis (GHS), Kenyan Shillings (KES), and South African Rands (ZAR) to the CurrencyUnit enum.
- Updated the derivation_index method to include these new currencies.
- Modified the FromStr and Display implementations to recognize and handle the new currency codes.
- Enhanced serialization and deserialization to support the new currencies.

This change is aimed at improving inclusivity and supporting the growing adoption of the Cashu protocol in African countries. By adding these currencies, users in Nigeria, Ghana, Kenya, and South Africa can now utilize the protocol more effectively with their local currencies.
Comment on lines +400 to +403
Self::Ngn => Some(4),
Self::Ghs => Some(5),
Self::Kes => Some(6),
Self::Zar => Some(7),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR. This isn't an issue introduced by this PR but the current way we do derivation path by just assigning numbers does not scale well and I don't think we should add more with this method. We've discussed the idea of using a short hashing method to achieve this. #464 (review)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants