From d48f9674e93997083580106f358d0be06ae9debf Mon Sep 17 00:00:00 2001 From: Esenbek Date: Fri, 15 Sep 2023 12:52:31 +0600 Subject: [PATCH 1/3] Pass TronGrid API key from ENV to XCConfig --- .github/workflows/deploy_appstore.yml | 1 + .github/workflows/deploy_dev.yml | 1 + fastlane/Fastfile | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/.github/workflows/deploy_appstore.yml b/.github/workflows/deploy_appstore.yml index c5d3c4fb0c..c4d55d882e 100644 --- a/.github/workflows/deploy_appstore.yml +++ b/.github/workflows/deploy_appstore.yml @@ -71,3 +71,4 @@ jobs: XCCONFIG_PROD_HS_PROVIDER_API_KEY: ${{ secrets.XCCONFIG_PROD_HS_PROVIDER_API_KEY }} XCCONFIG_PROD_WALLET_CONNECT_V2_PROJECT_KEY: ${{ secrets.XCCONFIG_PROD_WALLET_CONNECT_V2_PROJECT_KEY }} XCCONFIG_PROD_OPEN_SEA_API_KEY: ${{ secrets.XCCONFIG_PROD_OPEN_SEA_API_KEY }} + XCCONFIG_PROD_TRONGRID_API_KEY: ${{ secrets.XCCONFIG_PROD_TRONGRID_API_KEY }} diff --git a/.github/workflows/deploy_dev.yml b/.github/workflows/deploy_dev.yml index e1e47f339d..e23c0debf4 100644 --- a/.github/workflows/deploy_dev.yml +++ b/.github/workflows/deploy_dev.yml @@ -72,3 +72,4 @@ jobs: XCCONFIG_DEV_HS_PROVIDER_API_KEY: ${{ secrets.XCCONFIG_DEV_HS_PROVIDER_API_KEY }} XCCONFIG_DEV_WALLET_CONNECT_V2_PROJECT_KEY: ${{ secrets.XCCONFIG_DEV_WALLET_CONNECT_V2_PROJECT_KEY }} XCCONFIG_DEV_OPEN_SEA_API_KEY: ${{ secrets.XCCONFIG_DEV_OPEN_SEA_API_KEY }} + XCCONFIG_DEV_TRONGRID_API_KEY: ${{ secrets.XCCONFIG_DEV_TRONGRID_API_KEY }} diff --git a/fastlane/Fastfile b/fastlane/Fastfile index bb8195b382..3a6be9b4b3 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -28,6 +28,7 @@ XCCONFIG_DEV_TWITTER_BEARER_TOKEN = ENV["XCCONFIG_DEV_TWITTER_BEARER_TOKEN"] XCCONFIG_DEV_HS_PROVIDER_API_KEY = ENV["XCCONFIG_DEV_HS_PROVIDER_API_KEY"] XCCONFIG_DEV_WALLET_CONNECT_V2_PROJECT_KEY = ENV["XCCONFIG_DEV_WALLET_CONNECT_V2_PROJECT_KEY"] XCCONFIG_DEV_OPEN_SEA_API_KEY = ENV["XCCONFIG_DEV_OPEN_SEA_API_KEY"] +XCCONFIG_DEV_TRONGRID_API_KEY = ENV["XCCONFIG_DEV_TRONGRID_API_KEY"] XCCONFIG_PROD_INFURA_PROJECT_ID = ENV["XCCONFIG_PROD_INFURA_PROJECT_ID"] XCCONFIG_PROD_INFURA_PROJECT_SECRET = ENV["XCCONFIG_PROD_INFURA_PROJECT_SECRET"] @@ -44,6 +45,7 @@ XCCONFIG_PROD_TWITTER_BEARER_TOKEN = ENV["XCCONFIG_PROD_TWITTER_BEARER_TOKEN"] XCCONFIG_PROD_HS_PROVIDER_API_KEY = ENV["XCCONFIG_PROD_HS_PROVIDER_API_KEY"] XCCONFIG_PROD_WALLET_CONNECT_V2_PROJECT_KEY = ENV["XCCONFIG_PROD_WALLET_CONNECT_V2_PROJECT_KEY"] XCCONFIG_PROD_OPEN_SEA_API_KEY = ENV["XCCONFIG_PROD_OPEN_SEA_API_KEY"] +XCCONFIG_PROD_TRONGRID_API_KEY = ENV["XCCONFIG_PROD_TRONGRID_API_KEY"] def delete_temp_keychain(name) delete_keychain( @@ -117,6 +119,7 @@ def apply_dev_xcconfig update_dev_xcconfig('hs_provider_api_key', XCCONFIG_DEV_HS_PROVIDER_API_KEY) update_dev_xcconfig('wallet_connect_v2_project_key', XCCONFIG_DEV_WALLET_CONNECT_V2_PROJECT_KEY) update_dev_xcconfig('open_sea_api_key', XCCONFIG_DEV_OPEN_SEA_API_KEY) + update_dev_xcconfig('trongrid_api_key', XCCONFIG_DEV_TRONGRID_API_KEY) end def apply_prod_xcconfig @@ -135,6 +138,7 @@ def apply_prod_xcconfig update_prod_xcconfig('hs_provider_api_key', XCCONFIG_PROD_HS_PROVIDER_API_KEY) update_prod_xcconfig('wallet_connect_v2_project_key', XCCONFIG_PROD_WALLET_CONNECT_V2_PROJECT_KEY) update_prod_xcconfig('open_sea_api_key', XCCONFIG_PROD_OPEN_SEA_API_KEY) + update_prod_xcconfig('trongrid_api_key', XCCONFIG_PROD_TRONGRID_API_KEY) end def force_update_devices(type, username) From 5a996aedb3d0aa119eb797186ab45a7218051fa9 Mon Sep 17 00:00:00 2001 From: Esenbek Date: Mon, 18 Sep 2023 12:00:43 +0600 Subject: [PATCH 2/3] Use half hour fee as Bitcoin recommended fee --- .../UnstoppableWallet/Core/Providers/FeeRateProvider.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnstoppableWallet/UnstoppableWallet/Core/Providers/FeeRateProvider.swift b/UnstoppableWallet/UnstoppableWallet/Core/Providers/FeeRateProvider.swift index c745c93d2f..ab2d1f4b8a 100644 --- a/UnstoppableWallet/UnstoppableWallet/Core/Providers/FeeRateProvider.swift +++ b/UnstoppableWallet/UnstoppableWallet/Core/Providers/FeeRateProvider.swift @@ -61,7 +61,7 @@ class BitcoinFeeRateProvider: IFeeRateProvider { func feeRates() async throws -> FeeRateProvider.FeeRates { let rates = try await feeRateProvider.bitcoinFeeRate() - return .init(recommended: rates.economyFee, minimum: rates.minimumFee) + return .init(recommended: rates.halfHourFee, minimum: rates.minimumFee) } } From 38d98ef32070a4980a45067e1e3e02e850b9c86e Mon Sep 17 00:00:00 2001 From: ant013 Date: Wed, 20 Sep 2023 11:08:01 +0600 Subject: [PATCH 3/3] NFT-Overview: Replace buttons --- .../Modules/NftAsset/NftAssetButtonCell.swift | 62 +++++++------------ .../NftAssetOverviewViewController.swift | 43 ++----------- 2 files changed, 27 insertions(+), 78 deletions(-) diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/NftAsset/NftAssetButtonCell.swift b/UnstoppableWallet/UnstoppableWallet/Modules/NftAsset/NftAssetButtonCell.swift index e82d980b9a..816dfef702 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/NftAsset/NftAssetButtonCell.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/NftAsset/NftAssetButtonCell.swift @@ -1,16 +1,14 @@ -import UIKit import ComponentKit +import UIKit class NftAssetButtonCell: UITableViewCell { - private let providerButton = PrimaryButton() - private let sendButton = PrimaryButton() - private let moreButton = PrimaryCircleButton() + private let saveButton = PrimaryButton() + private let shareButton = PrimaryButton() private let stackView = UIStackView() - private var onTapSend: (() -> ())? - private var onTapProvider: (() -> ())? - private var onTapMore: (() -> ())? + private var onTapShare: (() -> Void)? + private var onTapSave: (() -> Void)? override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) @@ -25,51 +23,37 @@ class NftAssetButtonCell: UITableViewCell { maker.height.equalTo(CGFloat.heightButton) } - stackView.addArrangedSubview(sendButton) - stackView.addArrangedSubview(providerButton) - stackView.addArrangedSubview(moreButton) + stackView.addArrangedSubview(shareButton) + stackView.addArrangedSubview(saveButton) stackView.spacing = .margin8 stackView.alignment = .fill - stackView.distribution = .fill + stackView.distribution = .fillEqually - sendButton.set(style: .yellow) - sendButton.addTarget(self, action: #selector(onTapSendButton), for: .touchUpInside) - sendButton.setTitle("button.send".localized, for: .normal) + shareButton.set(style: .yellow) + shareButton.addTarget(self, action: #selector(onTapShareButton), for: .touchUpInside) + shareButton.setTitle("button.share".localized, for: .normal) - providerButton.set(style: .gray) - providerButton.addTarget(self, action: #selector(onTapProviderButton), for: .touchUpInside) - - moreButton.set(style: .gray) - moreButton.set(image: UIImage(named: "more_24")) - moreButton.addTarget(self, action: #selector(onTapMoreButton), for: .touchUpInside) + saveButton.set(style: .gray) + saveButton.addTarget(self, action: #selector(onTapSaveButton), for: .touchUpInside) + saveButton.setTitle("button.save".localized, for: .normal) } - required init?(coder aDecoder: NSCoder) { + @available(*, unavailable) + required init?(coder _: NSCoder) { fatalError("init(coder:) has not been implemented") } - @objc private func onTapSendButton() { - onTapSend?() - } - - @objc private func onTapProviderButton() { - onTapProvider?() + @objc private func onTapSaveButton() { + onTapSave?() } - @objc private func onTapMoreButton() { - onTapMore?() + @objc private func onTapShareButton() { + onTapShare?() } - func bind(providerTitle: String?, onTapSend: (() -> ())?, onTapProvider: @escaping () -> (), onTapMore: @escaping () -> ()) { - providerButton.setTitle(providerTitle, for: .normal) - - sendButton.isHidden = onTapSend == nil - providerButton.isHidden = onTapSend != nil - - self.onTapSend = onTapSend - self.onTapProvider = onTapProvider - self.onTapMore = onTapMore + func bind(onTapShare: @escaping () -> Void, onTapSave: @escaping () -> Void) { + self.onTapShare = onTapShare + self.onTapSave = onTapSave } - } diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/NftAsset/Overview/NftAssetOverviewViewController.swift b/UnstoppableWallet/UnstoppableWallet/Modules/NftAsset/Overview/NftAssetOverviewViewController.swift index 723790ddf6..c3cfe9853b 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/NftAsset/Overview/NftAssetOverviewViewController.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/NftAsset/Overview/NftAssetOverviewViewController.swift @@ -180,35 +180,6 @@ class NftAssetOverviewViewController: ThemeViewController { urlManager.open(url: url, from: parentNavigationController ?? self) } - private func openSend() { - guard let viewController = SendNftModule.viewController(nftUid: viewModel.nftUid) else { - return - } - - parentNavigationController?.present(viewController, animated: true) - } - - private func openOptionsMenu() { - let controller = AlertViewControllerNew.instance( - viewItems: [ - .init(text: "button.share".localized), - .init(text: "nft_asset.options.save_to_photos".localized), -// .init(text: "nft_asset.options.set_as_watch_face".localized) - ], - reportAfterDismiss: true, - onSelect: { [weak self] index in - switch index { - case 0: self?.handleShare() - case 1: self?.handleSaveToPhotos() -// case 2: self?.handleSetWatchFace() - default: () - } - } - ) - - (parentNavigationController ?? self).present(controller, animated: true) - } - private func handleShare() { if let providerUrl = providerUrl { openShare(text: providerUrl) @@ -319,17 +290,11 @@ extension NftAssetOverviewViewController: SectionsDataSource { height: .heightButton, bind: { [weak self] cell, _ in cell.bind( - providerTitle: self?.viewModel.providerTitle, - onTapSend: sendVisible ? { [weak self] in - self?.openSend() - } : nil, - onTapProvider: { - if let url = self?.providerUrl { - self?.openLink(url: url) - } + onTapShare: { [weak self] in + self?.handleShare() }, - onTapMore: { - self?.openOptionsMenu() + onTapSave: { [weak self] in + self?.handleSaveToPhotos() } ) }