Skip to content

Commit 6a5c8d7

Browse files
Merge pull request #420 from Adamant-im/develop
Release 3.4.0
2 parents ff2cc61 + 873478d commit 6a5c8d7

File tree

98 files changed

+2916
-560
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+2916
-560
lines changed

Adamant.xcodeproj/project.pbxproj

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
3AA50DF12AEBE66A00C58FC8 /* PartnerQRViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AA50DF02AEBE66A00C58FC8 /* PartnerQRViewModel.swift */; };
3434
3AA50DF32AEBE67C00C58FC8 /* PartnerQRFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AA50DF22AEBE67C00C58FC8 /* PartnerQRFactory.swift */; };
3535
3AC76E3D2AB09118008042C4 /* ElegantEmojiPicker in Frameworks */ = {isa = PBXBuildFile; productRef = 3AC76E3C2AB09118008042C4 /* ElegantEmojiPicker */; };
36+
3AF08D5F2B4EB3A200EB82B1 /* LanguageService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AF08D5E2B4EB3A200EB82B1 /* LanguageService.swift */; };
37+
3AF08D612B4EB3C400EB82B1 /* LanguageStorageProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AF08D602B4EB3C400EB82B1 /* LanguageStorageProtocol.swift */; };
38+
3AF53F8D2B3DCFA300B30312 /* NodeGroup+Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AF53F8C2B3DCFA300B30312 /* NodeGroup+Constants.swift */; };
3639
3C06931576393125C61FB8F6 /* Pods_Adamant.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33975C0D891698AA7E74EBCC /* Pods_Adamant.framework */; };
3740
41047B70294B5EE10039E956 /* VisibleWalletsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41047B6F294B5EE10039E956 /* VisibleWalletsViewController.swift */; };
3841
41047B72294B5F210039E956 /* VisibleWalletsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41047B71294B5F210039E956 /* VisibleWalletsTableViewCell.swift */; };
@@ -668,6 +671,12 @@
668671
3AA50DEE2AEBE65D00C58FC8 /* PartnerQRView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PartnerQRView.swift; sourceTree = "<group>"; };
669672
3AA50DF02AEBE66A00C58FC8 /* PartnerQRViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PartnerQRViewModel.swift; sourceTree = "<group>"; };
670673
3AA50DF22AEBE67C00C58FC8 /* PartnerQRFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PartnerQRFactory.swift; sourceTree = "<group>"; };
674+
3AF08D5B2B4E7FFC00EB82B1 /* zh */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh; path = zh.lproj/InfoPlist.strings; sourceTree = "<group>"; };
675+
3AF08D5C2B4E7FFC00EB82B1 /* zh */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = zh; path = zh.lproj/Localizable.stringsdict; sourceTree = "<group>"; };
676+
3AF08D5D2B4E7FFC00EB82B1 /* zh */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh; path = zh.lproj/Localizable.strings; sourceTree = "<group>"; };
677+
3AF08D5E2B4EB3A200EB82B1 /* LanguageService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LanguageService.swift; sourceTree = "<group>"; };
678+
3AF08D602B4EB3C400EB82B1 /* LanguageStorageProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LanguageStorageProtocol.swift; sourceTree = "<group>"; };
679+
3AF53F8C2B3DCFA300B30312 /* NodeGroup+Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NodeGroup+Constants.swift"; sourceTree = "<group>"; };
671680
41047B6F294B5EE10039E956 /* VisibleWalletsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VisibleWalletsViewController.swift; sourceTree = "<group>"; };
672681
41047B71294B5F210039E956 /* VisibleWalletsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VisibleWalletsTableViewCell.swift; sourceTree = "<group>"; };
673682
41047B73294C61D10039E956 /* VisibleWalletsService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VisibleWalletsService.swift; sourceTree = "<group>"; };
@@ -1924,6 +1933,7 @@
19241933
93ADC17C2B083C3B00F2DF77 /* NodesAdditionalParamsStorageProtocol.swift */,
19251934
3A2F55FB2AC6F885000A3F26 /* CoinStorage.swift */,
19261935
3A96E37B2AED27F8001F5A52 /* PartnerQRService.swift */,
1936+
3AF08D602B4EB3C400EB82B1 /* LanguageStorageProtocol.swift */,
19271937
);
19281938
path = ServiceProtocols;
19291939
sourceTree = "<group>";
@@ -1960,6 +1970,7 @@
19601970
93ADC17E2B083D7A00F2DF77 /* NodesAdditionalParamsStorage.swift */,
19611971
3A2F55FD2AC6F90E000A3F26 /* AdamantCoinStorageService.swift */,
19621972
3A96E3792AED27D7001F5A52 /* AdamantPartnerQRService.swift */,
1973+
3AF08D5E2B4EB3A200EB82B1 /* LanguageService.swift */,
19631974
);
19641975
path = Services;
19651976
sourceTree = "<group>";
@@ -2035,6 +2046,7 @@
20352046
93CCAE7F2B06E2D100EA5B94 /* ApiServiceError+Extension.swift */,
20362047
939FA3412B0D6F0000710EC6 /* SelfRemovableHostingController.swift */,
20372048
936658942B0AC15300BDB2D3 /* Node+UI.swift */,
2049+
3AF53F8C2B3DCFA300B30312 /* NodeGroup+Constants.swift */,
20382050
);
20392051
path = Helpers;
20402052
sourceTree = "<group>";
@@ -2702,6 +2714,7 @@
27022714
ru,
27032715
de,
27042716
Base,
2717+
zh,
27052718
);
27062719
mainGroup = E913C8E51FFFA51D001A83F7;
27072720
packageReferences = (
@@ -3139,6 +3152,7 @@
31393152
E9E7CDB32002B9FB00DFC4DB /* LoginFactory.swift in Sources */,
31403153
E941CCDE20E7B70200C96220 /* WalletCollectionViewCell.swift in Sources */,
31413154
4186B33A294200F4006594A3 /* DashWalletService+DynamicConstants.swift in Sources */,
3155+
3AF08D5F2B4EB3A200EB82B1 /* LanguageService.swift in Sources */,
31423156
E9AA8BFA212C166600F9249F /* EthWalletService+Send.swift in Sources */,
31433157
411743042A39B257008CD98A /* ContributeViewModel.swift in Sources */,
31443158
93E5D4DB293000BE00439298 /* UnregisteredTransaction.swift in Sources */,
@@ -3303,6 +3317,7 @@
33033317
E9B4E1A8210F079E007E77FC /* DoubleDetailsTableViewCell.swift in Sources */,
33043318
E9502740202E257E002C1098 /* RepeaterService.swift in Sources */,
33053319
E93D7AC02052CF63005D19DC /* AdamantNotificationService.swift in Sources */,
3320+
3AF53F8D2B3DCFA300B30312 /* NodeGroup+Constants.swift in Sources */,
33063321
411743002A39B1D2008CD98A /* ContributeFactory.swift in Sources */,
33073322
A5E04224282A830B0076CD13 /* BtcTransactionsViewController.swift in Sources */,
33083323
645938942378395E00A2BE7C /* EulaViewController.swift in Sources */,
@@ -3360,6 +3375,7 @@
33603375
93ADC17B2B08283500F2DF77 /* ForceQueryItemsEncoding.swift in Sources */,
33613376
41BCB310295C6082004B12AB /* VisibleWalletsResetTableViewCell.swift in Sources */,
33623377
93CCAE7B2B06D9B500EA5B94 /* DogeBlocksDTO.swift in Sources */,
3378+
3AF08D612B4EB3C400EB82B1 /* LanguageStorageProtocol.swift in Sources */,
33633379
E9E7CDB12002B97B00DFC4DB /* AccountFactory.swift in Sources */,
33643380
E9AA8BF82129F13000F9249F /* ComplexTransferViewController.swift in Sources */,
33653381
E9A174B52057EDCE003667CD /* AdamantTransfersProvider+backgroundFetch.swift in Sources */,
@@ -3454,6 +3470,7 @@
34543470
93E123302A6DF8EF004DF33B /* en */,
34553471
93E123322A6DF8F1004DF33B /* de */,
34563472
93E123332A6DF8F2004DF33B /* ru */,
3473+
3AF08D5B2B4E7FFC00EB82B1 /* zh */,
34573474
);
34583475
name = InfoPlist.strings;
34593476
sourceTree = "<group>";
@@ -3464,6 +3481,7 @@
34643481
93E123392A6DFD15004DF33B /* de */,
34653482
93E1233B2A6DFD18004DF33B /* ru */,
34663483
93E1233C2A6DFD19004DF33B /* en */,
3484+
3AF08D5D2B4E7FFC00EB82B1 /* zh */,
34673485
);
34683486
name = Localizable.strings;
34693487
sourceTree = "<group>";
@@ -3474,6 +3492,7 @@
34743492
93E123402A6DFE24004DF33B /* en */,
34753493
93E123422A6DFE27004DF33B /* de */,
34763494
93E123432A6DFE2E004DF33B /* ru */,
3495+
3AF08D5C2B4E7FFC00EB82B1 /* zh */,
34773496
);
34783497
name = Localizable.stringsdict;
34793498
sourceTree = "<group>";
@@ -3695,7 +3714,7 @@
36953714
"$(inherited)",
36963715
"@executable_path/Frameworks",
36973716
);
3698-
MARKETING_VERSION = 3.3.1;
3717+
MARKETING_VERSION = 3.4.0;
36993718
PRODUCT_BUNDLE_IDENTIFIER = "im.adamant.adamant-messenger-dev";
37003719
PRODUCT_NAME = "$(TARGET_NAME)";
37013720
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -3726,7 +3745,7 @@
37263745
"$(inherited)",
37273746
"@executable_path/Frameworks",
37283747
);
3729-
MARKETING_VERSION = 3.3.1;
3748+
MARKETING_VERSION = 3.4.0;
37303749
PRODUCT_BUNDLE_IDENTIFIER = "im.adamant.adamant-messenger";
37313750
PRODUCT_NAME = "$(TARGET_NAME)";
37323751
PROVISIONING_PROFILE_SPECIFIER = "";

Adamant/App/AppDelegate.swift

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,18 @@ import CommonKit
1414

1515
// MARK: - Constants
1616
extension String.adamant {
17-
struct tabItems {
18-
static let account = String.localized("Tabs.Account", comment: "Main tab bar: Account page")
19-
static let chats = String.localized("Tabs.Chats", comment: "Main tab bar: Chats page")
20-
static let settings = String.localized("Tabs.Settings", comment: "Main tab bar: Settings page")
17+
enum tabItems {
18+
static var account: String {
19+
String.localized("Tabs.Account", comment: "Main tab bar: Account page")
20+
}
21+
22+
static var chats: String {
23+
String.localized("Tabs.Chats", comment: "Main tab bar: Chats page")
24+
}
25+
26+
static var settings: String {
27+
String.localized("Tabs.Settings", comment: "Main tab bar: Settings page")
28+
}
2129
}
2230

2331
struct application {
@@ -564,6 +572,7 @@ extension AppDelegate {
564572
)
565573
}
566574

575+
// TODO: Figireout why we cant use AdamantContacts.adamantWelcomeWallet.address for senderId (chat is not shown)
567576
if let welcome = AdamantContacts.adamantWelcomeWallet.welcomeMessage {
568577
_ = try? await chatProvider.fakeReceived(
569578
message: welcome.message,

Adamant/App/DI/AppAssembly.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,11 @@ struct AppAssembly: Assembly {
231231
service.accountService = r.resolve(AccountService.self)
232232
}
233233

234+
// MARK: LanguageStorageProtocol
235+
container.register(LanguageStorageProtocol.self) { r in
236+
LanguageStorageService()
237+
}.inObjectScope(.container)
238+
234239
// MARK: - Data Providers
235240
// MARK: CoreData Stack
236241
container.register(CoreDataStack.self) { _ in

Adamant/Helpers/MyLittlePinpad+adamant.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ import Foundation
1010
import MyLittlePinpad
1111

1212
extension String.adamant {
13-
struct pinpad {
14-
static let createPin = String.localized("Pinpad.EnterNewPin", comment: "Pinpad: Ask user to create new pin")
15-
static let reenterPin = String.localized("Pinpad.ReenterPin", comment: "Pinpad: Ask user to repeat new pin")
13+
enum pinpad {
14+
static var createPin: String {
15+
String.localized("Pinpad.EnterNewPin", comment: "Pinpad: Ask user to create new pin")
16+
}
17+
static var reenterPin: String {
18+
String.localized("Pinpad.ReenterPin", comment: "Pinpad: Ask user to repeat new pin")
19+
}
1620
}
1721
}
1822

Adamant/Helpers/Node+UI.swift

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -71,35 +71,47 @@ extension Node {
7171

7272
private extension Node {
7373
enum Strings {
74-
static let ping = String.localized(
75-
"NodesList.NodeCell.Ping",
76-
comment: "NodesList.NodeCell: Node ping"
77-
)
74+
static var ping: String {
75+
String.localized(
76+
"NodesList.NodeCell.Ping",
77+
comment: "NodesList.NodeCell: Node ping"
78+
)
79+
}
7880

79-
static let milliseconds = String.localized(
80-
"NodesList.NodeCell.Milliseconds",
81-
comment: "NodesList.NodeCell: Milliseconds"
82-
)
81+
static var milliseconds: String {
82+
String.localized(
83+
"NodesList.NodeCell.Milliseconds",
84+
comment: "NodesList.NodeCell: Milliseconds"
85+
)
86+
}
8387

84-
static let synchronizing = String.localized(
85-
"NodesList.NodeCell.Synchronizing",
86-
comment: "NodesList.NodeCell: Node is synchronizing"
87-
)
88+
static var synchronizing: String {
89+
String.localized(
90+
"NodesList.NodeCell.Synchronizing",
91+
comment: "NodesList.NodeCell: Node is synchronizing"
92+
)
93+
}
8894

89-
static let offline = String.localized(
90-
"NodesList.NodeCell.Offline",
91-
comment: "NodesList.NodeCell: Node is offline"
92-
)
95+
static var offline: String {
96+
String.localized(
97+
"NodesList.NodeCell.Offline",
98+
comment: "NodesList.NodeCell: Node is offline"
99+
)
100+
}
93101

94-
static let version = String.localized(
95-
"NodesList.NodeCell.Version",
96-
comment: "NodesList.NodeCell: Node version"
97-
)
102+
static var version: String {
103+
String.localized(
104+
"NodesList.NodeCell.Version",
105+
comment: "NodesList.NodeCell: Node version"
106+
)
107+
}
98108

99-
static let disabled = String.localized(
100-
"NodesList.NodeCell.Disabled",
101-
comment: "NodesList.NodeCell: Node is disabled"
102-
)
109+
static var disabled: String {
110+
String.localized(
111+
"NodesList.NodeCell.Disabled",
112+
comment: "NodesList.NodeCell: Node is disabled"
113+
)
114+
}
103115
}
104116

105117
var versionString: String? {
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
//
2+
// NodeGroup+Constants.swift
3+
// Adamant
4+
//
5+
// Created by Stanislav Jelezoglo on 27.12.2023.
6+
// Copyright © 2023 Adamant. All rights reserved.
7+
//
8+
import Foundation
9+
import CommonKit
10+
11+
public extension NodeGroup {
12+
var onScreenUpdateInterval: TimeInterval {
13+
switch self {
14+
case .adm:
15+
return AdmWalletService.healthCheckParameters.onScreenUpdateInterval
16+
case .btc:
17+
return BtcWalletService.healthCheckParameters.onScreenUpdateInterval
18+
case .eth:
19+
return EthWalletService.healthCheckParameters.onScreenUpdateInterval
20+
case .lskNode:
21+
return LskWalletService.healthCheckParameters.onScreenUpdateInterval
22+
case .lskService:
23+
return LskWalletService.healthCheckParameters.onScreenServiceUpdateInterval
24+
case .doge:
25+
return DogeWalletService.healthCheckParameters.onScreenUpdateInterval
26+
case .dash:
27+
return DashWalletService.healthCheckParameters.onScreenUpdateInterval
28+
}
29+
}
30+
31+
var crucialUpdateInterval: TimeInterval {
32+
switch self {
33+
case .adm:
34+
return AdmWalletService.healthCheckParameters.crucialUpdateInterval
35+
case .btc:
36+
return BtcWalletService.healthCheckParameters.crucialUpdateInterval
37+
case .eth:
38+
return EthWalletService.healthCheckParameters.crucialUpdateInterval
39+
case .lskNode:
40+
return LskWalletService.healthCheckParameters.crucialUpdateInterval
41+
case .lskService:
42+
return LskWalletService.healthCheckParameters.crucialServiceUpdateInterval
43+
case .doge:
44+
return DogeWalletService.healthCheckParameters.crucialUpdateInterval
45+
case .dash:
46+
return DashWalletService.healthCheckParameters.crucialUpdateInterval
47+
}
48+
}
49+
50+
var nodeHeightEpsilon: Int {
51+
switch self {
52+
case .adm:
53+
return AdmWalletService.healthCheckParameters.threshold
54+
case .btc:
55+
return BtcWalletService.healthCheckParameters.threshold
56+
case .eth:
57+
return EthWalletService.healthCheckParameters.threshold
58+
case .lskNode:
59+
return LskWalletService.healthCheckParameters.threshold
60+
case .lskService:
61+
return LskWalletService.healthCheckParameters.threshold
62+
case .doge:
63+
return DogeWalletService.healthCheckParameters.threshold
64+
case .dash:
65+
return DashWalletService.healthCheckParameters.threshold
66+
}
67+
}
68+
69+
var normalUpdateInterval: TimeInterval {
70+
switch self {
71+
case .adm:
72+
return AdmWalletService.healthCheckParameters.normalUpdateInterval
73+
case .btc:
74+
return BtcWalletService.healthCheckParameters.normalUpdateInterval
75+
case .eth:
76+
return EthWalletService.healthCheckParameters.normalUpdateInterval
77+
case .lskNode:
78+
return LskWalletService.healthCheckParameters.normalUpdateInterval
79+
case .lskService:
80+
return LskWalletService.healthCheckParameters.normalServiceUpdateInterval
81+
case .doge:
82+
return DogeWalletService.healthCheckParameters.normalUpdateInterval
83+
case .dash:
84+
return DashWalletService.healthCheckParameters.normalUpdateInterval
85+
}
86+
}
87+
}

0 commit comments

Comments
 (0)