Skip to content

Commit 3648340

Browse files
Merge pull request #74 from Adamant-im/dev/lisk-api-done
lisk api done
2 parents cabc1d8 + e881f77 commit 3648340

File tree

106 files changed

+1479
-563
lines changed

Some content is hidden

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

106 files changed

+1479
-563
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 & 63 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
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"repositoryURL": "https://github.com/Alamofire/Alamofire.git",
77
"state": {
88
"branch": null,
9-
"revision": "4d19ad82f80cc71ff829b941ded114c56f4f604c",
10-
"version": "5.4.2"
9+
"revision": "d120af1e8638c7da36c8481fd61a66c0c08dc4fc",
10+
"version": "5.4.4"
1111
}
1212
},
1313
{
@@ -78,8 +78,8 @@
7878
"repositoryURL": "https://github.com/xmartlabs/Eureka.git",
7979
"state": {
8080
"branch": null,
81-
"revision": "523af88efc83cdaf39b415446be1ca1529f5664d",
82-
"version": "5.3.3"
81+
"revision": "975e8d5e0ea3c86aff828537b2d4abe4430d6312",
82+
"version": "5.3.4"
8383
}
8484
},
8585
{
@@ -96,26 +96,26 @@
9696
"repositoryURL": "https://github.com/bmoliveira/MarkdownKit.git",
9797
"state": {
9898
"branch": null,
99-
"revision": "828e99602285c9547ceb01a014bf2d0bd7bc545e",
100-
"version": "1.7.0"
99+
"revision": "5056f3305d3499f44d8815530d560b87082e0cf5",
100+
"version": "1.7.1"
101101
}
102102
},
103103
{
104104
"package": "OpenSSL",
105105
"repositoryURL": "https://github.com/krzyzanowskim/OpenSSL.git",
106106
"state": {
107107
"branch": null,
108-
"revision": "e88deedfc37501f03ae3a08b3b8cf497d0340197",
109-
"version": "1.1.1100"
108+
"revision": "4ae145c1446851cda62fa4b09c7b5e5c540d7b20",
109+
"version": "1.1.1300"
110110
}
111111
},
112112
{
113113
"package": "Parchment",
114-
"repositoryURL": "https://github.com/rechsteiner/Parchment.git",
114+
"repositoryURL": "https://github.com/rechsteiner/Parchment",
115115
"state": {
116-
"branch": null,
117-
"revision": "689ecaa80b7b0f712887ec87746f8598f2e12907",
118-
"version": "3.0.1"
116+
"branch": "main",
117+
"revision": "cad6924f8a292eecaedc1bdefb57006f7979b9eb",
118+
"version": null
119119
}
120120
},
121121
{
@@ -132,8 +132,8 @@
132132
"repositoryURL": "https://github.com/mxcl/PromiseKit.git",
133133
"state": {
134134
"branch": null,
135-
"revision": "aea48ea1855f5d82e2dffa6027afce3aab8f3dd7",
136-
"version": "6.13.3"
135+
"revision": "7b07b214dacecb22ca4b680531c7e981d52483f9",
136+
"version": "6.16.3"
137137
}
138138
},
139139
{

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/BigInt+Decimal.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extension BigInt {
2323

2424
extension BigUInt {
2525
func asDecimal(exponent: Int) -> Decimal {
26-
let decim = Decimal(floatLiteral: Double(self))
26+
let decim = Decimal(string: String(self)) ?? 0
2727

2828
if exponent != 0 {
2929
return Decimal(sign: .plus, exponent: exponent, significand: decim)

Adamant/Helpers/String+adamant.swift

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,27 @@ import UIKit
1212
struct AdamantAddress {
1313
let address: String
1414
let name: String?
15+
let amount: String?
1516
}
1617

1718
extension String {
1819
func getAdamantAddress() -> AdamantAddress? {
20+
guard
21+
let urlString = self.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed),
22+
let components = URLComponents(string: urlString),
23+
components.host == "msg.adamant.im",
24+
let queryItems = components.queryItems,
25+
let address = queryItems.filter({$0.name == "address"}).first?.value else {
26+
return nil
27+
}
28+
29+
let name = queryItems.filter({$0.name == "label"}).first?.value
30+
let amount = queryItems.filter({$0.name == "amount"}).first?.value
31+
32+
return AdamantAddress(address: address, name: name, amount: amount)
33+
}
34+
35+
func getLegacyAdamantAddress() -> AdamantAddress? {
1936
let address: String?
2037
var name: String? = nil
2138

@@ -27,6 +44,8 @@ extension String {
2744
if let params = params {
2845
for param in params {
2946
switch param {
47+
case .address:
48+
break
3049
case .label(let label):
3150
name = label
3251
break
@@ -48,7 +67,7 @@ extension String {
4867
}
4968

5069
if let address = address {
51-
return AdamantAddress(address: address, name: name)
70+
return AdamantAddress(address: address, name: name, amount: "")
5271
} else {
5372
return nil
5473
}

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+
<true/>
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/ServiceProtocols/AccountService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ extension AccountServiceError: RichError {
143143

144144

145145
// MARK: - Protocol
146-
protocol AccountService: class {
146+
protocol AccountService: AnyObject {
147147
// MARK: State
148148

149149
var state: AccountServiceState { get }

Adamant/ServiceProtocols/AdamantCore.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import Foundation
1010

11-
protocol AdamantCore: class {
11+
protocol AdamantCore: AnyObject {
1212
// MARK: - Keys
1313
func createHashFor(passphrase: String) -> String?
1414
func createKeypairFor(passphrase: String) -> Keypair?

Adamant/ServiceProtocols/AddressBookService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ extension AddressBookServiceError: RichError {
8383

8484

8585
// MARK: -
86-
protocol AddressBookService: class {
86+
protocol AddressBookService: AnyObject {
8787
// MARK: Work with Address book
8888
func set(name: String, for: String)
8989
var addressBook: [String:String] { get }

Adamant/ServiceProtocols/ApiService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ extension ApiServiceError: Equatable {
106106

107107

108108
// - MARK: ApiService
109-
protocol ApiService: class {
109+
protocol ApiService: AnyObject {
110110

111111
/// Default is async queue with .utilities priority.
112112
var defaultResponseDispatchQueue: DispatchQueue { get }

Adamant/ServiceProtocols/CellFactory.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct SharedCell: Equatable, Hashable {
2121
}
2222

2323

24-
protocol CellFactory: class {
24+
protocol CellFactory: AnyObject {
2525
func nib(for sharedCell: SharedCell) -> UINib?
2626
func cellInstance(for sharedCell: SharedCell) -> UITableViewCell?
2727
}

Adamant/ServiceProtocols/CurrencyInfoService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ enum Currency: String {
3838

3939

4040
// MARK: - protocol
41-
protocol CurrencyInfoService: class {
41+
protocol CurrencyInfoService: AnyObject {
4242
var currentCurrency: Currency { get set }
4343

4444
// Check rates for list of coins

Adamant/ServiceProtocols/DataProviders/DataProvider.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ enum State {
1515
case failedToUpdate(Error)
1616
}
1717

18-
protocol DataProvider: class {
18+
protocol DataProvider: AnyObject {
1919
var state: State { get }
2020
var isInitiallySynced: Bool { get }
2121

Adamant/ServiceProtocols/DialogService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ struct AdamantAlertAction {
9292
let handler: (() -> Void)?
9393
}
9494

95-
protocol DialogService: class {
95+
protocol DialogService: AnyObject {
9696

9797
func getTopmostViewController() -> UIViewController?
9898

Adamant/ServiceProtocols/LocalAuthentication.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ enum AuthenticationResult {
2727
case failed
2828
}
2929

30-
protocol LocalAuthentication: class {
30+
protocol LocalAuthentication: AnyObject {
3131
var biometryType: BiometryType { get }
3232

3333
func authorizeUser(reason: String, completion: @escaping (AuthenticationResult) -> Void)

Adamant/ServiceProtocols/LskApiService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extension Notification.Name {
2222
}
2323
}
2424

25-
protocol LskApiService: class {
25+
protocol LskApiService: AnyObject {
2626

2727
var account: LskAccount? { get }
2828

Adamant/ServiceProtocols/NotificationsService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ extension NotificationsServiceError: RichError {
142142
}
143143
}
144144

145-
protocol NotificationsService: class {
145+
protocol NotificationsService: AnyObject {
146146
var notificationsMode: NotificationsMode { get }
147147

148148
func setNotificationsMode(_ mode: NotificationsMode, completion: ((NotificationsServiceResult) -> Void)?)

Adamant/ServiceProtocols/RichMessageProvider.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ enum CellSource {
1414
case nib(nib: UINib)
1515
}
1616

17-
protocol RichMessageProvider: class {
17+
protocol RichMessageProvider: AnyObject {
1818
/// Lowercased!!
1919
static var richMessageType: String { get }
2020

Adamant/ServiceProtocols/Router.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ struct AdamantScene {
2323

2424

2525
// MARK: - Adamant Router
26-
protocol Router: class {
26+
protocol Router: AnyObject {
2727
func get(scene: AdamantScene) -> UIViewController
2828
}

0 commit comments

Comments
 (0)