├── TokenDWalletTemplate ├── Resources │ ├── Assets.xcassets │ │ ├── Contents.json │ │ ├── Menu icons │ │ │ ├── Contents.json │ │ │ ├── Send icon.imageset │ │ │ │ ├── Send icon.pdf │ │ │ │ └── Contents.json │ │ │ ├── Trade icon.imageset │ │ │ │ ├── Trade icon.pdf │ │ │ │ └── Contents.json │ │ │ ├── Wallet icon.imageset │ │ │ │ ├── Wallet icon.pdf │ │ │ │ └── Contents.json │ │ │ ├── Deposit icon.imageset │ │ │ │ ├── Deposit icon.pdf │ │ │ │ └── Contents.json │ │ │ ├── Settings icon.imageset │ │ │ │ ├── Settings icon.pdf │ │ │ │ └── Contents.json │ │ │ ├── Sign out icon.imageset │ │ │ │ ├── Sign out icon.pdf │ │ │ │ └── Contents.json │ │ │ ├── Withdraw icon.imageset │ │ │ │ ├── Withdraw icon.pdf │ │ │ │ └── Contents.json │ │ │ ├── Dashboard icon.imageset │ │ │ │ ├── Dashboard icon.pdf │ │ │ │ └── Contents.json │ │ │ ├── Explore funds icon.imageset │ │ │ │ ├── Explore funds icon.pdf │ │ │ │ └── Contents.json │ │ │ └── Explore tokens icon.imageset │ │ │ │ ├── Explore tokens icon.pdf │ │ │ │ └── Contents.json │ │ ├── Settings icons │ │ │ ├── Contents.json │ │ │ ├── Seed.imageset │ │ │ │ ├── seed.pdf │ │ │ │ └── Contents.json │ │ │ ├── Copyright.imageset │ │ │ │ ├── Copyright.png │ │ │ │ ├── Copyright@2x.png │ │ │ │ ├── Copyright@3x.png │ │ │ │ └── Contents.json │ │ │ ├── Face ID icon.imageset │ │ │ │ ├── Face ID icon.png │ │ │ │ ├── Face ID icon@2x.png │ │ │ │ ├── Face ID icon@3x.png │ │ │ │ └── Contents.json │ │ │ ├── Password icon.imageset │ │ │ │ ├── Password icon.pdf │ │ │ │ └── Contents.json │ │ │ ├── Security icon.imageset │ │ │ │ ├── Security icon.pdf │ │ │ │ └── Contents.json │ │ │ ├── Touch ID icon.imageset │ │ │ │ ├── Touch ID icon.png │ │ │ │ ├── Touch ID icon@2x.png │ │ │ │ ├── Touch ID icon@3x.png │ │ │ │ └── Contents.json │ │ │ ├── Verification icon.imageset │ │ │ │ ├── Verification icon.pdf │ │ │ │ └── Contents.json │ │ │ └── Invite a friend icon.imageset │ │ │ │ ├── Invite a friend icon.pdf │ │ │ │ └── Contents.json │ │ ├── Code.imageset │ │ │ ├── Code.pdf │ │ │ └── Contents.json │ │ ├── Date.imageset │ │ │ ├── Date.pdf │ │ │ └── Contents.json │ │ ├── Icon.imageset │ │ │ ├── logo.pdf │ │ │ └── Contents.json │ │ ├── Lock.imageset │ │ │ ├── Lock.pdf │ │ │ └── Contents.json │ │ ├── Check.imageset │ │ │ ├── Check.pdf │ │ │ └── Contents.json │ │ ├── Email.imageset │ │ │ ├── Email.pdf │ │ │ └── Contents.json │ │ ├── Match.imageset │ │ │ ├── Match.pdf │ │ │ └── Contents.json │ │ ├── Price.imageset │ │ │ ├── Price.pdf │ │ │ └── Contents.json │ │ ├── Token.imageset │ │ │ ├── Token.pdf │ │ │ └── Contents.json │ │ ├── Amount.imageset │ │ │ ├── Amount.pdf │ │ │ └── Contents.json │ │ ├── AppIcon.appiconset │ │ │ ├── Icon.png │ │ │ ├── Icon-40.png │ │ │ ├── Icon-72.png │ │ │ ├── Icon-76.png │ │ │ ├── Icon@2x.png │ │ │ ├── Icon-40@2x.png │ │ │ ├── Icon-40@3x.png │ │ │ ├── Icon-60@2x.png │ │ │ ├── Icon-60@3x.png │ │ │ ├── Icon-72@2x.png │ │ │ ├── Icon-76@2x.png │ │ │ ├── Icon-Small.png │ │ │ ├── Icon-83.5@2x.png │ │ │ ├── Icon-Small-50.png │ │ │ ├── Icon-Small@2x.png │ │ │ ├── Icon-Small@3x.png │ │ │ ├── ios-marketing.png │ │ │ ├── Icon-Small-50@2x.png │ │ │ ├── NotificationIcon@2x.png │ │ │ ├── NotificationIcon@3x.png │ │ │ ├── NotificationIcon~ipad.png │ │ │ └── NotificationIcon~ipad@2x.png │ │ ├── Delete.imageset │ │ │ ├── Delete.pdf │ │ │ └── Contents.json │ │ ├── Drop icon.imageset │ │ │ ├── drop.pdf │ │ │ └── Contents.json │ │ ├── Help icon.imageset │ │ │ ├── help.pdf │ │ │ └── Contents.json │ │ ├── Unlock.imageset │ │ │ ├── Unlock.pdf │ │ │ └── Contents.json │ │ ├── Comment.imageset │ │ │ ├── comment.pdf │ │ │ └── Contents.json │ │ ├── Polls icon.imageset │ │ │ ├── polls.pdf │ │ │ └── Contents.json │ │ ├── Receive.imageset │ │ │ ├── Receive.pdf │ │ │ └── Contents.json │ │ ├── Add icon.imageset │ │ │ ├── Add icon.png │ │ │ ├── Add icon@2x.png │ │ │ ├── Add icon@3x.png │ │ │ └── Contents.json │ │ ├── Checkmark.imageset │ │ │ ├── Checkmark.pdf │ │ │ └── Contents.json │ │ ├── Incoming.imageset │ │ │ ├── Incoming.pdf │ │ │ └── Contents.json │ │ ├── Menu icon.imageset │ │ │ ├── Menu icon.pdf │ │ │ └── Contents.json │ │ ├── Outgoing.imageset │ │ │ ├── Outgoing.pdf │ │ │ └── Contents.json │ │ ├── Plus icon.imageset │ │ │ ├── Plus icon.pdf │ │ │ └── Contents.json │ │ ├── Recipient.imageset │ │ │ ├── Recipient.pdf │ │ │ └── Contents.json │ │ ├── Reference.imageset │ │ │ ├── Reference.pdf │ │ │ └── Contents.json │ │ ├── Star icon.imageset │ │ │ ├── Star icon.pdf │ │ │ └── Contents.json │ │ ├── Time icon.imageset │ │ │ ├── Time icon.pdf │ │ │ └── Contents.json │ │ ├── Close icon.imageset │ │ │ ├── Close icon.pdf │ │ │ └── Contents.json │ │ ├── History icon.imageset │ │ │ ├── history.pdf │ │ │ └── Contents.json │ │ ├── Share icon.imageset │ │ │ ├── Share icon.pdf │ │ │ └── Contents.json │ │ ├── Destination.imageset │ │ │ ├── Destination.pdf │ │ │ └── Contents.json │ │ ├── Pending icon.imageset │ │ │ ├── Pending icon.png │ │ │ ├── Pending icon@2x.png │ │ │ ├── Pending icon@3x.png │ │ │ └── Contents.json │ │ ├── Scan QR icon.imageset │ │ │ ├── Scan QR icon.pdf │ │ │ └── Contents.json │ │ ├── Deposit action.imageset │ │ │ ├── Deposit action.pdf │ │ │ └── Contents.json │ │ ├── Document icon.imageset │ │ │ ├── Document icon1.pdf │ │ │ └── Contents.json │ │ ├── Payment action.imageset │ │ │ ├── Payment action.pdf │ │ │ └── Contents.json │ │ ├── Upcoming image.imageset │ │ │ ├── Upcoming image.pdf │ │ │ └── Contents.json │ │ ├── Withdraw action.imageset │ │ │ ├── Withdraw action.pdf │ │ │ └── Contents.json │ │ ├── Filled star icon.imageset │ │ │ ├── Filled star icon.pdf │ │ │ └── Contents.json │ │ ├── Flash Light icon.imageset │ │ │ ├── Flash Light icon.pdf │ │ │ └── Contents.json │ │ ├── Hide password icon.imageset │ │ │ ├── hide password.pdf │ │ │ └── Contents.json │ │ ├── Send.imageset │ │ │ ├── baseline_send_black_24pt_1x.png │ │ │ ├── baseline_send_black_24pt_2x.png │ │ │ ├── baseline_send_black_24pt_3x.png │ │ │ └── Contents.json │ │ ├── Show password icon.imageset │ │ │ ├── show password.pdf │ │ │ └── Contents.json │ │ ├── Fee.imageset │ │ │ ├── baseline_flash_on_black_24pt_1x.png │ │ │ ├── baseline_flash_on_black_24pt_2x.png │ │ │ ├── baseline_flash_on_black_24pt_3x.png │ │ │ └── Contents.json │ │ └── Place holder icon.imageset │ │ │ ├── Place holder icon.pdf │ │ │ └── Contents.json │ ├── TokenDWalletTemplate.entitlements │ └── APIConfiguration.plist └── Sources │ ├── Scenes │ ├── Polls │ │ ├── Views │ │ │ └── PollsEmptyView.swift │ │ ├── PollsRouting.swift │ │ └── Workers │ │ │ └── PollsPercentFormatter.swift │ ├── SideMenu │ │ ├── SideMenuRouting.swift │ │ └── SideMenuInteractor.swift │ ├── MarkdownViewer │ │ ├── MarkdownViewerRouting.swift │ │ ├── MarkdownViewerModels.swift │ │ └── MarkdownViewerPresenter.swift │ ├── Trade │ │ ├── Workers │ │ │ ├── TradeChartCardValueFormatter.swift │ │ │ ├── TradeDateFormatterProtocol.swift │ │ │ ├── TradeOffersFetcherProtocol.swift │ │ │ ├── TradeChartsFetcherProtocol.swift │ │ │ ├── TradeAssetsFetcherProtocol.swift │ │ │ ├── TradeAmountFormatterProtocol.swift │ │ │ └── TradeDateFormatter.swift │ │ └── TradeRouting.swift │ ├── Chart │ │ ├── ChartRouting.swift │ │ └── Workers │ │ │ ├── ChartAmountFormatter.swift │ │ │ └── ChartDateFormatter.swift │ ├── Dashboard │ │ ├── DashboardRouting.swift │ │ ├── PlugIns │ │ │ ├── Payments │ │ │ │ ├── DashboardPaymentsPlugInRouting.swift │ │ │ │ └── Workers │ │ │ │ │ ├── DashboardPaymentsPlugInAmountFormatterProtocol.swift │ │ │ │ │ ├── DashboardPaymentsPlugInAmountFormatter.swift │ │ │ │ │ ├── DashboardPaymentsPlugInRateProviderProtocol.swift │ │ │ │ │ └── DashboardPaymentsPlugInBalancesFetcherProtocol.swift │ │ │ └── PendingOffers │ │ │ │ ├── DashboardPendingOffersPreviewPlugInRouting.swift │ │ │ │ ├── DashboardPendingOffersPreviewPlugInModels.swift │ │ │ │ ├── DashboardPendingOffersPreviewPlugInInteractor.swift │ │ │ │ └── DashboardPendingOffersPreviewPlugInPresenter.swift │ │ ├── Workers │ │ │ ├── DashboardPlugInsProvider.swift │ │ │ └── DashboardPlugInsProviderProtocol.swift │ │ ├── DashboardModels.swift │ │ └── DashboardPresenter.swift │ ├── AuthenticatorAuth │ │ ├── Views │ │ │ └── AuthenticatorAuthQRCell.swift │ │ ├── AuthenticatorAuthRouting.swift │ │ └── Workers │ │ │ ├── AuthRequestQRCodeGenerator.swift │ │ │ ├── AuthAppAvailibilityChecker.swift │ │ │ ├── DownloadUrlFetcher.swift │ │ │ └── AuthRequestKeyFetcher.swift │ ├── TabBar │ │ ├── TabBarRouting.swift │ │ ├── Workers │ │ │ └── TabBarTabProviderProtocol.swift │ │ └── Views │ │ │ └── TabBarTabBarItem.swift │ ├── SaleInvest │ │ ├── Views │ │ │ ├── SaleInvestBalancesView.swift │ │ │ └── SaleInvestEnterInvestAmountView.swift │ │ ├── Workers │ │ │ ├── SaleInvestAmountFormatter.swift │ │ │ └── SaleInvesInvestedAmountFormatter.swift │ │ └── SaleInvestRouting.swift │ ├── WalletRecovery │ │ ├── WalletRecoveryRouting.swift │ │ ├── WalletRecoveryModels.swift │ │ ├── WalletRecoveryInteractor.swift │ │ └── WalletRecoveryPresenter.swift │ ├── TradeOffers │ │ └── Workers │ │ │ ├── TradeOffersChartCardValueFormatter.swift │ │ │ ├── TradeOffersDateFormatterProtocol.swift │ │ │ ├── TradeOffersChartsFetcherProtocol.swift │ │ │ ├── TradeOffersOffersFetcherProtocol.swift │ │ │ ├── TradeOffersTradesFetcherProtocol.swift │ │ │ └── TradeOffersAmountFormatterProtocol.swift │ ├── BalanceHeader │ │ ├── BalanceHeaderRouting.swift │ │ └── Workers │ │ │ ├── BalanceHeaderRateProviderProtocol.swift │ │ │ └── BalanceHeaderAmountFormatter.swift │ ├── SaleDetails │ │ └── SaleDetailsRouting.swift │ ├── TabBarContainer │ │ ├── TabBarContainerRouting.swift │ │ ├── Workers │ │ │ └── TabBarContentProvider.swift │ │ └── TabBarContainerModels.swift │ ├── BalancePicker │ │ ├── BalancePickerRouting.swift │ │ └── Workers │ │ │ └── BalancePickerAmountFormatter.swift │ ├── AssetPicker │ │ ├── AssetPickerRouting.swift │ │ └── Workers │ │ │ └── AssetPickerAmountFormatter.swift │ ├── SaleOverview │ │ ├── SaleOverviewRouting.swift │ │ └── Workers │ │ │ ├── SaleOverviewProgressValueFormatter.swift │ │ │ ├── SaleOverviewInvestedAmountFormatter.swift │ │ │ ├── SaleInfoTextFormatter.swift │ │ │ └── SaleOverviewFundedValueFormatter.swift │ ├── TransactionDetails │ │ ├── Worker │ │ │ ├── TransactionDetailsTransactionProvider.swift │ │ │ ├── TransactionDetailsDateFormatterProtocol.swift │ │ │ ├── TransactionDetailsAmountFormatterProtocol.swift │ │ │ ├── TransactionDetailsAmountFormatter.swift │ │ │ ├── TransactionDetailsDateFormatter.swift │ │ │ └── TransactionDetailsSectionsProviderProtocol.swift │ │ └── TransactionDetailsRouting.swift │ ├── DepositScene │ │ ├── DepositSceneRouting.swift │ │ └── Workers │ │ │ ├── DepositSceneDateFormatterProtocol.swift │ │ │ ├── DepositSceneAddressManagerProtocol.swift │ │ │ ├── DepositSceneQRCodeGeneratorProtocol.swift │ │ │ ├── DepositSceneDateFormatter.swift │ │ │ └── DepositSceneAssetsFetcherProtocol.swift │ ├── ReceiveAddress │ │ ├── ReceiveAddressRouting.swift │ │ └── Workers │ │ │ ├── ReceiveAddressManagerProtocol.swift │ │ │ ├── ReceiveAddressInvoiceFormatterProtocol.swift │ │ │ ├── ReceiveAddressShareUtilProtocol.swift │ │ │ ├── ReceiveAddressQRCodeGeneratorProtocol.swift │ │ │ ├── ReceiveAddressInvoiceFormatter.swift │ │ │ ├── ReceiveAddressManager.swift │ │ │ └── ExportSeedManager.swift │ ├── Fees │ │ ├── FeesRouting.swift │ │ └── Workers │ │ │ └── FeeAmountFormatter.swift │ ├── Confirmation │ │ ├── Workers │ │ │ ├── ConfirmationAmountFormatter.swift │ │ │ ├── ConfirmationPercentFormatter.swift │ │ │ ├── ConfirmationPercentFormatterProtocol.swift │ │ │ ├── ConfirmationAmountFormatterProtocol.swift │ │ │ └── ConfirmationSectionsProviderProtocol.swift │ │ ├── ConfirmationSceneRouting.swift │ │ └── Views │ │ │ └── ConfirmationSceneBaseCell.swift │ ├── BalanceHeaderWithPicker │ │ ├── BalanceHeaderWithPickerRouting.swift │ │ └── Workers │ │ │ ├── BalanceHeaderWithPickerAmountFormatterProtocol.swift │ │ │ ├── BalanceHeaderWithPickerBalancesFetcherProtocol.swift │ │ │ ├── BalanceHeaderWithPickerRateProviderProtocol.swift │ │ │ └── BalanceHeaderWithPickerAmountFormatter.swift │ ├── UpdatePassword │ │ ├── UpdatePasswordRouting.swift │ │ └── Worker │ │ │ └── UpdatePasswordSubmitWorkerProtocol.swift │ ├── VerifyEmail │ │ ├── VerifyEmailRouting.swift │ │ └── Workers │ │ │ ├── VerifyEmailResendWorkerProtocol.swift │ │ │ └── VerifyEmailVerifyWorkerProtocol.swift │ ├── BiometricsAuth │ │ ├── BiometricsAuthRouting.swift │ │ ├── BiometricsAuthModels.swift │ │ └── BiometricsAuthInteractor.swift │ ├── CreateOffer │ │ ├── CreateOfferRouting.swift │ │ └── Workers │ │ │ ├── CreateOfferAmountFormatterProtocol.swift │ │ │ ├── CreateOfferAmountFormatter.swift │ │ │ └── CreateOfferFeeLoaderProtocol.swift │ ├── TabsContainer │ │ ├── TabsContainerRouting.swift │ │ └── Workers │ │ │ └── TabsContainerContentProvider.swift │ ├── TokenDetails │ │ ├── Workers │ │ │ ├── TokenDetailsTokenColoringProviderProtocol.swift │ │ │ ├── TokenDetailsDocumentURLBuilderProtocol.swift │ │ │ ├── TokenDetailsAmountFormatter.swift │ │ │ ├── TokenDetailsSceneBalanceCreatorProtocol.swift │ │ │ ├── TokenDetailsFetcherProtocol.swift │ │ │ └── TokenDetailsDocumentURLBuilder.swift │ │ └── TokenDetailsRouting.swift │ ├── ExploreTokens │ │ ├── Workers │ │ │ ├── ExploreTokensTokenColoringProviderProtocol.swift │ │ │ ├── ExploreTokensSceneBalanceCreatorProtocol.swift │ │ │ └── ExploreTokensSceneTokensFetcherProtocol.swift │ │ └── ExploreTokensRouting.swift │ ├── BalancesList │ │ ├── BalancesListRouting.swift │ │ └── Workers │ │ │ ├── BalancesListAmountFormatter.swift │ │ │ ├── BalancesListPercentFormatter.swift │ │ │ └── BalancesListPieChartColorsProvider.swift │ ├── TransactionsList │ │ ├── Workers │ │ │ ├── TransactionsListSceneAmountFormatterProtocol.swift │ │ │ ├── TransactionsListSceneDateFormatterProtocol.swift │ │ │ ├── TransactionsListSceneRateProviderProtocol.swift │ │ │ ├── TransactionsListSceneTransactionsProviderProtocol.swift │ │ │ ├── TransactionsListAmountFormatter.swift │ │ │ └── TransactionsListSceneTransactionsFetcherProtocol.swift │ │ └── TransactionsListRouting.swift │ ├── TradesList │ │ └── Workers │ │ │ ├── TradesListAssetColoringProvider.swift │ │ │ ├── TradesListAmountFormatterProtocol.swift │ │ │ └── TradesListAssetPairsFetcherProtocol.swift │ ├── Sales │ │ ├── SalesRouting.swift │ │ └── Workers │ │ │ └── SalesInvestedAmountFormatter.swift │ ├── Settings │ │ └── SettingsRouting.swift │ ├── RecoverySeed │ │ └── RecoverySeedRouting.swift │ ├── SendPaymentAmount │ │ ├── Workers │ │ │ └── SendPaymentAmountAmountFormatter.swift │ │ └── SendPaymentAmountRouting.swift │ ├── SendPaymentDestination │ │ ├── SendPaymentDestinationRouting.swift │ │ └── Workers │ │ │ └── WithdrawRecipientAddressResolver.swift │ └── SignIn │ │ └── RegisterSceneRouting.swift │ ├── Shared │ ├── Extensions │ │ ├── Array+IndexInBounds.swift │ │ ├── BehaviorRelay+EmitValue.swift │ │ ├── SideMenuController+RootContent.swift │ │ ├── TokenDSDK.Asset+Identifier.swift │ │ ├── Array+RemoveObject.swift │ │ ├── Array+IndexOf.swift │ │ ├── SnapKit+Extension.swift │ │ ├── Bundle+Version.swift │ │ ├── NumberFormatter+Decimal.swift │ │ ├── String+QueueLabel.swift │ │ ├── UISegmentedControl+FillWithSegments.swift │ │ ├── Array+Take.swift │ │ ├── Hashable+Iterate.swift │ │ ├── UIResponder+First.swift │ │ ├── TokenDWallet.PublicKey+base32EncodedString.swift │ │ ├── UIImage+ButtonImage.swift │ │ ├── UIViewController+ChildViewController.swift │ │ └── UIColor+Hex.swift │ ├── Controllers │ │ ├── TextEditingContext │ │ │ ├── Validators │ │ │ │ ├── ValueValidator.swift │ │ │ │ └── DecimalMaxValueValidator.swift │ │ │ └── Formatters │ │ │ │ ├── ValueFormatter.swift │ │ │ │ └── PrecisedFormatter.swift │ │ ├── AppUtils │ │ │ └── AppInfoUtils.swift │ │ └── Permissions │ │ │ └── ContactEmailPickerHandler.swift │ ├── Workers │ │ ├── BalanceBinder │ │ │ └── BalanceBinderProtocol.swift │ │ ├── ChartCardValueFormatter │ │ │ └── ChartCardValueFormatter.swift │ │ ├── BalanceCreator │ │ │ ├── BalanceCreatorProtocol.swift │ │ │ └── BalanceCreator.swift │ │ ├── TermsInfoProvider │ │ │ └── TermsInfoProvider.swift │ │ ├── PasswordValidator │ │ │ └── PasswordValidator.swift │ │ ├── AmountConverter │ │ │ └── AmountConverter.swift │ │ └── QRCodeGenerator │ │ │ └── QRCodeGenerator.swift │ ├── Views │ │ ├── DynamicTableView │ │ │ └── DynamicTableViewDataSourceDelegate.swift │ │ └── BXFStaticTableView │ │ │ ├── BXFStaticTableViewInfoSection.swift │ │ │ ├── BXFScrollViewWithKeyboardResponder.swift │ │ │ ├── BXFGroupedHeaderFooterLabel.swift │ │ │ ├── BXFStaticTableViewInputSection │ │ │ └── BXFStaticTableViewInputSection.swift │ │ │ └── BXFStaticTableViewButtonCell │ │ │ └── BXFStaticTableViewButtonCellModel.swift │ └── Protocols │ │ └── DecimalFloorRoundingBehavior.swift │ ├── Default │ └── main.swift │ └── Controllers │ ├── APIConfiguration │ └── APIConfigurationModel.swift │ ├── Managers │ └── KeychainManager │ │ └── KeychainCodableAccountsV1.swift │ ├── UserDataProvider.swift │ └── Providers │ ├── TFADataProvider.swift │ └── KeychainDataProvider.swift ├── TokenDWalletTemplate.xcodeproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── TokenDWalletTemplate.xcworkspace ├── xcshareddata │ └── IDEWorkspaceChecks.plist └── contents.xcworkspacedata ├── Scripts └── gen_loc_keys.rb └── .swiftlint.yml /TokenDWalletTemplate/Resources/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Polls/Views/PollsEmptyView.swift: -------------------------------------------------------------------------------- 1 | extension Polls { 2 | 3 | typealias EmptyView = Sales.EmptyView 4 | } 5 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/SideMenu/SideMenuRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension SideMenu { 4 | struct Routing { } 5 | } 6 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Code.imageset/Code.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Code.imageset/Code.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Date.imageset/Date.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Date.imageset/Date.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Icon.imageset/logo.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Icon.imageset/logo.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Lock.imageset/Lock.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Lock.imageset/Lock.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Check.imageset/Check.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Check.imageset/Check.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Email.imageset/Email.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Email.imageset/Email.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Match.imageset/Match.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Match.imageset/Match.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Price.imageset/Price.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Price.imageset/Price.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Token.imageset/Token.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Token.imageset/Token.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Amount.imageset/Amount.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Amount.imageset/Amount.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Delete.imageset/Delete.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Delete.imageset/Delete.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Drop icon.imageset/drop.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Drop icon.imageset/drop.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Help icon.imageset/help.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Help icon.imageset/help.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Unlock.imageset/Unlock.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Unlock.imageset/Unlock.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Comment.imageset/comment.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Comment.imageset/comment.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Polls icon.imageset/polls.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Polls icon.imageset/polls.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Receive.imageset/Receive.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Receive.imageset/Receive.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/MarkdownViewer/MarkdownViewerRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension MarkdownViewer { 4 | 5 | struct Routing { 6 | 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Trade/Workers/TradeChartCardValueFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension Trade { 4 | typealias ChartCardValueFormatter = ChartValueFormatter 5 | } 6 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Add icon.imageset/Add icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Add icon.imageset/Add icon.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-40.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-72.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-76.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon@2x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Checkmark.imageset/Checkmark.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Checkmark.imageset/Checkmark.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Incoming.imageset/Incoming.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Incoming.imageset/Incoming.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Menu icon.imageset/Menu icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Menu icon.imageset/Menu icon.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Outgoing.imageset/Outgoing.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Outgoing.imageset/Outgoing.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Plus icon.imageset/Plus icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Plus icon.imageset/Plus icon.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Recipient.imageset/Recipient.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Recipient.imageset/Recipient.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Reference.imageset/Reference.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Reference.imageset/Reference.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Star icon.imageset/Star icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Star icon.imageset/Star icon.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Time icon.imageset/Time icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Time icon.imageset/Time icon.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Chart/ChartRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension Chart { 4 | public struct Routing { 5 | // public let onBackAction: () -> Void 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Add icon.imageset/Add icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Add icon.imageset/Add icon@2x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Add icon.imageset/Add icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Add icon.imageset/Add icon@3x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-72@2x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-Small.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Close icon.imageset/Close icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Close icon.imageset/Close icon.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/History icon.imageset/history.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/History icon.imageset/history.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Share icon.imageset/Share icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Share icon.imageset/Share icon.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Dashboard/DashboardRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension DashboardScene { 4 | struct Routing { 5 | let showExploreAssets: () -> Void 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-Small-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-Small-50.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/ios-marketing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/ios-marketing.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Destination.imageset/Destination.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Destination.imageset/Destination.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Seed.imageset/seed.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Seed.imageset/seed.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/AuthenticatorAuth/Views/AuthenticatorAuthQRCell.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension AuthenticatorAuth { 4 | 5 | typealias QRCell = ReceiveAddress.QRCell 6 | } 7 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TabBar/TabBarRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension TabBar { 4 | public struct Routing { 5 | let onAction: (_ identifier: String) -> Void 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-Small-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/Icon-Small-50@2x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Pending icon.imageset/Pending icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Pending icon.imageset/Pending icon.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Scan QR icon.imageset/Scan QR icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Scan QR icon.imageset/Scan QR icon.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/SaleInvest/Views/SaleInvestBalancesView.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension SaleInvest { 4 | 5 | typealias AvalableBalanceView = SendPaymentAmount.BalanceView 6 | } 7 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/WalletRecovery/WalletRecoveryRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension WalletRecovery { 4 | struct Routing { 5 | // let onBackAction: () -> Void 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/NotificationIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/NotificationIcon@2x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/NotificationIcon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/NotificationIcon@3x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Deposit action.imageset/Deposit action.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Deposit action.imageset/Deposit action.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Document icon.imageset/Document icon1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Document icon.imageset/Document icon1.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Payment action.imageset/Payment action.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Payment action.imageset/Payment action.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Pending icon.imageset/Pending icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Pending icon.imageset/Pending icon@2x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Pending icon.imageset/Pending icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Pending icon.imageset/Pending icon@3x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Upcoming image.imageset/Upcoming image.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Upcoming image.imageset/Upcoming image.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TradeOffers/Workers/TradeOffersChartCardValueFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension TradeOffers { 4 | public typealias ChartCardValueFormatter = ChartValueFormatter 5 | } 6 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Extensions/Array+IndexInBounds.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension Array { 4 | func indexInBounds(_ index: Int) -> Bool { 5 | return 0.. Void 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Extensions/BehaviorRelay+EmitValue.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import RxCocoa 3 | 4 | extension BehaviorRelay { 5 | func emitEvent() { 6 | self.accept(self.value) 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/NotificationIcon~ipad@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/AppIcon.appiconset/NotificationIcon~ipad@2x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Filled star icon.imageset/Filled star icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Filled star icon.imageset/Filled star icon.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Flash Light icon.imageset/Flash Light icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Flash Light icon.imageset/Flash Light icon.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Hide password icon.imageset/hide password.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Hide password icon.imageset/hide password.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Trade icon.imageset/Trade icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Trade icon.imageset/Trade icon.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Wallet icon.imageset/Wallet icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Wallet icon.imageset/Wallet icon.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Send.imageset/baseline_send_black_24pt_1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Send.imageset/baseline_send_black_24pt_1x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Send.imageset/baseline_send_black_24pt_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Send.imageset/baseline_send_black_24pt_2x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Send.imageset/baseline_send_black_24pt_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Send.imageset/baseline_send_black_24pt_3x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Copyright.imageset/Copyright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Copyright.imageset/Copyright.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Show password icon.imageset/show password.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Show password icon.imageset/show password.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/SaleDetails/SaleDetailsRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension SaleDetails { 4 | 5 | public struct Routing { 6 | 7 | public init() { } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/SaleInvest/Views/SaleInvestEnterInvestAmountView.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension SaleInvest { 4 | 5 | typealias EnterInvestAmountView = SendPaymentAmount.EnterAmountView 6 | } 7 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TabBarContainer/TabBarContainerRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension TabBarContainer { 4 | public struct Routing { 5 | // public let onBackAction: () -> Void 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Fee.imageset/baseline_flash_on_black_24pt_1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Fee.imageset/baseline_flash_on_black_24pt_1x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Fee.imageset/baseline_flash_on_black_24pt_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Fee.imageset/baseline_flash_on_black_24pt_2x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Fee.imageset/baseline_flash_on_black_24pt_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Fee.imageset/baseline_flash_on_black_24pt_3x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Deposit icon.imageset/Deposit icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Deposit icon.imageset/Deposit icon.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Place holder icon.imageset/Place holder icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Place holder icon.imageset/Place holder icon.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Settings icon.imageset/Settings icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Settings icon.imageset/Settings icon.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Sign out icon.imageset/Sign out icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Sign out icon.imageset/Sign out icon.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Withdraw icon.imageset/Withdraw icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Withdraw icon.imageset/Withdraw icon.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Copyright.imageset/Copyright@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Copyright.imageset/Copyright@2x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Copyright.imageset/Copyright@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Copyright.imageset/Copyright@3x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/BalanceHeader/Workers/BalanceHeaderRateProviderProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension BalanceHeader { 4 | typealias RateProviderProtocol = BalanceHeaderWithPicker.RateProviderProtocol 5 | } 6 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/BalancePicker/BalancePickerRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension BalancePicker { 4 | public struct Routing { 5 | let onBalancePicked: (_ balanceId: String) -> Void 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Dashboard icon.imageset/Dashboard icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Dashboard icon.imageset/Dashboard icon.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Face ID icon.imageset/Face ID icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Face ID icon.imageset/Face ID icon.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Face ID icon.imageset/Face ID icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Face ID icon.imageset/Face ID icon@2x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Face ID icon.imageset/Face ID icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Face ID icon.imageset/Face ID icon@3x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Password icon.imageset/Password icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Password icon.imageset/Password icon.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Security icon.imageset/Security icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Security icon.imageset/Security icon.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Touch ID icon.imageset/Touch ID icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Touch ID icon.imageset/Touch ID icon.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Default/main.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | _ = UIApplicationMain( 4 | CommandLine.argc, 5 | CommandLine.unsafeArgv, 6 | NSStringFromClass(TimerUIApplication.self), 7 | NSStringFromClass(AppDelegate.self) 8 | ) 9 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Touch ID icon.imageset/Touch ID icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Touch ID icon.imageset/Touch ID icon@2x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Touch ID icon.imageset/Touch ID icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Touch ID icon.imageset/Touch ID icon@3x.png -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/AssetPicker/AssetPickerRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension AssetPicker { 4 | public struct Routing { 5 | let onAssetPicked: (_ ownerAccountId: String, _ assetCode: String) -> Void 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/SaleOverview/SaleOverviewRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension SaleOverview { 4 | 5 | public struct Routing { 6 | 7 | // public let onBackAction: () -> Void 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /TokenDWalletTemplate.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Explore funds icon.imageset/Explore funds icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Explore funds icon.imageset/Explore funds icon.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Explore tokens icon.imageset/Explore tokens icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Explore tokens icon.imageset/Explore tokens icon.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Verification icon.imageset/Verification icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Verification icon.imageset/Verification icon.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Dashboard/PlugIns/Payments/DashboardPaymentsPlugInRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension DashboardPaymentsPlugIn { 4 | struct Routing { 5 | let onViewMoreAction: (_ balanceId: String) -> Void 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TransactionDetails/Worker/TransactionDetailsTransactionProvider.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension TransactionDetails { 4 | typealias TransactionsProviderProtocol = TransactionsListScene.TransactionsProviderProtocol 5 | } 6 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/DepositScene/DepositSceneRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension DepositScene { 4 | struct Routing { 5 | let onShare: (_ items: [Any]) -> Void 6 | let onError: (_ message: String) -> Void 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "logo.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Lock.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Lock.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Invite a friend icon.imageset/Invite a friend icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tokend/ios-app/HEAD/TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Invite a friend icon.imageset/Invite a friend icon.pdf -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Dashboard/PlugIns/PendingOffers/DashboardPendingOffersPreviewPlugInRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension DashboardPendingOffersPreviewPlugIn { 4 | struct Routing { 5 | let onViewMoreAction: () -> Void 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Email.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Email.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Match.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Match.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Token.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Token.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Unlock.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Unlock.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Incoming.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Incoming.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Outgoing.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Outgoing.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Reference.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Reference.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/ReceiveAddress/ReceiveAddressRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension ReceiveAddress { 4 | struct Routing { 5 | let onCopy: (_ stringToCopy: String) -> Void 6 | let onShare: (_ itemsToShare: [Any]) -> Void 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Seed.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "seed.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Fees/FeesRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension Fees { 4 | struct Routing { 5 | let showProgress: () -> Void 6 | let hideProgress: () -> Void 7 | let showMessage: (_ message: String) -> Void 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Extensions/SideMenuController+RootContent.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import SideMenuController 3 | 4 | extension SideMenuController: RootContentProtocol { 5 | func getRootContentViewController() -> UIViewController { 6 | return self 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Extensions/TokenDSDK.Asset+Identifier.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import TokenDSDK 3 | 4 | extension TokenDSDK.Asset { 5 | var identifier: ExploreTokensScene.TokenIdentifier { 6 | return self.code + (self.defaultDetails?.name ?? "") 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Controllers/TextEditingContext/Validators/ValueValidator.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | class ValueValidator { 4 | 5 | // MARK: - Public 6 | 7 | func validate(value: ValueType?) -> Bool { 8 | return true 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TabBar/Workers/TabBarTabProviderProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol TabBarTabProviderProtocol { 4 | func getTabs() -> [TabBar.Model.TabItem] 5 | } 6 | 7 | extension TabBar { 8 | typealias TabProviderProtocol = TabBarTabProviderProtocol 9 | } 10 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Extensions/Array+RemoveObject.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension Array where Element: Equatable { 4 | mutating func remove(object: Element) { 5 | if let index: Int = index(of: object) { 6 | remove(at: index) 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Confirmation/Workers/ConfirmationAmountFormatter.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | extension ConfirmationScene { 4 | class AmountFormatter: SharedAmountFormatter { } 5 | } 6 | 7 | extension ConfirmationScene.AmountFormatter: ConfirmationScene.AmountFormatterProtocol { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Confirmation/Workers/ConfirmationPercentFormatter.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | extension ConfirmationScene { 4 | class PercentFormatter: SharedAmountFormatter { } 5 | } 6 | 7 | extension ConfirmationScene.PercentFormatter: ConfirmationScene.PercentFormatterProtocol { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /TokenDWalletTemplate.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Controllers/APIConfiguration/APIConfigurationModel.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | struct APIConfigurationModel: Decodable { 4 | let storageEndpoint: String 5 | let apiEndpoint: String 6 | let termsAddress: String? 7 | let webClient: String? 8 | let downloadUrl: String? 9 | } 10 | -------------------------------------------------------------------------------- /TokenDWalletTemplate.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /TokenDWalletTemplate.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/AuthenticatorAuth/AuthenticatorAuthRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension AuthenticatorAuth { 4 | struct Routing { 5 | let openUrl: (_ url: URL) -> Void 6 | let showError: (_ message: String) -> Void 7 | let onSuccessfulSignIn: (_ account: String) -> Void 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/DepositScene/Workers/DepositSceneDateFormatterProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol DepositSceneDateFormatterProtocol { 4 | func formatExpiratioDate(_ date: Date) -> String 5 | } 6 | 7 | extension DepositScene { 8 | typealias DateFormatterProtocol = DepositSceneDateFormatterProtocol 9 | } 10 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/BalanceHeaderWithPicker/BalanceHeaderWithPickerRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension BalanceHeaderWithPicker { 4 | struct Routing { 5 | typealias DidSelectBalance = (_ balance: String?, _ asset: String) -> Void 6 | 7 | let onDidSelectBalance: DidSelectBalance 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Extensions/Array+IndexOf.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension Array where Element: Equatable { 4 | 5 | func indexOf(_ element: Element) -> Int? { 6 | for index in 0.. String 5 | } 6 | 7 | extension ConfirmationScene { 8 | typealias PercentFormatterProtocol = ConfirmationPercentFormatterProtocol 9 | } 10 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/UpdatePassword/UpdatePasswordRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension UpdatePassword { 4 | struct Routing { 5 | let onShowProgress: () -> Void 6 | let onHideProgress: () -> Void 7 | let onShowErrorMessage: (String) -> Void 8 | let onSubmitSucceeded: () -> Void 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/VerifyEmail/VerifyEmailRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension VerifyEmail { 4 | struct Routing { 5 | let showProgress: () -> Void 6 | let hideProgress: () -> Void 7 | let showErrorMessage: (_ errorMessage: String) -> Void 8 | let onEmailVerified: () -> Void 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/History icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "history.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template" 14 | } 15 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/BiometricsAuth/BiometricsAuthRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension BiometricsAuth { 4 | struct Routing { 5 | let onAuthSucceeded: (_ account: String) -> Void 6 | let onAuthFailed: () -> Void 7 | let onUserCancelled: () -> Void 8 | let onUserFallback: () -> Void 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Confirmation/Workers/ConfirmationAmountFormatterProtocol.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | protocol ConfirmationAmountFormatterProtocol { 4 | func assetAmountToString(_ amount: Decimal) -> String 5 | } 6 | 7 | extension ConfirmationScene { 8 | typealias AmountFormatterProtocol = ConfirmationAmountFormatterProtocol 9 | } 10 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/CreateOffer/CreateOfferRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension CreateOffer { 4 | struct Routing { 5 | let showProgress: () -> Void 6 | let hideProgress: () -> Void 7 | let onAction: (Model.CreateOfferModel) -> Void 8 | let onShowError: (_ error: String) -> Void 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/CreateOffer/Workers/CreateOfferAmountFormatterProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol CreateOfferAmountFormatterProtocol { 4 | func formatTotal(_ amount: CreateOffer.Model.Amount) -> String 5 | } 6 | 7 | extension CreateOffer { 8 | typealias AmountFormatterProtocol = CreateOfferAmountFormatterProtocol 9 | } 10 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TransactionDetails/Worker/TransactionDetailsDateFormatterProtocol.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | protocol TransactionDetailsDateFormatterProtocol { 4 | func dateToString(date: Date) -> String 5 | } 6 | 7 | extension TransactionDetails { 8 | typealias DateFormatterProtocol = TransactionDetailsDateFormatterProtocol 9 | } 10 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Extensions/SnapKit+Extension.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import SnapKit 3 | 4 | extension UIView { 5 | var safeArea: ConstraintBasicAttributesDSL { 6 | if #available(iOS 11.0, *) { 7 | return self.safeAreaLayoutGuide.snp 8 | } else { 9 | return self.snp 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Close icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Close icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "preserves-vector-representation" : true 14 | } 15 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TabsContainer/TabsContainerRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension TabsContainer { 4 | 5 | public struct Routing { 6 | 7 | let onAction: () -> Void 8 | 9 | public init(onAction: @escaping () -> Void) { 10 | self.onAction = onAction 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Payment action.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Payment action.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template" 14 | } 15 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Upcoming image.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Upcoming image.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "preserves-vector-representation" : true 14 | } 15 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TokenDetails/Workers/TokenDetailsTokenColoringProviderProtocol.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | protocol TokenDetailsTokenColoringProviderProtocol { 4 | func coloringForCode(_ code: String) -> UIColor 5 | } 6 | 7 | extension TokenDetailsScene { 8 | typealias TokenColoringProvider = TokenDetailsTokenColoringProviderProtocol 9 | } 10 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Extensions/Bundle+Version.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension Bundle { 4 | 5 | var shortVersion: String? { 6 | return infoDictionary?["CFBundleShortVersionString"] as? String 7 | } 8 | 9 | var bundleVersion: String? { 10 | return infoDictionary?["CFBundleVersion"] as? String 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Flash Light icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Flash Light icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "preserves-vector-representation" : true 14 | } 15 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Confirmation/ConfirmationSceneRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension ConfirmationScene { 4 | struct Routing { 5 | let onShowProgress: () -> Void 6 | let onHideProgress: () -> Void 7 | let onShowError: (_ erroMessage: String) -> Void 8 | let onConfirmationSucceeded: () -> Void 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/ExploreTokens/Workers/ExploreTokensTokenColoringProviderProtocol.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | protocol ExploreTokensTokenColoringProviderProtocol { 4 | func coloringForCode(_ code: String) -> UIColor 5 | } 6 | 7 | extension ExploreTokensScene { 8 | typealias TokenColoringProvider = ExploreTokensTokenColoringProviderProtocol 9 | } 10 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TokenDetails/TokenDetailsRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension TokenDetailsScene { 4 | struct Routing { 5 | let onDidSelectHistoryForBalance: (_ balanceId: String) -> Void 6 | let onDidSelectDocument: (URL) -> Void 7 | let showSeparator: () -> Void 8 | let hideSeparator: () -> Void 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Trade/Workers/TradeDateFormatterProtocol.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | protocol TradeDateFormatterProtocol { 4 | func dateToString(_ date: Date) -> String 5 | func formatDateForXAxis(_ date: Date, type: Trade.Model.Period) -> String 6 | } 7 | 8 | extension Trade { 9 | typealias DateFormatterProtocol = TradeDateFormatterProtocol 10 | } 11 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TabBarContainer/Workers/TabBarContentProvider.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public protocol TabBarContainerContentProviderProtocol { 4 | func getSceneContent() -> TabBarContainer.Model.SceneContent 5 | } 6 | 7 | extension TabBarContainer { 8 | 9 | public typealias ContentProviderProtocol = TabBarContainerContentProviderProtocol 10 | } 11 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Controllers/Managers/KeychainManager/KeychainCodableAccountsV1.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | class KeychainCodableAccountsV1: Codable { 4 | 5 | // MARK: - Public properties 6 | 7 | var accounts: [String] // emails 8 | 9 | // MARK: - 10 | 11 | init(accounts: [String]) { 12 | self.accounts = accounts 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/ExploreTokens/ExploreTokensRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension ExploreTokensScene { 4 | struct Routing { 5 | let onDidSelectToken: (_ tokenId: ExploreTokensScene.TokenIdentifier) -> Void 6 | let onDidSelectHistoryForBalance: (_ balanceId: String) -> Void 7 | let onError: (_ message: String) -> Void 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Extensions/NumberFormatter+Decimal.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension NumberFormatter { 4 | 5 | func string(from: Decimal) -> String? { 6 | return string(from: NSDecimalNumber(decimal: from)) 7 | } 8 | 9 | func decimal(from: String) -> Decimal? { 10 | return self.number(from: from)?.decimalValue 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Code.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Code.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Date.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Date.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/BalancesList/BalancesListRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension BalancesList { 4 | public struct Routing { 5 | let onBalanceSelected: (_ balanceId: String) -> Void 6 | let showProgress: () -> Void 7 | let hideProgress: () -> Void 8 | let showShadow: () -> Void 9 | let hideShadow: () -> Void 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TokenDetails/Workers/TokenDetailsDocumentURLBuilderProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import TokenDSDK 3 | 4 | protocol TokenDetailsDocumentURLBuilderProtocol { 5 | func getURLForTerms(_ terms: Asset.Details.Term) -> URL? 6 | } 7 | 8 | extension TokenDetailsScene { 9 | typealias DocumentURLBuilderProtocol = TokenDetailsDocumentURLBuilderProtocol 10 | } 11 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Amount.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Amount.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Check.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Check.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Delete.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Delete.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Price.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Price.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TransactionDetails/Worker/TransactionDetailsAmountFormatterProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol TransactionDetailsAmountFormatterProtocol { 4 | func formatAmount(_ amount: TransactionDetails.Model.Amount) -> String 5 | } 6 | 7 | extension TransactionDetails { 8 | typealias AmountFormatterProtocol = TransactionDetailsAmountFormatterProtocol 9 | } 10 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Checkmark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Checkmark.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Comment.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "comment.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Menu icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Menu icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Plus icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Plus icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Polls icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "polls.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Receive.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Receive.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Recipient.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Recipient.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Star icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Star icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Time icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Time icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Extensions/String+QueueLabel.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension String { 4 | var queueLabel: String { 5 | return [self.appBundleIdentifier, "queue", self].joined(separator: ".") 6 | } 7 | 8 | private var appBundleIdentifier: String { 9 | return Bundle.main.infoDictionary?["CFBundleIdentifier"] as? String ?? "APP_ID" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Extensions/UISegmentedControl+FillWithSegments.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | extension UISegmentedControl { 4 | func fillWithSegments(_ titles: [String], animated: Bool) { 5 | self.removeAllSegments() 6 | for title in titles { 7 | self.insertSegment(withTitle: title, at: self.numberOfSegments, animated: animated) 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Destination.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Destination.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Share icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Share icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Extensions/Array+Take.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension Array { 4 | 5 | func takeFirst(n: Int) -> [Element] { 6 | if self.isEmpty { 7 | return [] 8 | } else if self.count >= n { 9 | return Array(self[0...(n-1)]) 10 | } else { 11 | return Array(self[0...(self.count-1)]) 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Deposit action.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Deposit action.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Document icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Document icon1.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Scan QR icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Scan QR icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Filled star icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Filled star icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Hide password icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "hide password.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Send icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Send icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Trade icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Trade icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Wallet icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Wallet icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Show password icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "show password.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Withdraw action.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Withdraw action.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Deposit icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Deposit icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Settings icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Settings icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Sign out icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Sign out icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Withdraw icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Withdraw icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Place holder icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Place holder icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Dashboard icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Dashboard icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Password icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Password icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Security icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Security icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Explore funds icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Explore funds icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Menu icons/Explore tokens icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Explore tokens icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Verification icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Verification icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Polls/PollsRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension Polls { 4 | 5 | public struct Routing { 6 | let onPresentPicker: ( 7 | _ onSelect: @escaping (_ ownerAccountId: String, _ assetCode: String) -> Void 8 | ) -> Void 9 | let showError: (_ message: String) -> Void 10 | let showLoading: () -> Void 11 | let hideLoading: () -> Void 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TransactionsList/Workers/TransactionsListSceneAmountFormatterProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol TransactionsListSceneAmountFormatterProtocol { 4 | func formatAmount( 5 | _ amount: TransactionsListScene.Model.Amount 6 | ) -> String 7 | } 8 | 9 | extension TransactionsListScene { 10 | typealias AmountFormatterProtocol = TransactionsListSceneAmountFormatterProtocol 11 | } 12 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TransactionsList/Workers/TransactionsListSceneDateFormatterProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol TransactionsListSceneDateFormatterProtocol { 4 | func formatDateForTitle(_ date: Date) -> String 5 | func formatDateForTransaction(_ date: Date) -> String 6 | } 7 | 8 | extension TransactionsListScene { 9 | typealias DateFormatterProtocol = TransactionsListSceneDateFormatterProtocol 10 | } 11 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Workers/BalanceBinder/BalanceBinderProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | enum BalanceBinderBindBalanceResult { 4 | case succeeded 5 | case failed 6 | } 7 | 8 | protocol BalanceBinderProtocol { 9 | 10 | func bindBalance( 11 | _ asset: String, 12 | toAccount externalType: Int32, 13 | completion: @escaping (BalanceBinderBindBalanceResult) -> Void 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Invite a friend icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Invite a friend icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template", 14 | "preserves-vector-representation" : true 15 | } 16 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TradesList/Workers/TradesListAssetColoringProvider.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | public protocol TradesListAssetColoringProviderProtocol { 4 | func coloringForCode(_ code: String) -> UIColor 5 | } 6 | 7 | extension TradesList { 8 | 9 | public typealias AssetColoringProvider = TradesListAssetColoringProviderProtocol 10 | } 11 | 12 | extension TokenColoringProvider: TradesList.AssetColoringProvider {} 13 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TradeOffers/Workers/TradeOffersDateFormatterProtocol.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | public protocol TradeOffersDateFormatterProtocol { 4 | func dateToString(_ date: Date, relative: Bool) -> String 5 | func formatDateForXAxis(_ date: Date, type: TradeOffers.Model.Period) -> String 6 | } 7 | 8 | extension TradeOffers { 9 | 10 | public typealias DateFormatterProtocol = TradeOffersDateFormatterProtocol 11 | } 12 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/VerifyEmail/Workers/VerifyEmailResendWorkerProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import TokenDSDK 3 | 4 | enum VerifyEmailResendResult { 5 | case succeded 6 | case failed(ApiErrors) 7 | } 8 | 9 | protocol VerifyEmailResendWorkerProtocol { 10 | typealias Result = VerifyEmailResendResult 11 | 12 | func performResendRequest( 13 | completion: @escaping (_ result: Result) -> Void 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Sales/SalesRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension Sales { 4 | 5 | struct Routing { 6 | 7 | let onDidSelectSale: (_ identifier: String, _ asset: String) -> Void 8 | let onShowInvestments: () -> Void 9 | let onShowLoading: () -> Void 10 | let onHideLoading: () -> Void 11 | let onShowShadow: () -> Void 12 | let onHideShadow: () -> Void 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/ReceiveAddress/Workers/ReceiveAddressManagerProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import RxCocoa 3 | import RxSwift 4 | 5 | protocol ReceiveAddressManagerProtocol { 6 | typealias Address = ReceiveAddress.Address 7 | 8 | var address: Address { get } 9 | func observeAddressChange() -> Observable
10 | } 11 | 12 | extension ReceiveAddress { 13 | typealias AddressManagerProtocol = ReceiveAddressManagerProtocol 14 | } 15 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Workers/ChartCardValueFormatter/ChartCardValueFormatter.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Charts 3 | 4 | public class ChartValueFormatter: NSObject { 5 | 6 | public var string: ((Double, AxisBase?) -> String?)? 7 | } 8 | 9 | extension ChartValueFormatter: IAxisValueFormatter { 10 | 11 | public func stringForValue(_ value: Double, axis: AxisBase?) -> String { 12 | return self.string?(value, axis) ?? "" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Chart/Workers/ChartAmountFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol ChartAmountFormatterProtocol { 4 | func formatAmount(_ amount: Decimal, currency: String) -> String 5 | } 6 | 7 | extension Chart { 8 | typealias AmountFormatterProtocol = ChartAmountFormatterProtocol 9 | 10 | class AmountFormatter: SharedAmountFormatter { } 11 | } 12 | 13 | extension Chart.AmountFormatter: Chart.AmountFormatterProtocol { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Fees/Workers/FeeAmountFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol FeeAmountFormatterProtocol { 4 | func assetAmountToString(_ amount: Decimal, currency: String) -> String 5 | } 6 | 7 | extension Fees { 8 | typealias AmountFormatterProtocol = FeeAmountFormatterProtocol 9 | 10 | class AmountFormatter: SharedAmountFormatter { } 11 | } 12 | 13 | extension Fees.AmountFormatter: Fees.AmountFormatterProtocol { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/SaleOverview/Workers/SaleOverviewProgressValueFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UICircularProgressRing 3 | 4 | extension SaleOverview { 5 | 6 | class CircleProgressValueFormatter: UICircularRingValueFormatter { 7 | func string(for value: Any) -> String? { 8 | if let float = value as? CGFloat { 9 | return "\(Int(float))%" 10 | } 11 | return nil 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/CreateOffer/Workers/CreateOfferAmountFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension CreateOffer { 4 | class AmountFormatter: SharedAmountFormatter { } 5 | } 6 | 7 | extension CreateOffer.AmountFormatter: CreateOffer.AmountFormatterProtocol { 8 | func formatTotal( 9 | _ amount: CreateOffer.Model.Amount 10 | ) -> String { 11 | 12 | return self.formatAmount(amount.value ?? 0.0, currency: amount.asset) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Sales/Workers/SalesInvestedAmountFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol SalesInvestedAmountFormatterProtocol { 4 | func formatAmount(_ amount: Decimal, currency: String) -> String 5 | } 6 | 7 | extension Sales { 8 | typealias InvestedAmountFormatter = SalesInvestedAmountFormatterProtocol 9 | 10 | class AmountFormatter: SharedAmountFormatter { } 11 | } 12 | 13 | extension Sales.AmountFormatter: Sales.InvestedAmountFormatter { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TradesList/Workers/TradesListAmountFormatterProtocol.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | public protocol TradesListAmountFormatterProtocol { 4 | 5 | func assetAmountToString(_ amount: Decimal) -> String 6 | } 7 | 8 | extension TradesList { 9 | public typealias AmountFormatterProtocol = TradesListAmountFormatterProtocol 10 | 11 | @objc(TradesListAmountFormatter) 12 | public class AmountFormatter: SharedAmountFormatter, AmountFormatterProtocol { } 13 | } 14 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/TokenDWalletTemplate.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.developer.associated-domains 6 | 7 | applinks:demo.tokend.io 8 | webcredentials:demo.tokend.io 9 | activitycontinuation:demo.tokend.io 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/AssetPicker/Workers/AssetPickerAmountFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol AssetPickerAmountFormatterProtocol { 4 | func assetAmountToString(_ amount: Decimal) -> String 5 | } 6 | 7 | extension AssetPicker { 8 | typealias AmountFormatterProtocol = AssetPickerAmountFormatterProtocol 9 | 10 | class AmountFormatter: SharedAmountFormatter { } 11 | } 12 | 13 | extension AssetPicker.AmountFormatter: AssetPicker.AmountFormatterProtocol { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/DepositScene/Workers/DepositSceneAddressManagerProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol DepositSceneAddressManagerProtocol { 4 | func renewAddressForAsset( 5 | asset: String, 6 | externalSystemType: Int32 7 | ) 8 | func bindAddressForAsset( 9 | asset: String, 10 | externalSystemType: Int32 11 | ) 12 | } 13 | 14 | extension DepositScene { 15 | typealias AddressManagerProtocol = DepositSceneAddressManagerProtocol 16 | } 17 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/SaleInvest/Workers/SaleInvestAmountFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol SaleInvestAmountFormatterProtocol { 4 | func formatAmount(_ amount: Decimal, currency: String) -> String 5 | } 6 | 7 | extension SaleInvest { 8 | typealias AmountFormatterProtocol = SaleInvestAmountFormatterProtocol 9 | 10 | class AmountFormatter: SharedAmountFormatter { } 11 | } 12 | 13 | extension SaleInvest.AmountFormatter: SaleInvest.AmountFormatterProtocol { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Trade/TradeRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension Trade { 4 | struct Routing { 5 | let onSelectPendingOffers: () -> Void 6 | let onDidSelectOffer: (_ baseAmount: Model.Amount, _ price: Model.Amount) -> Void 7 | let onDidSelectNewOffer: (_ baseAsset: String, _ quoteAsset: String) -> Void 8 | let onShowError: (_ erroMessage: String) -> Void 9 | let onShowProgress: () -> Void 10 | let onHideProgress: () -> Void 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/BalancePicker/Workers/BalancePickerAmountFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol BalancePickerAmountFormatterProtocol { 4 | func assetAmountToString(_ amount: Decimal) -> String 5 | } 6 | 7 | extension BalancePicker { 8 | typealias AmountFormatterProtocol = BalancePickerAmountFormatterProtocol 9 | 10 | class AmountFormatter: SharedAmountFormatter { } 11 | } 12 | 13 | extension BalancePicker.AmountFormatter: BalancePicker.AmountFormatterProtocol { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Workers/BalanceCreator/BalanceCreatorProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | enum BalanceCreatorProtocolCreateBalanceResult { 4 | case succeeded 5 | case failed 6 | } 7 | 8 | protocol BalanceCreatorProtocol { 9 | typealias Asset = String 10 | typealias CreateBalanceResult = BalanceCreatorProtocolCreateBalanceResult 11 | 12 | func createBalanceForAsset( 13 | _ asset: Asset, 14 | completion: @escaping (CreateBalanceResult) -> Void 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/BalanceHeaderWithPicker/Workers/BalanceHeaderWithPickerAmountFormatterProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol BalanceHeaderWithPickerAmountFormatterProtocol { 4 | typealias Amount = BalanceHeaderWithPicker.Model.Amount 5 | 6 | func formatBalance(_ balance: Amount) -> String 7 | func formatRate(_ rate: Amount) -> String 8 | } 9 | 10 | extension BalanceHeaderWithPicker { 11 | typealias AmountFormatterProtocol = BalanceHeaderWithPickerAmountFormatterProtocol 12 | } 13 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/BalancesList/Workers/BalancesListAmountFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol BalancesListAmountFormatterProtocol { 4 | func formatAmount(_ amount: Decimal, currency: String) -> String 5 | } 6 | 7 | extension BalancesList { 8 | typealias AmountFormatterProtocol = BalancesListAmountFormatterProtocol 9 | 10 | class AmountFormatter: SharedAmountFormatter { } 11 | } 12 | 13 | extension BalancesList.AmountFormatter: BalancesList.AmountFormatterProtocol { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Dashboard/PlugIns/Payments/Workers/DashboardPaymentsPlugInAmountFormatterProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol DashboardPaymentsPlugInAmountFormatterProtocol { 4 | typealias Amount = DashboardPaymentsPlugIn.Model.Amount 5 | 6 | func formatBalance(_ balance: Amount) -> String 7 | func formatRate(_ rate: Amount) -> String 8 | } 9 | 10 | extension DashboardPaymentsPlugIn { 11 | typealias AmountFormatterProtocol = DashboardPaymentsPlugInAmountFormatterProtocol 12 | } 13 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TransactionDetails/Worker/TransactionDetailsAmountFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension TransactionDetails { 4 | class AmountFormatter: SharedAmountFormatter { } 5 | } 6 | 7 | extension TransactionDetails.AmountFormatter: TransactionDetails.AmountFormatterProtocol { 8 | func formatAmount( 9 | _ amount: TransactionDetails.Model.Amount 10 | ) -> String { 11 | 12 | return self.formatAmount(amount.value, currency: amount.asset) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Controllers/UserDataProvider.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import TokenDSDK 3 | 4 | protocol UserDataProviderProtocol { 5 | 6 | var userEmail: String { get } 7 | var accountId: String { get } 8 | var walletData: WalletData { get } 9 | var walletId: String { get } 10 | } 11 | 12 | struct UserDataProvider { 13 | let userEmail: String 14 | let accountId: String 15 | let walletData: WalletData 16 | let walletId: String 17 | } 18 | 19 | extension UserDataProvider: UserDataProviderProtocol { } 20 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/VerifyEmail/Workers/VerifyEmailVerifyWorkerProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import TokenDSDK 3 | 4 | enum VerifyEmailVerifyResult { 5 | case succeded 6 | case failed(Swift.Error) 7 | } 8 | 9 | protocol VerifyEmailVerifyWorkerProtocol { 10 | typealias Result = VerifyEmailVerifyResult 11 | 12 | func performVerifyRequest( 13 | token: String, 14 | completion: @escaping (_ result: Result) -> Void 15 | ) 16 | 17 | func verifyEmailTokenFrom(url: URL) -> String? 18 | } 19 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/SaleInvest/Workers/SaleInvesInvestedAmountFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol SaleInvestInvestedAmountFormatterProtocol { 4 | func assetAmountToString(_ amount: Decimal) -> String 5 | } 6 | 7 | extension SaleInvest { 8 | typealias InvestedAmountFormatterProtocol = SaleInvestInvestedAmountFormatterProtocol 9 | 10 | class InvestAmountFormatter: SharedAmountFormatter { } 11 | } 12 | 13 | extension SaleInvest.InvestAmountFormatter: SaleInvest.InvestedAmountFormatterProtocol { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/WalletRecovery/WalletRecoveryModels.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | enum WalletRecovery { 4 | 5 | // MARK: - Typealiases 6 | 7 | // MARK: - 8 | 9 | enum Model {} 10 | enum Event {} 11 | } 12 | 13 | // MARK: - Models 14 | 15 | extension WalletRecovery.Model { 16 | 17 | } 18 | 19 | // MARK: - Events 20 | 21 | extension WalletRecovery.Event { 22 | enum ViewDidLoad { 23 | struct Request {} 24 | struct Response {} 25 | struct ViewModel {} 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Extensions/Hashable+Iterate.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension Hashable { 4 | private static func iterate() -> AnyIterator { 5 | var index = 0 6 | return AnyIterator { 7 | let next = withUnsafeBytes(of: &index) { $0.load(as: self) } 8 | if next.hashValue != index { return nil } 9 | index += 1 10 | return next 11 | } 12 | } 13 | 14 | static var values: [Self] { 15 | return Array(Self.iterate()) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TransactionsList/TransactionsListRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension TransactionsListScene { 4 | struct Routing { 5 | let onDidSelectItemWithIdentifier: (Identifier, BalanceId) -> Void 6 | let showSendPayment: (_ balanceId: String?) -> Void 7 | let showWithdraw: (_ balanceId: String?) -> Void 8 | let showDeposit: (_ asset: String?) -> Void 9 | let showReceive: () -> Void 10 | let showShadow: () -> Void 11 | let hideShadow: () -> Void 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Copyright.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Copyright.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "Copyright@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "Copyright@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TokenDetails/Workers/TokenDetailsAmountFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol TokenDetailsAmountFormatterProtocol { 4 | func assetAmountToString(_ amount: Decimal) -> String 5 | } 6 | 7 | extension TokenDetailsScene { 8 | typealias AmountFormatterProtocol = TokenDetailsAmountFormatterProtocol 9 | } 10 | 11 | extension TokenDetailsScene { 12 | class AmountFormatter: SharedAmountFormatter { } 13 | } 14 | 15 | extension TokenDetailsScene.AmountFormatter: TokenDetailsScene.AmountFormatterProtocol { 16 | 17 | } 18 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Extensions/UIResponder+First.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | extension UIResponder { 4 | 5 | private struct Static { 6 | static weak var responder: UIResponder? 7 | } 8 | 9 | public static func currentFirst() -> UIResponder? { 10 | Static.responder = nil 11 | UIApplication.shared.sendAction(#selector(UIResponder._trap), to: nil, from: nil, for: nil) 12 | return Static.responder 13 | } 14 | 15 | @objc private func _trap() { 16 | Static.responder = self 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Dashboard/PlugIns/PendingOffers/DashboardPendingOffersPreviewPlugInModels.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | enum DashboardPendingOffersPreviewPlugIn { 4 | 5 | // MARK: - Typealiases 6 | 7 | // MARK: - 8 | 9 | enum Model {} 10 | enum Event {} 11 | } 12 | 13 | extension DashboardPendingOffersPreviewPlugIn.Model { } 14 | 15 | extension DashboardPendingOffersPreviewPlugIn.Event { 16 | enum DidSelectViewMore { 17 | struct Request { } 18 | struct Response { } 19 | struct ViewModel { } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/ReceiveAddress/Workers/ReceiveAddressInvoiceFormatterProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol ReceiveAddressInvoiceFormatterProtocol { 4 | func qrValueForAddress( 5 | _ address: ReceiveAddress.Address 6 | ) -> String 7 | 8 | func valueForAddress( 9 | _ address: ReceiveAddress.Address 10 | ) -> String 11 | 12 | var estimatedNumberOfLinesInValue: Int { get } 13 | } 14 | 15 | extension ReceiveAddress { 16 | typealias InvoiceFormatterProtocol = ReceiveAddressInvoiceFormatterProtocol 17 | } 18 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/ReceiveAddress/Workers/ReceiveAddressShareUtilProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol ReceiveAddressShareUtilProtocol { 4 | var canBeCopied: Bool { get } 5 | var canBeShared: Bool { get } 6 | 7 | func stringToCopyAddress( 8 | _ address: ReceiveAddress.Address 9 | ) -> String 10 | 11 | func itemsToShareAddress( 12 | _ address: ReceiveAddress.Address 13 | ) -> [Any] 14 | } 15 | 16 | extension ReceiveAddress { 17 | typealias ShareUtilProtocol = ReceiveAddressShareUtilProtocol 18 | } 19 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Settings/SettingsRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension Settings { 4 | struct Routing { 5 | let showProgress: () -> Void 6 | let hideProgress: () -> Void 7 | let showShadow: () -> Void 8 | let hideShadow: () -> Void 9 | let showErrorMessage: (_ errorMessage: String) -> Void 10 | let onCellSelected: (_ cellIdentifier: CellIdentifier) -> Void 11 | let onShowFees: () -> Void 12 | let onShowTerms: (_ url: URL) -> Void 13 | let onSignOut: () -> Void 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/SaleOverview/Workers/SaleOverviewInvestedAmountFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public protocol SaleOverviewInvestedAmountFormatterProtocol { 4 | 5 | func formatAmount(_ amount: Decimal, currency: String) -> String 6 | } 7 | 8 | extension SaleOverview { 9 | 10 | public typealias InvestedAmountFormatter = SaleOverviewInvestedAmountFormatterProtocol 11 | 12 | public class InvestAmountFormatter: SharedAmountFormatter { } 13 | } 14 | 15 | extension SaleOverview.InvestAmountFormatter: SaleOverview.InvestedAmountFormatter { } 16 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TransactionDetails/TransactionDetailsRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension TransactionDetails { 4 | struct Routing { 5 | let successAction: () -> Void 6 | let showProgress: () -> Void 7 | let hideProgress: () -> Void 8 | let showError: (String) -> Void 9 | let showMessage: (String) -> Void 10 | let showDialog: ( 11 | _ title: String, 12 | _ message: String, 13 | _ options: [String], 14 | _ onSelected: @escaping ((Int) -> Void) 15 | ) -> Void 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/BalanceHeaderWithPicker/Workers/BalanceHeaderWithPickerBalancesFetcherProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import RxCocoa 3 | import RxSwift 4 | 5 | protocol BalanceHeaderWithPickerBalancesFetcherProtocol { 6 | typealias HeaderBalance = BalanceHeaderWithPicker.Model.Balance 7 | 8 | var headerBalances: [HeaderBalance] { get } 9 | 10 | func observeHeaderBalances() -> Observable<[HeaderBalance]> 11 | } 12 | 13 | extension BalanceHeaderWithPicker { 14 | typealias BalancesFetcherProtocol = BalanceHeaderWithPickerBalancesFetcherProtocol 15 | } 16 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Views/DynamicTableView/DynamicTableViewDataSourceDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | public protocol DynamicTableViewDataSourceDelegate: class { 4 | 5 | // MARK: - Data source 6 | 7 | func numberOfSections() -> Int 8 | 9 | func numberOfRowsIn(section: Int) -> Int 10 | 11 | func contentAt(indexPath: IndexPath, currentContent: UIView?) -> UIView? 12 | 13 | // MARK: - Delegate 14 | 15 | func onSelectRowAt(indexPath: IndexPath) 16 | 17 | // MARK: - Configs 18 | 19 | func showsCellSeparator() -> Bool 20 | } 21 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/DepositScene/Workers/DepositSceneQRCodeGeneratorProtocol.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | protocol DepositSceneQRCodeGeneratorProtocol { 4 | func generateQRCodeFromString( 5 | _ string: String, 6 | withTintColor tintColor: UIColor, 7 | backgroundColor: UIColor, 8 | size: CGSize, 9 | completion: @escaping (UIImage?) -> Void 10 | ) 11 | } 12 | 13 | extension DepositScene { 14 | typealias QRCodeGeneratorProtocol = DepositSceneQRCodeGeneratorProtocol 15 | } 16 | 17 | extension QRCodeGenerator: DepositScene.QRCodeGeneratorProtocol { } 18 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/APIConfiguration.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | api_endpoint 6 | https://api.demo.tokend.io 7 | storage_endpoint 8 | https://s3.eu-west-1.amazonaws.com/demo-identity-storage-festive-colden 9 | terms_address 10 | https://demo.tokend.io/terms 11 | kyc 12 | https://demo.tokend.io/verification 13 | 14 | 15 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TokenDetails/Workers/TokenDetailsSceneBalanceCreatorProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol TokenDetailsSceneBalanceCreatorProtocol { 4 | typealias CreateBalanceResult = BalanceCreatorProtocolCreateBalanceResult 5 | 6 | func createBalanceForAsset( 7 | _ asset: String, 8 | completion: @escaping (CreateBalanceResult) -> Void 9 | ) 10 | } 11 | 12 | extension TokenDetailsScene { 13 | typealias BalanceCreatorProtocol = TokenDetailsSceneBalanceCreatorProtocol 14 | } 15 | 16 | extension BalanceCreator: TokenDetailsScene.BalanceCreatorProtocol { } 17 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Add icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Add icon.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "Add icon@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "Add icon@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | }, 23 | "properties" : { 24 | "template-rendering-intent" : "template" 25 | } 26 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TokenDetails/Workers/TokenDetailsFetcherProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import RxCocoa 3 | import RxSwift 4 | 5 | protocol TokenDetailsFetcherProtocol { 6 | typealias Token = TokenDetailsScene.Model.Token 7 | typealias TokenIdentifier = TokenDetailsScene.TokenIdentifier 8 | 9 | func observeTokenWithIdentifier(_ identifier: TokenIdentifier) -> Observable 10 | func tokenForIdentifier(_ identifier: TokenIdentifier) -> Token? 11 | } 12 | 13 | extension TokenDetailsScene { 14 | typealias TokenDetailsFetcherProtocol = TokenDWalletTemplate.TokenDetailsFetcherProtocol 15 | } 16 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Trade/Workers/TradeOffersFetcherProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | enum TradeOffersFetchResult { 4 | case succeeded([Trade.Model.Offer]) 5 | case failed 6 | } 7 | 8 | protocol TradeOffersFetcherProtocol { 9 | func cancelRequests() 10 | func getOffers( 11 | forBuy: Bool, 12 | base: String, 13 | quote: String, 14 | completion: @escaping (TradeOffersFetchResult) -> Void 15 | ) 16 | } 17 | 18 | extension Trade { 19 | typealias OffersFetcherProtocol = TradeOffersFetcherProtocol 20 | typealias OffersFetchResult = TradeOffersFetchResult 21 | } 22 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Pending icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Pending icon.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "Pending icon@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "Pending icon@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | }, 23 | "properties" : { 24 | "template-rendering-intent" : "template" 25 | } 26 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/AuthenticatorAuth/Workers/AuthRequestQRCodeGenerator.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | protocol AuthRequestSceneQRCodeGeneratorProtocol { 4 | func generateQRCodeFromString( 5 | _ string: String, 6 | withTintColor tintColor: UIColor, 7 | backgroundColor: UIColor, 8 | size: CGSize, 9 | completion: @escaping (UIImage?) -> Void 10 | ) 11 | } 12 | 13 | extension AuthenticatorAuth { 14 | typealias AuthRequestQRCodeGeneratorProtocol = AuthRequestSceneQRCodeGeneratorProtocol 15 | } 16 | 17 | extension QRCodeGenerator: AuthenticatorAuth.AuthRequestQRCodeGeneratorProtocol { } 18 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Dashboard/PlugIns/Payments/Workers/DashboardPaymentsPlugInAmountFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension DashboardPaymentsPlugIn { 4 | class AmountFormatter: SharedAmountFormatter { } 5 | } 6 | 7 | extension DashboardPaymentsPlugIn.AmountFormatter: DashboardPaymentsPlugIn.AmountFormatterProtocol { 8 | 9 | func formatBalance(_ balance: Amount) -> String { 10 | return self.formatAmount(balance.value, currency: balance.asset) 11 | } 12 | 13 | func formatRate(_ rate: Amount) -> String { 14 | return self.formatAmount(rate.value, currency: rate.asset) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Protocols/DecimalFloorRoundingBehavior.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | class DecimalFloorRoundingBehavior: NSDecimalNumberBehaviors { 4 | func roundingMode() -> NSDecimalNumber.RoundingMode { 5 | return .down 6 | } 7 | 8 | func scale() -> Int16 { 9 | return 0 10 | } 11 | 12 | func exceptionDuringOperation( 13 | _ operation: Selector, 14 | error: NSDecimalNumber.CalculationError, 15 | leftOperand: NSDecimalNumber, 16 | rightOperand: NSDecimalNumber? 17 | ) -> NSDecimalNumber? { 18 | 19 | return nil 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Face ID icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Face ID icon.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "Face ID icon@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "Face ID icon@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | }, 23 | "properties" : { 24 | "template-rendering-intent" : "template" 25 | } 26 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/ExploreTokens/Workers/ExploreTokensSceneBalanceCreatorProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol ExploreTokensSceneBalanceCreatorProtocol { 4 | typealias Asset = String 5 | typealias CreateBalanceResult = BalanceCreatorProtocolCreateBalanceResult 6 | 7 | func createBalanceForAsset( 8 | _ asset: Asset, 9 | completion: @escaping (CreateBalanceResult) -> Void 10 | ) 11 | } 12 | 13 | extension ExploreTokensScene { 14 | typealias BalanceCreatorProtocol = ExploreTokensSceneBalanceCreatorProtocol 15 | } 16 | 17 | extension BalanceCreator: ExploreTokensScene.BalanceCreatorProtocol { } 18 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/ReceiveAddress/Workers/ReceiveAddressQRCodeGeneratorProtocol.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | protocol ReceiveAddressSceneQRCodeGeneratorProtocol { 4 | func generateQRCodeFromString( 5 | _ string: String, 6 | withTintColor tintColor: UIColor, 7 | backgroundColor: UIColor, 8 | size: CGSize, 9 | completion: @escaping (UIImage?) -> Void 10 | ) 11 | } 12 | 13 | extension ReceiveAddress { 14 | typealias ReceiveAddressQRCodeGeneratorProtocol = ReceiveAddressSceneQRCodeGeneratorProtocol 15 | } 16 | 17 | extension QRCodeGenerator: ReceiveAddress.ReceiveAddressQRCodeGeneratorProtocol { } 18 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TransactionsList/Workers/TransactionsListSceneRateProviderProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import RxCocoa 3 | import RxSwift 4 | 5 | protocol TransactionsListSceneRateProviderProtocol { 6 | 7 | var rate: Observable { get } 8 | 9 | func rateForAmount( 10 | _ amount: Decimal, 11 | ofAsset asset: String, 12 | destinationAsset: String 13 | ) -> Decimal? 14 | } 15 | 16 | extension TransactionsListScene { 17 | typealias RateProviderProtocol = TransactionsListSceneRateProviderProtocol 18 | } 19 | 20 | extension RateProvider: TransactionsListScene.RateProviderProtocol { } 21 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Settings icons/Touch ID icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Touch ID icon.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "Touch ID icon@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "Touch ID icon@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | }, 23 | "properties" : { 24 | "template-rendering-intent" : "template" 25 | } 26 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Polls/Workers/PollsPercentFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public protocol PollsPercentFormatterProtocol { 4 | func formatPercantage(percent: Float) -> String 5 | } 6 | 7 | extension Polls { 8 | public typealias PercentFormatterProtocol = PollsPercentFormatterProtocol 9 | 10 | public class PercentFormatter: PercentFormatterProtocol { 11 | 12 | // MARK: - PercentFormatterProtocol 13 | 14 | public func formatPercantage(percent: Float) -> String { 15 | let value = ((percent * 100).rounded()) / 100 16 | return "\(value)%" 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/RecoverySeed/RecoverySeedRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension RecoverySeed { 4 | struct Routing { 5 | let onShowMessage: (_ message: String) -> Void 6 | let onRegisterFailure: (_ message: String) -> Void 7 | let onShowAlertDialog: ( 8 | _ message: String?, 9 | _ options: [String], 10 | _ onSelected: @escaping (_ selectedIndex: Int) -> Void 11 | ) -> Void 12 | let onSuccessfulRegister: (_ account: String, _ walletData: RegisterScene.Model.WalletData) -> Void 13 | let showLoading: () -> Void 14 | let hideLoading: () -> Void 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/SendPaymentAmount/Workers/SendPaymentAmountAmountFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol SendPaymentAmountFormatterProtocol { 4 | func formatAmount( 5 | _ amount: Decimal, 6 | currency: String 7 | ) -> String 8 | 9 | func assetAmountToString(_ amount: Decimal) -> String 10 | } 11 | 12 | extension SendPaymentAmount { 13 | typealias AmountFormatterProtocol = SendPaymentAmountFormatterProtocol 14 | 15 | class AmountFormatter: SharedAmountFormatter { } 16 | } 17 | 18 | extension SendPaymentAmount.AmountFormatter: SendPaymentAmount.AmountFormatterProtocol { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Controllers/TextEditingContext/Formatters/ValueFormatter.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | class ValueFormatter { 4 | 5 | func stringFromValue(_ value: ValueType?) -> String? { 6 | return nil 7 | } 8 | 9 | func valueFromString(_ string: String?) -> ValueType? { 10 | return nil 11 | } 12 | } 13 | 14 | class PlainTextValueFormatter: ValueFormatter { 15 | override func stringFromValue(_ value: String?) -> String? { 16 | return value 17 | } 18 | 19 | override func valueFromString(_ string: String?) -> String? { 20 | return string 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/BalanceHeaderWithPicker/Workers/BalanceHeaderWithPickerRateProviderProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import RxSwift 3 | import RxCocoa 4 | 5 | protocol BalanceHeaderWithPickerRateProviderProtocol { 6 | 7 | var rate: Observable { get } 8 | 9 | func rateForAmount( 10 | _ amount: Decimal, 11 | ofAsset asset: String, 12 | destinationAsset: String 13 | ) -> Decimal? 14 | } 15 | 16 | extension BalanceHeaderWithPicker { 17 | typealias RateProviderProtocol = BalanceHeaderWithPickerRateProviderProtocol 18 | } 19 | 20 | extension RateProvider: BalanceHeaderWithPicker.RateProviderProtocol { } 21 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Dashboard/PlugIns/Payments/Workers/DashboardPaymentsPlugInRateProviderProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import RxSwift 3 | import RxCocoa 4 | 5 | protocol DashboardPaymentsPlugInRateProviderProtocol { 6 | 7 | var rate: Observable { get } 8 | 9 | func rateForAmount( 10 | _ amount: Decimal, 11 | ofAsset asset: String, 12 | destinationAsset: String 13 | ) -> Decimal? 14 | } 15 | 16 | extension DashboardPaymentsPlugIn { 17 | typealias RateProviderProtocol = DashboardPaymentsPlugInRateProviderProtocol 18 | } 19 | 20 | extension RateProvider: DashboardPaymentsPlugIn.RateProviderProtocol { } 21 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Extensions/TokenDWallet.PublicKey+base32EncodedString.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import TokenDWallet 3 | 4 | extension TokenDWallet.PublicKey { 5 | init?( 6 | base32EncodedString: String, 7 | expectedVersion: Base32Check.VersionByte 8 | ) { 9 | 10 | guard let data = try? Base32Check.decodeCheck( 11 | expectedVersion: expectedVersion, 12 | encoded: base32EncodedString 13 | ) else { 14 | return nil 15 | } 16 | 17 | var uint = Uint256() 18 | uint.wrapped = data 19 | self = .keyTypeEd25519(uint) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Controllers/TextEditingContext/Validators/DecimalMaxValueValidator.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | class DecimalMaxValueValidator: ValueValidator { 4 | 5 | // MARK: - Public properties 6 | 7 | var maxValue: Decimal? 8 | 9 | // MARK: - 10 | 11 | init(maxValue: Decimal?) { 12 | self.maxValue = maxValue 13 | } 14 | 15 | // MARK: - Overridden 16 | 17 | override func validate(value: Decimal?) -> Bool { 18 | guard let value = value, let maxValue = self.maxValue else { 19 | return true 20 | } 21 | 22 | return value <= maxValue 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/BalancesList/Workers/BalancesListPercentFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public protocol BalancesListPercentFormatterProtocol { 4 | func formatPercantage(percent: Double) -> String 5 | } 6 | 7 | extension BalancesList { 8 | typealias PercentFormatterProtocol = BalancesListPercentFormatterProtocol 9 | 10 | public class PercentFormatter: PercentFormatterProtocol { 11 | 12 | // MARK: - PercentFormatterProtocol 13 | 14 | public func formatPercantage(percent: Double) -> String { 15 | let value = ((percent * 100).rounded()) / 100 16 | return "\(value)%" 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Trade/Workers/TradeChartsFetcherProtocol.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | enum TradeChartsFetcherGetChartsResult { 4 | case success(charts: Trade.Charts) 5 | case failure 6 | } 7 | 8 | protocol TradeChartsFetcherProtocol { 9 | typealias GetChartsResult = TradeChartsFetcherGetChartsResult 10 | typealias Completion = (GetChartsResult) -> Void 11 | 12 | func getChartsForBaseAsset( 13 | _ base: String, 14 | quoteAsset quote: String, 15 | completion: @escaping Completion 16 | ) 17 | 18 | func cancelRequests() 19 | } 20 | 21 | extension Trade { 22 | typealias ChartsFetcherProtocol = TradeChartsFetcherProtocol 23 | } 24 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/ReceiveAddress/Workers/ReceiveAddressInvoiceFormatter.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | extension ReceiveAddress { 4 | struct InvoiceFormatter: InvoiceFormatterProtocol { 5 | 6 | var estimatedNumberOfLinesInValue: Int { 7 | return 1 8 | } 9 | 10 | func qrValueForAddress( 11 | _ address: ReceiveAddress.Address 12 | ) -> String { 13 | 14 | return address 15 | } 16 | 17 | func valueForAddress( 18 | _ address: ReceiveAddress.Address 19 | ) -> String { 20 | 21 | return address 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/SendPaymentDestination/SendPaymentDestinationRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension SendPaymentDestination { 4 | public struct Routing { 5 | let onSelectContactEmail: (_ completion: @escaping SelectContactEmailCompletion) -> Void 6 | let onPresentQRCodeReader: (_ completion: @escaping QRCodeReaderCompletion) -> Void 7 | let showWithdrawConformation: (_ sendWithdrawModel: Model.SendWithdrawModel) -> Void 8 | let showSendAmount: (_ destination: Model.SendDestinationModel) -> Void 9 | let showProgress: () -> Void 10 | let hideProgress: () -> Void 11 | let showError: (_ message: String) -> Void 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TokenDetails/Workers/TokenDetailsDocumentURLBuilder.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import TokenDSDK 3 | 4 | extension TokenDetailsScene { 5 | class DocumentURLBuilder: DocumentURLBuilderProtocol { 6 | 7 | private let apiConfiguration: APIConfigurationModel 8 | 9 | init( 10 | apiConfiguration: APIConfigurationModel 11 | ) { 12 | 13 | self.apiConfiguration = apiConfiguration 14 | } 15 | 16 | func getURLForTerms(_ terms: Asset.Details.Term) -> URL? { 17 | return URL(string: self.apiConfiguration.storageEndpoint + "/" + terms.key) 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Controllers/Providers/TFADataProvider.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import TokenDSDK 3 | 4 | protocol TFADataProviderProtocol { 5 | func getUserEmail() -> String? 6 | func getKdfParams() -> KDFParams? 7 | } 8 | 9 | extension UserDataManager: TFADataProviderProtocol { 10 | func getUserEmail() -> String? { 11 | return self.getMainAccount() 12 | } 13 | 14 | func getKdfParams() -> KDFParams? { 15 | guard let mainAccount = self.getMainAccount(), let walletData = self.getWalletData(account: mainAccount) else { 16 | return nil 17 | } 18 | 19 | return walletData.walletKDF.getWalletKDFParams().kdfParams 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Dashboard/Workers/DashboardPlugInsProvider.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import RxSwift 3 | import RxCocoa 4 | 5 | extension DashboardScene { 6 | class PlugInsProvider { 7 | 8 | private let plugIns: BehaviorRelay<[PlugIn]> 9 | 10 | init( 11 | plugIns: [PlugIn] 12 | ) { 13 | 14 | self.plugIns = BehaviorRelay(value: plugIns) 15 | } 16 | } 17 | } 18 | 19 | extension DashboardScene.PlugInsProvider: DashboardScene.PlugInsProviderProtocol { 20 | func observePlugIns() -> Observable<[DashboardPlugInsProviderProtocol.PlugIn]> { 21 | return self.plugIns.asObservable() 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Send.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "baseline_send_black_24pt_1x.png", 5 | "idiom": "universal", 6 | "scale": "1x" 7 | }, 8 | { 9 | "filename": "baseline_send_black_24pt_2x.png", 10 | "idiom": "universal", 11 | "scale": "2x" 12 | }, 13 | { 14 | "filename": "baseline_send_black_24pt_3x.png", 15 | "idiom": "universal", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "author": "xcode", 21 | "template-rendering-intent": "template", 22 | "version": 1 23 | } 24 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/SendPaymentAmount/SendPaymentAmountRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension SendPaymentAmount { 4 | struct Routing { 5 | let onShowProgress: () -> Void 6 | let onHideProgress: () -> Void 7 | let onShowError: (_ erroMessage: String) -> Void 8 | let onPresentPicker: ( 9 | _ options: [String], 10 | _ onSelect: @escaping (_ balanceId: String) -> Void 11 | ) -> Void 12 | let onSendAction: ((_ sendModel: Model.SendPaymentModel) -> Void)? 13 | let onShowWithdrawDestination: ((_ sendModel: Model.SendWithdrawModel) -> Void)? 14 | let showFeesOverview: (_ asset: String, _ feeType: Int32) -> Void 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Extensions/UIImage+ButtonImage.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | extension UIImage { 4 | static func resizableImageWithColor(_ color: UIColor) -> UIImage? { 5 | let size = CGSize(width: 1.0, height: 1.0) 6 | UIGraphicsBeginImageContext(size) 7 | guard let context = UIGraphicsGetCurrentContext() else { return nil } 8 | color.setFill() 9 | context.fill(CGRect(origin: CGPoint.zero, size: size)) 10 | guard let image = UIGraphicsGetImageFromCurrentImageContext() else { return nil } 11 | 12 | let resizableImage = image.resizableImage(withCapInsets: UIEdgeInsets.zero, resizingMode: .stretch) 13 | return resizableImage 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Resources/Assets.xcassets/Fee.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "baseline_flash_on_black_24pt_1x.png", 5 | "idiom": "universal", 6 | "scale": "1x" 7 | }, 8 | { 9 | "filename": "baseline_flash_on_black_24pt_2x.png", 10 | "idiom": "universal", 11 | "scale": "2x" 12 | }, 13 | { 14 | "filename": "baseline_flash_on_black_24pt_3x.png", 15 | "idiom": "universal", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "author": "xcode", 21 | "template-rendering-intent": "template", 22 | "version": 1 23 | } 24 | } -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/CreateOffer/Workers/CreateOfferFeeLoaderProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import TokenDSDK 3 | 4 | enum CreateOfferFeeLoaderResult { 5 | typealias FeeLoaderError = ApiErrors 6 | 7 | case succeeded(CreateOffer.Model.FeeModel) 8 | case failed(FeeLoaderError) 9 | } 10 | protocol CreateOfferFeeLoaderProtocol { 11 | typealias LoadFeeResult = CreateOfferFeeLoaderResult 12 | 13 | func loadFee( 14 | accountId: String, 15 | asset: String, 16 | amount: Decimal, 17 | completion: @escaping (_ result: LoadFeeResult) -> Void 18 | ) 19 | } 20 | 21 | extension CreateOffer { 22 | typealias FeeLoaderProtocol = CreateOfferFeeLoaderProtocol 23 | } 24 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Dashboard/Workers/DashboardPlugInsProviderProtocol.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import RxSwift 3 | import RxCocoa 4 | 5 | enum DashboardPlugInType { 6 | case view(UIView) 7 | case viewController(UIViewController) 8 | } 9 | 10 | protocol DashboardPlugInProtocol { 11 | var type: DashboardPlugInType { get } 12 | 13 | func reloadData() 14 | } 15 | 16 | protocol DashboardPlugInsProviderProtocol { 17 | typealias PlugIn = DashboardPlugInProtocol 18 | 19 | func observePlugIns() -> Observable<[PlugIn]> 20 | } 21 | 22 | extension DashboardScene { 23 | typealias PlugIn = DashboardPlugInProtocol 24 | typealias PlugInsProviderProtocol = DashboardPlugInsProviderProtocol 25 | } 26 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/BalanceHeaderWithPicker/Workers/BalanceHeaderWithPickerAmountFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension BalanceHeaderWithPicker { 4 | class AmountFormatter: SharedAmountFormatter { } 5 | } 6 | 7 | extension BalanceHeaderWithPicker.AmountFormatter: BalanceHeaderWithPicker.AmountFormatterProtocol { 8 | 9 | func formatBalance(_ balance: BalanceHeaderWithPickerAmountFormatterProtocol.Amount) -> String { 10 | return self.formatAmount(balance.value, currency: balance.asset) 11 | } 12 | 13 | func formatRate(_ rate: BalanceHeaderWithPickerAmountFormatterProtocol.Amount) -> String { 14 | return self.formatAmount(rate.value, currency: rate.asset) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Views/BXFStaticTableView/BXFStaticTableViewInfoSection.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | class BXFStaticTableViewInfoSection { 4 | 5 | var section: UIView = UIView() 6 | let header: BXFStaticTableViewSectionHeaderFooterView 7 | let footer: BXFStaticTableViewSectionHeaderFooterView 8 | 9 | init(header: String, 10 | footer: String) { 11 | self.header = BXFStaticTableViewSectionHeaderFooterView.instantiate(with: .header, text: header) 12 | self.header.setTopInset(12) 13 | self.header.setBottomInset(0) 14 | self.footer = BXFStaticTableViewSectionHeaderFooterView.instantiate(with: .footer, text: footer) 15 | self.footer.setTopInset(0) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Dashboard/PlugIns/Payments/Workers/DashboardPaymentsPlugInBalancesFetcherProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import RxCocoa 3 | import RxSwift 4 | 5 | protocol DashboardPaymentsPlugInBalancesFetcherProtocol { 6 | typealias PaymentsPreviewBalance = DashboardPaymentsPlugIn.Model.Balance 7 | typealias LoadingStatus = DashboardPaymentsPlugIn.Model.LoadingStatus 8 | 9 | var paymentsPreviewBalances: [PaymentsPreviewBalance] { get } 10 | 11 | func observePaymentsPreviewBalances() -> Observable<[PaymentsPreviewBalance]> 12 | func refreshPaymentsPreviewBalances() 13 | } 14 | 15 | extension DashboardPaymentsPlugIn { 16 | typealias BalancesFetcherProtocol = DashboardPaymentsPlugInBalancesFetcherProtocol 17 | } 18 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TabBar/Views/TabBarTabBarItem.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | extension TabBar { 4 | 5 | class TabBarItem: UITabBarItem { 6 | 7 | let identifier: Model.TabIdentifier 8 | 9 | // MARK: - 10 | 11 | init( 12 | title: String?, 13 | image: UIImage?, 14 | identifier: Model.TabIdentifier 15 | ) { 16 | 17 | self.identifier = identifier 18 | super.init() 19 | 20 | self.title = title 21 | self.image = image 22 | } 23 | 24 | required init?(coder aDecoder: NSCoder) { 25 | fatalError("init(coder:) has not been implemented") 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/AuthenticatorAuth/Workers/AuthAppAvailibilityChecker.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | protocol AuthAppAvailibilityCheckerProtocol { 4 | func isAppAvailable() -> Bool 5 | } 6 | 7 | extension AuthenticatorAuth { 8 | 9 | class AuthAppAvailibilityChecker { 10 | 11 | // MARK: - Private properties 12 | 13 | private let scheme: String = "tokend://auth" 14 | } 15 | } 16 | 17 | extension AuthenticatorAuth.AuthAppAvailibilityChecker: AuthAppAvailibilityCheckerProtocol { 18 | 19 | func isAppAvailable() -> Bool { 20 | guard let urlSceme = URL(string: self.scheme) else { 21 | return false 22 | } 23 | 24 | return UIApplication.shared.canOpenURL(urlSceme) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/SaleOverview/Workers/SaleInfoTextFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol SaleOverviewTextFormatterProtocol { 4 | 5 | func formatText(text: String) -> String 6 | } 7 | 8 | extension SaleOverview { 9 | 10 | class TextFormatter: SaleOverviewTextFormatterProtocol { 11 | 12 | func formatText(text: String) -> String { 13 | guard let textData = text.data(using: .utf8), 14 | let jsonObject = try? JSONSerialization.jsonObject( 15 | with: textData, 16 | options: .allowFragments 17 | ) else { 18 | return text 19 | } 20 | 21 | return "\(jsonObject)" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Trade/Workers/TradeAssetsFetcherProtocol.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import RxSwift 3 | import RxCocoa 4 | 5 | public enum TradeableAssetsFetcherLoadingStatus { 6 | case loading 7 | case loaded 8 | } 9 | 10 | public protocol TradeableAssetsFetcherProtocol { 11 | 12 | typealias Asset = Trade.Model.Asset 13 | typealias LoadingStatus = TradeableAssetsFetcherLoadingStatus 14 | 15 | var assets: [Asset] { get } 16 | func updateAssets() 17 | func observeAssets() -> Observable<[Asset]> 18 | func observeAssetsLoadingStatus() -> Observable 19 | func observeAssetsError() -> Observable 20 | } 21 | 22 | extension Trade { 23 | public typealias AssetsFetcherProtocol = TradeableAssetsFetcherProtocol 24 | } 25 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TradeOffers/Workers/TradeOffersChartsFetcherProtocol.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | public enum TradeOffersChartsFetcherGetChartsResult { 4 | case failure(Swift.Error) 5 | case success(charts: TradeOffers.Model.Charts) 6 | } 7 | 8 | public protocol TradeOffersChartsFetcherProtocol { 9 | 10 | typealias GetChartsResult = TradeOffersChartsFetcherGetChartsResult 11 | typealias Completion = (GetChartsResult) -> Void 12 | 13 | func getChartsForBaseAsset( 14 | _ base: String, 15 | quoteAsset quote: String, 16 | completion: @escaping Completion 17 | ) 18 | 19 | func cancelRequests() 20 | } 21 | 22 | extension TradeOffers { 23 | public typealias ChartsFetcherProtocol = TradeOffersChartsFetcherProtocol 24 | } 25 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Views/BXFStaticTableView/BXFScrollViewWithKeyboardResponder.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | class BXFScrollViewWithKeyboardResponder: UIScrollView { //KeyboardResponder 4 | 5 | var observers: [NSObjectProtocol] = [] 6 | 7 | var hidesKeyboardOnTap: Bool { 8 | return true 9 | } 10 | 11 | override init(frame: CGRect) { 12 | super.init(frame: frame) 13 | commonInit() 14 | } 15 | 16 | required init?(coder aDecoder: NSCoder) { 17 | super.init(coder: aDecoder) 18 | commonInit() 19 | } 20 | 21 | private func commonInit() { 22 | alwaysBounceVertical = true 23 | showsVerticalScrollIndicator = false 24 | showsHorizontalScrollIndicator = false 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/BiometricsAuth/BiometricsAuthModels.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | enum BiometricsAuth { 4 | 5 | // MARK: - Typealiases 6 | 7 | // MARK: - 8 | 9 | enum Model {} 10 | enum Event {} 11 | } 12 | 13 | // MARK: - Models 14 | 15 | extension BiometricsAuth.Model { 16 | 17 | } 18 | 19 | // MARK: - Events 20 | 21 | extension BiometricsAuth.Event { 22 | enum ViewDidAppear { 23 | struct Request {} 24 | 25 | struct Response { 26 | let result: BiometricsAuth.AuthWorker.Result 27 | } 28 | 29 | enum ViewModel { 30 | case failure 31 | case success(account: String) 32 | case userCancel 33 | case userFallback 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/SendPaymentDestination/Workers/WithdrawRecipientAddressResolver.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import TokenDWallet 3 | import TokenDSDK 4 | 5 | extension SendPaymentDestination { 6 | public class WithdrawRecipientAddressResolver: RecipientAddressResolver { 7 | 8 | // MARK: - Private properties 9 | 10 | private let generalApi: GeneralApi 11 | 12 | // MARK: - 13 | 14 | init(generalApi: GeneralApi) { 15 | self.generalApi = generalApi 16 | } 17 | 18 | public func resolve(recipientAddress: String, completion: @escaping (RecipientAddressResolverResult) -> Void) { 19 | completion(.succeeded(recipientAddress: recipientAddress)) 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/DepositScene/Workers/DepositSceneDateFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension DepositScene { 4 | 5 | class DateFormatter: DateFormatterProtocol { 6 | 7 | // MARK: - Private properties 8 | 9 | private let dateFormatter: Foundation.DateFormatter 10 | 11 | // MARK: - 12 | 13 | init() { 14 | self.dateFormatter = Foundation.DateFormatter() 15 | self.dateFormatter.dateStyle = .long 16 | self.dateFormatter.timeStyle = .short 17 | } 18 | 19 | // MARK: - Private properties 20 | 21 | func formatExpiratioDate(_ date: Date) -> String { 22 | return self.dateFormatter.string(from: date) 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/MarkdownViewer/MarkdownViewerModels.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | enum MarkdownViewer { 4 | 5 | // MARK: - Typealiases 6 | 7 | typealias DeinitCompletion = ((_ vc: UIViewController) -> Void)? 8 | 9 | // MARK: - 10 | 11 | enum Model {} 12 | enum Event {} 13 | } 14 | 15 | // MARK: - Models 16 | 17 | extension MarkdownViewer.Model { 18 | 19 | } 20 | 21 | // MARK: - Events 22 | 23 | extension MarkdownViewer.Event { 24 | 25 | typealias Model = MarkdownViewer.Model 26 | 27 | // MARK: - 28 | 29 | enum ViewDidLoad { 30 | struct Request {} 31 | 32 | struct Response { 33 | let markdownString: String 34 | } 35 | 36 | typealias ViewModel = Response 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/UpdatePassword/Worker/UpdatePasswordSubmitWorkerProtocol.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | enum UpdatePasswordSubmitResult { 4 | typealias SubmitError = Error 5 | 6 | case failed(UpdatePassword.Event.SubmitAction.Response.ErrorModel) 7 | case succeeded 8 | } 9 | 10 | protocol UpdatePasswordSubmitWorkerProtocol { 11 | typealias Result = UpdatePasswordSubmitResult 12 | 13 | func submitFields( 14 | _ fields: [UpdatePassword.Model.Field], 15 | startLoading: @escaping () -> Void, 16 | stopLoading: @escaping () -> Void, 17 | completion: @escaping (_ result: UpdatePasswordSubmitWorkerProtocol.Result) -> Void 18 | ) 19 | } 20 | 21 | extension UpdatePassword { 22 | typealias SubmitPasswordHandler = UpdatePasswordSubmitWorkerProtocol 23 | } 24 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Views/BXFStaticTableView/BXFGroupedHeaderFooterLabel.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | class BXFGroupedHeaderFooterLabel: BXFLabelWithInsets { 4 | static func headerFooterLabel() -> BXFGroupedHeaderFooterLabel { 5 | let label = BXFGroupedHeaderFooterLabel() 6 | // label.textColor = UIColor.TableView.Grouped.headerFooter 7 | // label.font = UITableView.fontForHeaderFooter 8 | label.textAlignment = .left 9 | label.numberOfLines = 0 10 | label.lineBreakMode = .byWordWrapping 11 | label.setContentHuggingPriority(.required, for: .vertical) 12 | label.setContentCompressionResistancePriority(.required, for: .horizontal) 13 | label.setContentCompressionResistancePriority(.required, for: .vertical) 14 | return label 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Dashboard/DashboardModels.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | enum DashboardScene { 4 | 5 | // MARK: - Typealiases 6 | 7 | // MARK: - 8 | 9 | enum Model {} 10 | enum Event {} 11 | } 12 | 13 | extension DashboardScene.Model { 14 | struct SceneModel { 15 | var plugIns: [DashboardScene.PlugIn] 16 | } 17 | } 18 | 19 | extension DashboardScene.Event { 20 | enum ViewDidLoadSync { 21 | struct Request { } 22 | } 23 | 24 | enum DidInitiateRefresh { 25 | struct Request { } 26 | } 27 | 28 | enum PlugInsDidChange { 29 | struct Response { 30 | let plugIns: [DashboardScene.PlugIn] 31 | } 32 | struct ViewModel { 33 | let plugIns: [DashboardScene.PlugIn] 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Controllers/TextEditingContext/Formatters/PrecisedFormatter.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | class PrecisedFormatter: DecimalFormatter { 4 | 5 | public static var precision: Int64 = 1_000_000 6 | 7 | override func valueFromString(_ string: String?) -> Decimal? { 8 | guard let value = super.valueFromString(string) else { 9 | return nil 10 | } 11 | 12 | let multiplied = NSDecimalNumber( 13 | decimal: value * Decimal(PrecisedFormatter.precision) 14 | ) 15 | let rounded = multiplied.rounding( 16 | accordingToBehavior: DecimalFloorRoundingBehavior() 17 | ) 18 | 19 | let diff = multiplied.decimalValue - rounded.decimalValue 20 | 21 | return diff == 0 ? value : nil 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Confirmation/Workers/ConfirmationSectionsProviderProtocol.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import RxSwift 3 | import RxCocoa 4 | 5 | enum ConfirmationResult { 6 | case failed(ConfirmationScene.Event.ConfirmAction.ConfirmError) 7 | case succeeded 8 | } 9 | 10 | protocol ConfirmationSectionsProviderProtocol { 11 | func observeConfirmationSections() -> Observable<[ConfirmationScene.Model.SectionModel]> 12 | func loadConfirmationSections() 13 | 14 | func handleTextEdit( 15 | identifier: ConfirmationScene.CellIdentifier, 16 | value: String? 17 | ) 18 | 19 | func handleBoolSwitch( 20 | identifier: ConfirmationScene.CellIdentifier, 21 | value: Bool 22 | ) 23 | 24 | func handleConfirmAction(completion: @escaping (_ result: ConfirmationResult) -> Void) 25 | } 26 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Trade/Workers/TradeAmountFormatterProtocol.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | protocol TradeAmountFormatterProtocol { 4 | func formatToken(_ amount: Trade.Model.Amount) -> String 5 | func formatTradeOrderToken(value: Decimal) -> String 6 | } 7 | 8 | extension Trade { 9 | typealias AmountFormatterProtocol = TradeAmountFormatterProtocol 10 | 11 | class AmountFormatter: SharedAmountFormatter { } 12 | } 13 | 14 | extension Trade.AmountFormatter: Trade.AmountFormatterProtocol { 15 | func formatToken(_ amount: Trade.Model.Amount) -> String { 16 | let value = amount.value 17 | let currency = amount.currency 18 | 19 | return "\(value) \(currency)" 20 | } 21 | 22 | func formatTradeOrderToken(value: Decimal) -> String { 23 | return "\(value)" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/ReceiveAddress/Workers/ReceiveAddressManager.swift: -------------------------------------------------------------------------------- 1 | import RxCocoa 2 | import RxSwift 3 | import UIKit 4 | 5 | extension ReceiveAddress { 6 | class ReceiveAddressManager { 7 | 8 | private let addressBehaviorRelay: BehaviorRelay 9 | 10 | init(accountId: String) { 11 | self.addressBehaviorRelay = BehaviorRelay(value: accountId) 12 | } 13 | } 14 | } 15 | 16 | extension ReceiveAddress.ReceiveAddressManager: ReceiveAddress.AddressManagerProtocol { 17 | var address: ReceiveAddressManagerProtocol.Address { 18 | return self.addressBehaviorRelay.value 19 | } 20 | 21 | func observeAddressChange() -> Observable { 22 | return self.addressBehaviorRelay.asObservable() 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/WalletRecovery/WalletRecoveryInteractor.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol WalletRecoveryBusinessLogic { 4 | func onViewDidLoad(request: WalletRecovery.Event.ViewDidLoad.Request) 5 | } 6 | 7 | extension WalletRecovery { 8 | typealias BusinessLogic = WalletRecoveryBusinessLogic 9 | 10 | class Interactor { 11 | 12 | private let presenter: PresentationLogic 13 | 14 | init(presenter: PresentationLogic) { 15 | self.presenter = presenter 16 | } 17 | } 18 | } 19 | 20 | extension WalletRecovery.Interactor: WalletRecovery.BusinessLogic { 21 | func onViewDidLoad(request: WalletRecovery.Event.ViewDidLoad.Request) { 22 | let response = WalletRecovery.Event.ViewDidLoad.Response() 23 | self.presenter.presentViewDidLoad(response: response) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TradesList/Workers/TradesListAssetPairsFetcherProtocol.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import RxSwift 3 | import RxCocoa 4 | 5 | public enum TradesListAssetPairsFetcherLoadingStatus { 6 | case loading 7 | case loaded 8 | } 9 | 10 | public protocol TradesListAssetPairsFetcherProtocol { 11 | 12 | typealias AssetPair = TradesList.Model.AssetPair 13 | typealias LoadingStatus = TradesListAssetPairsFetcherLoadingStatus 14 | 15 | var assetsPairs: [AssetPair] { get } 16 | func updateAssetPairs() 17 | func observeAssetPairs() -> Observable<[AssetPair]> 18 | func observeAssetPairsLoadingStatus() -> Observable 19 | func observeAssetPairsError() -> Observable 20 | } 21 | 22 | extension TradesList { 23 | public typealias AssetPairsFetcherProtocol = TradesListAssetPairsFetcherProtocol 24 | } 25 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TransactionDetails/Worker/TransactionDetailsDateFormatter.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | extension TransactionDetails { 4 | 5 | public class DateFormatter: DateFormatterProtocol { 6 | 7 | // MARK: - Private properties 8 | 9 | private let dateFormatter: Foundation.DateFormatter 10 | 11 | // MARK: - 12 | 13 | public init() { 14 | self.dateFormatter = Foundation.DateFormatter() 15 | self.dateFormatter.dateFormat = "dd MMM yyyy h:mm a" 16 | self.dateFormatter.amSymbol = "AM" 17 | self.dateFormatter.pmSymbol = "PM" 18 | } 19 | 20 | // MARK: - DateFormatterProtocol 21 | 22 | func dateToString(date: Date) -> String { 23 | return self.dateFormatter.string(from: date) 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/AuthenticatorAuth/Workers/DownloadUrlFetcher.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol DownloadUrlFetcherProtocol { 4 | func fetchUrl() -> URL? 5 | } 6 | 7 | extension AuthenticatorAuth { 8 | 9 | class DownloadUrlFethcer { 10 | 11 | // MARK: - Private properties 12 | 13 | private let apiConfiguration: APIConfigurationModel 14 | 15 | // MARK: - 16 | 17 | init(apiConfiguration: APIConfigurationModel) { 18 | self.apiConfiguration = apiConfiguration 19 | } 20 | } 21 | } 22 | 23 | extension AuthenticatorAuth.DownloadUrlFethcer: DownloadUrlFetcherProtocol { 24 | func fetchUrl() -> URL? { 25 | guard let urLString = self.apiConfiguration.downloadUrl else { 26 | return nil 27 | } 28 | return URL(string: urLString) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Workers/TermsInfoProvider/TermsInfoProvider.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | struct TermsInfoProvider { 4 | 5 | // MARK: - Public properties 6 | 7 | let apiConfigurationModel: APIConfigurationModel 8 | 9 | // MARK: - 10 | 11 | init(apiConfigurationModel: APIConfigurationModel) { 12 | self.apiConfigurationModel = apiConfigurationModel 13 | } 14 | 15 | // MARK: - Public 16 | 17 | func getTermsUrl() -> URL? { 18 | var termsUrl: URL? 19 | if var termsAddress = self.apiConfigurationModel.termsAddress { 20 | if !(termsAddress.hasPrefix("http://") || termsAddress.hasPrefix("https://")) { 21 | termsAddress = "https://\(termsAddress)" 22 | } 23 | termsUrl = URL(string: termsAddress) 24 | } 25 | 26 | return termsUrl 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Controllers/AppUtils/AppInfoUtils.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | enum AppInfoUtils { 4 | 5 | enum PropertyKey: String { 6 | case bundleDisplayName = "CFBundleDisplayName" 7 | } 8 | 9 | static func hasValue(_ key: PropertyKey) -> Bool { 10 | guard let info = Bundle.main.infoDictionary else { 11 | return false 12 | } 13 | 14 | let value = info[key.rawValue] 15 | 16 | return value != nil 17 | } 18 | 19 | static func getValue(_ key: PropertyKey, _ defaultValue: Type) -> Type { 20 | guard let info = Bundle.main.infoDictionary else { 21 | return defaultValue 22 | } 23 | 24 | guard let value = info[key.rawValue] as? Type else { 25 | return defaultValue 26 | } 27 | 28 | return value 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/DepositScene/Workers/DepositSceneAssetsFetcherProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import RxSwift 3 | 4 | enum DepositSceneAssetsFetcherLoadingStatus { 5 | case loading 6 | case loaded 7 | } 8 | 9 | protocol DepositSceneAssetsFetcherProtocol { 10 | typealias Asset = DepositScene.Model.Asset 11 | typealias AssetID = DepositScene.AssetID 12 | typealias LoadingStatus = DepositSceneAssetsFetcherLoadingStatus 13 | 14 | var assets: [Asset] { get } 15 | 16 | func observeAssets() -> Observable<[Asset]> 17 | func observeAssetsLoadingStatus() -> Observable 18 | func observeAssetsErrorStatus() -> Observable 19 | 20 | func refreshAssets() 21 | 22 | func assetForId(_ id: AssetID) -> Asset? 23 | } 24 | 25 | extension DepositScene { 26 | typealias AssetsFetcherProtocol = DepositSceneAssetsFetcherProtocol 27 | } 28 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Views/BXFStaticTableView/BXFStaticTableViewInputSection/BXFStaticTableViewInputSection.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | class BXFStaticTableViewInputSection { 4 | 5 | static func create( 6 | with title: String?, 7 | cell cellContent: UIView, 8 | footer description: String? 9 | ) -> BXFStaticTableViewSection { 10 | 11 | let header = BXFStaticTableViewSectionHeaderFooterView.instantiate(with: .header, text: title) 12 | 13 | let cell: BXFStaticTableViewSectionCell = BXFStaticTableViewSectionCell.instantiate( 14 | with: cellContent, 15 | border: true 16 | ) 17 | 18 | let footer = BXFStaticTableViewSectionHeaderFooterView.instantiate(with: .footer, text: description) 19 | 20 | return BXFStaticTableViewSection(header: header, cell: cell, footer: footer) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Chart/Workers/ChartDateFormatter.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | protocol ChartSceneDateFormatterProtocol { 4 | func dateToString(_ date: Date) -> String 5 | } 6 | 7 | extension Chart { 8 | typealias DateFormatterProtocol = ChartSceneDateFormatterProtocol 9 | 10 | class DateFormatter: DateFormatterProtocol { 11 | 12 | // MARK: - Private properties 13 | 14 | private let dateFormatter: Foundation.DateFormatter 15 | 16 | // MARK: - 17 | 18 | public init() { 19 | self.dateFormatter = Foundation.DateFormatter() 20 | self.dateFormatter.dateFormat = "HH:mm, dd MMM yy" 21 | } 22 | 23 | // MARK: - DateFormatterProtocol 24 | 25 | func dateToString(_ date: Date) -> String { 26 | return self.dateFormatter.string(from: date) 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TradeOffers/Workers/TradeOffersOffersFetcherProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import RxCocoa 3 | import RxSwift 4 | 5 | public enum TradeOffersOffersFetcherLoadingStatus { 6 | case loaded 7 | case loading 8 | } 9 | 10 | public protocol TradeOffersOffersFetcherProtocol { 11 | 12 | typealias LoadingStatus = TradeOffersOffersFetcherLoadingStatus 13 | typealias OrderBook = TradeOffers.Model.OrderBook 14 | 15 | func getOrderBookValue() -> OrderBook 16 | func getLoadingStatusValue() -> LoadingStatus 17 | 18 | func observeOrderBook(pageSize: Int) -> Observable 19 | func reloadOrderBook() 20 | func observeLoadingStatus() -> Observable 21 | func observeErrorStatus() -> Observable 22 | } 23 | 24 | extension TradeOffers { 25 | 26 | public typealias OffersFetcherProtocol = TradeOffersOffersFetcherProtocol 27 | } 28 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Workers/BalanceCreator/BalanceCreator.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | class BalanceCreator: BalanceCreatorProtocol { 4 | 5 | private let balancesRepo: BalancesRepo 6 | 7 | init( 8 | balancesRepo: BalancesRepo 9 | ) { 10 | 11 | self.balancesRepo = balancesRepo 12 | } 13 | 14 | func createBalanceForAsset( 15 | _ asset: BalanceCreatorProtocol.Asset, 16 | completion: @escaping (BalanceCreatorProtocol.CreateBalanceResult) -> Void 17 | ) { 18 | 19 | self.balancesRepo.createBalanceForAsset( 20 | asset 21 | ) { (result) in 22 | switch result { 23 | 24 | case .succeeded: 25 | completion(.succeeded) 26 | 27 | case .failed: 28 | completion(.failed) 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Extensions/UIViewController+ChildViewController.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | extension UIViewController { 4 | 5 | func addChild( 6 | _ childController: UIViewController, 7 | to containerView: UIView, 8 | layoutFulledge: Bool 9 | ) { 10 | 11 | self.addChild(childController) 12 | containerView.addSubview(childController.view) 13 | if layoutFulledge { 14 | childController.view.snp.makeConstraints { (make) in 15 | make.edges.equalToSuperview() 16 | } 17 | } 18 | childController.didMove(toParent: self) 19 | } 20 | 21 | func removeChildViewController( 22 | _ childController: UIViewController 23 | ) { 24 | 25 | childController.willMove(toParent: nil) 26 | childController.view.removeFromSuperview() 27 | childController.removeFromParent() 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TradeOffers/Workers/TradeOffersTradesFetcherProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import RxCocoa 3 | import RxSwift 4 | 5 | public enum TradeOffersTradesFetcherLoadingStatus { 6 | case loaded 7 | case loading 8 | } 9 | 10 | public protocol TradeOffersTradesFetcherProtocol { 11 | 12 | typealias LoadingStatus = TradeOffersTradesFetcherLoadingStatus 13 | typealias Item = TradeOffers.Model.Trade 14 | 15 | func getItemsValue() -> [Item] 16 | func getLoadingStatusValue() -> LoadingStatus 17 | func getHasMoreItems() -> Bool 18 | 19 | func observeItems(pageSize: Int) -> Observable<[Item]> 20 | func reloadItems() 21 | func loadMoreItems() 22 | func observeLoadingStatus() -> Observable 23 | func observeErrorStatus() -> Observable 24 | } 25 | 26 | extension TradeOffers { 27 | 28 | public typealias TradesFetcherProtocol = TradeOffersTradesFetcherProtocol 29 | } 30 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TransactionDetails/Worker/TransactionDetailsSectionsProviderProtocol.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import RxCocoa 3 | import RxSwift 4 | import TokenDSDK 5 | 6 | struct TransactionDetailsProviderAction { 7 | let id: String 8 | let icon: UIImage 9 | let title: String 10 | let message: String 11 | } 12 | 13 | protocol TransactionDetailsProviderProtocol { 14 | typealias Action = TransactionDetailsProviderAction 15 | 16 | func observeTransaction() -> Observable<[TransactionDetails.Model.SectionModel]> 17 | func getActions() -> [Action] 18 | func performActionWithId( 19 | _ id: String, 20 | onSuccess: @escaping () -> Void, 21 | onShowLoading: @escaping () -> Void, 22 | onHideLoading: @escaping () -> Void, 23 | onError: @escaping (String) -> Void 24 | ) 25 | } 26 | 27 | extension TransactionDetails { 28 | typealias SectionsProviderProtocol = TransactionDetailsProviderProtocol 29 | } 30 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TransactionsList/Workers/TransactionsListSceneTransactionsProviderProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import TokenDSDK 3 | import RxSwift 4 | 5 | protocol TransactionsListSceneTransactionsProviderProtocol { 6 | func observeParicipantEffects() -> Observable<[ParticipantEffectResource]> 7 | func observeLoadingStatus() -> Observable 8 | func observeLoadingMoreStatus() -> Observable 9 | func observeErrors() -> Observable 10 | 11 | func setBalanceId(_ balanceId: String) 12 | 13 | func loadMoreParicipantEffects() 14 | func reloadParicipantEffects() 15 | } 16 | 17 | extension TransactionsListScene { 18 | typealias TransactionsProviderProtocol = TransactionsListSceneTransactionsProviderProtocol 19 | typealias LoadingStatus = TransactionsListSceneTransactionsLoadingStatus 20 | } 21 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/BalanceHeader/Workers/BalanceHeaderAmountFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol BalanceHeaderAmountFormatterProtocol { 4 | typealias Amount = BalanceHeader.Model.Amount 5 | 6 | func formatBalance(_ balance: Amount) -> String 7 | func formatRate(_ rate: Amount) -> String 8 | } 9 | 10 | extension BalanceHeader { 11 | typealias AmountFormatterProtocol = BalanceHeaderAmountFormatterProtocol 12 | } 13 | 14 | extension BalanceHeader { 15 | class AmountFormatter: SharedAmountFormatter { } 16 | } 17 | 18 | extension BalanceHeader.AmountFormatter: BalanceHeader.AmountFormatterProtocol { 19 | 20 | func formatBalance(_ balance: BalanceHeader.Model.Amount) -> String { 21 | return self.formatAmount(balance.value, currency: balance.asset) 22 | } 23 | 24 | func formatRate(_ rate: BalanceHeader.Model.Amount) -> String { 25 | return self.formatAmount(rate.value, currency: rate.asset) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/ExploreTokens/Workers/ExploreTokensSceneTokensFetcherProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import RxSwift 3 | import RxCocoa 4 | 5 | enum ExploreTokensSceneTokensFetcherLoadingStatus { 6 | case loading 7 | case loaded 8 | } 9 | 10 | protocol ExploreTokensSceneTokensFetcherProtocol { 11 | typealias Token = ExploreTokensScene.Model.Token 12 | typealias LoadingStatus = ExploreTokensSceneTokensFetcherLoadingStatus 13 | typealias TokenIdentifier = ExploreTokensScene.TokenIdentifier 14 | 15 | func reloadTokens() 16 | func observeTokens() -> Observable<[Token]> 17 | func observeLoadingStatus() -> Observable 18 | func observeErrorStatus() -> Observable 19 | func tokenForIdentifier(_ identifier: TokenIdentifier) -> Token? 20 | func changeFilter(_ filter: String) 21 | } 22 | 23 | extension ExploreTokensScene { 24 | typealias TokensFetcherProtocol = ExploreTokensSceneTokensFetcherProtocol 25 | } 26 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/SaleInvest/SaleInvestRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension SaleInvest { 4 | public struct Routing { 5 | let onShowProgress: () -> Void 6 | let onHideProgress: () -> Void 7 | let onShowError: (_ erroMessage: String) -> Void 8 | let onShowMessage: ( 9 | _ title: String, 10 | _ message: String 11 | ) -> Void 12 | let onPresentPicker: ( 13 | _ options: [String], 14 | _ onSelect: @escaping (_ balanceId: String) -> Void 15 | ) -> Void 16 | let showDialog: ( 17 | _ title: String, 18 | _ message: String, 19 | _ options: [String], 20 | _ onSelect: @escaping (_ index: Int) -> Void 21 | ) -> Void 22 | let onSaleInvestAction: (_ sendInvestModel: Model.SaleInvestModel) -> Void 23 | let onInvestHistory: ( 24 | _ baseAsset: String, 25 | _ onCanceled: @escaping (() -> Void) 26 | ) -> Void 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/WalletRecovery/WalletRecoveryPresenter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol WalletRecoveryPresentationLogic { 4 | func presentViewDidLoad(response: WalletRecovery.Event.ViewDidLoad.Response) 5 | } 6 | 7 | extension WalletRecovery { 8 | typealias PresentationLogic = WalletRecoveryPresentationLogic 9 | 10 | struct Presenter { 11 | 12 | private let presenterDispatch: PresenterDispatch 13 | 14 | init(presenterDispatch: PresenterDispatch) { 15 | self.presenterDispatch = presenterDispatch 16 | } 17 | } 18 | } 19 | 20 | extension WalletRecovery.Presenter: WalletRecovery.PresentationLogic { 21 | func presentViewDidLoad(response: WalletRecovery.Event.ViewDidLoad.Response) { 22 | let viewModel = WalletRecovery.Event.ViewDidLoad.ViewModel() 23 | self.presenterDispatch.display { displayLogic in 24 | displayLogic.displayViewDidLoad(viewModel: viewModel) 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TradeOffers/Workers/TradeOffersAmountFormatterProtocol.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | public protocol TradeOffersAmountFormatterProtocol { 4 | 5 | func formatToken(_ amount: TradeOffers.Model.Amount) -> String 6 | func formatTradeOrderToken(value: Decimal) -> String 7 | func assetAmountToString(_ amount: Decimal) -> String 8 | } 9 | 10 | extension TradeOffers { 11 | public typealias AmountFormatterProtocol = TradeOffersAmountFormatterProtocol 12 | 13 | public class AmountFormatter: SharedAmountFormatter { } 14 | } 15 | 16 | extension TradeOffers.AmountFormatter: TradeOffers.AmountFormatterProtocol { 17 | 18 | public func formatToken(_ amount: TradeOffers.Model.Amount) -> String { 19 | let value = amount.value 20 | let currency = amount.currency 21 | 22 | return "\(value) \(currency)" 23 | } 24 | 25 | public func formatTradeOrderToken(value: Decimal) -> String { 26 | return "\(value)" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Extensions/UIColor+Hex.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | extension UIColor { 4 | convenience init(hexString: String) { 5 | let hexString = hexString.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines) 6 | let scanner = Scanner(string: hexString) 7 | 8 | if hexString.hasPrefix("#") { 9 | scanner.scanLocation = 1 10 | } 11 | 12 | var color: UInt32 = 0 13 | scanner.scanHexInt32(&color) 14 | 15 | let mask = 0x000000FF 16 | let redInt = Int(color >> 16) & mask 17 | let greenInt = Int(color >> 8) & mask 18 | let blueInt = Int(color) & mask 19 | 20 | let red = CGFloat(redInt) / 255.0 21 | let green = CGFloat(greenInt) / 255.0 22 | let blue = CGFloat(blueInt) / 255.0 23 | 24 | self.init( 25 | red: red, 26 | green: green, 27 | blue: blue, 28 | alpha: 1 29 | ) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TabsContainer/Workers/TabsContainerContentProvider.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import RxCocoa 3 | import RxSwift 4 | 5 | public protocol TabsContainerContentProviderProtocol { 6 | 7 | func observeTabs() -> Observable<[TabsContainer.Model.TabModel]> 8 | } 9 | 10 | extension TabsContainer { 11 | 12 | public typealias ContentProvider = TabsContainerContentProviderProtocol 13 | 14 | public class InfoContentProvider { 15 | 16 | // MARK: - Private properties 17 | 18 | private let tabs: BehaviorRelay<[Model.TabModel]> 19 | 20 | // MARK: - 21 | 22 | public init(tabs: [Model.TabModel]) { 23 | self.tabs = BehaviorRelay(value: tabs) 24 | } 25 | } 26 | } 27 | 28 | extension TabsContainer.InfoContentProvider: TabsContainer.ContentProvider { 29 | 30 | public func observeTabs() -> Observable<[TabsContainer.Model.TabModel]> { 31 | return self.tabs.asObservable() 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Scripts/gen_loc_keys.rb: -------------------------------------------------------------------------------- 1 | source_file_path = './TokenDWalletTemplate/Resources/Base.lproj/Localizable.strings' 2 | target_file_path = './TokenDWalletTemplate/Sources/LocKey.swift' 3 | 4 | source_content = File.read(source_file_path) 5 | 6 | source_content.encode!('UTF-16', undef: :replace, invalid: :replace, replace: '') 7 | source_content.encode!('UTF-8') 8 | 9 | source_content_lines = source_content.lines 10 | 11 | offset = ' ' 12 | loc_keys_string = "// This file is auto-generated\n\nimport Foundation\n\nenum LocKey: String {\n" 13 | 14 | source_content_lines.each do |line| 15 | keyValue = line.split('=') 16 | next if keyValue.count < 2 17 | 18 | keyPart = keyValue.first 19 | 20 | keyPart = keyPart.sub('"', '').rstrip.chomp('"') 21 | 22 | key = keyPart 23 | loc_keys_string += offset 24 | loc_keys_string += "case #{key}\n" 25 | end 26 | 27 | loc_keys_string += "}\n" 28 | 29 | loc_keys_string.delete!("\x00") 30 | 31 | target_file = File.open(target_file_path, 'w') 32 | target_file.write(loc_keys_string) 33 | target_file.close 34 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TabBarContainer/TabBarContainerModels.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | public enum TabBarContainer { 4 | 5 | // MARK: - Typealiases 6 | 7 | public typealias DeinitCompletion = ((_ vc: UIViewController) -> Void)? 8 | 9 | // MARK: - 10 | 11 | public enum Model {} 12 | public enum Event {} 13 | } 14 | 15 | // MARK: - Models 16 | 17 | extension TabBarContainer.Model { 18 | 19 | public struct SceneContent { 20 | let content: TabBarContainer.ContentProtocol 21 | let tabBar: TabBarContainer.TabBarProtocol 22 | let title: String 23 | } 24 | } 25 | 26 | // MARK: - Events 27 | 28 | extension TabBarContainer.Event { 29 | public typealias Model = TabBarContainer.Model 30 | 31 | // MARK: - 32 | 33 | public enum ViewDidLoad { 34 | public struct Request {} 35 | public struct Response { 36 | let sceneContent: Model.SceneContent 37 | } 38 | public typealias ViewModel = Response 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Confirmation/Views/ConfirmationSceneBaseCell.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | extension ConfirmationScene.View { 4 | 5 | class BaseCell: UITableViewCell { 6 | let iconSize: CGFloat = 24.0 7 | let sideInset: CGFloat = 20.0 8 | let topInset: CGFloat = 15.0 9 | 10 | override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { 11 | super.init(style: style, reuseIdentifier: reuseIdentifier) 12 | } 13 | 14 | required init?(coder aDecoder: NSCoder) { 15 | fatalError("init(coder:) has not been implemented") 16 | } 17 | 18 | func setupView() { 19 | self.backgroundColor = Theme.Colors.contentBackgroundColor 20 | self.separatorInset = UIEdgeInsets( 21 | top: 0.0, 22 | left: self.sideInset * 2 + self.iconSize, 23 | bottom: 0.0, 24 | right: 0.0 25 | ) 26 | self.selectionStyle = .none 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Dashboard/DashboardPresenter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol DashboardScenePresentationLogic { 4 | func presentPlugInsDidChange(response: DashboardScene.Event.PlugInsDidChange.Response) 5 | } 6 | 7 | extension DashboardScene { 8 | typealias PresentationLogic = DashboardScenePresentationLogic 9 | 10 | struct Presenter { 11 | 12 | private let presenterDispatch: PresenterDispatch 13 | 14 | init(presenterDispatch: PresenterDispatch) { 15 | self.presenterDispatch = presenterDispatch 16 | } 17 | } 18 | } 19 | 20 | extension DashboardScene.Presenter: DashboardScene.PresentationLogic { 21 | func presentPlugInsDidChange(response: DashboardScene.Event.PlugInsDidChange.Response) { 22 | let viewModel = DashboardScene.Event.PlugInsDidChange.ViewModel( 23 | plugIns: response.plugIns 24 | ) 25 | self.presenterDispatch.display { (displayLogic) in 26 | displayLogic.displayPlugInsDidChange(viewModel: viewModel) 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/SignIn/RegisterSceneRouting.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension RegisterScene { 4 | struct Routing { 5 | let showProgress: () -> Void 6 | let hideProgress: () -> Void 7 | let showErrorMessage: (_ errorMessage: String, _ completion: (() -> Void)?) -> Void 8 | let onSuccessfulLogin: (_ account: String) -> Void 9 | let onUnverifiedEmail: (_ walletId: String) -> Void 10 | let onPresentQRCodeReader: (_ completion: @escaping QRCodeReaderCompletion) -> Void 11 | let onShowRecoverySeed: (_ model: TokenDRegisterWorker.SignUpModel) -> Void 12 | let onRecovery: () -> Void 13 | let onAuthenticatorSignIn: () -> Void 14 | let showDialogAlert: ( 15 | _ title: String, 16 | _ message: String, 17 | _ options: [String], 18 | _ onSelected: @escaping (_ selectedIndex: Int) -> Void, 19 | _ onCanceled: @escaping () -> Void 20 | ) -> Void 21 | let onSignedOut: () -> Void 22 | let onShowTerms: (_ url: URL) -> Void 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Workers/PasswordValidator/PasswordValidator.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum PasswordValidatorResult { 4 | case success 5 | case error(String) 6 | } 7 | protocol PasswordValidatorProtocol { 8 | func validate(password: String) -> PasswordValidatorResult 9 | } 10 | 11 | public class PasswordValidator: PasswordValidatorProtocol { 12 | 13 | // MARK: - Private properties 14 | 15 | private let minimalLength: Int = 6 16 | 17 | // MARK: - PasswordValidatorProtocol 18 | 19 | func validate(password: String) -> PasswordValidatorResult { 20 | if password.count >= minimalLength { 21 | return .success 22 | } else { 23 | let errorMessage = Localized( 24 | .password_should_contain_at_least_characters, 25 | replace: [ 26 | .password_should_contain_at_least_characters_replace_minimal_length: "\(self.minimalLength)" 27 | ] 28 | ) 29 | return .error(errorMessage) 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /.swiftlint.yml: -------------------------------------------------------------------------------- 1 | excluded: # paths to ignore during linting. Takes precedence over `included`. 2 | - Carthage 3 | - Pods 4 | - TokenDWalletTemplate/Sources/LocKey.swift 5 | 6 | disabled_rules: # rule identifiers to exclude from running 7 | - multiple_closures_with_trailing_closure 8 | - operator_whitespace 9 | - trailing_whitespace 10 | - function_parameter_count 11 | - cyclomatic_complexity 12 | - discouraged_direct_init 13 | - nesting 14 | - large_tuple 15 | - block_based_kvo 16 | - todo 17 | - fallthrough 18 | 19 | line_length: 120 20 | type_body_length: 21 | warning: 400 22 | error: 600 23 | file_length: 24 | warning: 800 25 | error: 1000 26 | function_body_length: 27 | warning: 100 # Should be 20 28 | error: 200 # Should 40 29 | identifier_name: 30 | min_length: 2 31 | excluded: 32 | - x 33 | - y 34 | - n 35 | - r 36 | - p 37 | - _default 38 | - _domain 39 | - _selected 40 | type_name: 41 | max_length: 50 42 | excluded: 43 | - iPhone 44 | - iPhoneSize 45 | 46 | nesting: 47 | level: 2 48 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Workers/AmountConverter/AmountConverter.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | protocol AmountConverterProtocol { 4 | func convertDecimalToUInt64(value: Decimal, precision: Int64) -> UInt64 5 | func convertDecimalToInt64(value: Decimal, precision: Int64) -> Int64 6 | } 7 | 8 | public class AmountConverter: AmountConverterProtocol { 9 | 10 | // MARK: - Private proverties 11 | 12 | private let behavior: NSDecimalNumberBehaviors = DecimalFloorRoundingBehavior() 13 | 14 | // MARK: - AmountConverterProtocol 15 | 16 | func convertDecimalToUInt64(value: Decimal, precision: Int64) -> UInt64 { 17 | let amount = NSDecimalNumber(decimal: value * Decimal(precision)).rounding(accordingToBehavior: self.behavior) 18 | return UInt64(exactly: amount) ?? 0 19 | } 20 | 21 | func convertDecimalToInt64(value: Decimal, precision: Int64) -> Int64 { 22 | let amount = NSDecimalNumber(decimal: value * Decimal(precision)).rounding(accordingToBehavior: self.behavior) 23 | return Int64(exactly: amount) ?? 0 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Dashboard/PlugIns/PendingOffers/DashboardPendingOffersPreviewPlugInInteractor.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol DashboardPendingOffersPreviewPlugInBusinessLogic { 4 | func onDidSelectViewMore(request: DashboardPendingOffersPreviewPlugIn.Event.DidSelectViewMore.Request) 5 | } 6 | 7 | extension DashboardPendingOffersPreviewPlugIn { 8 | typealias BusinessLogic = DashboardPendingOffersPreviewPlugInBusinessLogic 9 | 10 | class Interactor { 11 | 12 | private let presenter: PresentationLogic 13 | 14 | init(presenter: PresentationLogic) { 15 | self.presenter = presenter 16 | } 17 | } 18 | } 19 | 20 | extension DashboardPendingOffersPreviewPlugIn.Interactor: DashboardPendingOffersPreviewPlugIn.BusinessLogic { 21 | func onDidSelectViewMore(request: DashboardPendingOffersPreviewPlugIn.Event.DidSelectViewMore.Request) { 22 | let response = DashboardPendingOffersPreviewPlugIn.Event.DidSelectViewMore.Response() 23 | self.presenter.presentDidSelectViewMore(response: response) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TransactionsList/Workers/TransactionsListAmountFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol TransactionsListSceneAmountFormatterProtocol { 4 | func formatAmount( 5 | _ amount: TransactionsListScene.Model.Amount, 6 | isIncome: Bool? 7 | ) -> String 8 | } 9 | 10 | extension TransactionsListScene { 11 | typealias AmountFormatterProtocol = TransactionsListSceneAmountFormatterProtocol 12 | 13 | class AmountFormatter: SharedAmountFormatter { } 14 | } 15 | 16 | extension TransactionsListScene.AmountFormatter: TransactionsListScene.AmountFormatterProtocol { 17 | func formatAmount( 18 | _ amount: TransactionsListScene.Model.Amount, 19 | isIncome: Bool? 20 | ) -> String { 21 | 22 | let value: Decimal 23 | if let isIncome = isIncome { 24 | let absValue = abs(amount.value) 25 | value = isIncome ? absValue : -absValue 26 | } else { 27 | value = amount.value 28 | } 29 | 30 | return self.formatAmount(value, currency: amount.asset) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Views/BXFStaticTableView/BXFStaticTableViewButtonCell/BXFStaticTableViewButtonCellModel.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | class BXFStaticTableViewButtonCellModel: CellViewModel { 4 | 5 | typealias OnClickCallback = ((BXFStaticTableViewButtonCell) -> Void) 6 | 7 | var hashValue: Int { 8 | return title.hashValue ^ isEnabled.hashValue 9 | } 10 | 11 | static func ==(lhs: BXFStaticTableViewButtonCellModel, rhs: BXFStaticTableViewButtonCellModel) -> Bool { 12 | return lhs.title == rhs.title && lhs.isEnabled == rhs.isEnabled 13 | } 14 | 15 | let title: String 16 | var onClick: OnClickCallback? 17 | var isEnabled: Bool = true 18 | 19 | init(title: String, onClick: ((BXFStaticTableViewButtonCell) -> Void)?, isEnabled: Bool) { 20 | self.title = title 21 | self.onClick = onClick 22 | self.isEnabled = isEnabled 23 | } 24 | 25 | func setup(cell: BXFStaticTableViewButtonCell) { 26 | cell.onClick = onClick 27 | cell.actionButton.setTitle(title, for: .normal) 28 | cell.actionButton.isEnabled = isEnabled 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/AuthenticatorAuth/Workers/AuthRequestKeyFetcher.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import DLCryptoKit 3 | import TokenDWallet 4 | 5 | protocol AuthRequestKeyFectherProtocol { 6 | func getKey() -> ECDSA.KeyData? 7 | func getPublicKey() -> String? 8 | } 9 | 10 | extension AuthenticatorAuth { 11 | 12 | class AuthRequestKeyFecther { 13 | 14 | // MARK: - Private properties 15 | 16 | private var key: ECDSA.KeyData? 17 | } 18 | } 19 | 20 | extension AuthenticatorAuth.AuthRequestKeyFecther: AuthRequestKeyFectherProtocol { 21 | 22 | func getKey() -> ECDSA.KeyData? { 23 | if let key = self.key { 24 | return key 25 | } else { 26 | self.key = try? ECDSA.KeyData() 27 | return self.getKey() 28 | } 29 | } 30 | 31 | func getPublicKey() -> String? { 32 | if let key = self.key { 33 | return Base32Check.encode(version: .accountIdEd25519, data: key.getPublicKeyData()) 34 | } else { 35 | self.key = try? ECDSA.KeyData() 36 | return self.getPublicKey() 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/BiometricsAuth/BiometricsAuthInteractor.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol BiometricsAuthBusinessLogic { 4 | func onViewDidAppear(request: BiometricsAuth.Event.ViewDidAppear.Request) 5 | } 6 | 7 | extension BiometricsAuth { 8 | typealias BusinessLogic = BiometricsAuthBusinessLogic 9 | 10 | class Interactor { 11 | 12 | private let presenter: PresentationLogic 13 | private let authWorker: AuthWorker 14 | 15 | init( 16 | presenter: PresentationLogic, 17 | authWorker: AuthWorker 18 | ) { 19 | 20 | self.presenter = presenter 21 | self.authWorker = authWorker 22 | } 23 | } 24 | } 25 | 26 | extension BiometricsAuth.Interactor: BiometricsAuth.BusinessLogic { 27 | func onViewDidAppear(request: BiometricsAuth.Event.ViewDidAppear.Request) { 28 | self.authWorker.performAuth(completion: { [weak self] (result) in 29 | let response = BiometricsAuth.Event.ViewDidAppear.Response(result: result) 30 | self?.presenter.presentViewDidAppear(response: response) 31 | }) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/SaleOverview/Workers/SaleOverviewFundedValueFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol SaleOverviewFundedValueFormatterProtocol { 4 | func formatFundedValue(value: String) -> NSAttributedString 5 | } 6 | 7 | extension SaleOverview { 8 | typealias FundedValueFormatterProtocol = SaleOverviewFundedValueFormatterProtocol 9 | 10 | class FundedValueFormatter: FundedValueFormatterProtocol { 11 | 12 | // MARK: - FundedValueFormatterProtocol 13 | 14 | func formatFundedValue(value: String) -> NSAttributedString { 15 | let fundedValue = NSMutableAttributedString( 16 | string: value + "\n", 17 | attributes: [ 18 | .font: Theme.Fonts.largePlainTextFont 19 | ] 20 | ) 21 | let fundedText = NSMutableAttributedString( 22 | string: Localized(.funded_lowercase), 23 | attributes: [ 24 | .font: Theme.Fonts.plainTextFont 25 | ] 26 | ) 27 | fundedValue.append(fundedText) 28 | return fundedValue 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/ReceiveAddress/Workers/ExportSeedManager.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import TokenDWallet 3 | import RxSwift 4 | import RxCocoa 5 | 6 | extension ReceiveAddress { 7 | 8 | class ExportSeedManager { 9 | 10 | // MARK: - Private properties 11 | 12 | private let seedRelay: BehaviorRelay = BehaviorRelay(value: "") 13 | private let keychainDataProvider: KeychainDataProviderProtocol 14 | 15 | // MARK: - 16 | 17 | init(keychainDataProvider: KeychainDataProviderProtocol) { 18 | self.keychainDataProvider = keychainDataProvider 19 | } 20 | } 21 | } 22 | 23 | extension ReceiveAddress.ExportSeedManager: ReceiveAddressManagerProtocol { 24 | var address: Address { 25 | return self.seedRelay.value 26 | } 27 | 28 | func observeAddressChange() -> Observable
{ 29 | let seedData = self.keychainDataProvider.getKeyData() 30 | let seed = Base32Check.encode(version: .seedEd25519, data: seedData.getSeedData()) 31 | self.seedRelay.accept(seed) 32 | return self.seedRelay.asObservable() 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/BalancesList/Workers/BalancesListPieChartColorsProvider.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | protocol BalancesListPieChartColorsProviderProtocol { 4 | func getDefaultPieChartColors() -> [UIColor] 5 | func getPieChartColorForOther() -> UIColor 6 | } 7 | 8 | extension BalancesList { 9 | typealias PieChartColorsProviderProtocol = BalancesListPieChartColorsProviderProtocol 10 | 11 | class PieChartColorsProvider: PieChartColorsProviderProtocol { 12 | 13 | // MARK: - PieChartColorsProviderProtocol 14 | 15 | func getDefaultPieChartColors() -> [UIColor] { 16 | let colors: [UIColor] = [ 17 | UIColor(red: 0.22, green: 0.64, blue: 0.58, alpha: 1), 18 | UIColor(red: 0.49, green: 0.45, blue: 0.98, alpha: 1), 19 | UIColor(red: 0.94, green: 0.63, blue: 0.15, alpha: 1), 20 | UIColor(red: 0.93, green: 0.33, blue: 0.33, alpha: 1) 21 | ] 22 | return colors 23 | } 24 | 25 | func getPieChartColorForOther() -> UIColor { 26 | return UIColor(red: 0.84, green: 0.84, blue: 0.84, alpha: 1) 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Trade/Workers/TradeDateFormatter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension Trade { 4 | class TradeDateFormatter: DateFormatterProtocol { 5 | func dateToString(_ date: Date) -> String { 6 | let dateFormatter = DateFormatter() 7 | dateFormatter.dateFormat = "HH:mm dd MMM yy" 8 | return dateFormatter.string(from: date) 9 | } 10 | 11 | func formatDateForXAxis( 12 | _ date: Date, 13 | type: Trade.Model.Period 14 | ) -> String { 15 | 16 | let dateFormatter = DateFormatter() 17 | 18 | switch type { 19 | case .hour: 20 | dateFormatter.dateFormat = "HH:mm" 21 | case .day: 22 | dateFormatter.dateFormat = "HH:mm" 23 | case .week: 24 | dateFormatter.dateFormat = "dd MMM" 25 | case .month: 26 | dateFormatter.dateFormat = "dd MMM" 27 | case .year: 28 | dateFormatter.dateFormat = "MMM yyyy" 29 | } 30 | return dateFormatter.string(from: date) 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Controllers/Providers/KeychainDataProvider.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import TokenDSDK 3 | import DLCryptoKit 4 | 5 | public protocol KeychainDataProviderProtocol { 6 | 7 | func getKeyData() -> ECDSA.KeyData 8 | } 9 | 10 | public class KeychainDataProvider { 11 | 12 | // MARK: - Public properties 13 | 14 | public let account: String 15 | public let keychainManager: KeychainManagerProtocol 16 | 17 | // MARK: - 18 | 19 | public init?(account: String, keychainManager: KeychainManagerProtocol) { 20 | let keyData = keychainManager.getKeyData(account: account) 21 | guard keyData != nil else { 22 | return nil 23 | } 24 | 25 | self.account = account 26 | self.keychainManager = keychainManager 27 | } 28 | } 29 | 30 | extension KeychainDataProvider: KeychainDataProviderProtocol { 31 | 32 | public func getKeyData() -> ECDSA.KeyData { 33 | guard let keyData = self.keychainManager.getKeyData(account: self.account) else { 34 | fatalError(Localized(.keychaindataprovider_should_always_provide_key)) 35 | } 36 | 37 | return keyData 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Controllers/Permissions/ContactEmailPickerHandler.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import ContactsUI 3 | 4 | class ContactEmailPickerHandler: NSObject { 5 | 6 | let onCanceled: (() -> Void)? 7 | let onSelected: ((_ emails: [String]) -> Void)? 8 | 9 | // MARK: - 10 | 11 | init( 12 | onCanceled: (() -> Void)?, 13 | onSelected: ((_ email: [String]) -> Void)? 14 | ) { 15 | 16 | self.onCanceled = onCanceled 17 | self.onSelected = onSelected 18 | } 19 | 20 | // MARK: - Public 21 | 22 | func getPredicate() -> NSPredicate? { 23 | return NSPredicate(format: "emailAddresses.@count > 0") 24 | } 25 | } 26 | 27 | extension ContactEmailPickerHandler: CNContactPickerDelegate { 28 | 29 | func contactPickerDidCancel(_ picker: CNContactPickerViewController) { 30 | self.onCanceled?() 31 | } 32 | 33 | func contactPicker(_ picker: CNContactPickerViewController, didSelect contact: CNContact) { 34 | let emails: [String] = contact.emailAddresses.map({ (value) in 35 | return value.value as String 36 | }) 37 | 38 | self.onSelected?(emails) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/Dashboard/PlugIns/PendingOffers/DashboardPendingOffersPreviewPlugInPresenter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol DashboardPendingOffersPreviewPlugInPresentationLogic { 4 | func presentDidSelectViewMore(response: DashboardPendingOffersPreviewPlugIn.Event.DidSelectViewMore.Response) 5 | } 6 | 7 | extension DashboardPendingOffersPreviewPlugIn { 8 | typealias PresentationLogic = DashboardPendingOffersPreviewPlugInPresentationLogic 9 | 10 | struct Presenter { 11 | 12 | private let presenterDispatch: PresenterDispatch 13 | 14 | init(presenterDispatch: PresenterDispatch) { 15 | self.presenterDispatch = presenterDispatch 16 | } 17 | } 18 | } 19 | 20 | extension DashboardPendingOffersPreviewPlugIn.Presenter: DashboardPendingOffersPreviewPlugIn.PresentationLogic { 21 | func presentDidSelectViewMore(response: DashboardPendingOffersPreviewPlugIn.Event.DidSelectViewMore.Response) { 22 | let viewModel = DashboardPendingOffersPreviewPlugIn.Event.DidSelectViewMore.ViewModel() 23 | self.presenterDispatch.display { displayLogic in 24 | displayLogic.displayDidSelectViewMore(viewModel: viewModel) 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Shared/Workers/QRCodeGenerator/QRCodeGenerator.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | class QRCodeGenerator { 4 | 5 | typealias QRCode = UIImage 6 | 7 | private let operationQueue: OperationQueue = OperationQueue() 8 | private let dispatchQueue: DispatchQueue = DispatchQueue( 9 | label: NSStringFromClass(QRCodeGenerator.self), 10 | qos: .userInteractive, 11 | attributes: .concurrent 12 | ) 13 | 14 | init() { 15 | self.operationQueue.maxConcurrentOperationCount = 1 16 | self.operationQueue.underlyingQueue = self.dispatchQueue 17 | } 18 | 19 | func generateQRCodeFromString( 20 | _ string: String, 21 | withTintColor tintColor: UIColor, 22 | backgroundColor: UIColor, 23 | size: CGSize, 24 | completion: @escaping (QRCode?) -> Void 25 | ) { 26 | 27 | self.operationQueue.cancelAllOperations() 28 | let operation = QRCodeGenerationOperation( 29 | source: string, 30 | size: size, 31 | tintColor: tintColor, 32 | backgroundColor: backgroundColor, 33 | callback: completion 34 | ) 35 | self.operationQueue.addOperation(operation) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/SideMenu/SideMenuInteractor.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol SideMenuBusinessLogic { 4 | func onViewDidLoad(request: SideMenu.Event.ViewDidLoad.Request) 5 | } 6 | 7 | extension SideMenu { 8 | typealias BusinessLogic = SideMenuBusinessLogic 9 | 10 | class Interactor { 11 | 12 | private let presenter: PresentationLogic 13 | 14 | private let headerModel: Model.HeaderModel 15 | private let sceneModel: Model.SceneModel 16 | 17 | init( 18 | presenter: PresentationLogic, 19 | headerModel: Model.HeaderModel, 20 | sceneModel: Model.SceneModel 21 | ) { 22 | self.presenter = presenter 23 | self.headerModel = headerModel 24 | self.sceneModel = sceneModel 25 | } 26 | } 27 | } 28 | 29 | extension SideMenu.Interactor: SideMenu.BusinessLogic { 30 | func onViewDidLoad(request: SideMenu.Event.ViewDidLoad.Request) { 31 | let response = SideMenu.Event.ViewDidLoad.Response( 32 | header: self.headerModel, 33 | sections: self.sceneModel.sections 34 | ) 35 | self.presenter.presentViewDidLoad(response: response) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/TransactionsList/Workers/TransactionsListSceneTransactionsFetcherProtocol.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import RxSwift 3 | import RxCocoa 4 | 5 | enum TransactionsListSceneTransactionsLoadingStatus { 6 | case loading 7 | case loaded 8 | } 9 | 10 | protocol TransactionsListSceneTransactionsFetcherProtocol { 11 | typealias Transaction = TransactionsListScene.Model.Transaction 12 | typealias Transactions = [Transaction] 13 | typealias LoadingStatus = TransactionsListSceneTransactionsLoadingStatus 14 | 15 | var transactionsValue: Transactions { get } 16 | var loadingStatusValue: LoadingStatus { get } 17 | var loadingMoreStatusValue: LoadingStatus { get } 18 | 19 | func setBalanceId(_ balanceId: String) 20 | 21 | func observeTransactions() -> Observable 22 | func reloadTransactions() 23 | func loadMoreTransactions() 24 | func observeLoadingStatus() -> Observable 25 | func observeLoadingMoreStatus() -> Observable 26 | func observeErrorStatus() -> Observable 27 | } 28 | 29 | extension TransactionsListScene { 30 | typealias TransactionsFetcherProtocol = TransactionsListSceneTransactionsFetcherProtocol 31 | } 32 | -------------------------------------------------------------------------------- /TokenDWalletTemplate/Sources/Scenes/MarkdownViewer/MarkdownViewerPresenter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | protocol MarkdownViewerPresentationLogic { 4 | 5 | typealias Event = MarkdownViewer.Event 6 | 7 | func presentViewDidLoad(response: Event.ViewDidLoad.Response) 8 | } 9 | 10 | extension MarkdownViewer { 11 | 12 | typealias PresentationLogic = MarkdownViewerPresentationLogic 13 | 14 | class Presenter { 15 | 16 | typealias Event = MarkdownViewer.Event 17 | typealias Model = MarkdownViewer.Model 18 | 19 | // MARK: - Private properties 20 | 21 | private let presenterDispatch: PresenterDispatch 22 | 23 | // MARK: - 24 | 25 | init(presenterDispatch: PresenterDispatch) { 26 | self.presenterDispatch = presenterDispatch 27 | } 28 | } 29 | } 30 | 31 | extension MarkdownViewer.Presenter: MarkdownViewer.PresentationLogic { 32 | 33 | func presentViewDidLoad(response: Event.ViewDidLoad.Response) { 34 | let viewModel: Event.ViewDidLoad.ViewModel = response 35 | self.presenterDispatch.display { displayLogic in 36 | displayLogic.displayViewDidLoad(viewModel: viewModel) 37 | } 38 | } 39 | } 40 | --------------------------------------------------------------------------------