Arbitrum native token should display price history #3294

pull/3296/head
Vladyslav Shepitko 3 years ago
parent a08a9d150a
commit 5b55e01d71
  1. 10
      AlphaWallet/Core/CoinTicker/CoinTickersFetcher.swift

@ -118,7 +118,15 @@ class CoinTickersFetcher: CoinTickersFetcherType {
}.map { _ in } }.map { _ in }
} }
func fetchChartHistories(addressToRPCServerKey: AddressAndRPCServer, force: Bool, periods: [ChartHistoryPeriod]) -> Promise<[ChartHistory]> { func fetchChartHistories(addressToRPCServerKey addressAndPRCServer: AddressAndRPCServer, force: Bool, periods: [ChartHistoryPeriod]) -> Promise<[ChartHistory]> {
let addressToRPCServerKey: AddressAndRPCServer
//NOTE: If it doesn't include the price for the native token, hardwire it to use Ethereum's mainnet's native token price.
if addressAndPRCServer.server == .arbitrum && addressAndPRCServer.address.sameContract(as: Constants.nativeCryptoAddressInDatabase) {
addressToRPCServerKey = .init(address: Constants.nativeCryptoAddressInDatabase, server: .main)
} else {
addressToRPCServerKey = addressAndPRCServer
}
let promises: [Promise<ChartHistory>] = periods.map { let promises: [Promise<ChartHistory>] = periods.map {
fetchChartHistory(force: force, period: $0, for: addressToRPCServerKey) fetchChartHistory(force: force, period: $0, for: addressToRPCServerKey)
} }

Loading…
Cancel
Save