taler-ios

iOS apps for GNU Taler (wallet)
Log | Files | Refs | README | LICENSE

commit 5e4c433ea15481e71839d75ccba2bd01dc0a4238
parent 98f6a67d4a05aad9cce89a45fb4820e67595698b
Author: Marc Stibane <marc@taler.net>
Date:   Fri, 30 May 2025 20:19:12 +0200

ExchangeAccountDetails

Diffstat:
MTalerWallet1/Model/Model+Withdraw.swift | 9+++++----
MTalerWallet1/Model/Transaction.swift | 2+-
MTalerWallet1/Views/Transactions/ManualDetailsV.swift | 6+++---
MTalerWallet1/Views/Transactions/ManualDetailsWireV.swift | 4++--
4 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/TalerWallet1/Model/Model+Withdraw.swift b/TalerWallet1/Model/Model+Withdraw.swift @@ -34,14 +34,15 @@ extension AccountRestriction: Identifiable { //// [x: string]: unknown; //} -struct WithdrawalExchangeAccountDetails: Decodable { - var status: String // "OK" or error - then conversionError +struct ExchangeAccountDetails: Decodable { + var status: String // "OK" or "error" - then conversionError var paytoUri: String var transferAmount: Amount? // only if "OK" var bankLabel: String? // only if wallet-core knows it var currencySpecification: CurrencySpecification? // only if wallet-core knows it var creditRestrictions: [AccountRestriction]? // only if restrictions apply // var conversionError: TalerErrorDetail? // only if error + var scope: ScopeInfo? // for Deposit } // MARK: - enum WithdrawalOperationStatus: String, Codable { @@ -99,7 +100,7 @@ struct WithdrawalDetailsForAmount: Decodable { var amountRaw: Amount // Amount that the user will transfer to the exchange var amountEffective: Amount // Amount that will be added to the user's wallet balance var numCoins: Int? // Number of coins this amountEffective will create - var withdrawalAccountsList: [WithdrawalExchangeAccountDetails]? + var withdrawalAccountsList: [ExchangeAccountDetails]? var ageRestrictionOptions: [Int]? // Array of ages var scopeInfo: ScopeInfo } @@ -193,7 +194,7 @@ fileprivate struct AcceptBankIntegratedWithdrawal: WalletBackendFormattedRequest struct AcceptManualWithdrawalResult: Decodable { var reservePub: String var exchangePaytoUris: [String] - var withdrawalAccountsList: [WithdrawalExchangeAccountDetails] + var withdrawalAccountsList: [ExchangeAccountDetails] var transactionId: String } /// A request to accept a manual withdrawl. diff --git a/TalerWallet1/Model/Transaction.swift b/TalerWallet1/Model/Transaction.swift @@ -403,7 +403,7 @@ struct WithdrawalDetails: Decodable { /// The public key of the reserve. var reservePub: String var reserveIsReady: Bool - var exchangeCreditAccountDetails: [WithdrawalExchangeAccountDetails]? + var exchangeCreditAccountDetails: [ExchangeAccountDetails]? /// Details for manual withdrawals: var reserveClosingDelay: RelativeTime? diff --git a/TalerWallet1/Views/Transactions/ManualDetailsV.swift b/TalerWallet1/Views/Transactions/ManualDetailsV.swift @@ -11,7 +11,7 @@ import taler_swift struct SegmentControl: View { @Binding var value: Int - let accountDetails: [WithdrawalExchangeAccountDetails] + let accountDetails: [ExchangeAccountDetails] let action: (Int) -> Void @Environment(\.colorScheme) private var colorScheme @@ -82,7 +82,7 @@ struct SegmentControl: View { struct AccountPicker: View { let title: String @Binding var value: Int - let accountDetails: [WithdrawalExchangeAccountDetails] + let accountDetails: [ExchangeAccountDetails] let action: (Int) -> Void @State private var selected = 0 @@ -135,7 +135,7 @@ struct ManualDetailsV: View { withAnimation { listID = UUID() } } } - func validDetails(_ details: [WithdrawalExchangeAccountDetails]) -> [WithdrawalExchangeAccountDetails] { + func validDetails(_ details: [ExchangeAccountDetails]) -> [ExchangeAccountDetails] { details.filter { detail in detail.status.lowercased() == "ok" } diff --git a/TalerWallet1/Views/Transactions/ManualDetailsWireV.swift b/TalerWallet1/Views/Transactions/ManualDetailsWireV.swift @@ -65,7 +65,7 @@ struct ManualDetailsWireV: View { let amountValue: String // string representation of the value, formatted as "`integer`.`fraction`" let amountStr: (String, String) let obtainStr: (String, String) - let account: WithdrawalExchangeAccountDetails + let account: ExchangeAccountDetails @AppStorage("minimalistic") var minimalistic: Bool = false let navTitle = String(localized: "Wire transfer", comment: "ViewTitle of wire-transfer instructions") @@ -226,7 +226,7 @@ struct ManualDetailsWireV: View { // xTaler: <#T##String#>, // amountStr: <#T##String#>, // obtainStr: <#T##String#>, -// account: <#T##WithdrawalExchangeAccountDetails#>) +// account: T##ExchangeAccountDetails) // } // } //}