Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use correct currency for Arbitrum and Optimism #643

Merged
merged 1 commit into from
Nov 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions main/externalData/coingecko/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,20 @@ interface Quote {
usd_24h_change: number
}

export type CoinId = string

export interface Coin {
id: string,
id: CoinId,
symbol: string,
name: string,
asset_platform_id: string,
platforms?: {}
}

interface Platform {
id: string,
export type PlatformId = string

export interface Platform {
id: PlatformId,
chain_identifier: string,
name: string,
short_name: string
Expand Down
6 changes: 3 additions & 3 deletions main/externalData/rates/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import BigNumber from 'bignumber.js'
import log from 'electron-log'

import coingecko from '../coingecko'
import coingecko, { CoinId, PlatformId } from '../coingecko'

const FETCH_BATCH_SIZE = 200

Expand All @@ -13,10 +13,10 @@ interface Rate {
}

// { symbol: coinId }
let allCoins: { [key: string]: string }
let allCoins: { [symbol: string]: CoinId }

// { chainId: platformId }
let allPlatforms: { [key: string]: string }
let allPlatforms: { [chainId: string]: PlatformId }

function createRate (quote: any): Rate {
return {
Expand Down
3 changes: 2 additions & 1 deletion main/externalData/staticData/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ async function load (symbols: string[]) {
const allCoins = await coingecko.listCoins()

for (const symbol of symbols) {
const coinData = await loadCoinData(allCoins, symbol)
const lookupSymbol = (symbol === 'aeth' || symbol === 'oeth') ? 'eth' : symbol
const coinData = await loadCoinData(allCoins, lookupSymbol)

data[symbol] = {
icon: coinData.image,
Expand Down