Skip to content

Commit e64d8df

Browse files
authored
Improve about screen (#411)
* feat: add fiat currencies and max orders fields to About screen * fix old typos * improve info about the chain
1 parent 3158bc4 commit e64d8df

File tree

5 files changed

+61
-11
lines changed

5 files changed

+61
-11
lines changed

lib/features/mostro/mostro_instance.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ class MostroInstance {
2020
final String supportedChains;
2121
final String supportedNetworks;
2222
final String lndNodeUri;
23+
final String fiatCurrenciesAccepted;
24+
final int maxOrdersPerResponse;
2325

2426
MostroInstance(
2527
this.pubKey,
@@ -41,6 +43,8 @@ class MostroInstance {
4143
this.supportedChains,
4244
this.supportedNetworks,
4345
this.lndNodeUri,
46+
this.fiatCurrenciesAccepted,
47+
this.maxOrdersPerResponse,
4448
);
4549

4650
factory MostroInstance.fromEvent(NostrEvent event) {
@@ -64,6 +68,8 @@ class MostroInstance {
6468
event.supportedChains,
6569
event.supportedNetworks,
6670
event.lndNodeUri,
71+
event.fiatCurrenciesAccepted,
72+
event.maxOrdersPerResponse,
6773
);
6874
}
6975
}
@@ -96,4 +102,6 @@ extension MostroInstanceExtensions on NostrEvent {
96102
String get supportedChains => _getTagValue('lnd_chains');
97103
String get supportedNetworks => _getTagValue('lnd_networks');
98104
String get lndNodeUri => _getTagValue('lnd_uris');
105+
String get fiatCurrenciesAccepted => _getTagValue('fiat_currencies_accepted');
106+
int get maxOrdersPerResponse => int.parse(_getTagValue('max_orders_per_response'));
99107
}

lib/features/settings/about_screen.dart

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ class AboutScreen extends ConsumerWidget {
7676
);
7777
}
7878

79+
String _formatFiatCurrencies(BuildContext context, String currencies) {
80+
if (currencies.isEmpty || currencies == 'Tag: fiat_currencies_accepted not found') {
81+
return S.of(context)!.all;
82+
}
83+
// Add space after commas: "USD,EUR,ARS" -> "USD, EUR, ARS"
84+
return currencies.replaceAll(',', ', ');
85+
}
86+
7987
Widget _buildAppInformationCard(BuildContext context) {
8088
const String appVersion = String.fromEnvironment('APP_VERSION',
8189
defaultValue: 'N/A'); // DON'T TOUCH
@@ -260,7 +268,7 @@ class AboutScreen extends ConsumerWidget {
260268
context,
261269
S.of(context)!.mostroPublicKey,
262270
instance.pubKey,
263-
S.of(context)!.lndNodePublicKeyExplanation,
271+
S.of(context)!.mostroPublicKeyExplanation,
264272
),
265273

266274
const SizedBox(height: 16),
@@ -284,7 +292,7 @@ class AboutScreen extends ConsumerWidget {
284292
_buildInfoRowWithDialog(
285293
context,
286294
S.of(context)!.orderLifespan,
287-
'${instance.expirationHours} ${S.of(context)!.hour}',
295+
'${instance.expirationHours} ${instance.expirationHours == 1 ? S.of(context)!.hour : S.of(context)!.hours}',
288296
S.of(context)!.orderExpirationExplanation,
289297
),
290298
const SizedBox(height: 16),
@@ -295,6 +303,14 @@ class AboutScreen extends ConsumerWidget {
295303
'${instance.fee * 100}%',
296304
S.of(context)!.serviceFeeExplanation,
297305
),
306+
const SizedBox(height: 16),
307+
308+
_buildInfoRowWithDialog(
309+
context,
310+
S.of(context)!.fiatCurrenciesAccepted,
311+
_formatFiatCurrencies(context, instance.fiatCurrenciesAccepted),
312+
S.of(context)!.fiatCurrenciesAcceptedExplanation,
313+
),
298314
const SizedBox(height: 20),
299315

300316
// Technical Details Section
@@ -362,6 +378,14 @@ class AboutScreen extends ConsumerWidget {
362378
instance.pow.toString(),
363379
S.of(context)!.proofOfWorkExplanation,
364380
),
381+
const SizedBox(height: 16),
382+
383+
_buildInfoRowWithDialog(
384+
context,
385+
S.of(context)!.maxOrdersPerResponse,
386+
instance.maxOrdersPerResponse.toString(),
387+
S.of(context)!.maxOrdersPerResponseExplanation,
388+
),
365389
const SizedBox(height: 20),
366390

367391
// Lightning Network Section

lib/l10n/intl_en.arb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@
200200
"filter": "FILTER",
201201
"statusFilter": "Status",
202202
"allStatuses": "All",
203+
"all": "All",
203204
"statusPending": "Pending",
204205
"statusWaitingPayment": "Waiting-Payment",
205206
"statusWaitingBuyerInvoice": "Waiting-Buyer-Invoice",
@@ -881,31 +882,36 @@
881882
"minOrderAmount": "Minimum Order Amount",
882883
"orderLifespan": "Order Lifespan",
883884
"serviceFee": "Service Fee",
885+
"fiatCurrenciesAccepted": "Fiat Currencies Accepted",
886+
"maxOrdersPerResponse": "Max Orders Per Response",
884887
"satoshis": "Satoshis",
885888
"hour": "hour",
889+
"hours": "hours",
886890
"sec": "sec",
887891
"blocks": "blocks",
888892
"seconds": "seconds",
889893
"mostroPublicKey": "Mostro's Public Key",
890894
"license": "License",
891895

892896
"@_comment_mostro_node_field_explanations": "Mostro Node Field Explanations",
893-
"mostroPublicKeyExplanation": "The unique identifier for this Mostro node on the Nostr network. This is used to verify the authenticity of all communications with the node.",
897+
"mostroPublicKeyExplanation": "The public key of the Mostro instance you are using.",
894898
"mostroVersionExplanation": "The version of the Mostro software currently running on this node. This helps users understand which features are available.",
895899
"mostroCommitIdExplanation": "The specific Git commit hash of the Mostro software. This provides the exact version information for debugging and compatibility.",
896900
"maxOrderAmountExplanation": "The maximum amount of satoshis that can be traded in a single order on this Mostro node. Orders above this limit will be rejected.",
897901
"minOrderAmountExplanation": "The minimum amount of satoshis that can be traded in a single order on this Mostro node. Orders below this limit will be rejected.",
898-
"orderExpirationExplanation": "How long (in hours) an order remains active and visible in the order book before it automatically expires and is removed.",
902+
"orderExpirationExplanation": "The maximum time, in seconds, that an order can remain in waiting status before being canceled or reverted to pending status.",
899903
"holdInvoiceExpirationExplanation": "The time window (in seconds) for hold invoices to expire. Hold invoices are used to secure funds during the trade process.",
900904
"holdInvoiceCltvDeltaExplanation": "The number of blocks added to the current block height for hold invoice expiration. This provides time for the Lightning Network to process the payment.",
901905
"serviceFeeExplanation": "The fee charged by this Mostro node for facilitating trades. This is typically a small percentage of the trade amount, this amount is split between the buyer and seller.",
906+
"fiatCurrenciesAcceptedExplanation": "The list of fiat currencies that this Mostro node accepts for trades.",
907+
"maxOrdersPerResponseExplanation": "Maximum orders per response in orders action.",
902908
"invoiceExpirationWindowExplanation": "The time window (in seconds) for regular Lightning invoices to expire. This ensures invoices don't remain valid indefinitely.",
903909
"proofOfWorkExplanation": "The difficulty level required for proof-of-work in Nostr events. This helps prevent spam and ensures quality of service.",
904910
"lndDaemonVersionExplanation": "The version of the Lightning Network Daemon (LND) software that this Mostro node uses to process Bitcoin Lightning payments.",
905911
"lndNodePublicKeyExplanation": "The public key of the Lightning Network node that handles payments for this Mostro instance. This is used for Lightning Network routing.",
906912
"lndCommitIdExplanation": "The specific Git commit hash of the LND software. This provides exact version information for the Lightning Network implementation.",
907913
"lndNodeAliasExplanation": "The human-readable name or alias of the Lightning Network node. This makes it easier to identify the node in the Lightning Network.",
908-
"supportedChainsExplanation": "The blockchain networks supported by this Mostro node (typically Bitcoin mainnet, testnet, or regtest).",
914+
"supportedChainsExplanation": "The chains supported by the LND node.",
909915
"supportedNetworksExplanation": "The specific network environments that this Mostro node operates on (mainnet for real Bitcoin, testnet for testing).",
910916
"lndNodeUriExplanation": "The complete network address of the Lightning Network node, including public key and connection information for direct peer connections.",
911917

lib/l10n/intl_es.arb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,7 @@
672672

673673
"statusFilter": "Estado",
674674
"allStatuses": "Todos",
675+
"all": "Todas",
675676
"statusPending": "Pendiente",
676677
"statusWaitingPayment": "Esperando-Pago",
677678
"statusWaitingBuyerInvoice": "Esperando-Factura-Comprador",
@@ -858,31 +859,36 @@
858859
"lndNodeUri": "URI del Nodo LND",
859860
"orderLifespan": "Vida Útil de la Orden",
860861
"serviceFee": "Tarifa de Servicio",
862+
"fiatCurrenciesAccepted": "Monedas Fiat Aceptadas",
863+
"maxOrdersPerResponse": "Máximo de Órdenes por Respuesta",
861864
"satoshis": "Satoshis",
862865
"hour": "hora",
866+
"hours": "horas",
863867
"sec": "seg",
864868
"blocks": "bloques",
865869
"seconds": "segundos",
866870
"mostroPublicKey": "Clave Pública de Mostro",
867871
"license": "Licencia",
868872

869873
"@_comment_mostro_node_field_explanations": "Explicaciones de campos del nodo Mostro",
870-
"mostroPublicKeyExplanation": "El identificador único para este nodo Mostro en la red Nostr. Se utiliza para verificar la autenticidad de todas las comunicaciones con el nodo.",
874+
"mostroPublicKeyExplanation": "La clave pública de la instancia de Mostro que estás usando.",
871875
"mostroVersionExplanation": "La versión del software Mostro que se ejecuta actualmente en este nodo. Esto ayuda a los usuarios a entender qué características están disponibles.",
872876
"mostroCommitIdExplanation": "El hash específico del commit de Git del software Mostro. Esto proporciona la información exacta de la versión para depuración y compatibilidad.",
873877
"maxOrderAmountExplanation": "La cantidad máxima de satoshis que se puede comerciar en una sola orden en este nodo Mostro. Las órdenes por encima de este límite serán rechazadas.",
874878
"minOrderAmountExplanation": "La cantidad mínima de satoshis que se puede comerciar en una sola orden en este nodo Mostro. Las órdenes por debajo de este límite serán rechazadas.",
875-
"orderExpirationExplanation": "Cuánto tiempo (en horas) permanece activa y visible una orden en el libro de órdenes antes de que expire automáticamente y sea eliminada.",
879+
"orderExpirationExplanation": "El tiempo máximo, en segundos, que una orden puede permanecer en estado de espera antes de ser cancelada o revertida al estado pendiente.",
876880
"holdInvoiceExpirationExplanation": "El período de tiempo (en segundos) para que expiren las facturas de retención. Las facturas de retención se utilizan para asegurar fondos durante el proceso de comercio.",
877881
"holdInvoiceCltvDeltaExplanation": "El número de bloques agregados a la altura actual del bloque para la expiración de facturas de retención. Esto proporciona tiempo para que la Lightning Network procese el pago.",
878882
"invoiceExpirationWindowExplanation": "El período de tiempo (en segundos) para que expiren las facturas regulares de Lightning. Esto asegura que las facturas no permanezcan válidas indefinidamente.",
879883
"serviceFeeExplanation": "La tarifa cobrada por este nodo Mostro por facilitar intercambios. Esto es típicamente un pequeño porcentaje del monto del intercambio, este monto se divide entre el comprador y el vendedor.",
884+
"fiatCurrenciesAcceptedExplanation": "La lista de monedas fiat que este nodo Mostro acepta para intercambios.",
885+
"maxOrdersPerResponseExplanation": "El número máximo de órdenes devueltas por solicitud.",
880886
"proofOfWorkExplanation": "El nivel de dificultad requerido para la prueba de trabajo en eventos Nostr. Esto ayuda a prevenir spam y asegura calidad de servicio.",
881887
"lndDaemonVersionExplanation": "La versión del software Lightning Network Daemon (LND) que este nodo Mostro utiliza para procesar pagos de Bitcoin Lightning.",
882888
"lndNodePublicKeyExplanation": "La clave pública del nodo de Lightning Network que maneja pagos para esta instancia de Mostro. Se utiliza para enrutamiento de Lightning Network.",
883889
"lndCommitIdExplanation": "El hash específico del commit de Git del software LND. Esto proporciona información exacta de la versión para la implementación de Lightning Network.",
884890
"lndNodeAliasExplanation": "El nombre o alias legible por humanos del nodo de Lightning Network. Esto hace más fácil identificar el nodo en la Lightning Network.",
885-
"supportedChainsExplanation": "Las redes blockchain soportadas por este nodo Mostro (típicamente Bitcoin mainnet, testnet, o regtest).",
891+
"supportedChainsExplanation": "Las cadenas soportadas por el nodo LND.",
886892
"supportedNetworksExplanation": "Los entornos de red específicos en los que opera este nodo Mostro (mainnet para Bitcoin real, testnet para pruebas).",
887893
"lndNodeUriExplanation": "La dirección de red completa del nodo de Lightning Network, incluyendo clave pública e información de conexión para conexiones directas entre pares.",
888894

lib/l10n/intl_it.arb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@
199199
"filter": "FILTRO",
200200
"statusFilter": "Stato",
201201
"allStatuses": "Tutti",
202+
"all": "Tutte",
202203
"statusPending": "In Attesa",
203204
"statusWaitingPayment": "Aspettando-Pagamento",
204205
"statusWaitingBuyerInvoice": "Aspettando-Fattura-Acquirente",
@@ -914,31 +915,36 @@
914915
"minOrderAmount": "Importo Minimo Ordine",
915916
"orderLifespan": "Durata Ordine",
916917
"serviceFee": "Commissione Servizio",
918+
"fiatCurrenciesAccepted": "Valute Fiat Accettate",
919+
"maxOrdersPerResponse": "Massimo Ordini per Risposta",
917920
"satoshis": "Satoshis",
918921
"hour": "ora",
922+
"hours": "ore",
919923
"sec": "sec",
920924
"blocks": "blocchi",
921925
"seconds": "secondi",
922926
"mostroPublicKey": "Chiave Pubblica di Mostro",
923927
"license": "Licenza",
924928

925929
"@_comment_mostro_node_field_explanations": "Spiegazioni dei campi del nodo Mostro",
926-
"mostroPublicKeyExplanation": "L'identificatore univoco per questo nodo Mostro sulla rete Nostr. Viene utilizzato per verificare l'autenticità di tutte le comunicazioni con il nodo.",
930+
"mostroPublicKeyExplanation": "La chiave pubblica dell'istanza di Mostro che stai utilizzando.",
927931
"mostroVersionExplanation": "La versione del software Mostro attualmente in esecuzione su questo nodo. Questo aiuta gli utenti a capire quali funzionalità sono disponibili.",
928932
"mostroCommitIdExplanation": "L'hash specifico del commit Git del software Mostro. Questo fornisce le informazioni esatte della versione per il debug e la compatibilità.",
929933
"maxOrderAmountExplanation": "La quantità massima di satoshi che può essere scambiata in un singolo ordine su questo nodo Mostro. Gli ordini sopra questo limite saranno respinti.",
930934
"minOrderAmountExplanation": "La quantità minima di satoshi che può essere scambiata in un singolo ordine su questo nodo Mostro. Gli ordini sotto questo limite saranno respinti.",
931-
"orderExpirationExplanation": "Quanto tempo (in ore) un ordine rimane attivo e visibile nel libro degli ordini prima di scadere automaticamente e essere rimosso.",
935+
"orderExpirationExplanation": "Il tempo massimo, in secondi, che un ordine può rimanere in stato di attesa prima di essere annullato o ripristinato allo stato pendente.",
932936
"holdInvoiceExpirationExplanation": "La finestra temporale (in secondi) per la scadenza delle fatture di blocco. Le fatture di blocco vengono utilizzate per assicurare i fondi durante il processo di trading.",
933937
"holdInvoiceCltvDeltaExplanation": "Il numero di blocchi aggiunti all'altezza attuale del blocco per la scadenza delle fatture di blocco. Questo fornisce tempo per la Lightning Network per elaborare il pagamento.",
934938
"invoiceExpirationWindowExplanation": "La finestra temporale (in secondi) per la scadenza delle fatture Lightning regolari. Questo garantisce che le fatture non rimangano valide indefinitamente.",
935939
"serviceFeeExplanation": "La commissione addebitata da questo nodo Mostro per facilitare le transazioni. In genere, si tratta di una piccola percentuale dell'importo della transazione, che viene suddivisa tra acquirente e venditore.",
940+
"fiatCurrenciesAcceptedExplanation": "L'elenco delle valute fiat che questo nodo Mostro accetta per le transazioni.",
941+
"maxOrdersPerResponseExplanation": "Il numero massimo di ordini restituiti per richiesta.",
936942
"proofOfWorkExplanation": "Il livello di difficoltà richiesto per la prova di lavoro negli eventi Nostr. Questo aiuta a prevenire lo spam e garantisce la qualità del servizio.",
937943
"lndDaemonVersionExplanation": "La versione del software Lightning Network Daemon (LND) che questo nodo Mostro utilizza per elaborare i pagamenti Bitcoin Lightning.",
938944
"lndNodePublicKeyExplanation": "La chiave pubblica del nodo Lightning Network che gestisce i pagamenti per questa istanza di Mostro. Viene utilizzata per il routing della Lightning Network.",
939945
"lndCommitIdExplanation": "L'hash specifico del commit Git del software LND. Questo fornisce informazioni esatte della versione per l'implementazione della Lightning Network.",
940946
"lndNodeAliasExplanation": "Il nome leggibile dall'uomo o alias del nodo Lightning Network. Questo rende più facile identificare il nodo nella Lightning Network.",
941-
"supportedChainsExplanation": "Le reti blockchain supportate da questo nodo Mostro (tipicamente Bitcoin mainnet, testnet, o regtest).",
947+
"supportedChainsExplanation": "Le catene supportate dal nodo LND.",
942948
"supportedNetworksExplanation": "Gli ambienti di rete specifici su cui opera questo nodo Mostro (mainnet per Bitcoin reale, testnet per i test).",
943949
"lndNodeUriExplanation": "L'indirizzo di rete completo del nodo Lightning Network, incluse la chiave pubblica e le informazioni di connessione per connessioni peer dirette.",
944950

0 commit comments

Comments
 (0)