Skip to content

Conversation

@Catrya
Copy link
Member

@Catrya Catrya commented Jan 19, 2026

  • Add fiat currencies and max orders fields
  • fix typos in the info about: orderExpirationExplanation, mostroPublicKeyExplanation, expirationHours and supportedChainsExplanation

Summary by CodeRabbit

  • New Features

    • Display of accepted fiat currencies in app settings
    • Display of maximum orders per response in technical details
    • Improved time unit pluralization for order lifespans
  • Documentation

    • Updated explanations for Mostro instance configuration
    • Enhanced multilingual support with new translations (English, Spanish, Italian)

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 19, 2026

Walkthrough

The MostroInstance data model is extended with two new fields: fiatCurrenciesAccepted (String) and maxOrdersPerResponse (int). These fields are populated from Nostr events through factory methods and extension getters. The About screen UI is updated to display these values with appropriate formatting, and localization strings are added in English, Spanish, and Italian.

Changes

Cohort / File(s) Summary
Data Model
lib/features/mostro/mostro_instance.dart
Added two new fields (fiatCurrenciesAccepted, maxOrdersPerResponse); updated constructor and fromEvent factory to initialize them; extended MostroInstanceExtensions with corresponding tag-based getters.
UI Display
lib/features/settings/about_screen.dart
Added UI rows for displaying fiat currencies and max orders per response; introduced _formatFiatCurrencies helper; improved orderLifespan pluralization; updated label from lndNodePublicKeyExplanation to mostroPublicKeyExplanation; adjusted spacing.
Localization
lib/l10n/intl_en.arb
lib/l10n/intl_es.arb
lib/l10n/intl_it.arb
Added new keys: all, fiatCurrenciesAccepted, maxOrdersPerResponse, hours, and corresponding explanation keys; updated existing explanations for mostroPublicKeyExplanation, orderExpirationExplanation, and supportedChainsExplanation (Italian file); translated to Spanish and Italian.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • grunch
  • chebizarro
  • AndreaDiazCorreia

Poem

🐰 Two fields hop into the model so neat,
Fiat currencies and order limits—complete!
Through Nostr events they gather their data,
UI rows display, translations translate-a,
A mostro of features, our P2P getter! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title "Improve about screen" is vague and generic, using non-descriptive terms that don't clearly convey the specific changes (new fields, typo fixes, content updates). Consider using a more specific title such as "Add fiat currencies and max orders fields to about screen" or "Update about screen with new Mostro instance fields and fixes".
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
lib/features/mostro/mostro_instance.dart (1)

23-48: Unsafe parsing in maxOrdersPerResponse getter will crash if tag is missing.

The factory method MostroInstance.fromEvent() correctly passes both new constructor arguments. However, line 106 uses int.parse(_getTagValue('max_orders_per_response')) which throws FormatException if the tag is missing, since _getTagValue() returns 'Tag: max_orders_per_response not found' as a fallback string (line 80). Use safe parsing with a fallback value:

int get maxOrdersPerResponse {
  final value = _getTagValue('max_orders_per_response');
  return value.startsWith('Tag:') ? 0 : int.parse(value);
}

Or wrap with try-catch at the call site in fromEvent.

@BraCR10
Copy link
Member

BraCR10 commented Jan 21, 2026

Hi @Catrya, should the information (displayed on the About screen) be updated when the Mostro instance is changed?

While testing, I switched to my local instance, but the info on the About screen didn’t change. It continued showing the old data. My local mostro node only accepts a few currencies.

Current local instance About screen says
Local instance About screen

@Catrya
Copy link
Member Author

Catrya commented Jan 21, 2026

@BraCR10 tu mostro está actualizado y publica los eventos de info con la kind 38385? debes esperar un momento despues de cambiar de instancia para que esa pantalla se actualice, fijate que todavia sale el mostro por defecto

@BraCR10
Copy link
Member

BraCR10 commented Jan 21, 2026

@Catrya listo funciona super bien , my bad.

Copy link
Member

@BraCR10 BraCR10 left a comment

Choose a reason for hiding this comment

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

De momento solo tengo esta observación

String get supportedNetworks => _getTagValue('lnd_networks');
String get lndNodeUri => _getTagValue('lnd_uris');
String get fiatCurrenciesAccepted => _getTagValue('fiat_currencies_accepted');
int get maxOrdersPerResponse => int.parse(_getTagValue('max_orders_per_response'));
Copy link
Member

Choose a reason for hiding this comment

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

_getTagValue() might return a not found message, This could throw an error if the parameter is missing, couldn't it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sí, pero el evento tiene que tener esas tags, no deberían faltar, _getTagValue se ha usado para todas las demás siempre porque se espera que estén

Copy link
Member

Choose a reason for hiding this comment

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

Listo, gracias por la aclaración

@BraCR10
Copy link
Member

BraCR10 commented Jan 22, 2026

LGTM

@Catrya Catrya requested a review from grunch January 22, 2026 18:46
Copy link
Member

@grunch grunch left a comment

Choose a reason for hiding this comment

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

utACK

@grunch grunch merged commit e64d8df into main Jan 23, 2026
2 checks passed
@grunch grunch deleted the improve-about-screen branch January 23, 2026 18:15
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.

4 participants