Skip to content

Commit f6d0b76

Browse files
Merge pull request #499 from Adamant-im/develop
Release 3.7.0
2 parents 3040128 + 3bfaa58 commit f6d0b76

File tree

86 files changed

+1112
-767
lines changed

Some content is hidden

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

86 files changed

+1112
-767
lines changed

Adamant.xcodeproj/project.pbxproj

Lines changed: 82 additions & 66 deletions
Large diffs are not rendered by default.

Adamant/App/DI/AppAssembly.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,22 +151,22 @@ struct AppAssembly: Assembly {
151151
}.inObjectScope(.container)
152152

153153
// MARK: LskNodeApiService
154-
container.register(LskNodeApiService.self) { r in
155-
LskNodeApiService(api: .init(
154+
container.register(KlyNodeApiService.self) { r in
155+
KlyNodeApiService(api: .init(
156156
service: .init(),
157157
nodesStorage: r.resolve(NodesStorageProtocol.self)!,
158158
nodesAdditionalParamsStorage: r.resolve(NodesAdditionalParamsStorageProtocol.self)!,
159-
nodeGroup: .lskNode
159+
nodeGroup: .klyNode
160160
))
161161
}.inObjectScope(.container)
162162

163-
// MARK: LskServiceApiService
164-
container.register(LskServiceApiService.self) { r in
165-
LskServiceApiService(api: .init(
163+
// MARK: KlyServiceApiService
164+
container.register(KlyServiceApiService.self) { r in
165+
KlyServiceApiService(api: .init(
166166
service: .init(),
167167
nodesStorage: r.resolve(NodesStorageProtocol.self)!,
168168
nodesAdditionalParamsStorage: r.resolve(NodesAdditionalParamsStorageProtocol.self)!,
169-
nodeGroup: .lskService
169+
nodeGroup: .klyService
170170
))
171171
}.inObjectScope(.container)
172172

@@ -231,7 +231,7 @@ struct AppAssembly: Assembly {
231231
}.inObjectScope(.container)
232232

233233
// MARK: LanguageStorageProtocol
234-
container.register(LanguageStorageProtocol.self) { r in
234+
container.register(LanguageStorageProtocol.self) { _ in
235235
LanguageStorageService()
236236
}.inObjectScope(.container)
237237

@@ -333,7 +333,7 @@ struct AppAssembly: Assembly {
333333
AdmWalletService(),
334334
BtcWalletService(),
335335
EthWalletService(),
336-
LskWalletService(),
336+
KlyWalletService(),
337337
DogeWalletService(),
338338
DashWalletService()
339339
]

Adamant/Helpers/NodeGroup+Constants.swift

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ public extension NodeGroup {
1717
return BtcWalletService.healthCheckParameters.onScreenUpdateInterval
1818
case .eth:
1919
return EthWalletService.healthCheckParameters.onScreenUpdateInterval
20-
case .lskNode:
21-
return LskWalletService.healthCheckParameters.onScreenUpdateInterval
22-
case .lskService:
23-
return LskWalletService.healthCheckParameters.onScreenServiceUpdateInterval
20+
case .klyNode:
21+
return KlyWalletService.healthCheckParameters.onScreenUpdateInterval
22+
case .klyService:
23+
return KlyWalletService.healthCheckParameters.onScreenServiceUpdateInterval
2424
case .doge:
2525
return DogeWalletService.healthCheckParameters.onScreenUpdateInterval
2626
case .dash:
@@ -36,10 +36,10 @@ public extension NodeGroup {
3636
return BtcWalletService.healthCheckParameters.crucialUpdateInterval
3737
case .eth:
3838
return EthWalletService.healthCheckParameters.crucialUpdateInterval
39-
case .lskNode:
40-
return LskWalletService.healthCheckParameters.crucialUpdateInterval
41-
case .lskService:
42-
return LskWalletService.healthCheckParameters.crucialServiceUpdateInterval
39+
case .klyNode:
40+
return KlyWalletService.healthCheckParameters.crucialUpdateInterval
41+
case .klyService:
42+
return KlyWalletService.healthCheckParameters.crucialServiceUpdateInterval
4343
case .doge:
4444
return DogeWalletService.healthCheckParameters.crucialUpdateInterval
4545
case .dash:
@@ -55,10 +55,10 @@ public extension NodeGroup {
5555
return BtcWalletService.healthCheckParameters.threshold
5656
case .eth:
5757
return EthWalletService.healthCheckParameters.threshold
58-
case .lskNode:
59-
return LskWalletService.healthCheckParameters.threshold
60-
case .lskService:
61-
return LskWalletService.healthCheckParameters.threshold
58+
case .klyNode:
59+
return KlyWalletService.healthCheckParameters.threshold
60+
case .klyService:
61+
return KlyWalletService.healthCheckParameters.threshold
6262
case .doge:
6363
return DogeWalletService.healthCheckParameters.threshold
6464
case .dash:
@@ -74,10 +74,10 @@ public extension NodeGroup {
7474
return BtcWalletService.healthCheckParameters.normalUpdateInterval
7575
case .eth:
7676
return EthWalletService.healthCheckParameters.normalUpdateInterval
77-
case .lskNode:
78-
return LskWalletService.healthCheckParameters.normalUpdateInterval
79-
case .lskService:
80-
return LskWalletService.healthCheckParameters.normalServiceUpdateInterval
77+
case .klyNode:
78+
return KlyWalletService.healthCheckParameters.normalUpdateInterval
79+
case .klyService:
80+
return KlyWalletService.healthCheckParameters.normalServiceUpdateInterval
8181
case .doge:
8282
return DogeWalletService.healthCheckParameters.normalUpdateInterval
8383
case .dash:
@@ -94,10 +94,10 @@ public extension NodeGroup {
9494
minNodeVersion = BtcWalletService.minNodeVersion
9595
case .eth:
9696
minNodeVersion = EthWalletService.minNodeVersion
97-
case .lskNode:
98-
minNodeVersion = LskWalletService.minNodeVersion
99-
case .lskService:
100-
minNodeVersion = LskWalletService.minNodeVersion
97+
case .klyNode:
98+
minNodeVersion = KlyWalletService.minNodeVersion
99+
case .klyService:
100+
minNodeVersion = KlyWalletService.minNodeVersion
101101
case .doge:
102102
minNodeVersion = DogeWalletService.minNodeVersion
103103
case .dash:

Adamant/Models/NodeWithGroup.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ extension NodeGroup {
2020
return BtcWalletService.tokenNetworkSymbol
2121
case .eth:
2222
return EthWalletService.tokenNetworkSymbol
23-
case .lskNode:
24-
return LskWalletService.tokenNetworkSymbol
25-
case .lskService:
26-
return LskWalletService.tokenNetworkSymbol
23+
case .klyNode:
24+
return KlyWalletService.tokenNetworkSymbol
25+
case .klyService:
26+
return KlyWalletService.tokenNetworkSymbol
2727
+ " " + .adamant.coinsNodesList.serviceNode
2828
case .doge:
2929
return DogeWalletService.tokenNetworkSymbol
@@ -36,7 +36,7 @@ extension NodeGroup {
3636

3737
var includeVersionTitle: Bool {
3838
switch self {
39-
case .btc, .lskNode, .lskService, .doge, .adm:
39+
case .btc, .klyNode, .klyService, .doge, .adm:
4040
return true
4141
case .eth, .dash:
4242
return false

Adamant/Modules/Chat/ViewModel/ChatMessageFactory.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ private extension ChatMessageFactory {
254254
: transaction.senderAddress
255255

256256
let coreService = walletServiceCompose.getWallet(by: transfer.type)?.core
257+
let defaultIcon: UIImage = .asset(named: "no-token") ?? .init()
257258

258259
return .transaction(.init(value: .init(
259260
id: id,
@@ -263,9 +264,9 @@ private extension ChatMessageFactory {
263264
title: isFromCurrentSender
264265
? .adamant.chat.transactionSent
265266
: .adamant.chat.transactionReceived,
266-
icon: coreService?.tokenLogo ?? .init(),
267+
icon: coreService?.tokenLogo ?? defaultIcon,
267268
amount: AdamantBalanceFormat.full.format(transfer.amount),
268-
currency: coreService?.tokenSymbol ?? "",
269+
currency: coreService?.tokenSymbol ?? .adamant.transfer.unknownToken,
269270
date: transaction.sentDate?.humanizedDateTime(withWeekday: false) ?? "",
270271
comment: transfer.comments,
271272
backgroundColor: backgroundColor,

Adamant/Modules/CoinsNodesList/CoinsNodesListFactory.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ private struct CoinsNodesListAssembly: Assembly {
5050
apiServices: .init(
5151
btc: $0.resolve(BtcApiService.self)!,
5252
eth: $0.resolve(EthApiService.self)!,
53-
lskNode: $0.resolve(LskNodeApiService.self)!,
54-
lskService: $0.resolve(LskServiceApiService.self)!,
53+
klyNode: $0.resolve(KlyNodeApiService.self)!,
54+
klyService: $0.resolve(KlyServiceApiService.self)!,
5555
doge: $0.resolve(DogeApiService.self)!,
5656
dash: $0.resolve(DashApiService.self)!,
5757
adm: $0.resolve(ApiService.self)!

Adamant/Modules/CoinsNodesList/ViewModel/CoinsNodesListViewModel+ApiServices.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ extension CoinsNodesListViewModel {
1212
struct ApiServices {
1313
let btc: WalletApiService
1414
let eth: WalletApiService
15-
let lskNode: WalletApiService
16-
let lskService: WalletApiService
15+
let klyNode: WalletApiService
16+
let klyService: WalletApiService
1717
let doge: WalletApiService
1818
let dash: WalletApiService
1919
let adm: WalletApiService
@@ -27,10 +27,10 @@ extension CoinsNodesListViewModel.ApiServices {
2727
return btc
2828
case .eth:
2929
return eth
30-
case .lskNode:
31-
return lskNode
32-
case .lskService:
33-
return lskService
30+
case .klyNode:
31+
return klyNode
32+
case .klyService:
33+
return klyService
3434
case .doge:
3535
return doge
3636
case .dash:

Adamant/Modules/ScreensFactory/AdamantScreensFactory.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct AdamantScreensFactory: ScreensFactory {
4646
chatSelectTextFactory = .init()
4747

4848
walletFactoryCompose = AdamantWalletFactoryCompose(
49-
lskWalletFactory: .init(assembler: assembler),
49+
klyWalletFactory: .init(assembler: assembler),
5050
dogeWalletFactory: .init(assembler: assembler),
5151
dashWalletFactory: .init(assembler: assembler),
5252
btcWalletFactory: .init(assembler: assembler),

Adamant/Modules/Wallets/Adamant/AdmWalletService+DynamicConstants.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ Node(url: URL(string: "http://184.94.215.92:45555")!),
7979
Node(url: URL(string: "https://node1.adamant.business")!, altUrl: URL(string: "http://194.233.75.29:45555")),
8080
Node(url: URL(string: "https://node2.blockchain2fa.io")!),
8181
Node(url: URL(string: "https://phecda.adm.im")!, altUrl: URL(string: "http://46.250.234.248:36666")),
82-
Node(url: URL(string: "https://tegmine.adm.im")!, altUrl: URL(string: "http://5.104.87.219:36666")),
82+
Node(url: URL(string: "https://tegmine.adm.im")!),
8383
Node(url: URL(string: "https://tauri.adm.im")!, altUrl: URL(string: "http://154.26.159.245:36666")),
84-
Node(url: URL(string: "https://dschubba.adm.im")!, altUrl: URL(string: "http://85.239.234.17:36666")),
84+
Node(url: URL(string: "https://dschubba.adm.im")!),
8585
]
8686
}
8787

Adamant/Modules/Wallets/Bitcoin/BtcTransferViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ final class BtcTransferViewController: TransferViewControllerBase {
4242
let transaction = try await service.createTransaction(
4343
recipient: recipient,
4444
amount: amount,
45-
fee: transactionFee
45+
fee: transactionFee,
46+
comment: nil
4647
)
4748

4849
if await !doesNotContainSendingTx() {

Adamant/Modules/Wallets/Bitcoin/BtcWalletService+DynamicConstants.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ extension BtcWalletService {
7676
static var nodes: [Node] {
7777
[
7878
Node(url: URL(string: "https://btcnode1.adamant.im")!, altUrl: URL(string: "http://176.9.38.204:44099")),
79-
Node(url: URL(string: "https://btcnode2.adamant.im")!, altUrl: URL(string: "http://176.9.32.126:44099")),
79+
Node(url: URL(string: "https://btcnode3.adamant.im")!, altUrl: URL(string: "http://195.201.242.108:44099")),
8080
]
8181
}
8282

Adamant/Modules/Wallets/Bitcoin/BtcWalletService+Send.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ extension BtcWalletService: WalletServiceTwoStepSend {
1414
typealias T = BitcoinKit.Transaction
1515

1616
// MARK: Create & Send
17-
func createTransaction(recipient: String, amount: Decimal, fee: Decimal) async throws -> BitcoinKit.Transaction {
17+
func createTransaction(
18+
recipient: String,
19+
amount: Decimal,
20+
fee: Decimal,
21+
comment: String?
22+
) async throws -> BitcoinKit.Transaction {
1823
// MARK: 1. Prepare
1924
guard let wallet = self.btcWallet else {
2025
throw WalletServiceError.notLogged

Adamant/Modules/Wallets/DI/AdamantWalletFactoryCompose.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ struct AdamantWalletFactoryCompose: WalletFactoryCompose {
1212
private let factories: [any WalletFactory]
1313

1414
init(
15-
lskWalletFactory: LskWalletFactory,
15+
klyWalletFactory: KlyWalletFactory,
1616
dogeWalletFactory: DogeWalletFactory,
1717
dashWalletFactory: DashWalletFactory,
1818
btcWalletFactory: BtcWalletFactory,
@@ -21,7 +21,7 @@ struct AdamantWalletFactoryCompose: WalletFactoryCompose {
2121
admWalletFactory: AdmWalletFactory
2222
) {
2323
factories = [
24-
lskWalletFactory,
24+
klyWalletFactory,
2525
dogeWalletFactory,
2626
dashWalletFactory,
2727
btcWalletFactory,

Adamant/Modules/Wallets/Dash/DashTransferViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ final class DashTransferViewController: TransferViewControllerBase {
6666
let transaction = try await service.createTransaction(
6767
recipient: recipient,
6868
amount: amount,
69-
fee: transactionFee
69+
fee: transactionFee,
70+
comment: nil
7071
)
7172

7273
if await !doesNotContainSendingTx() {

Adamant/Modules/Wallets/Dash/DashWalletService+DynamicConstants.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ extension DashWalletService {
6060
}
6161

6262
var defaultOrdinalLevel: Int? {
63-
80
63+
70
6464
}
6565

6666
static var minNodeVersion: String? {

Adamant/Modules/Wallets/Dash/DashWalletService+Send.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ extension DashWalletService: WalletServiceTwoStepSend {
1919
return try await createTransaction(
2020
recipient: recipient,
2121
amount: amount,
22-
fee: transactionFee
22+
fee: transactionFee,
23+
comment: nil
2324
)
2425
}
2526

@@ -34,14 +35,16 @@ extension DashWalletService: WalletServiceTwoStepSend {
3435
return try await createTransaction(
3536
recipient: recipient,
3637
amount: amount,
37-
fee: transactionFee
38+
fee: transactionFee,
39+
comment: nil
3840
)
3941
}
4042

4143
func createTransaction(
4244
recipient: String,
4345
amount: Decimal,
44-
fee: Decimal
46+
fee: Decimal,
47+
comment: String?
4548
) async throws -> BitcoinKit.Transaction {
4649
// MARK: 1. Prepare
4750
guard let wallet = self.dashWallet else {

Adamant/Modules/Wallets/Doge/DogeTransferViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ final class DogeTransferViewController: TransferViewControllerBase {
4343
let transaction = try await service.createTransaction(
4444
recipient: recipient,
4545
amount: amount,
46-
fee: transactionFee
46+
fee: transactionFee,
47+
comment: nil
4748
)
4849

4950
if await !doesNotContainSendingTx() {

Adamant/Modules/Wallets/Doge/DogeWalletService+Send.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ extension DogeWalletService: WalletServiceTwoStepSend {
2424
func createTransaction(
2525
recipient: String,
2626
amount: Decimal,
27-
fee: Decimal
27+
fee: Decimal,
28+
comment: String?
2829
) async throws -> BitcoinKit.Transaction {
2930
// Prepare
3031
guard let wallet = self.dogeWallet else {

Adamant/Modules/Wallets/ERC20/ERC20TransferViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ final class ERC20TransferViewController: TransferViewControllerBase {
5050
let transaction = try await service.createTransaction(
5151
recipient: recipient,
5252
amount: amount,
53-
fee: transactionFee
53+
fee: transactionFee,
54+
comment: nil
5455
)
5556

5657
if await !doesNotContainSendingTx(

Adamant/Modules/Wallets/ERC20/ERC20WalletService+Send.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ extension ERC20WalletService: WalletServiceTwoStepSend {
1919
func createTransaction(
2020
recipient: String,
2121
amount: Decimal,
22-
fee: Decimal
22+
fee: Decimal,
23+
comment: String?
2324
) async throws -> CodableTransaction {
2425
guard let ethWallet = ethWallet else {
2526
throw WalletServiceError.notLogged

Adamant/Modules/Wallets/Ethereum/EthTransferViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ final class EthTransferViewController: TransferViewControllerBase {
4444
let transaction = try await service.createTransaction(
4545
recipient: recipient,
4646
amount: amount,
47-
fee: transactionFee
47+
fee: transactionFee,
48+
comment: nil
4849
)
4950

5051
if await !doesNotContainSendingTx(

Adamant/Modules/Wallets/Ethereum/EthWalletService+Send.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ extension EthWalletService: WalletServiceTwoStepSend {
2525
func createTransaction(
2626
recipient: String,
2727
amount: Decimal,
28-
fee: Decimal
28+
fee: Decimal,
29+
comment: String?
2930
) async throws -> CodableTransaction {
3031
try await ethApiService.requestWeb3 { [weak self] web3 in
3132
guard let self = self else { throw WalletServiceError.internalError(.unknownError) }

0 commit comments

Comments
 (0)