[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-ios] 50/54: withdrawalAmountDetails
From: |
gnunet |
Subject: |
[taler-taler-ios] 50/54: withdrawalAmountDetails |
Date: |
Fri, 30 Jun 2023 22:34:22 +0200 |
This is an automated email from the git hooks/post-receive script.
marc-stibane pushed a commit to branch master
in repository taler-ios.
commit 605eefc9bf0333c662c1eea9d7a33f26022e986b
Author: Marc Stibane <marc@taler.net>
AuthorDate: Fri Jun 30 19:24:14 2023 +0200
withdrawalAmountDetails
---
TalerWallet1/Model/Model+Withdraw.swift | 6 +++---
TalerWallet1/Views/Exchange/ManualWithdraw.swift | 18 +++++++++---------
TalerWallet1/Views/Exchange/QuiteSomeCoins.swift | 2 +-
.../Views/WithdrawBankIntegrated/WithdrawURIView.swift | 18 +++++++++---------
4 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/TalerWallet1/Model/Model+Withdraw.swift
b/TalerWallet1/Model/Model+Withdraw.swift
index 05a2ed8..0a1b5e2 100644
--- a/TalerWallet1/Model/Model+Withdraw.swift
+++ b/TalerWallet1/Model/Model+Withdraw.swift
@@ -44,7 +44,7 @@ fileprivate struct GetWithdrawalDetailsForURI:
WalletBackendFormattedRequest {
}
// MARK: -
/// The result from getWithdrawalDetailsForAmount
-struct ManualWithdrawalDetails: Decodable {
+struct WithdrawalAmountDetails: Decodable {
var tosAccepted: Bool // Did the user accept the current
version of the exchange's terms of service?
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
@@ -54,7 +54,7 @@ struct ManualWithdrawalDetails: Decodable {
}
/// A request to get an exchange's withdrawal details.
fileprivate struct GetWithdrawalDetailsForAmount:
WalletBackendFormattedRequest {
- typealias Response = ManualWithdrawalDetails
+ typealias Response = WithdrawalAmountDetails
func operation() -> String { return "getWithdrawalDetailsForAmount" }
func args() -> Args { return Args(exchangeBaseUrl: exchangeBaseUrl,
amount: amount) }
@@ -150,7 +150,7 @@ extension WalletModel {
}
@MainActor
func loadWithdrawalDetailsForAmountM(_ exchangeBaseUrl: String, amount:
Amount) // M for MainActor
- async throws -> ManualWithdrawalDetails {
+ async throws -> WithdrawalAmountDetails {
let request = GetWithdrawalDetailsForAmount(exchangeBaseUrl:
exchangeBaseUrl,
amount: amount)
let response = try await sendRequest(request, ASYNCDELAY)
diff --git a/TalerWallet1/Views/Exchange/ManualWithdraw.swift
b/TalerWallet1/Views/Exchange/ManualWithdraw.swift
index 885c5a7..366d672 100644
--- a/TalerWallet1/Views/Exchange/ManualWithdraw.swift
+++ b/TalerWallet1/Views/Exchange/ManualWithdraw.swift
@@ -15,7 +15,7 @@ struct ManualWithdraw: View {
@EnvironmentObject private var model: WalletModel
- @State var manualWithdrawalDetails: ManualWithdrawalDetails? = nil
+ @State var withdrawalAmountDetails: WithdrawalAmountDetails? = nil
// @State var ageMenuList: [Int] = []
// @State var selectedAge = 0
@@ -37,15 +37,15 @@ struct ManualWithdraw: View {
CurrencyInputView(currencyField: currencyField,
title: String(localized: "Amount to withdraw:"))
- let someCoins = SomeCoins(details: manualWithdrawalDetails)
+ let someCoins = SomeCoins(details: withdrawalAmountDetails)
QuiteSomeCoins(someCoins: someCoins, shouldShowFee: true,
- currency: currency, amountEffective:
manualWithdrawalDetails?.amountEffective)
+ currency: currency, amountEffective:
withdrawalAmountDetails?.amountEffective)
if !someCoins.invalid {
if !someCoins.tooMany {
// agePicker
- if let tosAccepted = manualWithdrawalDetails?.tosAccepted {
+ if let tosAccepted = withdrawalAmountDetails?.tosAccepted {
if tosAccepted {
// let restrictAge: Int? = (selectedAge == 0) ? nil
// :
selectedAge
@@ -82,11 +82,11 @@ struct ManualWithdraw: View {
.task(id: centsToTransfer) {
let amount = Amount.amountFromCents(currency, centsToTransfer)
do {
- manualWithdrawalDetails = try await
model.loadWithdrawalDetailsForAmountM(exchange.exchangeBaseUrl, amount: amount)
-// agePicker.setAges(ages:
manualWithdrawalDetails?.ageRestrictionOptions)
+ withdrawalAmountDetails = try await
model.loadWithdrawalDetailsForAmountM(exchange.exchangeBaseUrl, amount: amount)
+// agePicker.setAges(ages:
withdrawalAmountDetails?.ageRestrictionOptions)
} catch { // TODO: error
symLog.log(error.localizedDescription)
- manualWithdrawalDetails = nil
+ withdrawalAmountDetails = nil
}
}
}
@@ -95,7 +95,7 @@ struct ManualWithdraw: View {
#if DEBUG
struct ManualWithdraw_Container : View {
@State private var centsToTransfer: UInt64 = 510
- @State private var details = ManualWithdrawalDetails(tosAccepted: false,
+ @State private var details = WithdrawalAmountDetails(tosAccepted: false,
amountRaw: try!
Amount(fromString: LONGCURRENCY + ":5.1"),
amountEffective: try!
Amount(fromString: LONGCURRENCY + ":5.0"),
paytoUris: [],
@@ -111,7 +111,7 @@ struct ManualWithdraw_Container : View {
permanent: false)
ManualWithdraw(exchange: exchange,
centsToTransfer: $centsToTransfer,
- manualWithdrawalDetails: details)
+ withdrawalAmountDetails: details)
}
}
diff --git a/TalerWallet1/Views/Exchange/QuiteSomeCoins.swift
b/TalerWallet1/Views/Exchange/QuiteSomeCoins.swift
index 1c2febf..7efe434 100644
--- a/TalerWallet1/Views/Exchange/QuiteSomeCoins.swift
+++ b/TalerWallet1/Views/Exchange/QuiteSomeCoins.swift
@@ -19,7 +19,7 @@ struct SomeCoins {
}
extension SomeCoins {
- init(details: ManualWithdrawalDetails?) {
+ init(details: WithdrawalAmountDetails?) {
do {
if let details {
// Incoming: fee = raw - effective
diff --git a/TalerWallet1/Views/WithdrawBankIntegrated/WithdrawURIView.swift
b/TalerWallet1/Views/WithdrawBankIntegrated/WithdrawURIView.swift
index 85779a7..da3f547 100644
--- a/TalerWallet1/Views/WithdrawBankIntegrated/WithdrawURIView.swift
+++ b/TalerWallet1/Views/WithdrawBankIntegrated/WithdrawURIView.swift
@@ -20,15 +20,15 @@ struct WithdrawURIView: View {
// the exchange used for this withdrawal.
@State private var exchangeBaseUrl: String? = nil
- @State private var manualWithdrawalDetails: ManualWithdrawalDetails?
+ @State private var withdrawalAmountDetails: WithdrawalAmountDetails?
var body: some View {
let badURL = "Error in URL: \(url)"
VStack {
- if let manualWithdrawalDetails, let exchangeBaseUrl {
+ if let withdrawalAmountDetails, let exchangeBaseUrl {
List {
- let raw = manualWithdrawalDetails.amountRaw
- let effective = manualWithdrawalDetails.amountEffective
+ let raw = withdrawalAmountDetails.amountRaw
+ let effective = withdrawalAmountDetails.amountEffective
let currency = raw.currencyStr
let fee = try! Amount.diff(raw, effective)
let outColor = WalletColors().transactionColor(false)
@@ -40,12 +40,12 @@ struct WithdrawURIView: View {
bottomAmount: effective,
large: false, pending: false,
incoming: true,
baseURL: exchangeBaseUrl)
- let someCoins = SomeCoins(details: manualWithdrawalDetails)
+ let someCoins = SomeCoins(details: withdrawalAmountDetails)
QuiteSomeCoins(someCoins: someCoins, shouldShowFee: false,
currency: raw.currencyStr, amountEffective:
effective)
}
.navigationTitle(navTitle)
- let tosAccepted = manualWithdrawalDetails.tosAccepted
+ let tosAccepted = withdrawalAmountDetails.tosAccepted
if tosAccepted {
NavigationLink(destination: LazyView {
WithdrawAcceptDone(exchangeBaseUrl: exchangeBaseUrl,
url: url)
@@ -85,15 +85,15 @@ struct WithdrawURIView: View {
}
if let exchangeBaseUrl {
let details = try await
model.loadWithdrawalDetailsForAmountM(exchangeBaseUrl, amount: amount)
- manualWithdrawalDetails = details
+ withdrawalAmountDetails = details
// agePicker.setAges(ages: details?.ageRestrictionOptions)
} else { // TODO: error
symLog.log("no exchangeBaseUrl")
- manualWithdrawalDetails = nil
+ withdrawalAmountDetails = nil
}
} catch { // TODO: error
symLog.log(error.localizedDescription)
- manualWithdrawalDetails = nil
+ withdrawalAmountDetails = nil
}
}
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-ios] 39/54: Scrollview, (continued)
- [taler-taler-ios] 39/54: Scrollview, gnunet, 2023/06/30
- [taler-taler-ios] 25/54: failTransaction, gnunet, 2023/06/30
- [taler-taler-ios] 23/54: Remove old view, gnunet, 2023/06/30
- [taler-taler-ios] 24/54: balance-change, gnunet, 2023/06/30
- [taler-taler-ios] 47/54: #available(iOS 17.0, *) only with Xcode 15, gnunet, 2023/06/30
- [taler-taler-ios] 46/54: ThreeAmountsSheet, gnunet, 2023/06/30
- [taler-taler-ios] 51/54: remove debugging, gnunet, 2023/06/30
- [taler-taler-ios] 22/54: cleaned up P2P, gnunet, 2023/06/30
- [taler-taler-ios] 54/54: iOS: bump version to 0.9.3 (10), gnunet, 2023/06/30
- [taler-taler-ios] 49/54: ScrollViewReader, gnunet, 2023/06/30
- [taler-taler-ios] 50/54: withdrawalAmountDetails,
gnunet <=
- [taler-taler-ios] 48/54: Demo Shop, reloading, gnunet, 2023/06/30
- [taler-taler-ios] 52/54: playSound, gnunet, 2023/06/30
- [taler-taler-ios] 53/54: ScrollViewReader needs Spacers if too few items, gnunet, 2023/06/30