Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions assets/languages/strings_de.arb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"buyPaymentConfirmFailedAktionariat": "Es gibt ein technisches Problem. Bitte überprüfen Sie Ihr E-Mail-Postfach, möglicherweise fehlt noch eine Bestätigung Ihrer Blockchain-Adresse. Andernfalls versuchen Sie es später erneut. Falls der Fehler weiterhin besteht, kontaktieren Sie unseren Support.",
"buyPaymentInformation": "Zahlungsinformationen",
"buyPaymentInformationDescription": "Bitte überweisen Sie den Kaufbetrag mit diesen Angaben über Ihre Bankanwendung. Der Verwendungszweck ist wichtig!",
"buyRealUnit": "RealUnit kaufen",
"buyRealu": "RealUnit Token kaufen",
"buyRealUnit": "RealUnit kaufen",
"cancel": "Abbrechen",
"changeAddress": "Adresse ändern",
"changeInReview": "Änderung in Prüfung",
Expand All @@ -53,11 +53,11 @@
"connectBitboxContent": "Bitte verbinden Sie Ihre BitBox mit Ihrem Smartphone.",
"connectBitboxContentIos": "Bitte verbinden Sie Ihre BitBox mit Ihrem Smartphone und aktivieren Sie zusätzlich Bluetooth.",
"connectBitboxFailed": "Es ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.",
"connectBitboxSignInHint": "Nach der Code-Überprüfung wird die BitBox um eine zusätzliche Bestätigung zur Anmeldung gebeten.",
"connectBitboxSignatureCapturing": "Bitte bestätigen Sie die Anmeldeanfrage auf Ihrem BitBox-Gerät. Diese Signatur wird einmalig erfasst, damit künftige Käufe Ihre BitBox nicht erneut benötigen.",
"connectBitboxSignatureCapturingTitle": "Anmeldung bestätigen",
"connectBitboxSignatureFailed": "Ihre Anmeldesignatur konnte nicht erfasst werden. Sie können es erneut versuchen oder trotzdem fortfahren – Ihre BitBox wird dann möglicherweise für Ihren ersten Kauf erneut benötigt.",
"connectBitboxSignatureFailedTitle": "Anmeldung nicht abgeschlossen",
"connectBitboxSignInHint": "Nach der Code-Überprüfung wird die BitBox um eine zusätzliche Bestätigung zur Anmeldung gebeten.",
"connectBitboxTitle": "BitBox verbinden",
"connected": "Verbunden",
"connectedBitboxContent": "Bitte bestätigen Sie und folgen nun den letzten Anweisungen auf Ihrer BitBox.",
Expand Down Expand Up @@ -198,8 +198,8 @@
"proofDocument": "Nachweis-Dokument",
"purposeOfPayment": "Verwendungszweck",
"qrCode": "QR-Code",
"realunitStockToken": "RealUnit Aktientoken",
"realunitStockprice": "RealUnit Aktienkurs",
"realunitStockToken": "RealUnit Aktientoken",
"realunitWallet": "RealUnit Wallet",
"realunitWalletLogout": "Aus REALU Wallet abmelden",
"realunitWalletLogoutCheck": "Ich habe meine Wiederherstellungsphrase gesichert.",
Expand All @@ -217,6 +217,7 @@
"registerEmailInvalid": "E-Mail ist ungültig",
"registerEmailRequired": "E-Mail ist erforderlich",
"registerEmailVerification": "E-Mail Bestätigung",
"registerEmailVerificationBitboxRequired": "Ihre BitBox ist nicht verbunden. Bitte erneut verbinden, um die Wallet-Registrierung abzuschliessen.",
"registerEmailVerificationBitboxSignHint": "Bitte bestätigen Sie die Signatur auf Ihrer BitBox — die Nachricht erstreckt sich über mehrere Seiten, halten Sie den Touchsensor zum Weiterblättern.",
"registerEmailVerificationButton": "Ich habe meine E-Mail bestätigt",
"registerEmailVerificationDescription": "Wie es aussieht, haben Sie bereits ein Konto. Wir haben Ihnen gerade eine E-Mail geschickt. Um mit Ihrem bestehenden Konto fortzufahren, bestätigen Sie bitte Ihre E-Mail-Adresse, indem Sie auf den zugesandten Link klicken.",
Expand Down Expand Up @@ -247,18 +248,18 @@
"sellBitboxCheckingEth": "Wallet-Guthaben wird geprüft",
"sellBitboxDepositDescription": "Bestätigen Sie auf der BitBox, um ZCHF an die DFX-Einzahlungsadresse zu überweisen.",
"sellBitboxDepositFrom": "Sie senden",
"sellBitboxDepositing": "ZCHF wird gesendet. Bestätigen Sie auf der Bitbox",
"sellBitboxDepositRetryDescription": "Der Tausch wurde abgeschlossen, aber die ZCHF-Einzahlung konnte nicht gesendet werden. Ihre Mittel sind sicher. Tippen Sie auf Wiederholen.",
"sellBitboxDepositRetryTitle": "Einzahlung fehlgeschlagen",
"sellBitboxDepositTitle": "ZCHF an DFX senden",
"sellBitboxDepositTo": "DFX-Einzahlung",
"sellBitboxDepositing": "ZCHF wird gesendet. Bestätigen Sie auf der Bitbox",
"sellBitboxEthReady": "Wallet bereit",
"sellBitboxEthReadyDescription": "Ihr Wallet hat genug ETH, um mit dem Verkauf fortzufahren.",
"sellBitboxSwapDescription": "Bestätigen Sie auf Ihrem BitBox, um REALU über den BrokerBot in ZCHF zu tauschen.",
"sellBitboxSwapFrom": "Sie senden",
"sellBitboxSwapping": "Tausch on-chain. Bestätigen Sie auf der Bitbox.",
"sellBitboxSwapTitle": "REALU → ZCHF tauschen",
"sellBitboxSwapTo": "Sie erhalten",
"sellBitboxSwapping": "Tausch on-chain. Bestätigen Sie auf der Bitbox.",
"sellBitboxWaitingForEth": "Gasgebühren werden angefordert",
"sellBitboxWaitingForEthDescription": "Ein kleiner ETH-Betrag wird an Ihr Wallet gesendet, um die Transaktionsgebühren zu decken. Dies kann einige Minuten dauern.",
"sellMinAmount": "Mindestbetrag: ${amount} ${currency}",
Expand All @@ -283,10 +284,10 @@
"settingsWalletBackupSubtitle1": "Bitte notieren Sie Ihre 12 Wiederherstellungs-Wörter in der exakten Reihenfolge auf einem Blatt Papier und bewahren Sie sie absolut sicher auf.",
"settingsWalletBackupSubtitle2": "Dies ist die einzige Möglichkeit, Ihre Wallet wiederherzustellen.",
"showSeed": "Seed anzeigen",
"signMessage": "Signierte Nachricht",
"signMessageGet": "Signierte Nachricht abrufen",
"signature": "Signatur",
"signingCancelled": "Signatur abgebrochen — bitte BitBox erneut bestätigen",
"signMessage": "Signierte Nachricht",
"signMessageGet": "Signierte Nachricht abrufen",
"skip": "Überspringen",
"softwareTermsText": "Mit der Nutzung dieser App akzeptieren Sie die Nutzungsbedingungen dieser Software.",
"softwareTermsTextHighlighted": "Nutzungsbedingungen",
Expand Down Expand Up @@ -318,6 +319,8 @@
"supportTransactionIssue": "Transaktionsproblem",
"supportTypeMessage": "Beschreiben Sie Ihr Anliegen",
"swissPaymentTextInvalid": "Nur in der Schweiz gültige Buchstaben und Zeichen sind erlaubt",
"swissTaxResidence": "Ich bin in der Schweiz steuerpflichtig",
"swissTaxResidenceDescription": "Aktivieren, falls Ihr primärer Steuerwohnsitz die Schweiz ist. Erforderlich für FATCA / CRS-Meldungen.",
"tapHereToView": "Hier tippen, um anzuzeigen",
"taxReport": "Steuerbericht",
"taxReportDescription": "Hier können Sie Ihren Steuerbericht für ein spezifisches Datum generieren.",
Expand All @@ -330,9 +333,9 @@
"transactionBuy": "Kauf",
"transactionHistory": "Transaktionshistorie",
"transactionPending": "In Bearbeitung",
"transactions": "Transaktionen",
"transactionSell": "Verkauf",
"transactionWaitingForPayment": "Warte auf Zahlung",
"transactions": "Transaktionen",
"twoFa": "2-Faktor Authentifizierung",
"twoFaCodeRequired": "Code ist erforderlich",
"twoFaCodeTooShort": "Der Code sollte 6 Ziffern lang sein",
Expand All @@ -357,4 +360,4 @@
"youPay": "Sie bezahlen",
"youReceive": "Sie erhalten",
"youSell": "Sie verkaufen"
}
}
21 changes: 12 additions & 9 deletions assets/languages/strings_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"buyPaymentConfirmFailedAktionariat": "There is a technical problem. Please check your email inbox — you may still need to confirm your blockchain address. Otherwise, please try again later. If the error persists, contact our support team.",
"buyPaymentInformation": "Payment information",
"buyPaymentInformationDescription": "Please transfer the purchase amount using your banking app with these details. The purpose of payment is important!",
"buyRealUnit": "Buy RealUnit",
"buyRealu": "Buy RealUnit Token",
"buyRealUnit": "Buy RealUnit",
"cancel": "Cancel",
"changeAddress": "Change address",
"changeInReview": "Change in review",
Expand All @@ -53,11 +53,11 @@
"connectBitboxContent": "Please connect your BitBox with your Smartphone.",
"connectBitboxContentIos": "Please connect your BitBox with your Smartphone and activate Bluetooth.",
"connectBitboxFailed": "Something went wrong. Please try to connect again.",
"connectBitboxSignInHint": "After verifying the code, the BitBox will ask for one additional confirmation to sign you in.",
"connectBitboxSignatureCapturing": "Please confirm the sign-in request on your BitBox device. This signature is captured once so future purchases won't need your BitBox again.",
"connectBitboxSignatureCapturingTitle": "Confirm sign-in",
"connectBitboxSignatureFailed": "We couldn't capture your sign-in signature. You can retry, or continue anyway – your BitBox may then be needed again for your first purchase.",
"connectBitboxSignatureFailedTitle": "Sign-in not completed",
"connectBitboxSignInHint": "After verifying the code, the BitBox will ask for one additional confirmation to sign you in.",
"connectBitboxTitle": "Connect BitBox",
"connected": "Connected",
"connectedBitboxContent": "Please confirm and follow the last steps on your BitBox.",
Expand Down Expand Up @@ -198,8 +198,8 @@
"proofDocument": "Proof document",
"purposeOfPayment": "Purpose of payment",
"qrCode": "QR code",
"realunitStockToken": "RealUnit Stock Token",
"realunitStockprice": "RealUnit Stockprice",
"realunitStockToken": "RealUnit Stock Token",
"realunitWallet": "RealUnit Wallet",
"realunitWalletLogout": "Log out of REALU Wallet",
"realunitWalletLogoutCheck": "I have backed up my recovery phrase.",
Expand All @@ -217,6 +217,7 @@
"registerEmailInvalid": "Email is invalid",
"registerEmailRequired": "Email is required",
"registerEmailVerification": "Email verification",
"registerEmailVerificationBitboxRequired": "Your BitBox is not connected. Please reconnect to complete the wallet registration.",
"registerEmailVerificationBitboxSignHint": "Confirm the signature on your BitBox — the message spans multiple pages, hold the touch sensor to advance.",
"registerEmailVerificationButton": "I have confirmed my email address",
"registerEmailVerificationDescription": "It looks like you already have an account. We have just sent you an email. To continue with your existing account, please confirm your email address by clicking on the link in the email.",
Expand Down Expand Up @@ -247,18 +248,18 @@
"sellBitboxCheckingEth": "Checking your wallet balance",
"sellBitboxDepositDescription": "Confirm on your BitBox to transfer ZCHF to the DFX deposit address.",
"sellBitboxDepositFrom": "You send",
"sellBitboxDepositing": "Sending ZCHF. Please confirm on the Bitbox.",
"sellBitboxDepositRetryDescription": "The swap was completed but the ZCHF deposit could not be sent. Your funds are safe. Tap retry to try again.",
"sellBitboxDepositRetryTitle": "Deposit failed",
"sellBitboxDepositTitle": "Send ZCHF to DFX",
"sellBitboxDepositTo": "DFX deposit",
"sellBitboxDepositing": "Sending ZCHF. Please confirm on the Bitbox.",
"sellBitboxEthReady": "Wallet ready",
"sellBitboxEthReadyDescription": "Your wallet has enough ETH to proceed with the sale.",
"sellBitboxSwapDescription": "Confirm on your BitBox to swap REALU for ZCHF via the BrokerBot.",
"sellBitboxSwapFrom": "You send",
"sellBitboxSwapping": "Swapping on-chain. Please confirm on the Bitbox.",
"sellBitboxSwapTitle": "Swap REALU → ZCHF",
"sellBitboxSwapTo": "You receive",
"sellBitboxSwapping": "Swapping on-chain. Please confirm on the Bitbox.",
"sellBitboxWaitingForEth": "Requesting gas funds",
"sellBitboxWaitingForEthDescription": "A small amount of ETH is being sent to your wallet to cover transaction fees. This may take a few minutes.",
"sellMinAmount": "Minimum amount: ${amount} ${currency}",
Expand All @@ -283,10 +284,10 @@
"settingsWalletBackupSubtitle1": "Please write down your 12 recovery words in the exact order on a piece of paper and keep them in a completely safe place.",
"settingsWalletBackupSubtitle2": "This is the only way to recover your wallet.",
"showSeed": "Show Seed",
"signMessage": "Sign Message",
"signMessageGet": "Get Sign Message",
"signature": "Signature",
"signingCancelled": "Signature cancelled — please confirm on the BitBox again",
"signMessage": "Sign Message",
"signMessageGet": "Get Sign Message",
"skip": "Skip",
"softwareTermsText": "By using this app, you accept the terms of use of this software.",
"softwareTermsTextHighlighted": "terms of use",
Expand Down Expand Up @@ -318,6 +319,8 @@
"supportTransactionIssue": "Transaction issue",
"supportTypeMessage": "Describe your issue",
"swissPaymentTextInvalid": "Only letters and characters valid in Switzerland are allowed",
"swissTaxResidence": "I am a tax resident in Switzerland",
"swissTaxResidenceDescription": "Tick if Switzerland is your primary tax residence. Required for FATCA / CRS reporting.",
"tapHereToView": "Tap here to view",
"taxReport": "Tax report",
"taxReportDescription": "Here you can generate your tax report for a specific date.",
Expand All @@ -330,9 +333,9 @@
"transactionBuy": "Buy",
"transactionHistory": "Transaction history",
"transactionPending": "Processing",
"transactions": "Transactions",
"transactionSell": "Sell",
"transactionWaitingForPayment": "Waiting for payment",
"transactions": "Transactions",
"twoFa": "Two-factor authentication",
"twoFaCodeRequired": "Code is required",
"twoFaCodeTooShort": "Code should be 6 digits",
Expand All @@ -357,4 +360,4 @@
"youPay": "You pay",
"youReceive": "You receive",
"youSell": "You sell"
}
}
14 changes: 14 additions & 0 deletions lib/packages/service/dfx/models/user/dto/user_dto.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,17 @@ class UserDto {
final UserKycDto kyc;
final UserCapabilitiesDto capabilities;

/// Lowercased blockchain addresses currently associated with this user
/// account (the `addresses[].address` list from `/v2/user`). This is a
/// best-effort hint: absent/empty data is treated as unknown by callers, not
/// as proof that the locally-active wallet is unregistered.
final List<String> addresses;

const UserDto({
this.mail,
required this.kyc,
this.capabilities = const UserCapabilitiesDto(),
this.addresses = const [],
});

factory UserDto.fromJson(Map<String, dynamic> json) {
Expand All @@ -18,6 +25,13 @@ class UserDto {
capabilities: json['capabilities'] != null
? UserCapabilitiesDto.fromJson(json['capabilities'] as Map<String, dynamic>)
: const UserCapabilitiesDto(),
addresses:
(json['addresses'] as List<dynamic>?)
?.map((a) => a is Map<String, dynamic> ? a['address'] : null)
.whereType<String>()
.map((address) => address.toLowerCase())
.toList() ??
const [],
);
}
}
Expand Down
7 changes: 6 additions & 1 deletion lib/screens/buy/buy_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ class BuyView extends StatefulWidget {
}

class _BuyViewState extends State<BuyView> {
final TextEditingController _amountController = TextEditingController();
// Pre-fill the default 300 immediately so the amount is shown from the
// first frame, independent of the brokerbot share-conversion round-trip.
// The converter still emits fiatText='300' (see BuyPage's onFiatChanged),
// and the loading→false listener re-syncs (no-op when already equal); but
// if that round-trip stalls, the field must not render blank.
final TextEditingController _amountController = TextEditingController(text: '300');
final TextEditingController _resultController = TextEditingController();

@override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,30 @@ class BuyPaymentInfoCubit extends Cubit<BuyPaymentInfoState> {
minAmount: paymentInfo.minVolume!,
);
}
return const BuyPaymentInfoFailure(PaymentInfoError.unknown);
return BuyPaymentInfoFailure(
PaymentInfoError.unknown,
message: paymentInfo.error ?? '',
);
}
return BuyPaymentInfoSuccess(paymentInfo);
} on KycLevelRequiredException catch (e) {
return BuyPaymentInfoFailure(
PaymentInfoError.kycRequired,
message: e.toString(),
requiredLevel: e.requiredLevel,
context: e.context,
);
} on RegistrationRequiredException catch (e) {
return BuyPaymentInfoFailure(
PaymentInfoError.registrationRequired,
context: e.context,
message: e.toString(),
);
} on BitboxNotConnectedException catch (e) {
return BuyPaymentInfoFailure(
PaymentInfoError.bitboxDisconnected,
message: e.toString(),
);
} on BitboxNotConnectedException {
return const BuyPaymentInfoFailure(PaymentInfoError.bitboxDisconnected);
} on ApiException catch (e) {
// 503 / PRICE_SOURCE_UNAVAILABLE means the external price provider
// (Aktionariat) is down, so no quote can be built — surface that
Expand All @@ -90,10 +98,13 @@ class BuyPaymentInfoCubit extends Cubit<BuyPaymentInfoState> {
return const BuyPaymentInfoFailure(PaymentInfoError.priceSourceUnavailable);
}
developer.log(e.toString());
return const BuyPaymentInfoFailure(PaymentInfoError.unknown);
return BuyPaymentInfoFailure(PaymentInfoError.unknown, message: e.toString());
} catch (e) {
developer.log(e.toString());
return const BuyPaymentInfoFailure(PaymentInfoError.unknown);
return BuyPaymentInfoFailure(
PaymentInfoError.unknown,
message: e.toString(),
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,24 @@ class BuyPaymentInfoSuccess extends BuyPaymentInfoState {
class BuyPaymentInfoFailure extends BuyPaymentInfoState {
final PaymentInfoError error;
final int? requiredLevel;

/// KYC routing context forwarded as `extra` when the failure routes the user
/// into the KYC flow (see `payment_additional_action_needed_button.dart`).
final String? context;

const BuyPaymentInfoFailure(this.error, {this.requiredLevel, this.context});
/// Human-readable backend error text (e.g. the raw API message), surfaced in
/// the failure UI. Empty when the failure carries no message.
final String message;

const BuyPaymentInfoFailure(
this.error, {
this.requiredLevel,
this.context,
this.message = '',
});

@override
List<Object?> get props => [error, requiredLevel, context];
List<Object?> get props => [error, requiredLevel, context, message];
}

class BuyPaymentInfoMinAmountNotMetFailure extends BuyPaymentInfoFailure {
Expand Down
3 changes: 3 additions & 0 deletions lib/screens/kyc/cubits/kyc/kyc_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ class KycMergeProcessing extends KycState {
const KycMergeProcessing();
}

/// The backend reported a KYC step (or a `PendingReview`) that the app cannot
/// map to a known UI page. Surfaced as an explicit failure page (never a silent
/// `KycCompleted`), naming the offending step via [stepName] when one is known.
class KycUnsupportedStepFailure extends KycState {
// Null when the backend says `PendingReview` but the step list contains no
// `isRequired` step we can name — we still surface the failure (never a
Expand Down
Loading
Loading