taler-ios

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

PublicConstants.swift (11153B)


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