From 5e2027bc3a446c9da966afd1c86f5acfa68c7f1c Mon Sep 17 00:00:00 2001 From: Denis D Date: Tue, 4 Feb 2020 16:23:18 +0200 Subject: [PATCH] https://github.com/BeamMW/ios-wallet/issues/366 --- BeamWallet.xcodeproj/project.pbxproj | 242 +++++++----------- BeamWallet/AppDelegate.swift | 19 +- BeamWallet/BeamSDK/AppModel.h | 2 + BeamWallet/BeamSDK/AppModel.mm | 60 +++++ BeamWallet/BeamSDK/WalletModel.h | 4 +- BeamWallet/BeamSDK/WalletModel.mm | 16 +- BeamWallet/Controls/BMCountdownView.swift | 7 +- .../Controls/BMDataPickerViewController.swift | 5 +- .../Controls/BMInputViewController.swift | 19 +- BeamWallet/Controls/BMOverlayTimerView.swift | 85 ++++++ BeamWallet/Manager/OnboardManager.swift | 10 +- .../Model/Settings/SettingsViewModel.swift | 44 +++- BeamWallet/Protocols/LocalizableStrings.swift | 3 + .../CreateWalletPasswordViewController.swift | 2 +- .../Main/Wallet/Cells/OnboardCell.swift | 5 +- .../Main/Wallet/Cells/OnboardCell.xib | 5 +- .../Main/Wallet/WalletViewController.swift | 11 +- Resources/en.lproj/Localizable.strings | 2 + 18 files changed, 356 insertions(+), 185 deletions(-) create mode 100644 BeamWallet/Controls/BMOverlayTimerView.swift diff --git a/BeamWallet.xcodeproj/project.pbxproj b/BeamWallet.xcodeproj/project.pbxproj index 70097209..362b2fa4 100644 --- a/BeamWallet.xcodeproj/project.pbxproj +++ b/BeamWallet.xcodeproj/project.pbxproj @@ -302,18 +302,6 @@ 9268EA9A23A3DE650015FD68 /* bgBlack.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9268EA9923A3DE650015FD68 /* bgBlack.jpg */; }; 9268EA9B23A3DE650015FD68 /* bgBlack.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9268EA9923A3DE650015FD68 /* bgBlack.jpg */; }; 9268EA9C23A3DE650015FD68 /* bgBlack.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9268EA9923A3DE650015FD68 /* bgBlack.jpg */; }; - 9268EAA823A3E0A70015FD68 /* libmnemonic.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9268EA9D23A3E0A60015FD68 /* libmnemonic.a */; }; - 9268EAA923A3E0A70015FD68 /* libpbkdf.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9268EA9E23A3E0A60015FD68 /* libpbkdf.a */; }; - 9268EAAA23A3E0A70015FD68 /* libpow.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9268EA9F23A3E0A60015FD68 /* libpow.a */; }; - 9268EAAB23A3E0A70015FD68 /* libkeykeeper.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9268EAA023A3E0A60015FD68 /* libkeykeeper.a */; }; - 9268EAAC23A3E0A70015FD68 /* libuv_a.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9268EAA123A3E0A60015FD68 /* libuv_a.a */; }; - 9268EAAD23A3E0A70015FD68 /* libwallet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9268EAA223A3E0A60015FD68 /* libwallet.a */; }; - 9268EAAE23A3E0A70015FD68 /* libp2p.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9268EAA323A3E0A70015FD68 /* libp2p.a */; }; - 9268EAAF23A3E0A70015FD68 /* libhttp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9268EAA423A3E0A70015FD68 /* libhttp.a */; }; - 9268EAB023A3E0A70015FD68 /* libexternal_pow.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9268EAA523A3E0A70015FD68 /* libexternal_pow.a */; }; - 9268EAB123A3E0A70015FD68 /* libblake2b.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9268EAA623A3E0A70015FD68 /* libblake2b.a */; }; - 9268EAB223A3E0A70015FD68 /* libcore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9268EAA723A3E0A70015FD68 /* libcore.a */; }; - 9268EAB423A3E0B80015FD68 /* libsqlite.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9268EAB323A3E0B70015FD68 /* libsqlite.a */; }; 9268EAB523A3E0D30015FD68 /* libsecp256k1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9297388D2397F3BA008603C8 /* libsecp256k1.a */; }; 9268EAB723A3E0DC0015FD68 /* libcli.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9297388B2397F3B9008603C8 /* libcli.a */; }; 9268EAB823A3E15B0015FD68 /* libutility.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 929738892397F3B9008603C8 /* libutility.a */; }; @@ -386,6 +374,35 @@ 927993C422F424D300FF8ECC /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 927993C822F424D300FF8ECC /* InfoPlist.strings */; }; 927993C522F424D300FF8ECC /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 927993C822F424D300FF8ECC /* InfoPlist.strings */; }; 927993C622F424D300FF8ECC /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 927993C822F424D300FF8ECC /* InfoPlist.strings */; }; + 927C167723DB3439006BCF29 /* libblake2b.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 929738832397F3B9008603C8 /* libblake2b.a */; }; + 927C167823DB3439006BCF29 /* libcli.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9297388B2397F3B9008603C8 /* libcli.a */; }; + 927C167923DB3439006BCF29 /* libcore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 929738852397F3B9008603C8 /* libcore.a */; }; + 927C167A23DB3439006BCF29 /* libexternal_pow.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 929738862397F3B9008603C8 /* libexternal_pow.a */; }; + 927C167B23DB3439006BCF29 /* libhttp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 929738882397F3B9008603C8 /* libhttp.a */; }; + 927C167C23DB3439006BCF29 /* libkeykeeper.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 929738812397F3B8008603C8 /* libkeykeeper.a */; }; + 927C167D23DB3439006BCF29 /* libmnemonic.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9297388C2397F3BA008603C8 /* libmnemonic.a */; }; + 927C167E23DB3439006BCF29 /* libnode.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 929738872397F3B9008603C8 /* libnode.a */; }; + 927C167F23DB3439006BCF29 /* libp2p.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9297388E2397F3BA008603C8 /* libp2p.a */; }; + 927C168023DB3439006BCF29 /* libpbkdf.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 929738822397F3B8008603C8 /* libpbkdf.a */; }; + 927C168123DB3439006BCF29 /* libpow.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9297388F2397F3BA008603C8 /* libpow.a */; }; + 927C168223DB3439006BCF29 /* libsecp256k1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9297388D2397F3BA008603C8 /* libsecp256k1.a */; }; + 927C168323DB3439006BCF29 /* libsqlite.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 929738842397F3B9008603C8 /* libsqlite.a */; }; + 927C168423DB3439006BCF29 /* libutility.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 929738892397F3B9008603C8 /* libutility.a */; }; + 927C168523DB3439006BCF29 /* libuv_a.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9297388A2397F3B9008603C8 /* libuv_a.a */; }; + 927C168623DB3439006BCF29 /* libwallet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 929738802397F3B8008603C8 /* libwallet.a */; }; + 927C168723DB3439006BCF29 /* libblake2b.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 929738832397F3B9008603C8 /* libblake2b.a */; }; + 927C168823DB3439006BCF29 /* libcore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 929738852397F3B9008603C8 /* libcore.a */; }; + 927C168923DB3439006BCF29 /* libexternal_pow.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 929738862397F3B9008603C8 /* libexternal_pow.a */; }; + 927C168A23DB3439006BCF29 /* libhttp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 929738882397F3B9008603C8 /* libhttp.a */; }; + 927C168B23DB3439006BCF29 /* libkeykeeper.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 929738812397F3B8008603C8 /* libkeykeeper.a */; }; + 927C168C23DB3439006BCF29 /* libmnemonic.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9297388C2397F3BA008603C8 /* libmnemonic.a */; }; + 927C168D23DB3439006BCF29 /* libnode.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 929738872397F3B9008603C8 /* libnode.a */; }; + 927C168E23DB3439006BCF29 /* libp2p.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9297388E2397F3BA008603C8 /* libp2p.a */; }; + 927C168F23DB3439006BCF29 /* libpbkdf.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 929738822397F3B8008603C8 /* libpbkdf.a */; }; + 927C169023DB3439006BCF29 /* libpow.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9297388F2397F3BA008603C8 /* libpow.a */; }; + 927C169123DB3439006BCF29 /* libsqlite.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 929738842397F3B9008603C8 /* libsqlite.a */; }; + 927C169223DB3439006BCF29 /* libuv_a.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9297388A2397F3B9008603C8 /* libuv_a.a */; }; + 927C169323DB3439006BCF29 /* libwallet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 929738802397F3B8008603C8 /* libwallet.a */; }; 927D2F8222CF4A7A00D4B439 /* TransactionShareView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 927D2F8122CF4A7A00D4B439 /* TransactionShareView.swift */; }; 927D2F8322CF4A7A00D4B439 /* TransactionShareView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 927D2F8122CF4A7A00D4B439 /* TransactionShareView.swift */; }; 927D2F8422CF4A7A00D4B439 /* TransactionShareView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 927D2F8122CF4A7A00D4B439 /* TransactionShareView.swift */; }; @@ -540,6 +557,9 @@ 92AE366C22383D2300E0810B /* QRScannerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92AE366A22383D2300E0810B /* QRScannerViewController.swift */; }; 92AE366D22383D2300E0810B /* QRScannerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 92AE366B22383D2300E0810B /* QRScannerViewController.xib */; }; 92AE366F223845E300E0810B /* BMNetworkStatusView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92AE366E223845E300E0810B /* BMNetworkStatusView.swift */; }; + 92B2190E23E2DA7F0029135D /* BMOverlayTimerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92B2190D23E2DA7F0029135D /* BMOverlayTimerView.swift */; }; + 92B2190F23E2DA7F0029135D /* BMOverlayTimerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92B2190D23E2DA7F0029135D /* BMOverlayTimerView.swift */; }; + 92B2191023E2DA7F0029135D /* BMOverlayTimerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92B2190D23E2DA7F0029135D /* BMOverlayTimerView.swift */; }; 92B39D6E2260CB97006D27A5 /* phrases.txt in Resources */ = {isa = PBXBuildFile; fileRef = 92B39D6D2260CB97006D27A5 /* phrases.txt */; }; 92B39D6F2260CB97006D27A5 /* phrases.txt in Resources */ = {isa = PBXBuildFile; fileRef = 92B39D6D2260CB97006D27A5 /* phrases.txt */; }; 92B7DA2222D6237600D4F88B /* RestoreOptionsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92B7DA2122D6237600D4F88B /* RestoreOptionsViewController.swift */; }; @@ -815,22 +835,6 @@ 92E4AEE32359DC27004062A1 /* SeedIntroCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 92E4AEDF2359DC27004062A1 /* SeedIntroCell.xib */; }; 92E4AEE42359DC27004062A1 /* SeedIntroCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 92E4AEDF2359DC27004062A1 /* SeedIntroCell.xib */; }; 92E4AEE52359DC27004062A1 /* SeedIntroCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 92E4AEDF2359DC27004062A1 /* SeedIntroCell.xib */; }; - 92E7EBE5239E4D8800209FEE /* libpow.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92E7EBD5239E4D8600209FEE /* libpow.a */; }; - 92E7EBE6239E4D8800209FEE /* libpbkdf.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92E7EBD6239E4D8700209FEE /* libpbkdf.a */; }; - 92E7EBE7239E4D8800209FEE /* libnode.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92E7EBD7239E4D8700209FEE /* libnode.a */; }; - 92E7EBE8239E4D8800209FEE /* libcli.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92E7EBD8239E4D8700209FEE /* libcli.a */; }; - 92E7EBE9239E4D8800209FEE /* libblake2b.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92E7EBD9239E4D8700209FEE /* libblake2b.a */; }; - 92E7EBEA239E4D8800209FEE /* libhttp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92E7EBDA239E4D8700209FEE /* libhttp.a */; }; - 92E7EBEB239E4D8800209FEE /* libp2p.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92E7EBDB239E4D8700209FEE /* libp2p.a */; }; - 92E7EBEC239E4D8800209FEE /* libutility.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92E7EBDC239E4D8700209FEE /* libutility.a */; }; - 92E7EBED239E4D8800209FEE /* libexternal_pow.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92E7EBDD239E4D8700209FEE /* libexternal_pow.a */; }; - 92E7EBEE239E4D8800209FEE /* libuv_a.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92E7EBDE239E4D8800209FEE /* libuv_a.a */; }; - 92E7EBEF239E4D8800209FEE /* libcore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92E7EBDF239E4D8800209FEE /* libcore.a */; }; - 92E7EBF0239E4D8800209FEE /* libsecp256k1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92E7EBE0239E4D8800209FEE /* libsecp256k1.a */; }; - 92E7EBF1239E4D8800209FEE /* libmnemonic.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92E7EBE1239E4D8800209FEE /* libmnemonic.a */; }; - 92E7EBF2239E4D8800209FEE /* libsqlite.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92E7EBE2239E4D8800209FEE /* libsqlite.a */; }; - 92E7EBF3239E4D8800209FEE /* libkeykeeper.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92E7EBE3239E4D8800209FEE /* libkeykeeper.a */; }; - 92E7EBF4239E4D8800209FEE /* libwallet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92E7EBE4239E4D8800209FEE /* libwallet.a */; }; 92E884B9223F93FF0003D6BB /* BMUTXO.m in Sources */ = {isa = PBXBuildFile; fileRef = 92E884B8223F93FF0003D6BB /* BMUTXO.m */; }; 92E884BA223F93FF0003D6BB /* BMUTXO.m in Sources */ = {isa = PBXBuildFile; fileRef = 92E884B8223F93FF0003D6BB /* BMUTXO.m */; }; 92E884C4223FADCD0003D6BB /* UTXOCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92E884C2223FADCD0003D6BB /* UTXOCell.swift */; }; @@ -1133,18 +1137,6 @@ 9261C259228BF55800D666E0 /* AddressesViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddressesViewController.swift; sourceTree = ""; }; 9265CDCE2292F233003C98B2 /* ReceiveViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReceiveViewController.swift; sourceTree = ""; }; 9268EA9923A3DE650015FD68 /* bgBlack.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = bgBlack.jpg; sourceTree = ""; }; - 9268EA9D23A3E0A60015FD68 /* libmnemonic.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libmnemonic.a; sourceTree = ""; }; - 9268EA9E23A3E0A60015FD68 /* libpbkdf.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libpbkdf.a; sourceTree = ""; }; - 9268EA9F23A3E0A60015FD68 /* libpow.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libpow.a; sourceTree = ""; }; - 9268EAA023A3E0A60015FD68 /* libkeykeeper.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libkeykeeper.a; sourceTree = ""; }; - 9268EAA123A3E0A60015FD68 /* libuv_a.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libuv_a.a; sourceTree = ""; }; - 9268EAA223A3E0A60015FD68 /* libwallet.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libwallet.a; sourceTree = ""; }; - 9268EAA323A3E0A70015FD68 /* libp2p.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libp2p.a; sourceTree = ""; }; - 9268EAA423A3E0A70015FD68 /* libhttp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libhttp.a; sourceTree = ""; }; - 9268EAA523A3E0A70015FD68 /* libexternal_pow.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libexternal_pow.a; sourceTree = ""; }; - 9268EAA623A3E0A70015FD68 /* libblake2b.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libblake2b.a; sourceTree = ""; }; - 9268EAA723A3E0A70015FD68 /* libcore.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcore.a; sourceTree = ""; }; - 9268EAB323A3E0B70015FD68 /* libsqlite.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libsqlite.a; sourceTree = ""; }; 926A8567222E7FD900A3B747 /* WalletStatusCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletStatusCell.swift; sourceTree = ""; }; 926A8568222E7FD900A3B747 /* WalletStatusCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WalletStatusCell.xib; sourceTree = ""; }; 926A856B222E835300A3B747 /* TableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableView.swift; sourceTree = ""; }; @@ -1264,6 +1256,7 @@ 92B13273227B2CDC0099B86C /* BeamWallet.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = BeamWallet.entitlements; sourceTree = ""; }; 92B13274227B2CE30099B86C /* BeamWalletMasterNet.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = BeamWalletMasterNet.entitlements; sourceTree = ""; }; 92B13275227B2CEA0099B86C /* BeamWalletTestNet.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = BeamWalletTestNet.entitlements; sourceTree = ""; }; + 92B2190D23E2DA7F0029135D /* BMOverlayTimerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BMOverlayTimerView.swift; sourceTree = ""; }; 92B39D6D2260CB97006D27A5 /* phrases.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = phrases.txt; sourceTree = ""; }; 92B7DA2122D6237600D4F88B /* RestoreOptionsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = RestoreOptionsViewController.swift; path = "../New Group/RestoreOptionsViewController.swift"; sourceTree = ""; }; 92B7DA2E22D63EFB00D4F88B /* TrustedNodeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrustedNodeViewController.swift; sourceTree = ""; }; @@ -1332,22 +1325,6 @@ 92E4AEDE2359DC27004062A1 /* SeedIntroCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeedIntroCell.swift; sourceTree = ""; }; 92E4AEDF2359DC27004062A1 /* SeedIntroCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SeedIntroCell.xib; sourceTree = ""; }; 92E5E2FB22EEE0790098C699 /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/Localizable.strings; sourceTree = ""; }; - 92E7EBD5239E4D8600209FEE /* libpow.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libpow.a; sourceTree = ""; }; - 92E7EBD6239E4D8700209FEE /* libpbkdf.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libpbkdf.a; sourceTree = ""; }; - 92E7EBD7239E4D8700209FEE /* libnode.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libnode.a; sourceTree = ""; }; - 92E7EBD8239E4D8700209FEE /* libcli.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcli.a; sourceTree = ""; }; - 92E7EBD9239E4D8700209FEE /* libblake2b.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libblake2b.a; sourceTree = ""; }; - 92E7EBDA239E4D8700209FEE /* libhttp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libhttp.a; sourceTree = ""; }; - 92E7EBDB239E4D8700209FEE /* libp2p.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libp2p.a; sourceTree = ""; }; - 92E7EBDC239E4D8700209FEE /* libutility.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libutility.a; sourceTree = ""; }; - 92E7EBDD239E4D8700209FEE /* libexternal_pow.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libexternal_pow.a; sourceTree = ""; }; - 92E7EBDE239E4D8800209FEE /* libuv_a.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libuv_a.a; sourceTree = ""; }; - 92E7EBDF239E4D8800209FEE /* libcore.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcore.a; sourceTree = ""; }; - 92E7EBE0239E4D8800209FEE /* libsecp256k1.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libsecp256k1.a; sourceTree = ""; }; - 92E7EBE1239E4D8800209FEE /* libmnemonic.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libmnemonic.a; sourceTree = ""; }; - 92E7EBE2239E4D8800209FEE /* libsqlite.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libsqlite.a; sourceTree = ""; }; - 92E7EBE3239E4D8800209FEE /* libkeykeeper.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libkeykeeper.a; sourceTree = ""; }; - 92E7EBE4239E4D8800209FEE /* libwallet.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libwallet.a; sourceTree = ""; }; 92E884B7223F93FF0003D6BB /* BMUTXO.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BMUTXO.h; sourceTree = ""; }; 92E884B8223F93FF0003D6BB /* BMUTXO.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BMUTXO.m; sourceTree = ""; }; 92E884C2223FADCD0003D6BB /* UTXOCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UTXOCell.swift; sourceTree = ""; }; @@ -1398,38 +1375,39 @@ buildActionMask = 2147483647; files = ( 922FF97223507EA7007B817A /* libboost_unit_test_framework.a in Frameworks */, + 927C168F23DB3439006BCF29 /* libpbkdf.a in Frameworks */, + 927C169223DB3439006BCF29 /* libuv_a.a in Frameworks */, 922FF98123507EA7007B817A /* libboost_regex.a in Frameworks */, + 927C169123DB3439006BCF29 /* libsqlite.a in Frameworks */, 922FF99623507EA7007B817A /* libboost_chrono.a in Frameworks */, - 9268EAB023A3E0A70015FD68 /* libexternal_pow.a in Frameworks */, 922FF98723507EA7007B817A /* libboost_filesystem.a in Frameworks */, + 927C169023DB3439006BCF29 /* libpow.a in Frameworks */, + 927C168E23DB3439006BCF29 /* libp2p.a in Frameworks */, 922FF97823507EA7007B817A /* libboost_log_setup.a in Frameworks */, 923544792254CB1300889C74 /* openssl.framework in Frameworks */, 9268EAB723A3E0DC0015FD68 /* libcli.a in Frameworks */, 575CFF43C23FF5D78D61B080 /* Pods_BeamWallet.framework in Frameworks */, - 9268EAAF23A3E0A70015FD68 /* libhttp.a in Frameworks */, - 9268EAB123A3E0A70015FD68 /* libblake2b.a in Frameworks */, + 927C168A23DB3439006BCF29 /* libhttp.a in Frameworks */, + 927C168D23DB3439006BCF29 /* libnode.a in Frameworks */, 922FF99C23507EA7007B817A /* libboost_date_time.a in Frameworks */, + 927C168C23DB3439006BCF29 /* libmnemonic.a in Frameworks */, 922FF97E23507EA7007B817A /* libboost_prg_exec_monitor.a in Frameworks */, - 9268EAAC23A3E0A70015FD68 /* libuv_a.a in Frameworks */, 922FF98423507EA7007B817A /* libboost_timer.a in Frameworks */, + 927C168723DB3439006BCF29 /* libblake2b.a in Frameworks */, 9268EAB523A3E0D30015FD68 /* libsecp256k1.a in Frameworks */, 922FF98D23507EA7007B817A /* libboost_thread.a in Frameworks */, - 9268EAB223A3E0A70015FD68 /* libcore.a in Frameworks */, - 9268EAAE23A3E0A70015FD68 /* libp2p.a in Frameworks */, - 9268EAA923A3E0A70015FD68 /* libpbkdf.a in Frameworks */, - 9268EAA823A3E0A70015FD68 /* libmnemonic.a in Frameworks */, 922FF97B23507EA7007B817A /* libboost_exception.a in Frameworks */, + 927C168923DB3439006BCF29 /* libexternal_pow.a in Frameworks */, 922FF99F23507EA7007B817A /* libboost_random.a in Frameworks */, - 9268EAB423A3E0B80015FD68 /* libsqlite.a in Frameworks */, 922FF99023507EA7007B817A /* libboost_system.a in Frameworks */, 922FF97523507EA7007B817A /* libboost_atomic.a in Frameworks */, - 9268EAAD23A3E0A70015FD68 /* libwallet.a in Frameworks */, + 927C168823DB3439006BCF29 /* libcore.a in Frameworks */, + 927C169323DB3439006BCF29 /* libwallet.a in Frameworks */, 9268EAB823A3E15B0015FD68 /* libutility.a in Frameworks */, - 9268EAAB23A3E0A70015FD68 /* libkeykeeper.a in Frameworks */, 922FF99323507EA7007B817A /* libboost_program_options.a in Frameworks */, + 927C168B23DB3439006BCF29 /* libkeykeeper.a in Frameworks */, 922FF98A23507EA7007B817A /* libboost_test_exec_monitor.a in Frameworks */, 922FF99923507EA7007B817A /* libboost_log.a in Frameworks */, - 9268EAAA23A3E0A70015FD68 /* libpow.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1479,39 +1457,39 @@ buildActionMask = 2147483647; files = ( 922FF98023507EA7007B817A /* libboost_prg_exec_monitor.a in Frameworks */, + 927C167C23DB3439006BCF29 /* libkeykeeper.a in Frameworks */, + 927C168523DB3439006BCF29 /* libuv_a.a in Frameworks */, 92E2EB34226F21C700367928 /* openssl.framework in Frameworks */, - 92E7EBE7239E4D8800209FEE /* libnode.a in Frameworks */, - 92E7EBF2239E4D8800209FEE /* libsqlite.a in Frameworks */, - 92E7EBED239E4D8800209FEE /* libexternal_pow.a in Frameworks */, + 927C167B23DB3439006BCF29 /* libhttp.a in Frameworks */, + 927C167D23DB3439006BCF29 /* libmnemonic.a in Frameworks */, + 927C168123DB3439006BCF29 /* libpow.a in Frameworks */, + 927C168423DB3439006BCF29 /* libutility.a in Frameworks */, 922FF99823507EA7007B817A /* libboost_chrono.a in Frameworks */, + 927C167A23DB3439006BCF29 /* libexternal_pow.a in Frameworks */, 922FF98C23507EA7007B817A /* libboost_test_exec_monitor.a in Frameworks */, 922FF98323507EA7007B817A /* libboost_regex.a in Frameworks */, + 927C167923DB3439006BCF29 /* libcore.a in Frameworks */, + 927C168323DB3439006BCF29 /* libsqlite.a in Frameworks */, 922FF99223507EA7007B817A /* libboost_system.a in Frameworks */, 922FF99E23507EA7007B817A /* libboost_date_time.a in Frameworks */, 922FF99523507EA7007B817A /* libboost_program_options.a in Frameworks */, 922FF98923507EA7007B817A /* libboost_filesystem.a in Frameworks */, 4C58997BBD95511DB5847C74 /* Pods_BeamWalletMasterNet.framework in Frameworks */, + 927C167E23DB3439006BCF29 /* libnode.a in Frameworks */, 922FF97723507EA7007B817A /* libboost_atomic.a in Frameworks */, - 92E7EBEC239E4D8800209FEE /* libutility.a in Frameworks */, - 92E7EBEB239E4D8800209FEE /* libp2p.a in Frameworks */, - 92E7EBEF239E4D8800209FEE /* libcore.a in Frameworks */, - 92E7EBE6239E4D8800209FEE /* libpbkdf.a in Frameworks */, - 92E7EBE5239E4D8800209FEE /* libpow.a in Frameworks */, + 927C167F23DB3439006BCF29 /* libp2p.a in Frameworks */, 922FF97423507EA7007B817A /* libboost_unit_test_framework.a in Frameworks */, + 927C168223DB3439006BCF29 /* libsecp256k1.a in Frameworks */, 922FF9A123507EA7007B817A /* libboost_random.a in Frameworks */, - 92E7EBF0239E4D8800209FEE /* libsecp256k1.a in Frameworks */, - 92E7EBE9239E4D8800209FEE /* libblake2b.a in Frameworks */, 922FF97A23507EA7007B817A /* libboost_log_setup.a in Frameworks */, + 927C167823DB3439006BCF29 /* libcli.a in Frameworks */, 922FF99B23507EA7007B817A /* libboost_log.a in Frameworks */, - 92E7EBEE239E4D8800209FEE /* libuv_a.a in Frameworks */, - 92E7EBF1239E4D8800209FEE /* libmnemonic.a in Frameworks */, - 92E7EBE8239E4D8800209FEE /* libcli.a in Frameworks */, - 92E7EBF4239E4D8800209FEE /* libwallet.a in Frameworks */, - 92E7EBF3239E4D8800209FEE /* libkeykeeper.a in Frameworks */, + 927C168623DB3439006BCF29 /* libwallet.a in Frameworks */, + 927C168023DB3439006BCF29 /* libpbkdf.a in Frameworks */, 922FF98F23507EA7007B817A /* libboost_thread.a in Frameworks */, 922FF97D23507EA7007B817A /* libboost_exception.a in Frameworks */, 922FF98623507EA7007B817A /* libboost_timer.a in Frameworks */, - 92E7EBEA239E4D8800209FEE /* libhttp.a in Frameworks */, + 927C167723DB3439006BCF29 /* libblake2b.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1945,6 +1923,7 @@ 923DB10B235DD2D60056ACDA /* BMInputViewController.swift */, 923DB10C235DD2D60056ACDA /* BMInputViewController.xib */, 92C00D1922A009F100DDB579 /* BMDoubleAuthViewController.swift */, + 92B2190D23E2DA7F0029135D /* BMOverlayTimerView.swift */, ); path = Controls; sourceTree = ""; @@ -2178,18 +2157,6 @@ 92D3CBD32264B562007E3C55 /* mainnet */ = { isa = PBXGroup; children = ( - 9268EAB323A3E0B70015FD68 /* libsqlite.a */, - 9268EAA623A3E0A70015FD68 /* libblake2b.a */, - 9268EAA723A3E0A70015FD68 /* libcore.a */, - 9268EAA523A3E0A70015FD68 /* libexternal_pow.a */, - 9268EAA423A3E0A70015FD68 /* libhttp.a */, - 9268EAA023A3E0A60015FD68 /* libkeykeeper.a */, - 9268EA9D23A3E0A60015FD68 /* libmnemonic.a */, - 9268EAA323A3E0A70015FD68 /* libp2p.a */, - 9268EA9E23A3E0A60015FD68 /* libpbkdf.a */, - 9268EA9F23A3E0A60015FD68 /* libpow.a */, - 9268EAA123A3E0A60015FD68 /* libuv_a.a */, - 9268EAA223A3E0A60015FD68 /* libwallet.a */, ); path = mainnet; sourceTree = ""; @@ -2241,22 +2208,6 @@ 92E2EB8D226F24C200367928 /* masternet */ = { isa = PBXGroup; children = ( - 92E7EBD9239E4D8700209FEE /* libblake2b.a */, - 92E7EBD8239E4D8700209FEE /* libcli.a */, - 92E7EBDF239E4D8800209FEE /* libcore.a */, - 92E7EBDD239E4D8700209FEE /* libexternal_pow.a */, - 92E7EBDA239E4D8700209FEE /* libhttp.a */, - 92E7EBE3239E4D8800209FEE /* libkeykeeper.a */, - 92E7EBE1239E4D8800209FEE /* libmnemonic.a */, - 92E7EBD7239E4D8700209FEE /* libnode.a */, - 92E7EBDB239E4D8700209FEE /* libp2p.a */, - 92E7EBD6239E4D8700209FEE /* libpbkdf.a */, - 92E7EBD5239E4D8600209FEE /* libpow.a */, - 92E7EBE0239E4D8800209FEE /* libsecp256k1.a */, - 92E7EBE2239E4D8800209FEE /* libsqlite.a */, - 92E7EBDC239E4D8700209FEE /* libutility.a */, - 92E7EBDE239E4D8800209FEE /* libuv_a.a */, - 92E7EBE4239E4D8800209FEE /* libwallet.a */, ); path = masternet; sourceTree = ""; @@ -3088,6 +3039,7 @@ 9212DB9422E07ECA0053FC99 /* AddressTableView.swift in Sources */, 92B7DA2222D6237600D4F88B /* RestoreOptionsViewController.swift in Sources */, 92E884C4223FADCD0003D6BB /* UTXOCell.swift in Sources */, + 92B2190E23E2DA7F0029135D /* BMOverlayTimerView.swift in Sources */, 92AE366F223845E300E0810B /* BMNetworkStatusView.swift in Sources */, 92554D512289A34000FE6041 /* BaseTableViewController.swift in Sources */, 92A1BA032236920C008135B5 /* QRViewController.swift in Sources */, @@ -3288,6 +3240,7 @@ 9212DB9522E07ECA0053FC99 /* AddressTableView.swift in Sources */, 92B7DA2322D6237600D4F88B /* RestoreOptionsViewController.swift in Sources */, 92E884C5223FADCD0003D6BB /* UTXOCell.swift in Sources */, + 92B2190F23E2DA7F0029135D /* BMOverlayTimerView.swift in Sources */, 9288DD49223A55410020C501 /* BMNetworkStatusView.swift in Sources */, 92554D522289A34000FE6041 /* BaseTableViewController.swift in Sources */, 9288DD4B223A55410020C501 /* QRViewController.swift in Sources */, @@ -3488,6 +3441,7 @@ 9212DB9622E07ECA0053FC99 /* AddressTableView.swift in Sources */, 92B7DA2422D6237600D4F88B /* RestoreOptionsViewController.swift in Sources */, 92E2EAFE226F21C700367928 /* UTXOCell.swift in Sources */, + 92B2191023E2DA7F0029135D /* BMOverlayTimerView.swift in Sources */, 92E2EAFF226F21C700367928 /* BMNetworkStatusView.swift in Sources */, 92554D532289A34000FE6041 /* BaseTableViewController.swift in Sources */, 92E2EB00226F21C700367928 /* QRViewController.swift in Sources */, @@ -3808,13 +3762,13 @@ "$(PROJECT_DIR)/Frameworks/boost", ); HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../beam-mainnet\"", - "\"$(SRCROOT)/../beam-mainnet/3rdparty\"", - "\"$(SRCROOT)/../beam-mainnet/3rdparty/libuv/include\"", - "\"$(SRCROOT)/../beam-mainnet/core\"", - "\"$(SRCROOT)/../beam-mainnet/utility\"", - "\"$(SRCROOT)/../beam-mainnet/wallet\"", - "\"$(SRCROOT)/../beam-mainnet/3rdparty/sqlite\"", + "\"$(SRCROOT)/../beam-testnet\"", + "\"$(SRCROOT)/../beam-testnet/3rdparty\"", + "\"$(SRCROOT)/../beam-testnet/3rdparty/libuv/include\"", + "\"$(SRCROOT)/../beam-testnet/core\"", + "\"$(SRCROOT)/../beam-testnet/utility\"", + "\"$(SRCROOT)/../beam-testnet/wallet\"", + "\"$(SRCROOT)/../beam-testnet/3rdparty/sqlite\"", "\"$(SRCROOT)/../boost/include/boost\"", ); INFOPLIST_FILE = "$(SRCROOT)/Resources/Info.plist"; @@ -3888,13 +3842,13 @@ "$(PROJECT_DIR)/Frameworks/boost", ); HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../beam-mainnet\"", - "\"$(SRCROOT)/../beam-mainnet/3rdparty\"", - "\"$(SRCROOT)/../beam-mainnet/3rdparty/libuv/include\"", - "\"$(SRCROOT)/../beam-mainnet/core\"", - "\"$(SRCROOT)/../beam-mainnet/utility\"", - "\"$(SRCROOT)/../beam-mainnet/wallet\"", - "\"$(SRCROOT)/../beam-mainnet/3rdparty/sqlite\"", + "\"$(SRCROOT)/../beam-testnet\"", + "\"$(SRCROOT)/../beam-testnet/3rdparty\"", + "\"$(SRCROOT)/../beam-testnet/3rdparty/libuv/include\"", + "\"$(SRCROOT)/../beam-testnet/core\"", + "\"$(SRCROOT)/../beam-testnet/utility\"", + "\"$(SRCROOT)/../beam-testnet/wallet\"", + "\"$(SRCROOT)/../beam-testnet/3rdparty/sqlite\"", "\"$(SRCROOT)/../boost/include/boost\"", ); INFOPLIST_FILE = "$(SRCROOT)/Resources/Info.plist"; @@ -3959,7 +3913,7 @@ CODE_SIGN_ENTITLEMENTS = Resources/BeamWalletTestNet.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 5; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = KNU2R94BJK; ENABLE_BITCODE = NO; @@ -3994,7 +3948,7 @@ "$(PROJECT_DIR)/Frameworks/boost", "$(PROJECT_DIR)/Frameworks/masternet", ); - MARKETING_VERSION = 4.2; + MARKETING_VERSION = 4.3; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -4042,7 +3996,7 @@ CODE_SIGN_ENTITLEMENTS = Resources/BeamWalletTestNet.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 5; DEVELOPMENT_TEAM = KNU2R94BJK; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -4086,7 +4040,7 @@ "$(PROJECT_DIR)/Frameworks/boost", "$(PROJECT_DIR)/Frameworks/masternet", ); - MARKETING_VERSION = 4.2; + MARKETING_VERSION = 4.3; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -4143,13 +4097,13 @@ "$(PROJECT_DIR)/Frameworks/boost", ); HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../beam-master\"", - "\"$(SRCROOT)/../beam-master/3rdparty\"", - "\"$(SRCROOT)/../beam-master/3rdparty/libuv/include\"", - "\"$(SRCROOT)/../beam-master/core\"", - "\"$(SRCROOT)/../beam-master/utility\"", - "\"$(SRCROOT)/../beam-master/wallet\"", - "\"$(SRCROOT)/../beam-master/3rdparty/sqlite\"", + "\"$(SRCROOT)/../beam-testnet\"", + "\"$(SRCROOT)/../beam-testnet/3rdparty\"", + "\"$(SRCROOT)/../beam-testnet/3rdparty/libuv/include\"", + "\"$(SRCROOT)/../beam-testnet/core\"", + "\"$(SRCROOT)/../beam-testnet/utility\"", + "\"$(SRCROOT)/../beam-testnet/wallet\"", + "\"$(SRCROOT)/../beam-testnet/3rdparty/sqlite\"", "\"$(SRCROOT)/../boost/include/boost\"", ); INFOPLIST_FILE = "$(SRCROOT)/Resources/InfoMasternet.plist"; @@ -4222,13 +4176,13 @@ "$(PROJECT_DIR)/Frameworks/boost", ); HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../beam-master\"", - "\"$(SRCROOT)/../beam-master/3rdparty\"", - "\"$(SRCROOT)/../beam-master/3rdparty/libuv/include\"", - "\"$(SRCROOT)/../beam-master/core\"", - "\"$(SRCROOT)/../beam-master/utility\"", - "\"$(SRCROOT)/../beam-master/wallet\"", - "\"$(SRCROOT)/../beam-master/3rdparty/sqlite\"", + "\"$(SRCROOT)/../beam-testnet\"", + "\"$(SRCROOT)/../beam-testnet/3rdparty\"", + "\"$(SRCROOT)/../beam-testnet/3rdparty/libuv/include\"", + "\"$(SRCROOT)/../beam-testnet/core\"", + "\"$(SRCROOT)/../beam-testnet/utility\"", + "\"$(SRCROOT)/../beam-testnet/wallet\"", + "\"$(SRCROOT)/../beam-testnet/3rdparty/sqlite\"", "\"$(SRCROOT)/../boost/include/boost\"", ); INFOPLIST_FILE = "$(SRCROOT)/Resources/InfoMasternet.plist"; diff --git a/BeamWallet/AppDelegate.swift b/BeamWallet/AppDelegate.swift index 5a7c9e8a..aad0d315 100644 --- a/BeamWallet/AppDelegate.swift +++ b/BeamWallet/AppDelegate.swift @@ -101,10 +101,27 @@ class AppDelegate: UIResponder, UIApplicationDelegate { UserDefaults.standard.synchronize() }) } - + return true } + func before(value1: String, value2: String) -> Bool { + let ch1 = value1.first + let l1 = ch1!.isLetter + if (!l1) { + return false + } + + let ch2 = value2.first + let l2 = ch2!.isLetter + if (!l2) { + return false + } + + return value1.lowercased() < value2.lowercased() + } + + public func logout() { AppModel.sharedManager().clearAllCategories() AppModel.sharedManager().isLoggedin = false diff --git a/BeamWallet/BeamSDK/AppModel.h b/BeamWallet/BeamSDK/AppModel.h index c603464a..f5d6945a 100644 --- a/BeamWallet/BeamSDK/AppModel.h +++ b/BeamWallet/BeamSDK/AppModel.h @@ -191,6 +191,7 @@ typedef void(^ExportOwnerKey)(NSString * _Nonnull key); -(void)clearAllTransactions; -(BMTransaction*_Nullable)lastTransactionFromAddress:(NSString*_Nonnull)ID; -(NSString*_Nullable)getFirstTransactionIdForAddress:(NSString*_Nonnull)address; +-(BOOL)hasActiveTransactions; // utxo -(void)getUTXO; @@ -211,6 +212,7 @@ typedef void(^ExportOwnerKey)(NSString * _Nonnull key); -(NSMutableArray*_Nonnull)getOnlyContactsFromCategory:(BMCategory*_Nonnull)category; -(void)fixCategories; -(void)clearAllCategories; +-(NSMutableArray*_Nonnull)sortedCategories; //fork -(BOOL)isFork; diff --git a/BeamWallet/BeamSDK/AppModel.mm b/BeamWallet/BeamSDK/AppModel.mm index 82a4b640..2fdf2fcb 100644 --- a/BeamWallet/BeamSDK/AppModel.mm +++ b/BeamWallet/BeamSDK/AppModel.mm @@ -120,6 +120,7 @@ -(id)init{ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didBecomeActiveNotification) name:UIApplicationDidBecomeActiveNotification object:nil]; [self loadRules]; + return self; } @@ -1894,6 +1895,18 @@ -(NSString*_Nullable)getFirstTransactionIdForAddress:(NSString*_Nonnull)address return _id; } +-(BOOL)hasActiveTransactions { + for (BMTransaction *tr in self.transactions.reverseObjectEnumerator) + { + if(tr.enumStatus == BMTransactionStatusPending || tr.enumStatus == BMTransactionStatusInProgress + || tr.enumStatus == BMTransactionStatusRegistering) { + return YES; + } + } + + return NO; +} + #pragma mark - UTXO -(void)setUtxos:(NSMutableArray *)utxos { @@ -2163,6 +2176,53 @@ -(void)clearAllCategories { } } +-(NSArray *)partitionObjects:(NSArray *)array collationStringSelector:(SEL)selector +{ + UILocalizedIndexedCollation *collation = [UILocalizedIndexedCollation currentCollation]; + NSInteger sectionCount = [[collation sectionTitles] count]; //section count is take from sectionTitles and not sectionIndexTitles + NSMutableArray *unsortedSections = [NSMutableArray arrayWithCapacity:sectionCount]; + + //create an array to hold the data for each section + for(int i = 0; i < sectionCount; i++) + { + [unsortedSections addObject:[NSMutableArray array]]; + } + + //put each object into a section + for (id object in array) + { + NSInteger index = [collation sectionForObject:object collationStringSelector:selector]; + [[unsortedSections objectAtIndex:index] addObject:object]; + } + NSMutableArray *sections = [NSMutableArray arrayWithCapacity:sectionCount]; + + //sort each section + for (NSMutableArray *section in unsortedSections) + { + [sections addObject:[collation sortedArrayFromArray:section collationStringSelector:selector]]; + } + return sections; +} + +-(NSMutableArray*_Nonnull)sortedCategories { + NSArray *sections = [self partitionObjects:_categories collationStringSelector:@selector(name)]; + + NSMutableArray *sorted = [NSMutableArray array]; + + for (NSArray *arr in sections) { + if(arr.count > 0) { + NSSortDescriptor *sortDescriptor; + sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"name" + ascending:YES]; + NSArray *sortedArray = [arr sortedArrayUsingDescriptors:@[sortDescriptor]]; + + [sorted addObjectsFromArray:sortedArray]; + } + } + + return sorted; +} + -(void)fixCategories { if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"fix"] intValue]==1) { return; diff --git a/BeamWallet/BeamSDK/WalletModel.h b/BeamWallet/BeamSDK/WalletModel.h index d6697af6..c9c96034 100644 --- a/BeamWallet/BeamSDK/WalletModel.h +++ b/BeamWallet/BeamSDK/WalletModel.h @@ -75,6 +75,6 @@ class WalletModel : public beam::wallet::WalletClient void onImportDataFromJson(bool isOk) override; void onExportDataToJson(const std::string& data) override; void onPostFunctionToClientContext(MessageFunction&& func) override; - // void onExportTxHistoryToCsv(const std::string& data) override; - //void onAddressesChanged(beam::wallet::ChangeAction, const std::vector& addresses) override; + void onExportTxHistoryToCsv(const std::string& data) override; + // void onAddressesChanged(beam::wallet::ChangeAction, const std::vector& addresses) override; }; diff --git a/BeamWallet/BeamSDK/WalletModel.mm b/BeamWallet/BeamSDK/WalletModel.mm index 2e4eabed..72bce365 100644 --- a/BeamWallet/BeamSDK/WalletModel.mm +++ b/BeamWallet/BeamSDK/WalletModel.mm @@ -89,8 +89,6 @@ void WalletModel::onTxStatus(beam::wallet::ChangeAction action, const std::vector& items) { - NSLog(@"onTxStatus"); - NSMutableArray *transactions = [NSMutableArray new]; for (const auto& item : items) @@ -720,17 +718,13 @@ } -//void WalletModel::onExportTxHistoryToCsv(const std::string& data) { -// -//} +void WalletModel::onExportTxHistoryToCsv(const std::string& data) { + +} //void WalletModel::onAddressesChanged (beam::wallet::ChangeAction action, const std::vector &items) { -// if(items[0].isOwn()) { -// getAsync()->getAddresses(true); -// } -// else{ -// getAsync()->getAddresses(false); -// } +// getAsync()->getAddresses(true); +// getAsync()->getAddresses(false); //} diff --git a/BeamWallet/Controls/BMCountdownView.swift b/BeamWallet/Controls/BMCountdownView.swift index 5a13f0e3..e932d8dc 100644 --- a/BeamWallet/Controls/BMCountdownView.swift +++ b/BeamWallet/Controls/BMCountdownView.swift @@ -25,8 +25,9 @@ import Foundation public class BMCountdownView: UIView { private var lineWidth: CGFloat = 1.5 - private var lineColor: UIColor = UIColor.init(hexString: "#032E49") - private var trailLineColor: UIColor = UIColor.main.steelGrey.withAlphaComponent(0.3) + + var lineColor: UIColor = UIColor.init(hexString: "#032E49") + var trailLineColor: UIColor = UIColor.main.steelGrey.withAlphaComponent(0.3) public weak var delegate: BMCountdownViewDelegate? @@ -37,7 +38,7 @@ public class BMCountdownView: UIView { private var interval: TimeInterval = 1 private let fireInterval: TimeInterval = 0.01 - private lazy var counterLabel: UILabel = { + lazy var counterLabel: UILabel = { let label = UILabel() self.addSubview(label) diff --git a/BeamWallet/Controls/BMDataPickerViewController.swift b/BeamWallet/Controls/BMDataPickerViewController.swift index 44962ee1..ad201475 100644 --- a/BeamWallet/Controls/BMDataPickerViewController.swift +++ b/BeamWallet/Controls/BMDataPickerViewController.swift @@ -227,10 +227,13 @@ class BMDataPickerViewController: BaseTableViewController { if selectedCategories.count == 0 { selectedCategories.append("0") } + let none = BMCategory.none() none.name = none.name.capitalizingFirstLetter() - var categories = (AppModel.sharedManager().categories as! [BMCategory]) + + var categories = AppModel.sharedManager().sortedCategories() as! [BMCategory] categories.insert(none, at: 0) + for category in categories { let selected = selectedCategories.contains(String(category.id)) values.append(BMPickerData(title: category.name, detail: nil, titleColor: UIColor(hexString: category.color), arrowType: selected ? BMPickerData.ArrowType.selected : BMPickerData.ArrowType.unselected, unique: category.id, multiplie: true)) diff --git a/BeamWallet/Controls/BMInputViewController.swift b/BeamWallet/Controls/BMInputViewController.swift index fa8774e1..67973b15 100644 --- a/BeamWallet/Controls/BMInputViewController.swift +++ b/BeamWallet/Controls/BMInputViewController.swift @@ -1,9 +1,20 @@ // -// BMInputViewController.swift -// BeamWallet +// BMInputViewController.swift +// BeamWallet // -// Created by Denis on 10/21/19. -// Copyright © 2019 Denis. All rights reserved. +// Copyright 2018 Beam Development +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // import UIKit diff --git a/BeamWallet/Controls/BMOverlayTimerView.swift b/BeamWallet/Controls/BMOverlayTimerView.swift new file mode 100644 index 00000000..5a5a74e1 --- /dev/null +++ b/BeamWallet/Controls/BMOverlayTimerView.swift @@ -0,0 +1,85 @@ +// +// BMOverlayTimerView.swift +// BeamWallet +// +// Copyright 2018 Beam Development +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import UIKit + +class BMOverlayTimerView: UIView, BMCountdownViewDelegate { + + private var seconds = 0 + private var url:URL! + + public static func show (text:String, link:URL) { + let view = BMOverlayTimerView(text: text, link: link) + view.display() + } + + init(text:String, link:URL) { + super.init(frame: UIScreen.main.bounds) + + alpha = 0 + + let blurEffect = UIBlurEffect(style: .dark) + let blurView = UIVisualEffectView(effect: blurEffect) + blurView.frame = frame + addSubview(blurView) + + url = link + + let window = (UIApplication.shared.delegate as! AppDelegate).window + + self.backgroundColor = UIColor.main.marine.withAlphaComponent(0.4) + + let label = UILabel(frame: CGRect.zero) + label.font = RegularFont(size: 17) + label.textColor = UIColor.white + label.numberOfLines = 0 + label.text = Localizable.shared.strings.faucet_redirect_text + label.textAlignment = .center + let size = label.sizeThatFits(CGSize(width: 260, height: 99999)) + label.frame = CGRect(x: (self.width - size.width)/2,y: (self.h - size.height)/2, width: size.width, height: size.height) + addSubview(label) + + let timer = BMCountdownView(frame: CGRect(x: (self.width - 28)/2, y: label.frame.origin.y - 40, width: 28, height: 28)) + timer.delegate = self + timer.backgroundColor = UIColor.clear + timer.lineColor = UIColor.white + timer.trailLineColor = UIColor.main.steelGrey.withAlphaComponent(0.1) + timer.counterLabel.textColor = UIColor.white + timer.start(beginingValue: 4) + addSubview(timer) + + window?.addSubview(self) + } + + public func display() + { + UIView.animate(withDuration: 0.3) { + self.alpha = 1 + } + } + + required init?(coder: NSCoder) { + fatalError(Localizable.shared.strings.fatalInitCoderError) + } + + internal func timerDidEnd() { + UIApplication.shared.open(url, options: [:], completionHandler: nil) + removeFromSuperview() + } +} diff --git a/BeamWallet/Manager/OnboardManager.swift b/BeamWallet/Manager/OnboardManager.swift index 402811f7..24215de5 100644 --- a/BeamWallet/Manager/OnboardManager.swift +++ b/BeamWallet/Manager/OnboardManager.swift @@ -44,9 +44,17 @@ class OnboardManager: NSObject { public func canReceiveFaucet() -> Bool { let isInProgress = AppModel.sharedManager().walletStatus?.hasInProgressBalance() ?? false let isBalanceZero = (AppModel.sharedManager().walletStatus?.available ?? 0) == 0 - return !isInProgress && isBalanceZero && !isCloseFaucet + let emptyTransactions = AppModel.sharedManager().transactions?.count == 0 + return !isInProgress && isBalanceZero && !isCloseFaucet && emptyTransactions } + public func faucetAvailable() -> Bool { + let isInProgress = AppModel.sharedManager().walletStatus?.hasInProgressBalance() ?? false + let isBalanceZero = (AppModel.sharedManager().walletStatus?.available ?? 0) == 0 + let emptyTransactions = AppModel.sharedManager().transactions?.count == 0 + return !isInProgress && isBalanceZero && emptyTransactions + } + public func receiveFaucet(completion: @escaping ((URL?, Error?) -> Void)) { let address = AppModel.sharedManager().findAddress(byName: "Beam community faucet") diff --git a/BeamWallet/Model/Settings/SettingsViewModel.swift b/BeamWallet/Model/Settings/SettingsViewModel.swift index ffac80cf..e249cb79 100644 --- a/BeamWallet/Model/Settings/SettingsViewModel.swift +++ b/BeamWallet/Model/Settings/SettingsViewModel.swift @@ -180,7 +180,10 @@ class SettingsViewModel: NSObject { case .tags: var categories = [SettingsItem]() if AppModel.sharedManager().categories.count > 0 { - for category in AppModel.sharedManager().categories as! [BMCategory] { + + let sorted = AppModel.sharedManager().sortedCategories() + + for category in sorted as! [BMCategory] { categories.append(SettingsItem(title: category.name, detail: nil, isSwitch: nil, type: .open_category, category: category, hasArrow: true)) } } @@ -450,7 +453,16 @@ extension SettingsViewModel { top.alert(message: reason) } else if let result = link { - top.openUrl(url: result, additionalInfo: Localizable.shared.strings.faucet_address_alert, infoDelay: 4) + if Settings.sharedManager().isAllowOpenLink { + BMOverlayTimerView.show(text: Localizable.shared.strings.faucet_redirect_text, link: result) + } + else { + top.confirmAlert(title: Localizable.shared.strings.external_link_title, message: Localizable.shared.strings.external_link_text, cancelTitle: Localizable.shared.strings.cancel, confirmTitle: Localizable.shared.strings.open, cancelHandler: { _ in + + }) { _ in + BMOverlayTimerView.show(text: Localizable.shared.strings.faucet_redirect_text, link: result) + } + } } } } @@ -458,19 +470,25 @@ extension SettingsViewModel { func onClearWallet() { if let top = UIApplication.getTopMostViewController() { - top.confirmAlert(title: Localizable.shared.strings.clear_wallet, message: Localizable.shared.strings.clear_wallet_text, cancelTitle: Localizable.shared.strings.cancel, confirmTitle: Localizable.shared.strings.remove_wallet, cancelHandler: { _ in - - }) { _ in - let modalViewController = UnlockPasswordPopover(event: .clear_wallet, allowBiometric: false) - modalViewController.completion = { obj in - if obj { - let app = UIApplication.shared.delegate as! AppDelegate - app.logout() + + if(AppModel.sharedManager().hasActiveTransactions()) { + top.alert(title: Localizable.shared.strings.clear_wallet, message: Localizable.shared.strings.clear_wallet_transactions_text, handler: nil) + } + else { + top.confirmAlert(title: Localizable.shared.strings.clear_wallet, message: Localizable.shared.strings.clear_wallet_text, cancelTitle: Localizable.shared.strings.cancel, confirmTitle: Localizable.shared.strings.remove_wallet, cancelHandler: { _ in + + }) { _ in + let modalViewController = UnlockPasswordPopover(event: .clear_wallet, allowBiometric: false) + modalViewController.completion = { obj in + if obj { + let app = UIApplication.shared.delegate as! AppDelegate + app.logout() + } } + modalViewController.modalPresentationStyle = .overFullScreen + modalViewController.modalTransitionStyle = .crossDissolve + top.present(modalViewController, animated: true, completion: nil) } - modalViewController.modalPresentationStyle = .overFullScreen - modalViewController.modalTransitionStyle = .crossDissolve - top.present(modalViewController, animated: true, completion: nil) } } } diff --git a/BeamWallet/Protocols/LocalizableStrings.swift b/BeamWallet/Protocols/LocalizableStrings.swift index 93b8207d..01654b82 100644 --- a/BeamWallet/Protocols/LocalizableStrings.swift +++ b/BeamWallet/Protocols/LocalizableStrings.swift @@ -489,8 +489,11 @@ class LocalizableStrings : NSObject { var faucet_address_alert = "faucet_address_alert".localized var seed_verification = "seed_verification".localized var complete_seed_verification = "complete_seed_verification".localized + var faucet_redirect_text = "faucet_redirect_text".localized + var clear_wallet_transactions_text = "clear_wallet_transactions_text".localized + var in_progress_out = "in_progress_out".localized.split(separator: "\n").last!.replacingOccurrences(of: "(", with: "").replacingOccurrences(of: ")", with: "").replacingOccurrences(of: "in_progress".localized, with: "").replacingOccurrences(of: " ", with: "") var in_progress_in = "in_progress_in".localized.split(separator: "\n").last!.replacingOccurrences(of: "(", with: "").replacingOccurrences(of: ")", with: "").replacingOccurrences(of: "in_progress".localized, with: "").replacingOccurrences(of: " ", with: "") diff --git a/BeamWallet/ViewControllers/Main/Passwords/CreateWalletPasswordViewController.swift b/BeamWallet/ViewControllers/Main/Passwords/CreateWalletPasswordViewController.swift index cbd148c9..57f978ef 100644 --- a/BeamWallet/ViewControllers/Main/Passwords/CreateWalletPasswordViewController.swift +++ b/BeamWallet/ViewControllers/Main/Passwords/CreateWalletPasswordViewController.swift @@ -151,7 +151,7 @@ class CreateWalletPasswordViewController: BaseWizardViewController { private func goNext(pass: String) { if AppModel.sharedManager().isLoggedin { AppModel.sharedManager().changePassword(pass) - KeychainManager.addPassword(password: pass) + _ = KeychainManager.addPassword(password: pass) back() } diff --git a/BeamWallet/ViewControllers/Main/Wallet/Cells/OnboardCell.swift b/BeamWallet/ViewControllers/Main/Wallet/Cells/OnboardCell.swift index 1376290a..01ecc74f 100644 --- a/BeamWallet/ViewControllers/Main/Wallet/Cells/OnboardCell.swift +++ b/BeamWallet/ViewControllers/Main/Wallet/Cells/OnboardCell.swift @@ -23,6 +23,7 @@ class OnboardCell: UITableViewCell { @IBOutlet weak private var verificationButton: BMButton! @IBOutlet weak private var receiveButton: BMButton! + @IBOutlet weak private var closeButton: UIButton! weak var delegate: OnboardCellDelegate? @@ -41,10 +42,12 @@ class OnboardCell: UITableViewCell { if secure { detailLabel.text = Localizable.shared.strings.make_wallet_secure_text + closeButton.isHidden = true receiveButton.isHidden = true verificationButton.isHidden = false } - else { + else { + closeButton.isHidden = false receiveButton.isHidden = false verificationButton.isHidden = true diff --git a/BeamWallet/ViewControllers/Main/Wallet/Cells/OnboardCell.xib b/BeamWallet/ViewControllers/Main/Wallet/Cells/OnboardCell.xib index 08df49af..b81e4016 100644 --- a/BeamWallet/ViewControllers/Main/Wallet/Cells/OnboardCell.xib +++ b/BeamWallet/ViewControllers/Main/Wallet/Cells/OnboardCell.xib @@ -1,8 +1,8 @@ - + - + @@ -134,6 +134,7 @@ + diff --git a/BeamWallet/ViewControllers/Main/Wallet/WalletViewController.swift b/BeamWallet/ViewControllers/Main/Wallet/WalletViewController.swift index 395c1990..7d6773c4 100644 --- a/BeamWallet/ViewControllers/Main/Wallet/WalletViewController.swift +++ b/BeamWallet/ViewControllers/Main/Wallet/WalletViewController.swift @@ -485,7 +485,16 @@ extension WalletViewController: OnboardCellDelegate { strongSelf.alert(message: reason) } else if let result = url { - strongSelf.openUrl(url: result, additionalInfo: Localizable.shared.strings.faucet_address_alert, infoDelay: 4) + if Settings.sharedManager().isAllowOpenLink { + BMOverlayTimerView.show(text: Localizable.shared.strings.faucet_redirect_text, link: result) + } + else { + strongSelf.confirmAlert(title: Localizable.shared.strings.external_link_title, message: Localizable.shared.strings.external_link_text, cancelTitle: Localizable.shared.strings.cancel, confirmTitle: Localizable.shared.strings.open, cancelHandler: { _ in + + }) { _ in + BMOverlayTimerView.show(text: Localizable.shared.strings.faucet_redirect_text, link: result) + } + } } } } diff --git a/Resources/en.lproj/Localizable.strings b/Resources/en.lproj/Localizable.strings index fa477583..2972356c 100644 --- a/Resources/en.lproj/Localizable.strings +++ b/Resources/en.lproj/Localizable.strings @@ -503,3 +503,5 @@ "faucet_address_alert" = "Your address will be filled-in automatically on the faucet webpage"; "seed_verification" = "Seed verification"; "complete_seed_verification" = "Complete seed verification"; +"faucet_redirect_text" = "Redirecting to the faucet website.\nYour address will be filled-in automatically."; +"clear_wallet_transactions_text" = "Unable to delete wallet with active transactions";