Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOB-2028 - Purchase UW #575

Merged
merged 93 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
2ea56b4
MOB-1886 - Fireblocks + UD POC (#487)
Oleg-Pecheneg Apr 9, 2024
23a4289
MOB-1958 - Load MPC wallet assets (#488)
Oleg-Pecheneg Apr 9, 2024
44b50e0
MOB-1959 - Added mpc wallet type (#490)
Oleg-Pecheneg Apr 10, 2024
a12d5ff
Merge branch 'development' into dev/feat/MOB-1885-Fireblocks
Oleg-Pecheneg Apr 10, 2024
fd2657a
Merge branch 'development' into dev/feat/MOB-1885-Fireblocks
Oleg-Pecheneg Apr 11, 2024
4c8b570
Merge branch 'development' into dev/feat/MOB-1885-Fireblocks
Oleg-Pecheneg Apr 11, 2024
fe8988d
Merge branch 'development' into dev/feat/MOB-1885-Fireblocks
Oleg-Pecheneg Apr 11, 2024
255b11d
MOB-1964 - Added ability to purchase mpc wallet (#495)
Oleg-Pecheneg Apr 12, 2024
7d1cd19
MOB-1953 Prepare wallet code for mpc (#496)
rommex Apr 13, 2024
6d7a9b7
Merge branch 'development' into dev/feat/MOB-1885-Fireblocks
Oleg-Pecheneg Apr 15, 2024
7369a9a
Merge branch 'development' into dev/feat/MOB-1885-Fireblocks
Oleg-Pecheneg Apr 16, 2024
ee29968
MOB-1977 - Restore session with bootstrap token (#503)
Oleg-Pecheneg Apr 17, 2024
43a4c7c
Merge branch 'development' into dev/feat/MOB-1885-Fireblocks
Oleg-Pecheneg Apr 17, 2024
7ff8da4
Merge branch 'development' into dev/feat/MOB-1885-Fireblocks
Oleg-Pecheneg Apr 17, 2024
9512241
MOB-1985 - Sign personal message with MPC wallet (#508)
Oleg-Pecheneg Apr 23, 2024
556e169
Merge branch 'development' into dev/feat/MOB-1885-Fireblocks
Oleg-Pecheneg Apr 23, 2024
da58a35
Fixed preview target
Oleg-Pecheneg Apr 23, 2024
6b3c906
Merge branch 'development' into dev/feat/MOB-1885-Fireblocks
Oleg-Pecheneg Apr 23, 2024
53d3c5f
Merge branch 'development' into dev/feat/MOB-1885-Fireblocks
Oleg-Pecheneg Apr 23, 2024
5ff9672
Merge branch 'development' into dev/feat/MOB-1885-Fireblocks
Oleg-Pecheneg Apr 23, 2024
1df59a4
MOB-1986 - Activate MPC wallet during onboarding (#512)
Oleg-Pecheneg Apr 23, 2024
ebee719
Merge branch 'development' into dev/feat/MOB-1885-Fireblocks
Oleg-Pecheneg Apr 24, 2024
0df8eef
Merge branch 'development' into dev/feat/MOB-1885-Fireblocks
Oleg-Pecheneg Apr 24, 2024
6e175b2
MOB-1992 - Let user activate MPC wallet after onboarding (#518)
Oleg-Pecheneg Apr 24, 2024
8dcc765
MOB-1986 - Fixing incorrect copies (#520)
Oleg-Pecheneg Apr 25, 2024
8a5861a
Merge branch 'development' into dev/feat/MOB-1885-Fireblocks
Oleg-Pecheneg Apr 25, 2024
aa4df85
MOB-1996 - Update MPC wallets UI (#521)
Oleg-Pecheneg Apr 25, 2024
3596ef4
MOB-1997 - Load balances for MPC wallet (#523)
Oleg-Pecheneg Apr 25, 2024
ed23b57
MOB-1986 - Onboarding MPC fixes (#524)
Oleg-Pecheneg Apr 25, 2024
9dbacec
Load balances for all mpc wallet assets
Oleg-Pecheneg Apr 25, 2024
8be769c
Updates in MPC wallets work (#525)
Oleg-Pecheneg Apr 26, 2024
06e3709
Merge branch 'development' into dev/feat/MOB-1885-Fireblocks
Oleg-Pecheneg Apr 30, 2024
aa02dcb
Fix MPC message conversion (#530)
rommex May 2, 2024
3ae2b87
Merge branch 'development' into dev/feat/MOB-1885-Fireblocks
Oleg-Pecheneg May 3, 2024
15ffc09
Fixed Preview target
Oleg-Pecheneg May 3, 2024
35b19a8
MOB-1998 - Send crypto from MPC wallet (#535)
Oleg-Pecheneg May 8, 2024
7d7bacc
MOB-2014 - Share addresses of MPC wallet (#538)
Oleg-Pecheneg May 8, 2024
e1e9d9b
MOB-2017 - Fetch gas prices using MPC wallets API (#542)
Oleg-Pecheneg May 9, 2024
55c3d14
MOB-2014 - Share MPC addresses fixes (#543)
Oleg-Pecheneg May 9, 2024
b358322
MOB-2014 - Fixed copies
Oleg-Pecheneg May 9, 2024
8d81909
Refresh token on app launch
Oleg-Pecheneg May 9, 2024
5953371
Enable production url
Oleg-Pecheneg May 10, 2024
35ce986
MOB-1942 - Updated Settings screen UI (#546)
Oleg-Pecheneg May 10, 2024
d62b773
Share Fireblocks logs in debug
Oleg-Pecheneg May 10, 2024
c21e21c
Revert refresh token on app launch
Oleg-Pecheneg May 10, 2024
fdf75db
Temporary use api key to get balances for mpc wallet
Oleg-Pecheneg May 13, 2024
71b1a0e
Fixed preview target
Oleg-Pecheneg May 13, 2024
6bab86e
MOB-2020 - Rename MPC wallet product (#547)
Oleg-Pecheneg May 13, 2024
9734ebf
Miscellaneous fixes (#548)
Oleg-Pecheneg May 14, 2024
16d36f1
Merge branch 'development' into dev/feat/MOB-1885-Fireblocks
Oleg-Pecheneg May 14, 2024
de09e22
Fixed numbers formatting when sending funds from MPC wallets
Oleg-Pecheneg May 14, 2024
19a3a56
Merge branch 'development' into dev/feat/MOB-1885-Fireblocks
Oleg-Pecheneg May 14, 2024
e0cb7f5
MOB-2020 - Fixed copies that referencing mpc wallet product (#551)
Oleg-Pecheneg May 14, 2024
903349f
Fixed issue when request to change email was made when activating MPC
Oleg-Pecheneg May 15, 2024
3621337
Disable create wallet selection screen
Oleg-Pecheneg May 15, 2024
fbefe2a
Fixed preview target
Oleg-Pecheneg May 15, 2024
332e96d
Fixed mpc enter credentials layout on smaller devices
Oleg-Pecheneg May 15, 2024
92703a8
Fixed enter mpc credentials appearance animation
Oleg-Pecheneg May 15, 2024
7d7bdfc
Updated Settings icons
Oleg-Pecheneg May 15, 2024
647e6e9
Updated settings more section icons background
Oleg-Pecheneg May 15, 2024
23c3ecf
Updated add currency view (#552)
Oleg-Pecheneg May 15, 2024
c8d2f6e
MOB-2023 - Allow to send BASE using raw address (#553)
Oleg-Pecheneg May 16, 2024
4e75b13
Removed purchase mpc option from top menu
Oleg-Pecheneg May 17, 2024
52c9468
MOB-2023 - Don't resolve raw address to send crypto (#554)
Oleg-Pecheneg May 17, 2024
e570412
Fixed issue when passcode verification wasn't started after pull up t…
Oleg-Pecheneg May 20, 2024
9d0bf15
MOB-2033 - MPC wallets analytics (#556)
Oleg-Pecheneg May 20, 2024
81b0d2d
Handle null token balance in the response
Oleg-Pecheneg May 21, 2024
d204ea8
Updated Fireblocks SDK to 2.4.1
Oleg-Pecheneg May 21, 2024
33c23af
MOB-2029 - Purchase MPC wallet POC (#558)
Oleg-Pecheneg May 22, 2024
8d79085
Merge branch 'development' into dev/feat/MOB-1885-Fireblocks
Oleg-Pecheneg May 23, 2024
7c27829
Merge branch 'dev/feat/MOB-1885-Fireblocks' into dev/feat/fireblocks/…
Oleg-Pecheneg May 23, 2024
5e677cb
MOB-2032 - Handle expired MPC wallet tokens (#559)
Oleg-Pecheneg May 23, 2024
1b10c84
Merge branch 'dev/feat/MOB-1885-Fireblocks' into dev/feat/fireblocks/…
Oleg-Pecheneg May 23, 2024
c0a6023
Merge branch 'development' into dev/feat/fireblocks/MOB-2028-purchase
Oleg-Pecheneg May 23, 2024
c2343d6
Merge branch 'development' into dev/feat/fireblocks/MOB-2028-purchase
Oleg-Pecheneg May 27, 2024
bfa32a0
Check isMPCWalletEnabled to see if it is allowed to purchase mpc wallet
Oleg-Pecheneg May 27, 2024
dd6067b
Merge branch 'development' into dev/feat/fireblocks/MOB-2028-purchase
Oleg-Pecheneg May 28, 2024
6966638
MOB-2045 - Implement UI to select to create UW during onboarding (#569)
Oleg-Pecheneg May 28, 2024
bc7be5a
MOB-2046 - Buy mpc wallet during onboarding (#571)
Oleg-Pecheneg May 29, 2024
0b793ab
MOB-2047 - Setup mpc wallet after purchase during onboarding (#572)
Oleg-Pecheneg May 30, 2024
07d584a
MOB-2052 - Purchase MPC wallet in app (#574)
Oleg-Pecheneg May 30, 2024
5ba1fe6
Added feature flag to control mpc purchase availability
Oleg-Pecheneg May 31, 2024
0b53802
Fixed enter credentials scrolling issue
Oleg-Pecheneg May 31, 2024
7a0250c
Fixed top padding
Oleg-Pecheneg May 31, 2024
e0e3026
Do not send bootstrap code when not necessary
Oleg-Pecheneg May 31, 2024
a926e94
Updated copies
Oleg-Pecheneg May 31, 2024
3ca9929
Added email query to claim mpc request
Oleg-Pecheneg May 31, 2024
657f67f
Handle case when email verification failed
Oleg-Pecheneg May 31, 2024
d5c190a
Merge branch 'development' into dev/feat/fireblocks/MOB-2028-purchase
Oleg-Pecheneg Jun 1, 2024
11357c7
Rename UW
Oleg-Pecheneg Jun 1, 2024
2910029
Merge branch 'development' into dev/feat/fireblocks/MOB-2028-purchase
Oleg-Pecheneg Jun 17, 2024
3dca7fe
Merge branch 'development' into dev/feat/fireblocks/MOB-2028-purchase
Oleg-Pecheneg Jun 17, 2024
a203265
Merge branch 'development' into dev/feat/fireblocks/MOB-2028-purchase
Oleg-Pecheneg Jun 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// PreviewEcomMPCPriceFetcher.swift
// unstoppable-preview
//
// Created by Oleg Kuplin on 28.05.2024.
//

import Foundation

final class EcomMPCPriceFetcher {

static let shared = EcomMPCPriceFetcher()

func fetchPrice() async throws -> Int {
await Task.sleep(seconds: 0.5)
return 999
}

}
278 changes: 248 additions & 30 deletions unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ extension String {
static let to = "TO"
static let domainOrAddress = "DOMAIN_OR_ADDRESS"
static let yourWallets = "YOUR_WALLETS"
static let new = "NEW"
static let confirmEmail = "CONFIRM_EMAIL"
static let setup = "SETUP"

//Onboarding
static let alreadyMintedDomain = "ALREADY_MINTED_DOMAIN"
Expand Down Expand Up @@ -1232,6 +1235,29 @@ extension String {
static let removeMPCWalletPullUpSubtitle = "REMOVE_MPC_WALLET_PULL_UP_SUBTITLE"
static let mpcWalletMessagingUnavailableMessage = "MPC_WALLET_MESSAGING_UNAVAILABLE_MESSAGE"
static let mpcWalletSigningUnavailableErrorMessage = "MPC_WALLET_SIGNING_UNAVAILABLE_ERROR_MESSAGE"
static let createMPCOnboardingSubtitle = "CREATE_MPC_ONBOARDING_SUBTITLE"
static let createWalletOnboardingSubtitle = "CREATE_WALLET_ONBOARDING_SUBTITLE"
static let nPricePerYear = "N_PRICE_PER_YEAR"
static let buyMPCEnterEmailSubtitle = "BUY_MPC_ENTER_EMAIL_SUBTITLE"
static let subscribe = "SUBSCRIBE"
static let mpcPurchaseErrorMessage = "MPC_PURCHASE_ERROR_MESSAGE"
static let mpcWalletAlreadyPurchasedTitle = "MPC_WALLET_ALREADY_PURCHASED_TITLE"
static let mpcWalletAlreadyPurchasedSubtitle = "MPC_WALLET_ALREADY_PURCHASED_SUBTITLE"
static let useDifferentEmail = "USE_DIFFERENT_EMAIL"
static let mpcPasswordValidationLengthTitle = "MPC_PASSWORD_VALIDATION_LENGTH_TITLE"
static let mpcPasswordValidationTooLongTitle = "MPC_PASSWORD_VALIDATION_TOO_LONG_TITLE"
static let mpcPasswordValidationNumberTitle = "MPC_PASSWORD_VALIDATION_NUMBER_TITLE"
static let mpcPasswordValidationSpecialCharTitle = "MPC_PASSWORD_VALIDATION_SPECIAL_CHAR_TITLE"
static let mpcTakeoverCredentialsSubtitle = "MPC_TAKEOVER_CREDENTIALS_SUBTITLE"
static let mpcTakeoverRecoveryTitle = "MPC_TAKEOVER_RECOVERY_TITLE"
static let mpcTakeoverRecoverySubtitle = "MPC_TAKEOVER_RECOVERY_SUBTITLE"
static let sendMeRecoveryLink = "SEND_ME_RECOVERY_LINK"
static let dontSendMeRecoveryLink = "DONT_SEND_ME_RECOVERY_LINK"
static let mpcWalletEmailInUseMessage = "MPC_WALLET_EMAIL_IN_USE_MESSAGE"
static let mpcWalletEmailInUseCantVerifyMessage = "MPC_WALLET_EMAIL_IN_USE_CANT_VERIFY_MESSAGE"
static let mpcTakeoverInProgressTitle = "MPC_TAKEOVER_IN_PROGRESS_TITLE"
static let mpcTakeoverInProgressSubtitle = "MPC_TAKEOVER_IN_PROGRESS_SUBTITLE"
static let contactSupport = "CONTACT_SUPPORT"
static let mpcWalletDefaultName = "MPC_WALLET_DEFAULT_NAME"

// Send crypto first time
Expand Down Expand Up @@ -1349,4 +1375,8 @@ extension String {
func appendingURLQueryComponents(_ components: [String : String]) -> String {
self + "?" + components.compactMap({ "\($0.key)=\($0.value)".addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) }).joined(separator: "&")
}

var encodingSpecialCharacters: String {
addingPercentEncoding(withAllowedCharacters: .alphanumerics) ?? self
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ final class HomeTabRouter: ObservableObject {
@Published var isSelectProfilePresented: Bool = false
@Published var isConnectedAppsListPresented: Bool = false
@Published var showingUpdatedToWalletGreetings: Bool = false
@Published var purchasingMPCWallet: Bool = false
@Published var tabViewSelection: HomeTab = .wallets
@Published var pullUp: ViewPullUpConfigurationType?
@Published var walletViewNavPath: [HomeWalletNavigationDestination] = []
Expand Down Expand Up @@ -296,7 +295,6 @@ extension HomeTabRouter {
isSelectProfilePresented = false
isConnectedAppsListPresented = false
showingUpdatedToWalletGreetings = false
purchasingMPCWallet = false
presentedNFT = nil
presentedDomain = nil
presentedPublicDomain = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ struct HomeTabView: View {
.sheet(item: $router.sendCryptoInitialData, content: { initialData in
SendCryptoAssetRootView(viewModel: SendCryptoAssetViewModel(initialData: initialData))
})
.sheet(isPresented: $router.purchasingMPCWallet, content: {
PurchaseMPCWalletRootView()
})
.sheet(item: $router.resolvingPrimaryDomainWallet, content: { presentationDetails in
ReverseResolutionSelectionView(wallet: presentationDetails.wallet,
mode: presentationDetails.mode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,13 @@ extension HomeWalletView {

case copyWalletAddress
case connectedApps
case buyMPC

var title: String {
switch self {
case .copyWalletAddress:
return String.Constants.copyWalletAddress.localized()
case .connectedApps:
return String.Constants.connectedAppsTitle.localized()
case .buyMPC:
return "Buy MPC"
}
}

Expand All @@ -165,8 +162,6 @@ extension HomeWalletView {
return Image.systemDocOnDoc
case .connectedApps:
return Image.systemAppBadgeCheckmark
case .buyMPC:
return .wallet3Icon
}
}

Expand All @@ -176,8 +171,6 @@ extension HomeWalletView {
return .copyWalletAddress
case .connectedApps:
return .connectedApps
case .buyMPC:
return .unblock
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ extension HomeWalletView {
}
case .connectedApps:
router.isConnectedAppsListPresented = true
case .buyMPC:
router.purchasingMPCWallet = true
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct MPCEnterCredentialsInAppView: View {
let preFilledEmail: String?

var body: some View {
MPCEnterCredentialsView(mode: preFilledEmail == nil ? .freeInput : .strictEmail(preFilledEmail!),
MPCEnterCredentialsView(mode: preFilledEmail == nil ? .freeInput() : .strictEmail(preFilledEmail!),
analyticsName: .mpcEnterCredentialsInApp,
credentialsCallback: didEnterCredentials)
.padding(.top, ActivateMPCWalletFlow.viewsTopOffset)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,10 @@ private extension MPCActivateWalletView {

@ViewBuilder
func mpcStateView() -> some View {
MPCActivateWalletStateCardView(title: mpcStateTitle,
activationState: activationState,
mpcCreateProgress: mpcCreateProgress)
MPCWalletStateCardView(title: mpcStateTitle,
subtitle: String.Constants.mpcProductName.localized(),
mode: .activation(activationState),
mpcCreateProgress: mpcCreateProgress)
}

@ViewBuilder
Expand Down Expand Up @@ -237,25 +238,3 @@ private extension MPCActivateWalletView {
mpcWalletCreatedCallback: { _ in },
changeEmailCallback: { })
}

struct CircularProgressView: View {
let progress: CGFloat
var lineWidth: CGFloat = 10

var body: some View {
ZStack {
// Background for the progress bar
Circle()
.stroke(lineWidth: lineWidth)
.foregroundStyle(Color.backgroundMuted)

// Foreground or the actual progress bar
Circle()
.trim(from: 0.0, to: min(progress, 1.0))
.stroke(style: StrokeStyle(lineWidth: lineWidth, lineCap: .round, lineJoin: .round))
.foregroundStyle(Color.foregroundAccent)
.rotationEffect(Angle(degrees: 270.0))
.animation(.linear, value: progress)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ struct MPCEnterCredentialsView: View, UserDataValidator, ViewAnalyticsLogger {

@Environment(\.mpcWalletsService) private var mpcWalletsService

var mode: InputMode = .freeInput
var mode: InputMode = .freeInput()
let analyticsName: Analytics.ViewName
let credentialsCallback: (MPCActivateCredentials)->()
@State private var emailInput: String = ""
@State private var passwordInput: String = ""
@State private var isLoading = false
@State private var isEmailFocused = true
@State private var didSetInitialEmail = false
@State private var error: Error?

var body: some View {
Expand Down Expand Up @@ -46,8 +47,11 @@ struct MPCEnterCredentialsView: View, UserDataValidator, ViewAnalyticsLogger {
private extension MPCEnterCredentialsView {
func onAppear() {
switch mode {
case .freeInput:
return
case .freeInput(let email):
if !didSetInitialEmail {
didSetInitialEmail = true
emailInput = email ?? ""
}
case .strictEmail(let email):
self.emailInput = email
}
Expand Down Expand Up @@ -166,7 +170,7 @@ private extension MPCEnterCredentialsView {
// MARK: - Open methods
extension MPCEnterCredentialsView {
enum InputMode {
case freeInput
case freeInput(String? = nil)
case strictEmail(String)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ private extension MPCOnboardingEnterCredentialsViewController {
}

func addChildView() {
let mpcView = MPCEnterCredentialsView(analyticsName: .mpcEnterCredentialsOnboarding) { [weak self] credentials in
let mpcView = MPCEnterCredentialsView(mode: .freeInput(OnboardingData.mpcCredentials?.email),
analyticsName: .mpcEnterCredentialsOnboarding) { [weak self] credentials in
DispatchQueue.main.async {
self?.didEnterCredentials(credentials)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// MPCPurchaseUDCredentials.swift
// domains-manager-ios
//
// Created by Oleg Kuplin on 17.05.2024.
//

import Foundation

struct MPCPurchaseUDCredentials: Hashable {
let email: String
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// MPCTakeoverCredentials.swift
// domains-manager-ios
//
// Created by Oleg Kuplin on 29.05.2024.
//

import Foundation

struct MPCTakeoverCredentials: Hashable {
let email: String
var password: String
var sendRecoveryLink: Bool = true
}
Loading