taler-ios

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

PublicConstants.swift (14298B)


      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 = 3                   // 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 HALFDETENT = 0.666           // 2/3 height - in the rest is a (invisible) dismiss button, also for VoiceOver
     35 public let FULLDETENT = 0.999           // leave 0.001 space for dismiss
     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 = "document.on.clipboard"        // 􀉃                       6.0 (iOS 18)
     71 public let PASTE = "doc.on.clipboard"               // 􀉃                       1.0 (iOS 13)
     72 public let SHARE = "square.and.arrow.up"            // 􀈂                       1.0 (iOS 13)
     73 public let RETURN = "return"                        // 􀅇 􁂇                    1.0 (iOS 13)   reverses for RTL
     74 public let MERCHANT14 = "handbag"                   // 􁞸                       2.0 (iOS 14)
     75 public let MERCHANT17 = "storefront"                // 􁽇                       5.0 (iOS 17)
     76 
     77 
     78 public let BALANCES = "chart.bar.xaxis"             // 􀣉                       2.0 (iOS 14)
     79 public let SETTINGS = "gear"                        // 􀍟                       1.0 (iOS 13)
     80 public let QRBUTTON = "qrcode.viewfinder"           // 􀎻                       1.0 (iOS 13)
     81 public let QRCODE = "qrcode"                        // 􀖂                       1.0 (iOS 13)
     82 public let NFCLOGO = "wave.3.right.circle"          // 􀭹                       2.0 (iOS 14)
     83 public let NOTIFICATION1 = "bell"                   // 􀋙 􀋚                    1.0 (iOS 13)
     84 public let NOTIFICATION2 = "bell.badge"             // 􀝖 􀝗                    2.0 (iOS 14)   reverses for RTL
     85 
     86 public let CONFIRM_BANK = "circle.fill"             // 􀀁 badge in PendingRow, TransactionRow and TransactionSummary
     87 public let NEEDS_KYC = "star.fill"                  // 􀋃 badge in PendingRow, TransactionRow and TransactionSummary
     88 //public let PENDING_INCOMING = "plus.diamond"      // 􀡿 􀢀                    2.0 (iOS 14)
     89 public let PENDING_INCOMING = "plus"                // 􀅼                       1.0 (iOS 13)
     90 public let PENDING_OUTGOING = "minus.diamond"       // 􀢁 􀢂                    2.0 (iOS 14)
     91 public let DONE_INCOMING = "plus.circle.fill"       // 􀁌 􀁍                    1.0 (iOS 13)
     92 public let DONE_OUTGOING = "minus.circle"           // 􀁎 􀁏                    1.0 (iOS 13)
     93 
     94 public let ICONNAME_FILL = ".fill"
     95 public let ICONNAME_DUMMY = "taler.dummy"                           // 􀀀 􀀁
     96 public let SYSTEM_DUMMY1 = "circle"                                 // 􀀀 􀀁    1.0 (iOS 13)
     97 
     98 public let ICONNAME_WITHDRAWAL = "taler.withdrawal"                 // 􁾬 􁾭
     99 public let SYSTEM_WITHDRAWAL5 = "arrowshape.down"                   // 􁾬 􁾭    5.0 (iOS 17)
    100 public let FALLBACK_WITHDRAWAL = "arrow.down"                       // 􀄩       1.0 (iOS 13)   no fill variant!
    101 //                             "arrow.down.to.line"                 //    􀅀    1.0 (iOS 13)
    102 
    103 public let ICONNAME_DEPOSIT = "taler.deposit"                       // 􁾨 􁾩
    104 public let SYSTEM_DEPOSIT5 = "arrowshape.up"                        // 􁾨 􁾩    5.0 (iOS 17)
    105 public let FALLBACK_DEPOSIT = "arrow.up"                            // 􀄨       1.0 (iOS 13)   no fill variant!
    106 //                             "arrow.up.to.line"                   //    􀄿    1.0 (iOS 13)
    107 
    108 public let ICONNAME_REFUND = "taler.refund"                         // 􀰚 􀰛
    109 public let SYSTEM_REFUND2 = "arrowshape.turn.up.backward"           // 􀰚 􀰛    2.0 (iOS 14)
    110 public let ICONNAME_PAYMENT = "taler.payment"                       // 􀉐 􀰟
    111 public let SYSTEM_PAYMENT2 = "arrowshape.turn.up.forward"           // 􀉐 􀰟    2.0 (iOS 14)
    112 
    113 public let ICONNAME_INCOMING = "taler.incoming"                     // 􁉈 􁉅
    114 public let SYSTEM_INCOMING4 = "arrowshape.backward"                 // 􁉈 􁉅    4.0 (iOS 16)
    115 public let FALLBACK_INCOMING = "arrow.backward"                     // 􀰌       2.0 (iOS 14)   no fill variant!
    116 //                             "arrow.backward.to.line"             //    􁂊    3.0 (iOS 15)
    117 
    118 public let ICONNAME_OUTGOING = "taler.outgoing"                     // 􁉆 􁉇
    119 public let SYSTEM_OUTGOING4 = "arrowshape.forward"                  // 􁉆 􁉇    4.0 (iOS 16)
    120 public let FALLBACK_OUTGOING = "arrow.forward"                      // 􀰑       2.0 (iOS 14)   no fill variant!
    121 //                             "arrow.forward.to.line"              //    􁂎    3.0 (iOS 15)
    122 
    123 public let ICONNAME_REFRESH = "taler.refresh"                       // 􀎀 􁣛
    124 public let SYSTEM_REFRESH6 = "arrow.trianglehead.counterclockwise"  // 􀎀       6.0 (iOS 18)
    125 public let SYSTEM_REFRESH6_fill = "checkmark.arrow.trianglehead.counterclockwise"  // 􁣛       6.0 (iOS 18)
    126 public let FALLBACK_REFRESH = "arrow.counterclockwise"              // 􁹠       1.0 (iOS 13)   no fill variant!
    127 //public let SYSTEM_REFRESH1 = "arrow.counterclockwise.circle"    // 􀚃 􀚄
    128 //public let SYSTEM_REFRESH2 = "arrow.counterclockwise.square"    // 􂅟 􂅠
    129 public let ICONNAME_RECOUP = "taler.recoup"                         // 􀁞 􀁟
    130 public let SYSTEM_RECOUP1 = "exclamationmark.circle"                // 􀁞 􀁟    1.0 (iOS 13)
    131 public let ICONNAME_DENOMLOSS = "taler.denomloss"                   // 􀇾 􀇿
    132 public let SYSTEM_DENOMLOSS1 = "exclamationmark.triangle"           // 􀇾 􀇿    1.0 (iOS 13)
    133 
    134 public let ICONNAME_ZOOM_IN = "taler.left.and.right.fill"           // 􀟦       3.0 (iOS 15)
    135 public let ICONNAME_ZOOM_OUT = "taler.right.and.left.fill"          // 􀟧       3.0 (iOS 15)
    136 public let SYSTEM_ZOOM_IN = "arrowtriangle.left.and.line.vertical.and.arrowtriangle.right.fill"   // 􀟦   3.0 (iOS 15)
    137 public let SYSTEM_ZOOM_OUT = "arrowtriangle.right.and.line.vertical.and.arrowtriangle.left.fill"  // 􀟧   3.0 (iOS 15)
    138 
    139 public let ICONNAME_LOCKCLOCK = "taler.lock.clock"                  // 􂆉
    140 public let SYSTEM_LOCKCLOCK = "lock.badge.clock"                    // 􂆉       5.0 (iOS 17)
    141 public let FALLBACK_LOCK = "lock"                                   // 􀎠       1.0 (iOS 13)
    142 
    143 public let SUNFILL = "sun.max.fill"                                 // 􀆮       1.0 (iOS 13)
    144 public let MOONFILL = "moon.fill"                                   // 􀆺       1.0 (iOS 13)
    145 
    146 public let HTTPS = "https://"
    147 //public let DEMOBANK = HTTPS + "bAnK.dEmO.tAlEr.nEt"             // should be weird to read, but still work
    148 //public let DEMOEXCHANGE = HTTPS + "eXcHaNgE.dEmO.tAlEr.nEt"
    149 public let TALER = "taler.net/"
    150 public let TALER_NET = HTTPS + TALER
    151 public let DEMO = ".demo." + TALER
    152 public let TEST = ".test." + TALER
    153 public let HEAD = ".head." + TALER
    154 
    155 public let SANDBOX = "instances/sandbox/"
    156 public let DEMOBANK = HTTPS + "bank" + DEMO
    157 public let DEMOSHOP = HTTPS + "shop" + DEMO
    158 public let DEMOBACKEND = HTTPS + "backend" + DEMO + SANDBOX
    159 public let DEMOEXCHANGE = HTTPS + "exchange" + DEMO
    160 public let TESTBANK = HTTPS + "bank" + TEST
    161 public let TESTSHOP = HTTPS + "shop" + TEST
    162 public let TESTBACKEND = HTTPS + "backend" + TEST + SANDBOX
    163 public let TESTEXCHANGE = HTTPS + "exchange" + TEST
    164 public let HEADBANK = HTTPS + "bank" + HEAD
    165 public let HEADSHOP = HTTPS + "shop" + HEAD
    166 public let HEADBACKEND = HTTPS + "backend" + HEAD
    167 public let HEADEXCHANGE = HTTPS + "exchange" + HEAD
    168 
    169 public let ARS_AGE_EXCHANGE = HTTPS + "exchange-age.taler.ar/"
    170 public let ARS_EXP_EXCHANGE = HTTPS + "exchange-expensive.taler.ar/"
    171 public let DEMOCURRENCY = "KUDOS"
    172 public let TESTCURRENCY = "TESTKUDOS"
    173 //public let LONGCURRENCY = "gold-pressed Latinum"                // 20 characters, with dash and space
    174 public let LONGCURRENCY = "GOLDLATINUM"                         // 11 characters, no dash, no space
    175 
    176 // MARK: - Keys used in JSON
    177 
    178 public let PLAINTEXT = "text/plain"
    179 public let MARKDOWN = "text/markdown"
    180 public let HTML = "text/html"
    181 
    182 public let EXCHANGEBASEURL = "exchangeBaseUrl"
    183 public let TALERURI = "talerUri"
    184 
    185 public let TRANSACTIONTRANSITION = "transactionTransition"
    186 public let TRANSACTIONID = "transactionID"
    187 
    188 public let NOTIFICATIONTIME = "notif.time"
    189 public let NOTIFICATIONERROR = "notif.error"
    190 public let NOTIFICATIONANIMATION = "notif.animation"
    191 public let NOTIFICATIONSHARE = "notif.share"
    192 public let NOTIFICATIONPASTE = "notif.paste"
    193 
    194 /// Notifications sent by wallet-core
    195 extension Notification.Name {
    196     static let Idle = Notification.Name("idle")
    197     static let BalanceChange = Notification.Name("balance-change")
    198     static let BankAccountChange = Notification.Name(AccountChange.TransitionType.change.rawValue)
    199     static let ExchangeAdded = Notification.Name("exchange-added")
    200     static let ExchangeDeleted = Notification.Name("exchange-deleted")
    201     static let ExchangeStateTransition = Notification.Name(ExchangeTransition.TransitionType.transition.rawValue)
    202     static let TransactionStateTransition = Notification.Name(TransactionTransition.TransitionType.transition.rawValue)
    203     static let TransactionDone = Notification.Name("transaction-done")
    204     static let TransactionExpired = Notification.Name("transaction-expired")
    205     static let TransactionScanned = Notification.Name("transaction-scanned")
    206     static let PendingReady = Notification.Name("pending-ready")
    207     static let WaitReserve = Notification.Name("wait-reserve")
    208     static let WithdrawCoins = Notification.Name("withdraw-coins")
    209     static let KYCrequired = Notification.Name("kyc-required")
    210     static let DismissSheet = Notification.Name("dismiss-sheet")
    211     static let PendingOperationProcessed = Notification.Name("pending-operation-processed")
    212     static let ReserveNotYetFound = Notification.Name("reserve-not-yet-found")
    213 //    static let WithdrawalGroupBankConfirmed = Notification.Name("withdrawal-group-bank-confirmed")
    214 //    static let WithdrawalGroupReserveReady = Notification.Name("withdrawal-group-reserve-ready")
    215 //    static let WithdrawGroupFinished = Notification.Name("withdraw-group-finished")
    216 //    static let PayOperationSuccess = Notification.Name("pay-operation-success")
    217     static let ProposalAccepted = Notification.Name("proposal-accepted")
    218     static let ProposalDownloaded = Notification.Name("proposal-downloaded")
    219     static let TaskObservabilityEvent = Notification.Name("task-observability-event")
    220     static let RequestObservabilityEvent = Notification.Name("request-observability-event")
    221 
    222     static let GeneralError = Notification.Name("error")
    223     static let TransactionError = Notification.Name("txError")
    224 }
    225 
    226 /// Notifications for internal synchronization
    227 extension Notification.Name {
    228     static let SendAction = Notification.Name("sendAction")
    229     static let RequestAction = Notification.Name("requestAction")
    230     static let DepositAction = Notification.Name("depositAction")
    231     static let WithdrawAction = Notification.Name("withdrawAction")
    232     static let QrScanAction = Notification.Name("qrScanAction")
    233     static let SettingsAction = Notification.Name("settingsAction")
    234     static let ShareAction = Notification.Name("shareAction")
    235     static let PasteAction = Notification.Name("pasteAction")
    236 }