[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-ios] 06/10: GetScopedCurrencyInfo
From: |
gnunet |
Subject: |
[taler-taler-ios] 06/10: GetScopedCurrencyInfo |
Date: |
Tue, 08 Aug 2023 12:29:25 +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 949faafeaefa0ed08545b7315aec6309919594c3
Author: Marc Stibane <marc@taler.net>
AuthorDate: Tue Aug 8 12:16:54 2023 +0200
GetScopedCurrencyInfo
---
TalerWallet1/Model/Model+Exchange.swift | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/TalerWallet1/Model/Model+Exchange.swift
b/TalerWallet1/Model/Model+Exchange.swift
index 8446893..434311d 100644
--- a/TalerWallet1/Model/Model+Exchange.swift
+++ b/TalerWallet1/Model/Model+Exchange.swift
@@ -76,6 +76,26 @@ fileprivate struct AddExchange:
WalletBackendFormattedRequest {
var exchangeBaseUrl: String
}
}
+
+/// A request to get info about a currency
+struct ScopedCurrencyInfo: Decodable {
+ var decimalSeparator: String
+ var numFractionalDigits: Int // 0 Yen, 2 €,$, 3 arabic
+ var numTinyDigits: Int // SuperScriptDigits
+ var isCurrencyNameLeading: Bool
+}
+
+fileprivate struct GetScopedCurrencyInfo: WalletBackendFormattedRequest {
+ typealias Response = ScopedCurrencyInfo
+ func operation() -> String { return "getScopedCurrencyInfo" }
+ func args() -> Args { return Args(scope: scope) }
+
+ var scope: ScopeInfo
+
+ struct Args: Encodable {
+ var scope: ScopeInfo
+ }
+}
// MARK: -
extension WalletModel {
/// ask wallet-core for its list of known exchanges
@@ -97,4 +117,12 @@ extension WalletModel {
logger.info("adding exchange: \(url, privacy: .public)")
_ = try await sendRequest(request)
}
+
+ @MainActor func getScopedCurrencyInfoM(scope: ScopeInfo)
+ async throws -> ScopedCurrencyInfo { // M for MainActor
+ let request = GetScopedCurrencyInfo(scope: scope)
+ let response = try await sendRequest(request, ASYNCDELAY)
+ return response
+ }
+
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-ios] branch master updated (dbf44d6 -> 7792241), gnunet, 2023/08/08
- [taler-taler-ios] 03/10: tip -> reward, gnunet, 2023/08/08
- [taler-taler-ios] 07/10: Wallet changes + bugfixes, gnunet, 2023/08/08
- [taler-taler-ios] 01/10: PaymentView, gnunet, 2023/08/08
- [taler-taler-ios] 10/10: iOS: bump version to 0.9.3 (17), gnunet, 2023/08/08
- [taler-taler-ios] 05/10: SuperScriptDigits, gnunet, 2023/08/08
- [taler-taler-ios] 04/10: Payment Sounds by carlo von lynX, gnunet, 2023/08/08
- [taler-taler-ios] 02/10: started with PayTemplates, gnunet, 2023/08/08
- [taler-taler-ios] 09/10: Usability improved for manual withdrawal + P2P, gnunet, 2023/08/08
- [taler-taler-ios] 08/10: NavigationLinksView, gnunet, 2023/08/08
- [taler-taler-ios] 06/10: GetScopedCurrencyInfo,
gnunet <=