Skip to content

Commit

Permalink
fix: api price watcher |2
Browse files Browse the repository at this point in the history
  • Loading branch information
serezhaolshan committed Jul 5, 2024
1 parent 1a145c0 commit ee6e339
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/price-watchers/api-price-watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class ApiPriceWatcher {

private async watchApiPrice() {
const { data: { data: { price_usd: price } } } = await axios.get(tokenPriceUrl);
console.log("setting api price, ", { price });
await this.cacheStorage.set("apiPrice", Number(price));
}
}
5 changes: 3 additions & 2 deletions src/price-watchers/cg-price-watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export class CgPriceWatcher {
}

private async watchCgPrice() {
const { data: price } = await axios.get(cgTokenPriceUrl);
await this.cacheStorage.set("cgPrices", JSON.stringify(price.prices));
const { data: { prices } } = await axios.get(cgTokenPriceUrl);
console.log("Setting Cg Prices", JSON.stringify(prices));
await this.cacheStorage.set("cgPrices", JSON.stringify(prices));
}
}

0 comments on commit ee6e339

Please sign in to comment.