Skip to content

Commit 95bdeae

Browse files
committed
Fix signature and bugs
1 parent c7de788 commit 95bdeae

File tree

54 files changed

+556
-182
lines changed

Some content is hidden

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

54 files changed

+556
-182
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,7 @@ xcuserdata/
104104

105105
### Here we store Release password. It's super-secret, not for git. ###
106106
AdamantSecret.swift
107+
runkit ex.rtf
108+
to do.rtf
109+
tz.rtf
110+
profiles

Adamant.xcodeproj/project.pbxproj

Lines changed: 55 additions & 51 deletions
Large diffs are not rendered by default.

Adamant.xcodeproj/xcshareddata/xcschemes/Adamant.Dev.xcscheme

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
2929
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<MacroExpansion>
31+
<BuildableReference
32+
BuildableIdentifier = "primary"
33+
BlueprintIdentifier = "E913C8ED1FFFA51D001A83F7"
34+
BuildableName = "Adamant.app"
35+
BlueprintName = "Adamant"
36+
ReferencedContainer = "container:Adamant.xcodeproj">
37+
</BuildableReference>
38+
</MacroExpansion>
3039
<Testables>
3140
<TestableReference
3241
skipped = "NO">
@@ -39,17 +48,6 @@
3948
</BuildableReference>
4049
</TestableReference>
4150
</Testables>
42-
<MacroExpansion>
43-
<BuildableReference
44-
BuildableIdentifier = "primary"
45-
BlueprintIdentifier = "E913C8ED1FFFA51D001A83F7"
46-
BuildableName = "Adamant.app"
47-
BlueprintName = "Adamant"
48-
ReferencedContainer = "container:Adamant.xcodeproj">
49-
</BuildableReference>
50-
</MacroExpansion>
51-
<AdditionalOptions>
52-
</AdditionalOptions>
5351
</TestAction>
5452
<LaunchAction
5553
buildConfiguration = "Debug"
@@ -72,8 +70,6 @@
7270
ReferencedContainer = "container:Adamant.xcodeproj">
7371
</BuildableReference>
7472
</BuildableProductRunnable>
75-
<AdditionalOptions>
76-
</AdditionalOptions>
7773
</LaunchAction>
7874
<ProfileAction
7975
buildConfiguration = "Release"

Adamant.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Adamant/AppDelegate.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
115115
accounts.viewControllers = [account]
116116
}
117117

118+
if #available(iOS 13.0, *) {
119+
let tabBarAppearance: UITabBarAppearance = UITabBarAppearance()
120+
tabBarAppearance.configureWithDefaultBackground()
121+
UITabBar.appearance().standardAppearance = tabBarAppearance
122+
123+
if #available(iOS 15.0, *) {
124+
UITabBar.appearance().scrollEdgeAppearance = tabBarAppearance
125+
}
126+
}
127+
118128
tabbar.setViewControllers([chats, accounts], animated: false)
119129
}
120130

Adamant/Assets/l18n/de.lproj/Localizable.strings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,9 @@
733733
/* Transaction details: date row. */
734734
"TransactionDetailsScene.Row.Date" = "Datum";
735735

736+
/* Transaction send: recipient minimum remaining balance requirement */
737+
"TransactionSend.Minimum.Balance" = "Der Empfänger muss mindestens 0,05 LSK haben – Senden Sie mehr Token";
738+
736739
/* Transaction details: 'Open transaction in explorer' row. */
737740
"TransactionDetailsScene.Row.Explorer" = "Im Explorer öffnen";
738741

Adamant/Assets/l18n/en.lproj/Localizable.strings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,9 @@
751751
/* TransactionList: 'Transactions not found' localize error message from API. */
752752
"No transactions found" = "Transactions not found";
753753

754+
/* Transaction send: recipient minimum remaining balance requirement */
755+
"TransactionSend.Minimum.Balance" = "Recipient must have at least 0.05 LSK—Send more tokens";
756+
754757
/* Transaction status: updating in progress */
755758
"TransactionStatus.Updating" = "Updating…";
756759

Adamant/Assets/l18n/ru.lproj/Localizable.strings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,9 @@
784784
/* Transaction details: 'Open transaction in explorer' row. */
785785
"TransactionDetailsScene.Row.Explorer" = "Открыть в Explorer";
786786

787+
/* Transaction send: recipient minimum remaining balance requirement */
788+
"TransactionSend.Minimum.Balance" = "На кошельке получателя должно быть больше 0.05 LSK — Отправьте больше токенов";
789+
787790
/* Transaction details: fee row. */
788791
"TransactionDetailsScene.Row.Fee" = "Комиссия";
789792

Adamant/CoreData/BaseTransaction+TransactionDetails.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,8 @@ extension BaseTransaction: TransactionDetails {
3535
return 0
3636
}
3737
}
38+
39+
var blockHeight: UInt64? {
40+
return nil
41+
}
3842
}

Adamant/Helpers/String+adamant.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import UIKit
1212
struct AdamantAddress {
1313
let address: String
1414
let name: String?
15+
let amount: String?
1516
}
1617

1718
extension String {
@@ -26,8 +27,9 @@ extension String {
2627
}
2728

2829
let name = queryItems.filter({$0.name == "label"}).first?.value
29-
30-
return AdamantAddress(address: address, name: name)
30+
let amount = queryItems.filter({$0.name == "amount"}).first?.value
31+
32+
return AdamantAddress(address: address, name: name, amount: amount)
3133
}
3234

3335
func getLegacyAdamantAddress() -> AdamantAddress? {
@@ -65,7 +67,7 @@ extension String {
6567
}
6668

6769
if let address = address {
68-
return AdamantAddress(address: address, name: name)
70+
return AdamantAddress(address: address, name: name, amount: "")
6971
} else {
7072
return nil
7173
}

Adamant/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
<string>$(MARKETING_VERSION)</string>
2121
<key>CFBundleVersion</key>
2222
<string>$(CURRENT_PROJECT_VERSION)</string>
23+
<key>ITSAppUsesNonExemptEncryption</key>
24+
<false/>
2325
<key>LSRequiresIPhoneOS</key>
2426
<true/>
2527
<key>NSAppTransportSecurity</key>

Adamant/Models/BaseBtcTransaction.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class BaseBtcTransaction: TransactionDetails {
2525
let isOutgoing: Bool
2626
let transactionStatus: TransactionStatus?
2727

28+
var blockHeight: UInt64?
29+
2830
required init(txId: String, dateValue: Date?, blockValue: String?, senderAddress: String, recipientAddress: String, amountValue: Decimal, feeValue: Decimal?, confirmationsValue: String?, isOutgoing: Bool, transactionStatus: TransactionStatus?) {
2931
self.txId = txId
3032
self.dateValue = dateValue
@@ -36,5 +38,6 @@ class BaseBtcTransaction: TransactionDetails {
3638
self.confirmationsValue = confirmationsValue
3739
self.isOutgoing = isOutgoing
3840
self.transactionStatus = transactionStatus
41+
self.blockHeight = nil
3942
}
4043
}

Adamant/Models/EthTransaction.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ extension EthTransaction: TransactionDetails {
155155
var transactionStatus: TransactionStatus? {
156156
return receiptStatus.asTransactionStatus()
157157
}
158+
159+
var blockHeight: UInt64? {
160+
return nil
161+
}
158162
}
159163

160164
// MARK: - From EthereumTransaction

Adamant/Models/SimpleTransactionDetails.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,8 @@ struct SimpleTransactionDetails: TransactionDetails {
3030
var isOutgoing: Bool
3131

3232
var transactionStatus: TransactionStatus?
33+
34+
var blockHeight: UInt64? {
35+
return nil
36+
}
3337
}

Adamant/Services/AdamantAccountService.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,11 @@ class AdamantAccountService: AccountService {
115115
let erc20WalletServices = ERC20Token.supportedTokens.map { ERC20WalletService(token: $0) }
116116
wallets.append(contentsOf: erc20WalletServices)
117117

118+
119+
//LskWalletService(mainnet: false)
118120
// Testnet
119-
// wallets.append(contentsOf: LskWalletService(mainnet: false))
121+
// wallets.append(contentsOf: LskWalletService(mainnet: false))
122+
120123
return wallets
121124
}()
122125

Adamant/Services/AdamantDialogService.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class AdamantDialogService: DialogService {
2222
// Configure notifications
2323
init() {
2424
FTIndicator.setIndicatorStyle(.extraLight)
25+
2526
FTNotificationIndicator.setDefaultDismissTime(4)
2627
}
2728
}

Adamant/Wallets/Adamant/AdmTransferViewController.swift

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,11 @@ class AdmTransferViewController: TransferViewControllerBase {
215215
}
216216

217217
self?.validateForm()
218+
}.onCellSelection { [weak self] (cell, row) in
219+
if let recipient = self?.recipientAddress {
220+
let text = recipient
221+
self?.shareValue(text, from: cell)
222+
}
218223
}
219224

220225
return row
@@ -247,10 +252,29 @@ class AdmTransferViewController: TransferViewControllerBase {
247252
row.updateCell()
248253
}
249254

255+
if let row: TextRow = form.rowBy(tag: BaseRows.amount.tag) {
256+
row.value = admAddress.amount
257+
row.updateCell()
258+
}
259+
250260
return true
251261
}
252262

253263
override func defaultSceneTitle() -> String? {
254264
return String.adamantLocalized.wallets.sendAdm
255265
}
266+
267+
// MARK: - Tools
268+
269+
func shareValue(_ value: String, from: UIView) {
270+
dialogService.presentShareAlertFor(string: value, types: [.copyToPasteboard, .share], excludedActivityTypes: nil, animated: true, from: from) { [weak self] in
271+
guard let tableView = self?.tableView else {
272+
return
273+
}
274+
275+
if let indexPath = tableView.indexPathForSelectedRow {
276+
tableView.deselectRow(at: indexPath, animated: true)
277+
}
278+
}
279+
}
256280
}

Adamant/Wallets/Adamant/AdmWallet.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class AdmWallet: WalletAccount {
1212
let address: String
1313
var balance: Decimal = 0
1414
var notifications: Int = 0
15+
var minBalance: Decimal = 0
1516

1617
init(address: String) {
1718
self.address = address

Adamant/Wallets/Dash/DashTransferViewController.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,11 @@ class DashTransferViewController: TransferViewControllerBase {
201201
}
202202

203203
self?.validateForm()
204+
}.onCellSelection { [weak self] (cell, row) in
205+
if let recipient = self?.recipientAddress {
206+
let text = recipient
207+
self?.shareValue(text, from: cell)
208+
}
204209
}
205210

206211
return row
@@ -248,4 +253,18 @@ class DashTransferViewController: TransferViewControllerBase {
248253
override func defaultSceneTitle() -> String? {
249254
return String.adamantLocalized.sendDash
250255
}
256+
257+
// MARK: - Tools
258+
259+
func shareValue(_ value: String, from: UIView) {
260+
dialogService.presentShareAlertFor(string: value, types: [.copyToPasteboard, .share], excludedActivityTypes: nil, animated: true, from: from) { [weak self] in
261+
guard let tableView = self?.tableView else {
262+
return
263+
}
264+
265+
if let indexPath = tableView.indexPathForSelectedRow {
266+
tableView.deselectRow(at: indexPath, animated: true)
267+
}
268+
}
269+
}
251270
}

Adamant/Wallets/Dash/DashWallet.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class DashWallet: WalletAccount {
1919
}()
2020
var balance: Decimal = 0.0
2121
var notifications: Int = 0
22+
var minBalance: Decimal = 0
2223

2324
init(privateKey: PrivateKey) {
2425
self.privateKey = privateKey

Adamant/Wallets/Dash/DashWalletService.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ extension DashWalletService: InitiatedWithPassphraseService {
258258
service.initialBalanceCheck = true
259259
service.setState(.upToDate, silent: true)
260260
service.update()
261-
262261
completion(.success(result: eWallet))
263262

264263
case .failure(let error):

Adamant/Wallets/Doge/DogeTransferViewController.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,11 @@ class DogeTransferViewController: TransferViewControllerBase {
187187
}
188188

189189
self?.validateForm()
190+
}.onCellSelection { [weak self] (cell, row) in
191+
if let recipient = self?.recipientAddress {
192+
let text = recipient
193+
self?.shareValue(text, from: cell)
194+
}
190195
}
191196

192197
return row
@@ -234,4 +239,18 @@ class DogeTransferViewController: TransferViewControllerBase {
234239
override func defaultSceneTitle() -> String? {
235240
return String.adamantLocalized.sendDoge
236241
}
242+
243+
// MARK: - Tools
244+
245+
func shareValue(_ value: String, from: UIView) {
246+
dialogService.presentShareAlertFor(string: value, types: [.copyToPasteboard, .share], excludedActivityTypes: nil, animated: true, from: from) { [weak self] in
247+
guard let tableView = self?.tableView else {
248+
return
249+
}
250+
251+
if let indexPath = tableView.indexPathForSelectedRow {
252+
tableView.deselectRow(at: indexPath, animated: true)
253+
}
254+
}
255+
}
237256
}

0 commit comments

Comments
 (0)