Skip to content

Commit

Permalink
Merge pull request #888 from novasamatech/develop
Browse files Browse the repository at this point in the history
v7.2x and v7.3.x
  • Loading branch information
ERussel authored Nov 17, 2023
2 parents 2b5db4a + 2923df9 commit 573232f
Show file tree
Hide file tree
Showing 105 changed files with 1,196 additions and 533 deletions.
4 changes: 2 additions & 2 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ platform :ios, '13.0'
abstract_target 'novawalletAll' do
use_frameworks!

pod 'SubstrateSdk', :git => 'https://github.com/nova-wallet/substrate-sdk-ios.git', :tag => '1.13.0'
pod 'SubstrateSdk', :git => 'https://github.com/nova-wallet/substrate-sdk-ios.git', :tag => '1.14.0'
pod 'SwiftLint'
pod 'R.swift', :inhibit_warnings => true
pod 'SoraKeystore', '~> 1.0.0'
Expand All @@ -31,7 +31,7 @@ abstract_target 'novawalletAll' do
inherit! :search_paths

pod 'Cuckoo'
pod 'SubstrateSdk', :git => 'https://github.com/nova-wallet/substrate-sdk-ios.git', :tag => '1.13.0'
pod 'SubstrateSdk', :git => 'https://github.com/nova-wallet/substrate-sdk-ios.git', :tag => '1.14.0'
pod 'SoraFoundation', :git => 'https://github.com/ERussel/Foundation-iOS.git', :tag => '1.1.0'
pod 'R.swift', :inhibit_warnings => true
pod 'FireMock', :inhibit_warnings => true
Expand Down
14 changes: 7 additions & 7 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ PODS:
- SoraUI/Skrull (1.11.1)
- Sourcery (1.4.1)
- Starscream (4.0.8)
- SubstrateSdk (1.13.0):
- SubstrateSdk (1.14.0):
- BigInt (~> 5.0)
- IrohaCrypto/ed25519 (~> 0.9.0)
- IrohaCrypto/Scrypt (~> 0.9.0)
Expand Down Expand Up @@ -162,7 +162,7 @@ DEPENDENCIES:
- SoraUI (from `https://github.com/ERussel/UIkit-iOS.git`, tag `1.11.1`)
- Sourcery (~> 1.4)
- Starscream (from `https://github.com/ERussel/Starscream.git`, tag `4.0.8`)
- SubstrateSdk (from `https://github.com/nova-wallet/substrate-sdk-ios.git`, tag `1.13.0`)
- SubstrateSdk (from `https://github.com/nova-wallet/substrate-sdk-ios.git`, tag `1.14.0`)
- SVGKit (from `https://github.com/SVGKit/SVGKit.git`, tag `3.0.0`)
- SwiftAlgorithms (~> 1.0.0)
- SwiftFormat/CLI (~> 0.47.13)
Expand Down Expand Up @@ -220,7 +220,7 @@ EXTERNAL SOURCES:
:tag: 4.0.8
SubstrateSdk:
:git: https://github.com/nova-wallet/substrate-sdk-ios.git
:tag: 1.13.0
:tag: 1.14.0
SVGKit:
:git: https://github.com/SVGKit/SVGKit.git
:tag: 3.0.0
Expand Down Expand Up @@ -251,7 +251,7 @@ CHECKOUT OPTIONS:
:tag: 4.0.8
SubstrateSdk:
:git: https://github.com/nova-wallet/substrate-sdk-ios.git
:tag: 1.13.0
:tag: 1.14.0
SVGKit:
:git: https://github.com/SVGKit/SVGKit.git
:tag: 3.0.0
Expand Down Expand Up @@ -288,7 +288,7 @@ SPEC CHECKSUMS:
SoraUI: e5ceb2cffe40145e589aa464e2e0a8d054011e0b
Sourcery: db66600e8b285c427701821598d07cf3c7e6c476
Starscream: b676ee89781677a2d8d36029a78c970710e2d3eb
SubstrateSdk: aad6725e00295219ee9722b1975175ef4db3f4a6
SubstrateSdk: 1cb78eac5b05f2c259487f3027c3ae807f24c097
SVGKit: 132b010efbf57ec345309fe4a7f627c0a40c5d63
SwiftAlgorithms: 38dda4731d19027fdeee1125f973111bf3386b53
SwiftFormat: 73573b89257437c550b03d934889725fbf8f75e5
Expand All @@ -303,6 +303,6 @@ SPEC CHECKSUMS:
ZMarkupParser: a92d31ba40695b790f1da5fec98c3d4505341aff
ZNSTextAttachment: 4a9b4e8ee1ed087fc893ae6657dfb678f1a00340

PODFILE CHECKSUM: 9da63967acbaf0ea90ab5cf6e0cef78c59d3668f
PODFILE CHECKSUM: f37e3724d47617fb7ce7ed5e0a583491617b5899

COCOAPODS: 1.12.1
COCOAPODS: 1.13.0
62 changes: 51 additions & 11 deletions novawallet.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions novawallet/Assets.xcassets/iconCloseWithBg.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "iconCloseWithBg.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
6 changes: 6 additions & 0 deletions novawallet/Assets.xcassets/iconsBuyProviders/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "Banxa.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "imagePolkadotStakingBg.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "imagePolkadotStakingPromo.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
4 changes: 2 additions & 2 deletions novawallet/Common/Configs/ApplicationConfigs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ extension ApplicationConfig: ApplicationConfigProtocol {

var chainListURL: URL {
#if F_RELEASE
URL(string: "https://raw.githubusercontent.com/novasamatech/nova-utils/master/chains/v14/chains.json")!
URL(string: "https://raw.githubusercontent.com/novasamatech/nova-utils/master/chains/v15/chains.json")!
#else
URL(string: "https://raw.githubusercontent.com/novasamatech/nova-utils/master/chains/v14/chains_dev.json")!
URL(string: "https://raw.githubusercontent.com/novasamatech/nova-utils/master/chains/v15/chains_dev.json")!
#endif
}

Expand Down
11 changes: 11 additions & 0 deletions novawallet/Common/Extension/SettingsExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ enum SettingsKey: String {
case skippedUpdateVersion
case skippedAddDelegationTracksHint
case pinConfirmationEnabled
case polkadotStakingPromoSeen
}

extension SettingsManagerProtocol {
Expand Down Expand Up @@ -162,4 +163,14 @@ extension SettingsManagerProtocol {
set(value: newValue, for: SettingsKey.skippedAddDelegationTracksHint.rawValue)
}
}

var polkadotStakingPromoSeen: Bool {
get {
bool(for: SettingsKey.polkadotStakingPromoSeen.rawValue) ?? false
}

set {
set(value: newValue, for: SettingsKey.polkadotStakingPromoSeen.rawValue)
}
}
}
10 changes: 10 additions & 0 deletions novawallet/Common/Extension/UIKit/RoundedButton+Styles.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ extension RoundedButton {
changesContentOpacityWhenHighlighted = true
}

func applyIconWithBackgroundStyle() {
roundedBackgroundView?.shadowOpacity = 0
roundedBackgroundView?.fillColor = R.color.colorBlockBackground()!
roundedBackgroundView?.highlightedFillColor = R.color.colorBlockBackground()!
roundedBackgroundView?.strokeColor = .clear
roundedBackgroundView?.highlightedStrokeColor = .clear
roundedBackgroundView?.cornerRadius = 12
changesContentOpacityWhenHighlighted = true
}

func applySecondaryStyle() {
roundedBackgroundView?.shadowOpacity = 0.0
roundedBackgroundView?.fillColor = R.color.colorButtonBackgroundSecondary()!
Expand Down
10 changes: 10 additions & 0 deletions novawallet/Common/Extension/UIKit/Style/UILabel+Style.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ extension UILabel.Style {
font: .semiBoldSubheadline
)

static let semiboldSubhedlinePrimary = UILabel.Style(
textColor: R.color.colorTextPrimary(),
font: .semiBoldSubheadline
)

static let semiboldBodyPrimary = UILabel.Style(
textColor: R.color.colorTextPrimary(),
font: .semiBoldBody
Expand Down Expand Up @@ -81,6 +86,11 @@ extension UILabel.Style {
font: .regularFootnote
)

static let caption1Primary = UILabel.Style(
textColor: R.color.colorTextPrimary(),
font: .caption1
)

static let caption1Secondary = UILabel.Style(
textColor: R.color.colorTextSecondary(),
font: .caption1
Expand Down
11 changes: 11 additions & 0 deletions novawallet/Common/Helpers/KeyboardAppearanceState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import UIKit
protocol KeyboardAppearanceStrategyProtocol {
func onViewWillAppear(for target: UIView)
func onViewDidAppear(for target: UIView)
func onCellSelected(for target: UIView)
}

extension KeyboardAppearanceStrategyProtocol {
func onCellSelected(for _: UIView) {}
}

final class EventDrivenKeyboardStrategy: KeyboardAppearanceStrategyProtocol {
Expand Down Expand Up @@ -56,4 +61,10 @@ final class ModalNavigationKeyboardStrategy: KeyboardAppearanceStrategyProtocol
isPresented = true
}
}

func onCellSelected(for target: UIView) {
if isPresented {
target.resignFirstResponder()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ extension RemoteAssetModel {
staking: nil,
type: AssetType.evmAsset.rawValue,
typeExtras: JSON.stringValue(evmInstance.contractAddress),
buyProviders: nil
buyProviders: evmInstance.buyProviders
)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Foundation
import SubstrateSdk

struct RemoteEvmToken: Codable {
let symbol: String
Expand All @@ -11,5 +12,6 @@ struct RemoteEvmToken: Codable {
struct Instance: Codable {
let chainId: String
let contractAddress: String
let buyProviders: JSON?
}
}
68 changes: 68 additions & 0 deletions novawallet/Common/Protocols/PurchaseFlowManaging.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import SoraFoundation

protocol PurchaseFlowManaging {
func startPuchaseFlow(
from view: ControllerBackedProtocol?,
purchaseActions: [PurchaseAction],
wireframe: (PurchasePresentable & AlertPresentable)?,
locale: Locale
)
}

extension PurchaseFlowManaging where Self: ModalPickerViewControllerDelegate & PurchaseDelegate {
func startPuchaseFlow(
from view: ControllerBackedProtocol?,
purchaseActions: [PurchaseAction],
wireframe: (PurchasePresentable & AlertPresentable)?,
locale: Locale
) {
guard !purchaseActions.isEmpty else {
return
}
if purchaseActions.count == 1 {
startPuchaseFlow(from: view, purchaseAction: purchaseActions[0], wireframe: wireframe, locale: locale)
} else {
wireframe?.showPurchaseProviders(
from: view,
actions: purchaseActions,
delegate: self
)
}
}

func startPuchaseFlow(
from view: ControllerBackedProtocol?,
purchaseAction: PurchaseAction,
wireframe: (PurchasePresentable & AlertPresentable)?,
locale: Locale
) {
let title = R.string.localizable.commonAlertExternalLinkDisclaimerTitle(preferredLanguages: locale.rLanguages)
let message = R.string.localizable.commonAlertExternalLinkDisclaimerMessage(
purchaseAction.displayURL,
preferredLanguages: locale.rLanguages
)

let closeTitle = R.string.localizable
.commonCancel(preferredLanguages: locale.rLanguages)
let continueTitle = R.string.localizable
.commonContinue(preferredLanguages: locale.rLanguages)
let continueAction = AlertPresentableAction(title: continueTitle) {
wireframe?.showPurchaseTokens(
from: view,
action: purchaseAction,
delegate: self
)
}

wireframe?.present(
viewModel: .init(
title: title,
message: message,
actions: [continueAction],
closeAction: closeTitle
),
style: .alert,
from: view
)
}
}
67 changes: 67 additions & 0 deletions novawallet/Common/Protocols/PurchasePresentable.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import Foundation

protocol PurchasePresentable {
func showPurchaseTokens(
from view: ControllerBackedProtocol?,
action: PurchaseAction,
delegate: PurchaseDelegate
)

func showPurchaseProviders(
from view: ControllerBackedProtocol?,
actions: [PurchaseAction],
delegate: ModalPickerViewControllerDelegate
)

func presentPurchaseDidComplete(
view: ControllerBackedProtocol?,
locale: Locale
)
}

extension PurchasePresentable {
func showPurchaseTokens(
from view: ControllerBackedProtocol?,
action: PurchaseAction,
delegate: PurchaseDelegate
) {
guard let purchaseView = PurchaseViewFactory.createView(
for: action,
delegate: delegate
) else {
return
}
purchaseView.controller.modalPresentationStyle = .fullScreen
view?.controller.present(purchaseView.controller, animated: true)
}

func showPurchaseProviders(
from view: ControllerBackedProtocol?,
actions: [PurchaseAction],
delegate: ModalPickerViewControllerDelegate
) {
guard let pickerView = ModalPickerFactory.createPickerForList(
actions,
delegate: delegate,
context: nil
) else {
return
}
guard let navigationController = view?.controller.navigationController else {
return
}
navigationController.present(pickerView, animated: true)
}

func presentPurchaseDidComplete(
view: ControllerBackedProtocol?,
locale: Locale
) {
let languages = locale.rLanguages
let message = R.string.localizable
.buyCompleted(preferredLanguages: languages)

let alertController = ModalAlertFactory.createMultilineSuccessAlert(message)
view?.controller.present(alertController, animated: true)
}
}
Loading

0 comments on commit 573232f

Please sign in to comment.