From a984a8e4d5b7ca5653c1c18bfb2e188b3d2616d1 Mon Sep 17 00:00:00 2001 From: Denis D Date: Tue, 16 Apr 2019 17:31:57 +0300 Subject: [PATCH] sprint 2.0 completed --- BeamWallet.xcodeproj/project.pbxproj | 294 ++- .../xcdebugger/Breakpoints_v2.xcbkptlist | 34 - BeamWallet/AppDelegate.swift | 2 + BeamWallet/BeamSDK/AppModel.h | 7 +- BeamWallet/BeamSDK/AppModel.mm | 171 +- BeamWallet/BeamSDK/MnemonicModel.h | 7 +- BeamWallet/BeamSDK/MnemonicModel.mm | 43 +- BeamWallet/BeamSDK/Objects/BMTransaction.h | 2 + BeamWallet/BeamSDK/Objects/BMTransaction.m | 38 +- BeamWallet/BeamSDK/Objects/BMUTXO.h | 2 + BeamWallet/BeamSDK/Objects/BMUTXO.m | 4 +- BeamWallet/BeamSDK/Settings.h | 1 + BeamWallet/BeamSDK/Settings.m | 21 +- BeamWallet/BeamSDK/WalletModel.h | 2 +- BeamWallet/BeamSDK/WalletModel.mm | 43 +- BeamWallet/BeamSDK/phrases.txt | 2048 +++++++++++++++++ BeamWallet/Controls/AutoSecurityScreen.swift | 5 +- BeamWallet/Controls/BMCopyLabel.swift | 10 +- BeamWallet/Controls/BMField.swift | 7 +- BeamWallet/Controls/BMInputCopyBar.swift | 22 +- BeamWallet/Controls/BMNetworkStatusView.swift | 20 +- BeamWallet/Controls/BMTextView.swift | 7 +- BeamWallet/Controls/BMWordField.swift | 155 +- .../Controls/BMWordSuggestionView.swift | 24 + BeamWallet/Extensions/Double.swift | 8 + BeamWallet/Extensions/String.swift | 2 + BeamWallet/Extensions/TableView.swift | 5 + .../Manager/BiometricAuthorization.swift | 83 + BeamWallet/Manager/NewsService.swift | 60 - .../CreateWalletPasswordViewController.swift | 13 +- .../CreateWalletProgressViewController.swift | 4 +- .../EnterWalletPasswordViewController.swift | 36 +- .../EnterWalletPasswordViewController.xib | 37 +- .../Login/LoginViewController.swift | 3 +- .../Login/LoginViewController.xib | 4 +- .../Addresses/AddressesViewController.swift | 7 + .../Main/Addresses/Cell/AddressSwitchCell.xib | 2 +- .../Addresses/EditAddressViewController.swift | 8 +- .../Settings/SettingsViewController.swift | 26 + .../UnlockPasswordViewController.swift | 14 +- .../Settings/UnlockPasswordViewController.xib | 1 + .../Main/UTXO/Cells/UTXOBlockCell.xib | 26 +- .../Main/UTXO/UTXODetailViewController.swift | 42 + .../Main/UTXO/UTXOViewController.swift | 76 +- .../Main/UTXO/UTXOViewController.xib | 23 + .../Main/Wallet/Cells/WalletProgressCell.xib | 80 +- .../Main/Wallet/Cells/WalletStatusCell.xib | 25 +- .../Wallet/Cells/WalletTransactionCell.swift | 5 +- .../Receive/WalletReceiveViewController.swift | 1 - .../WalletConfirmSendViewController.swift | 19 +- .../Send/WalletSendViewController.swift | 41 +- .../Wallet/Send/WalletSendViewController.xib | 38 + .../Cell/GeneralTransactionInfoCell.swift | 30 +- .../PaymentProofDetailViewController.swift | 30 +- .../TransactionViewController.swift | 5 + .../Main/Wallet/WalletViewController.swift | 58 +- .../Main/Wallet/WalletViewController.xib | 23 + .../Cells/InputWordCell.swift | 4 + .../Cells/InputWordCell.xib | 10 +- .../ConfirmPhraseViewController.swift | 17 +- .../ConfirmPhraseViewController.xib | 16 +- .../DisplayPhraseViewController.swift | 17 + .../DisplayPhraseViewController.xib | 7 +- .../InputPhraseViewController.swift | 8 + .../InputPhraseViewController.xib | 8 +- 65 files changed, 3443 insertions(+), 448 deletions(-) create mode 100644 BeamWallet/BeamSDK/phrases.txt create mode 100644 BeamWallet/Controls/BMWordSuggestionView.swift create mode 100644 BeamWallet/Manager/BiometricAuthorization.swift delete mode 100644 BeamWallet/Manager/NewsService.swift diff --git a/BeamWallet.xcodeproj/project.pbxproj b/BeamWallet.xcodeproj/project.pbxproj index 3b364c4f..659b694c 100644 --- a/BeamWallet.xcodeproj/project.pbxproj +++ b/BeamWallet.xcodeproj/project.pbxproj @@ -67,20 +67,6 @@ 92365AD3222D3E79000D7064 /* WalletModel.mm in Sources */ = {isa = PBXBuildFile; fileRef = 92365ACF222D3E79000D7064 /* WalletModel.mm */; }; 92365ADB222D3F5E000D7064 /* Settings.m in Sources */ = {isa = PBXBuildFile; fileRef = 92365AD8222D3F5E000D7064 /* Settings.m */; }; 92365ADE222D3FAB000D7064 /* MnemonicModel.mm in Sources */ = {isa = PBXBuildFile; fileRef = 92365ADD222D3FAB000D7064 /* MnemonicModel.mm */; }; - 92365AF3222D41C7000D7064 /* libuv_a.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AE5222D41C5000D7064 /* libuv_a.a */; }; - 92365AF4222D41C7000D7064 /* libhttp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AE6222D41C5000D7064 /* libhttp.a */; }; - 92365AF5222D41C7000D7064 /* libwallet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AE7222D41C5000D7064 /* libwallet.a */; }; - 92365AF6222D41C7000D7064 /* libsqlite.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AE8222D41C5000D7064 /* libsqlite.a */; }; - 92365AF7222D41C7000D7064 /* libexplorer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AE9222D41C5000D7064 /* libexplorer.a */; }; - 92365AF8222D41C7000D7064 /* libp2p.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AEA222D41C5000D7064 /* libp2p.a */; }; - 92365AF9222D41C7000D7064 /* libmnemonic.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AEB222D41C5000D7064 /* libmnemonic.a */; }; - 92365AFA222D41C7000D7064 /* libexternal_pow.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AEC222D41C6000D7064 /* libexternal_pow.a */; }; - 92365AFB222D41C7000D7064 /* libwallet_api_proto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AED222D41C6000D7064 /* libwallet_api_proto.a */; }; - 92365AFC222D41C7000D7064 /* libutility.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AEE222D41C6000D7064 /* libutility.a */; }; - 92365AFD222D41C7000D7064 /* libnode.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AEF222D41C6000D7064 /* libnode.a */; }; - 92365AFE222D41C7000D7064 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AF0222D41C6000D7064 /* libcrypto.a */; }; - 92365AFF222D41C7000D7064 /* libcore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AF1222D41C6000D7064 /* libcore.a */; }; - 92365B00222D41C7000D7064 /* libpow.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AF2222D41C6000D7064 /* libpow.a */; }; 92365B06222D743A000D7064 /* EnterWalletPasswordViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92365B04222D743A000D7064 /* EnterWalletPasswordViewController.swift */; }; 92365B07222D743A000D7064 /* EnterWalletPasswordViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 92365B05222D743A000D7064 /* EnterWalletPasswordViewController.xib */; }; 92435243222DED3200A0EF37 /* BMWalletStatus.m in Sources */ = {isa = PBXBuildFile; fileRef = 92435242222DED3200A0EF37 /* BMWalletStatus.m */; }; @@ -198,21 +184,6 @@ 9288DD5E223A55410020C501 /* IntroPhraseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9207FF3D222932DA009D931B /* IntroPhraseViewController.swift */; }; 9288DD5F223A55410020C501 /* SettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92435253222E73E900A0EF37 /* SettingsViewController.swift */; }; 9288DD60223A55410020C501 /* WalletQRCodeScannerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92AE366A22383D2300E0810B /* WalletQRCodeScannerViewController.swift */; }; - 9288DD63223A55410020C501 /* libuv_a.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AE5222D41C5000D7064 /* libuv_a.a */; }; - 9288DD64223A55410020C501 /* SelectItemController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 928E78112236A8880099AD20 /* SelectItemController.framework */; }; - 9288DD66223A55410020C501 /* libmnemonic.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AEB222D41C5000D7064 /* libmnemonic.a */; }; - 9288DD67223A55410020C501 /* libsqlite.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AE8222D41C5000D7064 /* libsqlite.a */; }; - 9288DD68223A55410020C501 /* libexternal_pow.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AEC222D41C6000D7064 /* libexternal_pow.a */; }; - 9288DD69223A55410020C501 /* libwallet_api_proto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AED222D41C6000D7064 /* libwallet_api_proto.a */; }; - 9288DD6A223A55410020C501 /* libnode.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AEF222D41C6000D7064 /* libnode.a */; }; - 9288DD6B223A55410020C501 /* libexplorer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AE9222D41C5000D7064 /* libexplorer.a */; }; - 9288DD6C223A55410020C501 /* libp2p.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AEA222D41C5000D7064 /* libp2p.a */; }; - 9288DD6E223A55410020C501 /* libwallet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AE7222D41C5000D7064 /* libwallet.a */; }; - 9288DD6F223A55410020C501 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AF0222D41C6000D7064 /* libcrypto.a */; }; - 9288DD70223A55410020C501 /* libutility.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AEE222D41C6000D7064 /* libutility.a */; }; - 9288DD71223A55410020C501 /* libcore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AF1222D41C6000D7064 /* libcore.a */; }; - 9288DD72223A55410020C501 /* libhttp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AE6222D41C5000D7064 /* libhttp.a */; }; - 9288DD73223A55410020C501 /* libpow.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92365AF2222D41C6000D7064 /* libpow.a */; }; 9288DD76223A55410020C501 /* ConfirmPhraseViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 92FC610822294F7D00AEABC1 /* ConfirmPhraseViewController.xib */; }; 9288DD77223A55410020C501 /* WalletTransactionCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 926A857B222EC10C00A3B747 /* WalletTransactionCell.xib */; }; 9288DD78223A55410020C501 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 925AD5E42228254F00DDE66B /* LaunchScreen.storyboard */; }; @@ -242,7 +213,6 @@ 9288DD90223A55410020C501 /* LoginViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 925AD5F2222827A500DDE66B /* LoginViewController.xib */; }; 9288DD91223A55410020C501 /* CreateWalletPasswordViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 92FC611B22297EEC00AEABC1 /* CreateWalletPasswordViewController.xib */; }; 9288DD92223A55410020C501 /* ProximaNova-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 925AD5F8222829A400DDE66B /* ProximaNova-Bold.ttf */; }; - 9288DD95223A55410020C501 /* SelectItemController.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 928E78112236A8880099AD20 /* SelectItemController.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 9288DD9F223A55DF0020C501 /* BaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9288DD9E223A55DF0020C501 /* BaseViewController.swift */; }; 9288DDA0223A56920020C501 /* BaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9288DD9E223A55DF0020C501 /* BaseViewController.swift */; }; 9288DDA2223A5A550020C501 /* BaseCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9288DDA1223A5A550020C501 /* BaseCell.swift */; }; @@ -251,8 +221,6 @@ 9288DDA6223A5B430020C501 /* BaseView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9288DDA4223A5B430020C501 /* BaseView.swift */; }; 928B0AB222425329003CE9E7 /* BMPopoverMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 928B0AB122425329003CE9E7 /* BMPopoverMenu.swift */; }; 928B0AB322425329003CE9E7 /* BMPopoverMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 928B0AB122425329003CE9E7 /* BMPopoverMenu.swift */; }; - 928E78122236A8880099AD20 /* SelectItemController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 928E78112236A8880099AD20 /* SelectItemController.framework */; }; - 928E78142236A88F0099AD20 /* SelectItemController.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 928E78112236A8880099AD20 /* SelectItemController.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 929885F3222A15300038C015 /* InputPhraseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 929885F1222A15300038C015 /* InputPhraseViewController.swift */; }; 929885F4222A15300038C015 /* InputPhraseViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 929885F2222A15300038C015 /* InputPhraseViewController.xib */; }; 929885F6222B2B1F0038C015 /* Label.swift in Sources */ = {isa = PBXBuildFile; fileRef = 929885F5222B2B1E0038C015 /* Label.swift */; }; @@ -270,10 +238,14 @@ 92AB832F223BC5D4000ADE86 /* TransactionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92AB832C223BC5D4000ADE86 /* TransactionViewController.swift */; }; 92AB8330223BC5D4000ADE86 /* TransactionViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 92AB832D223BC5D4000ADE86 /* TransactionViewController.xib */; }; 92AB8331223BC5D4000ADE86 /* TransactionViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 92AB832D223BC5D4000ADE86 /* TransactionViewController.xib */; }; + 92AC2DED225F8DA7000272BF /* BMWordSuggestionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92AC2DEC225F8DA7000272BF /* BMWordSuggestionView.swift */; }; + 92AC2DEE225F8DA7000272BF /* BMWordSuggestionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92AC2DEC225F8DA7000272BF /* BMWordSuggestionView.swift */; }; 92ADED812229F213001D0A38 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92ADED802229F213001D0A38 /* ViewController.swift */; }; 92AE366C22383D2300E0810B /* WalletQRCodeScannerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92AE366A22383D2300E0810B /* WalletQRCodeScannerViewController.swift */; }; 92AE366D22383D2300E0810B /* WalletQRCodeScannerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 92AE366B22383D2300E0810B /* WalletQRCodeScannerViewController.xib */; }; 92AE366F223845E300E0810B /* BMNetworkStatusView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92AE366E223845E300E0810B /* BMNetworkStatusView.swift */; }; + 92B39D6E2260CB97006D27A5 /* phrases.txt in Resources */ = {isa = PBXBuildFile; fileRef = 92B39D6D2260CB97006D27A5 /* phrases.txt */; }; + 92B39D6F2260CB97006D27A5 /* phrases.txt in Resources */ = {isa = PBXBuildFile; fileRef = 92B39D6D2260CB97006D27A5 /* phrases.txt */; }; 92BA4B7822484DCB0044B721 /* Application.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92BA4B7722484DCB0044B721 /* Application.swift */; }; 92BA4B7922484DCB0044B721 /* Application.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92BA4B7722484DCB0044B721 /* Application.swift */; }; 92BA7EC322520915002D9367 /* BMTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92BA7EC222520915002D9367 /* BMTextView.swift */; }; @@ -282,6 +254,36 @@ 92BA7EC8225238C7002D9367 /* NodeModel.mm in Sources */ = {isa = PBXBuildFile; fileRef = 92BA7EC6225238C7002D9367 /* NodeModel.mm */; }; 92D2AE0E22578D2200642789 /* LockScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92D2AE0D22578D2200642789 /* LockScreen.swift */; }; 92D2AE0F22578D2200642789 /* LockScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92D2AE0D22578D2200642789 /* LockScreen.swift */; }; + 92D3CBD12264AB6D007E3C55 /* BiometricAuthorization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92D3CBD02264AB6D007E3C55 /* BiometricAuthorization.swift */; }; + 92D3CBD22264AB6D007E3C55 /* BiometricAuthorization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92D3CBD02264AB6D007E3C55 /* BiometricAuthorization.swift */; }; + 92D3CBE22264B562007E3C55 /* libnode.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBD42264B562007E3C55 /* libnode.a */; }; + 92D3CBE32264B562007E3C55 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBD52264B562007E3C55 /* libcrypto.a */; }; + 92D3CBE42264B562007E3C55 /* libhttp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBD62264B562007E3C55 /* libhttp.a */; }; + 92D3CBE52264B562007E3C55 /* libcore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBD72264B562007E3C55 /* libcore.a */; }; + 92D3CBE62264B562007E3C55 /* libutility.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBD82264B562007E3C55 /* libutility.a */; }; + 92D3CBE72264B562007E3C55 /* libexplorer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBD92264B562007E3C55 /* libexplorer.a */; }; + 92D3CBE82264B562007E3C55 /* libmnemonic.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBDA2264B562007E3C55 /* libmnemonic.a */; }; + 92D3CBE92264B562007E3C55 /* libwallet_api_proto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBDB2264B562007E3C55 /* libwallet_api_proto.a */; }; + 92D3CBEA2264B562007E3C55 /* libsqlite.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBDC2264B562007E3C55 /* libsqlite.a */; }; + 92D3CBEB2264B562007E3C55 /* libpow.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBDD2264B562007E3C55 /* libpow.a */; }; + 92D3CBEC2264B562007E3C55 /* libwallet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBDE2264B562007E3C55 /* libwallet.a */; }; + 92D3CBED2264B562007E3C55 /* libp2p.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBDF2264B562007E3C55 /* libp2p.a */; }; + 92D3CBEE2264B562007E3C55 /* libexternal_pow.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBE02264B562007E3C55 /* libexternal_pow.a */; }; + 92D3CBEF2264B562007E3C55 /* libuv_a.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBE12264B562007E3C55 /* libuv_a.a */; }; + 92D3CBFF2264B56D007E3C55 /* libnode.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBF12264B56D007E3C55 /* libnode.a */; }; + 92D3CC002264B56D007E3C55 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBF22264B56D007E3C55 /* libcrypto.a */; }; + 92D3CC012264B56D007E3C55 /* libhttp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBF32264B56D007E3C55 /* libhttp.a */; }; + 92D3CC022264B56D007E3C55 /* libcore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBF42264B56D007E3C55 /* libcore.a */; }; + 92D3CC032264B56D007E3C55 /* libutility.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBF52264B56D007E3C55 /* libutility.a */; }; + 92D3CC042264B56D007E3C55 /* libexplorer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBF62264B56D007E3C55 /* libexplorer.a */; }; + 92D3CC052264B56D007E3C55 /* libmnemonic.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBF72264B56D007E3C55 /* libmnemonic.a */; }; + 92D3CC062264B56D007E3C55 /* libwallet_api_proto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBF82264B56D007E3C55 /* libwallet_api_proto.a */; }; + 92D3CC072264B56D007E3C55 /* libsqlite.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBF92264B56D007E3C55 /* libsqlite.a */; }; + 92D3CC082264B56D007E3C55 /* libpow.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBFA2264B56D007E3C55 /* libpow.a */; }; + 92D3CC092264B56D007E3C55 /* libwallet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBFB2264B56D007E3C55 /* libwallet.a */; }; + 92D3CC0A2264B56D007E3C55 /* libp2p.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBFC2264B56D007E3C55 /* libp2p.a */; }; + 92D3CC0B2264B56D007E3C55 /* libexternal_pow.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBFD2264B56D007E3C55 /* libexternal_pow.a */; }; + 92D3CC0C2264B56D007E3C55 /* libuv_a.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D3CBFE2264B56D007E3C55 /* libuv_a.a */; }; 92D9C9492240FB3C00EDE059 /* UTXOBlockCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92D9C9472240FB3C00EDE059 /* UTXOBlockCell.swift */; }; 92D9C94A2240FB3C00EDE059 /* UTXOBlockCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92D9C9472240FB3C00EDE059 /* UTXOBlockCell.swift */; }; 92D9C94B2240FB3C00EDE059 /* UTXOBlockCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 92D9C9482240FB3C00EDE059 /* UTXOBlockCell.xib */; }; @@ -324,8 +326,6 @@ 92F7ADD5225B79E000D8C46D /* NewsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92F7ADD2225B79E000D8C46D /* NewsViewController.swift */; }; 92F7ADD6225B79E000D8C46D /* NewsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 92F7ADD3225B79E000D8C46D /* NewsViewController.xib */; }; 92F7ADD7225B79E000D8C46D /* NewsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 92F7ADD3225B79E000D8C46D /* NewsViewController.xib */; }; - 92F7ADD9225B7A8A00D8C46D /* NewsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92F7ADD8225B7A8A00D8C46D /* NewsService.swift */; }; - 92F7ADDA225B7A8A00D8C46D /* NewsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92F7ADD8225B7A8A00D8C46D /* NewsService.swift */; }; 92FC610922294F7D00AEABC1 /* ConfirmPhraseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92FC610722294F7D00AEABC1 /* ConfirmPhraseViewController.swift */; }; 92FC610A22294F7D00AEABC1 /* ConfirmPhraseViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 92FC610822294F7D00AEABC1 /* ConfirmPhraseViewController.xib */; }; 92FC610D22295A6E00AEABC1 /* InputWordCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92FC610B22295A6E00AEABC1 /* InputWordCell.swift */; }; @@ -355,7 +355,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 928E78142236A88F0099AD20 /* SelectItemController.framework in Embed Frameworks */, 9235447A2254CB1300889C74 /* openssl.framework in Embed Frameworks */, ); name = "Embed Frameworks"; @@ -367,7 +366,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 9288DD95223A55410020C501 /* SelectItemController.framework in Embed Frameworks */, 923544782254CB0F00889C74 /* openssl.framework in Embed Frameworks */, ); name = "Embed Frameworks"; @@ -418,20 +416,6 @@ 92365AD8222D3F5E000D7064 /* Settings.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Settings.m; sourceTree = ""; }; 92365ADC222D3FAB000D7064 /* MnemonicModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MnemonicModel.h; sourceTree = ""; }; 92365ADD222D3FAB000D7064 /* MnemonicModel.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MnemonicModel.mm; sourceTree = ""; }; - 92365AE5222D41C5000D7064 /* libuv_a.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libuv_a.a; sourceTree = ""; }; - 92365AE6222D41C5000D7064 /* libhttp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libhttp.a; sourceTree = ""; }; - 92365AE7222D41C5000D7064 /* libwallet.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libwallet.a; sourceTree = ""; }; - 92365AE8222D41C5000D7064 /* libsqlite.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libsqlite.a; sourceTree = ""; }; - 92365AE9222D41C5000D7064 /* libexplorer.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libexplorer.a; sourceTree = ""; }; - 92365AEA222D41C5000D7064 /* libp2p.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libp2p.a; sourceTree = ""; }; - 92365AEB222D41C5000D7064 /* libmnemonic.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libmnemonic.a; sourceTree = ""; }; - 92365AEC222D41C6000D7064 /* libexternal_pow.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libexternal_pow.a; sourceTree = ""; }; - 92365AED222D41C6000D7064 /* libwallet_api_proto.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libwallet_api_proto.a; sourceTree = ""; }; - 92365AEE222D41C6000D7064 /* libutility.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libutility.a; sourceTree = ""; }; - 92365AEF222D41C6000D7064 /* libnode.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libnode.a; sourceTree = ""; }; - 92365AF0222D41C6000D7064 /* libcrypto.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcrypto.a; sourceTree = ""; }; - 92365AF1222D41C6000D7064 /* libcore.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcore.a; sourceTree = ""; }; - 92365AF2222D41C6000D7064 /* libpow.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libpow.a; sourceTree = ""; }; 92365B04222D743A000D7064 /* EnterWalletPasswordViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnterWalletPasswordViewController.swift; sourceTree = ""; }; 92365B05222D743A000D7064 /* EnterWalletPasswordViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = EnterWalletPasswordViewController.xib; sourceTree = ""; }; 92435241222DED3200A0EF37 /* BMWalletStatus.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BMWalletStatus.h; sourceTree = ""; }; @@ -500,7 +484,6 @@ 9288DDA1223A5A550020C501 /* BaseCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseCell.swift; sourceTree = ""; }; 9288DDA4223A5B430020C501 /* BaseView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseView.swift; sourceTree = ""; }; 928B0AB122425329003CE9E7 /* BMPopoverMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BMPopoverMenu.swift; sourceTree = ""; }; - 928E78112236A8880099AD20 /* SelectItemController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = SelectItemController.framework; sourceTree = ""; }; 929885F1222A15300038C015 /* InputPhraseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InputPhraseViewController.swift; sourceTree = ""; }; 929885F2222A15300038C015 /* InputPhraseViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = InputPhraseViewController.xib; sourceTree = ""; }; 929885F5222B2B1E0038C015 /* Label.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Label.swift; sourceTree = ""; }; @@ -514,15 +497,46 @@ 92AB8326223BA921000ADE86 /* ShareLogActivity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareLogActivity.swift; sourceTree = ""; }; 92AB832C223BC5D4000ADE86 /* TransactionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionViewController.swift; sourceTree = ""; }; 92AB832D223BC5D4000ADE86 /* TransactionViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TransactionViewController.xib; sourceTree = ""; }; + 92AC2DEC225F8DA7000272BF /* BMWordSuggestionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BMWordSuggestionView.swift; sourceTree = ""; }; 92ADED802229F213001D0A38 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 92AE366A22383D2300E0810B /* WalletQRCodeScannerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletQRCodeScannerViewController.swift; sourceTree = ""; }; 92AE366B22383D2300E0810B /* WalletQRCodeScannerViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WalletQRCodeScannerViewController.xib; sourceTree = ""; }; 92AE366E223845E300E0810B /* BMNetworkStatusView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BMNetworkStatusView.swift; sourceTree = ""; }; + 92B39D6D2260CB97006D27A5 /* phrases.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = phrases.txt; sourceTree = ""; }; 92BA4B7722484DCB0044B721 /* Application.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Application.swift; sourceTree = ""; }; 92BA7EC222520915002D9367 /* BMTextView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BMTextView.swift; sourceTree = ""; }; 92BA7EC5225238C7002D9367 /* NodeModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NodeModel.h; sourceTree = ""; }; 92BA7EC6225238C7002D9367 /* NodeModel.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = NodeModel.mm; sourceTree = ""; }; 92D2AE0D22578D2200642789 /* LockScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LockScreen.swift; sourceTree = ""; }; + 92D3CBD02264AB6D007E3C55 /* BiometricAuthorization.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BiometricAuthorization.swift; sourceTree = ""; }; + 92D3CBD42264B562007E3C55 /* libnode.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libnode.a; sourceTree = ""; }; + 92D3CBD52264B562007E3C55 /* libcrypto.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcrypto.a; sourceTree = ""; }; + 92D3CBD62264B562007E3C55 /* libhttp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libhttp.a; sourceTree = ""; }; + 92D3CBD72264B562007E3C55 /* libcore.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcore.a; sourceTree = ""; }; + 92D3CBD82264B562007E3C55 /* libutility.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libutility.a; sourceTree = ""; }; + 92D3CBD92264B562007E3C55 /* libexplorer.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libexplorer.a; sourceTree = ""; }; + 92D3CBDA2264B562007E3C55 /* libmnemonic.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libmnemonic.a; sourceTree = ""; }; + 92D3CBDB2264B562007E3C55 /* libwallet_api_proto.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libwallet_api_proto.a; sourceTree = ""; }; + 92D3CBDC2264B562007E3C55 /* libsqlite.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libsqlite.a; sourceTree = ""; }; + 92D3CBDD2264B562007E3C55 /* libpow.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libpow.a; sourceTree = ""; }; + 92D3CBDE2264B562007E3C55 /* libwallet.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libwallet.a; sourceTree = ""; }; + 92D3CBDF2264B562007E3C55 /* libp2p.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libp2p.a; sourceTree = ""; }; + 92D3CBE02264B562007E3C55 /* libexternal_pow.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libexternal_pow.a; sourceTree = ""; }; + 92D3CBE12264B562007E3C55 /* libuv_a.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libuv_a.a; sourceTree = ""; }; + 92D3CBF12264B56D007E3C55 /* libnode.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libnode.a; sourceTree = ""; }; + 92D3CBF22264B56D007E3C55 /* libcrypto.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcrypto.a; sourceTree = ""; }; + 92D3CBF32264B56D007E3C55 /* libhttp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libhttp.a; sourceTree = ""; }; + 92D3CBF42264B56D007E3C55 /* libcore.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcore.a; sourceTree = ""; }; + 92D3CBF52264B56D007E3C55 /* libutility.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libutility.a; sourceTree = ""; }; + 92D3CBF62264B56D007E3C55 /* libexplorer.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libexplorer.a; sourceTree = ""; }; + 92D3CBF72264B56D007E3C55 /* libmnemonic.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libmnemonic.a; sourceTree = ""; }; + 92D3CBF82264B56D007E3C55 /* libwallet_api_proto.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libwallet_api_proto.a; sourceTree = ""; }; + 92D3CBF92264B56D007E3C55 /* libsqlite.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libsqlite.a; sourceTree = ""; }; + 92D3CBFA2264B56D007E3C55 /* libpow.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libpow.a; sourceTree = ""; }; + 92D3CBFB2264B56D007E3C55 /* libwallet.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libwallet.a; sourceTree = ""; }; + 92D3CBFC2264B56D007E3C55 /* libp2p.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libp2p.a; sourceTree = ""; }; + 92D3CBFD2264B56D007E3C55 /* libexternal_pow.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libexternal_pow.a; sourceTree = ""; }; + 92D3CBFE2264B56D007E3C55 /* libuv_a.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libuv_a.a; sourceTree = ""; }; 92D9C9472240FB3C00EDE059 /* UTXOBlockCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UTXOBlockCell.swift; sourceTree = ""; }; 92D9C9482240FB3C00EDE059 /* UTXOBlockCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = UTXOBlockCell.xib; sourceTree = ""; }; 92D9C94D224188A400EDE059 /* GeneralTransactionInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeneralTransactionInfoCell.swift; sourceTree = ""; }; @@ -545,7 +559,6 @@ 92F68C8C2245070200197D4D /* UTXOTransactionCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = UTXOTransactionCell.xib; sourceTree = ""; }; 92F7ADD2225B79E000D8C46D /* NewsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewsViewController.swift; sourceTree = ""; }; 92F7ADD3225B79E000D8C46D /* NewsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NewsViewController.xib; sourceTree = ""; }; - 92F7ADD8225B7A8A00D8C46D /* NewsService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewsService.swift; sourceTree = ""; }; 92F82512222C33F6000D34F7 /* BeamWallet-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BeamWallet-Bridging-Header.h"; sourceTree = ""; }; 92FC610722294F7D00AEABC1 /* ConfirmPhraseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfirmPhraseViewController.swift; sourceTree = ""; }; 92FC610822294F7D00AEABC1 /* ConfirmPhraseViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ConfirmPhraseViewController.xib; sourceTree = ""; }; @@ -573,25 +586,24 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 92365AF3222D41C7000D7064 /* libuv_a.a in Frameworks */, - 928E78122236A8880099AD20 /* SelectItemController.framework in Frameworks */, - 92365AF9222D41C7000D7064 /* libmnemonic.a in Frameworks */, - 92365AF6222D41C7000D7064 /* libsqlite.a in Frameworks */, - 92365AFA222D41C7000D7064 /* libexternal_pow.a in Frameworks */, 923544792254CB1300889C74 /* openssl.framework in Frameworks */, - 92365AFB222D41C7000D7064 /* libwallet_api_proto.a in Frameworks */, - 92365AFD222D41C7000D7064 /* libnode.a in Frameworks */, - 92365AF7222D41C7000D7064 /* libexplorer.a in Frameworks */, - 92365AF8222D41C7000D7064 /* libp2p.a in Frameworks */, - 92365AF5222D41C7000D7064 /* libwallet.a in Frameworks */, - 92365AFE222D41C7000D7064 /* libcrypto.a in Frameworks */, - 92365AFC222D41C7000D7064 /* libutility.a in Frameworks */, - 92365AFF222D41C7000D7064 /* libcore.a in Frameworks */, - 92365AF4222D41C7000D7064 /* libhttp.a in Frameworks */, + 92D3CBE42264B562007E3C55 /* libhttp.a in Frameworks */, + 92D3CBE32264B562007E3C55 /* libcrypto.a in Frameworks */, + 92D3CBEB2264B562007E3C55 /* libpow.a in Frameworks */, + 92D3CBE22264B562007E3C55 /* libnode.a in Frameworks */, 923544722254C6CE00889C74 /* openssl.framework in Frameworks */, + 92D3CBEA2264B562007E3C55 /* libsqlite.a in Frameworks */, + 92D3CBED2264B562007E3C55 /* libp2p.a in Frameworks */, + 92D3CBE82264B562007E3C55 /* libmnemonic.a in Frameworks */, + 92D3CBEF2264B562007E3C55 /* libuv_a.a in Frameworks */, 92790D92224CCDF600F79D64 /* boost.framework in Frameworks */, - 92365B00222D41C7000D7064 /* libpow.a in Frameworks */, 575CFF43C23FF5D78D61B080 /* Pods_BeamWallet.framework in Frameworks */, + 92D3CBEC2264B562007E3C55 /* libwallet.a in Frameworks */, + 92D3CBE72264B562007E3C55 /* libexplorer.a in Frameworks */, + 92D3CBE52264B562007E3C55 /* libcore.a in Frameworks */, + 92D3CBE62264B562007E3C55 /* libutility.a in Frameworks */, + 92D3CBEE2264B562007E3C55 /* libexternal_pow.a in Frameworks */, + 92D3CBE92264B562007E3C55 /* libwallet_api_proto.a in Frameworks */, A3D65E76187D5C3531088ABD /* Pods_BeamWallet.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -600,25 +612,24 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9288DD63223A55410020C501 /* libuv_a.a in Frameworks */, - 9288DD64223A55410020C501 /* SelectItemController.framework in Frameworks */, - 9288DD66223A55410020C501 /* libmnemonic.a in Frameworks */, + 92D3CC0A2264B56D007E3C55 /* libp2p.a in Frameworks */, + 92D3CC052264B56D007E3C55 /* libmnemonic.a in Frameworks */, + 92D3CC0B2264B56D007E3C55 /* libexternal_pow.a in Frameworks */, + 92D3CC0C2264B56D007E3C55 /* libuv_a.a in Frameworks */, 923544732254C6CE00889C74 /* openssl.framework in Frameworks */, + 92D3CC022264B56D007E3C55 /* libcore.a in Frameworks */, 92790D93224CCDF600F79D64 /* boost.framework in Frameworks */, - 9288DD67223A55410020C501 /* libsqlite.a in Frameworks */, - 9288DD68223A55410020C501 /* libexternal_pow.a in Frameworks */, - 9288DD69223A55410020C501 /* libwallet_api_proto.a in Frameworks */, - 9288DD6A223A55410020C501 /* libnode.a in Frameworks */, - 9288DD6B223A55410020C501 /* libexplorer.a in Frameworks */, - 9288DD6C223A55410020C501 /* libp2p.a in Frameworks */, - 9288DD6E223A55410020C501 /* libwallet.a in Frameworks */, - 9288DD6F223A55410020C501 /* libcrypto.a in Frameworks */, - 9288DD70223A55410020C501 /* libutility.a in Frameworks */, 923544772254CB0F00889C74 /* openssl.framework in Frameworks */, - 9288DD71223A55410020C501 /* libcore.a in Frameworks */, - 9288DD72223A55410020C501 /* libhttp.a in Frameworks */, - 9288DD73223A55410020C501 /* libpow.a in Frameworks */, B204B190DA4B48994EBAD225 /* Pods_BeamWalletTestNet.framework in Frameworks */, + 92D3CC072264B56D007E3C55 /* libsqlite.a in Frameworks */, + 92D3CC042264B56D007E3C55 /* libexplorer.a in Frameworks */, + 92D3CC062264B56D007E3C55 /* libwallet_api_proto.a in Frameworks */, + 92D3CC092264B56D007E3C55 /* libwallet.a in Frameworks */, + 92D3CBFF2264B56D007E3C55 /* libnode.a in Frameworks */, + 92D3CC002264B56D007E3C55 /* libcrypto.a in Frameworks */, + 92D3CC032264B56D007E3C55 /* libutility.a in Frameworks */, + 92D3CC012264B56D007E3C55 /* libhttp.a in Frameworks */, + 92D3CC082264B56D007E3C55 /* libpow.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -702,6 +713,7 @@ 926A857F222ECD7600A3B747 /* Reachability.m */, 92FC932F225371D400555DE1 /* DiskStatusManager.h */, 92FC9330225371D400555DE1 /* DiskStatusManager.m */, + 92B39D6D2260CB97006D27A5 /* phrases.txt */, ); path = BeamSDK; sourceTree = ""; @@ -709,23 +721,10 @@ 92365AC8222D3E16000D7064 /* Frameworks */ = { isa = PBXGroup; children = ( + 92D3CBF02264B56D007E3C55 /* testnet */, + 92D3CBD32264B562007E3C55 /* mainnet */, 923544712254C6CE00889C74 /* openssl.framework */, 92790D91224CCDF600F79D64 /* boost.framework */, - 928E78112236A8880099AD20 /* SelectItemController.framework */, - 92365AF1222D41C6000D7064 /* libcore.a */, - 92365AF0222D41C6000D7064 /* libcrypto.a */, - 92365AE9222D41C5000D7064 /* libexplorer.a */, - 92365AEC222D41C6000D7064 /* libexternal_pow.a */, - 92365AE6222D41C5000D7064 /* libhttp.a */, - 92365AEB222D41C5000D7064 /* libmnemonic.a */, - 92365AEF222D41C6000D7064 /* libnode.a */, - 92365AEA222D41C5000D7064 /* libp2p.a */, - 92365AF2222D41C6000D7064 /* libpow.a */, - 92365AE8222D41C5000D7064 /* libsqlite.a */, - 92365AEE222D41C6000D7064 /* libutility.a */, - 92365AE5222D41C5000D7064 /* libuv_a.a */, - 92365AED222D41C6000D7064 /* libwallet_api_proto.a */, - 92365AE7222D41C5000D7064 /* libwallet.a */, 60CB149AE31B7B21CD7FD15E /* Pods_BeamWallet.framework */, E96237C4102DE036679EDC41 /* Pods_BeamWalletTestNet.framework */, ); @@ -748,14 +747,14 @@ 92435242222DED3200A0EF37 /* BMWalletStatus.m */, 92435244222DF9AE00A0EF37 /* BMAddress.h */, 92435245222DF9AE00A0EF37 /* BMAddress.mm */, - 926A8577222EB7C600A3B747 /* BMTransaction.h */, - 926A8578222EB7C600A3B747 /* BMTransaction.m */, 92E884B7223F93FF0003D6BB /* BMUTXO.h */, 92E884B8223F93FF0003D6BB /* BMUTXO.m */, - 92790D94224CD8AE00F79D64 /* BMContact.h */, - 92790D95224CD8AE00F79D64 /* BMContact.m */, 92790D98224E41E800F79D64 /* BMPaymentProof.h */, 92790D99224E41E800F79D64 /* BMPaymentProof.m */, + 92790D94224CD8AE00F79D64 /* BMContact.h */, + 92790D95224CD8AE00F79D64 /* BMContact.m */, + 926A8577222EB7C600A3B747 /* BMTransaction.h */, + 926A8578222EB7C600A3B747 /* BMTransaction.m */, ); path = Objects; sourceTree = ""; @@ -902,6 +901,7 @@ 928848012243B66500DFC2AD /* BMCopyLabel.swift */, 92BA7EC222520915002D9367 /* BMTextView.swift */, 92D2AE0D22578D2200642789 /* LockScreen.swift */, + 92AC2DEC225F8DA7000272BF /* BMWordSuggestionView.swift */, ); path = Controls; sourceTree = ""; @@ -999,6 +999,48 @@ path = Cell; sourceTree = ""; }; + 92D3CBD32264B562007E3C55 /* mainnet */ = { + isa = PBXGroup; + children = ( + 92D3CBD42264B562007E3C55 /* libnode.a */, + 92D3CBD52264B562007E3C55 /* libcrypto.a */, + 92D3CBD62264B562007E3C55 /* libhttp.a */, + 92D3CBD72264B562007E3C55 /* libcore.a */, + 92D3CBD82264B562007E3C55 /* libutility.a */, + 92D3CBD92264B562007E3C55 /* libexplorer.a */, + 92D3CBDA2264B562007E3C55 /* libmnemonic.a */, + 92D3CBDB2264B562007E3C55 /* libwallet_api_proto.a */, + 92D3CBDC2264B562007E3C55 /* libsqlite.a */, + 92D3CBDD2264B562007E3C55 /* libpow.a */, + 92D3CBDE2264B562007E3C55 /* libwallet.a */, + 92D3CBDF2264B562007E3C55 /* libp2p.a */, + 92D3CBE02264B562007E3C55 /* libexternal_pow.a */, + 92D3CBE12264B562007E3C55 /* libuv_a.a */, + ); + path = mainnet; + sourceTree = ""; + }; + 92D3CBF02264B56D007E3C55 /* testnet */ = { + isa = PBXGroup; + children = ( + 92D3CBF12264B56D007E3C55 /* libnode.a */, + 92D3CBF22264B56D007E3C55 /* libcrypto.a */, + 92D3CBF32264B56D007E3C55 /* libhttp.a */, + 92D3CBF42264B56D007E3C55 /* libcore.a */, + 92D3CBF52264B56D007E3C55 /* libutility.a */, + 92D3CBF62264B56D007E3C55 /* libexplorer.a */, + 92D3CBF72264B56D007E3C55 /* libmnemonic.a */, + 92D3CBF82264B56D007E3C55 /* libwallet_api_proto.a */, + 92D3CBF92264B56D007E3C55 /* libsqlite.a */, + 92D3CBFA2264B56D007E3C55 /* libpow.a */, + 92D3CBFB2264B56D007E3C55 /* libwallet.a */, + 92D3CBFC2264B56D007E3C55 /* libp2p.a */, + 92D3CBFD2264B56D007E3C55 /* libexternal_pow.a */, + 92D3CBFE2264B56D007E3C55 /* libuv_a.a */, + ); + path = testnet; + sourceTree = ""; + }; 92DD900B224A553D0011BE3E /* Addresses */ = { isa = PBXGroup; children = ( @@ -1066,7 +1108,7 @@ 92FC6117222978C400AEABC1 /* PasswordManager.swift */, 92592CA42245296D00050A13 /* KeychainManager.swift */, 92592CA72245309B00050A13 /* NotificationManager.swift */, - 92F7ADD8225B7A8A00D8C46D /* NewsService.swift */, + 92D3CBD02264AB6D007E3C55 /* BiometricAuthorization.swift */, ); path = Manager; sourceTree = ""; @@ -1195,6 +1237,7 @@ 9235447F2254D6B700889C74 /* WalletConfirmSendViewController.xib in Resources */, 92DD901D224A77800011BE3E /* AddressViewController.xib in Resources */, 92790DA6224E59E800F79D64 /* TransactionUTXOCell.xib in Resources */, + 92B39D6E2260CB97006D27A5 /* phrases.txt in Resources */, 925AD5E62228254F00DDE66B /* LaunchScreen.storyboard in Resources */, 92365B07222D743A000D7064 /* EnterWalletPasswordViewController.xib in Resources */, 92482E002237F69700776D38 /* WalletSendViewController.xib in Resources */, @@ -1257,6 +1300,7 @@ 923544802254D6B700889C74 /* WalletConfirmSendViewController.xib in Resources */, 92DD901E224A77800011BE3E /* AddressViewController.xib in Resources */, 92790DA7224E59E800F79D64 /* TransactionUTXOCell.xib in Resources */, + 92B39D6F2260CB97006D27A5 /* phrases.txt in Resources */, 9288DD78223A55410020C501 /* LaunchScreen.storyboard in Resources */, 9288DD79223A55410020C501 /* EnterWalletPasswordViewController.xib in Resources */, 9288DD7A223A55410020C501 /* WalletSendViewController.xib in Resources */, @@ -1473,6 +1517,7 @@ 92365ADB222D3F5E000D7064 /* Settings.m in Sources */, 926A856F222E97DF00A3B747 /* WalletAvailableCell.swift in Sources */, 92FC611C22297EEC00AEABC1 /* CreateWalletPasswordViewController.swift in Sources */, + 92AC2DED225F8DA7000272BF /* BMWordSuggestionView.swift in Sources */, 9235447D2254D6B700889C74 /* WalletConfirmSendViewController.swift in Sources */, 92D9C9492240FB3C00EDE059 /* UTXOBlockCell.swift in Sources */, 92435243222DED3200A0EF37 /* BMWalletStatus.m in Sources */, @@ -1517,6 +1562,7 @@ 92592CA82245309B00050A13 /* NotificationManager.swift in Sources */, 92F68C8D2245070200197D4D /* UTXOTransactionCell.swift in Sources */, 921E21FD224B84A4001E2538 /* AddressSwitchCell.swift in Sources */, + 92D3CBD12264AB6D007E3C55 /* BiometricAuthorization.swift in Sources */, 92435246222DF9AE00A0EF37 /* BMAddress.mm in Sources */, 920F460D223A9EA20048966E /* BMInputCopyBar.swift in Sources */, 92DD900E224A554E0011BE3E /* AddressesViewController.swift in Sources */, @@ -1534,7 +1580,6 @@ 92790D96224CD8AE00F79D64 /* BMContact.m in Sources */, 92F68C782244E37200197D4D /* UTXODetailViewController.swift in Sources */, 926A857C222EC10C00A3B747 /* WalletTransactionCell.swift in Sources */, - 92F7ADD9225B7A8A00D8C46D /* NewsService.swift in Sources */, 928848022243B66500DFC2AD /* BMCopyLabel.swift in Sources */, 92FC933422538CE400555DE1 /* Double.swift in Sources */, 92ADED812229F213001D0A38 /* ViewController.swift in Sources */, @@ -1573,6 +1618,7 @@ 9288DD37223A55410020C501 /* Settings.m in Sources */, 9288DD38223A55410020C501 /* WalletAvailableCell.swift in Sources */, 9288DD39223A55410020C501 /* CreateWalletPasswordViewController.swift in Sources */, + 92AC2DEE225F8DA7000272BF /* BMWordSuggestionView.swift in Sources */, 9235447E2254D6B700889C74 /* WalletConfirmSendViewController.swift in Sources */, 92D9C94A2240FB3C00EDE059 /* UTXOBlockCell.swift in Sources */, 9288DD3A223A55410020C501 /* BMWalletStatus.m in Sources */, @@ -1617,6 +1663,7 @@ 92592CA92245309B00050A13 /* NotificationManager.swift in Sources */, 92F68C8E2245070200197D4D /* UTXOTransactionCell.swift in Sources */, 921E21FE224B84A4001E2538 /* AddressSwitchCell.swift in Sources */, + 92D3CBD22264AB6D007E3C55 /* BiometricAuthorization.swift in Sources */, 9288DD52223A55410020C501 /* BMAddress.mm in Sources */, 920F460E223A9EA20048966E /* BMInputCopyBar.swift in Sources */, 92DD900F224A554E0011BE3E /* AddressesViewController.swift in Sources */, @@ -1634,7 +1681,6 @@ 92790D97224CD8AE00F79D64 /* BMContact.m in Sources */, 92F68C792244E37200197D4D /* UTXODetailViewController.swift in Sources */, 9288DD59223A55410020C501 /* WalletTransactionCell.swift in Sources */, - 92F7ADDA225B7A8A00D8C46D /* NewsService.swift in Sources */, 928848032243B66500DFC2AD /* BMCopyLabel.swift in Sources */, 92FC933522538CE400555DE1 /* Double.swift in Sources */, 9288DD5A223A55410020C501 /* ViewController.swift in Sources */, @@ -1798,7 +1844,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7BFB7F991044E9C6718DE261 /* Pods-BeamWallet.debug.xcconfig */; buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIconMain; CLANG_ENABLE_MODULES = YES; CLANG_WARN_ENUM_CONVERSION = NO; CODE_SIGN_STYLE = Automatic; @@ -1811,13 +1857,13 @@ "$(PROJECT_DIR)/Frameworks", ); HEADER_SEARCH_PATHS = ( - "\"$(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)/../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\"", ); INFOPLIST_FILE = "$(SRCROOT)/Resources/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 11.0; @@ -1829,8 +1875,9 @@ "$(inherited)", "$(PROJECT_DIR)/BeamWallet/BeamSDK", "$(PROJECT_DIR)/Frameworks", + "$(PROJECT_DIR)/Frameworks/mainnet", ); - PRODUCT_BUNDLE_IDENTIFIER = com.mw.beam.beamwalletiOS; + PRODUCT_BUNDLE_IDENTIFIER = com.mw.beam.beamwalletiOSMainnet; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "BeamWallet/BeamWallet-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -1843,7 +1890,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 3507D319FDB9B8876886EFE4 /* Pods-BeamWallet.release.xcconfig */; buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIconMain; CLANG_ENABLE_MODULES = YES; CLANG_WARN_ENUM_CONVERSION = NO; CODE_SIGN_STYLE = Automatic; @@ -1855,13 +1902,13 @@ "$(PROJECT_DIR)/Frameworks", ); HEADER_SEARCH_PATHS = ( - "\"$(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)/../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\"", ); INFOPLIST_FILE = "$(SRCROOT)/Resources/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 11.0; @@ -1873,8 +1920,9 @@ "$(inherited)", "$(PROJECT_DIR)/BeamWallet/BeamSDK", "$(PROJECT_DIR)/Frameworks", + "$(PROJECT_DIR)/Frameworks/mainnet", ); - PRODUCT_BUNDLE_IDENTIFIER = com.mw.beam.beamwalletiOS; + PRODUCT_BUNDLE_IDENTIFIER = com.mw.beam.beamwalletiOSMainnet; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "BeamWallet/BeamWallet-Bridging-Header.h"; SWIFT_VERSION = 4.2; @@ -1918,6 +1966,7 @@ "$(inherited)", "$(PROJECT_DIR)/BeamWallet/BeamSDK", "$(PROJECT_DIR)/Frameworks", + "$(PROJECT_DIR)/Frameworks/testnet", ); PRODUCT_BUNDLE_IDENTIFIER = com.mw.beam.beamwalletiOS; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1963,6 +2012,7 @@ "$(inherited)", "$(PROJECT_DIR)/BeamWallet/BeamSDK", "$(PROJECT_DIR)/Frameworks", + "$(PROJECT_DIR)/Frameworks/testnet", ); PRODUCT_BUNDLE_IDENTIFIER = com.mw.beam.beamwalletiOS; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/BeamWallet.xcodeproj/xcuserdata/Denis.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/BeamWallet.xcodeproj/xcuserdata/Denis.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 0c21af99..fe2b4541 100644 --- a/BeamWallet.xcodeproj/xcuserdata/Denis.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/BeamWallet.xcodeproj/xcuserdata/Denis.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -2,38 +2,4 @@ - - - - - - - - - - diff --git a/BeamWallet/AppDelegate.swift b/BeamWallet/AppDelegate.swift index 20962870..e4b962da 100644 --- a/BeamWallet/AppDelegate.swift +++ b/BeamWallet/AppDelegate.swift @@ -47,6 +47,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } } + static var enableNewFeatures = true + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { diff --git a/BeamWallet/BeamSDK/AppModel.h b/BeamWallet/BeamSDK/AppModel.h index 30458825..d0692274 100644 --- a/BeamWallet/BeamSDK/AppModel.h +++ b/BeamWallet/BeamSDK/AppModel.h @@ -77,12 +77,13 @@ -(BOOL)createWallet:(NSString*_Nonnull)phrase pass:(NSString*_Nonnull)pass; -(BOOL)openWallet:(NSString*_Nonnull)pass; -(BOOL)canOpenWallet:(NSString*_Nonnull)pass; --(void)resetWallet; +-(void)resetWallet:(BOOL)removeDatabase; -(void)startForgotPassword; -(void)stopForgotPassword; -(void)cancelForgotPassword; -(BOOL)isValidPassword:(NSString*_Nonnull)pass; -(void)changePassword:(NSString*_Nonnull)pass; +-(void)onSyncWithLocalNodeCompleted; // updates -(void)getWalletStatus; @@ -99,6 +100,8 @@ -(void)deleteAddress:(NSString*_Nullable)address; -(BOOL)isValidAddress:(NSString*_Nullable)address; -(BOOL)isExpiredAddress:(NSString*_Nullable)address; +-(BOOL)isAddressDeleted:(NSString*_Nullable)address; + // send -(NSString*_Nullable)canSend:(double)amount fee:(double)fee to:(NSString*_Nullable)to; @@ -114,9 +117,11 @@ -(void)cancelTransaction:(BMTransaction*_Nonnull)transaction; -(void)resumeTransaction:(BMTransaction*_Nonnull)transaction; -(NSMutableArray*_Nonnull)getUTXOSFromTransaction:(BMTransaction*_Nonnull)transaction; +-(void)exportTransactionsToCSV:(void(^_Nonnull)(NSURL*_Nonnull))callback; // utxo -(void)getUTXO; +-(NSMutableArray*_Nonnull)getUTXOWithPadding:(BOOL)active page:(int)page perPage:(int)perPage; -(NSMutableArray*_Nonnull)getTransactionsFromUTXO:(BMUTXO*_Nonnull)utox; //contacts diff --git a/BeamWallet/BeamSDK/AppModel.mm b/BeamWallet/BeamSDK/AppModel.mm index 8f23f512..59b4403b 100644 --- a/BeamWallet/BeamSDK/AppModel.mm +++ b/BeamWallet/BeamSDK/AppModel.mm @@ -39,7 +39,7 @@ #include "utility/bridge.h" #include "utility/string_helpers.h" -#include "utility/options.h" +//#include "utility/options.h" #include "mnemonic/mnemonic.h" @@ -54,9 +54,11 @@ using namespace beam::io; static int proofSize = 330; +static NSString *deletedAddressesKEY = @"deletedAddresses"; @implementation AppModel { BOOL isStarted; + NSTimer *utxoTimer; Reachability *internetReachableFoo; @@ -99,7 +101,7 @@ -(id)init{ name:UIApplicationDidBecomeActiveNotification object:nil]; [self cancelForgotPassword]; - + return self; } @@ -161,11 +163,12 @@ -(void)setIsLocalNodeStarted:(BOOL)isLocalNodeStarted { wallet->start(); dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5.0f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - self->nodeModel.stopNode(); + + /// self->nodeModel.stopNode(); - string nodeAddrStr = [Settings sharedManager].nodeAddress.string; + /// string nodeAddrStr = [Settings sharedManager].nodeAddress.string; - self->wallet->getAsync()->setNodeAddress(nodeAddrStr); + /// self->wallet->getAsync()->setNodeAddress(nodeAddrStr); for(id delegate in [AppModel sharedManager].delegates) { @@ -174,7 +177,7 @@ -(void)setIsLocalNodeStarted:(BOOL)isLocalNodeStarted { } } - [[NSFileManager defaultManager] removeItemAtPath:[Settings sharedManager].localNodeStorage error:nil]; + /// [[NSFileManager defaultManager] removeItemAtPath:[Settings sharedManager].localNodeStorage error:nil]; if([AppModel sharedManager].isForgotPasswordFlow) { [[AppModel sharedManager] stopForgotPassword]; @@ -231,19 +234,25 @@ -(BOOL)openWallet:(NSString*)pass { -(BOOL)canOpenWallet:(NSString*)pass { Rules::get().UpdateChecksum(); - + string dbFilePath = [Settings sharedManager].walletStoragePath.string; - + walletDb = WalletDB::open(dbFilePath, pass.string, walletReactor); if (!walletDb) { return NO; } if ([[NSFileManager defaultManager] fileExistsAtPath:[Settings sharedManager].localNodeStorage]) { - self.isRestoreFlow = YES; + // self.isRestoreFlow = YES; + + if (!nodeModel.isStarted()) + { + nodeModel.start(); + } + + [Settings sharedManager].isLocalNode = YES; } - return YES; } @@ -304,16 +313,23 @@ -(BOOL)createWallet:(NSString*)phrase pass:(NSString*)pass { return YES; } --(void)resetWallet{ +-(void)resetWallet:(BOOL)removeDatabase { if (self.isRestoreFlow) { self.isRestoreFlow = NO; self->nodeModel.stopNode(); } - else{ - walletDb.reset(); - wallet.reset(); - + + isStarted = NO; + + walletDb.reset(); + wallet.reset(); + + wallet = nil; + walletDb = nil; + + if(removeDatabase) { [[NSFileManager defaultManager] removeItemAtPath:[Settings sharedManager].walletStoragePath error:nil]; + [[NSFileManager defaultManager] removeItemAtPath:[Settings sharedManager].localNodeStorage error:nil]; } } @@ -509,13 +525,27 @@ -(void)setWalletComment:(NSString*)comment toAddress:(NSString*_Nonnull)address } -(void)deleteAddress:(NSString*_Nullable)address { + WalletID walletID(Zero); if (walletID.FromHex(address.string)) { - walletDb->deleteAddress(walletID); + wallet->getAsync()->deleteAddress(walletID); + // walletDb->deleteAddress(walletID); } } +-(BOOL)isAddressDeleted:(NSString*_Nullable)address { + NSMutableArray *deletedAddresses = [NSMutableArray arrayWithArray:[[NSUserDefaults standardUserDefaults]objectForKey:deletedAddressesKEY]]; + + for (NSString *a in deletedAddresses) { + if ([a isEqualToString:address]){ + return YES; + } + } + + return NO; +} + -(void)generateNewWalletAddress { wallet->getAsync()->generateNewAddress(); } @@ -572,7 +602,7 @@ -(void)editAddress:(BMAddress*_Nonnull)address { } } else{ - wallet->getAsync()->saveAddressChanges(walletID, address.label.string, (address.duration == 0 ? true : false), false, false); + wallet->getAsync()->saveAddressChanges(walletID, address.label.string, (address.duration == 0 ? true : false), true, false); } } } @@ -626,6 +656,7 @@ -(NSString*)sendError:(double)amount fee:(double)fee to:(NSString*_Nullable)to { currencyFormatter.maximumIntegerDigits = 20; currencyFormatter.maximumFractionDigits = 20; currencyFormatter.maximumSignificantDigits = 20; + currencyFormatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]; NSString *beam = [currencyFormatter stringFromNumber:[NSNumber numberWithDouble:need]]; @@ -641,8 +672,10 @@ -(void)send:(double)amount fee:(double)fee to:(NSString*_Nonnull)to comment:(NSS WalletID walletID(Zero); if (walletID.FromHex(to.string)) { + auto bAmount = round(amount * Rules::Coin); + try{ - wallet->getAsync()->sendMoney(walletID, comment.string, amount * Rules::Coin,fee); + wallet->getAsync()->sendMoney(walletID, comment.string, bAmount, fee); } catch(NSException *ex) { NSLog(@"%@",ex); @@ -822,8 +855,71 @@ -(TxID)txIDfromString:(NSString*)string { return txID; } +-(void)exportTransactionsToCSV:(void(^_Nonnull)(NSURL*_Nonnull))callback { + NSString *fileName = @"transactions.csv"; + NSURL *url = [NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent:fileName]]; + + NSString *csvText = @"Type,Date,Amount,Status,Sending address,Receiving address,Transaction fee,Transaction ID,Kernel ID\n"; + + for (BMTransaction *tr in _transactions) { + NSString *newLine = [tr csvLine]; + csvText = [csvText stringByAppendingString:newLine]; + } + + [csvText writeToURL:url atomically:YES encoding:NSUTF8StringEncoding error:nil]; + + callback(url); +} + #pragma mark - UTXO +-(void)onSyncWithLocalNodeCompleted { + if ([Settings sharedManager].isLocalNode) { + NSLog(@"---------------------------"); + NSLog(@"---------------------------"); + NSLog(@"---------------------------"); + NSLog(@"---------------------------"); + NSLog(@"---------------------------"); + NSLog(@"---------------------------"); + NSLog(@"---------------------------"); + NSLog(@"---------------------------"); + NSLog(@"---------------------------"); + NSLog(@"---------------------------"); + + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + + self->nodeModel.stopNode(); + + string nodeAddrStr = [Settings sharedManager].nodeAddress.string; + + self->wallet->getAsync()->setNodeAddress(nodeAddrStr); + + [[NSFileManager defaultManager] removeItemAtPath:[Settings sharedManager].localNodeStorage error:nil]; + }); + + self.isLocalNodeStarted = NO; + self.isRestoreFlow = NO; + } +} + +-(void)setUtxos:(NSMutableArray *)utxos { + _utxos = utxos; +// dispatch_async(dispatch_get_main_queue(), ^{ +// if ([Settings sharedManager].isLocalNode) { +// if (self->utxoTimer) { +// [self->utxoTimer invalidate]; +// self->utxoTimer = nil; +// } +// +// self->utxoTimer = [NSTimer scheduledTimerWithTimeInterval: 15 +// target: self +// selector: @selector(onUTXOTimer) +// userInfo: nil +// repeats: NO]; +// } +// }); +} + -(void)getUTXO { wallet->getAsync()->getUtxosStatus(); } @@ -850,6 +946,45 @@ -(void)getUTXO { return result; } +-(NSMutableArray*_Nonnull)getUTXOWithPadding:(BOOL)active page:(int)page perPage:(int)perPage { + + NSArray *filteredArray = [self.utxos filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id object, NSDictionary *bindings) { + if (active) { + if ([(BMUTXO*)object isActive]) { + return YES; + } + else{ + return NO; + } + } + + return YES; + }]]; + + NSMutableArray *result = [NSMutableArray array]; + + if(filteredArray.count >= (perPage*page)) { + result = [NSMutableArray arrayWithArray:[filteredArray subarrayWithRange:NSMakeRange(0, perPage*page)]]; + } + else{ + [result addObjectsFromArray:filteredArray]; + } + + [result sortUsingComparator:^NSComparisonResult(id _Nonnull obj1, id _Nonnull obj2) { + BMUTXO *utxo_1 = (BMUTXO*)obj1; + BMUTXO *utxo_2 = (BMUTXO*)obj2; + + if (utxo_1.ID > utxo_2.ID) { + return (NSComparisonResult)NSOrderedAscending; + } + else{ + return (NSComparisonResult)NSOrderedDescending; + } + }]; + + return result; +} + #pragma mark - Contacts -(BMContact*_Nullable)getContactFromId:(NSString*_Nonnull)idValue { diff --git a/BeamWallet/BeamSDK/MnemonicModel.h b/BeamWallet/BeamSDK/MnemonicModel.h index adf2f072..fda32ce1 100644 --- a/BeamWallet/BeamSDK/MnemonicModel.h +++ b/BeamWallet/BeamSDK/MnemonicModel.h @@ -23,8 +23,9 @@ @interface MnemonicModel : NSObject -+(NSString*)generatePhrase; -+(BOOL)isValidPhrase:(NSString*)phrase; -+(BOOL)isValidWord:(NSString*)word; ++(NSString*_Nonnull)generatePhrase; ++(BOOL)isValidPhrase:(NSString*_Nonnull)phrase; ++(BOOL)isValidWord:(NSString*_Nonnull)word; ++(NSArray*_Nonnull)mnemonicWordsForPrefix:(NSString*_Nonnull)prefix suggestions:(NSArray*_Nullable)suggestions; @end diff --git a/BeamWallet/BeamSDK/MnemonicModel.mm b/BeamWallet/BeamSDK/MnemonicModel.mm index d0885707..b0545079 100644 --- a/BeamWallet/BeamSDK/MnemonicModel.mm +++ b/BeamWallet/BeamSDK/MnemonicModel.mm @@ -1,8 +1,7 @@ // -// MnemonicModel.m -// BeamTest +// MnemonicModel.m +// BeamTest // -// 2/28/19. // Copyright 2018 Beam Development // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -27,6 +26,8 @@ @implementation MnemonicModel +static NSMutableArray *phrases; + +(BOOL)isValidPhrase:(NSString*)phrase { NSArray *wordsArray = [phrase componentsSeparatedByString:@";"]; @@ -60,5 +61,41 @@ +(NSString*)generatePhrase { return [words componentsJoinedByString:@";"]; } ++(NSArray*_Nonnull)mnemonicWordsForPrefix:(NSString*_Nonnull)prefix suggestions:(NSArray*_Nullable)suggestions { + + if (prefix.length == 0) + { + return @[]; + } + + if (suggestions!=nil) { + NSMutableArray *result = [NSMutableArray array]; + + for (NSString *phrase in suggestions) { + if ([phrase hasPrefix:prefix]) { + [result addObject:phrase]; + } + } + + return [NSArray arrayWithArray:result]; + } + else{ + if (phrases == nil) { + NSString *string = [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"phrases" ofType:@"txt"] encoding:NSUTF8StringEncoding error:nil]; + phrases = [NSMutableArray arrayWithArray:[string componentsSeparatedByString:@"\n"]]; + } + + NSMutableArray *result = [NSMutableArray array]; + + for (NSString *phrase in phrases) { + if ([phrase hasPrefix:prefix]) { + [result addObject:phrase]; + } + } + + return [NSArray arrayWithArray:result]; + } +} + @end diff --git a/BeamWallet/BeamSDK/Objects/BMTransaction.h b/BeamWallet/BeamSDK/Objects/BMTransaction.h index 00f50384..ff524438 100644 --- a/BeamWallet/BeamSDK/Objects/BMTransaction.h +++ b/BeamWallet/BeamSDK/Objects/BMTransaction.h @@ -53,8 +53,10 @@ typedef UInt64 BMTransactionStatus; -(NSString*)formattedDate; -(BOOL)isFailed; -(BOOL)hasPaymentProof; +-(BOOL)isCancelled; -(NSString*)details; +-(NSString*)csvLine; @end diff --git a/BeamWallet/BeamSDK/Objects/BMTransaction.m b/BeamWallet/BeamSDK/Objects/BMTransaction.m index d72971b8..4ce5bdc6 100644 --- a/BeamWallet/BeamSDK/Objects/BMTransaction.m +++ b/BeamWallet/BeamSDK/Objects/BMTransaction.m @@ -57,7 +57,11 @@ -(NSString*)formattedDate { } -(BOOL)isFailed { - return [self.status isEqualToString:@"failed"]; + return [self.status isEqualToString:@"failed"] || [self.status isEqualToString:@"expired"]; +} + +-(BOOL)isCancelled { + return [self.status isEqualToString:@"cancelled"]; } -(BOOL)hasPaymentProof { @@ -70,9 +74,39 @@ -(NSString*)details { formatter.currencySymbol = @""; formatter.minimumFractionDigits = 0; formatter.maximumFractionDigits = 10; + formatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]; + formatter.numberStyle = NSNumberFormatterCurrencyAccountingStyle; + + NSString *number = [formatter stringFromNumber:[NSNumber numberWithDouble:_realAmount]]; + number = [number stringByReplacingOccurrencesOfString:@" " withString:@""]; + + NSString *detail = [NSString stringWithFormat:@"Sender: %@\nReceiver: %@\nAmount: %@ BEAM\nKernel ID: %@", _senderAddress, _receiverAddress, number, _kernelId]; + detail = [detail stringByReplacingOccurrencesOfString:@" " withString:@" "]; + return detail; +} + +-(NSString*)csvLine { + NSNumberFormatter *formatter = [NSNumberFormatter new]; + formatter.currencyCode = @""; + formatter.currencySymbol = @""; + formatter.minimumFractionDigits = 0; + formatter.maximumFractionDigits = 10; + formatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]; formatter.numberStyle = NSNumberFormatterCurrencyAccountingStyle; - return [NSString stringWithFormat:@"Sender: %@\nReceiver: %@\nAmount: %@\nKernel ID: %@", _senderAddress, _receiverAddress, [formatter stringFromNumber:[NSNumber numberWithDouble:_realAmount]], _kernelId]; + NSString *_type = self.isIncome ? @"Receive BEAM" : @"Send BEAM"; + NSString *_date = [self formattedDate]; + NSString *_amount = [[formatter stringFromNumber:[NSNumber numberWithDouble:_realAmount]] stringByReplacingOccurrencesOfString:@" " withString:@""]; + NSString *_status = self.status; + NSString *_sending = self.senderAddress; + NSString *_receiving = self.receiverAddress; + NSString *_fee = [[formatter stringFromNumber:[NSNumber numberWithDouble:self.fee]] stringByReplacingOccurrencesOfString:@" " withString:@""]; + NSString *_id = self.ID; + NSString *_kernel = self.kernelId; + + NSArray *array = @[_type,_date,_amount,_status,_sending,_receiving,_fee,_id,_kernel]; + + return [[array componentsJoinedByString:@","] stringByAppendingString:@"\n"]; } @end diff --git a/BeamWallet/BeamSDK/Objects/BMUTXO.h b/BeamWallet/BeamSDK/Objects/BMUTXO.h index 5e832b33..61c33628 100644 --- a/BeamWallet/BeamSDK/Objects/BMUTXO.h +++ b/BeamWallet/BeamSDK/Objects/BMUTXO.h @@ -35,5 +35,7 @@ @property (nonatomic,strong) NSString * _Nullable createTxId; @property (nonatomic,strong) NSString * _Nullable spentTxId; +-(BOOL)isActive; + @end diff --git a/BeamWallet/BeamSDK/Objects/BMUTXO.m b/BeamWallet/BeamSDK/Objects/BMUTXO.m index 1f9b3ef1..ab32255b 100644 --- a/BeamWallet/BeamSDK/Objects/BMUTXO.m +++ b/BeamWallet/BeamSDK/Objects/BMUTXO.m @@ -21,6 +21,8 @@ @implementation BMUTXO - +-(BOOL)isActive{ + return (self.status == 1 || self.status == 2); +} @end diff --git a/BeamWallet/BeamSDK/Settings.h b/BeamWallet/BeamSDK/Settings.h index 6aff5333..fd7f9b1e 100644 --- a/BeamWallet/BeamSDK/Settings.h +++ b/BeamWallet/BeamSDK/Settings.h @@ -26,6 +26,7 @@ @property (nonatomic, assign) BOOL isLocalNode; @property (nonatomic, assign) BOOL isNeedaskPasswordForSend; +@property (nonatomic, assign) BOOL isEnableBiometric; @property (nonatomic, assign) int lockScreenSeconds; //+(void)generateNewStoragePath; diff --git a/BeamWallet/BeamSDK/Settings.m b/BeamWallet/BeamSDK/Settings.m index 3cf2af86..440a594e 100644 --- a/BeamWallet/BeamSDK/Settings.m +++ b/BeamWallet/BeamSDK/Settings.m @@ -26,6 +26,7 @@ @implementation Settings static NSString *allPathsKey = @"allPaths"; static NSString *askKey = @"isNeedaskPasswordForSend"; static NSString *lockScreen = @"lockScreen"; +static NSString *biometricKey = @"biometricKey"; + (Settings*_Nonnull)sharedManager { static Settings *sharedMyManager = nil; @@ -45,7 +46,7 @@ -(id)init { _isNeedaskPasswordForSend = [[[NSUserDefaults standardUserDefaults] objectForKey:askKey] boolValue]; } else{ - _isNeedaskPasswordForSend = YES; + _isNeedaskPasswordForSend = NO; } if ([[NSUserDefaults standardUserDefaults] objectForKey:lockScreen]) { @@ -55,9 +56,23 @@ -(id)init { _lockScreenSeconds = 0; } + if ([[NSUserDefaults standardUserDefaults] objectForKey:biometricKey]) { + _isEnableBiometric = [[[NSUserDefaults standardUserDefaults] objectForKey:askKey] boolValue]; + } + else{ + _isEnableBiometric = YES; + } + return self; } +-(void)setIsEnableBiometric:(BOOL)isEnableBiometric { + _isEnableBiometric = isEnableBiometric; + + [[NSUserDefaults standardUserDefaults] setValue:[NSNumber numberWithInt:_isEnableBiometric] forKey:biometricKey]; + [[NSUserDefaults standardUserDefaults] synchronize]; +} + -(void)setLockScreenSeconds:(int)lockScreenSeconds { _lockScreenSeconds = lockScreenSeconds; @@ -108,7 +123,7 @@ -(NSString*_Nonnull)nodeAddress { return @"ap-node03.testnet.beam.mw:8100"; } else{ - return @"eu-node01.masternet.beam.mw:8100"; + return @"ap-node01.mainnet.beam.mw:8100"; } } @@ -154,7 +169,7 @@ -(NSArray*_Nonnull)localNodePeers { return @[@"us-nodes.testnet.beam.mw:8100",@"eu-nodes.testnet.beam.mw:8100",@"ap-nodes.testnet.beam.mw:8100"]; } else{ - return @[@"eu-node01.masternet.beam.mw:8100",@"eu-node02.masternet.beam.mw:8100",@"eu-node03.masternet.beam.mw:8100",@"eu-node04.masternet.beam.mw:8100"]; + return @[@"ap-nodes.mainnet.beam.mw:8100",@"eu-nodes.mainnet.beam.mw:8100",@"us-nodes.mainnet.beam.mw:8100"]; } } diff --git a/BeamWallet/BeamSDK/WalletModel.h b/BeamWallet/BeamSDK/WalletModel.h index e94ad658..a72cc9a5 100644 --- a/BeamWallet/BeamSDK/WalletModel.h +++ b/BeamWallet/BeamSDK/WalletModel.h @@ -33,7 +33,7 @@ class WalletModel : public WalletClient private: NSString *GetErrorString(beam::wallet::ErrorType type); - NSString *GetTransactionStatusString(beam::TxStatus status, bool income, bool self); + NSString *GetTransactionStatusString(beam::TxDescription transaction); NSString *GetTransactionFailurString(beam::TxFailureReason reason); NSString *GetUTXOStatusString(beam::Coin coin); NSString *GetUTXOTypeString(beam::Coin coin); diff --git a/BeamWallet/BeamSDK/WalletModel.mm b/BeamWallet/BeamSDK/WalletModel.mm index d1e5c0de..1b8026a8 100644 --- a/BeamWallet/BeamSDK/WalletModel.mm +++ b/BeamWallet/BeamSDK/WalletModel.mm @@ -47,7 +47,7 @@ void WalletModel::onStatus(const WalletStatus& status) { - NSLog(@"onStatus"); + // NSLog(@"onStatus"); BMWalletStatus *walletStatus = [[BMWalletStatus alloc] init]; walletStatus.available = status.available; @@ -84,7 +84,7 @@ transaction.realAmount = double(int64_t(item.m_amount)) / Rules::Coin; transaction.createdTime = item.m_createTime; transaction.isIncome = (item.m_sender == false); - transaction.status = GetTransactionStatusString(item.m_status,transaction.isIncome, item.m_selfTx); + transaction.status = GetTransactionStatusString(item); transaction.enumStatus = (UInt64)item.m_status; if (item.m_failureReason != TxFailureReason::Unknown) { @@ -103,7 +103,6 @@ transaction.canDelete = item.canDelete(); transaction.comment = [NSString stringWithUTF8String:comment.c_str()]; - if (item.m_sender) { transaction.senderAddress = [NSString stringWithUTF8String:to_string(item.m_myId).c_str()]; } @@ -118,8 +117,7 @@ transaction.receiverAddress = [NSString stringWithUTF8String:to_string(item.m_myId).c_str()]; } - - [transactions addObject:transaction]; + [transactions addObject:transaction]; } switch (action) { @@ -200,7 +198,12 @@ if ([delegate respondsToSelector:@selector(onSyncProgressUpdated: total:)]) { [delegate onSyncProgressUpdated:done total:total]; } - } + } + + if (done == total) + { + [[AppModel sharedManager] onSyncWithLocalNodeCompleted]; + } } void WalletModel::onChangeCalculated(beam::Amount change) @@ -210,7 +213,7 @@ void WalletModel::onAllUtxoChanged(const std::vector& utxos) { - NSLog(@"onAllUtxoChanged"); + // NSLog(@"onAllUtxoChanged"); NSMutableArray *bmUtxos = [[NSMutableArray alloc] init]; @@ -254,9 +257,9 @@ [delegate onReceivedUTXOs:[[AppModel sharedManager]utxos]]; } } - - [bmUtxos removeAllObjects]; - bmUtxos = nil; +// +// [bmUtxos removeAllObjects]; +// bmUtxos = nil; } void WalletModel::onAddresses(bool own, const std::vector& addrs) @@ -458,27 +461,35 @@ } } -NSString* WalletModel::GetTransactionStatusString(TxStatus status, bool income, bool self) +NSString* WalletModel::GetTransactionStatusString(TxDescription transaction) { - switch (status) + bool isIncome = (transaction.m_sender == false); + + switch (transaction.m_status) { case TxStatus::Pending: return @"pending"; case TxStatus::InProgress: - return income ? @"waiting for sender" : @"waiting for receiver"; + return isIncome ? @"waiting for sender" : @"waiting for receiver"; case TxStatus::Registering: - return income ? @"receiving" : @"sending"; + return isIncome ? @"receiving" : @"sending"; case TxStatus::Completed: { - if (self) + if (transaction.m_selfTx) { return @"completed"; } - return income ? @"received" : @"sent"; + return isIncome ? @"received" : @"sent"; } case TxStatus::Cancelled: return @"cancelled"; case TxStatus::Failed: + { + if (transaction.m_failureReason == TxFailureReason::TransactionExpired) + { + return @"expired"; + } + } return @"failed"; default: break; diff --git a/BeamWallet/BeamSDK/phrases.txt b/BeamWallet/BeamSDK/phrases.txt new file mode 100644 index 00000000..942040ed --- /dev/null +++ b/BeamWallet/BeamSDK/phrases.txt @@ -0,0 +1,2048 @@ +abandon +ability +able +about +above +absent +absorb +abstract +absurd +abuse +access +accident +account +accuse +achieve +acid +acoustic +acquire +across +act +action +actor +actress +actual +adapt +add +addict +address +adjust +admit +adult +advance +advice +aerobic +affair +afford +afraid +again +age +agent +agree +ahead +aim +air +airport +aisle +alarm +album +alcohol +alert +alien +all +alley +allow +almost +alone +alpha +already +also +alter +always +amateur +amazing +among +amount +amused +analyst +anchor +ancient +anger +angle +angry +animal +ankle +announce +annual +another +answer +antenna +antique +anxiety +any +apart +apology +appear +apple +approve +april +arch +arctic +area +arena +argue +arm +armed +armor +army +around +arrange +arrest +arrive +arrow +art +artefact +artist +artwork +ask +aspect +assault +asset +assist +assume +asthma +athlete +atom +attack +attend +attitude +attract +auction +audit +august +aunt +author +auto +autumn +average +avocado +avoid +awake +aware +away +awesome +awful +awkward +axis +baby +bachelor +bacon +badge +bag +balance +balcony +ball +bamboo +banana +banner +bar +barely +bargain +barrel +base +basic +basket +battle +beach +bean +beauty +because +become +beef +before +begin +behave +behind +believe +below +belt +bench +benefit +best +betray +better +between +beyond +bicycle +bid +bike +bind +biology +bird +birth +bitter +black +blade +blame +blanket +blast +bleak +bless +blind +blood +blossom +blouse +blue +blur +blush +board +boat +body +boil +bomb +bone +bonus +book +boost +border +boring +borrow +boss +bottom +bounce +box +boy +bracket +brain +brand +brass +brave +bread +breeze +brick +bridge +brief +bright +bring +brisk +broccoli +broken +bronze +broom +brother +brown +brush +bubble +buddy +budget +buffalo +build +bulb +bulk +bullet +bundle +bunker +burden +burger +burst +bus +business +busy +butter +buyer +buzz +cabbage +cabin +cable +cactus +cage +cake +call +calm +camera +camp +can +canal +cancel +candy +cannon +canoe +canvas +canyon +capable +capital +captain +car +carbon +card +cargo +carpet +carry +cart +case +cash +casino +castle +casual +cat +catalog +catch +category +cattle +caught +cause +caution +cave +ceiling +celery +cement +census +century +cereal +certain +chair +chalk +champion +change +chaos +chapter +charge +chase +chat +cheap +check +cheese +chef +cherry +chest +chicken +chief +child +chimney +choice +choose +chronic +chuckle +chunk +churn +cigar +cinnamon +circle +citizen +city +civil +claim +clap +clarify +claw +clay +clean +clerk +clever +click +client +cliff +climb +clinic +clip +clock +clog +close +cloth +cloud +clown +club +clump +cluster +clutch +coach +coast +coconut +code +coffee +coil +coin +collect +color +column +combine +come +comfort +comic +common +company +concert +conduct +confirm +congress +connect +consider +control +convince +cook +cool +copper +copy +coral +core +corn +correct +cost +cotton +couch +country +couple +course +cousin +cover +coyote +crack +cradle +craft +cram +crane +crash +crater +crawl +crazy +cream +credit +creek +crew +cricket +crime +crisp +critic +crop +cross +crouch +crowd +crucial +cruel +cruise +crumble +crunch +crush +cry +crystal +cube +culture +cup +cupboard +curious +current +curtain +curve +cushion +custom +cute +cycle +dad +damage +damp +dance +danger +daring +dash +daughter +dawn +day +deal +debate +debris +decade +december +decide +decline +decorate +decrease +deer +defense +define +defy +degree +delay +deliver +demand +demise +denial +dentist +deny +depart +depend +deposit +depth +deputy +derive +describe +desert +design +desk +despair +destroy +detail +detect +develop +device +devote +diagram +dial +diamond +diary +dice +diesel +diet +differ +digital +dignity +dilemma +dinner +dinosaur +direct +dirt +disagree +discover +disease +dish +dismiss +disorder +display +distance +divert +divide +divorce +dizzy +doctor +document +dog +doll +dolphin +domain +donate +donkey +donor +door +dose +double +dove +draft +dragon +drama +drastic +draw +dream +dress +drift +drill +drink +drip +drive +drop +drum +dry +duck +dumb +dune +during +dust +dutch +duty +dwarf +dynamic +eager +eagle +early +earn +earth +easily +east +easy +echo +ecology +economy +edge +edit +educate +effort +egg +eight +either +elbow +elder +electric +elegant +element +elephant +elevator +elite +else +embark +embody +embrace +emerge +emotion +employ +empower +empty +enable +enact +end +endless +endorse +enemy +energy +enforce +engage +engine +enhance +enjoy +enlist +enough +enrich +enroll +ensure +enter +entire +entry +envelope +episode +equal +equip +era +erase +erode +erosion +error +erupt +escape +essay +essence +estate +eternal +ethics +evidence +evil +evoke +evolve +exact +example +excess +exchange +excite +exclude +excuse +execute +exercise +exhaust +exhibit +exile +exist +exit +exotic +expand +expect +expire +explain +expose +express +extend +extra +eye +eyebrow +fabric +face +faculty +fade +faint +faith +fall +false +fame +family +famous +fan +fancy +fantasy +farm +fashion +fat +fatal +father +fatigue +fault +favorite +feature +february +federal +fee +feed +feel +female +fence +festival +fetch +fever +few +fiber +fiction +field +figure +file +film +filter +final +find +fine +finger +finish +fire +firm +first +fiscal +fish +fit +fitness +fix +flag +flame +flash +flat +flavor +flee +flight +flip +float +flock +floor +flower +fluid +flush +fly +foam +focus +fog +foil +fold +follow +food +foot +force +forest +forget +fork +fortune +forum +forward +fossil +foster +found +fox +fragile +frame +frequent +fresh +friend +fringe +frog +front +frost +frown +frozen +fruit +fuel +fun +funny +furnace +fury +future +gadget +gain +galaxy +gallery +game +gap +garage +garbage +garden +garlic +garment +gas +gasp +gate +gather +gauge +gaze +general +genius +genre +gentle +genuine +gesture +ghost +giant +gift +giggle +ginger +giraffe +girl +give +glad +glance +glare +glass +glide +glimpse +globe +gloom +glory +glove +glow +glue +goat +goddess +gold +good +goose +gorilla +gospel +gossip +govern +gown +grab +grace +grain +grant +grape +grass +gravity +great +green +grid +grief +grit +grocery +group +grow +grunt +guard +guess +guide +guilt +guitar +gun +gym +habit +hair +half +hammer +hamster +hand +happy +harbor +hard +harsh +harvest +hat +have +hawk +hazard +head +health +heart +heavy +hedgehog +height +hello +helmet +help +hen +hero +hidden +high +hill +hint +hip +hire +history +hobby +hockey +hold +hole +holiday +hollow +home +honey +hood +hope +horn +horror +horse +hospital +host +hotel +hour +hover +hub +huge +human +humble +humor +hundred +hungry +hunt +hurdle +hurry +hurt +husband +hybrid +ice +icon +idea +identify +idle +ignore +ill +illegal +illness +image +imitate +immense +immune +impact +impose +improve +impulse +inch +include +income +increase +index +indicate +indoor +industry +infant +inflict +inform +inhale +inherit +initial +inject +injury +inmate +inner +innocent +input +inquiry +insane +insect +inside +inspire +install +intact +interest +into +invest +invite +involve +iron +island +isolate +issue +item +ivory +jacket +jaguar +jar +jazz +jealous +jeans +jelly +jewel +job +join +joke +journey +joy +judge +juice +jump +jungle +junior +junk +just +kangaroo +keen +keep +ketchup +key +kick +kid +kidney +kind +kingdom +kiss +kit +kitchen +kite +kitten +kiwi +knee +knife +knock +know +lab +label +labor +ladder +lady +lake +lamp +language +laptop +large +later +latin +laugh +laundry +lava +law +lawn +lawsuit +layer +lazy +leader +leaf +learn +leave +lecture +left +leg +legal +legend +leisure +lemon +lend +length +lens +leopard +lesson +letter +level +liar +liberty +library +license +life +lift +light +like +limb +limit +link +lion +liquid +list +little +live +lizard +load +loan +lobster +local +lock +logic +lonely +long +loop +lottery +loud +lounge +love +loyal +lucky +luggage +lumber +lunar +lunch +luxury +lyrics +machine +mad +magic +magnet +maid +mail +main +major +make +mammal +man +manage +mandate +mango +mansion +manual +maple +marble +march +margin +marine +market +marriage +mask +mass +master +match +material +math +matrix +matter +maximum +maze +meadow +mean +measure +meat +mechanic +medal +media +melody +melt +member +memory +mention +menu +mercy +merge +merit +merry +mesh +message +metal +method +middle +midnight +milk +million +mimic +mind +minimum +minor +minute +miracle +mirror +misery +miss +mistake +mix +mixed +mixture +mobile +model +modify +mom +moment +monitor +monkey +monster +month +moon +moral +more +morning +mosquito +mother +motion +motor +mountain +mouse +move +movie +much +muffin +mule +multiply +muscle +museum +mushroom +music +must +mutual +myself +mystery +myth +naive +name +napkin +narrow +nasty +nation +nature +near +neck +need +negative +neglect +neither +nephew +nerve +nest +net +network +neutral +never +news +next +nice +night +noble +noise +nominee +noodle +normal +north +nose +notable +note +nothing +notice +novel +now +nuclear +number +nurse +nut +oak +obey +object +oblige +obscure +observe +obtain +obvious +occur +ocean +october +odor +off +offer +office +often +oil +okay +old +olive +olympic +omit +once +one +onion +online +only +open +opera +opinion +oppose +option +orange +orbit +orchard +order +ordinary +organ +orient +original +orphan +ostrich +other +outdoor +outer +output +outside +oval +oven +over +own +owner +oxygen +oyster +ozone +pact +paddle +page +pair +palace +palm +panda +panel +panic +panther +paper +parade +parent +park +parrot +party +pass +patch +path +patient +patrol +pattern +pause +pave +payment +peace +peanut +pear +peasant +pelican +pen +penalty +pencil +people +pepper +perfect +permit +person +pet +phone +photo +phrase +physical +piano +picnic +picture +piece +pig +pigeon +pill +pilot +pink +pioneer +pipe +pistol +pitch +pizza +place +planet +plastic +plate +play +please +pledge +pluck +plug +plunge +poem +poet +point +polar +pole +police +pond +pony +pool +popular +portion +position +possible +post +potato +pottery +poverty +powder +power +practice +praise +predict +prefer +prepare +present +pretty +prevent +price +pride +primary +print +priority +prison +private +prize +problem +process +produce +profit +program +project +promote +proof +property +prosper +protect +proud +provide +public +pudding +pull +pulp +pulse +pumpkin +punch +pupil +puppy +purchase +purity +purpose +purse +push +put +puzzle +pyramid +quality +quantum +quarter +question +quick +quit +quiz +quote +rabbit +raccoon +race +rack +radar +radio +rail +rain +raise +rally +ramp +ranch +random +range +rapid +rare +rate +rather +raven +raw +razor +ready +real +reason +rebel +rebuild +recall +receive +recipe +record +recycle +reduce +reflect +reform +refuse +region +regret +regular +reject +relax +release +relief +rely +remain +remember +remind +remove +render +renew +rent +reopen +repair +repeat +replace +report +require +rescue +resemble +resist +resource +response +result +retire +retreat +return +reunion +reveal +review +reward +rhythm +rib +ribbon +rice +rich +ride +ridge +rifle +right +rigid +ring +riot +ripple +risk +ritual +rival +river +road +roast +robot +robust +rocket +romance +roof +rookie +room +rose +rotate +rough +round +route +royal +rubber +rude +rug +rule +run +runway +rural +sad +saddle +sadness +safe +sail +salad +salmon +salon +salt +salute +same +sample +sand +satisfy +satoshi +sauce +sausage +save +say +scale +scan +scare +scatter +scene +scheme +school +science +scissors +scorpion +scout +scrap +screen +script +scrub +sea +search +season +seat +second +secret +section +security +seed +seek +segment +select +sell +seminar +senior +sense +sentence +series +service +session +settle +setup +seven +shadow +shaft +shallow +share +shed +shell +sheriff +shield +shift +shine +ship +shiver +shock +shoe +shoot +shop +short +shoulder +shove +shrimp +shrug +shuffle +shy +sibling +sick +side +siege +sight +sign +silent +silk +silly +silver +similar +simple +since +sing +siren +sister +situate +six +size +skate +sketch +ski +skill +skin +skirt +skull +slab +slam +sleep +slender +slice +slide +slight +slim +slogan +slot +slow +slush +small +smart +smile +smoke +smooth +snack +snake +snap +sniff +snow +soap +soccer +social +sock +soda +soft +solar +soldier +solid +solution +solve +someone +song +soon +sorry +sort +soul +sound +soup +source +south +space +spare +spatial +spawn +speak +special +speed +spell +spend +sphere +spice +spider +spike +spin +spirit +split +spoil +sponsor +spoon +sport +spot +spray +spread +spring +spy +square +squeeze +squirrel +stable +stadium +staff +stage +stairs +stamp +stand +start +state +stay +steak +steel +stem +step +stereo +stick +still +sting +stock +stomach +stone +stool +story +stove +strategy +street +strike +strong +struggle +student +stuff +stumble +style +subject +submit +subway +success +such +sudden +suffer +sugar +suggest +suit +summer +sun +sunny +sunset +super +supply +supreme +sure +surface +surge +surprise +surround +survey +suspect +sustain +swallow +swamp +swap +swarm +swear +sweet +swift +swim +swing +switch +sword +symbol +symptom +syrup +system +table +tackle +tag +tail +talent +talk +tank +tape +target +task +taste +tattoo +taxi +teach +team +tell +ten +tenant +tennis +tent +term +test +text +thank +that +theme +then +theory +there +they +thing +this +thought +three +thrive +throw +thumb +thunder +ticket +tide +tiger +tilt +timber +time +tiny +tip +tired +tissue +title +toast +tobacco +today +toddler +toe +together +toilet +token +tomato +tomorrow +tone +tongue +tonight +tool +tooth +top +topic +topple +torch +tornado +tortoise +toss +total +tourist +toward +tower +town +toy +track +trade +traffic +tragic +train +transfer +trap +trash +travel +tray +treat +tree +trend +trial +tribe +trick +trigger +trim +trip +trophy +trouble +truck +true +truly +trumpet +trust +truth +try +tube +tuition +tumble +tuna +tunnel +turkey +turn +turtle +twelve +twenty +twice +twin +twist +two +type +typical +ugly +umbrella +unable +unaware +uncle +uncover +under +undo +unfair +unfold +unhappy +uniform +unique +unit +universe +unknown +unlock +until +unusual +unveil +update +upgrade +uphold +upon +upper +upset +urban +urge +usage +use +used +useful +useless +usual +utility +vacant +vacuum +vague +valid +valley +valve +van +vanish +vapor +various +vast +vault +vehicle +velvet +vendor +venture +venue +verb +verify +version +very +vessel +veteran +viable +vibrant +vicious +victory +video +view +village +vintage +violin +virtual +virus +visa +visit +visual +vital +vivid +vocal +voice +void +volcano +volume +vote +voyage +wage +wagon +wait +walk +wall +walnut +want +warfare +warm +warrior +wash +wasp +waste +water +wave +way +wealth +weapon +wear +weasel +weather +web +wedding +weekend +weird +welcome +west +wet +whale +what +wheat +wheel +when +where +whip +whisper +wide +width +wife +wild +will +win +window +wine +wing +wink +winner +winter +wire +wisdom +wise +wish +witness +wolf +woman +wonder +wood +wool +word +work +world +worry +worth +wrap +wreck +wrestle +wrist +write +wrong +yard +year +yellow +you +young +youth +zebra +zero +zone +zoo diff --git a/BeamWallet/Controls/AutoSecurityScreen.swift b/BeamWallet/Controls/AutoSecurityScreen.swift index 2a331c0c..4c1ee072 100755 --- a/BeamWallet/Controls/AutoSecurityScreen.swift +++ b/BeamWallet/Controls/AutoSecurityScreen.swift @@ -43,7 +43,10 @@ public class AutoSecurityScreen { } @objc private func addBlur() { - createBlurEffect() + if UIApplication.getTopMostViewController() is DisplayPhraseViewController + || UIApplication.getTopMostViewController() is InputPhraseViewController { + createBlurEffect() + } } @objc private func remoteBlur() { diff --git a/BeamWallet/Controls/BMCopyLabel.swift b/BeamWallet/Controls/BMCopyLabel.swift index dc651bed..bfa7ea11 100644 --- a/BeamWallet/Controls/BMCopyLabel.swift +++ b/BeamWallet/Controls/BMCopyLabel.swift @@ -21,6 +21,8 @@ import UIKit class BMCopyLabel: UILabel { + public var copyText:String? + override public var canBecomeFirstResponder: Bool { get { return true @@ -46,7 +48,13 @@ class BMCopyLabel: UILabel { } override func copy(_ sender: Any?) { - UIPasteboard.general.string = text + if let copy = copyText { + UIPasteboard.general.string = copy + } + else{ + UIPasteboard.general.string = text + } + UIMenuController.shared.setMenuVisible(false, animated: true) SVProgressHUD.showSuccess(withStatus: "copied to clipboard") diff --git a/BeamWallet/Controls/BMField.swift b/BeamWallet/Controls/BMField.swift index cd807092..2825bc76 100644 --- a/BeamWallet/Controls/BMField.swift +++ b/BeamWallet/Controls/BMField.swift @@ -33,7 +33,8 @@ class BMField: UITextField { private var _lineColor:UIColor? private var _lineHeight:CGFloat = 2 private var _error:String? - + private var _oldColor:UIColor? + var status: Status? { didSet { switch status { @@ -42,7 +43,7 @@ class BMField: UITextField { self.line.backgroundColor = UIColor.main.red self.errorLabel?.isHidden = false case .normal?: - self.textColor = UIColor.white + self.textColor = _oldColor self.line.backgroundColor = lineColor self.errorLabel?.isHidden = true case .none: @@ -88,6 +89,8 @@ class BMField: UITextField { override func awakeFromNib() { super.awakeFromNib() + _oldColor = self.textColor + if lineColor == nil { line.backgroundColor = AppDelegate.CurrentTarget == .Test ? UIColor.main.marineTwo : UIColor.main.darkSlateBlue lineColor = AppDelegate.CurrentTarget == .Test ? UIColor.main.marineTwo : UIColor.main.darkSlateBlue diff --git a/BeamWallet/Controls/BMInputCopyBar.swift b/BeamWallet/Controls/BMInputCopyBar.swift index 6cd935e8..ca1ce3e9 100644 --- a/BeamWallet/Controls/BMInputCopyBar.swift +++ b/BeamWallet/Controls/BMInputCopyBar.swift @@ -1,6 +1,6 @@ // -// BMInputCopyBar.swift -// BeamWallet +// BMInputCopyBar.swift +// BeamWallet // // Copyright 2018 Beam Development // @@ -26,9 +26,19 @@ class BMInputCopyBar: UIView { init(frame: CGRect, copy:String) { super.init(frame: frame) - let toolBar = UIView(frame: CGRect(x: 0, y: 0, width: frame.size.width, height: 44)) - toolBar.backgroundColor = UIColor(red: 186/255, green: 191/255, blue: 196/255, alpha: 1) - addSubview(toolBar) + let view = UIView(frame: CGRect(x: 0, y: 0, width: frame.size.width, height: 44)) + view.backgroundColor = UIColor.clear + addSubview(view) + + let toolbar = UIToolbar(frame: view.bounds) + toolbar.autoresizingMask = .flexibleWidth; + toolbar.isUserInteractionEnabled = false; + view.addSubview(toolbar) + + let separator = UIView(frame: CGRect(x:0, y:43.5, width:view.frame.size.width, height:0.5)) + separator.autoresizingMask = .flexibleWidth; + separator.backgroundColor = UIColor.init(white: 0, alpha: 0.2) + view.addSubview(separator) let label = UIButton(frame: CGRect(x: 50, y: 5, width: frame.size.width-100, height: 34)) label.layer.cornerRadius = 6 @@ -39,7 +49,7 @@ class BMInputCopyBar: UIView { label.setTitle(copy, for: .normal) label.titleEdgeInsets = UIEdgeInsets(top: 0, left: 6, bottom: 0, right: 6) label.addTarget(self, action: #selector(onCopy), for: .touchUpInside) - toolBar.addSubview(label) + view.addSubview(label) } required init?(coder aDecoder: NSCoder) { diff --git a/BeamWallet/Controls/BMNetworkStatusView.swift b/BeamWallet/Controls/BMNetworkStatusView.swift index 20ca3adf..5b0e22d0 100644 --- a/BeamWallet/Controls/BMNetworkStatusView.swift +++ b/BeamWallet/Controls/BMNetworkStatusView.swift @@ -41,13 +41,12 @@ class BMNetworkStatusView: UIView { indicatorView.hidesWhenStopped = true addSubview(indicatorView) + onNetwotkStatusChange(AppModel.sharedManager().isConnected) + if (AppModel.sharedManager().isUpdating && AppModel.sharedManager().isConnected) { onSyncProgressUpdated(0, total: 1) } - else{ - onNetwotkStatusChange(AppModel.sharedManager().isConnected) - } AppModel.sharedManager().addDelegate(self) } @@ -68,12 +67,22 @@ extension BMNetworkStatusView: WalletModelDelegate { if connected { self.statusView.backgroundColor = UIColor.main.green - self.statusLabel.text = "online (testnet)" + if AppDelegate.CurrentTarget == .Main { + self.statusLabel.text = "online" + } + else{ + self.statusLabel.text = "online (testnet)" + } self.statusLabel.textColor = UIColor.main.blueyGrey } else{ self.statusView.backgroundColor = UIColor.main.red - self.statusLabel.text = "offline (testnet)" + if AppDelegate.CurrentTarget == .Main { + self.statusLabel.text = "offline" + } + else{ + self.statusLabel.text = "offline (testnet)" + } self.statusLabel.textColor = UIColor.main.red } } @@ -89,6 +98,7 @@ extension BMNetworkStatusView: WalletModelDelegate { self.statusLabel.x = 20 self.statusLabel.text = "updating" self.statusView.alpha = 0 + self.statusLabel.textColor = UIColor.main.blueyGrey } else { self.indicatorView.stopAnimating() diff --git a/BeamWallet/Controls/BMTextView.swift b/BeamWallet/Controls/BMTextView.swift index 7d28bdae..e7a5dafd 100644 --- a/BeamWallet/Controls/BMTextView.swift +++ b/BeamWallet/Controls/BMTextView.swift @@ -68,7 +68,12 @@ class BMTextView: UITextView { override func layoutSubviews() { super.layoutSubviews() - line.frame = CGRect(x: 0, y: self.frame.size.height-lineHeight, width: self.frame.size.width, height: lineHeight) + if self.frame.size.height <= 42 { + line.frame = CGRect(x: 0, y: self.frame.size.height - lineHeight - 12, width: self.frame.size.width, height: lineHeight) + } + else{ + line.frame = CGRect(x: 0, y: self.frame.size.height - lineHeight - 4, width: self.frame.size.width, height: lineHeight) + } } } diff --git a/BeamWallet/Controls/BMWordField.swift b/BeamWallet/Controls/BMWordField.swift index 8ad471f5..31558457 100644 --- a/BeamWallet/Controls/BMWordField.swift +++ b/BeamWallet/Controls/BMWordField.swift @@ -28,9 +28,16 @@ class BMWordField: BMField { case empty } + private var maxWords = 3 + + private var accessoryView = UIView() + private var accessoryOptions = [UIButton]() + private let errorColor = UIColor.main.red private let normalColor = AppDelegate.CurrentTarget == .Test ? UIColor.main.marineTwo : UIColor.main.darkSlateBlue - + + var suggestions: [String]? + var fState: FieldState! = .none { didSet { switch fState { @@ -51,4 +58,150 @@ class BMWordField: BMField { } } } + + override init(frame: CGRect) { + super.init(frame: frame) + setupSuggestionsView() + } + + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + setupSuggestionsView() + } + + private func setupSuggestionsView() { + accessoryView = UIView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 44)) + + let toolbar = UIToolbar(frame: accessoryView.bounds) + toolbar.autoresizingMask = .flexibleWidth; + toolbar.isUserInteractionEnabled = false; + accessoryView.addSubview(toolbar) + + let width_3 = toolbar.frame.size.width / CGFloat(maxWords) + + for i in 0...maxWords-1 { + let button = UIButton(type: .custom) + button.frame = CGRect(x: CGFloat(i) * width_3, y: 0, width: width_3, height: 44) + button.setTitleColor(UIColor.init(white: 0.3, alpha: 1), for: .normal) + button.setTitleColor(UIColor.init(white: 0.3, alpha: 0.3), for: .highlighted) + button.addTarget(self, action: #selector(onSuggestion), for: .touchUpInside) + accessoryView.addSubview(button) + accessoryOptions.append(button) + } + + let separator = UIView(frame: CGRect(x:0, y:43.5, width:accessoryView.frame.size.width, height:0.5)) + separator.autoresizingMask = .flexibleWidth; + separator.backgroundColor = UIColor.init(white: 0, alpha: 0.2) + accessoryView.addSubview(separator) + + if AppDelegate.enableNewFeatures { + self.addTarget(self, action: #selector(didBeginEditing), for: UIControl.Event.editingDidBegin) + self.addTarget(self, action: #selector(editingChanged), for: UIControl.Event.editingChanged) + } + } + + @objc private func onSuggestion(sender:UIButton) { + if sender.currentAttributedTitle?.string.lengthOfBytes(using: .utf8) == 0 { + return + } + + self.text = sender.currentAttributedTitle?.string + + _ = self.delegate?.textFieldShouldReturn!(self) + } + + @objc private func didBeginEditing() { + if let txt = text { + updateAccessoryViewPrefix(prefix: txt) + } + } + + @objc private func editingChanged() { + if let txt = text { + updateAccessoryViewPrefix(prefix: txt) + } + } + + private func updateAccessoryViewPrefix(prefix:String) { + var words = MnemonicModel.mnemonicWords(forPrefix: prefix, suggestions: suggestions) as [String] + +// if words.count == 1 { +// self.text = words[0] +// +// _ = self.delegate?.textFieldShouldReturn!(self) +// } + + for btn in accessoryOptions { + btn.setAttributedTitle(nil, for: .normal) + } + + if words.count > 0 { + var recommendFirstWord = (words.count == 1) + + if !recommendFirstWord && words.count != 0 && words[0].hasPrefix(prefix) { + + var hasPrefix = false; + + for i in 1...words.count-1 { + if words[i].hasPrefix(prefix) { + hasPrefix = true; + break + } + } + + if !hasPrefix { + recommendFirstWord = true; + } + } + + + for i in 0...words.count-1 { + if i >= maxWords { + break + } + + let button = accessoryOptions [i] + + let word = words[i] + + if word == prefix { + recommendFirstWord = true + } + + let attributedTitle = NSMutableAttributedString(string: word) + let range = (word as NSString).range(of: String(prefix)) + + if range.location == 0 && range.length > 0 { + attributedTitle.addAttribute(NSAttributedString.Key.font, value: UIFont(name: "SFProDisplay-Bold", size: 15) ?? UIFont.boldSystemFont(ofSize: 15) , range: range) + } + + if range.length < word.lengthOfBytes(using: .utf8) { + attributedTitle.addAttribute(NSAttributedString.Key.font, value: UIFont(name: "SFProDisplay-Regular", size: 15) ?? UIFont.systemFont(ofSize: 15) , range: NSRange(location: range.length, length: word.lengthOfBytes(using: .utf8) - range.length)) + } + else{ + attributedTitle.addAttribute(NSAttributedString.Key.font, value: UIFont(name: "SFProDisplay-Regular", size: 15) ?? UIFont.systemFont(ofSize: 15) , range: NSRange(location: 0, length: word.lengthOfBytes(using: .utf8))) + } + + button.setAttributedTitle(attributedTitle, for: .normal) + } + + if recommendFirstWord { + let button = accessoryOptions[0]; + button.layer.removeAllAnimations() + + let animate = CABasicAnimation(keyPath: "backgroundColor") + animate.fromValue = UIColor.black.cgColor + animate.toValue = UIColor.clear.cgColor + animate.duration = 1.0; + + button.layer.add(animate, forKey: "recommend") + } + + self.inputAccessoryView = accessoryView + self.reloadInputViews() + } + else{ + self.inputAccessoryView = nil + } + } } diff --git a/BeamWallet/Controls/BMWordSuggestionView.swift b/BeamWallet/Controls/BMWordSuggestionView.swift new file mode 100644 index 00000000..ce3a2976 --- /dev/null +++ b/BeamWallet/Controls/BMWordSuggestionView.swift @@ -0,0 +1,24 @@ +// +// BMWordSuggestionView.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 Foundation + +class BMWordSuggestionView: UIView { + +} diff --git a/BeamWallet/Extensions/Double.swift b/BeamWallet/Extensions/Double.swift index b221ab4c..f5911916 100644 --- a/BeamWallet/Extensions/Double.swift +++ b/BeamWallet/Extensions/Double.swift @@ -19,6 +19,14 @@ import Foundation +extension Double { + /// Rounds the double to decimal places value + func rounded(toPlaces places:Int) -> Double { + let divisor = pow(10.0, Double(places)) + return (self * divisor).rounded() / divisor + } +} + extension Double { func asTime(style: DateComponentsFormatter.UnitsStyle) -> String { let formatter = DateComponentsFormatter() diff --git a/BeamWallet/Extensions/String.swift b/BeamWallet/Extensions/String.swift index fa71f393..761cfdf6 100644 --- a/BeamWallet/Extensions/String.swift +++ b/BeamWallet/Extensions/String.swift @@ -27,6 +27,8 @@ extension String { formatter.minimumFractionDigits = 0 formatter.maximumFractionDigits = 10 formatter.numberStyle = .currencyAccounting + formatter.locale = Locale(identifier: "en_US") + return formatter }() diff --git a/BeamWallet/Extensions/TableView.swift b/BeamWallet/Extensions/TableView.swift index 4d606f74..325d05f0 100644 --- a/BeamWallet/Extensions/TableView.swift +++ b/BeamWallet/Extensions/TableView.swift @@ -56,6 +56,11 @@ extension UITableView { } public func stopRefreshing() { + if let control = self.refreshControl { + if !control.isRefreshing { + return + } + } DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) { if let control = self.refreshControl { diff --git a/BeamWallet/Manager/BiometricAuthorization.swift b/BeamWallet/Manager/BiometricAuthorization.swift new file mode 100644 index 00000000..c326fda9 --- /dev/null +++ b/BeamWallet/Manager/BiometricAuthorization.swift @@ -0,0 +1,83 @@ +// +// BiometricAuthorization.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 Foundation +import LocalAuthentication + +public typealias AuthorizationSuccess = (() -> ()) + +public typealias AuthorizationFailure = (() -> ()) + +class BiometricAuthorization: NSObject { + + public static let shared = BiometricAuthorization() + + public func canAuthenticate() -> Bool { + + var isBiometricAuthenticationAvailable = false + var error: NSError? = nil + + if LAContext().canEvaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, error: &error) { + isBiometricAuthenticationAvailable = (error == nil) + } + return isBiometricAuthenticationAvailable + } + + public func faceIDAvailable() -> Bool { + + if #available(iOS 11.0, *) { + let context = LAContext() + return (context.canEvaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, error: nil) && context.biometryType == .faceID) + } + return false + } + + public func touchIDAvailable() -> Bool { + + let context = LAContext() + var error: NSError? + + let canEvaluate = context.canEvaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, error: &error) + if #available(iOS 11.0, *) { + return canEvaluate && context.biometryType == .touchID + } + return canEvaluate + } + + public func authenticateWithBioMetrics(success successBlock: @escaping AuthorizationSuccess, failure failureBlock: @escaping AuthorizationFailure) { + + let reason = faceIDAvailable() ? "Confirm your face to authenticate" : "Confirm your fingerprint to authenticate" + + let context = LAContext() + + context.localizedFallbackTitle = "" + context.touchIDAuthenticationAllowableReuseDuration = 60 + + context.evaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, localizedReason: reason) { (success, err) in + DispatchQueue.main.async { + if success { + successBlock() + } + else { + failureBlock() + } + } + } + } +} diff --git a/BeamWallet/Manager/NewsService.swift b/BeamWallet/Manager/NewsService.swift deleted file mode 100644 index 672b6250..00000000 --- a/BeamWallet/Manager/NewsService.swift +++ /dev/null @@ -1,60 +0,0 @@ -// -// NewsService.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 Foundation -import SwiftSoup - -class NewsService { - static func loadNews() { - let url = URL(string: "https://www.beam.mw/news")! - - //create the session object - let session = URLSession.shared - - //now create the URLRequest object using the url object - let request = URLRequest(url: url) - - //create dataTask using the session object to send data to the server - let task = session.dataTask(with: request as URLRequest, completionHandler: { data, response, error in - - guard error == nil else { - return - } - - guard let data = data else { - return - } - - do { - let html = String(data: data, encoding: String.Encoding.utf8)! - let doc: Document = try SwiftSoup.parse(html) - let link = try doc.body()?.select("news content-item") - print(try link?.text()) - print(try link?.outerHtml()) - } catch Exception.Error(let type, let message) { - print(message) - } catch { - print("error") - } - }) - - task.resume() - } -} diff --git a/BeamWallet/ViewControllers/CreateWallet/CreateWalletPasswordViewController.swift b/BeamWallet/ViewControllers/CreateWallet/CreateWalletPasswordViewController.swift index a3fe7289..8037c039 100644 --- a/BeamWallet/ViewControllers/CreateWallet/CreateWalletPasswordViewController.swift +++ b/BeamWallet/ViewControllers/CreateWallet/CreateWalletPasswordViewController.swift @@ -85,12 +85,12 @@ class CreateWalletPasswordViewController: BaseWizardViewController { else{ let alert = UIAlertController(title: "Return to seed phrase", message: "If you return to seed phrase, it would be changed and your local password won’t be saved.", preferredStyle: .alert) - let ok = UIAlertAction(title: "Return", style: .cancel, handler: { action in + let ok = UIAlertAction(title: "Return", style: .default, handler: { action in let viewControllers = self.navigationController?.viewControllers let vc = viewControllers![(viewControllers?.count)!-3] self.navigationController?.popToViewController(vc, animated: true) }) - alert.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil)) + alert.addAction(UIAlertAction(title: "Cancel", style: .default, handler: nil)) alert.addAction(ok) self.present(alert, animated: true) @@ -224,6 +224,15 @@ extension CreateWalletPasswordViewController : UITextFieldDelegate { } return true } + + func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { + + if string == " " { + return false + } + + return true + } } extension CreateWalletPasswordViewController { diff --git a/BeamWallet/ViewControllers/CreateWallet/CreateWalletProgressViewController.swift b/BeamWallet/ViewControllers/CreateWallet/CreateWalletProgressViewController.swift index a153adcc..4c6c3e84 100644 --- a/BeamWallet/ViewControllers/CreateWallet/CreateWalletProgressViewController.swift +++ b/BeamWallet/ViewControllers/CreateWallet/CreateWalletProgressViewController.swift @@ -83,6 +83,8 @@ class CreateWalletProgressViewController: BaseViewController { appModel.addDelegate(self) if !appModel.isInternetAvailable { + appModel.resetWallet(false) + self.navigationController?.popViewController(animated: true) self.alert(title: "Error", message: "No internet connection") { (_ ) in @@ -142,7 +144,7 @@ class CreateWalletProgressViewController: BaseViewController { // MARK: IBAction @IBAction func onCancel(sender :UIButton) { let appModel = AppModel.sharedManager() - appModel.resetWallet() + appModel.resetWallet(true) navigationController?.popToRootViewController(animated: true) } diff --git a/BeamWallet/ViewControllers/Login/EnterWalletPasswordViewController.swift b/BeamWallet/ViewControllers/Login/EnterWalletPasswordViewController.swift index 4ba4fa66..00d14de0 100644 --- a/BeamWallet/ViewControllers/Login/EnterWalletPasswordViewController.swift +++ b/BeamWallet/ViewControllers/Login/EnterWalletPasswordViewController.swift @@ -23,13 +23,22 @@ class EnterWalletPasswordViewController: BaseWizardViewController { @IBOutlet private weak var passField: BMField! @IBOutlet private weak var errorLabel: UILabel! + @IBOutlet private weak var touchIdButton: UIButton! + @IBOutlet private weak var passViewHeight: NSLayoutConstraint! override func viewDidLoad() { super.viewDidLoad() if Device.screenType == .iPhones_5 { mainStack?.spacing = 60 + passViewHeight.constant = 70 } + + if !BiometricAuthorization.shared.canAuthenticate() || Settings.sharedManager().isEnableBiometric == false { + touchIdButton.isHidden = true + } + + biometricAuthorization() } override func viewWillAppear(_ animated: Bool) { @@ -38,8 +47,27 @@ class EnterWalletPasswordViewController: BaseWizardViewController { AppModel.sharedManager().cancelForgotPassword() } + private func biometricAuthorization() { + if BiometricAuthorization.shared.canAuthenticate() && AppDelegate.enableNewFeatures && Settings.sharedManager().isEnableBiometric { + BiometricAuthorization.shared.authenticateWithBioMetrics(success: { + if let password = KeychainManager.getPassword() { + self.passField.text = password + self.onLogin(sender: UIButton()) + } + }) { + self.touchIdButton.tintColor = UIColor.main.red + } + } + } + //MARK: IBAction + @IBAction func onTouchId(sender :UIButton) { + touchIdButton.tintColor = UIColor.white + + biometricAuthorization() + } + @IBAction func onLogin(sender :UIButton) { AppModel.sharedManager().isRestoreFlow = false; @@ -72,7 +100,7 @@ class EnterWalletPasswordViewController: BaseWizardViewController { @IBAction func onForgotPassword(sender :UIButton) { if AppModel.sharedManager().canRestoreWallet() { let alertController = UIAlertController(title: "Forgot password", message: "Only your funds can be fully restored from the blockchain. The transaction history is stored locally and is encrypted with your password, hence it can't be restored.\n\nThat's the final version until the future validation and process.", preferredStyle: .alert) - + let NoAction = UIAlertAction(title: "Cancel", style: .default) { (action) in } alertController.addAction(NoAction) @@ -85,7 +113,7 @@ class EnterWalletPasswordViewController: BaseWizardViewController { self.pushViewController(vc: vc) } alertController.addAction(OKAction) - + self.present(alertController, animated: true, completion: nil) } else{ @@ -106,6 +134,10 @@ extension EnterWalletPasswordViewController : UITextFieldDelegate { func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { + if string == " " { + return false + } + errorLabel.text = "" return true diff --git a/BeamWallet/ViewControllers/Login/EnterWalletPasswordViewController.xib b/BeamWallet/ViewControllers/Login/EnterWalletPasswordViewController.xib index 9e43d1fa..176c4326 100644 --- a/BeamWallet/ViewControllers/Login/EnterWalletPasswordViewController.xib +++ b/BeamWallet/ViewControllers/Login/EnterWalletPasswordViewController.xib @@ -1,11 +1,11 @@ - + - + @@ -26,8 +26,10 @@ + + @@ -37,20 +39,20 @@ - + - + - + - + @@ -110,8 +112,8 @@ - - + + - + @@ -185,6 +197,7 @@ + diff --git a/BeamWallet/ViewControllers/Login/LoginViewController.swift b/BeamWallet/ViewControllers/Login/LoginViewController.swift index 87c5c70e..d562997a 100644 --- a/BeamWallet/ViewControllers/Login/LoginViewController.swift +++ b/BeamWallet/ViewControllers/Login/LoginViewController.swift @@ -52,13 +52,12 @@ class LoginViewController: BaseViewController { let vc = InputPhraseViewController() self.pushViewController(vc: vc) } - alertController.addAction(OKAction) + alertController.addAction(OKAction) self.present(alertController, animated: true, completion: nil) } else{ self.alert(title: "Not enough storage", message: "To restore the wallet on the phone should be at least 200 MB of free space") { (_ ) in - } } } diff --git a/BeamWallet/ViewControllers/Login/LoginViewController.xib b/BeamWallet/ViewControllers/Login/LoginViewController.xib index cdf421ef..73f7df20 100644 --- a/BeamWallet/ViewControllers/Login/LoginViewController.xib +++ b/BeamWallet/ViewControllers/Login/LoginViewController.xib @@ -1,11 +1,11 @@ - + - + diff --git a/BeamWallet/ViewControllers/Main/Addresses/AddressesViewController.swift b/BeamWallet/ViewControllers/Main/Addresses/AddressesViewController.swift index c99bf8ba..e665849c 100644 --- a/BeamWallet/ViewControllers/Main/Addresses/AddressesViewController.swift +++ b/BeamWallet/ViewControllers/Main/Addresses/AddressesViewController.swift @@ -46,6 +46,13 @@ class AddressesViewController: BaseViewController { filterAddresses() AppModel.sharedManager().addDelegate(self) + + NotificationCenter.default.addObserver(self, selector: #selector(didBecomeActive), name: UIApplication.didBecomeActiveNotification, object: nil) + } + + @objc private func didBecomeActive() { + filterAddresses() + tableView.reloadData() } @objc private func refreshData(_ sender: Any) { diff --git a/BeamWallet/ViewControllers/Main/Addresses/Cell/AddressSwitchCell.xib b/BeamWallet/ViewControllers/Main/Addresses/Cell/AddressSwitchCell.xib index 33c3e933..97c02338 100644 --- a/BeamWallet/ViewControllers/Main/Addresses/Cell/AddressSwitchCell.xib +++ b/BeamWallet/ViewControllers/Main/Addresses/Cell/AddressSwitchCell.xib @@ -27,7 +27,7 @@ -