commit 2d5a14f1277d3dea78a838b2f2c7eb64a82426a8 parent 9387c893ed8c7516aa34824266bb2d3824a74c47 Author: Marc Stibane <marc@taler.net> Date: Wed, 26 Jun 2024 15:07:34 +0200 wireFee Diffstat:
4 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/TalerWallet1/Model/Model+Withdraw.swift b/TalerWallet1/Model/Model+Withdraw.swift @@ -55,9 +55,11 @@ struct WithdrawUriInfoResponse: Decodable { var operationId: String var status: WithdrawalOperationStatus // pending, selected, aborted, confirmed var confirmTransferUrl: String? + var currency: String // use this if amount=nil var amount: Amount? // if nil then ask User + var editableAmount: Bool var maxAmount: Amount? // limit how much the user may withdraw - var currency: String // use this if amount=nil + var wireFee: Amount? var defaultExchangeBaseUrl: String? // if nil then use possibleExchanges var possibleExchanges: [Exchange] // TODO: query these for fees? } diff --git a/TalerWallet1/Views/HelperViews/AmountInputV.swift b/TalerWallet1/Views/HelperViews/AmountInputV.swift @@ -16,6 +16,7 @@ struct AmountInputV: View { let url: URL? let amountAvailable: Amount? // TODO: GetMaxPeerPushAmount @Binding var amountToTransfer: Amount + let wireFee: Amount? let amountLabel: String let summaryIsEditable: Bool // if true we call SubjectInputV next @Binding var summary: String diff --git a/TalerWallet1/Views/Sheets/Payment/PayTemplateV.swift b/TalerWallet1/Views/Sheets/Payment/PayTemplateV.swift @@ -122,6 +122,7 @@ struct PayTemplateV: View { let amountInput = AmountInputV(stack: stack.push(), url: url, amountAvailable: nil, amountToTransfer: $amountToTransfer, + wireFee: nil, amountLabel: amountLabel, summaryIsEditable: summaryIsEditable, summary: $summary, diff --git a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift @@ -30,6 +30,7 @@ struct WithdrawURIView: View { @State private var amountToTransfer = Amount.zero(currency: EMPTYSTRING) // Update currency when used @State private var amountShortcut = Amount.zero(currency: EMPTYSTRING) // Update currency when used @State private var shortcutSelected = false + @State private var wireFee: Amount? = nil @State private var selectedExchange = EMPTYSTRING @State private var exchange: Exchange? = nil @@ -75,6 +76,7 @@ struct WithdrawURIView: View { WithdrawAcceptView(stack: stack.push(), url: url, amountToTransfer: $amountToTransfer, exchange: $exchange) + wireFee: wireFee, } else { WithdrawAcceptView(stack: stack.push(), url: url, amountToTransfer: $amountToTransfer, @@ -105,6 +107,7 @@ struct WithdrawURIView: View { defaultExchangeBaseUrl = someInfo.defaultExchangeBaseUrl possibleExchanges = someInfo.possibleExchanges amountToTransfer = someInfo.amount ?? Amount.zero(currency: someInfo.currency) + wireFee = someInfo.wireFee } // TODO: amount = nil ==> show amount input