Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
domechn committed Oct 28, 2023
1 parent a271e64 commit b7b82d7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src-tauri/src/price.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ impl CoinGecko {
symbols: Vec<String>,
) -> Result<HashMap<String, f64>, Box<dyn std::error::Error>> {
let all_coins = self.list_all_coin_ids(symbols).await?;
// todo: if there are multi coins with same symbol, we should find by tokenAddress
let all_ids = all_coins.iter().map(|c| &c.id).collect::<Vec<_>>();
let all_prices = self
.client
Expand Down
1 change: 1 addition & 0 deletions src/middlelayers/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type ExportData = {
md5: string
}

// TODO: query by token address not symbol, because there are multiple coins with same symbol
export async function queryCoinPrices(symbols: string[]): Promise<{ [k: string]: number }> {
return await invoke("query_coins_prices", { symbols })
}
Expand Down
1 change: 1 addition & 0 deletions src/middlelayers/datafetch/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export type Coin = {
// used to query price if there are multiple coins with same symbol
tokenAddress?: string
symbol: string
amount: number
Expand Down

0 comments on commit b7b82d7

Please sign in to comment.