Skip to content

Commit 74970c8

Browse files
authored
upgrade coco to stable release line (#421)
* replace coco alpha packages * migrate coco flows to ops api * handle pending melt state in confirmation * added proper MeltConfirmation step * remove "Done" button on amount inputs * Handle prepared send confirmation cleanup * fix: handle melt loading and swap totals * refactor: confirm melts from input screen * refactor: inline melt lightning address flow * Refine melt input flow * Refactor send amount flow to header mint selector * Refactor mint amount flow to header mint selector * Clean up screen navigation props * refactor payment request parsing * support unified nfc payment requests * remove stale swap target route * support creqB payment requests * Validate LNURL pay metadata * Handle NFC payment handoffs * Improve QR scanner experience * Guard NFC payment request transports
1 parent ede807f commit 74970c8

65 files changed

Lines changed: 4835 additions & 1311 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ node_modules/
88
dist/
99
web-build/
1010
expo-env.d.ts
11+
/android/
12+
/ios/
1113

1214
# Native
1315
.kotlin/

TODO.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# TODO
2+
3+
## Typecheck cleanup
4+
5+
These are the best next targets because they block `npx tsc --noEmit` from being useful as a regression check.
6+
7+
- [x] Remove stale `selectMintToSwapTo` route.
8+
- Removed the unreachable route registration, route type, screen prop type, and screen file.
9+
10+
- [ ] Fix stale route types in `src/components/Empty.tsx`.
11+
- Current type references old routes: `"nostrReceive"` and `"qr scan"`.
12+
- Replace with a generic `NativeStackNavigationProp<RootStackParamList>` or a narrower current route type.
13+
14+
- [ ] Clean up payment overview residue in `src/screens/Payment/Send/CoinSelection.tsx`.
15+
- Remove the missing `_testmintUrl` import from `@consts`.
16+
- Check whether `url`, `scanned`, and `trustMintRef` are still needed.
17+
18+
- [ ] Fix utility module type errors in `src/util/index.ts`.
19+
- Import or remove the `IContact` dependency used by `uniqByIContacts`.
20+
- Fix `decodeLnInvoice`, which currently calls `decodeInvoice` without an import/provider.
21+
22+
- [ ] Fix environment typing in `src/consts/env.ts`.
23+
- TypeScript cannot resolve the `expo-constants` import from the root dependency graph.
24+
- Add declarations or remove direct global references for `__TEST__` and `jest`.
25+
26+
- [ ] Fix i18n key typing errors.
27+
- `src/components/MintSelectionSheet.tsx` has a union key call for `"selectMint" | "selectMints"` that does not satisfy the typed `t` overload.
28+
- `src/screens/Payment/Processing.tsx` has a similar dynamic key issue for processing status strings.
29+
30+
## Parser/payment follow-ups
31+
32+
- [ ] Add a QR chooser for unified requests with multiple supported candidates.
33+
- Current QR policy chooses by priority.
34+
- A chooser is better when a unified request contains both a Cashu payment request and a Lightning invoice.
35+
36+
- [ ] Implement Cashu payment request execution from QR.
37+
- QR currently recognizes `cashuPaymentRequest` candidates but shows an unsupported prompt.
38+
- NFC already extracts and executes Cashu payment requests through `manager.paymentRequests`.
39+
40+
- [ ] Add focused parser coverage once a test runner exists.
41+
- Direct Cashu token.
42+
- Direct Lightning invoice.
43+
- Lightning address.
44+
- LNURL.
45+
- Direct `creq...`.
46+
- `bitcoin:` with address plus `lightning=...`.
47+
- `bitcoin:` with `creq=...`.
48+
- `bitcoin:` with multiple supported fallbacks.
49+
50+
## Lower-priority cleanup
51+
52+
- [ ] Reduce noisy debug logging in `src/shim.ts`.
53+
- It logs crypto polyfill setup details on startup.
54+
55+
- [ ] Review `src/screens/Payment/MeltInput.tsx` for extraction opportunities.
56+
- The file is large and still owns request parsing, LNURL amount flow, mint selection, operation preparation, confirmation, cancellation, and success routing.
57+
- Do this after typecheck is cleaner, so behavior changes are easier to validate.
58+
59+
- [ ] Review broad `any` and modal backdrop types.
60+
- Several bottom-sheet components type backdrop props as `any`.
61+
- This is lower priority than the current typecheck blockers.

assets/translations/de.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,13 @@
126126
"estimateFee": "Gebühren schätzen",
127127
"expired": "Abgelaufen",
128128
"fee": "Gebühr",
129+
"swapFee": "Tauschgebühr",
129130
"feeErr": "Gebühr kann nicht geschätzt werden. Ist \"{{input}}\" eine valide LNURL?",
130131
"foundCashuClipboard": "Cashu-Token gefunden",
131132
"french": "Französisch",
132133
"from": "von",
133134
"fromMint": "von folgende Mint",
135+
"sendingFrom": "Senden von",
134136
"german": "Deutsch",
135137
"github": "GitHub",
136138
"githubIssues": "Melden Sie Fehler auf Github",
@@ -190,6 +192,21 @@
190192
"scanAgain": "Erneut scannen",
191193
"scan": "Scannen",
192194
"scanQR": "QR scannen",
195+
"qrScanHint": "QR-Code im Rahmen ausrichten",
196+
"qrScanFormats": "Cashu, Lightning, LNURL oder Bitcoin",
197+
"qrScanReady": "Bereit zum Scannen",
198+
"qrScanPaused": "Scan pausiert",
199+
"animatedQrProgress": "Animierter QR-Fortschritt",
200+
"receivingAnimatedQr": "Empfange animierten QR-Code",
201+
"unsupportedFormat": "Nicht unterstütztes Format",
202+
"cashuPaymentRequestQrUnsupported": "Cashu-Zahlungsanfragen werden per QR noch nicht unterstützt",
203+
"bitcoinAddressPaymentsUnsupported": "Bitcoin-Adresszahlungen werden nicht unterstützt",
204+
"cameraAccessRequired": "Kamerazugriff erforderlich",
205+
"cameraAccessDenied": "Kamerazugriff verweigert",
206+
"cameraAccessRequiredHint": "Wir benötigen Kamerazugriff, um QR-Codes für Zahlungen und Token zu scannen.",
207+
"cameraAccessDeniedHint": "Aktiviere den Kamerazugriff in den Geräteeinstellungen, um QR-Codes zu scannen.",
208+
"allowCameraAccess": "Kamerazugriff erlauben",
209+
"openSettings": "Einstellungen öffnen",
193210
"seconds": "Sekunden",
194211
"selectAmount": "Betrag auswählen",
195212
"selected": "Ausgewählt",
@@ -201,6 +218,7 @@
201218
"today": "Heute",
202219
"tokenInfoErr": "Ein Fehler ist aufgetreten während der Token-Info-Abfrage",
203220
"totalInclFee": "Gesamt inkl. Gebühr",
221+
"reservedTotal": "Reservierte Summe",
204222
"trustMint": "Mint vertrauen?",
205223
"tryLater": "Bitte versuchen Sie es später noch einmal.",
206224
"unknownType": "Unbekannter Code-Typ",
@@ -309,6 +327,7 @@
309327
"error": {
310328
"checkSpendableErr": "Fehler beim Überprüfen, ob der Token ausgegeben werden kann",
311329
"claimTokenErr": "Fehler beim Beanspruchen des Tokens",
330+
"sendTokenErr": "Fehler beim Senden des Tokens",
312331
"header": "Ein Fehler ist aufgetreten",
313332
"msg": "Es tut uns leid, dass dieses Problem bei Ihnen aufgetreten ist. Sie können uns helfen, die Software zu verbessern, indem Sie einen Screenshot machen und einen kurzen Fehlerbericht erstellen.",
314333
"reportBug": "Fehler melden",

assets/translations/en.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,13 @@
126126
"estimateFee": "Estimate fee",
127127
"expired": "Expired",
128128
"fee": "Fee",
129+
"swapFee": "Swap fee",
129130
"feeErr": "Unable to estimate fee. Is \"{{input}}\" a valid LNURL?",
130131
"foundCashuClipboard": "Cashu token detected",
131132
"french": "French",
132133
"from": "from",
133134
"fromMint": "from the following mint",
135+
"sendingFrom": "Sending from",
134136
"german": "German",
135137
"github": "GitHub",
136138
"githubIssues": "Report bugs on Github",
@@ -190,6 +192,21 @@
190192
"scanAgain": "Scan Again",
191193
"scan": "Scan",
192194
"scanQR": "Scan QR",
195+
"qrScanHint": "Place the QR code inside the frame",
196+
"qrScanFormats": "Cashu, Lightning, LNURL, or Bitcoin",
197+
"qrScanReady": "Ready to scan",
198+
"qrScanPaused": "Scan paused",
199+
"animatedQrProgress": "Animated QR progress",
200+
"receivingAnimatedQr": "Receiving animated QR",
201+
"unsupportedFormat": "Unsupported format",
202+
"cashuPaymentRequestQrUnsupported": "Cashu payment requests are not supported from QR yet",
203+
"bitcoinAddressPaymentsUnsupported": "Bitcoin address payments are not supported",
204+
"cameraAccessRequired": "Camera access required",
205+
"cameraAccessDenied": "Camera access denied",
206+
"cameraAccessRequiredHint": "We need camera access to scan QR codes for payments and tokens.",
207+
"cameraAccessDeniedHint": "Enable camera access in your device settings to scan QR codes.",
208+
"allowCameraAccess": "Allow camera access",
209+
"openSettings": "Open settings",
193210
"seconds": "seconds",
194211
"selectAmount": "Select amount",
195212
"selected": "Selected",
@@ -202,6 +219,7 @@
202219
"today": "Today",
203220
"tokenInfoErr": "Error while getting token info",
204221
"totalInclFee": "Total incl. fee",
222+
"reservedTotal": "Reserved total",
205223
"trustMint": "Trust this mint?",
206224
"tryLater": "Please try again later.",
207225
"unknownType": "Unknown data",
@@ -310,6 +328,7 @@
310328
"error": {
311329
"checkSpendableErr": "Error while checking if token is spendable",
312330
"claimTokenErr": "Error while claiming token",
331+
"sendTokenErr": "Error while sending token",
313332
"header": "An error occured",
314333
"msg": "We are sorry that you encountered this problem. You can help us improve the software by taking a screenshot and creating a short bug report.",
315334
"reportBug": "Report the bug",

assets/translations/es.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,13 @@
126126
"estimateFee": "Estimar comisión",
127127
"expired": "Expirado",
128128
"fee": "Comisión",
129+
"swapFee": "Comisión de intercambio",
129130
"feeErr": "No se pudo estimar la comisión. ¿Es \"{{input}}\" una LNURL valida?",
130131
"foundCashuClipboard": "Token Cashu detectado",
131132
"french": "Francés",
132133
"from": "desde",
133134
"fromMint": "desde la siguiente ceca",
135+
"sendingFrom": "Enviando desde",
134136
"german": "Alemán",
135137
"github": "GitHub",
136138
"githubIssues": "Reportar bugs en Github",
@@ -190,6 +192,21 @@
190192
"scanAgain": "Escanear de nuevo",
191193
"scan": "Escanear",
192194
"scanQR": "Escanear QR",
195+
"qrScanHint": "Coloca el código QR dentro del marco",
196+
"qrScanFormats": "Cashu, Lightning, LNURL o Bitcoin",
197+
"qrScanReady": "Listo para escanear",
198+
"qrScanPaused": "Escaneo en pausa",
199+
"animatedQrProgress": "Progreso del QR animado",
200+
"receivingAnimatedQr": "Recibiendo QR animado",
201+
"unsupportedFormat": "Formato no compatible",
202+
"cashuPaymentRequestQrUnsupported": "Las solicitudes de pago Cashu aún no son compatibles desde QR",
203+
"bitcoinAddressPaymentsUnsupported": "Los pagos a direcciones Bitcoin no son compatibles",
204+
"cameraAccessRequired": "Se requiere acceso a la cámara",
205+
"cameraAccessDenied": "Acceso a la cámara denegado",
206+
"cameraAccessRequiredHint": "Necesitamos acceso a la cámara para escanear códigos QR de pagos y tokens.",
207+
"cameraAccessDeniedHint": "Activa el acceso a la cámara en los ajustes del dispositivo para escanear códigos QR.",
208+
"allowCameraAccess": "Permitir acceso a la cámara",
209+
"openSettings": "Abrir ajustes",
193210
"seconds": "segundos",
194211
"selectAmount": "Seleccionar cantidad",
195212
"selected": "Seleccionado",
@@ -201,6 +218,7 @@
201218
"today": "Hoy",
202219
"tokenInfoErr": "Error al obtener la información del token",
203220
"totalInclFee": "Total incl. comisiones",
221+
"reservedTotal": "Total reservado",
204222
"trustMint": "¿Quieres fiarte de esta ceca?",
205223
"tryLater": "Por favor, reinténtalo más tarde.",
206224
"unknownType": "Desconocido",
@@ -309,6 +327,7 @@
309327
"error": {
310328
"checkSpendableErr": "Error al comprobar si el token puede ser gastado",
311329
"claimTokenErr": "Error al reclamar el token",
330+
"sendTokenErr": "Error al enviar el token",
312331
"header": "Ocurrió un error",
313332
"msg": "Sentimos que hayas experimentado este problema. Puedes ayudarnos a mejorar el programa realizando una captura de pantalla y creando un pequeño informe de errores.",
314333
"reportBug": "Reportar el bug",

assets/translations/it.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,13 @@
126126
"estimateFee": "Stimare le commissioni",
127127
"expired": "Scaduto",
128128
"fee": "Commissioni",
129+
"swapFee": "Commissione di swap",
129130
"feeErr": "Non è stato possibile stimare le commissioni necessarie. \"{{input}}\" è un LNURL valido?",
130131
"foundCashuClipboard": "Token cashu rilevato",
131132
"french": "Francese",
132133
"from": "da",
133134
"fromMint": "dalla seguente mint",
135+
"sendingFrom": "Invio da",
134136
"german": "Tedesco",
135137
"github": "GitHub",
136138
"githubIssues": "Segnala bug su Github",
@@ -190,6 +192,21 @@
190192
"scanAgain": "Scansiona ancora",
191193
"scan": "Scansiona",
192194
"scanQR": "Scansiona QR",
195+
"qrScanHint": "Posiziona il codice QR nel riquadro",
196+
"qrScanFormats": "Cashu, Lightning, LNURL o Bitcoin",
197+
"qrScanReady": "Pronto per la scansione",
198+
"qrScanPaused": "Scansione in pausa",
199+
"animatedQrProgress": "Avanzamento QR animato",
200+
"receivingAnimatedQr": "Ricezione QR animato",
201+
"unsupportedFormat": "Formato non supportato",
202+
"cashuPaymentRequestQrUnsupported": "Le richieste di pagamento Cashu da QR non sono ancora supportate",
203+
"bitcoinAddressPaymentsUnsupported": "I pagamenti a indirizzi Bitcoin non sono supportati",
204+
"cameraAccessRequired": "Accesso alla fotocamera richiesto",
205+
"cameraAccessDenied": "Accesso alla fotocamera negato",
206+
"cameraAccessRequiredHint": "Serve l'accesso alla fotocamera per scansionare codici QR di pagamenti e token.",
207+
"cameraAccessDeniedHint": "Abilita l'accesso alla fotocamera nelle impostazioni del dispositivo per scansionare codici QR.",
208+
"allowCameraAccess": "Consenti accesso fotocamera",
209+
"openSettings": "Apri impostazioni",
193210
"seconds": "secondi",
194211
"selectAmount": "Seleziona importo",
195212
"selected": "Selezionato",
@@ -201,6 +218,7 @@
201218
"today": "Oggi",
202219
"tokenInfoErr": "Errore durante il recupero delle informazioni sul token",
203220
"totalInclFee": "Totale (commissioni incluse)",
221+
"reservedTotal": "Totale riservato",
204222
"trustMint": "Affidarsi a questa mint?",
205223
"tryLater": "Riprovare più tardi.",
206224
"unknownType": "Dato sconosciuto",
@@ -309,6 +327,7 @@
309327
"error": {
310328
"checkSpendableErr": "Errore di verifica del token",
311329
"claimTokenErr": "Errore nel riscatto del token",
330+
"sendTokenErr": "Errore durante l'invio del token",
312331
"header": "Errore",
313332
"msg": "Purtroppo si è verificato un errore. Puoi aiutarci a migliorare eNuts facendo uno screenshot e riportandoci il bug.",
314333
"reportBug": "Segnalare il bug",

assets/translations/ru.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,13 @@
126126
"estimateFee": "Попробовать оплатить",
127127
"expired": "Истёкший",
128128
"fee": "Комиссия",
129+
"swapFee": "Комиссия обмена",
129130
"feeErr": "Невозможно произвести оплату. Является ли \"{{input}}\" допустимым LNURL?",
130131
"foundCashuClipboard": "Обнаружен токен Cashu",
131132
"french": "Французский",
132133
"from": "от",
133134
"fromMint": "из монетного двора именуемого",
135+
"sendingFrom": "Отправка из",
134136
"german": "Немецкий",
135137
"github": "GitHub",
136138
"githubIssues": "Сообщайте об ошибках на Github",
@@ -190,6 +192,21 @@
190192
"scanAgain": "Отсканируйте ещё раз",
191193
"scan": "Скан.",
192194
"scanQR": "Сканировать QR",
195+
"qrScanHint": "Поместите QR-код в рамку",
196+
"qrScanFormats": "Cashu, Lightning, LNURL или Bitcoin",
197+
"qrScanReady": "Готово к сканированию",
198+
"qrScanPaused": "Сканирование приостановлено",
199+
"animatedQrProgress": "Прогресс анимированного QR",
200+
"receivingAnimatedQr": "Получение анимированного QR",
201+
"unsupportedFormat": "Формат не поддерживается",
202+
"cashuPaymentRequestQrUnsupported": "Платёжные запросы Cashu из QR пока не поддерживаются",
203+
"bitcoinAddressPaymentsUnsupported": "Платежи на Bitcoin-адреса не поддерживаются",
204+
"cameraAccessRequired": "Требуется доступ к камере",
205+
"cameraAccessDenied": "Доступ к камере запрещён",
206+
"cameraAccessRequiredHint": "Нужен доступ к камере, чтобы сканировать QR-коды для платежей и токенов.",
207+
"cameraAccessDeniedHint": "Разрешите доступ к камере в настройках устройства, чтобы сканировать QR-коды.",
208+
"allowCameraAccess": "Разрешить доступ к камере",
209+
"openSettings": "Открыть настройки",
193210
"seconds": "секунд",
194211
"selectAmount": "Выберите сумму",
195212
"selected": "Выбрано",
@@ -201,6 +218,7 @@
201218
"today": "Сегодня",
202219
"tokenInfoErr": "Ошибка при получении информации о токене",
203220
"totalInclFee": "Всего в платеже",
221+
"reservedTotal": "Зарезервировано всего",
204222
"trustMint": "Доверять этому монетному двору?",
205223
"tryLater": "Пожалуйста, повторите попытку позже.",
206224
"unknownType": "Неизвестные данные",
@@ -309,6 +327,7 @@
309327
"error": {
310328
"checkSpendableErr": "Ошибка при проверке попытке потратить токен",
311329
"claimTokenErr": "Ошибка при запросе токена",
330+
"sendTokenErr": "Ошибка при отправке токена",
312331
"header": "Произошла ошибка",
313332
"msg": "Сожалеем, что вы столкнулись с этой проблемой. Вы можете помочь нам улучшить программное обеспечение, сделав снимок экрана и создав короткий отчет об ошибке.",
314333
"reportBug": "Сообщить об ошибке",

0 commit comments

Comments
 (0)