Skip to content

Commit

Permalink
Disabled bitrefill until compliance docs received
Browse files Browse the repository at this point in the history
Adjusted low fees tier

Signed-off-by: kcw-grunt <[email protected]>
  • Loading branch information
kcw-grunt committed May 16, 2024
1 parent 4ce9975 commit 244c294
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 250 deletions.
6 changes: 3 additions & 3 deletions litewallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -4530,7 +4530,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = litewallet/litewallet.entitlements;
CURRENT_PROJECT_VERSION = 240513.0;
CURRENT_PROJECT_VERSION = 240516.1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = ZV7987N2ZC;
EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE = YES;
Expand Down Expand Up @@ -4887,7 +4887,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = litewallet/litewallet.entitlements;
CURRENT_PROJECT_VERSION = 240513.0;
CURRENT_PROJECT_VERSION = 240516.1;
DEVELOPMENT_TEAM = ZV7987N2ZC;
EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -5028,7 +5028,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = litewallet/litewallet.entitlements;
CURRENT_PROJECT_VERSION = 240513.0;
CURRENT_PROJECT_VERSION = 240516.1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = ZV7987N2ZC;
EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE = NO;
Expand Down
79 changes: 17 additions & 62 deletions litewallet/BuyTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ class BuyTableViewController: UITableViewController, SFSafariViewControllerDeleg
@IBOutlet var bitrefillDetailsLabel: UILabel!
@IBOutlet var bitrefillCellContainerView: UIView!
@IBAction func didTapBitrefill(_: UIButton) {
guard let url = URL(string: "https://www.bitrefill.com/?ref=bAshL935")
else {
return
}

let sfSafariVC = SFSafariViewController(url: url)
sfSafariVC.delegate = self
present(sfSafariVC, animated: true)
/// DEV: Until Compliance data is sent . KCW_051624
// guard let url = URL(string: "https://www.bitrefill.com/?ref=bAshL935")
// else {
// return
// }
//
// let sfSafariVC = SFSafariViewController(url: url)
// sfSafariVC.delegate = self
// present(sfSafariVC, animated: true)
}

// MARK: Moonpay UI
Expand All @@ -39,42 +40,10 @@ class BuyTableViewController: UITableViewController, SFSafariViewControllerDeleg
present(sfSafariVC, animated: true)
}

// MARK: Simplex UI

@IBOutlet var simplexLogoImageView: UIImageView!
@IBOutlet var simplexHeaderLabel: UILabel!
@IBOutlet var simplexDetailsLabel: UILabel!
@IBOutlet var simplexCellContainerView: UIView!
@IBOutlet var simplexCurrencySegmentedControl: UISegmentedControl!

private var currencyCode: String = "USD"
private let uuidString: String = UIDevice.current.identifierForVendor?.uuidString ?? ""
private let currentWalletAddress: String = WalletManager.sharedInstance.wallet?.receiveAddress ?? ""

@IBAction func didTapSimplex(_: Any) {
if let vcWKVC = UIStoryboard(name: "Buy", bundle: nil).instantiateViewController(withIdentifier: "BuyWKWebViewController") as? BuyWKWebViewController {
vcWKVC.currencyCode = currencyCode
vcWKVC.currentWalletAddress = currentWalletAddress
vcWKVC.uuidString = uuidString
vcWKVC.timestamp = Int(Date().timeIntervalSince1970)
addChild(vcWKVC)
view.addSubview(vcWKVC.view)
vcWKVC.didMove(toParent: self)

vcWKVC.didDismissChildView = {
for vc in self.children {
DispatchQueue.main.async {
vc.willMove(toParent: nil)
vc.view.removeFromSuperview()
vc.removeFromParent()
}
}
}
} else {
NSLog("ERROR: Storyboard not initialized")
}
}

var store: Store?
var walletManager: WalletManager?

Expand All @@ -93,11 +62,11 @@ class BuyTableViewController: UITableViewController, SFSafariViewControllerDeleg
moonpaySegmentedControl.setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.white], for: .normal)
moonpaySegmentedControl.setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.liteWalletBlue], for: .selected)

simplexCurrencySegmentedControl.addTarget(self, action: #selector(didChangeCurrencySimplex), for: .valueChanged)
simplexCurrencySegmentedControl.selectedSegmentIndex = PartnerFiatOptions.usd.index
simplexCurrencySegmentedControl.selectedSegmentTintColor = .white
simplexCurrencySegmentedControl.setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.white], for: .normal)
simplexCurrencySegmentedControl.setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.liteWalletBlue], for: .selected)
/// DEV: Until Compliance data is sent . KCW_051624
bitrefillLogoImageView.alpha = 0.0
bitrefillHeaderLabel.alpha = 0.0
bitrefillDetailsLabel.alpha = 0.0
bitrefillCellContainerView.alpha = 0.0

setupWkVCData()

Expand All @@ -114,6 +83,9 @@ class BuyTableViewController: UITableViewController, SFSafariViewControllerDeleg
bitrefillCellContainerView.layer.borderWidth = 1.0
bitrefillCellContainerView.clipsToBounds = true

/// DEV: Until Compliance data is sent . KCW_051624
bitrefillCellContainerView.alpha = 0.0

let moonpayData = Partner.partnerDataArray()[1]
moonpayLogoImageView.image = moonpayData.logo
moonpayHeaderLabel.text = moonpayData.headerTitle
Expand All @@ -122,15 +94,6 @@ class BuyTableViewController: UITableViewController, SFSafariViewControllerDeleg
moonpayCellContainerView.layer.borderColor = UIColor.white.cgColor
moonpayCellContainerView.layer.borderWidth = 1.0
moonpayCellContainerView.clipsToBounds = true

let simplexData = Partner.partnerDataArray()[2]
simplexLogoImageView.image = simplexData.logo
simplexHeaderLabel.text = simplexData.headerTitle
simplexDetailsLabel.text = simplexData.details
simplexCellContainerView.layer.cornerRadius = 6.0
simplexCellContainerView.layer.borderColor = UIColor.white.cgColor
simplexCellContainerView.layer.borderWidth = 1.0
simplexCellContainerView.clipsToBounds = true
}

@objc private func didChangeCurrencyMoonpay() {
Expand All @@ -140,12 +103,4 @@ class BuyTableViewController: UITableViewController, SFSafariViewControllerDeleg
print("Error: Code not found: \(moonpaySegmentedControl.selectedSegmentIndex)")
}
}

@objc private func didChangeCurrencySimplex() {
if let code = PartnerFiatOptions(rawValue: simplexCurrencySegmentedControl.selectedSegmentIndex)?.description {
currencyCode = code
} else {
print("Error: Code not found: \(simplexCurrencySegmentedControl.selectedSegmentIndex)")
}
}
}
7 changes: 4 additions & 3 deletions litewallet/Constants/Functions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,18 @@ func strongify<Context: AnyObject, Arguments>(_ context: Context?, closure: @esc
}
}

/// Description: 1709405141
/// Description: 1715876807
func tieredOpsFee(store: Store, amount: UInt64) -> UInt64 {
var usdRate = 67.000
var usdRate = 83.000
if let liveRate = store.state.rates.filter({ $0.code == "USD" }).first?.rate {
usdRate = liveRate
}
let usdInLTC = Double(amount) * usdRate / 100_000_000

switch usdInLTC {
case 0 ..< 20.00:
return UInt64(0.20 / usdRate * 100_000_000)
let lowRate = usdInLTC * 0.01
return UInt64(lowRate / usdRate * 100_000_000)
case 20.00 ..< 50.00:
return UInt64(0.30 / usdRate * 100_000_000)
case 50.00 ..< 100.00:
Expand Down
Loading

0 comments on commit 244c294

Please sign in to comment.