Skip to content

Commit

Permalink
🚀[Release v3.13.5] Merge into Develop (#245)
Browse files Browse the repository at this point in the history
* version bump

Signed-off-by: kcw-grunt <[email protected]>

* removed unused code

Signed-off-by: kcw-grunt <[email protected]>

* Added Ukrainian localizations

- version bump

Signed-off-by: kcw-grunt <[email protected]>

* Disabled bitrefill until compliance docs received

Adjusted low fees tier

Signed-off-by: kcw-grunt <[email protected]>

* version bump

- Removed Unstoppable code
- Uncommented out Bitrefill
- added more branding

Signed-off-by: kcw-grunt <[email protected]>

* bugfix of SyncProgress crash

https://console.firebase.google.com/project/litewallet-beta/crashlytics/app/ios:com.litecoin.loafwallet/issues/fecabb7c7120dca59920bd7a1918c710?time=last-seven-days&types=crash&sessionEventKey=040a831703ba417ab9c755d44759ced2_1949520751979676838
- Removed Unstoppable code
- Uncommented out Bitrefill
- added more branding
- Need to redesign Moonpay for Apple meeting
- Added labels

Signed-off-by: kcw-grunt <[email protected]>

Further polishing the new buy view

- rebuilt moonpay view
- removed unused logos
- added paste button
- improved layout
- Added non-buy country tabBar ViewController
- Fixed the region filter to change tabbar for unsupported countries
- Added unsupported event for Firebase
- Reset sync params to original value

Signed-off-by: kcw-grunt <[email protected]>

Refactored code

Signed-off-by: kcw-grunt <[email protected]>

---------

Signed-off-by: kcw-grunt <[email protected]>
  • Loading branch information
kcw-grunt committed May 31, 2024
1 parent c49b399 commit e25ed0f
Show file tree
Hide file tree
Showing 70 changed files with 1,402 additions and 1,692 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ litewallet-partner-api-ios
/partner-keys.plist
partner-keys.plist
GoogleService-Info.plist
*.gpx
19 changes: 19 additions & 0 deletions Dakar, Senegal.gpx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<gpx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.topografix.com/GPX/1/1" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd http://www.topografix.com/GPX/gpx_style/0/2 http://www.topografix.com/GPX/gpx_style/0/2/gpx_style.xsd" xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1" xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3" xmlns:gpx_style="http://www.topografix.com/GPX/gpx_style/0/2" version="1.1" creator="https://gpx.studio">
<metadata>
<name>new</name>
<author>
<name>gpx.studio</name>
<link href="https://gpx.studio"></link>
</author>
</metadata>
<trk>
<name>new</name>
<type>Cycling</type>
<trkseg>
<trkpt lat="14.737937563639399" lon="-17.483073867161895">
<ele>23.1</ele>
</trkpt>
</trkseg>
</trk>
</gpx>
160 changes: 51 additions & 109 deletions litewallet.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

51 changes: 0 additions & 51 deletions litewallet/AlertFailureView.swift

This file was deleted.

40 changes: 40 additions & 0 deletions litewallet/ApplicationController.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import BackgroundTasks
import StoreKit
import SwiftUI
import UIKit

let timeSinceLastExitKey = "TimeSinceLastExit"
Expand Down Expand Up @@ -73,6 +74,8 @@ class ApplicationController: Subscriber, Trackable {
}

private func setup() {
setupDefaults()
countLaunches()
setupRootViewController()
window?.makeKeyAndVisible()
offMainInitialization()
Expand Down Expand Up @@ -316,3 +319,40 @@ class ApplicationController: Subscriber, Trackable {
}
}
}

extension ApplicationController {
func setupDefaults() {
if UserDefaults.standard.object(forKey: shouldRequireLoginTimeoutKey) == nil {
UserDefaults.standard.set(60.0 * 3.0, forKey: shouldRequireLoginTimeoutKey) // Default 3 min timeout
}
if UserDefaults.standard.object(forKey: hasSeenAnnounceView) == nil {
UserDefaults.standard.set(false, forKey: hasSeenAnnounceView) // Hasnt seen the Announce View
}
}

func countLaunches() {
if var launchNumber = UserDefaults.standard.object(forKey: numberOfLitewalletLaunches) as? Int {
launchNumber += 1
UserDefaults.standard.set(NSNumber(value: launchNumber), forKey: numberOfLitewalletLaunches)
if launchNumber == 5 {
if #available(iOS 14, *) {
if self.window != nil,
let scene = self.window?.windowScene
{
SKStoreReviewController.requestReview(in: scene)
}

} else {
SKStoreReviewController.requestReview()
}

LWAnalytics.logEventWithParameters(itemName: ._20200125_DSRR)
}
} else {
UserDefaults.standard.set(NSNumber(value: 1), forKey: numberOfLitewalletLaunches)
}
}

func willResignActive()
{}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
{
"images" : [
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ud-Logo-Full-Light@3x.png",
"filename" : "moonpay-white.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 0 additions & 5 deletions litewallet/BRTxInputExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,4 @@ extension BRTxInput {
get { return [UInt8](UnsafeBufferPointer(start: script, count: scriptLen)) }
set { BRTxInputSetScript(&self, newValue, newValue.count) }
}

var swiftSignature: [UInt8] {
get { return [UInt8](UnsafeBufferPointer(start: signature, count: sigLen)) }
set { BRTxInputSetSignature(&self, newValue, newValue.count) }
}
}
7 changes: 1 addition & 6 deletions litewallet/BartyCrouch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,20 @@ import Foundation
enum BartyCrouch {
enum SupportedLanguage: String {
// TODO: remove unsupported languages from the following cases list & add any missing languages
case arabic = "ar"
case chineseSimplified = "zh-Hans"
case chineseTraditional = "zh-Hant"
case english = "en"
case french = "fr"
case german = "de"
case hindi = "hi"
case indonesian = "id"
case italian = "it"
case japanese = "ja"
case korean = "ko"
case malay = "ms"
case portuguese = "pt"
case russian = "ru"
case spanish = "es"
case danish = "da"
case dutch = "nl"
case swedish = "sv"
case turkey = "tr"
case ukrainian = "uk"
}

static func translate(key: String, translations: [SupportedLanguage: String], comment _: String? = nil) -> String {
Expand Down
24 changes: 18 additions & 6 deletions litewallet/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand All @@ -19,18 +19,29 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="new-logotype-white" translatesAutoresizingMaskIntoConstraints="NO" id="UyL-pz-ADP">
<rect key="frame" x="67.5" y="249.5" width="240" height="128"/>
<constraints>
<constraint firstAttribute="height" constant="128" id="2T7-QM-N2k"/>
<constraint firstAttribute="width" secondItem="UyL-pz-ADP" secondAttribute="height" multiplier="15:8" id="gVV-Cv-OOs"/>
<constraint firstAttribute="width" constant="240" id="qRO-re-ZCk"/>
</constraints>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="litecoinFoundationLogo" translatesAutoresizingMaskIntoConstraints="NO" id="4Uy-2W-2oq">
<rect key="frame" x="125" y="310" width="125" height="47"/>
<rect key="frame" x="137" y="587.5" width="101" height="54.5"/>
<constraints>
<constraint firstAttribute="width" constant="125" id="wF8-SG-7m4"/>
<constraint firstAttribute="width" secondItem="4Uy-2W-2oq" secondAttribute="height" multiplier="50:27" id="LXi-Mv-tv8"/>
<constraint firstAttribute="height" constant="54.5" id="kNp-6s-xRq"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" red="0.086274509799999996" green="0.24313725489999999" blue="0.49803921569999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="tintColor" red="0.086274509799999996" green="0.24313725489999999" blue="0.49803921569999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="4Uy-2W-2oq" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="e7w-QI-2ig"/>
<constraint firstItem="4Uy-2W-2oq" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="g5u-1h-SRX"/>
<constraint firstItem="4Uy-2W-2oq" firstAttribute="centerX" secondItem="UyL-pz-ADP" secondAttribute="centerX" id="LCk-KH-GoU"/>
<constraint firstItem="UyL-pz-ADP" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="UlD-yW-hJ1"/>
<constraint firstItem="xb3-aO-Qok" firstAttribute="top" secondItem="4Uy-2W-2oq" secondAttribute="bottom" constant="25" id="f5H-Dd-1vk"/>
<constraint firstItem="UyL-pz-ADP" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" constant="-20" id="lUV-Or-9fO"/>
</constraints>
</view>
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics" statusBarStyle="lightContent"/>
Expand All @@ -42,5 +53,6 @@
</scenes>
<resources>
<image name="litecoinFoundationLogo" width="126.33333587646484" height="47"/>
<image name="new-logotype-white" width="3688" height="825"/>
</resources>
</document>
51 changes: 51 additions & 0 deletions litewallet/BuyHostingController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import Foundation
import SwiftUI

/// Moonpay: List supported countries endpoint
/// https://api.moonpay.com/v3/countries
/// - Parameter alphaCode2Char: String
/// - Parameter alphaCode3Char: String
/// - Parameter isBuyAllowed: Bool
/// - Parameter isSellAllowed: Bool
/// - Parameter countryName: String (name)
/// - Parameter isAllowedInCountry: Bool (isAllowed)
/// ===================================
/// Unused JSON parameters
/// "isNftAllowed": false
/// "isBalanceLedgerWithdrawAllowed": true,
/// "isSelfServeHighRisk": true,
/// "continent": "Asia",
/// "supportedDocuments": [
/// "passport",
/// "driving_licence",
/// "national_identity_card",
/// "residence_permit",
/// ],
/// "suggestedDocument": "national_identity_card"
/// - Returns: MoonpayCountryData
public struct MoonpayCountryData: Codable, Hashable {
var alphaCode2Char: String
var alphaCode3Char: String
var isBuyAllowed: Bool
var isSellAllowed: Bool
var countryName: String
var isAllowedInCountry: Bool
}

class BuyHostingController: UIHostingController<BuyView> {
var contentView: BuyView

var isLoaded: Bool = false

init() {
let buyViewModel = BuyViewModel()
contentView = BuyView(viewModel: buyViewModel)

super.init(rootView: contentView)
}

@available(*, unavailable)
@MainActor dynamic required init?(coder _: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
Loading

0 comments on commit e25ed0f

Please sign in to comment.