Skip to content

Commit

Permalink
Merge branch 'master' into 2.2.5
Browse files Browse the repository at this point in the history
* master:
  Update dumps
  Update response for TopPlatform entity
  Add ability to fetch top full coins
  Reformat code
  Add `apiTag` for required HsProvider API endpoints
  Add TON blockchain type
  Integrate verified property to MarketTicket entity
  Update `GRDB` dependency

# Conflicts:
#	Sources/MarketKit/Classes/Models/BlockchainType.swift
#	Sources/MarketKit/Classes/Providers/HsProvider.swift
  • Loading branch information
JiangSonglun committed Mar 13, 2024
2 parents bf142ba + 148e592 commit ccd764c
Show file tree
Hide file tree
Showing 95 changed files with 910 additions and 1,120 deletions.
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.8
60 changes: 30 additions & 30 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,34 @@
import PackageDescription

let package = Package(
name: "MarketKit",
platforms: [
.iOS(.v13),
],
products: [
.library(
name: "MarketKit",
targets: ["MarketKit"]
),
],
dependencies: [
.package(url: "https://github.com/groue/GRDB.swift.git", .upToNextMajor(from: "5.0.0")),
.package(url: "https://github.com/tristanhimmelman/ObjectMapper.git", .upToNextMajor(from: "4.1.0")),
.package(url: "https://github.com/horizontalsystems/HsToolKit.Swift.git", .upToNextMajor(from: "2.0.0")),
.package(url: "https://github.com/horizontalsystems/HsExtensions.Swift.git", .upToNextMajor(from: "1.0.6")),
],
targets: [
.target(
name: "MarketKit",
dependencies: [
.product(name: "GRDB", package: "GRDB.swift"),
"ObjectMapper",
.product(name: "HsToolKit", package: "HsToolKit.Swift"),
.product(name: "HsExtensions", package: "HsExtensions.Swift"),
],
resources: [
.copy("Dumps")
]
)
]
name: "MarketKit",
platforms: [
.iOS(.v13),
],
products: [
.library(
name: "MarketKit",
targets: ["MarketKit"]
),
],
dependencies: [
.package(url: "https://github.com/groue/GRDB.swift.git", .upToNextMajor(from: "6.0.0")),
.package(url: "https://github.com/tristanhimmelman/ObjectMapper.git", .upToNextMajor(from: "4.1.0")),
.package(url: "https://github.com/horizontalsystems/HsToolKit.Swift.git", .upToNextMajor(from: "2.0.0")),
.package(url: "https://github.com/horizontalsystems/HsExtensions.Swift.git", .upToNextMajor(from: "1.0.6")),
],
targets: [
.target(
name: "MarketKit",
dependencies: [
.product(name: "GRDB", package: "GRDB.swift"),
"ObjectMapper",
.product(name: "HsToolKit", package: "HsToolKit.Swift"),
.product(name: "HsExtensions", package: "HsExtensions.Swift"),
],
resources: [
.copy("Dumps"),
]
),
]
)
8 changes: 3 additions & 5 deletions Sources/MarketKit/Classes/Chart/HsChartHelper.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import Foundation

public struct HsChartHelper {

public enum HsChartHelper {
static func pointInterval(_ interval: HsTimePeriod) -> HsPointTimePeriod {
switch interval {
case .day1: return .minute30
case .week1: return .hour4
case .week2: return .hour8
case .week1: return .hour4
case .week2: return .hour8
case .year2: return .week1
default: return .day1
}
Expand Down Expand Up @@ -67,5 +66,4 @@ public struct HsChartHelper {
}
return .week1
}

}
15 changes: 6 additions & 9 deletions Sources/MarketKit/Classes/Extensions.swift
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
import Foundation

extension Decimal {

init?(convertibleValue: Any?) {
guard let convertibleValue = convertibleValue as? CustomStringConvertible,
let value = Decimal.init(string: convertibleValue.description) else {
let value = Decimal(string: convertibleValue.description)
else {
return nil
}

self = value
}

}

extension TimeInterval {

public static func minutes(_ count: Self) -> Self {
public extension TimeInterval {
static func minutes(_ count: Self) -> Self {
count * 60
}

public static func hours(_ count: Self) -> Self {
static func hours(_ count: Self) -> Self {
count * minutes(60)
}

public static func days(_ count: Self) -> Self {
static func days(_ count: Self) -> Self {
count * hours(24)
}

}
Loading

0 comments on commit ccd764c

Please sign in to comment.