taler-ios

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

PublicConstants.swift (13478B)


      1 /*
      2  * This file is part of GNU Taler, ©2022-25 Taler Systems S.A.
      3  * See LICENSE.md
      4  */
      5 /**
      6  * @author Marc Stibane
      7  */
      8 import Foundation
      9 
     10 #if TALER_WALLET
     11 let TALER_LOGO = "taler-logo-2023-blue"
     12 #elseif TALER_NIGHTLY
     13 let TALER_LOGO = "taler-logo-2023-black"
     14 #else   // GNU_TALER
     15 let TALER_LOGO = "taler-logo-2023-red"
     16 #endif
     17 let TALER_LOGO_FULL = "taler-logo-full"
     18 let TALER_LOGO_QR = "taler-logo-qr"
     19 let EXCHANGE_LOGO = "Exchange-logo-blue"
     20 let SWISS_QR = "swiss_qr"
     21 
     22 public let INVISIBLE = 0.001
     23 public let MAXEXCHANGES = 1000          // per currency
     24 public let CHF_4217 = "CHF"             // ISO-4217 Swiss Francs
     25 public let EUR_4217 = "EUR"             // ISO-4217 Euro
     26 public let HUF_4217 = "HUF"             // ISO-4217 Hungarian Forint
     27 
     28 public let TAPPED = 4                   // how often you need to tap on the Actions button before it loses its label
     29 public let DRAGGED = 2                  // #times to drag to stop the auto-dragging
     30 public let DRAGDELAY = 0.5
     31 public let DRAGDURATION = 0.45
     32 public let DRAGSPEED = 0.1
     33 public let MAXRECENT = 4                // # of rows in Recent Transactions
     34 public let SCANDETENT = 0.666            // 2/3 height - in the rest is a (invisible) dismiss button, also for VoiceOver
     35 public let ACTIONDETENT = 0.999
     36 
     37 public let ICONLEADING = CGFloat(-8)
     38 public let HSPACING = CGFloat(10)                  // space between items in HStack
     39 
     40 public let LAUNCHDURATION: Double = 1.60
     41 
     42 public let ONEDAY: UInt = 1         // 1..3
     43 public let SEVENDAYS: UInt = 7      // 3..9
     44 public let THIRTYDAYS: UInt = 30    // 10..30
     45 
     46 public let EMPTYSTRING = ""                         // avoid automatic translation of empty "" textLiterals in Text()
     47 public let SPACE = " "
     48 public let SPACECHAR: Character = " "
     49 public let NONBREAKING: Character = "\u{00A0}"
     50 public let LINEFEED = "\n"
     51 public let UNKNOWN = String(localized: "UNKNOWN", comment: "merchant didn't specify the currency, use ALL CAPS")
     52 public let LINK = "link"                            // 􀉣                       1.0 (iOS 13)
     53 public let MAPPIN = "mappin.and.ellipse"            // 􀎫                       1.0 (iOS 13)
     54 public let HAMBURGER = "line.3.horizontal"          // 􀌇                       3.0 (iOS 15)
     55 public let EXCLAMATION = "exclamationmark.circle"   // 􀁞                       1.0 (iOS 13)
     56 public let WARNING = "exclamationmark.triangle"     // 􀇾                       1.0 (iOS 13)
     57 public let CHEVRON = "chevron.forward"              // 􀯻  􀯶                     2.0 (iOS 14)   reverses for RTL
     58 public let CHEVRON_UP = "chevron.up"                // 􀆇                       1.0 (iOS 13)
     59 
     60 public let BANKNOTE = "banknote.fill"               // 􀮀                       2.0 (iOS 14)
     61 public let PLUS = "plus"                            // 􀅼                       1.0 (iOS 13)
     62 public let XMARK = "xmark"                          // 􀆄                       1.0 (iOS 13)
     63 public let LIGHT_OFF = "lightbulb"                  // 􀛭                       1.0 (iOS 13)
     64 public let LIGHT_ON = "lightbulb.fill"              // 􀛮                       1.0 (iOS 13)
     65 public let CHECKMARK = "checkmark"                  // 􀆅                       1.0 (iOS 13)
     66 public let ARROW_TOP = "arrow.up.to.line"           // 􀄿                       1.0 (iOS 13)
     67 public let ARROW_BOT = "arrow.down.to.line"         // 􀅀                       1.0 (iOS 13)
     68 public let RELOAD = "arrow.clockwise"               // 􀅈                       1.0 (iOS 13)
     69 public let COPY1 = "doc.on.doc"                     // 􀉁                       1.0 (iOS 13)
     70 public let COPY6 = "doc.on.clipboard"               // 􀉃                       6.0 (iOS 18)
     71 public let SHARE = "square.and.arrow.up"            // 􀈂                       1.0 (iOS 13)
     72 public let RETURN = "return"                        // 􀅇 􁂇                    1.0 (iOS 13)   reverses for RTL
     73 
     74 
     75 public let BALANCES = "chart.bar.xaxis"             // 􀣉                       2.0 (iOS 14)
     76 public let SETTINGS = "gear"                        // 􀍟                       1.0 (iOS 13)
     77 public let QRBUTTON = "qrcode.viewfinder"           // 􀎻                       1.0 (iOS 13)
     78 public let QRCODE = "qrcode"                        // 􀖂                       1.0 (iOS 13)
     79 public let NFCLOGO = "wave.3.right.circle"          // 􀭹                       2.0 (iOS 14)
     80 
     81 public let CONFIRM_BANK = "circle.fill"             // 􀀁 badge in PendingRow, TransactionRow and TransactionSummary
     82 public let NEEDS_KYC = "star.fill"                  // 􀋃 badge in PendingRow, TransactionRow and TransactionSummary
     83 //public let PENDING_INCOMING = "plus.diamond"      // 􀡿 􀢀                    2.0 (iOS 14)
     84 public let PENDING_INCOMING = "plus"                // 􀅼                       1.0 (iOS 13)
     85 public let PENDING_OUTGOING = "minus.diamond"       // 􀢁 􀢂                    2.0 (iOS 14)
     86 public let DONE_INCOMING = "plus.circle.fill"       // 􀁌 􀁍                    1.0 (iOS 13)
     87 public let DONE_OUTGOING = "minus.circle"           // 􀁎 􀁏                    1.0 (iOS 13)
     88 
     89 public let ICONNAME_FILL = ".fill"
     90 public let ICONNAME_DUMMY = "taler.dummy"                           // 􀀀 􀀁
     91 public let SYSTEM_DUMMY1 = "circle"                                 // 􀀀 􀀁    1.0 (iOS 13)
     92 
     93 public let ICONNAME_WITHDRAWAL = "taler.withdrawal"                 // 􁾬 􁾭
     94 public let SYSTEM_WITHDRAWAL5 = "arrowshape.down"                   // 􁾬 􁾭    5.0 (iOS 17)
     95 public let FALLBACK_WITHDRAWAL = "arrow.down"                       // 􀄩       1.0 (iOS 13)   no fill variant!
     96 //                             "arrow.down.to.line"                 //    􀅀    1.0 (iOS 13)
     97 
     98 public let ICONNAME_DEPOSIT = "taler.deposit"                       // 􁾨 􁾩
     99 public let SYSTEM_DEPOSIT5 = "arrowshape.up"                        // 􁾨 􁾩    5.0 (iOS 17)
    100 public let FALLBACK_DEPOSIT = "arrow.up"                            // 􀄨       1.0 (iOS 13)   no fill variant!
    101 //                             "arrow.up.to.line"                   //    􀄿    1.0 (iOS 13)
    102 
    103 public let ICONNAME_REFUND = "taler.refund"                         // 􀰚 􀰛
    104 public let SYSTEM_REFUND2 = "arrowshape.turn.up.backward"           // 􀰚 􀰛    2.0 (iOS 14)
    105 public let ICONNAME_PAYMENT = "taler.payment"                       // 􀉐 􀰟
    106 public let SYSTEM_PAYMENT2 = "arrowshape.turn.up.forward"           // 􀉐 􀰟    2.0 (iOS 14)
    107 
    108 public let ICONNAME_INCOMING = "taler.incoming"                     // 􁉈 􁉅
    109 public let SYSTEM_INCOMING4 = "arrowshape.backward"                 // 􁉈 􁉅    4.0 (iOS 16)
    110 public let FALLBACK_INCOMING = "arrow.backward"                     // 􀰌       2.0 (iOS 14)   no fill variant!
    111 //                             "arrow.backward.to.line"             //    􁂊    3.0 (iOS 15)
    112 
    113 public let ICONNAME_OUTGOING = "taler.outgoing"                     // 􁉆 􁉇
    114 public let SYSTEM_OUTGOING4 = "arrowshape.forward"                  // 􁉆 􁉇    4.0 (iOS 16)
    115 public let FALLBACK_OUTGOING = "arrow.forward"                      // 􀰑       2.0 (iOS 14)   no fill variant!
    116 //                             "arrow.forward.to.line"              //    􁂎    3.0 (iOS 15)
    117 
    118 public let ICONNAME_REFRESH = "taler.refresh"                       // 􀎀 􁣛
    119 public let SYSTEM_REFRESH6 = "arrow.trianglehead.counterclockwise"  // 􀎀       6.0 (iOS 18)
    120 public let SYSTEM_REFRESH6_fill = "checkmark.arrow.trianglehead.counterclockwise"  // 􁣛       6.0 (iOS 18)
    121 public let FALLBACK_REFRESH = "arrow.counterclockwise"              // 􁹠       1.0 (iOS 13)   no fill variant!
    122 //public let SYSTEM_REFRESH1 = "arrow.counterclockwise.circle"    // 􀚃 􀚄
    123 //public let SYSTEM_REFRESH2 = "arrow.counterclockwise.square"    // 􂅟 􂅠
    124 public let ICONNAME_RECOUP = "taler.recoup"                         // 􀁞 􀁟
    125 public let SYSTEM_RECOUP1 = "exclamationmark.circle"                // 􀁞 􀁟    1.0 (iOS 13)
    126 public let ICONNAME_DENOMLOSS = "taler.denomloss"                   // 􀇾 􀇿
    127 public let SYSTEM_DENOMLOSS1 = "exclamationmark.triangle"           // 􀇾 􀇿    1.0 (iOS 13)
    128 
    129 public let ICONNAME_ZOOM_IN = "taler.left.and.right.fill"           // 􀟦       3.0 (iOS 15)
    130 public let ICONNAME_ZOOM_OUT = "taler.right.and.left.fill"          // 􀟧       3.0 (iOS 15)
    131 public let SYSTEM_ZOOM_IN = "arrowtriangle.left.and.line.vertical.and.arrowtriangle.right.fill"   // 􀟦   3.0 (iOS 15)
    132 public let SYSTEM_ZOOM_OUT = "arrowtriangle.right.and.line.vertical.and.arrowtriangle.left.fill"  // 􀟧   3.0 (iOS 15)
    133 
    134 public let ICONNAME_LOCKCLOCK = "taler.lock.clock"                  // 􂆉
    135 public let SYSTEM_LOCKCLOCK = "lock.badge.clock"                    // 􂆉       5.0 (iOS 17)
    136 public let FALLBACK_LOCK = "lock"                                   // 􀎠       1.0 (iOS 13)
    137 
    138 public let SUNFILL = "sun.max.fill"                                 // 􀆮       1.0 (iOS 13)
    139 public let MOONFILL = "moon.fill"                                   // 􀆺       1.0 (iOS 13)
    140 
    141 public let HTTPS = "https://"
    142 //public let DEMOBANK = HTTPS + "bAnK.dEmO.tAlEr.nEt"             // should be weird to read, but still work
    143 //public let DEMOEXCHANGE = HTTPS + "eXcHaNgE.dEmO.tAlEr.nEt"
    144 public let TALER = "taler.net/"
    145 public let TALER_NET = HTTPS + TALER
    146 public let DEMO = ".demo." + TALER
    147 public let TEST = ".test." + TALER
    148 public let HEAD = ".head." + TALER
    149 
    150 public let SANDBOX = "instances/sandbox/"
    151 public let DEMOBANK = HTTPS + "bank" + DEMO
    152 public let DEMOSHOP = HTTPS + "shop" + DEMO
    153 public let DEMOBACKEND = HTTPS + "backend" + DEMO + SANDBOX
    154 public let DEMOEXCHANGE = HTTPS + "exchange" + DEMO
    155 public let TESTBANK = HTTPS + "bank" + TEST
    156 public let TESTSHOP = HTTPS + "shop" + TEST
    157 public let TESTBACKEND = HTTPS + "backend" + TEST + SANDBOX
    158 public let TESTEXCHANGE = HTTPS + "exchange" + TEST
    159 public let HEADBANK = HTTPS + "bank" + HEAD
    160 public let HEADSHOP = HTTPS + "shop" + HEAD
    161 public let HEADBACKEND = HTTPS + "backend" + HEAD
    162 public let HEADEXCHANGE = HTTPS + "exchange" + HEAD
    163 
    164 public let ARS_AGE_EXCHANGE = HTTPS + "exchange-age.taler.ar/"
    165 public let ARS_EXP_EXCHANGE = HTTPS + "exchange-expensive.taler.ar/"
    166 public let DEMOCURRENCY = "KUDOS"
    167 public let TESTCURRENCY = "TESTKUDOS"
    168 //public let LONGCURRENCY = "gold-pressed Latinum"                // 20 characters, with dash and space
    169 public let LONGCURRENCY = "GOLDLATINUM"                         // 11 characters, no dash, no space
    170 
    171 // MARK: - Keys used in JSON
    172 
    173 public let PLAINTEXT = "text/plain"
    174 public let MARKDOWN = "text/markdown"
    175 public let HTML = "text/html"
    176 
    177 public let EXCHANGEBASEURL = "exchangeBaseUrl"
    178 public let TALERURI = "talerUri"
    179 
    180 public let TRANSACTIONTRANSITION = "transactionTransition"
    181 public let TRANSACTIONID = "transactionID"
    182 
    183 public let NOTIFICATIONTIME = "notif.time"
    184 public let NOTIFICATIONERROR = "notif.error"
    185 public let NOTIFICATIONANIMATION = "notif.animation"
    186 
    187 /// Notifications sent by wallet-core
    188 extension Notification.Name {
    189     static let Idle = Notification.Name("idle")
    190     static let BalanceChange = Notification.Name("balance-change")
    191     static let BankAccountChange = Notification.Name(AccountChange.TransitionType.change.rawValue)
    192     static let ExchangeAdded = Notification.Name("exchange-added")
    193     static let ExchangeDeleted = Notification.Name("exchange-deleted")
    194     static let ExchangeStateTransition = Notification.Name(ExchangeTransition.TransitionType.transition.rawValue)
    195     static let TransactionStateTransition = Notification.Name(TransactionTransition.TransitionType.transition.rawValue)
    196     static let TransactionDone = Notification.Name("transaction-done")
    197     static let TransactionExpired = Notification.Name("transaction-expired")
    198     static let TransactionScanned = Notification.Name("transaction-scanned")
    199     static let PendingReady = Notification.Name("pending-ready")
    200     static let WaitReserve = Notification.Name("wait-reserve")
    201     static let WithdrawCoins = Notification.Name("withdraw-coins")
    202     static let KYCrequired = Notification.Name("kyc-required")
    203     static let DismissSheet = Notification.Name("dismiss-sheet")
    204     static let PendingOperationProcessed = Notification.Name("pending-operation-processed")
    205     static let ReserveNotYetFound = Notification.Name("reserve-not-yet-found")
    206 //    static let WithdrawalGroupBankConfirmed = Notification.Name("withdrawal-group-bank-confirmed")
    207 //    static let WithdrawalGroupReserveReady = Notification.Name("withdrawal-group-reserve-ready")
    208 //    static let WithdrawGroupFinished = Notification.Name("withdraw-group-finished")
    209 //    static let PayOperationSuccess = Notification.Name("pay-operation-success")
    210     static let ProposalAccepted = Notification.Name("proposal-accepted")
    211     static let ProposalDownloaded = Notification.Name("proposal-downloaded")
    212     static let TaskObservabilityEvent = Notification.Name("task-observability-event")
    213     static let RequestObservabilityEvent = Notification.Name("request-observability-event")
    214 
    215     static let GeneralError = Notification.Name("error")
    216     static let TransactionError = Notification.Name("txError")
    217 }
    218 
    219 /// Notifications for internal synchronization
    220 extension Notification.Name {
    221     static let SendAction = Notification.Name("sendAction")
    222     static let RequestAction = Notification.Name("requestAction")
    223     static let DepositAction = Notification.Name("depositAction")
    224     static let WithdrawAction = Notification.Name("withdrawAction")
    225     static let QrScanAction = Notification.Name("qrScanAction")
    226 }