generated from nimblehq/git-template
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from nimblehq/release/0.7.0
Release - 0.7.0
- Loading branch information
Showing
35 changed files
with
600 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 0 additions & 24 deletions
24
CryptoPrices/Sources/Domain/Sources/DomainTestHelpers/MockCoinDetail/MockMarketData.swift
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
62 changes: 62 additions & 0 deletions
62
...Prices/Sources/Domain/Sources/DomainTestHelpers/Mocks/MockCoinDetail/MockMarketData.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// | ||
// MockMarketData.swift | ||
// Domain | ||
// | ||
// Created by Khanh on 28/12/2022. | ||
// | ||
|
||
import Entities | ||
|
||
public struct MockMarketData: MarketData, Equatable { | ||
|
||
public let currentPrice: USDDecimalable | ||
public let priceChangePercentage24H: Double | ||
public let marketCap: USDDecimalable | ||
public let marketCapChangePercentage24H: Double | ||
public let ath: USDDecimalable | ||
public let athChangePercentage: USDDoublable | ||
public let atl: USDDecimalable | ||
public let atlChangePercentage: USDDoublable | ||
|
||
public init(marketData: MarketData) { | ||
self.currentPrice = marketData.currentPrice | ||
self.priceChangePercentage24H = marketData.priceChangePercentage24H | ||
self.marketCap = marketData.marketCap | ||
self.marketCapChangePercentage24H = marketData.marketCapChangePercentage24H | ||
self.ath = marketData.ath | ||
self.athChangePercentage = marketData.athChangePercentage | ||
self.atl = marketData.atl | ||
self.atlChangePercentage = marketData.atlChangePercentage | ||
} | ||
|
||
public init( | ||
currentPrice: USDDecimalable, | ||
priceChangePercentage24H: Double, | ||
marketCap: USDDecimalable, | ||
marketCapChangePercentage24H: Double, | ||
ath: USDDecimalable, | ||
athChangePercentage: USDDoublable, | ||
atl: USDDecimalable, | ||
atlChangePercentage: USDDoublable | ||
) { | ||
self.currentPrice = currentPrice | ||
self.priceChangePercentage24H = priceChangePercentage24H | ||
self.marketCap = marketCap | ||
self.marketCapChangePercentage24H = marketCapChangePercentage24H | ||
self.ath = ath | ||
self.athChangePercentage = athChangePercentage | ||
self.atl = atl | ||
self.atlChangePercentage = atlChangePercentage | ||
} | ||
|
||
public static func == (lhs: MockMarketData, rhs: MockMarketData) -> Bool { | ||
lhs.currentPrice.usd == rhs.currentPrice.usd && | ||
lhs.priceChangePercentage24H == rhs.priceChangePercentage24H && | ||
lhs.marketCap.usd == rhs.marketCap.usd && | ||
lhs.marketCapChangePercentage24H == rhs.marketCapChangePercentage24H && | ||
lhs.ath.usd == rhs.ath.usd && | ||
lhs.athChangePercentage.usd == rhs.athChangePercentage.usd && | ||
lhs.atl.usd == rhs.atl.usd && | ||
lhs.atlChangePercentage.usd == rhs.atlChangePercentage.usd | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
CryptoPrices/Sources/MyCoin/Sources/MyCoin/ChartSectionView/ChartDataPointUIModel.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// ChartDataPointUIModel.swift | ||
// MyCoin | ||
// | ||
// Created by Minh Pham on 10/01/2023. | ||
// | ||
|
||
import Entities | ||
import Charts | ||
import Foundation | ||
|
||
public struct ChartDataPointUIModel: Equatable { | ||
|
||
public let price: Decimal | ||
public let timestamp: TimeInterval | ||
|
||
public init(dataPoint: ChartDataPoint) { | ||
self.price = dataPoint.price | ||
self.timestamp = dataPoint.timestamp | ||
} | ||
|
||
public func toChartDataEntry() -> ChartDataEntry { | ||
let priceInDouble = NSDecimalNumber(decimal: price).doubleValue | ||
return ChartDataEntry(x: timestamp, y: priceInDouble) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.